From de5262c09e234d33522a3d38072cc4e22209339f Mon Sep 17 00:00:00 2001 From: Sebastien Guillemot Date: Mon, 18 Sep 2023 13:19:55 +0900 Subject: [PATCH 1/4] v1 of reusable build script --- engine/package-lock.json | 6 +++ engine/package.json | 3 ++ engine/paima-mw-core/esbuildconfig.cjs | 26 ++++++++- engine/paima-mw-core/package.json | 6 ++- engine/paima-mw-core/scripts/esbuild.sh | 10 ++++ .../scripts/esbuildconfig.template.cjs | 53 +++++++++++++++++++ .../scripts/prepare_standalone_folders.sh | 1 + 7 files changed, 103 insertions(+), 2 deletions(-) create mode 100755 engine/paima-mw-core/scripts/esbuild.sh create mode 100644 engine/paima-mw-core/scripts/esbuildconfig.template.cjs diff --git a/engine/package-lock.json b/engine/package-lock.json index 718b63df5..15371b2b4 100644 --- a/engine/package-lock.json +++ b/engine/package-lock.json @@ -27,6 +27,9 @@ "pg-tx": "^1.0.1", "web3": "1.10.0" }, + "bin": { + "paima-build-middleware": "node_modules/paima-build-middleware.sh" + }, "devDependencies": { "@types/eslint": "^8.4.10", "@types/node": "^18.11.18", @@ -24605,6 +24608,9 @@ "algosdk": "^2.3.0", "bech32": "^2.0.0" }, + "bin": { + "paima-build-middleware": "scripts/esbuild.sh" + }, "devDependencies": { "dotenv": "^16.0.3", "esbuild": "^0.17.14", diff --git a/engine/package.json b/engine/package.json index 069ea809a..f2bc3cd93 100644 --- a/engine/package.json +++ b/engine/package.json @@ -2,6 +2,9 @@ "name": "@paima/engine", "version": "0.6.0", "private": true, + "bin": { + "paima-build-middleware": "./node_modules/paima-build-middleware.sh" + }, "scripts": { "lint": "npm run prettier && npm run eslint", "cilint": "npm run cprettier && npm run eslint", diff --git a/engine/paima-mw-core/esbuildconfig.cjs b/engine/paima-mw-core/esbuildconfig.cjs index b443839fb..12c792fa7 100644 --- a/engine/paima-mw-core/esbuildconfig.cjs +++ b/engine/paima-mw-core/esbuildconfig.cjs @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/explicit-function-return-type */ /* eslint-disable @typescript-eslint/no-var-requires */ const esbuild = require('esbuild'); const { polyfillNode } = require('esbuild-plugin-polyfill-node'); @@ -9,6 +10,15 @@ for (const variable in process.env) { define[`process.env.${variable}`] = JSON.stringify(process.env[variable]); } +if (process.env.SECURITY_NAMESPACE) { + const namespace = process.env.SECURITY_NAMESPACE; + if (namespace.endsWith('.yml') || namespace.endsWith('.yaml')) { + const fileContent = fs.readFileSync(`../${namespace}`, 'utf-8'); + define[`process.env.SECURITY_NAMESPACE_ROUTER`] = + JSON.stringify(fileContent); + } +} + // Verify env file is filled out if ( !process.env.CONTRACT_ADDRESS || @@ -19,14 +29,28 @@ if ( throw new Error('Please ensure you have filled out your .env file'); } +/** @type esbuild.Plugin */ +const fsaReplace = { + name: 'fsa-replace', + setup(build) { + build.onResolve({ filter: /fsa\.js/ }, (args) => { + const mockFile = args.path.replace('fsa.js', 'fsa_empty.js'); + return { path: `${args.resolveDir}/${mockFile}`, namespace: args.namespace }; + }); + } +}; + const config = { entryPoints: ['build/index.js'], bundle: true, + + // we use iife so that it's easy to import from the index.html for the debug website format: 'iife', globalName: 'middleware', + define, outfile: 'web/middleware.js', - plugins: [polyfillNode({})], + plugins: [polyfillNode({}), fsaReplace], external: ['pg-native'], }; diff --git a/engine/paima-mw-core/package.json b/engine/paima-mw-core/package.json index f52a6e71a..905efd89f 100644 --- a/engine/paima-mw-core/package.json +++ b/engine/paima-mw-core/package.json @@ -6,8 +6,12 @@ "main": "build/index.js", "types": "build/index.d.ts", "files": [ - "/build" + "/build", + "/scripts" ], + "bin": { + "paima-build-middleware": "./scripts/esbuild.sh" + }, "scripts": { "build": "tsc", "test": "echo \"Error: no test specified\" && exit 1", diff --git a/engine/paima-mw-core/scripts/esbuild.sh b/engine/paima-mw-core/scripts/esbuild.sh new file mode 100755 index 000000000..3e4134198 --- /dev/null +++ b/engine/paima-mw-core/scripts/esbuild.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + +echo "Packaging Middleware" + +node --require dotenv/config ./esbuildconfig.cjs +echo "Finished Packaging" + +echo "Vanilla Middleware (With Exports) Prepared In: packaged/middleware.js" + +head -n $(( $(grep -n '^export {' packaged/middleware.js | head -1 | cut -d: -f1) - 1 )) packaged/middleware.js > packaged/paimaMiddleware.js diff --git a/engine/paima-mw-core/scripts/esbuildconfig.template.cjs b/engine/paima-mw-core/scripts/esbuildconfig.template.cjs new file mode 100644 index 000000000..f96a32411 --- /dev/null +++ b/engine/paima-mw-core/scripts/esbuildconfig.template.cjs @@ -0,0 +1,53 @@ +/* eslint-disable @typescript-eslint/explicit-function-return-type */ +/* eslint-disable @typescript-eslint/no-var-requires */ +const { polyfillNode } = require('esbuild-plugin-polyfill-node'); + +const define = { global: 'window' }; +// To replace process.env calls in middleware with variable values during build time +for (const variable in process.env) { + define[`process.env.${variable}`] = JSON.stringify(process.env[variable]); +} + +if (process.env.SECURITY_NAMESPACE) { + const namespace = process.env.SECURITY_NAMESPACE; + if (namespace.endsWith('.yml') || namespace.endsWith('.yaml')) { + const fileContent = fs.readFileSync(`../${namespace}`, 'utf-8'); + define[`process.env.SECURITY_NAMESPACE_ROUTER`] = + JSON.stringify(fileContent); + } +} + +// Verify env file is filled out +if ( + !process.env.CONTRACT_ADDRESS || + !process.env.CHAIN_URI || + !process.env.CHAIN_ID || + !process.env.BACKEND_URI +) + throw new Error('Please ensure you have filled out your .env file'); + +// mock out fs as we can't use it in browser builds +/** @type esbuild.Plugin */ +const fsaReplace = { + name: 'fsa-replace', + setup(build) { + build.onResolve({ filter: /fsa\.js/ }, (args) => { + const mockFile = args.path.replace('fsa.js', 'fsa_empty.js'); + return { path: `${args.resolveDir}/${mockFile}`, namespace: args.namespace }; + }); + } +}; + +const { dtsPlugin } = require('esbuild-plugin-d.ts'); +const config = { + // JS output from previous compilation step used here instead of index.ts to have more control over the TS build process + entryPoints: ['build/index.js'], + bundle: true, + format: 'esm', + define, + outfile: 'packaged/middleware.js', + plugins: [polyfillNode({}), dtsPlugin(), fsaReplace], + external: ['pg-native'], +}; + +module.exports = config; diff --git a/engine/paima-standalone/scripts/prepare_standalone_folders.sh b/engine/paima-standalone/scripts/prepare_standalone_folders.sh index 9235f2f17..ba28dda22 100644 --- a/engine/paima-standalone/scripts/prepare_standalone_folders.sh +++ b/engine/paima-standalone/scripts/prepare_standalone_folders.sh @@ -68,6 +68,7 @@ echo $SDK_PATH/$module mkdir $SDK_PATH/$module mkdir $SDK_PATH/$module/web cp -a $module/build/. $SDK_PATH/$module/build/ +cp -r $module/scripts $SDK_PATH/$module/scripts cp $module/README.md $SDK_PATH/$module/README.md cp $module/package.json $SDK_PATH/$module/package.json cp $module/web/index.html $SDK_PATH/$module/web/index.html From 7a06f3e0633c668ec0b9ee9026531aa6b60decc7 Mon Sep 17 00:00:00 2001 From: Sebastien Guillemot Date: Tue, 19 Sep 2023 02:33:50 +0900 Subject: [PATCH 2/4] Create build-utils workspace --- README.md | 5 +- engine/package-lock.json | 236 +++++------------- engine/package.json | 1 + engine/paima-build-utils/README.md | 5 + engine/paima-build-utils/package.json | 21 ++ .../scripts/esbuild.sh | 0 .../middleware-esbuildconfig.template.cts} | 24 +- .../src/standalone-esbuildconfig.template.cts | 22 ++ engine/paima-build-utils/tsconfig.json | 10 + engine/paima-mw-core/package.json | 6 +- .../scripts/prepare_standalone_folders.sh | 11 +- engine/tsconfig.build.json | 1 + engine/tsconfig.lib.json | 1 + 13 files changed, 153 insertions(+), 190 deletions(-) create mode 100644 engine/paima-build-utils/README.md create mode 100644 engine/paima-build-utils/package.json rename engine/{paima-mw-core => paima-build-utils}/scripts/esbuild.sh (100%) rename engine/{paima-mw-core/scripts/esbuildconfig.template.cjs => paima-build-utils/src/middleware-esbuildconfig.template.cts} (70%) create mode 100644 engine/paima-build-utils/src/standalone-esbuildconfig.template.cts create mode 100644 engine/paima-build-utils/tsconfig.json diff --git a/README.md b/README.md index 29e196697..e5c7d051b 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,13 @@ Of note, `Paima Engine Core` refers to all of the following modules: While `Paima Engine SDK` refers to these modules: - `Paima Executors` (The library which enables building `RoundExecutor`s and `MatchExecutor`s) -- `Paima Tx` (The library which aids in building transactions) +- `Paima Middleware Core` (The library which aids connecting frontends to Paima logic) - `Paima Utils` (The Library which holds auxillary functions between the other modules) +- `Paima Build Utils` (Helps build the Paima components used user projects) - `Paima Prando` (Custom fork of a deterministic pseudo-RNG generator library) - `Paima Concise` (The library which enables building and parsing concise encoding) +- `Paima Crypto` (Has utility functions for all cryptography and blockchains Paima supports) +- `Paima Providers` (Handles connection to wallet standards for all blockchains Paima supports) Then we also have a `Paima Engine Standalone` which is a module that utilizes `Paima Engine Core` to provide easy to use and secure way of creating new games by the public. This is achieved by creating an executable with the bundled core that has two main responsibilities: diff --git a/engine/package-lock.json b/engine/package-lock.json index 15371b2b4..a33945823 100644 --- a/engine/package-lock.json +++ b/engine/package-lock.json @@ -16,6 +16,7 @@ "./paima-prando", "./paima-executors", "./paima-mw-core", + "./paima-build-utils", "./paima-db", "./paima-funnel", "./paima-sm", @@ -1802,7 +1803,7 @@ "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, + "devOptional": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -1814,7 +1815,7 @@ "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, + "devOptional": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -1827,7 +1828,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "android" @@ -1843,7 +1843,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "android" @@ -1859,7 +1858,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "android" @@ -1875,7 +1873,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -1891,7 +1888,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -1907,7 +1903,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "freebsd" @@ -1923,7 +1918,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "freebsd" @@ -1939,7 +1933,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1955,7 +1948,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1971,7 +1963,6 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1987,7 +1978,6 @@ "cpu": [ "loong64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -2003,7 +1993,6 @@ "cpu": [ "mips64el" ], - "dev": true, "optional": true, "os": [ "linux" @@ -2019,7 +2008,6 @@ "cpu": [ "ppc64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -2035,7 +2023,6 @@ "cpu": [ "riscv64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -2051,7 +2038,6 @@ "cpu": [ "s390x" ], - "dev": true, "optional": true, "os": [ "linux" @@ -2067,7 +2053,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -2083,7 +2068,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "netbsd" @@ -2099,7 +2083,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "openbsd" @@ -2115,7 +2098,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "sunos" @@ -2131,7 +2113,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -2147,7 +2128,6 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "win32" @@ -2163,7 +2143,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -3629,8 +3608,7 @@ "node_modules/@jspm/core": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@jspm/core/-/core-2.0.1.tgz", - "integrity": "sha512-Lg3PnLp0QXpxwLIAuuJboLeRaIhrgJjeuh797QADg3xz8wGLugQOS5DpsE8A6i6Adgzf+bacllkKZG3J0tGfDw==", - "dev": true + "integrity": "sha512-Lg3PnLp0QXpxwLIAuuJboLeRaIhrgJjeuh797QADg3xz8wGLugQOS5DpsE8A6i6Adgzf+bacllkKZG3J0tGfDw==" }, "node_modules/@metamask/eth-sig-util": { "version": "4.0.1", @@ -3785,7 +3763,6 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -3798,7 +3775,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, "engines": { "node": ">= 8" } @@ -3807,7 +3783,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -3816,6 +3791,10 @@ "node": ">= 8" } }, + "node_modules/@paima/build-utils": { + "resolved": "paima-build-utils", + "link": true + }, "node_modules/@paima/concise": { "resolved": "paima-concise", "link": true @@ -7055,25 +7034,25 @@ "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "dev": true + "devOptional": true }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true + "devOptional": true }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true + "devOptional": true }, "node_modules/@tsconfig/node16": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true + "devOptional": true }, "node_modules/@typechain/web3-v1": { "version": "6.0.6", @@ -7788,7 +7767,7 @@ "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "dev": true, + "devOptional": true, "bin": { "acorn": "bin/acorn" }, @@ -7809,7 +7788,7 @@ "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.4.0" } @@ -7918,14 +7897,12 @@ "node_modules/any-promise": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", - "dev": true + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -7938,7 +7915,7 @@ "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true + "devOptional": true }, "node_modules/argparse": { "version": "2.0.1", @@ -7964,7 +7941,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, "engines": { "node": ">=8" } @@ -8305,8 +8281,7 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/base-x": { "version": "3.0.9", @@ -8365,7 +8340,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, "engines": { "node": ">=8" } @@ -8465,7 +8439,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -8475,7 +8448,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -8647,7 +8619,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-3.1.2.tgz", "integrity": "sha512-Of6l6JBAxiyQ5axFxUM6dYeP/W7X2Sozeo/4EYB9sJhL+dqL7TKjg+shwxp6jlu/6ZSERfsYtIpSJ1/x3XkAEA==", - "dev": true, "dependencies": { "load-tsconfig": "^0.2.0" }, @@ -8670,7 +8641,6 @@ "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", - "dev": true, "engines": { "node": ">=8" } @@ -8847,7 +8817,6 @@ "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, "funding": [ { "type": "individual", @@ -9096,8 +9065,7 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "node_modules/content-disposition": { "version": "0.5.4", @@ -9216,7 +9184,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true + "devOptional": true }, "node_modules/cross-env": { "version": "7.0.3", @@ -9248,7 +9216,6 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -9455,7 +9422,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.3.1" } @@ -9474,7 +9441,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, "dependencies": { "path-type": "^4.0.0" }, @@ -9658,7 +9624,6 @@ "version": "0.17.19", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", - "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -9698,11 +9663,11 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "android" ], + "peer": true, "engines": { "node": ">=12" } @@ -9714,11 +9679,11 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "android" ], + "peer": true, "engines": { "node": ">=12" } @@ -9730,11 +9695,11 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" ], + "peer": true, "engines": { "node": ">=12" } @@ -9746,11 +9711,11 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "darwin" ], + "peer": true, "engines": { "node": ">=12" } @@ -9762,11 +9727,11 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "freebsd" ], + "peer": true, "engines": { "node": ">=12" } @@ -9778,11 +9743,11 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "freebsd" ], + "peer": true, "engines": { "node": ">=12" } @@ -9794,11 +9759,11 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -9810,11 +9775,11 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -9826,11 +9791,11 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -9842,11 +9807,11 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -9858,11 +9823,11 @@ "cpu": [ "mips64el" ], - "dev": true, "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -9874,11 +9839,11 @@ "cpu": [ "ppc64" ], - "dev": true, "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -9890,11 +9855,11 @@ "cpu": [ "riscv64" ], - "dev": true, "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -9906,11 +9871,11 @@ "cpu": [ "s390x" ], - "dev": true, "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -9922,11 +9887,11 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "netbsd" ], + "peer": true, "engines": { "node": ">=12" } @@ -9938,11 +9903,11 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "openbsd" ], + "peer": true, "engines": { "node": ">=12" } @@ -9951,7 +9916,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/esbuild-plugin-d.ts/-/esbuild-plugin-d.ts-1.1.0.tgz", "integrity": "sha512-3oSR3kUS4fNdKHLYLcST9YOfD2dULe7/UbXnrnu/mRybJYW+jZlYNgklb9Pt7osg6B1qwAYMyr2jTC+Ijj2YbQ==", - "dev": true, "dependencies": { "chalk": "4.x", "jju": "^1.4.0", @@ -9969,7 +9933,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -9984,7 +9947,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -10000,7 +9962,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -10011,14 +9972,12 @@ "node_modules/esbuild-plugin-d.ts/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/esbuild-plugin-d.ts/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, "engines": { "node": ">=8" } @@ -10027,7 +9986,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -10039,7 +9997,6 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/esbuild-plugin-polyfill-node/-/esbuild-plugin-polyfill-node-0.3.0.tgz", "integrity": "sha512-SHG6CKUfWfYyYXGpW143NEZtcVVn8S/WHcEOxk62LuDXnY4Zpmc+WmxJKN6GMTgTClXJXhEM5KQlxKY6YjbucQ==", - "dev": true, "dependencies": { "@jspm/core": "^2.0.1", "import-meta-resolve": "^3.0.0" @@ -10055,11 +10012,11 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "sunos" ], + "peer": true, "engines": { "node": ">=12" } @@ -10071,11 +10028,11 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "win32" ], + "peer": true, "engines": { "node": ">=12" } @@ -10087,11 +10044,11 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" ], + "peer": true, "engines": { "node": ">=12" } @@ -10103,11 +10060,11 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "win32" ], + "peer": true, "engines": { "node": ">=12" } @@ -10911,7 +10868,6 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -11111,7 +11067,6 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -11143,7 +11098,6 @@ "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, "dependencies": { "reusify": "^1.0.4" } @@ -11196,7 +11150,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -11425,14 +11378,12 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -11550,7 +11501,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -11600,7 +11550,6 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -11852,7 +11801,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true, "engines": { "node": ">=10.17.0" } @@ -11918,7 +11866,6 @@ "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, "engines": { "node": ">= 4" } @@ -11968,7 +11915,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-3.0.0.tgz", "integrity": "sha512-4IwhLhNNA8yy445rPjD/lWh++7hMDOml2eHtd58eG7h+qK3EryMuuRbsHGPikCoAgIkkDnckKfWSk2iDla/ejg==", - "dev": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -11987,7 +11933,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -12076,7 +12021,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, "dependencies": { "binary-extensions": "^2.0.0" }, @@ -12110,7 +12054,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -12165,7 +12108,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -12186,7 +12128,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, "engines": { "node": ">=0.12.0" } @@ -12233,8 +12174,7 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/isstream": { "version": "0.1.2", @@ -14170,14 +14110,12 @@ "node_modules/jju": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", - "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==", - "dev": true + "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==" }, "node_modules/joycon": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", - "dev": true, "engines": { "node": ">=10" } @@ -14573,7 +14511,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", - "dev": true, "engines": { "node": ">=10" } @@ -14581,14 +14518,12 @@ "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" }, "node_modules/load-tsconfig": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", - "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } @@ -14639,8 +14574,7 @@ "node_modules/lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", - "dev": true + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==" }, "node_modules/loupe": { "version": "2.3.6", @@ -14739,7 +14673,7 @@ "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true + "devOptional": true }, "node_modules/makeerror": { "version": "1.0.12", @@ -14803,14 +14737,12 @@ "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, "engines": { "node": ">= 8" } @@ -14900,7 +14832,6 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -14943,7 +14874,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, "engines": { "node": ">=6" } @@ -14978,7 +14908,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -15180,7 +15109,6 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dev": true, "dependencies": { "any-promise": "^1.0.0", "object-assign": "^4.0.1", @@ -15354,7 +15282,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -15526,7 +15453,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, "dependencies": { "path-key": "^3.0.0" }, @@ -18545,7 +18471,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, "dependencies": { "mimic-fn": "^2.1.0" }, @@ -18712,7 +18637,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -18721,7 +18645,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "engines": { "node": ">=8" } @@ -18740,7 +18663,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, "engines": { "node": ">=8" } @@ -18935,7 +18857,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "engines": { "node": ">=8.6" }, @@ -18955,7 +18876,6 @@ "version": "4.0.6", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", - "dev": true, "engines": { "node": ">= 6" } @@ -19723,7 +19643,6 @@ "version": "3.1.4", "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-3.1.4.tgz", "integrity": "sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==", - "dev": true, "dependencies": { "lilconfig": "^2.0.5", "yaml": "^1.10.2" @@ -19752,7 +19671,6 @@ "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "dev": true, "engines": { "node": ">= 6" } @@ -20079,7 +19997,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, "funding": [ { "type": "github", @@ -20184,7 +20101,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, "dependencies": { "picomatch": "^2.2.1" }, @@ -20405,7 +20321,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -20415,7 +20330,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, "dependencies": { "glob": "^7.1.3" }, @@ -20430,7 +20344,6 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -20475,7 +20388,6 @@ "version": "2.79.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", - "dev": true, "bin": { "rollup": "dist/bin/rollup" }, @@ -20490,7 +20402,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, "funding": [ { "type": "github", @@ -20694,7 +20605,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -20706,7 +20616,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "engines": { "node": ">=8" } @@ -20727,8 +20636,7 @@ "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "node_modules/simple-concat": { "version": "1.0.1", @@ -20781,7 +20689,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, "engines": { "node": ">=8" } @@ -21044,7 +20951,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, "engines": { "node": ">=6" } @@ -21077,7 +20983,6 @@ "version": "3.34.0", "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.34.0.tgz", "integrity": "sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==", - "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.2", "commander": "^4.0.0", @@ -21099,7 +21004,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", - "dev": true, "engines": { "node": ">= 6" } @@ -21108,7 +21012,6 @@ "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -21419,7 +21322,6 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "dev": true, "dependencies": { "any-promise": "^1.0.0" } @@ -21428,7 +21330,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", - "dev": true, "dependencies": { "thenify": ">= 3.1.0 < 4" }, @@ -21448,7 +21349,6 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dev": true, "dependencies": { "rimraf": "^3.0.0" }, @@ -21475,7 +21375,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -21512,7 +21411,6 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", - "dev": true, "bin": { "tree-kill": "cli.js" } @@ -21614,8 +21512,7 @@ "node_modules/ts-interface-checker": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", - "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", - "dev": true + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" }, "node_modules/ts-jest": { "version": "29.1.1", @@ -21697,7 +21594,7 @@ "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", - "dev": true, + "devOptional": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -21754,7 +21651,6 @@ "version": "5.12.9", "resolved": "https://registry.npmjs.org/tsup/-/tsup-5.12.9.tgz", "integrity": "sha512-dUpuouWZYe40lLufo64qEhDpIDsWhRbr2expv5dHEMjwqeKJS2aXA/FPqs1dxO4T6mBojo7rvo3jP9NNzaKyDg==", - "dev": true, "dependencies": { "bundle-require": "^3.0.2", "cac": "^6.7.12", @@ -21799,11 +21695,11 @@ "cpu": [ "loong64" ], - "dev": true, "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">=12" } @@ -21812,7 +21708,6 @@ "version": "0.14.54", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.54.tgz", "integrity": "sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA==", - "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -21848,7 +21743,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, "engines": { "node": ">=8" } @@ -21857,7 +21751,6 @@ "version": "0.8.0-beta.0", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", - "dev": true, "dependencies": { "whatwg-url": "^7.0.0" }, @@ -21869,7 +21762,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", - "dev": true, "dependencies": { "punycode": "^2.1.0" } @@ -21877,14 +21769,12 @@ "node_modules/tsup/node_modules/webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==" }, "node_modules/tsup/node_modules/whatwg-url": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", - "dev": true, "dependencies": { "lodash.sortby": "^4.7.0", "tr46": "^1.0.1", @@ -22247,7 +22137,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "devOptional": true }, "node_modules/v8-to-istanbul": { "version": "9.1.0", @@ -24226,7 +24116,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -24463,7 +24352,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, + "devOptional": true, "engines": { "node": ">=6" } @@ -24480,6 +24369,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "paima-build-utils": { + "name": "@paima/build-utils", + "version": "1.0.0", + "bin": { + "paima-build-middleware": "scripts/esbuild.sh" + }, + "peerDependencies": { + "esbuild": "^0.17.14", + "esbuild-plugin-d.ts": "^1.1.0", + "esbuild-plugin-polyfill-node": "^0.3.0" + } + }, "paima-concise": { "name": "@paima/concise", "version": "1.0.0", @@ -24608,9 +24509,6 @@ "algosdk": "^2.3.0", "bech32": "^2.0.0" }, - "bin": { - "paima-build-middleware": "scripts/esbuild.sh" - }, "devDependencies": { "dotenv": "^16.0.3", "esbuild": "^0.17.14", diff --git a/engine/package.json b/engine/package.json index f2bc3cd93..eadc67d2a 100644 --- a/engine/package.json +++ b/engine/package.json @@ -29,6 +29,7 @@ "./paima-prando", "./paima-executors", "./paima-mw-core", + "./paima-build-utils", "./paima-db", "./paima-funnel", "./paima-sm", diff --git a/engine/paima-build-utils/README.md b/engine/paima-build-utils/README.md new file mode 100644 index 000000000..524455406 --- /dev/null +++ b/engine/paima-build-utils/README.md @@ -0,0 +1,5 @@ +# Paima build utils + +A common place to store utility scripts to help build Paima projects on various platforms + +We store these in Paima itself instead of inside user codebases, as this is much easier than having to tell all users to have to change their build configuration every time there is a breaking change. diff --git a/engine/paima-build-utils/package.json b/engine/paima-build-utils/package.json new file mode 100644 index 000000000..990d4ab39 --- /dev/null +++ b/engine/paima-build-utils/package.json @@ -0,0 +1,21 @@ +{ + "name": "@paima/build-utils", + "version": "1.0.0", + "description": "Util functions to build Paima projects for various platforms", + "files": [ + "/build", + "/scripts" + ], + "scripts": { + "build": "tsc" + }, + "bin": { + "paima-build-middleware": "./scripts/esbuild.sh" + }, + "author": "Paima Studios", + "peerDependencies": { + "esbuild": "^0.17.14", + "esbuild-plugin-d.ts": "^1.1.0", + "esbuild-plugin-polyfill-node": "^0.3.0" + } +} diff --git a/engine/paima-mw-core/scripts/esbuild.sh b/engine/paima-build-utils/scripts/esbuild.sh similarity index 100% rename from engine/paima-mw-core/scripts/esbuild.sh rename to engine/paima-build-utils/scripts/esbuild.sh diff --git a/engine/paima-mw-core/scripts/esbuildconfig.template.cjs b/engine/paima-build-utils/src/middleware-esbuildconfig.template.cts similarity index 70% rename from engine/paima-mw-core/scripts/esbuildconfig.template.cjs rename to engine/paima-build-utils/src/middleware-esbuildconfig.template.cts index f96a32411..f85eb2623 100644 --- a/engine/paima-mw-core/scripts/esbuildconfig.template.cjs +++ b/engine/paima-build-utils/src/middleware-esbuildconfig.template.cts @@ -1,8 +1,9 @@ -/* eslint-disable @typescript-eslint/explicit-function-return-type */ -/* eslint-disable @typescript-eslint/no-var-requires */ -const { polyfillNode } = require('esbuild-plugin-polyfill-node'); +import { polyfillNode } from 'esbuild-plugin-polyfill-node'; +import type esbuild from 'esbuild'; +import { dtsPlugin } from 'esbuild-plugin-d.ts'; +import fs from 'fs'; -const define = { global: 'window' }; +const define: Record = { global: 'window' as const }; // To replace process.env calls in middleware with variable values during build time for (const variable in process.env) { define[`process.env.${variable}`] = JSON.stringify(process.env[variable]); @@ -12,8 +13,7 @@ if (process.env.SECURITY_NAMESPACE) { const namespace = process.env.SECURITY_NAMESPACE; if (namespace.endsWith('.yml') || namespace.endsWith('.yaml')) { const fileContent = fs.readFileSync(`../${namespace}`, 'utf-8'); - define[`process.env.SECURITY_NAMESPACE_ROUTER`] = - JSON.stringify(fileContent); + define[`process.env.SECURITY_NAMESPACE_ROUTER`] = JSON.stringify(fileContent); } } @@ -27,19 +27,17 @@ if ( throw new Error('Please ensure you have filled out your .env file'); // mock out fs as we can't use it in browser builds -/** @type esbuild.Plugin */ -const fsaReplace = { +const fsaReplace: esbuild.Plugin = { name: 'fsa-replace', setup(build) { - build.onResolve({ filter: /fsa\.js/ }, (args) => { + build.onResolve({ filter: /fsa\.js/ }, args => { const mockFile = args.path.replace('fsa.js', 'fsa_empty.js'); return { path: `${args.resolveDir}/${mockFile}`, namespace: args.namespace }; }); - } + }, }; -const { dtsPlugin } = require('esbuild-plugin-d.ts'); -const config = { +const config: esbuild.BuildOptions = { // JS output from previous compilation step used here instead of index.ts to have more control over the TS build process entryPoints: ['build/index.js'], bundle: true, @@ -50,4 +48,4 @@ const config = { external: ['pg-native'], }; -module.exports = config; +export default config; diff --git a/engine/paima-build-utils/src/standalone-esbuildconfig.template.cts b/engine/paima-build-utils/src/standalone-esbuildconfig.template.cts new file mode 100644 index 000000000..bf241f84f --- /dev/null +++ b/engine/paima-build-utils/src/standalone-esbuildconfig.template.cts @@ -0,0 +1,22 @@ +import fs from 'fs'; +import type esbuild from 'esbuild'; + +export function generateConfig(apiFolder: string, stfFolder: string): esbuild.BuildOptions { + const workspace = process.env.BUNDLE_WORKSPACE; + if (!workspace) throw new Error('BUNDLE_WORKSPACE variable not set.'); + + if (!fs.existsSync(workspace)) throw new Error(`Invalid workspace: ${workspace}.`); + + const outFile = { + [apiFolder]: 'endpoints.cjs', + [stfFolder]: 'gameCode.cjs', + }; + return { + platform: 'node', + entryPoints: [`${workspace}/src/index.ts`], + bundle: true, + format: 'cjs', + outfile: `packaged/${outFile[workspace]}`, + external: ['pg-native'], + }; +} diff --git a/engine/paima-build-utils/tsconfig.json b/engine/paima-build-utils/tsconfig.json new file mode 100644 index 000000000..a52f7e981 --- /dev/null +++ b/engine/paima-build-utils/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "build", + "module": "commonjs", + }, + "include": ["src/**/*"], + "references": [] +} diff --git a/engine/paima-mw-core/package.json b/engine/paima-mw-core/package.json index 905efd89f..f52a6e71a 100644 --- a/engine/paima-mw-core/package.json +++ b/engine/paima-mw-core/package.json @@ -6,12 +6,8 @@ "main": "build/index.js", "types": "build/index.d.ts", "files": [ - "/build", - "/scripts" + "/build" ], - "bin": { - "paima-build-middleware": "./scripts/esbuild.sh" - }, "scripts": { "build": "tsc", "test": "echo \"Error: no test specified\" && exit 1", diff --git a/engine/paima-standalone/scripts/prepare_standalone_folders.sh b/engine/paima-standalone/scripts/prepare_standalone_folders.sh index ba28dda22..26488f0ec 100644 --- a/engine/paima-standalone/scripts/prepare_standalone_folders.sh +++ b/engine/paima-standalone/scripts/prepare_standalone_folders.sh @@ -13,7 +13,7 @@ rm -rf $SDK_PATH mkdir $SDK_PATH npm run build:sdk -# SDK_MODULES=( "paima-concise" "paima-db" "paima-executors" "paima-mw-core" "paima-prando" "paima-utils" "paima-crypto" "paima-providers" ) +# SDK_MODULES=( "paima-concise" "paima-db" "paima-executors" "paima-mw-core" "paima-build-utils" "paima-prando" "paima-utils" "paima-crypto" "paima-providers" ) # Prepare SDK modules module="paima-concise" @@ -68,13 +68,20 @@ echo $SDK_PATH/$module mkdir $SDK_PATH/$module mkdir $SDK_PATH/$module/web cp -a $module/build/. $SDK_PATH/$module/build/ -cp -r $module/scripts $SDK_PATH/$module/scripts cp $module/README.md $SDK_PATH/$module/README.md cp $module/package.json $SDK_PATH/$module/package.json cp $module/web/index.html $SDK_PATH/$module/web/index.html cp -r $module/web/TemplateData $SDK_PATH/$module/web/TemplateData cp $module/esbuildconfig.cjs $SDK_PATH/$module/esbuildconfig.cjs +module="paima-build-utils" +echo $SDK_PATH/$module +mkdir $SDK_PATH/$module +cp -a $module/build/. $SDK_PATH/$module/build/ +cp -a $module/scripts/. $SDK_PATH/$module/scripts/ +cp $module/README.md $SDK_PATH/$module/README.md +cp $module/package.json $SDK_PATH/$module/package.json + module="paima-db" echo $SDK_PATH/$module mkdir $SDK_PATH/$module diff --git a/engine/tsconfig.build.json b/engine/tsconfig.build.json index 8ffe9be41..c81540464 100644 --- a/engine/tsconfig.build.json +++ b/engine/tsconfig.build.json @@ -10,6 +10,7 @@ { "path": "./paima-concise" }, { "path": "./paima-executors" }, { "path": "./paima-mw-core" }, + { "path": "./paima-build-utils" }, { "path": "./paima-runtime" }, { "path": "./paima-funnel" }, { "path": "./paima-sm" }, diff --git a/engine/tsconfig.lib.json b/engine/tsconfig.lib.json index 332c47c91..6f505f6ca 100644 --- a/engine/tsconfig.lib.json +++ b/engine/tsconfig.lib.json @@ -9,6 +9,7 @@ { "path": "./paima-utils-backend" }, { "path": "./paima-concise" }, { "path": "./paima-mw-core" }, + { "path": "./paima-build-utils" }, { "path": "./paima-executors" } ] } From 2d402e17126affc56e14926fa795a3ab4db2e089 Mon Sep 17 00:00:00 2001 From: Sebastien Guillemot Date: Tue, 19 Sep 2023 02:53:21 +0900 Subject: [PATCH 3/4] Simplify config exports --- .../src/middleware-esbuildconfig.template.cts | 4 +--- .../src/standalone-esbuildconfig.template.cts | 21 +++++++++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/engine/paima-build-utils/src/middleware-esbuildconfig.template.cts b/engine/paima-build-utils/src/middleware-esbuildconfig.template.cts index f85eb2623..ba2eeb571 100644 --- a/engine/paima-build-utils/src/middleware-esbuildconfig.template.cts +++ b/engine/paima-build-utils/src/middleware-esbuildconfig.template.cts @@ -37,7 +37,7 @@ const fsaReplace: esbuild.Plugin = { }, }; -const config: esbuild.BuildOptions = { +export const config: esbuild.BuildOptions = { // JS output from previous compilation step used here instead of index.ts to have more control over the TS build process entryPoints: ['build/index.js'], bundle: true, @@ -47,5 +47,3 @@ const config: esbuild.BuildOptions = { plugins: [polyfillNode({}), dtsPlugin(), fsaReplace], external: ['pg-native'], }; - -export default config; diff --git a/engine/paima-build-utils/src/standalone-esbuildconfig.template.cts b/engine/paima-build-utils/src/standalone-esbuildconfig.template.cts index bf241f84f..8c9193464 100644 --- a/engine/paima-build-utils/src/standalone-esbuildconfig.template.cts +++ b/engine/paima-build-utils/src/standalone-esbuildconfig.template.cts @@ -1,22 +1,35 @@ import fs from 'fs'; import type esbuild from 'esbuild'; -export function generateConfig(apiFolder: string, stfFolder: string): esbuild.BuildOptions { +export function generateConfig( + apiFolder: string, + stfFolder: string +): { + config: esbuild.BuildOptions; + outFiles: Record; + workspace: string; +} { const workspace = process.env.BUNDLE_WORKSPACE; if (!workspace) throw new Error('BUNDLE_WORKSPACE variable not set.'); if (!fs.existsSync(workspace)) throw new Error(`Invalid workspace: ${workspace}.`); - const outFile = { + const outFiles = { [apiFolder]: 'endpoints.cjs', [stfFolder]: 'gameCode.cjs', }; - return { + + const config: esbuild.BuildOptions = { platform: 'node', entryPoints: [`${workspace}/src/index.ts`], bundle: true, format: 'cjs', - outfile: `packaged/${outFile[workspace]}`, + outfile: `packaged/${outFiles[workspace]}`, external: ['pg-native'], }; + return { + config, + workspace, + outFiles, + }; } From 4bba49124b4c9728a9466267efc326718a1e5ef1 Mon Sep 17 00:00:00 2001 From: Sebastien Guillemot Date: Tue, 19 Sep 2023 18:14:56 +0900 Subject: [PATCH 4/4] Add missing README entries --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e5c7d051b..c5b1cecaf 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,13 @@ While `Paima Engine SDK` refers to these modules: - `Paima Executors` (The library which enables building `RoundExecutor`s and `MatchExecutor`s) - `Paima Middleware Core` (The library which aids connecting frontends to Paima logic) - `Paima Utils` (The Library which holds auxillary functions between the other modules) +- `Paima Utils Backend` (Utils which are purely for backend (and may not work in a browser environment)) - `Paima Build Utils` (Helps build the Paima components used user projects) - `Paima Prando` (Custom fork of a deterministic pseudo-RNG generator library) - `Paima Concise` (The library which enables building and parsing concise encoding) - `Paima Crypto` (Has utility functions for all cryptography and blockchains Paima supports) - `Paima Providers` (Handles connection to wallet standards for all blockchains Paima supports) +- `Paima DB` (Handles utility functions to handling the Paima database) Then we also have a `Paima Engine Standalone` which is a module that utilizes `Paima Engine Core` to provide easy to use and secure way of creating new games by the public. This is achieved by creating an executable with the bundled core that has two main responsibilities: