diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 67e04df9..2d3c7ce8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,124 +34,49 @@ jobs: build-splicer: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - node-version: - - '22' - - latest steps: - uses: actions/checkout@v4 - - name: Install Rust Toolchain - run: | - rustup toolchain install 1.77.1 - rustup target add wasm32-wasi --toolchain 1.77.1 - rustup target add wasm32-wasip1 - - - uses: actions/setup-node@v4 - with: - node-version: ${{matrix.node-version}} - - - name: Install NPM packages - run: npm install - - name: Cache Splicer build uses: actions/cache@v4 id: splicer-build with: - key: output-splicer-node-${{matrix.node-version}}-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }} + key: splicer-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }} path: | - lib/spidermonkey-embedding-splicer.core2.wasm - lib/spidermonkey-embedding-splicer.core.wasm - lib/spidermonkey-embedding-splicer.d.ts - lib/spidermonkey-embedding-splicer.js + lib target - - name: Build splicer - if: steps.splicer-build.outputs.cache-hit != 'true' - run: | - make lib/spidermonkey-embedding-splicer.js - - build-jit: - runs-on: ubuntu-latest - needs: - - build-splicer - strategy: - fail-fast: false - matrix: - node-version: - - '22' - - latest - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Get StarlingMonkey Commit - id: starlingmonkey-commit - run: echo "STARLINGMONKEY_HASH=$(git submodule status | head -c9 | tail -c8)" >> "$GITHUB_OUTPUT" - - name: Install Rust Toolchain + if: steps.splicer-build.outputs.cache-hit != 'true' run: | rustup toolchain install 1.77.1 rustup target add wasm32-wasi --toolchain 1.77.1 rustup target add wasm32-wasip1 - - name: Restore Embedding Splicer from cache - uses: actions/cache/restore@v4 - id: splicer-build - with: - key: output-splicer-node-${{matrix.node-version}}-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }} - path: | - lib/spidermonkey-embedding-splicer.core2.wasm - lib/spidermonkey-embedding-splicer.core.wasm - lib/spidermonkey-embedding-splicer.d.ts - lib/spidermonkey-embedding-splicer.js - target - - uses: actions/setup-node@v4 + if: steps.splicer-build.outputs.cache-hit != 'true' with: - node-version: ${{matrix.node-version}} + node-version: '22' - name: Install NPM packages + if: steps.splicer-build.outputs.cache-hit != 'true' run: npm install - - name: Cache StarlingMonkey - uses: actions/cache@v4 - id: starlingmonkey-jit - with: - key: output-starlingmonkey-jit-node-${{matrix.node-version}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} - lookup-only: 'true' - path: | - lib/starlingmonkey_embedding.wasm - build-release - - - name: Build ComponentizeJS - if: steps.starlingmonkey-jit.outputs.cache-hit != 'true' - run: | - npm run clean - npm run build - - - uses: actions/upload-artifact@v4 - if: steps.starlingmonkey-jit.outputs.cache-hit != 'true' - with: - name: starlingmonkey-jit-node-${{matrix.node-version}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} - if-no-files-found: 'error' - path: | - lib/starlingmonkey_embedding.wasm - build-release + - name: Build splicer + if: steps.splicer-build.outputs.cache-hit != 'true' + run: make lib/spidermonkey-embedding-splicer.js - build-aot: + build: runs-on: ubuntu-latest needs: - build-splicer strategy: fail-fast: false matrix: - node-version: - - '22' - - latest + build-type: + - 'release' + - 'debug' + - 'weval' steps: - uses: actions/checkout@v4 with: @@ -160,73 +85,66 @@ jobs: - name: Get StarlingMonkey Commit id: starlingmonkey-commit run: echo "STARLINGMONKEY_HASH=$(git submodule status | head -c9 | tail -c8)" >> "$GITHUB_OUTPUT" + + - uses: actions/cache@v4 + id: starlingmonkey-build + with: + key: starlingmonkey-${{matrix.build-type}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} + path: lib - name: Install Rust Toolchain + if: steps.starlingmonkey-build.outputs.cache-hit != 'true' run: | rustup toolchain install 1.77.1 rustup target add wasm32-wasi --toolchain 1.77.1 rustup target add wasm32-wasip1 + - name: Install wasm-tools + if: steps.starlingmonkey-build.outputs.cache-hit != 'true' + run: cargo install wasm-tools + - name: Restore Embedding Splicer from cache uses: actions/cache/restore@v4 id: splicer-build with: - key: output-splicer-node-${{matrix.node-version}}-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }} + key: splicer-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }} path: | - lib/spidermonkey-embedding-splicer.core2.wasm - lib/spidermonkey-embedding-splicer.core.wasm - lib/spidermonkey-embedding-splicer.d.ts - lib/spidermonkey-embedding-splicer.js + lib target - uses: actions/setup-node@v4 + if: steps.starlingmonkey-build.outputs.cache-hit != 'true' with: - node-version: ${{matrix.node-version}} + node-version: '22' - name: Install NPM packages + if: steps.starlingmonkey-build.outputs.cache-hit != 'true' run: npm install - - name: Cache StarlingMonkey (Weval) - uses: actions/cache@v4 - id: starlingmonkey-aot - with: - key: output-starlingmonkey-aot-node-${{matrix.node-version}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} - lookup-only: 'true' - path: | - lib/starlingmonkey_embedding_weval.wasm - lib/starlingmonkey_ics.wevalcache - build-release-weval - - - name: Build Weval - if: steps.starlingmonkey-aot.outputs.cache-hit != 'true' + - name: Build ComponentizeJS + if: steps.starlingmonkey-build.outputs.cache-hit != 'true' run: | npm run clean - npm run build:weval - - - uses: actions/upload-artifact@v4 - if: steps.starlingmonkey-aot.outputs.cache-hit != 'true' - with: - name: starlingmonkey-aot-node-${{matrix.node-version}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} - if-no-files-found: 'error' - path: | - lib/starlingmonkey_embedding_weval.wasm - lib/starlingmonkey_ics.wevalcache - build-release-weval + npm run build:${{matrix.build-type}} ######## # Test # ######## - test-jit: + test: runs-on: ubuntu-latest needs: - - build-jit + - build strategy: fail-fast: false matrix: node-version: - - '22' - - latest + - '22.14.0' + # - latest reenable when https://github.com/nodejs/node/issues/57172 is fixed + build-type: + - 'release' + - 'debug' + - 'weval' steps: - uses: actions/checkout@v4 @@ -234,34 +152,12 @@ jobs: id: starlingmonkey-commit run: echo "STARLINGMONKEY_HASH=$(git submodule status | head -c9 | tail -c8)" >> "$GITHUB_OUTPUT" - - name: Restore Embedding Splicer from cache - uses: actions/cache/restore@v4 - id: splicer-build - with: - key: output-splicer-node-${{matrix.node-version}}-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }} - path: | - lib/spidermonkey-embedding-splicer.core2.wasm - lib/spidermonkey-embedding-splicer.core.wasm - lib/spidermonkey-embedding-splicer.d.ts - lib/spidermonkey-embedding-splicer.js - target - - name: Restore StarlingMonkey build from cache uses: actions/cache/restore@v4 id: restore-starlingmonkey-jit-build with: - key: output-starlingmonkey-jit-node-${{matrix.node-version}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} - path: | - lib/starlingmonkey_embedding.wasm - build-release - - - uses: actions/download-artifact@v4 - if: steps.restore-starlingmonkey-jit-build.outputs.cache-hit != 'true' - with: - name: starlingmonkey-jit-node-${{matrix.node-version}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} - path: | - lib/starlingmonkey_embedding.wasm - build-release + key: starlingmonkey-${{matrix.build-type}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} + path: lib - uses: actions/setup-node@v4 with: @@ -271,30 +167,12 @@ jobs: run: npm install - name: Test - run: npm run test - - - name: Cache Example build - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # 4.1.2 - with: - path: example/target - key: output-example-jit-cargo-${{ hashFiles('example/src/main.rs', 'example/Cargo.lock', 'example/hello.wit') }} + run: npm run test:${{matrix.build-type}} - - name: Test Example - working-directory: examples/hello-world - run: bash test.sh - - test-aot: + test-example: runs-on: ubuntu-latest needs: - - build-aot - strategy: - fail-fast: false - matrix: - node-version: - - '22' - - latest - env: - ENABLE_AOT: "1" + - build steps: - uses: actions/checkout@v4 @@ -302,53 +180,27 @@ jobs: id: starlingmonkey-commit run: echo "STARLINGMONKEY_HASH=$(git submodule status | head -c9 | tail -c8)" >> "$GITHUB_OUTPUT" - - name: Restore Embedding Splicer from cache - uses: actions/cache/restore@v4 - id: splicer-build - with: - key: output-splicer-node-${{matrix.node-version}}-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }} - path: | - lib/spidermonkey-embedding-splicer.core2.wasm - lib/spidermonkey-embedding-splicer.core.wasm - lib/spidermonkey-embedding-splicer.d.ts - lib/spidermonkey-embedding-splicer.js - target - - - name: Restore StarlingMonkey AOT build from cache + - name: Restore StarlingMonkey build from cache uses: actions/cache/restore@v4 - id: restore-starlingmonkey-aot-build - with: - key: output-starlingmonkey-aot-node-${{matrix.node-version}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} - path: | - lib/starlingmonkey_embedding_weval.wasm - lib/starlingmonkey_ics.wevalcache - build-release-weval - - - uses: actions/download-artifact@v4 - if: steps.restore-starlingmonkey-aot-build.outputs.cache-hit != 'true' + id: restore-starlingmonkey-jit-build with: - name: starlingmonkey-aot-node-${{matrix.node-version}}-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} - path: | - lib/starlingmonkey_embedding_weval.wasm - lib/starlingmonkey_ics.wevalcache - build-release-weval + key: starlingmonkey-release-${{ steps.starlingmonkey-commit.outputs.STARLINGMONKEY_HASH }} + path: lib - uses: actions/setup-node@v4 with: - node-version: ${{matrix.node-version}} + node-version: '22' - name: Install NPM packages run: npm install - - name: Test - run: npm run test:weval - - name: Cache Example build uses: actions/cache@v4 with: - path: example/target - key: output-example-aot-cargo-${{ hashFiles('example/src/main.rs', 'example/Cargo.lock', 'example/hello.wit') }} + path: examples/target + key: example-jit-cargo-${{ hashFiles('examples/src/main.rs', 'examples/Cargo.lock', 'examples/hello.wit') }} - name: Test Example - working-directory: examples/hello-world - run: bash test.sh + run: | + cd examples/hello-world + ./test.sh diff --git a/Makefile b/Makefile index 055538a7..8cd0a3d5 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ lib/starlingmonkey_ics.wevalcache: lib/starlingmonkey_embedding_weval.wasm lib/starlingmonkey_embedding.debug.wasm: StarlingMonkey/cmake/* embedding/* StarlingMonkey/runtime/* StarlingMonkey/builtins/* StarlingMonkey/builtins/*/* StarlingMonkey/builtins/*/*/* StarlingMonkey/include/* | lib cmake -B build-debug -DCMAKE_BUILD_TYPE=RelWithDebInfo make -j16 -C build-debug - @cp build-debug/starling-raw.wasm/starling-raw.wasm $@ + wasm-tools strip build-debug/starling-raw.wasm/starling-raw.wasm -d ".debug_(info|loc|ranges|abbrev|line|str)" -o $@ obj: mkdir -p obj diff --git a/README.md b/README.md index 6659b85b..8c932595 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,7 @@ export function componentize(jsSource: string, opts: { witPath: string, worldName: string, debug?: bool, + debugBuild?: bool, sourceName?: string, engine?: string, preview2Adapter?: string, diff --git a/package-lock.json b/package-lock.json index ce5c62ff..8b70522a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@bytecodealliance/preview2-shim": "^0.17.1", - "mocha": "^10.2.0" + "mocha": "^11.1.0" } }, "node_modules/@bytecodealliance/componentize-js": { @@ -229,6 +229,24 @@ "tslib": "^2.4.0" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.8", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", @@ -592,9 +610,9 @@ } }, "node_modules/@napi-rs/wasm-runtime": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.6.tgz", - "integrity": "sha512-z8YVS3XszxFTO73iwvFDNpQIzdMmSDTP/mB3E/ucR37V3Sx57hSExcXyMoNwaucWxnsWf4xfbZv0iZ30jr0M4Q==", + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.7.tgz", + "integrity": "sha512-5yximcFK5FNompXfJFoWanu5l8v1hNGqNHh9du1xETp9HWk/B/PzvchX55WYOPaIeNglG8++68AAiauBAtbnzw==", "license": "MIT", "optional": true, "dependencies": { @@ -603,6 +621,17 @@ "@tybys/wasm-util": "^0.9.0" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@tybys/wasm-util": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.9.0.tgz", @@ -648,16 +677,13 @@ } }, "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" @@ -935,15 +961,18 @@ } }, "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "license": "ISC", "dependencies": { "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/cliui/node_modules/ansi-regex": { @@ -956,6 +985,22 @@ "node": ">=8" } }, + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/cliui/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -991,6 +1036,24 @@ "node": ">=8" } }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1026,6 +1089,21 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "license": "MIT" }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/debug": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", @@ -1163,10 +1241,18 @@ "node": ">=0.3.1" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, "node_modules/emoji-regex": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", - "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, "license": "MIT" }, "node_modules/end-of-stream": { @@ -1265,19 +1351,29 @@ "flat": "cli.js" } }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", "license": "MIT" }, - "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, - "license": "ISC" - }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -1329,21 +1425,21 @@ } }, "node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, - "engines": { - "node": ">=12" + "bin": { + "glob": "dist/esm/bin.mjs" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -1362,6 +1458,22 @@ "node": ">= 6" } }, + "node_modules/glob/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -1408,18 +1520,6 @@ ], "license": "BSD-3-Clause" }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1538,6 +1638,29 @@ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "license": "MIT" }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -1584,6 +1707,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/log-symbols/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -1614,6 +1753,13 @@ "node": ">=8" } }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, "node_modules/make-dir": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", @@ -1660,6 +1806,16 @@ "node": ">=10" } }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/mkdirp": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", @@ -1676,9 +1832,9 @@ } }, "node_modules/mocha": { - "version": "10.8.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", - "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.1.0.tgz", + "integrity": "sha512-8uJR5RTC2NgpY3GrYcgpZrsEd9zKbPDpob1RezyR2upGHRQtHWofmzTMzTMSV6dru3tj5Ukt0+Vnq1qhFEEwAg==", "dev": true, "license": "MIT", "dependencies": { @@ -1689,7 +1845,7 @@ "diff": "^5.2.0", "escape-string-regexp": "^4.0.0", "find-up": "^5.0.0", - "glob": "^8.1.0", + "glob": "^10.4.5", "he": "^1.2.0", "js-yaml": "^4.1.0", "log-symbols": "^4.1.0", @@ -1699,8 +1855,8 @@ "strip-json-comments": "^3.1.1", "supports-color": "^8.1.1", "workerpool": "^6.5.1", - "yargs": "^16.2.0", - "yargs-parser": "^20.2.9", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", "yargs-unparser": "^2.0.0" }, "bin": { @@ -1708,7 +1864,7 @@ "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 14.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/ms": { @@ -1762,9 +1918,9 @@ } }, "node_modules/ora": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-8.1.1.tgz", - "integrity": "sha512-YWielGi1XzG1UTvOaCFaNgEnuhZVMSHYkW/FQ7UX8O26PtlpdM84c0f7wLPlkvx2RfiQmnzd61d/MGxmpQeJPw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-8.2.0.tgz", + "integrity": "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==", "license": "MIT", "dependencies": { "chalk": "^5.3.0", @@ -1784,6 +1940,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/ora/node_modules/emoji-regex": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", + "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "license": "MIT" + }, "node_modules/ora/node_modules/is-unicode-supported": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", @@ -1824,6 +1986,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/ora/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -1856,6 +2035,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -1866,6 +2052,33 @@ "node": ">=8" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -2040,6 +2253,29 @@ "randombytes": "^2.1.0" } }, + "node_modules/shebang-command": { + "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, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", @@ -2099,22 +2335,69 @@ "license": "MIT" }, "node_modules/string-width": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", - "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, "license": "MIT", "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=18" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", @@ -2130,6 +2413,30 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/strip-dirs": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", @@ -2187,9 +2494,9 @@ } }, "node_modules/terser": { - "version": "5.37.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz", - "integrity": "sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==", + "version": "5.39.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.39.0.tgz", + "integrity": "sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw==", "license": "BSD-2-Clause", "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -2258,6 +2565,22 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/workerpool": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", @@ -2266,6 +2589,25 @@ "license": "Apache-2.0" }, "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", @@ -2283,7 +2625,7 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", @@ -2293,14 +2635,30 @@ "node": ">=8" } }, - "node_modules/wrap-ansi/node_modules/emoji-regex": { + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true, "license": "MIT" }, - "node_modules/wrap-ansi/node_modules/string-width": { + "node_modules/wrap-ansi-cjs/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", @@ -2315,7 +2673,7 @@ "node": ">=8" } }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", @@ -2354,32 +2712,32 @@ } }, "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "license": "MIT", "dependencies": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "string-width": "^4.2.0", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "yargs-parser": "^21.1.1" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, "license": "ISC", "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-unparser": { diff --git a/package.json b/package.json index 4635ba8b..a75db7f1 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "devDependencies": { "@bytecodealliance/preview2-shim": "^0.17.1", - "mocha": "^10.2.0" + "mocha": "^11.1.0" }, "dependencies": { "@bytecodealliance/jco": "^1.9.1", @@ -22,17 +22,21 @@ "scripts": { "clean": "npm run clean:starlingmonkey", "clean:starlingmonkey": "rm -rf build-release", - "build": "make release", + "build": "npm run build:release && npm run build:debug && npm run build:weval", + "build:release": "make release", "build:weval": "make release-weval", "build:debug": "make debug", "test": "mocha -u tdd test/test.js --timeout 120000", + "test:release": "mocha -u tdd test/test.js --timeout 120000", "test:weval": "WEVAL_TEST=1 mocha -u tdd test/test.js --timeout 120000", - "prepublishOnly": "npm run build && npm run build:weval" + "test:debug": "DEBUG_TEST=1 mocha -u tdd test/test.js --timeout 120000", + "prepublishOnly": "npm run build" }, "files": [ "lib/interfaces", "lib/spidermonkey-*", "lib/starlingmonkey_embedding.wasm", + "lib/starlingmonkey_embedding.debug.wasm", "lib/starlingmonkey_embedding_weval.wasm", "lib/starlingmonkey_ics.wevalcache", "src", diff --git a/src/componentize.js b/src/componentize.js index bc29860d..5720a78d 100644 --- a/src/componentize.js +++ b/src/componentize.js @@ -24,7 +24,6 @@ export const { version } = JSON.parse( const isWindows = platform === 'win32'; const DEBUG_BINDINGS = false; const DEBUG_CALLS = false; -const DEBUG_BUILD = false; const DEBUG_BINARY = false; function maybeWindowsPath(path) { @@ -46,6 +45,7 @@ export async function componentize(jsSource, witWorld, opts) { worldName, disableFeatures = [], enableFeatures = [], + debugBuild = false, runtimeArgs, aotCache = fileURLToPath( new URL(`../lib/starlingmonkey_ics.wevalcache`, import.meta.url) @@ -59,7 +59,7 @@ export async function componentize(jsSource, witWorld, opts) { opts.enableAot ? `../lib/starlingmonkey_embedding_weval.wasm` : `../lib/starlingmonkey_embedding${ - DEBUG_BUILD ? '.debug' : '' + debugBuild ? '.debug' : '' }.wasm`, import.meta.url ) diff --git a/test/builtins/performance.js b/test/builtins/performance.js index 3399f87b..3f3821da 100644 --- a/test/builtins/performance.js +++ b/test/builtins/performance.js @@ -22,7 +22,7 @@ export async function test(run) { ok(stderr.includes(' ms')); const time = Number(stderr.split(' ms')[0]); // TODO: fix back to half a millisecond when Weval fix is added - if (time > 4) { + if (time > 5) { throw new Error('took more than half a millisecond - ' + time + ' ms'); } } diff --git a/test/test.js b/test/test.js index 65cb6ea5..928b9fdf 100644 --- a/test/test.js +++ b/test/test.js @@ -8,6 +8,9 @@ import { strictEqual } from 'node:assert'; const DEBUG_TRACING = false; const LOG_DEBUGGING = false; +const enableAot = process.env.WEVAL_TEST == '1'; +const debugBuild = process.env.DEBUG_TEST == '1'; + function maybeLogging(disableFeatures) { if (!LOG_DEBUGGING) return disableFeatures; if (disableFeatures && disableFeatures.includes('stdio')) { @@ -18,8 +21,6 @@ function maybeLogging(disableFeatures) { const builtinsCases = await readdir(new URL('./builtins', import.meta.url)); suite('Builtins', () => { - const enableAot = process.env.WEVAL_TEST == '1' - for (const filename of builtinsCases) { const name = filename.slice(0, -3); test(name, async () => { @@ -27,7 +28,7 @@ suite('Builtins', () => { source, test: runTest, disableFeatures, - enableFeatures + enableFeatures, } = await import(`./builtins/${filename}`); const { component } = await componentize( @@ -40,13 +41,19 @@ suite('Builtins', () => { `, { sourceName: `${name}.js`, + // also test the debug build while we are about it (unless testing Weval) + debugBuild, enableFeatures, disableFeatures: maybeLogging(disableFeatures), - enableAot + enableAot, } ); - const { files } = await transpile(component, { name, wasiShim: true, tracing: DEBUG_TRACING }); + const { files } = await transpile(component, { + name, + wasiShim: true, + tracing: DEBUG_TRACING, + }); await mkdir(new URL(`./output/${name}/interfaces`, import.meta.url), { recursive: true, @@ -99,23 +106,26 @@ suite('Builtins', () => { code === 0 ? resolve() : reject(new Error(stderr || stdout)) ); timeout = setTimeout(() => { - reject(new Error("test timed out with output:\n" + stdout + '\n\nstderr:\n' + stderr)); + reject( + new Error( + 'test timed out with output:\n' + + stdout + + '\n\nstderr:\n' + + stderr + ) + ); }, 10_000); }); - } - catch (err) { + } catch (err) { throw { err, stdout, stderr }; - } - finally { + } finally { clearTimeout(timeout); } return { stdout, stderr }; }); - } - catch (err) { - if (err.stderr) - console.error(err.stderr); + } catch (err) { + if (err.stderr) console.error(err.stderr); throw err.err || err; } }); @@ -124,8 +134,6 @@ suite('Builtins', () => { const bindingsCases = await readdir(new URL('./cases', import.meta.url)); suite('Bindings', () => { - const enableAot = process.env.WEVAL_TEST == '1' - for (const name of bindingsCases) { test(name, async () => { const source = await readFile( @@ -133,7 +141,10 @@ suite('Bindings', () => { 'utf8' ); - let witWorld, witPath, worldName, isWasiTarget = false; + let witWorld, + witPath, + worldName, + isWasiTarget = false; try { witWorld = await readFile( new URL(`./cases/${name}/world.wit`, import.meta.url), @@ -163,7 +174,9 @@ suite('Bindings', () => { const test = await import(`./cases/${name}/test.js`); const enableFeatures = test.enableFeatures || ['http']; - const disableFeatures = test.disableFeatures || (isWasiTarget ? [] : ['random', 'clocks', 'http', 'stdio']); + const disableFeatures = + test.disableFeatures || + (isWasiTarget ? [] : ['random', 'clocks', 'http', 'stdio']); let testArg; try { @@ -174,7 +187,8 @@ suite('Bindings', () => { worldName, enableFeatures, disableFeatures: maybeLogging(disableFeatures), - enableAot + enableAot, + debugBuild, }); const map = { 'wasi:cli-base/*': '@bytecodealliance/preview2-shim/cli-base#*', @@ -189,19 +203,22 @@ suite('Bindings', () => { }; for (let [impt] of imports) { if (impt.startsWith('wasi:')) continue; - if (impt.startsWith('[')) - impt = impt.slice(impt.indexOf(']') + 1); + if (impt.startsWith('[')) impt = impt.slice(impt.indexOf(']') + 1); let importName = impt.split('/').pop(); if (importName === 'test') importName = 'imports'; map[impt] = `../../cases/${name}/${importName}.js`; } - const { files, imports: componentImports, exports: componentExports } = await transpile(component, { + const { + files, + imports: componentImports, + exports: componentExports, + } = await transpile(component, { name, map, wasiShim: true, validLiftingOptimization: false, - tracing: DEBUG_TRACING + tracing: DEBUG_TRACING, }); testArg = { imports, componentImports, componentExports }; @@ -238,8 +255,6 @@ suite('Bindings', () => { suite('WASI', () => { test('basic app', async () => { - const enableAot = process.env.WEVAL_TEST == '1' - const { component } = await componentize( ` import { now } from 'wasi:clocks/wall-clock@0.2.3'; @@ -257,7 +272,8 @@ suite('WASI', () => { { witPath: fileURLToPath(new URL('./wit', import.meta.url)), worldName: 'test1', - enableAot + enableAot, + debugBuild, } ); diff --git a/types.d.ts b/types.d.ts index 2d2d9201..5c42607f 100644 --- a/types.d.ts +++ b/types.d.ts @@ -1,4 +1,10 @@ interface ComponentizeOptions { + /** + * Use a debug build + * Note that the debug build only includes the names section only for size optimization, and not DWARF + * debugging sections, due to a lack of support in Node.js for these debugging workflows currently. + */ + debugBuild?: boolean, /** * Source name for debugging */