From 235f6da2fd4f7354fa4765fde4aea880d2a4aef5 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 7 Sep 2024 16:15:42 -0400 Subject: [PATCH] quickjs for quickjs (#137) * improve error unwrapping fidelity * add purejs variant * call it asmjs * regen * add test * yarn lock * regen doc * bring over bun example * implement enough fs stuff to get example to run * quickjs-for-quickjs * progress * fix package name * regen * d.mts * prettier * changelog * maybe we messed up stack size? * fix stack size * turn off ttylog * lint * update changelog * bump version * upgrade emscripten * regen makefile --- CHANGELOG.md | 6 + README.md | 2 + c/interface.c | 2 + .../quickjs-asmjs-mjs-release-sync/README.md | 89 ++++ .../quickjs-asmjs-mjs-release-sync/exports.md | 40 ++ doc/README.md | 2 + doc/packages.md | 1 + doc/quickjs-emscripten-core/README.md | 14 + .../classes/DisposableFail.md | 18 +- .../classes/DisposableSuccess.md | 20 +- .../classes/Lifetime.md | 95 +++- .../classes/QuickJSAsyncContext.md | 8 +- .../classes/QuickJSContext.md | 8 +- doc/quickjs-emscripten-core/classes/Scope.md | 12 +- .../classes/StaticLifetime.md | 117 ++++- .../classes/WeakLifetime.md | 113 ++++- doc/quickjs-emscripten-core/exports.md | 12 +- .../errors/classes/QuickJSAsyncifyError.md | 2 +- .../classes/QuickJSAsyncifySuspended.md | 2 +- .../QuickJSEmptyGetOwnPropertyNames.md | 2 +- .../classes/QuickJSEmscriptenModuleError.md | 2 +- .../classes/QuickJSMemoryLeakDetected.md | 2 +- .../errors/classes/QuickJSNotImplemented.md | 2 +- .../errors/classes/QuickJSPromisePending.md | 2 +- .../errors/classes/QuickJSUnknownIntrinsic.md | 2 +- .../errors/classes/QuickJSUseAfterFree.md | 2 +- .../errors/classes/QuickJSWrongOwner.md | 2 +- doc/quickjs-emscripten/README.md | 2 + .../classes/DisposableFail.md | 18 +- .../classes/DisposableSuccess.md | 20 +- doc/quickjs-emscripten/classes/Lifetime.md | 95 +++- .../classes/QuickJSAsyncContext.md | 8 +- .../classes/QuickJSContext.md | 8 +- doc/quickjs-emscripten/classes/Scope.md | 12 +- .../classes/StaticLifetime.md | 117 ++++- .../classes/WeakLifetime.md | 113 ++++- doc/quickjs-emscripten/exports.md | 12 +- .../errors/classes/QuickJSAsyncifyError.md | 2 +- .../classes/QuickJSAsyncifySuspended.md | 2 +- .../QuickJSEmptyGetOwnPropertyNames.md | 2 +- .../classes/QuickJSEmscriptenModuleError.md | 2 +- .../classes/QuickJSMemoryLeakDetected.md | 2 +- .../errors/classes/QuickJSNotImplemented.md | 2 +- .../errors/classes/QuickJSPromisePending.md | 2 +- .../errors/classes/QuickJSUnknownIntrinsic.md | 2 +- .../errors/classes/QuickJSUseAfterFree.md | 2 +- .../errors/classes/QuickJSWrongOwner.md | 2 +- examples/bun-typescript/.gitignore | 2 + examples/bun-typescript/.npmrc | 2 + examples/bun-typescript/bun.lockb | Bin 0 -> 1350 bytes examples/bun-typescript/index.ts | 10 + examples/bun-typescript/package-lock.json | 96 ++++ examples/bun-typescript/package.json | 18 + examples/bun-typescript/tsconfig.json | 10 + package.json | 4 +- packages/internal-tsconfig/package.json | 2 +- packages/internal-tsconfig/tsconfig.json | 2 +- .../internal-tsconfig/tsup.base.config.ts | 5 +- packages/quickjs-emscripten-core/README.md | 13 + packages/quickjs-emscripten-core/package.json | 2 +- .../quickjs-emscripten-core/src/context.ts | 19 +- .../quickjs-emscripten-core/src/errors.ts | 6 +- packages/quickjs-emscripten-core/src/index.ts | 8 +- .../quickjs-emscripten-core/src/lifetime.ts | 25 ++ .../quickjs-emscripten-core/src/runtime.ts | 10 +- packages/quickjs-emscripten/package.json | 4 +- .../src/quickjs-in-quickjs-node-test.mts | 162 +++++++ packages/quickjs-ffi-types/package.json | 2 +- packages/quickjs-for-quickjs/LICENSE | 21 + packages/quickjs-for-quickjs/README.md | 70 +++ .../quickjs-for-quickjs/example/node-host.mjs | 51 +++ .../example/quickjs-host.mjs | 49 ++ packages/quickjs-for-quickjs/package.json | 40 ++ packages/quickjs-for-quickjs/src/index.mts | 52 +++ packages/quickjs-for-quickjs/tsconfig.json | 7 + packages/quickjs-for-quickjs/tsup.config.ts | 10 + packages/quickjs-for-quickjs/yodawg.jpg | Bin 0 -> 58744 bytes .../LICENSE | 47 ++ .../Makefile | 172 +++++++ .../README.md | 72 +++ .../package.json | 48 ++ .../src/ffi.ts | 419 ++++++++++++++++++ .../src/index.ts | 24 + .../tsconfig.json | 1 + .../tsup.config.ts | 7 + .../typedoc.json | 1 + .../Makefile | 5 +- .../package.json | 2 +- .../tsup.config.ts | 3 +- .../Makefile | 5 +- .../package.json | 2 +- .../tsup.config.ts | 3 +- .../Makefile | 5 +- .../package.json | 2 +- .../tsup.config.ts | 3 +- .../Makefile | 5 +- .../package.json | 2 +- .../tsup.config.ts | 3 +- .../Makefile | 5 +- .../package.json | 7 +- .../tsup.config.ts | 5 +- .../Makefile | 5 +- .../package.json | 7 +- .../tsup.config.ts | 5 +- .../Makefile | 5 +- .../package.json | 7 +- .../tsup.config.ts | 5 +- .../Makefile | 5 +- .../package.json | 7 +- .../tsup.config.ts | 5 +- .../Makefile | 5 +- .../package.json | 2 +- .../tsup.config.ts | 5 +- .../Makefile | 5 +- .../package.json | 2 +- .../tsup.config.ts | 5 +- .../Makefile | 5 +- .../package.json | 2 +- .../tsup.config.ts | 5 +- .../Makefile | 5 +- .../package.json | 2 +- .../tsup.config.ts | 5 +- .../Makefile | 5 +- .../package.json | 7 +- .../tsup.config.ts | 5 +- .../Makefile | 5 +- .../package.json | 7 +- .../tsup.config.ts | 5 +- .../Makefile | 5 +- .../package.json | 7 +- .../tsup.config.ts | 5 +- .../Makefile | 5 +- .../package.json | 7 +- .../tsup.config.ts | 5 +- .../Makefile | 5 +- .../package.json | 2 +- .../tsup.config.ts | 3 +- .../Makefile | 5 +- .../package.json | 2 +- .../tsup.config.ts | 3 +- .../Makefile | 5 +- .../package.json | 2 +- .../tsup.config.ts | 3 +- .../Makefile | 5 +- .../package.json | 2 +- .../tsup.config.ts | 3 +- scripts/prepareVariants.ts | 121 +++-- templates/Variant.mk | 5 +- variants.json | 148 ++++--- yarn.lock | 18 + 150 files changed, 2682 insertions(+), 371 deletions(-) create mode 100644 doc/@jitl/quickjs-asmjs-mjs-release-sync/README.md create mode 100644 doc/@jitl/quickjs-asmjs-mjs-release-sync/exports.md create mode 100644 examples/bun-typescript/.gitignore create mode 100644 examples/bun-typescript/.npmrc create mode 100755 examples/bun-typescript/bun.lockb create mode 100644 examples/bun-typescript/index.ts create mode 100644 examples/bun-typescript/package-lock.json create mode 100644 examples/bun-typescript/package.json create mode 100644 examples/bun-typescript/tsconfig.json create mode 100644 packages/quickjs-emscripten/src/quickjs-in-quickjs-node-test.mts create mode 100644 packages/quickjs-for-quickjs/LICENSE create mode 100644 packages/quickjs-for-quickjs/README.md create mode 100644 packages/quickjs-for-quickjs/example/node-host.mjs create mode 100644 packages/quickjs-for-quickjs/example/quickjs-host.mjs create mode 100644 packages/quickjs-for-quickjs/package.json create mode 100644 packages/quickjs-for-quickjs/src/index.mts create mode 100644 packages/quickjs-for-quickjs/tsconfig.json create mode 100644 packages/quickjs-for-quickjs/tsup.config.ts create mode 100644 packages/quickjs-for-quickjs/yodawg.jpg create mode 100644 packages/variant-quickjs-asmjs-mjs-release-sync/LICENSE create mode 100644 packages/variant-quickjs-asmjs-mjs-release-sync/Makefile create mode 100644 packages/variant-quickjs-asmjs-mjs-release-sync/README.md create mode 100644 packages/variant-quickjs-asmjs-mjs-release-sync/package.json create mode 100644 packages/variant-quickjs-asmjs-mjs-release-sync/src/ffi.ts create mode 100644 packages/variant-quickjs-asmjs-mjs-release-sync/src/index.ts create mode 100644 packages/variant-quickjs-asmjs-mjs-release-sync/tsconfig.json create mode 100644 packages/variant-quickjs-asmjs-mjs-release-sync/tsup.config.ts create mode 100644 packages/variant-quickjs-asmjs-mjs-release-sync/typedoc.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fad84e5..d268c48e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v0.31.0 + +- [#137](https://github.com/justjake/quickjs-emscripten/pull/137) + - Add `quickjs-for-quickjs`, a package that can run inside quickjs, so you can put quickjs inside your quickjs. + - **Possibly breaking**: Fix a build system bug that made commonjs or esm variants include both types, thus being larger than they needed to be. After upgrading a variant to this release, you should verify that it can be imported/required as expected. You may need to add additional variants if you were using an "esm" variant from both cjs and esm. + ## v0.30.0 - [#200](https://github.com/justjake/quickjs-emscripten/pull/200) Inspect and iterate handles, equality, changes to result types, changes to debug logging. diff --git a/README.md b/README.md index de4c113d..67dc356b 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ compiled to WebAssembly. - Create and manipulate values inside the QuickJS runtime ([more][values]). - Expose host functions to the QuickJS runtime ([more][functions]). - Execute synchronous code that uses asynchronous functions, with [asyncify][asyncify]. +- Supports browsers, NodeJS, Deno, Bun, Cloudflare Workers, QuickJS (via [quickjs-for-quickjs][]). [Github] | [NPM] | [API Documentation][api] | [Variants][core] | [Examples][tests] @@ -43,6 +44,7 @@ main() [values]: #interfacing-with-the-interpreter [asyncify]: #asyncify [functions]: #exposing-apis +[quickjs-for-quickjs]: https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-for-quickjs - [quickjs-emscripten](#quickjs-emscripten) - [Usage](#usage) diff --git a/c/interface.c b/c/interface.c index 48cedffd..39eb0c6b 100644 --- a/c/interface.c +++ b/c/interface.c @@ -728,6 +728,8 @@ MaybeAsync(JSBorrowedChar *) QTS_Dump(JSContext *ctx, JSValueConst *obj) { copy_prop_if_needed(ctx, enumerable_props, *obj, "name"); copy_prop_if_needed(ctx, enumerable_props, *obj, "message"); copy_prop_if_needed(ctx, enumerable_props, *obj, "stack"); + copy_prop_if_needed(ctx, enumerable_props, *obj, "fileName"); + copy_prop_if_needed(ctx, enumerable_props, *obj, "lineNumber"); // Serialize again. JSValue enumerable_json = JS_JSONStringify(ctx, enumerable_props, JS_UNDEFINED, JS_UNDEFINED); diff --git a/doc/@jitl/quickjs-asmjs-mjs-release-sync/README.md b/doc/@jitl/quickjs-asmjs-mjs-release-sync/README.md new file mode 100644 index 00000000..d87401a9 --- /dev/null +++ b/doc/@jitl/quickjs-asmjs-mjs-release-sync/README.md @@ -0,0 +1,89 @@ +[quickjs-emscripten](../../packages.md) • **@jitl/quickjs-asmjs-mjs-release-sync** • [Readme](README.md) \| [Exports](exports.md) + +*** + +# @jitl/quickjs-asmjs-mjs-release-sync + +Compiled to pure Javascript, no WebAssembly required. + +This generated package is part of [quickjs-emscripten](https://github.com/justjake/quickjs-emscripten). +It contains a variant of the quickjs WASM library, and can be used with quickjs-emscripten-core. + +```typescript +import variant from "@jitl/quickjs-asmjs-mjs-release-sync" +import { newQuickJSWASMModuleFromVariant } from "quickjs-emscripten-core" +const QuickJS = await newQuickJSWASMModuleFromVariant(variant) +``` + +This variant was built with the following settings: + +## Contents + +- [Library: quickjs](README.md#library-quickjs) +- [Release mode: release](README.md#release-mode-release) +- [Exports: import](README.md#exports-import) +- [Extra async magic? No](README.md#extra-async-magic-no) +- [Single-file, or separate .wasm file? asmjs](README.md#single-file-or-separate-wasm-file-asmjs) +- [More details](README.md#more-details) + +## Library: quickjs + +The original [bellard/quickjs](https://github.com/bellard/quickjs) library. + +Version [2024-02-14+36911f0d](https://github.com/bellard/quickjs/commit/36911f0d3ab1a4c190a4d5cbe7c2db225a455389) vendored to quickjs-emscripten on 2024-06-15. + +## Release mode: release + +Optimized for performance; use when building/deploying your application. + +## Exports: import + +Exports the following in package.json for the package entrypoint: + +- Exports a NodeJS-compatible ESModule. Cannot be imported synchronously from a NodeJS CommonJS module. + +## Extra async magic? No + +The default, normal build. Note that both variants support regular async functions. + +## Single-file, or separate .wasm file? asmjs + +The C library code is compiled to Javascript, no WebAssembly used. Sometimes called "asmjs". This is the slowest possible option, and is intended for constrained environments that do not support WebAssembly, like quickjs-for-quickjs. + +## More details + +Full variant JSON description: + +```json +{ + "library": "quickjs", + "releaseMode": "release", + "syncMode": "sync", + "description": "Compiled to pure Javascript, no WebAssembly required.", + "emscriptenInclusion": "asmjs", + "exports": { + "import": { + "emscriptenEnvironment": ["web", "worker", "node"] + } + } +} +``` + +Variant-specific Emscripten build flags: + +```json +[ + "-Oz", + "-flto", + "--closure 1", + "-s FILESYSTEM=0", + "--pre-js $(TEMPLATES)/pre-extension.js", + "--pre-js $(TEMPLATES)/pre-wasmMemory.js", + "-s WASM=0", + "-s SINGLE_FILE=1" +] +``` + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/doc/@jitl/quickjs-asmjs-mjs-release-sync/exports.md b/doc/@jitl/quickjs-asmjs-mjs-release-sync/exports.md new file mode 100644 index 00000000..e215c9c1 --- /dev/null +++ b/doc/@jitl/quickjs-asmjs-mjs-release-sync/exports.md @@ -0,0 +1,40 @@ +[quickjs-emscripten](../../packages.md) • **@jitl/quickjs-asmjs-mjs-release-sync** • [Readme](README.md) \| [Exports](exports.md) + +*** + +[quickjs-emscripten](../../packages.md) / @jitl/quickjs-asmjs-mjs-release-sync + +# @jitl/quickjs-asmjs-mjs-release-sync + +## Contents + +- [Variables](exports.md#variables) + - [default](exports.md#default) + - [@jitl/quickjs-asmjs-mjs-release-sync](exports.md#jitlquickjs-asmjs-mjs-release-sync) + +## Variables + +### default + +> **`const`** **default**: [`QuickJSSyncVariant`](../../quickjs-emscripten/interfaces/QuickJSSyncVariant.md) + +### @jitl/quickjs-asmjs-mjs-release-sync + +[Docs](https://github.com/justjake/quickjs-emscripten/blob/main/doc/@jitl/quickjs-asmjs-mjs-release-sync/README.md) | +Compiled to pure Javascript, no WebAssembly required. + +| Variable | Setting | Description | +| -- | -- | -- | +| library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. Version [2024-02-14+36911f0d](https://github.com/bellard/quickjs/commit/36911f0d3ab1a4c190a4d5cbe7c2db225a455389) vendored to quickjs-emscripten on 2024-06-15. | +| releaseMode | release | Optimized for performance; use when building/deploying your application. | +| syncMode | sync | The default, normal build. Note that both variants support regular async functions. | +| emscriptenInclusion | asmjs | The C library code is compiled to Javascript, no WebAssembly used. Sometimes called "asmjs". This is the slowest possible option, and is intended for constrained environments that do not support WebAssembly, like quickjs-for-quickjs. | +| exports | import | Has these package.json export conditions | + +#### Source + +[index.ts:19](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-asmjs-mjs-release-sync/src/index.ts#L19) + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/doc/README.md b/doc/README.md index 95a382a3..02aca07c 100644 --- a/doc/README.md +++ b/doc/README.md @@ -11,6 +11,7 @@ compiled to WebAssembly. - Create and manipulate values inside the QuickJS runtime ([more][values]). - Expose host functions to the QuickJS runtime ([more][functions]). - Execute synchronous code that uses asynchronous functions, with [asyncify][asyncify]. +- Supports browsers, NodeJS, Deno, Bun, Cloudflare Workers, QuickJS (via [quickjs-for-quickjs][]). [Github] | [NPM] | [API Documentation][api] | [Variants][core] | [Examples][tests] @@ -47,6 +48,7 @@ main() [values]: #interfacing-with-the-interpreter [asyncify]: #asyncify [functions]: #exposing-apis +[quickjs-for-quickjs]: https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-for-quickjs - [quickjs-emscripten](#quickjs-emscripten) - [Usage](#usage) diff --git a/doc/packages.md b/doc/packages.md index b22125ad..69e42148 100644 --- a/doc/packages.md +++ b/doc/packages.md @@ -29,6 +29,7 @@ - [@jitl/quickjs-singlefile-browser-debug-asyncify](@jitl/quickjs-singlefile-browser-debug-asyncify/README.md) - [@jitl/quickjs-singlefile-browser-release-sync](@jitl/quickjs-singlefile-browser-release-sync/README.md) - [@jitl/quickjs-singlefile-browser-release-asyncify](@jitl/quickjs-singlefile-browser-release-asyncify/README.md) +- [@jitl/quickjs-asmjs-mjs-release-sync](@jitl/quickjs-asmjs-mjs-release-sync/README.md) *** diff --git a/doc/quickjs-emscripten-core/README.md b/doc/quickjs-emscripten-core/README.md index c9946214..ba1cb0c9 100644 --- a/doc/quickjs-emscripten-core/README.md +++ b/doc/quickjs-emscripten-core/README.md @@ -48,6 +48,7 @@ const QuickJS = await newQuickJSWASMModuleFromVariant(releaseVariant) - [@jitl/quickjs-singlefile-browser-debug-asyncify](README.md#jitlquickjs-singlefile-browser-debug-asyncify) - [@jitl/quickjs-singlefile-browser-release-sync](README.md#jitlquickjs-singlefile-browser-release-sync) - [@jitl/quickjs-singlefile-browser-release-asyncify](README.md#jitlquickjs-singlefile-browser-release-asyncify) + - [@jitl/quickjs-asmjs-mjs-release-sync](README.md#jitlquickjs-asmjs-mjs-release-sync) ## What's a variant? @@ -357,6 +358,19 @@ Variant with the WASM data embedded into a browser ESModule. | emscriptenInclusion | singlefile | The WASM runtime is included directly in the JS file. Use if you run into issues with missing .wasm files when building or deploying your app. | | exports | browser | Has these package.json export conditions | +### @jitl/quickjs-asmjs-mjs-release-sync + +[Docs](https://github.com/justjake/quickjs-emscripten/blob/main/doc/@jitl/quickjs-asmjs-mjs-release-sync/README.md) | +Compiled to pure Javascript, no WebAssembly required. + +| Variable | Setting | Description | +| ------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. Version [2024-02-14+36911f0d](https://github.com/bellard/quickjs/commit/36911f0d3ab1a4c190a4d5cbe7c2db225a455389) vendored to quickjs-emscripten on 2024-06-15. | +| releaseMode | release | Optimized for performance; use when building/deploying your application. | +| syncMode | sync | The default, normal build. Note that both variants support regular async functions. | +| emscriptenInclusion | asmjs | The C library code is compiled to Javascript, no WebAssembly used. Sometimes called "asmjs". This is the slowest possible option, and is intended for constrained environments that do not support WebAssembly, like quickjs-for-quickjs. | +| exports | import | Has these package.json export conditions | + *** Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/doc/quickjs-emscripten-core/classes/DisposableFail.md b/doc/quickjs-emscripten-core/classes/DisposableFail.md index 3a615c2c..b1cef224 100644 --- a/doc/quickjs-emscripten-core/classes/DisposableFail.md +++ b/doc/quickjs-emscripten-core/classes/DisposableFail.md @@ -55,7 +55,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L426) +[packages/quickjs-emscripten-core/src/lifetime.ts:451](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L451) ## Properties @@ -65,7 +65,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:427](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L427) +[packages/quickjs-emscripten-core/src/lifetime.ts:452](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L452) ## Accessors @@ -79,7 +79,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:433](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L433) +[packages/quickjs-emscripten-core/src/lifetime.ts:458](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L458) ## Methods @@ -117,7 +117,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:437](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L437) +[packages/quickjs-emscripten-core/src/lifetime.ts:462](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L462) *** @@ -131,7 +131,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:443](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L443) +[packages/quickjs-emscripten-core/src/lifetime.ts:468](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L468) *** @@ -153,7 +153,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:448](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L448) +[packages/quickjs-emscripten-core/src/lifetime.ts:473](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L473) *** @@ -183,7 +183,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L384) +[packages/quickjs-emscripten-core/src/lifetime.ts:409](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L409) *** @@ -211,7 +211,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:391](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L391) +[packages/quickjs-emscripten-core/src/lifetime.ts:416](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L416) *** @@ -239,7 +239,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:380](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L380) +[packages/quickjs-emscripten-core/src/lifetime.ts:405](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L405) *** diff --git a/doc/quickjs-emscripten-core/classes/DisposableSuccess.md b/doc/quickjs-emscripten-core/classes/DisposableSuccess.md index ff6d43a1..70b6aaeb 100644 --- a/doc/quickjs-emscripten-core/classes/DisposableSuccess.md +++ b/doc/quickjs-emscripten-core/classes/DisposableSuccess.md @@ -54,7 +54,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:402](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L402) +[packages/quickjs-emscripten-core/src/lifetime.ts:427](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L427) ## Properties @@ -64,7 +64,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:400](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L400) +[packages/quickjs-emscripten-core/src/lifetime.ts:425](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L425) *** @@ -74,7 +74,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:402](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L402) +[packages/quickjs-emscripten-core/src/lifetime.ts:427](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L427) ## Accessors @@ -88,7 +88,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L406) +[packages/quickjs-emscripten-core/src/lifetime.ts:431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L431) ## Methods @@ -126,7 +126,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:410](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L410) +[packages/quickjs-emscripten-core/src/lifetime.ts:435](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L435) *** @@ -140,7 +140,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:416](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L416) +[packages/quickjs-emscripten-core/src/lifetime.ts:441](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L441) *** @@ -162,7 +162,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:420](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L420) +[packages/quickjs-emscripten-core/src/lifetime.ts:445](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L445) *** @@ -192,7 +192,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L384) +[packages/quickjs-emscripten-core/src/lifetime.ts:409](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L409) *** @@ -220,7 +220,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:391](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L391) +[packages/quickjs-emscripten-core/src/lifetime.ts:416](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L416) *** @@ -248,7 +248,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:380](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L380) +[packages/quickjs-emscripten-core/src/lifetime.ts:405](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L405) *** diff --git a/doc/quickjs-emscripten-core/classes/Lifetime.md b/doc/quickjs-emscripten-core/classes/Lifetime.md index e7143477..c88e8f5a 100644 --- a/doc/quickjs-emscripten-core/classes/Lifetime.md +++ b/doc/quickjs-emscripten-core/classes/Lifetime.md @@ -35,6 +35,8 @@ Typically, quickjs-emscripten uses Lifetimes to protect C memory pointers. - [consume()](Lifetime.md#consume) - [dispose()](Lifetime.md#dispose) - [dup()](Lifetime.md#dup) + - [map()](Lifetime.md#map) + - [tap()](Lifetime.md#tap) ## Extends @@ -324,7 +326,7 @@ Dispose of [value](Lifetime.md#value-1) and perform cleanup. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L149) +[packages/quickjs-emscripten-core/src/lifetime.ts:174](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L174) *** @@ -344,4 +346,95 @@ Create a new handle pointing to the same [value](Lifetime.md#value-1). *** +### map() + +#### map(map) + +> **map**\<`O`\>(`map`): `O` + +Call `map` with this lifetime, returning the result. +Does not dispose the lifetime. + +##### Type parameters + +• **O** + +##### Parameters + +• **map**: (`lifetime`) => `O` + +##### Returns + +`O` + +the result of `map(this)`. + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:151](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L151) + +#### map(map) + +> **map**\<`O`\>(`map`): `O` + +##### Type parameters + +• **O** + +##### Parameters + +• **map**: (`lifetime`) => `O` + +##### Returns + +`O` + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:152](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L152) + +*** + +### tap() + +#### tap(fn) + +> **tap**(`fn`): [`Lifetime`](Lifetime.md)\<`T`, `TCopy`, `Owner`\> + +Call `fn` with this lifetime, then return `this`. Does not dispose the +lifetime. Useful for imperative operations within an expression, like when +you're building up objects, or to add logging in the middle of a call chain. + +##### Parameters + +• **fn**: (`lifetime`) => `void` + +##### Returns + +[`Lifetime`](Lifetime.md)\<`T`, `TCopy`, `Owner`\> + +this + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L164) + +#### tap(fn) + +> **tap**(`fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +##### Parameters + +• **fn**: (`lifetime`) => `void` + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L165) + +*** + Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md b/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md index 345518a8..754d4bc9 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md @@ -389,7 +389,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1422](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1422) +[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) *** @@ -505,7 +505,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1405](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1405) +[packages/quickjs-emscripten-core/src/context.ts:1414](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1414) *** @@ -643,7 +643,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Source -[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) +[packages/quickjs-emscripten-core/src/context.ts:1440](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1440) *** @@ -1611,7 +1611,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1427](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1427) +[packages/quickjs-emscripten-core/src/context.ts:1436](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1436) *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSContext.md b/doc/quickjs-emscripten-core/classes/QuickJSContext.md index 65647992..bf3f1ad7 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSContext.md @@ -409,7 +409,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1422](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1422) +[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) *** @@ -521,7 +521,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1405](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1405) +[packages/quickjs-emscripten-core/src/context.ts:1414](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1414) *** @@ -625,7 +625,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) +[packages/quickjs-emscripten-core/src/context.ts:1440](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1440) *** @@ -1469,7 +1469,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1427](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1427) +[packages/quickjs-emscripten-core/src/context.ts:1436](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1436) *** diff --git a/doc/quickjs-emscripten-core/classes/Scope.md b/doc/quickjs-emscripten-core/classes/Scope.md index 682fafd8..34f5312a 100644 --- a/doc/quickjs-emscripten-core/classes/Scope.md +++ b/doc/quickjs-emscripten-core/classes/Scope.md @@ -63,7 +63,7 @@ false after the object has been [dispose](Scope.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:308](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L308) +[packages/quickjs-emscripten-core/src/lifetime.ts:333](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L333) ## Methods @@ -111,7 +111,7 @@ Dispose of the underlying resources used by this object. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:312](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L312) +[packages/quickjs-emscripten-core/src/lifetime.ts:337](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L337) *** @@ -135,7 +135,7 @@ Track `lifetime` so that it is disposed when this scope is disposed. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:303](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L303) +[packages/quickjs-emscripten-core/src/lifetime.ts:328](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L328) *** @@ -165,7 +165,7 @@ Do not use with async functions. Instead, use [withScopeAsync](Scope.md#withscop #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:248](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L248) +[packages/quickjs-emscripten-core/src/lifetime.ts:273](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L273) *** @@ -192,7 +192,7 @@ block returns. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:285](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L285) +[packages/quickjs-emscripten-core/src/lifetime.ts:310](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L310) *** @@ -220,7 +220,7 @@ block returns. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:261](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L261) +[packages/quickjs-emscripten-core/src/lifetime.ts:286](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L286) *** diff --git a/doc/quickjs-emscripten-core/classes/StaticLifetime.md b/doc/quickjs-emscripten-core/classes/StaticLifetime.md index 6b93e251..97d17214 100644 --- a/doc/quickjs-emscripten-core/classes/StaticLifetime.md +++ b/doc/quickjs-emscripten-core/classes/StaticLifetime.md @@ -31,6 +31,8 @@ A Lifetime that lives forever. Used for constants. - [consume()](StaticLifetime.md#consume) - [dispose()](StaticLifetime.md#dispose) - [dup()](StaticLifetime.md#dup) + - [map()](StaticLifetime.md#map) + - [tap()](StaticLifetime.md#tap) ## Extends @@ -64,7 +66,7 @@ A Lifetime that lives forever. Used for constants. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:173](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L173) +[packages/quickjs-emscripten-core/src/lifetime.ts:198](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L198) ## Properties @@ -196,7 +198,7 @@ false after the object has been [dispose](StaticLifetime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:178](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L178) +[packages/quickjs-emscripten-core/src/lifetime.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L203) *** @@ -327,7 +329,7 @@ Dispose of [value](StaticLifetime.md#value-1) and perform cleanup. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:188](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L188) +[packages/quickjs-emscripten-core/src/lifetime.ts:213](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L213) *** @@ -347,7 +349,114 @@ Create a new handle pointing to the same [value](StaticLifetime.md#value-1). #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:183](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L183) +[packages/quickjs-emscripten-core/src/lifetime.ts:208](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L208) + +*** + +### map() + +#### map(map) + +> **map**\<`O`\>(`map`): `O` + +Call `map` with this lifetime, returning the result. +Does not dispose the lifetime. + +##### Type parameters + +• **O** + +##### Parameters + +• **map**: (`lifetime`) => `O` + +##### Returns + +`O` + +the result of `map(this)`. + +##### Inherited from + +[`quickjs-emscripten-core.Lifetime.map`](Lifetime.md#map) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:151](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L151) + +#### map(map) + +> **map**\<`O`\>(`map`): `O` + +##### Type parameters + +• **O** + +##### Parameters + +• **map**: (`lifetime`) => `O` + +##### Returns + +`O` + +##### Inherited from + +[`quickjs-emscripten-core.Lifetime.map`](Lifetime.md#map) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:152](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L152) + +*** + +### tap() + +#### tap(fn) + +> **tap**(`fn`): [`StaticLifetime`](StaticLifetime.md)\<`T`, `Owner`\> + +Call `fn` with this lifetime, then return `this`. Does not dispose the +lifetime. Useful for imperative operations within an expression, like when +you're building up objects, or to add logging in the middle of a call chain. + +##### Parameters + +• **fn**: (`lifetime`) => `void` + +##### Returns + +[`StaticLifetime`](StaticLifetime.md)\<`T`, `Owner`\> + +this + +##### Inherited from + +[`quickjs-emscripten-core.Lifetime.tap`](Lifetime.md#tap) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L164) + +#### tap(fn) + +> **tap**(`fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +##### Parameters + +• **fn**: (`lifetime`) => `void` + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Inherited from + +[`quickjs-emscripten-core.Lifetime.tap`](Lifetime.md#tap) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L165) *** diff --git a/doc/quickjs-emscripten-core/classes/WeakLifetime.md b/doc/quickjs-emscripten-core/classes/WeakLifetime.md index c3e9d495..089cf48f 100644 --- a/doc/quickjs-emscripten-core/classes/WeakLifetime.md +++ b/doc/quickjs-emscripten-core/classes/WeakLifetime.md @@ -35,6 +35,8 @@ Used for function arguments. - [consume()](WeakLifetime.md#consume) - [dispose()](WeakLifetime.md#dispose) - [dup()](WeakLifetime.md#dup) + - [map()](WeakLifetime.md#map) + - [tap()](WeakLifetime.md#tap) ## Extends @@ -74,7 +76,7 @@ Used for function arguments. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:199](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L199) +[packages/quickjs-emscripten-core/src/lifetime.ts:224](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L224) ## Properties @@ -337,7 +339,7 @@ Dispose of [value](WeakLifetime.md#value-1) and perform cleanup. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:209](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L209) +[packages/quickjs-emscripten-core/src/lifetime.ts:234](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L234) *** @@ -361,4 +363,111 @@ Create a new handle pointing to the same [value](WeakLifetime.md#value-1). *** +### map() + +#### map(map) + +> **map**\<`O`\>(`map`): `O` + +Call `map` with this lifetime, returning the result. +Does not dispose the lifetime. + +##### Type parameters + +• **O** + +##### Parameters + +• **map**: (`lifetime`) => `O` + +##### Returns + +`O` + +the result of `map(this)`. + +##### Inherited from + +[`quickjs-emscripten-core.Lifetime.map`](Lifetime.md#map) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:151](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L151) + +#### map(map) + +> **map**\<`O`\>(`map`): `O` + +##### Type parameters + +• **O** + +##### Parameters + +• **map**: (`lifetime`) => `O` + +##### Returns + +`O` + +##### Inherited from + +[`quickjs-emscripten-core.Lifetime.map`](Lifetime.md#map) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:152](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L152) + +*** + +### tap() + +#### tap(fn) + +> **tap**(`fn`): [`WeakLifetime`](WeakLifetime.md)\<`T`, `TCopy`, `Owner`\> + +Call `fn` with this lifetime, then return `this`. Does not dispose the +lifetime. Useful for imperative operations within an expression, like when +you're building up objects, or to add logging in the middle of a call chain. + +##### Parameters + +• **fn**: (`lifetime`) => `void` + +##### Returns + +[`WeakLifetime`](WeakLifetime.md)\<`T`, `TCopy`, `Owner`\> + +this + +##### Inherited from + +[`quickjs-emscripten-core.Lifetime.tap`](Lifetime.md#tap) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L164) + +#### tap(fn) + +> **tap**(`fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +##### Parameters + +• **fn**: (`lifetime`) => `void` + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Inherited from + +[`quickjs-emscripten-core.Lifetime.tap`](Lifetime.md#tap) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L165) + +*** + Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/doc/quickjs-emscripten-core/exports.md b/doc/quickjs-emscripten-core/exports.md index c0da3274..51df2323 100644 --- a/doc/quickjs-emscripten-core/exports.md +++ b/doc/quickjs-emscripten-core/exports.md @@ -179,7 +179,7 @@ An `Array` that also implements [Disposable](interfaces/Disposable.md): #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:329](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L329) +[packages/quickjs-emscripten-core/src/lifetime.ts:354](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L354) *** @@ -195,7 +195,7 @@ An `Array` that also implements [Disposable](interfaces/Disposable.md): #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:453](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L453) +[packages/quickjs-emscripten-core/src/lifetime.ts:478](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L478) *** @@ -237,7 +237,7 @@ by the runtime. ### InterruptHandler -> **InterruptHandler**: (`runtime`) => `boolean` \| `undefined` +> **InterruptHandler**: (`runtime`) => `boolean` \| `undefined` \| `void` Callback called regularly while the VM executes code. Determines if a VM's execution should be interrupted. @@ -248,7 +248,7 @@ Determines if a VM's execution should be interrupted. #### Returns -`boolean` \| `undefined` +`boolean` \| `undefined` \| `void` `true` to interrupt JS execution inside the VM. @@ -905,7 +905,7 @@ The default [Intrinsics](exports.md#intrinsics) language features enabled in a Q #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:453](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L453) +[packages/quickjs-emscripten-core/src/lifetime.ts:478](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L478) *** @@ -1198,7 +1198,7 @@ Create an array that also implements [Disposable](interfaces/Disposable.md). #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:334](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L334) +[packages/quickjs-emscripten-core/src/lifetime.ts:359](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L359) *** diff --git a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSAsyncifyError.md b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSAsyncifyError.md index f8b54767..f54e832f 100644 --- a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSAsyncifyError.md +++ b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSAsyncifyError.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:29](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L29) +[packages/quickjs-emscripten-core/src/errors.ts:33](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L33) *** diff --git a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSAsyncifySuspended.md b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSAsyncifySuspended.md index c2dcd778..05168843 100644 --- a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSAsyncifySuspended.md +++ b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSAsyncifySuspended.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:33](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L33) +[packages/quickjs-emscripten-core/src/errors.ts:37](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L37) *** diff --git a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSEmptyGetOwnPropertyNames.md b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSEmptyGetOwnPropertyNames.md index 3a6e4a62..38907f4d 100644 --- a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSEmptyGetOwnPropertyNames.md +++ b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSEmptyGetOwnPropertyNames.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L53) +[packages/quickjs-emscripten-core/src/errors.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L57) *** diff --git a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSEmscriptenModuleError.md b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSEmscriptenModuleError.md index 0d707d15..6de3198c 100644 --- a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSEmscriptenModuleError.md +++ b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSEmscriptenModuleError.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L41) +[packages/quickjs-emscripten-core/src/errors.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L45) *** diff --git a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSMemoryLeakDetected.md b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSMemoryLeakDetected.md index 1c04616d..85c5385a 100644 --- a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSMemoryLeakDetected.md +++ b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSMemoryLeakDetected.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:37](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L37) +[packages/quickjs-emscripten-core/src/errors.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L41) *** diff --git a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSNotImplemented.md b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSNotImplemented.md index 5584d60a..ab28b86a 100644 --- a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSNotImplemented.md +++ b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSNotImplemented.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:25](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L25) +[packages/quickjs-emscripten-core/src/errors.ts:29](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L29) *** diff --git a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSPromisePending.md b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSPromisePending.md index 507d45e6..48153e06 100644 --- a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSPromisePending.md +++ b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSPromisePending.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L49) +[packages/quickjs-emscripten-core/src/errors.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L53) *** diff --git a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSUnknownIntrinsic.md b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSUnknownIntrinsic.md index 92d051fc..6cd58c47 100644 --- a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSUnknownIntrinsic.md +++ b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSUnknownIntrinsic.md @@ -73,7 +73,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L45) +[packages/quickjs-emscripten-core/src/errors.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L49) *** diff --git a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSUseAfterFree.md b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSUseAfterFree.md index aada20cf..5b9a0df9 100644 --- a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSUseAfterFree.md +++ b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSUseAfterFree.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:21](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L21) +[packages/quickjs-emscripten-core/src/errors.ts:25](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L25) *** diff --git a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSWrongOwner.md b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSWrongOwner.md index 42411823..17405113 100644 --- a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSWrongOwner.md +++ b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSWrongOwner.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L17) +[packages/quickjs-emscripten-core/src/errors.ts:21](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L21) *** diff --git a/doc/quickjs-emscripten/README.md b/doc/quickjs-emscripten/README.md index 025b8e45..56d90b3d 100644 --- a/doc/quickjs-emscripten/README.md +++ b/doc/quickjs-emscripten/README.md @@ -11,6 +11,7 @@ compiled to WebAssembly. - Create and manipulate values inside the QuickJS runtime ([more][values]). - Expose host functions to the QuickJS runtime ([more][functions]). - Execute synchronous code that uses asynchronous functions, with [asyncify][asyncify]. +- Supports browsers, NodeJS, Deno, Bun, Cloudflare Workers, QuickJS (via [quickjs-for-quickjs][]). [Github] | [NPM] | [API Documentation][api] | [Variants][core] | [Examples][tests] @@ -47,6 +48,7 @@ main() [values]: #interfacing-with-the-interpreter [asyncify]: #asyncify [functions]: #exposing-apis +[quickjs-for-quickjs]: https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-for-quickjs - [quickjs-emscripten](#quickjs-emscripten) - [Usage](#usage) diff --git a/doc/quickjs-emscripten/classes/DisposableFail.md b/doc/quickjs-emscripten/classes/DisposableFail.md index e10ede00..af081e63 100644 --- a/doc/quickjs-emscripten/classes/DisposableFail.md +++ b/doc/quickjs-emscripten/classes/DisposableFail.md @@ -55,7 +55,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L426) +[packages/quickjs-emscripten-core/src/lifetime.ts:451](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L451) ## Properties @@ -65,7 +65,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:427](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L427) +[packages/quickjs-emscripten-core/src/lifetime.ts:452](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L452) ## Accessors @@ -79,7 +79,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:433](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L433) +[packages/quickjs-emscripten-core/src/lifetime.ts:458](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L458) ## Methods @@ -117,7 +117,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:437](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L437) +[packages/quickjs-emscripten-core/src/lifetime.ts:462](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L462) *** @@ -131,7 +131,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:443](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L443) +[packages/quickjs-emscripten-core/src/lifetime.ts:468](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L468) *** @@ -153,7 +153,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:448](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L448) +[packages/quickjs-emscripten-core/src/lifetime.ts:473](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L473) *** @@ -183,7 +183,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L384) +[packages/quickjs-emscripten-core/src/lifetime.ts:409](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L409) *** @@ -211,7 +211,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:391](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L391) +[packages/quickjs-emscripten-core/src/lifetime.ts:416](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L416) *** @@ -239,7 +239,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:380](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L380) +[packages/quickjs-emscripten-core/src/lifetime.ts:405](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L405) *** diff --git a/doc/quickjs-emscripten/classes/DisposableSuccess.md b/doc/quickjs-emscripten/classes/DisposableSuccess.md index fad44ca8..c4dce084 100644 --- a/doc/quickjs-emscripten/classes/DisposableSuccess.md +++ b/doc/quickjs-emscripten/classes/DisposableSuccess.md @@ -54,7 +54,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:402](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L402) +[packages/quickjs-emscripten-core/src/lifetime.ts:427](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L427) ## Properties @@ -64,7 +64,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:400](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L400) +[packages/quickjs-emscripten-core/src/lifetime.ts:425](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L425) *** @@ -74,7 +74,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:402](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L402) +[packages/quickjs-emscripten-core/src/lifetime.ts:427](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L427) ## Accessors @@ -88,7 +88,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L406) +[packages/quickjs-emscripten-core/src/lifetime.ts:431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L431) ## Methods @@ -126,7 +126,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:410](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L410) +[packages/quickjs-emscripten-core/src/lifetime.ts:435](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L435) *** @@ -140,7 +140,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:416](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L416) +[packages/quickjs-emscripten-core/src/lifetime.ts:441](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L441) *** @@ -162,7 +162,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:420](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L420) +[packages/quickjs-emscripten-core/src/lifetime.ts:445](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L445) *** @@ -192,7 +192,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L384) +[packages/quickjs-emscripten-core/src/lifetime.ts:409](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L409) *** @@ -220,7 +220,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:391](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L391) +[packages/quickjs-emscripten-core/src/lifetime.ts:416](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L416) *** @@ -248,7 +248,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:380](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L380) +[packages/quickjs-emscripten-core/src/lifetime.ts:405](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L405) *** diff --git a/doc/quickjs-emscripten/classes/Lifetime.md b/doc/quickjs-emscripten/classes/Lifetime.md index 3fbcd4b1..62ec48a9 100644 --- a/doc/quickjs-emscripten/classes/Lifetime.md +++ b/doc/quickjs-emscripten/classes/Lifetime.md @@ -35,6 +35,8 @@ Typically, quickjs-emscripten uses Lifetimes to protect C memory pointers. - [consume()](Lifetime.md#consume) - [dispose()](Lifetime.md#dispose) - [dup()](Lifetime.md#dup) + - [map()](Lifetime.md#map) + - [tap()](Lifetime.md#tap) ## Extends @@ -324,7 +326,7 @@ Dispose of [value](Lifetime.md#value-1) and perform cleanup. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L149) +[packages/quickjs-emscripten-core/src/lifetime.ts:174](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L174) *** @@ -344,4 +346,95 @@ Create a new handle pointing to the same [value](Lifetime.md#value-1). *** +### map() + +#### map(map) + +> **map**\<`O`\>(`map`): `O` + +Call `map` with this lifetime, returning the result. +Does not dispose the lifetime. + +##### Type parameters + +• **O** + +##### Parameters + +• **map**: (`lifetime`) => `O` + +##### Returns + +`O` + +the result of `map(this)`. + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:151](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L151) + +#### map(map) + +> **map**\<`O`\>(`map`): `O` + +##### Type parameters + +• **O** + +##### Parameters + +• **map**: (`lifetime`) => `O` + +##### Returns + +`O` + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:152](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L152) + +*** + +### tap() + +#### tap(fn) + +> **tap**(`fn`): [`Lifetime`](Lifetime.md)\<`T`, `TCopy`, `Owner`\> + +Call `fn` with this lifetime, then return `this`. Does not dispose the +lifetime. Useful for imperative operations within an expression, like when +you're building up objects, or to add logging in the middle of a call chain. + +##### Parameters + +• **fn**: (`lifetime`) => `void` + +##### Returns + +[`Lifetime`](Lifetime.md)\<`T`, `TCopy`, `Owner`\> + +this + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L164) + +#### tap(fn) + +> **tap**(`fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +##### Parameters + +• **fn**: (`lifetime`) => `void` + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L165) + +*** + Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md b/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md index f312c8cf..d5fdcc5b 100644 --- a/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md @@ -389,7 +389,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1422](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1422) +[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) *** @@ -505,7 +505,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1405](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1405) +[packages/quickjs-emscripten-core/src/context.ts:1414](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1414) *** @@ -643,7 +643,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Source -[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) +[packages/quickjs-emscripten-core/src/context.ts:1440](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1440) *** @@ -1611,7 +1611,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1427](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1427) +[packages/quickjs-emscripten-core/src/context.ts:1436](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1436) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSContext.md b/doc/quickjs-emscripten/classes/QuickJSContext.md index 11d282b2..00d400b9 100644 --- a/doc/quickjs-emscripten/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSContext.md @@ -409,7 +409,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1422](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1422) +[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) *** @@ -521,7 +521,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1405](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1405) +[packages/quickjs-emscripten-core/src/context.ts:1414](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1414) *** @@ -625,7 +625,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) +[packages/quickjs-emscripten-core/src/context.ts:1440](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1440) *** @@ -1469,7 +1469,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1427](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1427) +[packages/quickjs-emscripten-core/src/context.ts:1436](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1436) *** diff --git a/doc/quickjs-emscripten/classes/Scope.md b/doc/quickjs-emscripten/classes/Scope.md index 038058ef..b231f37f 100644 --- a/doc/quickjs-emscripten/classes/Scope.md +++ b/doc/quickjs-emscripten/classes/Scope.md @@ -63,7 +63,7 @@ false after the object has been [dispose](Scope.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:308](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L308) +[packages/quickjs-emscripten-core/src/lifetime.ts:333](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L333) ## Methods @@ -111,7 +111,7 @@ Dispose of the underlying resources used by this object. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:312](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L312) +[packages/quickjs-emscripten-core/src/lifetime.ts:337](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L337) *** @@ -135,7 +135,7 @@ Track `lifetime` so that it is disposed when this scope is disposed. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:303](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L303) +[packages/quickjs-emscripten-core/src/lifetime.ts:328](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L328) *** @@ -165,7 +165,7 @@ Do not use with async functions. Instead, use [withScopeAsync](Scope.md#withscop #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:248](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L248) +[packages/quickjs-emscripten-core/src/lifetime.ts:273](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L273) *** @@ -192,7 +192,7 @@ block returns. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:285](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L285) +[packages/quickjs-emscripten-core/src/lifetime.ts:310](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L310) *** @@ -220,7 +220,7 @@ block returns. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:261](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L261) +[packages/quickjs-emscripten-core/src/lifetime.ts:286](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L286) *** diff --git a/doc/quickjs-emscripten/classes/StaticLifetime.md b/doc/quickjs-emscripten/classes/StaticLifetime.md index 43563372..d8ce4a69 100644 --- a/doc/quickjs-emscripten/classes/StaticLifetime.md +++ b/doc/quickjs-emscripten/classes/StaticLifetime.md @@ -31,6 +31,8 @@ A Lifetime that lives forever. Used for constants. - [consume()](StaticLifetime.md#consume) - [dispose()](StaticLifetime.md#dispose) - [dup()](StaticLifetime.md#dup) + - [map()](StaticLifetime.md#map) + - [tap()](StaticLifetime.md#tap) ## Extends @@ -64,7 +66,7 @@ A Lifetime that lives forever. Used for constants. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:173](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L173) +[packages/quickjs-emscripten-core/src/lifetime.ts:198](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L198) ## Properties @@ -196,7 +198,7 @@ false after the object has been [dispose](StaticLifetime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:178](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L178) +[packages/quickjs-emscripten-core/src/lifetime.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L203) *** @@ -327,7 +329,7 @@ Dispose of [value](StaticLifetime.md#value-1) and perform cleanup. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:188](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L188) +[packages/quickjs-emscripten-core/src/lifetime.ts:213](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L213) *** @@ -347,7 +349,114 @@ Create a new handle pointing to the same [value](StaticLifetime.md#value-1). #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:183](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L183) +[packages/quickjs-emscripten-core/src/lifetime.ts:208](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L208) + +*** + +### map() + +#### map(map) + +> **map**\<`O`\>(`map`): `O` + +Call `map` with this lifetime, returning the result. +Does not dispose the lifetime. + +##### Type parameters + +• **O** + +##### Parameters + +• **map**: (`lifetime`) => `O` + +##### Returns + +`O` + +the result of `map(this)`. + +##### Inherited from + +[`quickjs-emscripten.Lifetime.map`](Lifetime.md#map) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:151](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L151) + +#### map(map) + +> **map**\<`O`\>(`map`): `O` + +##### Type parameters + +• **O** + +##### Parameters + +• **map**: (`lifetime`) => `O` + +##### Returns + +`O` + +##### Inherited from + +[`quickjs-emscripten.Lifetime.map`](Lifetime.md#map) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:152](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L152) + +*** + +### tap() + +#### tap(fn) + +> **tap**(`fn`): [`StaticLifetime`](StaticLifetime.md)\<`T`, `Owner`\> + +Call `fn` with this lifetime, then return `this`. Does not dispose the +lifetime. Useful for imperative operations within an expression, like when +you're building up objects, or to add logging in the middle of a call chain. + +##### Parameters + +• **fn**: (`lifetime`) => `void` + +##### Returns + +[`StaticLifetime`](StaticLifetime.md)\<`T`, `Owner`\> + +this + +##### Inherited from + +[`quickjs-emscripten.Lifetime.tap`](Lifetime.md#tap) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L164) + +#### tap(fn) + +> **tap**(`fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +##### Parameters + +• **fn**: (`lifetime`) => `void` + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Inherited from + +[`quickjs-emscripten.Lifetime.tap`](Lifetime.md#tap) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L165) *** diff --git a/doc/quickjs-emscripten/classes/WeakLifetime.md b/doc/quickjs-emscripten/classes/WeakLifetime.md index 41173dc4..eedbf4cd 100644 --- a/doc/quickjs-emscripten/classes/WeakLifetime.md +++ b/doc/quickjs-emscripten/classes/WeakLifetime.md @@ -35,6 +35,8 @@ Used for function arguments. - [consume()](WeakLifetime.md#consume) - [dispose()](WeakLifetime.md#dispose) - [dup()](WeakLifetime.md#dup) + - [map()](WeakLifetime.md#map) + - [tap()](WeakLifetime.md#tap) ## Extends @@ -74,7 +76,7 @@ Used for function arguments. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:199](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L199) +[packages/quickjs-emscripten-core/src/lifetime.ts:224](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L224) ## Properties @@ -337,7 +339,7 @@ Dispose of [value](WeakLifetime.md#value-1) and perform cleanup. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:209](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L209) +[packages/quickjs-emscripten-core/src/lifetime.ts:234](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L234) *** @@ -361,4 +363,111 @@ Create a new handle pointing to the same [value](WeakLifetime.md#value-1). *** +### map() + +#### map(map) + +> **map**\<`O`\>(`map`): `O` + +Call `map` with this lifetime, returning the result. +Does not dispose the lifetime. + +##### Type parameters + +• **O** + +##### Parameters + +• **map**: (`lifetime`) => `O` + +##### Returns + +`O` + +the result of `map(this)`. + +##### Inherited from + +[`quickjs-emscripten.Lifetime.map`](Lifetime.md#map) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:151](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L151) + +#### map(map) + +> **map**\<`O`\>(`map`): `O` + +##### Type parameters + +• **O** + +##### Parameters + +• **map**: (`lifetime`) => `O` + +##### Returns + +`O` + +##### Inherited from + +[`quickjs-emscripten.Lifetime.map`](Lifetime.md#map) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:152](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L152) + +*** + +### tap() + +#### tap(fn) + +> **tap**(`fn`): [`WeakLifetime`](WeakLifetime.md)\<`T`, `TCopy`, `Owner`\> + +Call `fn` with this lifetime, then return `this`. Does not dispose the +lifetime. Useful for imperative operations within an expression, like when +you're building up objects, or to add logging in the middle of a call chain. + +##### Parameters + +• **fn**: (`lifetime`) => `void` + +##### Returns + +[`WeakLifetime`](WeakLifetime.md)\<`T`, `TCopy`, `Owner`\> + +this + +##### Inherited from + +[`quickjs-emscripten.Lifetime.tap`](Lifetime.md#tap) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L164) + +#### tap(fn) + +> **tap**(`fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +##### Parameters + +• **fn**: (`lifetime`) => `void` + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Inherited from + +[`quickjs-emscripten.Lifetime.tap`](Lifetime.md#tap) + +##### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L165) + +*** + Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/doc/quickjs-emscripten/exports.md b/doc/quickjs-emscripten/exports.md index 88fbae13..fc574efb 100644 --- a/doc/quickjs-emscripten/exports.md +++ b/doc/quickjs-emscripten/exports.md @@ -193,7 +193,7 @@ An `Array` that also implements [Disposable](interfaces/Disposable.md): #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:329](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L329) +[packages/quickjs-emscripten-core/src/lifetime.ts:354](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L354) *** @@ -209,7 +209,7 @@ An `Array` that also implements [Disposable](interfaces/Disposable.md): #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:453](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L453) +[packages/quickjs-emscripten-core/src/lifetime.ts:478](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L478) *** @@ -251,7 +251,7 @@ by the runtime. ### InterruptHandler -> **InterruptHandler**: (`runtime`) => `boolean` \| `undefined` +> **InterruptHandler**: (`runtime`) => `boolean` \| `undefined` \| `void` Callback called regularly while the VM executes code. Determines if a VM's execution should be interrupted. @@ -262,7 +262,7 @@ Determines if a VM's execution should be interrupted. #### Returns -`boolean` \| `undefined` +`boolean` \| `undefined` \| `void` `true` to interrupt JS execution inside the VM. @@ -965,7 +965,7 @@ The default [Intrinsics](exports.md#intrinsics) language features enabled in a Q #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:453](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L453) +[packages/quickjs-emscripten-core/src/lifetime.ts:478](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L478) *** @@ -1304,7 +1304,7 @@ Create an array that also implements [Disposable](interfaces/Disposable.md). #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:334](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L334) +[packages/quickjs-emscripten-core/src/lifetime.ts:359](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L359) *** diff --git a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSAsyncifyError.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSAsyncifyError.md index 16145711..7645b7f0 100644 --- a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSAsyncifyError.md +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSAsyncifyError.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:29](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L29) +[packages/quickjs-emscripten-core/src/errors.ts:33](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L33) *** diff --git a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSAsyncifySuspended.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSAsyncifySuspended.md index fb19558d..1eb66f9a 100644 --- a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSAsyncifySuspended.md +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSAsyncifySuspended.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:33](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L33) +[packages/quickjs-emscripten-core/src/errors.ts:37](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L37) *** diff --git a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSEmptyGetOwnPropertyNames.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSEmptyGetOwnPropertyNames.md index a1d39aba..1f7a442c 100644 --- a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSEmptyGetOwnPropertyNames.md +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSEmptyGetOwnPropertyNames.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L53) +[packages/quickjs-emscripten-core/src/errors.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L57) *** diff --git a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSEmscriptenModuleError.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSEmscriptenModuleError.md index 4b72410f..92f4ea54 100644 --- a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSEmscriptenModuleError.md +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSEmscriptenModuleError.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L41) +[packages/quickjs-emscripten-core/src/errors.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L45) *** diff --git a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSMemoryLeakDetected.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSMemoryLeakDetected.md index 37f52310..631e1e49 100644 --- a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSMemoryLeakDetected.md +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSMemoryLeakDetected.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:37](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L37) +[packages/quickjs-emscripten-core/src/errors.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L41) *** diff --git a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSNotImplemented.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSNotImplemented.md index 6e079b5c..f450c81b 100644 --- a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSNotImplemented.md +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSNotImplemented.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:25](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L25) +[packages/quickjs-emscripten-core/src/errors.ts:29](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L29) *** diff --git a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSPromisePending.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSPromisePending.md index dac6d304..b23993ed 100644 --- a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSPromisePending.md +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSPromisePending.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L49) +[packages/quickjs-emscripten-core/src/errors.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L53) *** diff --git a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUnknownIntrinsic.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUnknownIntrinsic.md index d1f7d950..42959ad2 100644 --- a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUnknownIntrinsic.md +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUnknownIntrinsic.md @@ -73,7 +73,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L45) +[packages/quickjs-emscripten-core/src/errors.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L49) *** diff --git a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUseAfterFree.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUseAfterFree.md index e896dbc1..cf73087c 100644 --- a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUseAfterFree.md +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUseAfterFree.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:21](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L21) +[packages/quickjs-emscripten-core/src/errors.ts:25](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L25) *** diff --git a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSWrongOwner.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSWrongOwner.md index 6e35723f..acc3b09e 100644 --- a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSWrongOwner.md +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSWrongOwner.md @@ -52,7 +52,7 @@ node\_modules/typescript/lib/lib.es5.d.ts:1081 #### Source -[packages/quickjs-emscripten-core/src/errors.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L17) +[packages/quickjs-emscripten-core/src/errors.ts:21](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L21) *** diff --git a/examples/bun-typescript/.gitignore b/examples/bun-typescript/.gitignore new file mode 100644 index 00000000..6736aa1e --- /dev/null +++ b/examples/bun-typescript/.gitignore @@ -0,0 +1,2 @@ +node_modules +index.js diff --git a/examples/bun-typescript/.npmrc b/examples/bun-typescript/.npmrc new file mode 100644 index 00000000..09b35cdd --- /dev/null +++ b/examples/bun-typescript/.npmrc @@ -0,0 +1,2 @@ +audit=false +fund=false diff --git a/examples/bun-typescript/bun.lockb b/examples/bun-typescript/bun.lockb new file mode 100755 index 0000000000000000000000000000000000000000..2c03ba518ccbbb1f175ce782d282e1039672035c GIT binary patch literal 1350 zcmY#Z)GsYA(of3F(@)JSQ%EY!;{sycoc!eMw9K4T-L(9o+{6;yG6OCq1_p-k54)DF z+jTwLvvrBA_#=-8yPFq&@-h=Ckl))qonQFI`E4vfML+;j3j!Pv3Qjjb`Bg9lV7?3k zLjw>qZ~^HihT0|D8YURcS8dSIZcR;Mgz6xdf>~q)G{6REJ}Z!BhGJsP1i1m(9jN?& z{Qr<8i8YjfIz|SFxyVMdEG?b0c8$-aHxAyfeJ?QXXNjGBYGu2%Z$-M_m!Ly+OQLV= z6j}9Q;UB)#m2 zQAu$!*xUoZMV1y#nIHnn*dQ_fdy8$}$rkP^DK1Ve0-6|mS)nl~&HINMP&E%QU$j`5 zo?)!u`{w|4#X7iaK>jksK7(#+)StYY2N+~VY-%z~2CJl*2l{Or_{)Z&to%7Rpg zD8v;In=?vE3W}}t^@~!|GmA@#D)sUTa=16.0.0" + } + }, + "node_modules/quickjs-emscripten-core": { + "version": "0.26.0", + "resolved": "file:../../build/tar/quickjs-emscripten-core.tgz", + "integrity": "sha512-RFglP182/9sTYirChNUsQOIbH70goOMe4rVr0G4aJykIk0m9ogglUvhXP7iANOeA9CFCKB93ORp6DJ5KJctbKg==", + "license": "MIT", + "dependencies": { + "@jitl/quickjs-ffi-types": "0.26.0" + } + }, + "node_modules/typescript": { + "version": "5.3.3", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + } + } +} diff --git a/examples/bun-typescript/package.json b/examples/bun-typescript/package.json new file mode 100644 index 00000000..80f0be6a --- /dev/null +++ b/examples/bun-typescript/package.json @@ -0,0 +1,18 @@ +{ + "name": "quickjs-emscripten-smoketest", + "version": "1.0.0", + "type": "commonjs", + "main": "index.js", + "license": "MIT", + "dependencies": { + "@jitl/quickjs-ffi-types": "file:../../build/tar/@jitl-quickjs-ffi-types.tgz", + "@jitl/quickjs-wasmfile-debug-asyncify": "file:../../build/tar/@jitl-quickjs-wasmfile-debug-asyncify.tgz", + "@jitl/quickjs-wasmfile-debug-sync": "file:../../build/tar/@jitl-quickjs-wasmfile-debug-sync.tgz", + "@jitl/quickjs-wasmfile-release-asyncify": "file:../../build/tar/@jitl-quickjs-wasmfile-release-asyncify.tgz", + "@jitl/quickjs-wasmfile-release-sync": "file:../../build/tar/@jitl-quickjs-wasmfile-release-sync.tgz", + "quickjs-emscripten": "file:../../build/tar/quickjs-emscripten.tgz", + "quickjs-emscripten-core": "file:../../build/tar/quickjs-emscripten-core.tgz", + "typescript": "5" + }, + "workspaces": [] +} diff --git a/examples/bun-typescript/tsconfig.json b/examples/bun-typescript/tsconfig.json new file mode 100644 index 00000000..8b4876fc --- /dev/null +++ b/examples/bun-typescript/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "ES6", + "lib": ["ES2015", "DOM"], + "module": "Node16", + "strict": true + }, + "include": ["*.ts"], + "exclude": ["../../node_modules/**/*"] +} diff --git a/package.json b/package.json index 12398479..c19bb460 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "quickjs-emscripten-repo", "private": true, - "version": "0.30.0", + "version": "0.31.0", "sideEffects": false, "license": "MIT", "type": "commonjs", @@ -44,7 +44,7 @@ "all:publish:stable": "yarn run check:packages && yarn for-each-publishable-package npm publish --access public", "all:publish:next": "yarn run check:packages && yarn for-each-publishable-package npm publish --access public --tag next", "all:version": "./scripts/set-version.ts", - "for-each-package-cmd": "yarn workspaces foreach --from 'packages/*' -Rpti", + "for-each-package-cmd": "yarn workspaces foreach --from 'packages/*' --topological-dev -Rpti", "for-each-publishable-package": "yarn for-each-package-cmd --exclude 'packages/internal-*'", "for-each-package": "yarn for-each-package-cmd run" }, diff --git a/packages/internal-tsconfig/package.json b/packages/internal-tsconfig/package.json index 5cce5b26..7e3aede5 100644 --- a/packages/internal-tsconfig/package.json +++ b/packages/internal-tsconfig/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/tsconfig", "private": true, - "version": "0.30.0", + "version": "0.31.0", "scripts": { "build": "yarn build:tsc && echo built $npm_package_json && ls -l", "build:tsc": "npx tsc --project tsconfig.tsup.json", diff --git a/packages/internal-tsconfig/tsconfig.json b/packages/internal-tsconfig/tsconfig.json index 6bc2677d..6b65072f 100644 --- a/packages/internal-tsconfig/tsconfig.json +++ b/packages/internal-tsconfig/tsconfig.json @@ -35,7 +35,7 @@ "noEmitOnError": true, // "importHelpers": true, /* Import emit helpers from 'tslib'. */ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + "isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */, // "emitDeclarationOnly": true, /* Strict Type-Checking Options */ diff --git a/packages/internal-tsconfig/tsup.base.config.ts b/packages/internal-tsconfig/tsup.base.config.ts index ea915700..7ded78f6 100644 --- a/packages/internal-tsconfig/tsup.base.config.ts +++ b/packages/internal-tsconfig/tsup.base.config.ts @@ -1,13 +1,14 @@ import type { Options } from "tsup" import { defineConfig } from "tsup" -const baseConfig = defineConfig((options) => ({ +const baseConfig = defineConfig((_options) => ({ entry: ["src/index.ts"], - minify: !options.watch, sourcemap: true, dts: true, clean: true, format: ["cjs", "esm"], + minifySyntax: true, + minifyWhitespace: true, })) as (options: Options) => Options export function extendConfig(options: Options = {}) { diff --git a/packages/quickjs-emscripten-core/README.md b/packages/quickjs-emscripten-core/README.md index 2c99c9b9..8bd5dd5c 100644 --- a/packages/quickjs-emscripten-core/README.md +++ b/packages/quickjs-emscripten-core/README.md @@ -326,3 +326,16 @@ Variant with the WASM data embedded into a browser ESModule. | syncMode | asyncify | Build run through the ASYNCIFY WebAssembly transform. This imposes substantial size (2x the size of sync) and speed penalties (40% the speed of sync). In return, allows synchronous calls from the QuickJS WASM runtime to async functions on the host. The extra magic makes this variant slower than sync variants. Note that both variants support regular async functions. Only adopt ASYNCIFY if you need to! The [QuickJSAsyncRuntime](https://github.com/justjake/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md) and [QuickJSAsyncContext](https://github.com/justjake/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md) classes expose the ASYNCIFY-specific APIs. | | emscriptenInclusion | singlefile | The WASM runtime is included directly in the JS file. Use if you run into issues with missing .wasm files when building or deploying your app. | | exports | browser | Has these package.json export conditions | + +### @jitl/quickjs-asmjs-mjs-release-sync + +[Docs](https://github.com/justjake/quickjs-emscripten/blob/main/doc/@jitl/quickjs-asmjs-mjs-release-sync/README.md) | +Compiled to pure Javascript, no WebAssembly required. + +| Variable | Setting | Description | +| ------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. Version [2024-02-14+36911f0d](https://github.com/bellard/quickjs/commit/36911f0d3ab1a4c190a4d5cbe7c2db225a455389) vendored to quickjs-emscripten on 2024-06-15. | +| releaseMode | release | Optimized for performance; use when building/deploying your application. | +| syncMode | sync | The default, normal build. Note that both variants support regular async functions. | +| emscriptenInclusion | asmjs | The C library code is compiled to Javascript, no WebAssembly used. Sometimes called "asmjs". This is the slowest possible option, and is intended for constrained environments that do not support WebAssembly, like quickjs-for-quickjs. | +| exports | import | Has these package.json export conditions | diff --git a/packages/quickjs-emscripten-core/package.json b/packages/quickjs-emscripten-core/package.json index 88a5539a..71989561 100644 --- a/packages/quickjs-emscripten-core/package.json +++ b/packages/quickjs-emscripten-core/package.json @@ -1,6 +1,6 @@ { "name": "quickjs-emscripten-core", - "version": "0.30.0", + "version": "0.31.0", "sideEffects": false, "license": "MIT", "type": "commonjs", diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index da43fbbd..d2a19bdb 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -1281,28 +1281,37 @@ export class QuickJSContext const cause = result.error.consume((error) => this.dump(error)) if (cause && typeof cause === "object" && typeof cause.message === "string") { - const { message, name, stack } = cause - const exception = new QuickJSUnwrapError("") - const hostStack = exception.stack + const { message, name, stack, ...rest } = cause + const exception = new QuickJSUnwrapError(cause, context) if (typeof name === "string") { exception.name = cause.name } + exception.message = message + const hostStack = exception.stack if (typeof stack === "string") { exception.stack = `${name}: ${message}\n${cause.stack}Host: ${hostStack}` } - Object.assign(exception, { cause, context, message }) + Object.assign(exception, rest) throw exception } - throw new QuickJSUnwrapError(cause, context) + throw new QuickJSUnwrapError(cause) } return result.value } + /** @private */ + [Symbol.for("nodejs.util.inspect.custom")]() { + if (!this.alive) { + return `${this.constructor.name} { disposed }` + } + return `${this.constructor.name} { ctx: ${this.ctx.value} rt: ${this.rt.value} }` + } + /** @private */ protected fnNextId = -32768 // min value of signed 16bit int used by Quickjs /** @private */ diff --git a/packages/quickjs-emscripten-core/src/errors.ts b/packages/quickjs-emscripten-core/src/errors.ts index a2711f6f..af491e54 100644 --- a/packages/quickjs-emscripten-core/src/errors.ts +++ b/packages/quickjs-emscripten-core/src/errors.ts @@ -9,7 +9,11 @@ export class QuickJSUnwrapError extends Error { public cause: unknown, public context?: QuickJSContext, ) { - super(String(cause)) + const message = + typeof cause === "object" && cause && "message" in cause + ? String(cause.message) + : String(cause) + super(message) } } diff --git a/packages/quickjs-emscripten-core/src/index.ts b/packages/quickjs-emscripten-core/src/index.ts index 8583c07a..4f62a7b7 100644 --- a/packages/quickjs-emscripten-core/src/index.ts +++ b/packages/quickjs-emscripten-core/src/index.ts @@ -3,12 +3,14 @@ export * from "@jitl/quickjs-ffi-types" // Sync classes export { QuickJSWASMModule } from "./module" export { QuickJSContext } from "./context" -export { QuickJSRuntime, InterruptHandler, ExecutePendingJobsResult } from "./runtime" +export { QuickJSRuntime } from "./runtime" +export type { InterruptHandler, ExecutePendingJobsResult } from "./runtime" // Async classes export { QuickJSAsyncWASMModule } from "./module-asyncify" export { QuickJSAsyncRuntime } from "./runtime-asyncify" -export { QuickJSAsyncContext, AsyncFunctionImplementation } from "./context-asyncify" +export { QuickJSAsyncContext } from "./context-asyncify" +export type { AsyncFunctionImplementation } from "./context-asyncify" // Build variants export * from "./from-variant" @@ -45,5 +47,5 @@ export type { } from "./types" export { DefaultIntrinsics } from "./types" export type { ModuleEvalOptions } from "./module" -export { QuickJSPropertyKey } from "./context" +export type { QuickJSPropertyKey } from "./context" export { debugLog, setDebugMode } from "./debug" diff --git a/packages/quickjs-emscripten-core/src/lifetime.ts b/packages/quickjs-emscripten-core/src/lifetime.ts index 1442e2af..5b97e43b 100644 --- a/packages/quickjs-emscripten-core/src/lifetime.ts +++ b/packages/quickjs-emscripten-core/src/lifetime.ts @@ -143,6 +143,31 @@ export class Lifetime return result } + /** + * Call `map` with this lifetime, returning the result. + * Does not dispose the lifetime. + * @return the result of `map(this)`. + */ + map(map: (lifetime: this) => O): O + map(map: (lifetime: QuickJSHandle) => O): O + map(map: (lifetime: any) => O): O { + this.assertAlive() + return map(this) + } + + /** + * Call `fn` with this lifetime, then return `this`. Does not dispose the + * lifetime. Useful for imperative operations within an expression, like when + * you're building up objects, or to add logging in the middle of a call chain. + * @returns this + */ + tap(fn: (lifetime: this) => void): this + tap(fn: (lifetime: QuickJSHandle) => void): QuickJSHandle + tap(fn: (lifetime: any) => void): any { + fn(this) + return this + } + /** * Dispose of {@link value} and perform cleanup. */ diff --git a/packages/quickjs-emscripten-core/src/runtime.ts b/packages/quickjs-emscripten-core/src/runtime.ts index adf77513..fd98b406 100644 --- a/packages/quickjs-emscripten-core/src/runtime.ts +++ b/packages/quickjs-emscripten-core/src/runtime.ts @@ -24,7 +24,7 @@ import { intrinsicsToFlags } from "./types" * @returns `true` to interrupt JS execution inside the VM. * @returns `false` or `undefined` to continue JS execution inside the VM. */ -export type InterruptHandler = (runtime: QuickJSRuntime) => boolean | undefined +export type InterruptHandler = (runtime: QuickJSRuntime) => boolean | undefined | void /** * Used as an optional for the results of executing pendingJobs. @@ -366,6 +366,14 @@ export class QuickJSRuntime extends UsingDisposable implements Disposable { } } + /** @private */ + [Symbol.for("nodejs.util.inspect.custom")]() { + if (!this.alive) { + return `${this.constructor.name} { disposed }` + } + return `${this.constructor.name} { rt: ${this.rt.value} }` + } + private getSystemContext() { if (!this.context) { // We own this context and should dispose of it. diff --git a/packages/quickjs-emscripten/package.json b/packages/quickjs-emscripten/package.json index 70b84bdf..e0c73676 100644 --- a/packages/quickjs-emscripten/package.json +++ b/packages/quickjs-emscripten/package.json @@ -1,6 +1,6 @@ { "name": "quickjs-emscripten", - "version": "0.30.0", + "version": "0.31.0", "sideEffects": false, "license": "MIT", "type": "commonjs", @@ -33,7 +33,7 @@ "clean": "git clean -fx dist .output", "tsc": "npx tsc -p . --noEmit", "test:vi": "VITEST=1 npx vitest run", - "test:node": "npx tsc -p tsconfig.build.json && ./makeTestPackageJson.ts && node -r source-map-support/register --test ./.output/*node-test*.*js", + "test:node": "npx tsc -p tsconfig.build.json && ./makeTestPackageJson.ts && node --experimental-import-meta-resolve -r source-map-support/register --test ./.output/*node-test*.*js", "test": "npm run test:vi && npm run test:node" }, "types": "./dist/index.d.ts", diff --git a/packages/quickjs-emscripten/src/quickjs-in-quickjs-node-test.mts b/packages/quickjs-emscripten/src/quickjs-in-quickjs-node-test.mts new file mode 100644 index 00000000..022e781e --- /dev/null +++ b/packages/quickjs-emscripten/src/quickjs-in-quickjs-node-test.mts @@ -0,0 +1,162 @@ +import fs from "node:fs" +import util from "node:util" +import module from "node:module" +import { test } from "node:test" +import path from "node:path" +import assert from "node:assert" +import { getQuickJS } from "./index.js" +import type { JSModuleLoader, JSModuleNormalizer, QuickJSHandle, QuickJSContext } from "./index.js" + +const DEBUG = false + +const ttyLog = (...args: unknown[]) => { + if (DEBUG) { + const fd = fs.openSync("/dev/tty", "w") + fs.writeSync(fd, util.format(...args) + "\n") + fs.closeSync(fd) + } +} + +const QuickJS = await getQuickJS() + +function addConsoleGlobal(context: QuickJSContext, logOfLogs: any[]) { + const consoleHandle = context.newObject() + const log = context.newFunction("log", (...args: QuickJSHandle[]) => { + const logged = args.map((arg) => context.dump(arg)) + logOfLogs.push(logged) + ttyLog(...logged) + }) + context.setProp(consoleHandle, "log", log) + context.setProp(consoleHandle, "error", log) + context.setProp(context.global, "console", consoleHandle) + log.dispose() + consoleHandle.dispose() +} + +function* pathAncestors(filepath: string) { + yield filepath + while (filepath !== "/") { + filepath = path.dirname(filepath) + yield filepath + } +} + +class QuickJSNodeModuleLoader { + static convertPath(filepath: string, mountPoints: Map) { + filepath = path.normalize(filepath) + for (const dirname of pathAncestors(filepath)) { + const mappedDirname = mountPoints.get(dirname) + if (!mappedDirname) { + continue + } + return mappedDirname + filepath.slice(dirname.length) + } + return undefined + } + + require = module.createRequire(import.meta.url) + hostToGuest = new Map() + guestToHost = new Map() + + mount(args: { hostPath: string; guestPath: string }) { + const guestPath = path.normalize(args.guestPath) + if (!path.isAbsolute(guestPath)) { + throw new Error("guestPath must be absolute") + } + + const hostPath = fs.realpathSync(args.hostPath) + this.hostToGuest.set(hostPath, guestPath) + this.guestToHost.set(guestPath, hostPath) + + ttyLog("mount", { hostPath, guestPath }) + } + + mountImport(args: { hostImport: string; guestImport: string; direct?: true }) { + const hostFile = this.require.resolve(args.hostImport).replace(".js", ".mjs") + this.mount({ + hostPath: args.direct ? hostFile : path.dirname(hostFile), + guestPath: "/node_modules/" + args.guestImport, + }) + } + + toGuestPath(hostPath: string) { + return QuickJSNodeModuleLoader.convertPath(hostPath, this.hostToGuest) + } + + toHostPath(guestPath: string) { + return QuickJSNodeModuleLoader.convertPath(guestPath, this.guestToHost) + } + + jsModuleNormalizer: JSModuleNormalizer = (baseModuleName, requestedName, _context) => { + if (path.isAbsolute(requestedName)) { + ttyLog("absolute", requestedName) + return path.normalize(requestedName) + } + + if (requestedName.startsWith(".")) { + const resolved = path.resolve(path.dirname(baseModuleName), requestedName) + ttyLog("relative", { resolved, baseModuleName, requestedName }) + return path.normalize(resolved) + } + + const resolved = path.resolve("/node_modules/", requestedName) + ttyLog("node_modules", { resolved, baseModuleName, requestedName }) + return path.normalize(resolved) + } + + jsModuleLoader: JSModuleLoader = (moduleName, _context) => { + try { + const hostPath = this.toHostPath(moduleName) + if (hostPath) { + return fs.readFileSync(hostPath, "utf8") + } + throw new Error("Not found") + } catch (error) { + ttyLog("QuickJSNodeModuleLoader.loader error:", { moduleName, error }) + return { + error: Error(`Not found: ${moduleName}`), + } + } + } +} + +test("quickjs-for-quickjs", () => { + const moduleLoader = new QuickJSNodeModuleLoader() + moduleLoader.mountImport({ + hostImport: "quickjs-emscripten-core", + guestImport: "quickjs-emscripten-core", + }) + moduleLoader.mountImport({ + hostImport: "@jitl/quickjs-asmjs-mjs-release-sync", + guestImport: "@jitl/quickjs-asmjs-mjs-release-sync", + }) + moduleLoader.mountImport({ + hostImport: "@jitl/quickjs-ffi-types", + guestImport: "@jitl/quickjs-ffi-types", + direct: true, + }) + + const runtime = QuickJS.newRuntime() + runtime.setModuleLoader(moduleLoader.jsModuleLoader, moduleLoader.jsModuleNormalizer) + + const context = runtime.newContext() + const logs: any[] = [] + addConsoleGlobal(context, logs) + + ttyLog("hi") + + const result = context.evalCode( + ` +import { newQuickJSWASMModuleFromVariant } from 'quickjs-emscripten-core/index.mjs' +import variant from '@jitl/quickjs-asmjs-mjs-release-sync/index.mjs' +globalThis.done = newQuickJSWASMModuleFromVariant(variant).then(QuickJS => { + const result = QuickJS.evalCode('1+2') + console.log('inner result', result) +}) +`, + "/script.mjs", + ) + context.unwrapResult(result).dispose() + runtime.executePendingJobs() + assert.deepEqual(logs, [["inner result", 3]]) +}) diff --git a/packages/quickjs-ffi-types/package.json b/packages/quickjs-ffi-types/package.json index 3cb5804c..760fb441 100644 --- a/packages/quickjs-ffi-types/package.json +++ b/packages/quickjs-ffi-types/package.json @@ -1,6 +1,6 @@ { "name": "@jitl/quickjs-ffi-types", - "version": "0.30.0", + "version": "0.31.0", "license": "MIT", "repository": { "type": "git", diff --git a/packages/quickjs-for-quickjs/LICENSE b/packages/quickjs-for-quickjs/LICENSE new file mode 100644 index 00000000..22f51c71 --- /dev/null +++ b/packages/quickjs-for-quickjs/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +quickjs-emscripten copyright (c) 2019-2024 Jake Teton-Landis + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/quickjs-for-quickjs/README.md b/packages/quickjs-for-quickjs/README.md new file mode 100644 index 00000000..6e8cc1ea --- /dev/null +++ b/packages/quickjs-for-quickjs/README.md @@ -0,0 +1,70 @@ +# quickjs-for-quickjs + +![yo dawg i herd u like quickjs so i put quickjs in ur quickjs so u can eval while u eval](./yodawg.jpg) + +This package is a build of [quickjs-emscripten](https://github.com/justjake/quickjs-emscripten) that can run inside QuickJS or any other JavaScript runtime without WebAssembly support. The QuickJS C library is compiled to Asm.js, and then bundled together with the quickjs-emscripten JavaScript wrapper into a single standalone file with no external dependencies. + +`quickjs-for-quickjs` has been tested in the following configurations: + +- ✅ NodeJS -> quickjs-for-quickjs +- ✅ NodeJS -> quickjs-emscripten RELEASE_SYNC -> quickjs-for-quickjs +- ❌ NodeJS -> quickjs-emscripten RELEASE_SYNC -> quickjs-for-quickjs -> quickjs-for-quickjs (This hits stack overflow in QuickJS. It could work with a larger stack size for the outer QuickJS instance) + +## Why? + +For fun! + +This could have practical applications, like if you're a user writing a plugin for a 3rd-party system using quickjs-emscripten for scripting, and you as a plugin author also want your plugin to have its own plugin ecosystem. + +## Usage + +For a more detailed example, see [the "example" directory][example] in the repo. + +[example]: https://github.com/justjake/quickjs-emscripte/tree/main/packages/quickjs-for-quickjs/example + +```javascript +// nodejs-host.mjs +import fs from "node:fs/promises" +import module from "node:module" +import { getQuickJS, setUpContext } from "quickjs-for-quickjs" + +// get quickjs source code +const require = module.createRequire(import.meta.url) +const quickjsSource = await fs.readFile(require.resolve("quickjs-for-quickjs"), "utf8") + +// create the host QuickJS context +const QuickJS = await getQuickJS() +const context = QuickJS.createContext() + +// inject console.log, which is required for quickjs-for-quickjs to work +setUpContext(context) + +// allow the host QuickJS to import quickjs-for-quickjs module +context.runtime.setModuleLoader((name) => { + if (name === "quickjs-for-quickjs") { + return quickjsSource + } + throw new Error(`Module not found: ${name}`) +}) + +const quickjsHost = ` +// import and create inner QuickJS guest context +import { getQuickJS } from "quickjs-for-quickjs" +const context = await getQuickJS().then(mod => mod.createContext()) + +// eval some code in the inner context +const innerResult = context.evalCode('1 + 2', "quickjs-guest.mjs").unwrap() + +// export the result +export const result = innerResult.consume(context.dump) +` + +// eval the quickjs host +const handle = context.evalCode(quickjsHost, "quickjs-host.mjs").unwrap() + +// get the result +context.runtime.executePendingJob() +const result = context.unwrapResult(context.getPromiseState(handle)) + +console.log(result.consume(context.dump)) +``` diff --git a/packages/quickjs-for-quickjs/example/node-host.mjs b/packages/quickjs-for-quickjs/example/node-host.mjs new file mode 100644 index 00000000..5ea39a1f --- /dev/null +++ b/packages/quickjs-for-quickjs/example/node-host.mjs @@ -0,0 +1,51 @@ +import fs from "node:fs/promises" +import module from "node:module" +import { getQuickJS, setUpContext } from "quickjs-for-quickjs" +const require = module.createRequire(import.meta.url) + +console.log("hello") + +const quickjsSource = await fs.readFile(require.resolve("quickjs-for-quickjs"), "utf8") +const exportQuickjsSource = `export default ${JSON.stringify(quickjsSource)}` + +const exampleQuickjsHostSource = await fs.readFile(require.resolve("./quickjs-host.mjs"), "utf8") +const exportExampleQuickjsHostSource = `export default ${JSON.stringify(exampleQuickjsHostSource)}` + +const QuickJS = await getQuickJS() +const context = setUpContext(QuickJS.newContext()) +context.runtime.setModuleLoader((name) => { + console.log(`0: import ${name}`) + if (name === "quickjs-for-quickjs") { + return quickjsSource + } + if (name === "quickjs-for-quickjs-source") { + return exportQuickjsSource + } + if (name === "example-quickjs-host-source") { + return exportExampleQuickjsHostSource + } + return { error: new Error("not found") } +}) + +let nestingLimit = 2 +context.setProp( + context.global, + "done", + context.newFunction("done", () => context.newNumber(--nestingLimit <= 0 ? 1 : 0)), +) +const handle = context + .evalCode(exampleQuickjsHostSource, "quickjs-host.mjs", { + type: "module", + }) + .unwrap() + +const promise = context.resolvePromise(handle) +context.runtime.executePendingJobs() + +const result = (await promise).unwrap() + +console.log({ + result: context.dump(context.getProp(result, "result")), +}) + +console.log("result:", context.dump(context.getProp(await promise, "result"))) diff --git a/packages/quickjs-for-quickjs/example/quickjs-host.mjs b/packages/quickjs-for-quickjs/example/quickjs-host.mjs new file mode 100644 index 00000000..a82df11f --- /dev/null +++ b/packages/quickjs-for-quickjs/example/quickjs-host.mjs @@ -0,0 +1,49 @@ +import { getQuickJS, setUpContext } from "quickjs-for-quickjs" +import quickjsSource from "quickjs-for-quickjs-source" +import exampleQuickjsHostSource from "example-quickjs-host-source" + +console.log(`${console.depth}: started`) +const QuickJS = await getQuickJS() + +const exportQuickjsSource = `export default ${JSON.stringify(quickjsSource)}` +const exportExampleQuickjsHostSource = `export default ${JSON.stringify(exampleQuickjsHostSource)}` + +console.log(`${console.depth}: imported`) + +const context = setUpContext(QuickJS.newContext()) +context.runtime.setModuleLoader((name) => { + console.log(`${console.depth}: import ${name}`) + if (name === "quickjs-for-quickjs") { + return quickjsSource + } + if (name === "quickjs-for-quickjs-source") { + return exportQuickjsSource + } + if (name === "example-quickjs-host-source") { + return exportExampleQuickjsHostSource + } + return { error: new Error("not found") } +}) +context.setProp( + context.global, + "done", + context.newFunction("random", () => context.newNumber(done())), +) + +console.log(`${console.depth}: evaluating`) + +const codeToEval = done() + ? `export const result = ['hello', 'world', console.depth].join(' ')` + : exampleQuickjsHostSource +const promise = context.resolvePromise(context.evalCode(codeToEval).unwrap()) + +console.log(`${console.depth}: executing pending jobs`) +context.runtime.executePendingJobs() + +console.log("awaiting") +const promised = (await promise).unwrap() +console.log(`${console.depth}:`, { promised, type: context.typeof(promised) }) + +export const result = "hello " + context.dump(context.getProp(promised, "result")) + +console.log(`${console.depth}: done`) diff --git a/packages/quickjs-for-quickjs/package.json b/packages/quickjs-for-quickjs/package.json new file mode 100644 index 00000000..d86e032e --- /dev/null +++ b/packages/quickjs-for-quickjs/package.json @@ -0,0 +1,40 @@ +{ + "name": "quickjs-for-quickjs", + "version": "0.31.0", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/justjake/quickjs-emscripten" + }, + "author": { + "name": "Jake Teton-Landis", + "url": "https://jake.tl" + }, + "scripts": { + "check": "npx tsc --project . --noEmit", + "build": "npx tsup", + "clean": "git clean -fx dist" + }, + "files": [ + "LICENSE", + "yodawg.jpg", + "example/**/*", + "dist/**/*" + ], + "types": "dist/index.d.mts", + "main": "dist/index.mjs", + "module": "dist/index.mjs", + "exports": { + "./package.json": "./package.json", + ".": { + "types": "./dist/index.d.mts", + "import": "./dist/index.mjs", + "default": "./dist/index.mjs" + } + }, + "devDependencies": { + "@jitl/quickjs-asmjs-mjs-release-sync": "workspace:*", + "@jitl/tsconfig": "workspace:*", + "quickjs-emscripten-core": "workspace:*" + } +} diff --git a/packages/quickjs-for-quickjs/src/index.mts b/packages/quickjs-for-quickjs/src/index.mts new file mode 100644 index 00000000..6a7d3a09 --- /dev/null +++ b/packages/quickjs-for-quickjs/src/index.mts @@ -0,0 +1,52 @@ +import type { QuickJSWASMModule, QuickJSContext } from "quickjs-emscripten-core" +import { newQuickJSWASMModuleFromVariant } from "quickjs-emscripten-core" +import RELEASE_SYNC from "@jitl/quickjs-asmjs-mjs-release-sync" + +let promise: Promise | undefined + +export function getQuickJS(): Promise { + return (promise ??= newQuickJSWASMModule()) +} + +export function newQuickJSWASMModule(): Promise { + // TODO: why are the types mad? + return newQuickJSWASMModuleFromVariant(RELEASE_SYNC as any) +} + +export function setUpContext( + context: QuickJSContext, + options: { + log?: (...args: unknown[]) => void + } = {}, +) { + const { log } = options + const depth: number = (console as any)["depth"] ?? 0 + using consoleHandle = context.newObject() + using logHandle = context.newFunction("console.log", (...args) => { + const message = args.map(context.dump) + if (log) { + log(...message) + } else { + console.log(...message) + } + }) + using depthHandle = context.newNumber(1 + depth) + + context.setProp(consoleHandle, "log", logHandle) + context.setProp(consoleHandle, "error", logHandle) + context.setProp(consoleHandle, "depth", depthHandle) + + context.setProp(context.global, "console", consoleHandle) + + context.runtime.setMaxStackSize(0) + context.runtime.setMemoryLimit(0) + let interruptCount = 0 + context.runtime.setInterruptHandler(() => { + console.log(`${depth}: ...eval... (${++interruptCount})`) + return undefined + }) + + return context +} + +export { RELEASE_SYNC } diff --git a/packages/quickjs-for-quickjs/tsconfig.json b/packages/quickjs-for-quickjs/tsconfig.json new file mode 100644 index 00000000..3dd81964 --- /dev/null +++ b/packages/quickjs-for-quickjs/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "@jitl/tsconfig/tsconfig.json", + "include": ["src/**/*"], + "compilerOptions": { + "rootDir": "src" + } +} diff --git a/packages/quickjs-for-quickjs/tsup.config.ts b/packages/quickjs-for-quickjs/tsup.config.ts new file mode 100644 index 00000000..cf490f78 --- /dev/null +++ b/packages/quickjs-for-quickjs/tsup.config.ts @@ -0,0 +1,10 @@ +import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" + +export default extendConfig({ + entry: ["src/index.mts"], + format: ["esm"], + external: [], + clean: true, + splitting: false, + sourcemap: false, +}) diff --git a/packages/quickjs-for-quickjs/yodawg.jpg b/packages/quickjs-for-quickjs/yodawg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..81e68c25191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#B6t+?!s8v8{`dX-PaErom%PR_?ydsP=5E%Icz@^^>}K=l!gLr^Ha2&NPt z2)QMX7wo$X>P%aE0B{1F>{*f`wp!EG0>hM5nP4`Cs)ck*^JWKuPnzw$qv}_1om?%{ zqlw3T{V4i#Wgv}281(lHBgOce2iArKeH2I#w_N;Y@2S=9GQ_aAl?cIz3fR+JZxW)Q z)uXmmwGcqx5ma8^PZas1XDp!Q*C6iTjV| z{{Y}~Key0%`tyFA&-j02;hulzv*vz>^H1M@KSO_Y9%uB2@{co|={Y`}zK=7n_^R(Y hPEY)B`g(uC&**&@7st`kar#FQ;&hy|l>JnH|Jj$_fV2Pr literal 0 HcmV?d00001 diff --git a/packages/variant-quickjs-asmjs-mjs-release-sync/LICENSE b/packages/variant-quickjs-asmjs-mjs-release-sync/LICENSE new file mode 100644 index 00000000..92facdd2 --- /dev/null +++ b/packages/variant-quickjs-asmjs-mjs-release-sync/LICENSE @@ -0,0 +1,47 @@ +quickjs-emscripten: +The MIT License + +quickjs-emscripten copyright (c) 2019-2024 Jake Teton-Landis + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +quickjs: +QuickJS Javascript Engine + +Copyright (c) 2017-2021 Fabrice Bellard +Copyright (c) 2017-2021 Charlie Gordon + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/packages/variant-quickjs-asmjs-mjs-release-sync/Makefile b/packages/variant-quickjs-asmjs-mjs-release-sync/Makefile new file mode 100644 index 00000000..8b0076b0 --- /dev/null +++ b/packages/variant-quickjs-asmjs-mjs-release-sync/Makefile @@ -0,0 +1,172 @@ +# Tools +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 +EMCC_SRC=../../scripts/emcc.sh +EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) +GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts +THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) +REPO_ROOT := $(abspath $(THIS_DIR)/../..) + +QUICKJS_LIB=quickjs + +# Paths +QUICKJS_ROOT=../../vendor/$(QUICKJS_LIB) +WRAPPER_ROOT=../../c +TEMPLATES=../../templates +# Intermediate build files +BUILD_ROOT=build +BUILD_WRAPPER=$(BUILD_ROOT)/wrapper +BUILD_QUICKJS=$(BUILD_ROOT)/quickjs +# Distributed to users +DIST=dist + +# QuickJS +QUICKJS_OBJS=quickjs.o libregexp.o libunicode.o cutils.o quickjs-libc.o libbf.o +ifeq ($(QUICKJS_LIB),quickjs-ng) + QUICKJS_DEFINES:=-D_GNU_SOURCE + CFLAGS_WASM+=-DQTS_USE_QUICKJS_NG +else + QUICKJS_CONFIG_VERSION=$(shell cat $(QUICKJS_ROOT)/VERSION) + QUICKJS_DEFINES:=-D_GNU_SOURCE -DCONFIG_VERSION=\"$(QUICKJS_CONFIG_VERSION)\" -DCONFIG_STACK_CHECK -DCONFIG_BIGNUM + CFLAGS_WASM+=-DCONFIG_BIGNUM +endif +VARIANT_QUICKJS_OBJS=$(patsubst %.o, $(BUILD_QUICKJS)/%.o, $(QUICKJS_OBJS)) + +# quickjs-emscripten +WRAPPER_DEFINES+=-Wcast-function-type # Likewise, warns about some quickjs casts we don't control. +EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json +EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json + +# Emscripten options +CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json +CFLAGS_WASM+=-s MODULARIZE=1 +CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten +CFLAGS_WASM+=-s EXPORT_NAME=QuickJSRaw +CFLAGS_WASM+=-s INVOKE_RUN=0 +CFLAGS_WASM+=-s ALLOW_MEMORY_GROWTH=1 +CFLAGS_WASM+=-s ALLOW_TABLE_GROWTH=1 +CFLAGS_WASM+=-s STACK_SIZE=5MB +# CFLAGS_WASM+=-s MINIMAL_RUNTIME=1 # Appears to break MODULARIZE +CFLAGS_WASM+=-s SUPPORT_ERRNO=0 + +# Emscripten options - like STRICT +# https://github.com/emscripten-core/emscripten/blob/fa339b76424ca9fbe5cf15faea0295d2ac8d58cc/src/settings.js#L1095-L1109 +# CFLAGS_WASM+=-s STRICT_JS=1 # Doesn't work with MODULARIZE +CFLAGS_WASM+=-s IGNORE_MISSING_MAIN=0 --no-entry +CFLAGS_WASM+=-s AUTO_JS_LIBRARIES=0 +CFLAGS_WASM+=-s -lccall.js +CFLAGS_WASM+=-s AUTO_NATIVE_LIBRARIES=0 +CFLAGS_WASM+=-s AUTO_ARCHIVE_INDEXES=0 +CFLAGS_WASM+=-s DEFAULT_TO_CXX=0 +CFLAGS_WASM+=-s ALLOW_UNIMPLEMENTED_SYSCALLS=0 + +# Emscripten options - NodeJS +CFLAGS_WASM+=-s MIN_NODE_VERSION=160000 +CFLAGS_WASM+=-s NODEJS_CATCH_EXIT=0 + +CFLAGS_MJS+=-s EXPORT_ES6=1 +CFLAGS_BROWSER+=-s EXPORT_ES6=1 + +# VARIANT +SYNC=SYNC +CFLAGS_WASM_BROWSER=$(CFLAGS_WASM) + +# Emscripten options - variant & target specific +CFLAGS_WASM+=-Oz +CFLAGS_WASM+=-flto +CFLAGS_WASM+=--closure 1 +CFLAGS_WASM+=-s FILESYSTEM=0 +CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js +CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js +CFLAGS_WASM+=-s WASM=0 +CFLAGS_WASM+=-s SINGLE_FILE=1 + +CFLAGS_MJS+=-s ENVIRONMENT=web,worker,node + + + +# GENERATE_TS options - variant specific + + + +ifdef DEBUG_MAKE + MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) +else + MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 +endif + +############################################################################### +# High-level +all: EXPORTS + +clean: + git clean -fx $(DIST) $(BUILD_ROOT) + +############################################################################### +# Emscripten output targets +EXPORTS: MJS +CJS: $(DIST)/emscripten-module.cjs $(DIST)/emscripten-module.d.ts +MJS: $(DIST)/emscripten-module.mjs $(DIST)/emscripten-module.d.ts +BROWSER: $(DIST)/emscripten-module.browser.mjs $(DIST)/emscripten-module.browser.d.ts +CLOUDFLARE: $(DIST)/emscripten-module.cloudflare.cjs $(DIST)/emscripten-module.cloudflare.d.ts + +$(DIST)/emscripten-module.mjs: CFLAGS_WASM+=$(CFLAGS_ESM) +$(DIST)/emscripten-module.mjs: $(BUILD_WRAPPER)/interface.o $(VARIANT_QUICKJS_OBJS) $(WASM_SYMBOLS) | $(EMCC_SRC) + $(MKDIRP) + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) $(EMCC_EXPORTED_FUNCS) -o $@ $< $(VARIANT_QUICKJS_OBJS) + +$(DIST)/emscripten-module.cjs: CFLAGS_WASM+=$(CFLAGS_CJS) +$(DIST)/emscripten-module.cjs: $(BUILD_WRAPPER)/interface.o $(VARIANT_QUICKJS_OBJS) $(WASM_SYMBOLS) | $(EMCC_SRC) + $(MKDIRP) + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) $(EMCC_EXPORTED_FUNCS) -o $@ $< $(VARIANT_QUICKJS_OBJS) + +$(DIST)/emscripten-module.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts + $(MKDIRP) + echo '// Generated from $<' > $@ + cat $< >> $@ + +$(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts + $(MKDIRP) + echo '// Generated from $<' > $@ + cat $< >> $@ + +# Browser target needs intermediate build to avoid two copies of .wasm +$(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js + $(MKDIRP) + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi + cp $< $@ + +$(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js + $(MKDIRP) + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi + cp $< $@ + +$(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) +$(BUILD_WRAPPER)/cloudflare/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_CLOUDFLARE) +$(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_QUICKJS_OBJS) $(WASM_SYMBOLS) | $(EMCC_SRC) + $(MKDIRP) + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) $(EMCC_EXPORTED_FUNCS) -o $@ $< $(VARIANT_QUICKJS_OBJS) + +############################################################################### +# Emscripten intermediate files +WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json +$(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) + $(MKDIRP) + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< + +$(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) + $(MKDIRP) + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< + +$(BUILD_WRAPPER)/symbols.json: + $(MKDIRP) + $(GENERATE_TS) symbols $@ + +$(BUILD_WRAPPER)/asyncify-remove.json: + $(MKDIRP) + $(GENERATE_TS) sync-symbols $@ + +$(BUILD_WRAPPER)/asyncify-imports.json: + $(MKDIRP) + $(GENERATE_TS) async-callback-symbols $@ diff --git a/packages/variant-quickjs-asmjs-mjs-release-sync/README.md b/packages/variant-quickjs-asmjs-mjs-release-sync/README.md new file mode 100644 index 00000000..8d648b7f --- /dev/null +++ b/packages/variant-quickjs-asmjs-mjs-release-sync/README.md @@ -0,0 +1,72 @@ +# @jitl/quickjs-asmjs-mjs-release-sync + +Compiled to pure Javascript, no WebAssembly required. + +This generated package is part of [quickjs-emscripten](https://github.com/justjake/quickjs-emscripten). +It contains a variant of the quickjs WASM library, and can be used with quickjs-emscripten-core. + +```typescript +import variant from "@jitl/quickjs-asmjs-mjs-release-sync" +import { newQuickJSWASMModuleFromVariant } from "quickjs-emscripten-core" +const QuickJS = await newQuickJSWASMModuleFromVariant(variant) +``` + +This variant was built with the following settings: + +## Library: quickjs + +The original [bellard/quickjs](https://github.com/bellard/quickjs) library. + +Version [2024-02-14+36911f0d](https://github.com/bellard/quickjs/commit/36911f0d3ab1a4c190a4d5cbe7c2db225a455389) vendored to quickjs-emscripten on 2024-06-15. + +## Release mode: release + +Optimized for performance; use when building/deploying your application. + +## Exports: import + +Exports the following in package.json for the package entrypoint: + +- Exports a NodeJS-compatible ESModule. Cannot be imported synchronously from a NodeJS CommonJS module. + +## Extra async magic? No + +The default, normal build. Note that both variants support regular async functions. + +## Single-file, or separate .wasm file? asmjs + +The C library code is compiled to Javascript, no WebAssembly used. Sometimes called "asmjs". This is the slowest possible option, and is intended for constrained environments that do not support WebAssembly, like quickjs-for-quickjs. + +## More details + +Full variant JSON description: + +```json +{ + "library": "quickjs", + "releaseMode": "release", + "syncMode": "sync", + "description": "Compiled to pure Javascript, no WebAssembly required.", + "emscriptenInclusion": "asmjs", + "exports": { + "import": { + "emscriptenEnvironment": ["web", "worker", "node"] + } + } +} +``` + +Variant-specific Emscripten build flags: + +```json +[ + "-Oz", + "-flto", + "--closure 1", + "-s FILESYSTEM=0", + "--pre-js $(TEMPLATES)/pre-extension.js", + "--pre-js $(TEMPLATES)/pre-wasmMemory.js", + "-s WASM=0", + "-s SINGLE_FILE=1" +] +``` diff --git a/packages/variant-quickjs-asmjs-mjs-release-sync/package.json b/packages/variant-quickjs-asmjs-mjs-release-sync/package.json new file mode 100644 index 00000000..6b09f208 --- /dev/null +++ b/packages/variant-quickjs-asmjs-mjs-release-sync/package.json @@ -0,0 +1,48 @@ +{ + "name": "@jitl/quickjs-asmjs-mjs-release-sync", + "license": "MIT", + "version": "0.31.0", + "description": "Variant of quickjs library: Compiled to pure Javascript, no WebAssembly required.", + "sideEffects": false, + "repository": { + "type": "git", + "url": "https://github.com/justjake/quickjs-emscripten" + }, + "author": { + "name": "Jake Teton-Landis", + "url": "https://jake.tl" + }, + "scripts": { + "build": "yarn build:c && yarn build:ts", + "build:c": "make -j2", + "build:ts": "npx tsup", + "check:types": "npx tsc --project . --noEmit", + "clean": "make clean", + "prepare": "yarn clean && yarn build" + }, + "files": [ + "LICENSE", + "README.md", + "dist/**/*", + "!dist/*.tsbuildinfo" + ], + "types": "./dist/index.d.mts", + "main": "./dist/index.mjs", + "module": "./dist/index.mjs", + "exports": { + ".": { + "types": "./dist/index.d.mts", + "import": "./dist/index.mjs", + "default": "./dist/index.mjs" + }, + "./package.json": "./package.json", + "./emscripten-module": { + "types": "./dist/emscripten-module.d.ts", + "import": "./dist/emscripten-module.mjs", + "default": "./dist/emscripten-module.mjs" + } + }, + "dependencies": { + "@jitl/quickjs-ffi-types": "workspace:*" + } +} diff --git a/packages/variant-quickjs-asmjs-mjs-release-sync/src/ffi.ts b/packages/variant-quickjs-asmjs-mjs-release-sync/src/ffi.ts new file mode 100644 index 00000000..419f408d --- /dev/null +++ b/packages/variant-quickjs-asmjs-mjs-release-sync/src/ffi.ts @@ -0,0 +1,419 @@ +// This file generated by "generate.ts ffi" in the root of the repo. +import { + QuickJSEmscriptenModule, + JSRuntimePointer, + JSContextPointer, + JSContextPointerPointer, + JSModuleDefPointer, + JSValuePointer, + JSValueConstPointer, + JSValuePointerPointer, + JSValuePointerPointerPointer, + JSValueConstPointerPointer, + QTS_C_To_HostCallbackFuncPointer, + QTS_C_To_HostInterruptFuncPointer, + QTS_C_To_HostLoadModuleFuncPointer, + BorrowedHeapCharPointer, + OwnedHeapCharPointer, + JSBorrowedCharPointer, + JSVoidPointer, + UInt32Pointer, + EvalFlags, + IntrinsicsFlags, + EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, + JSPromiseStateEnum, +} from "@jitl/quickjs-ffi-types" + +/** + * Low-level FFI bindings to QuickJS's Emscripten module. + * See instead {@link QuickJSContext}, the public Javascript interface exposed by this + * library. + * + * @unstable The FFI interface is considered private and may change. + */ +export class QuickJSFFI { + constructor(private module: QuickJSEmscriptenModule) {} + /** Set at compile time. */ + readonly DEBUG = false + + QTS_Throw: ( + ctx: JSContextPointer, + error: JSValuePointer | JSValueConstPointer, + ) => JSValuePointer = this.module.cwrap("QTS_Throw", "number", ["number", "number"]) + + QTS_NewError: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( + "QTS_NewError", + "number", + ["number"], + ) + + QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void = this.module.cwrap( + "QTS_RuntimeSetMemoryLimit", + null, + ["number", "number"], + ) + + QTS_RuntimeComputeMemoryUsage: (rt: JSRuntimePointer, ctx: JSContextPointer) => JSValuePointer = + this.module.cwrap("QTS_RuntimeComputeMemoryUsage", "number", ["number", "number"]) + + QTS_RuntimeDumpMemoryUsage: (rt: JSRuntimePointer) => OwnedHeapCharPointer = this.module.cwrap( + "QTS_RuntimeDumpMemoryUsage", + "number", + ["number"], + ) + + QTS_RecoverableLeakCheck: () => number = this.module.cwrap( + "QTS_RecoverableLeakCheck", + "number", + [], + ) + + QTS_BuildIsSanitizeLeak: () => number = this.module.cwrap("QTS_BuildIsSanitizeLeak", "number", []) + + QTS_RuntimeSetMaxStackSize: (rt: JSRuntimePointer, stack_size: number) => void = + this.module.cwrap("QTS_RuntimeSetMaxStackSize", null, ["number", "number"]) + + QTS_GetUndefined: () => JSValueConstPointer = this.module.cwrap("QTS_GetUndefined", "number", []) + + QTS_GetNull: () => JSValueConstPointer = this.module.cwrap("QTS_GetNull", "number", []) + + QTS_GetFalse: () => JSValueConstPointer = this.module.cwrap("QTS_GetFalse", "number", []) + + QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) + + QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ + "number", + ]) + + QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer = + this.module.cwrap("QTS_NewContext", "number", ["number", "number"]) + + QTS_FreeContext: (ctx: JSContextPointer) => void = this.module.cwrap("QTS_FreeContext", null, [ + "number", + ]) + + QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void = this.module.cwrap( + "QTS_FreeValuePointer", + null, + ["number", "number"], + ) + + QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void = + this.module.cwrap("QTS_FreeValuePointerRuntime", null, ["number", "number"]) + + QTS_FreeVoidPointer: (ctx: JSContextPointer, ptr: JSVoidPointer) => void = this.module.cwrap( + "QTS_FreeVoidPointer", + null, + ["number", "number"], + ) + + QTS_FreeCString: (ctx: JSContextPointer, str: JSBorrowedCharPointer) => void = this.module.cwrap( + "QTS_FreeCString", + null, + ["number", "number"], + ) + + QTS_DupValuePointer: ( + ctx: JSContextPointer, + val: JSValuePointer | JSValueConstPointer, + ) => JSValuePointer = this.module.cwrap("QTS_DupValuePointer", "number", ["number", "number"]) + + QTS_NewObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( + "QTS_NewObject", + "number", + ["number"], + ) + + QTS_NewObjectProto: ( + ctx: JSContextPointer, + proto: JSValuePointer | JSValueConstPointer, + ) => JSValuePointer = this.module.cwrap("QTS_NewObjectProto", "number", ["number", "number"]) + + QTS_NewArray: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( + "QTS_NewArray", + "number", + ["number"], + ) + + QTS_NewArrayBuffer: ( + ctx: JSContextPointer, + buffer: JSVoidPointer, + length: number, + ) => JSValuePointer = this.module.cwrap("QTS_NewArrayBuffer", "number", [ + "number", + "number", + "number", + ]) + + QTS_NewFloat64: (ctx: JSContextPointer, num: number) => JSValuePointer = this.module.cwrap( + "QTS_NewFloat64", + "number", + ["number", "number"], + ) + + QTS_GetFloat64: (ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer) => number = + this.module.cwrap("QTS_GetFloat64", "number", ["number", "number"]) + + QTS_NewString: (ctx: JSContextPointer, string: BorrowedHeapCharPointer) => JSValuePointer = + this.module.cwrap("QTS_NewString", "number", ["number", "number"]) + + QTS_GetString: ( + ctx: JSContextPointer, + value: JSValuePointer | JSValueConstPointer, + ) => JSBorrowedCharPointer = this.module.cwrap("QTS_GetString", "number", ["number", "number"]) + + QTS_GetArrayBuffer: ( + ctx: JSContextPointer, + data: JSValuePointer | JSValueConstPointer, + ) => JSVoidPointer = this.module.cwrap("QTS_GetArrayBuffer", "number", ["number", "number"]) + + QTS_GetArrayBufferLength: ( + ctx: JSContextPointer, + data: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetArrayBufferLength", "number", ["number", "number"]) + + QTS_NewSymbol: ( + ctx: JSContextPointer, + description: BorrowedHeapCharPointer, + isGlobal: number, + ) => JSValuePointer = this.module.cwrap("QTS_NewSymbol", "number", ["number", "number", "number"]) + + QTS_GetSymbolDescriptionOrKey: ( + ctx: JSContextPointer, + value: JSValuePointer | JSValueConstPointer, + ) => JSBorrowedCharPointer = this.module.cwrap("QTS_GetSymbolDescriptionOrKey", "number", [ + "number", + "number", + ]) + + QTS_IsGlobalSymbol: ( + ctx: JSContextPointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_IsGlobalSymbol", "number", ["number", "number"]) + + QTS_IsJobPending: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_IsJobPending", + "number", + ["number"], + ) + + QTS_ExecutePendingJob: ( + rt: JSRuntimePointer, + maxJobsToExecute: number, + lastJobContext: JSContextPointerPointer, + ) => JSValuePointer = this.module.cwrap("QTS_ExecutePendingJob", "number", [ + "number", + "number", + "number", + ]) + + QTS_GetProp: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: JSValuePointer | JSValueConstPointer, + ) => JSValuePointer = this.module.cwrap("QTS_GetProp", "number", ["number", "number", "number"]) + + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + + QTS_SetProp: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: JSValuePointer | JSValueConstPointer, + prop_value: JSValuePointer | JSValueConstPointer, + ) => void = this.module.cwrap("QTS_SetProp", null, ["number", "number", "number", "number"]) + + QTS_DefineProp: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: JSValuePointer | JSValueConstPointer, + prop_value: JSValuePointer | JSValueConstPointer, + get: JSValuePointer | JSValueConstPointer, + set: JSValuePointer | JSValueConstPointer, + configurable: boolean, + enumerable: boolean, + has_value: boolean, + ) => void = this.module.cwrap("QTS_DefineProp", null, [ + "number", + "number", + "number", + "number", + "number", + "number", + "boolean", + "boolean", + "boolean", + ]) + + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]) + + QTS_Call: ( + ctx: JSContextPointer, + func_obj: JSValuePointer | JSValueConstPointer, + this_obj: JSValuePointer | JSValueConstPointer, + argc: number, + argv_ptrs: JSValueConstPointerPointer, + ) => JSValuePointer = this.module.cwrap("QTS_Call", "number", [ + "number", + "number", + "number", + "number", + "number", + ]) + + QTS_ResolveException: (ctx: JSContextPointer, maybe_exception: JSValuePointer) => JSValuePointer = + this.module.cwrap("QTS_ResolveException", "number", ["number", "number"]) + + QTS_Dump: ( + ctx: JSContextPointer, + obj: JSValuePointer | JSValueConstPointer, + ) => JSBorrowedCharPointer = this.module.cwrap("QTS_Dump", "number", ["number", "number"]) + + QTS_Eval: ( + ctx: JSContextPointer, + js_code: BorrowedHeapCharPointer, + js_code_length: number, + filename: string, + detectModule: EvalDetectModule, + evalFlags: EvalFlags, + ) => JSValuePointer = this.module.cwrap("QTS_Eval", "number", [ + "number", + "number", + "number", + "string", + "number", + "number", + ]) + + QTS_GetModuleNamespace: ( + ctx: JSContextPointer, + module_func_obj: JSValuePointer | JSValueConstPointer, + ) => JSValuePointer = this.module.cwrap("QTS_GetModuleNamespace", "number", ["number", "number"]) + + QTS_Typeof: ( + ctx: JSContextPointer, + value: JSValuePointer | JSValueConstPointer, + ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( + "QTS_GetGlobalObject", + "number", + ["number"], + ) + + QTS_NewPromiseCapability: ( + ctx: JSContextPointer, + resolve_funcs_out: JSValuePointerPointer, + ) => JSValuePointer = this.module.cwrap("QTS_NewPromiseCapability", "number", [ + "number", + "number", + ]) + + QTS_PromiseState: ( + ctx: JSContextPointer, + promise: JSValuePointer | JSValueConstPointer, + ) => JSPromiseStateEnum = this.module.cwrap("QTS_PromiseState", "number", ["number", "number"]) + + QTS_PromiseResult: ( + ctx: JSContextPointer, + promise: JSValuePointer | JSValueConstPointer, + ) => JSValuePointer = this.module.cwrap("QTS_PromiseResult", "number", ["number", "number"]) + + QTS_TestStringArg: (string: string) => void = this.module.cwrap("QTS_TestStringArg", null, [ + "string", + ]) + + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) + + QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) + + QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = + this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + + QTS_ArgvGetJSValueConstPointer: ( + argv: JSValuePointer | JSValueConstPointer, + index: number, + ) => JSValueConstPointer = this.module.cwrap("QTS_ArgvGetJSValueConstPointer", "number", [ + "number", + "number", + ]) + + QTS_RuntimeEnableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap( + "QTS_RuntimeEnableInterruptHandler", + null, + ["number"], + ) + + QTS_RuntimeDisableInterruptHandler: (rt: JSRuntimePointer) => void = this.module.cwrap( + "QTS_RuntimeDisableInterruptHandler", + null, + ["number"], + ) + + QTS_RuntimeEnableModuleLoader: (rt: JSRuntimePointer, use_custom_normalize: number) => void = + this.module.cwrap("QTS_RuntimeEnableModuleLoader", null, ["number", "number"]) + + QTS_RuntimeDisableModuleLoader: (rt: JSRuntimePointer) => void = this.module.cwrap( + "QTS_RuntimeDisableModuleLoader", + null, + ["number"], + ) + + QTS_bjson_encode: ( + ctx: JSContextPointer, + val: JSValuePointer | JSValueConstPointer, + ) => JSValuePointer = this.module.cwrap("QTS_bjson_encode", "number", ["number", "number"]) + + QTS_bjson_decode: ( + ctx: JSContextPointer, + data: JSValuePointer | JSValueConstPointer, + ) => JSValuePointer = this.module.cwrap("QTS_bjson_decode", "number", ["number", "number"]) +} diff --git a/packages/variant-quickjs-asmjs-mjs-release-sync/src/index.ts b/packages/variant-quickjs-asmjs-mjs-release-sync/src/index.ts new file mode 100644 index 00000000..0eaa9f15 --- /dev/null +++ b/packages/variant-quickjs-asmjs-mjs-release-sync/src/index.ts @@ -0,0 +1,24 @@ +import type { QuickJSSyncVariant } from "@jitl/quickjs-ffi-types" +import moduleLoader from "@jitl/quickjs-asmjs-mjs-release-sync/emscripten-module" +import { QuickJSFFI } from "./ffi.js" +/** + * ### @jitl/quickjs-asmjs-mjs-release-sync + * + * [Docs](https://github.com/justjake/quickjs-emscripten/blob/main/doc/@jitl/quickjs-asmjs-mjs-release-sync/README.md) | + * Compiled to pure Javascript, no WebAssembly required. + * + * | Variable | Setting | Description | + * | -- | -- | -- | + * | library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. Version [2024-02-14+36911f0d](https://github.com/bellard/quickjs/commit/36911f0d3ab1a4c190a4d5cbe7c2db225a455389) vendored to quickjs-emscripten on 2024-06-15. | + * | releaseMode | release | Optimized for performance; use when building/deploying your application. | + * | syncMode | sync | The default, normal build. Note that both variants support regular async functions. | + * | emscriptenInclusion | asmjs | The C library code is compiled to Javascript, no WebAssembly used. Sometimes called "asmjs". This is the slowest possible option, and is intended for constrained environments that do not support WebAssembly, like quickjs-for-quickjs. | + * | exports | import | Has these package.json export conditions | + * + */ +const variant: QuickJSSyncVariant = { + type: "sync", + importFFI: () => Promise.resolve(QuickJSFFI), + importModuleLoader: () => Promise.resolve(moduleLoader), +} as const +export default variant diff --git a/packages/variant-quickjs-asmjs-mjs-release-sync/tsconfig.json b/packages/variant-quickjs-asmjs-mjs-release-sync/tsconfig.json new file mode 100644 index 00000000..3a077e27 --- /dev/null +++ b/packages/variant-quickjs-asmjs-mjs-release-sync/tsconfig.json @@ -0,0 +1 @@ +{ "extends": "@jitl/tsconfig/tsconfig.json", "include": ["src/*"], "exclude": ["node_modules"] } diff --git a/packages/variant-quickjs-asmjs-mjs-release-sync/tsup.config.ts b/packages/variant-quickjs-asmjs-mjs-release-sync/tsup.config.ts new file mode 100644 index 00000000..b99f85b0 --- /dev/null +++ b/packages/variant-quickjs-asmjs-mjs-release-sync/tsup.config.ts @@ -0,0 +1,7 @@ +import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" +export default extendConfig({ + entry: ["src/index.ts"], + external: [], + format: ["esm"], + clean: false, +}) diff --git a/packages/variant-quickjs-asmjs-mjs-release-sync/typedoc.json b/packages/variant-quickjs-asmjs-mjs-release-sync/typedoc.json new file mode 100644 index 00000000..e0f02210 --- /dev/null +++ b/packages/variant-quickjs-asmjs-mjs-release-sync/typedoc.json @@ -0,0 +1 @@ +{ "extends": "../../typedoc.base.js", "entryPoints": ["./src/index.ts"], "mergeReadme": true } diff --git a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile index 16fa99c8..8c2b2a38 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/package.json b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/package.json index 3bae4dd1..bfe2a4f4 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/package.json +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-ng-wasmfile-debug-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { diff --git a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/tsup.config.ts b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/tsup.config.ts index 30451ad2..d2ab789b 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/tsup.config.ts +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], external: ["@jitl/quickjs-ng-wasmfile-debug-asyncify/emscripten-module"], - formats: ["esm", "cjs"], + format: ["esm", "cjs"], clean: false, }) diff --git a/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile b/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile index ef572faa..8eab16ee 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-ng-wasmfile-debug-sync/package.json b/packages/variant-quickjs-ng-wasmfile-debug-sync/package.json index 5679565d..0fd01f15 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/package.json +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-ng-wasmfile-debug-sync", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { diff --git a/packages/variant-quickjs-ng-wasmfile-debug-sync/tsup.config.ts b/packages/variant-quickjs-ng-wasmfile-debug-sync/tsup.config.ts index 11d9a581..da548d8b 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/tsup.config.ts +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], external: ["@jitl/quickjs-ng-wasmfile-debug-sync/emscripten-module"], - formats: ["esm", "cjs"], + format: ["esm", "cjs"], clean: false, }) diff --git a/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile b/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile index fa97b618..66dc3f74 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-ng-wasmfile-release-asyncify/package.json b/packages/variant-quickjs-ng-wasmfile-release-asyncify/package.json index 90964565..0378d772 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-asyncify/package.json +++ b/packages/variant-quickjs-ng-wasmfile-release-asyncify/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-ng-wasmfile-release-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { diff --git a/packages/variant-quickjs-ng-wasmfile-release-asyncify/tsup.config.ts b/packages/variant-quickjs-ng-wasmfile-release-asyncify/tsup.config.ts index 998c3ddb..c762d2ff 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-asyncify/tsup.config.ts +++ b/packages/variant-quickjs-ng-wasmfile-release-asyncify/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], external: ["@jitl/quickjs-ng-wasmfile-release-asyncify/emscripten-module"], - formats: ["esm", "cjs"], + format: ["esm", "cjs"], clean: false, }) diff --git a/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile b/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile index 6f37e049..ce4a8ce7 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-ng-wasmfile-release-sync/package.json b/packages/variant-quickjs-ng-wasmfile-release-sync/package.json index 4ea60895..8c6052f0 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-sync/package.json +++ b/packages/variant-quickjs-ng-wasmfile-release-sync/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-ng-wasmfile-release-sync", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { diff --git a/packages/variant-quickjs-ng-wasmfile-release-sync/tsup.config.ts b/packages/variant-quickjs-ng-wasmfile-release-sync/tsup.config.ts index 6636095e..ec030821 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-sync/tsup.config.ts +++ b/packages/variant-quickjs-ng-wasmfile-release-sync/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], external: ["@jitl/quickjs-ng-wasmfile-release-sync/emscripten-module"], - formats: ["esm", "cjs"], + format: ["esm", "cjs"], clean: false, }) diff --git a/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile index 97ac9d0e..84953e75 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-singlefile-browser-debug-asyncify/package.json b/packages/variant-quickjs-singlefile-browser-debug-asyncify/package.json index 7132e03c..b1c8b4b0 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/package.json +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-singlefile-browser-debug-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with the WASM data embedded into a browser ESModule.", "sideEffects": false, "repository": { @@ -38,14 +38,15 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.browser.d.ts", "browser": "./dist/emscripten-module.browser.mjs", - "import": "./dist/emscripten-module.browser.mjs" + "import": "./dist/emscripten-module.browser.mjs", + "default": "./dist/emscripten-module.browser.mjs" } }, "dependencies": { diff --git a/packages/variant-quickjs-singlefile-browser-debug-asyncify/tsup.config.ts b/packages/variant-quickjs-singlefile-browser-debug-asyncify/tsup.config.ts index 3501a3d1..fbd0f507 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/tsup.config.ts +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], - external: ["@jitl/quickjs-singlefile-browser-debug-asyncify/emscripten-module"], - formats: ["esm"], + external: [], + format: ["esm"], clean: false, }) diff --git a/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile b/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile index 20313d1e..199a275a 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-singlefile-browser-debug-sync/package.json b/packages/variant-quickjs-singlefile-browser-debug-sync/package.json index 8b10ac76..d1a257a6 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/package.json +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-singlefile-browser-debug-sync", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with the WASM data embedded into a browser ESModule.", "sideEffects": false, "repository": { @@ -38,14 +38,15 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.browser.d.ts", "browser": "./dist/emscripten-module.browser.mjs", - "import": "./dist/emscripten-module.browser.mjs" + "import": "./dist/emscripten-module.browser.mjs", + "default": "./dist/emscripten-module.browser.mjs" } }, "dependencies": { diff --git a/packages/variant-quickjs-singlefile-browser-debug-sync/tsup.config.ts b/packages/variant-quickjs-singlefile-browser-debug-sync/tsup.config.ts index 4b7e31f3..fbd0f507 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/tsup.config.ts +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], - external: ["@jitl/quickjs-singlefile-browser-debug-sync/emscripten-module"], - formats: ["esm"], + external: [], + format: ["esm"], clean: false, }) diff --git a/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile index 61068155..fbb8c343 100644 --- a/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-singlefile-browser-release-asyncify/package.json b/packages/variant-quickjs-singlefile-browser-release-asyncify/package.json index 909b3359..d85ff42f 100644 --- a/packages/variant-quickjs-singlefile-browser-release-asyncify/package.json +++ b/packages/variant-quickjs-singlefile-browser-release-asyncify/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-singlefile-browser-release-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with the WASM data embedded into a browser ESModule.", "sideEffects": false, "repository": { @@ -38,14 +38,15 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.browser.d.ts", "browser": "./dist/emscripten-module.browser.mjs", - "import": "./dist/emscripten-module.browser.mjs" + "import": "./dist/emscripten-module.browser.mjs", + "default": "./dist/emscripten-module.browser.mjs" } }, "dependencies": { diff --git a/packages/variant-quickjs-singlefile-browser-release-asyncify/tsup.config.ts b/packages/variant-quickjs-singlefile-browser-release-asyncify/tsup.config.ts index 1aee367f..fbd0f507 100644 --- a/packages/variant-quickjs-singlefile-browser-release-asyncify/tsup.config.ts +++ b/packages/variant-quickjs-singlefile-browser-release-asyncify/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], - external: ["@jitl/quickjs-singlefile-browser-release-asyncify/emscripten-module"], - formats: ["esm"], + external: [], + format: ["esm"], clean: false, }) diff --git a/packages/variant-quickjs-singlefile-browser-release-sync/Makefile b/packages/variant-quickjs-singlefile-browser-release-sync/Makefile index 66f97d57..1b881b01 100644 --- a/packages/variant-quickjs-singlefile-browser-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-browser-release-sync/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-singlefile-browser-release-sync/package.json b/packages/variant-quickjs-singlefile-browser-release-sync/package.json index 945b0bd4..1f307870 100644 --- a/packages/variant-quickjs-singlefile-browser-release-sync/package.json +++ b/packages/variant-quickjs-singlefile-browser-release-sync/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-singlefile-browser-release-sync", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with the WASM data embedded into a browser ESModule.", "sideEffects": false, "repository": { @@ -38,14 +38,15 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.browser.d.ts", "browser": "./dist/emscripten-module.browser.mjs", - "import": "./dist/emscripten-module.browser.mjs" + "import": "./dist/emscripten-module.browser.mjs", + "default": "./dist/emscripten-module.browser.mjs" } }, "dependencies": { diff --git a/packages/variant-quickjs-singlefile-browser-release-sync/tsup.config.ts b/packages/variant-quickjs-singlefile-browser-release-sync/tsup.config.ts index 604b63ee..fbd0f507 100644 --- a/packages/variant-quickjs-singlefile-browser-release-sync/tsup.config.ts +++ b/packages/variant-quickjs-singlefile-browser-release-sync/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], - external: ["@jitl/quickjs-singlefile-browser-release-sync/emscripten-module"], - formats: ["esm"], + external: [], + format: ["esm"], clean: false, }) diff --git a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile index 4fd5522f..e9f520c1 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/package.json b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/package.json index d7eac754..08566d6d 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/package.json +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-singlefile-cjs-debug-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with the WASM data embedded into a universal (Node and Browser compatible) CommonJS module.", "sideEffects": false, "repository": { diff --git a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/tsup.config.ts b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/tsup.config.ts index 1ae4be23..1e0a2f62 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/tsup.config.ts +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], - external: ["@jitl/quickjs-singlefile-cjs-debug-asyncify/emscripten-module"], - formats: ["cjs"], + external: [], + format: ["cjs"], clean: false, }) diff --git a/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile b/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile index 2d3fd16e..1f65e61b 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-singlefile-cjs-debug-sync/package.json b/packages/variant-quickjs-singlefile-cjs-debug-sync/package.json index 8e70b579..76e50399 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/package.json +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-singlefile-cjs-debug-sync", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with the WASM data embedded into a universal (Node and Browser compatible) CommonJS module.", "sideEffects": false, "repository": { diff --git a/packages/variant-quickjs-singlefile-cjs-debug-sync/tsup.config.ts b/packages/variant-quickjs-singlefile-cjs-debug-sync/tsup.config.ts index 557d0270..1e0a2f62 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/tsup.config.ts +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], - external: ["@jitl/quickjs-singlefile-cjs-debug-sync/emscripten-module"], - formats: ["cjs"], + external: [], + format: ["cjs"], clean: false, }) diff --git a/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile index b2c3f5e4..a9566b72 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-singlefile-cjs-release-asyncify/package.json b/packages/variant-quickjs-singlefile-cjs-release-asyncify/package.json index 3f37cece..59d3211f 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-asyncify/package.json +++ b/packages/variant-quickjs-singlefile-cjs-release-asyncify/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-singlefile-cjs-release-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with the WASM data embedded into a universal (Node and Browser compatible) CommonJS module.", "sideEffects": false, "repository": { diff --git a/packages/variant-quickjs-singlefile-cjs-release-asyncify/tsup.config.ts b/packages/variant-quickjs-singlefile-cjs-release-asyncify/tsup.config.ts index ecb57989..1e0a2f62 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-asyncify/tsup.config.ts +++ b/packages/variant-quickjs-singlefile-cjs-release-asyncify/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], - external: ["@jitl/quickjs-singlefile-cjs-release-asyncify/emscripten-module"], - formats: ["cjs"], + external: [], + format: ["cjs"], clean: false, }) diff --git a/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile b/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile index c29d2205..29392d85 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-singlefile-cjs-release-sync/package.json b/packages/variant-quickjs-singlefile-cjs-release-sync/package.json index 7b93a7b5..4a16a753 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-sync/package.json +++ b/packages/variant-quickjs-singlefile-cjs-release-sync/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-singlefile-cjs-release-sync", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with the WASM data embedded into a universal (Node and Browser compatible) CommonJS module.", "sideEffects": false, "repository": { diff --git a/packages/variant-quickjs-singlefile-cjs-release-sync/tsup.config.ts b/packages/variant-quickjs-singlefile-cjs-release-sync/tsup.config.ts index c6a76e67..1e0a2f62 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-sync/tsup.config.ts +++ b/packages/variant-quickjs-singlefile-cjs-release-sync/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], - external: ["@jitl/quickjs-singlefile-cjs-release-sync/emscripten-module"], - formats: ["cjs"], + external: [], + format: ["cjs"], clean: false, }) diff --git a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile index 3137c992..9c0abf44 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/package.json b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/package.json index dd71b0c5..9b8b0ab1 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/package.json +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-singlefile-mjs-debug-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with the WASM data embedded into a NodeJS ESModule.", "sideEffects": false, "repository": { @@ -37,13 +37,14 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.d.ts", - "import": "./dist/emscripten-module.mjs" + "import": "./dist/emscripten-module.mjs", + "default": "./dist/emscripten-module.mjs" } }, "dependencies": { diff --git a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/tsup.config.ts b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/tsup.config.ts index 6a96f502..fbd0f507 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/tsup.config.ts +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], - external: ["@jitl/quickjs-singlefile-mjs-debug-asyncify/emscripten-module"], - formats: ["esm"], + external: [], + format: ["esm"], clean: false, }) diff --git a/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile b/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile index f3fb14a2..855979a5 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-singlefile-mjs-debug-sync/package.json b/packages/variant-quickjs-singlefile-mjs-debug-sync/package.json index 4cf9837c..3fd03693 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/package.json +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-singlefile-mjs-debug-sync", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with the WASM data embedded into a NodeJS ESModule.", "sideEffects": false, "repository": { @@ -37,13 +37,14 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.d.ts", - "import": "./dist/emscripten-module.mjs" + "import": "./dist/emscripten-module.mjs", + "default": "./dist/emscripten-module.mjs" } }, "dependencies": { diff --git a/packages/variant-quickjs-singlefile-mjs-debug-sync/tsup.config.ts b/packages/variant-quickjs-singlefile-mjs-debug-sync/tsup.config.ts index 6a6d5598..fbd0f507 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/tsup.config.ts +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], - external: ["@jitl/quickjs-singlefile-mjs-debug-sync/emscripten-module"], - formats: ["esm"], + external: [], + format: ["esm"], clean: false, }) diff --git a/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile index 7e6179a2..4e1b8a1a 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-singlefile-mjs-release-asyncify/package.json b/packages/variant-quickjs-singlefile-mjs-release-asyncify/package.json index 4b4a1056..76c1bbe2 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-asyncify/package.json +++ b/packages/variant-quickjs-singlefile-mjs-release-asyncify/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-singlefile-mjs-release-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with the WASM data embedded into a NodeJS ESModule.", "sideEffects": false, "repository": { @@ -37,13 +37,14 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.d.ts", - "import": "./dist/emscripten-module.mjs" + "import": "./dist/emscripten-module.mjs", + "default": "./dist/emscripten-module.mjs" } }, "dependencies": { diff --git a/packages/variant-quickjs-singlefile-mjs-release-asyncify/tsup.config.ts b/packages/variant-quickjs-singlefile-mjs-release-asyncify/tsup.config.ts index 7645627d..fbd0f507 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-asyncify/tsup.config.ts +++ b/packages/variant-quickjs-singlefile-mjs-release-asyncify/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], - external: ["@jitl/quickjs-singlefile-mjs-release-asyncify/emscripten-module"], - formats: ["esm"], + external: [], + format: ["esm"], clean: false, }) diff --git a/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile b/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile index a7548983..dac0b9c3 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-singlefile-mjs-release-sync/package.json b/packages/variant-quickjs-singlefile-mjs-release-sync/package.json index 98b56bdc..1f327fc6 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-sync/package.json +++ b/packages/variant-quickjs-singlefile-mjs-release-sync/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-singlefile-mjs-release-sync", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with the WASM data embedded into a NodeJS ESModule.", "sideEffects": false, "repository": { @@ -37,13 +37,14 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.d.ts", - "import": "./dist/emscripten-module.mjs" + "import": "./dist/emscripten-module.mjs", + "default": "./dist/emscripten-module.mjs" } }, "dependencies": { diff --git a/packages/variant-quickjs-singlefile-mjs-release-sync/tsup.config.ts b/packages/variant-quickjs-singlefile-mjs-release-sync/tsup.config.ts index 5de3be3b..fbd0f507 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-sync/tsup.config.ts +++ b/packages/variant-quickjs-singlefile-mjs-release-sync/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], - external: ["@jitl/quickjs-singlefile-mjs-release-sync/emscripten-module"], - formats: ["esm"], + external: [], + format: ["esm"], clean: false, }) diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile index 64ce94bb..f0f6d634 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/package.json b/packages/variant-quickjs-wasmfile-debug-asyncify/package.json index 9f180418..640f63a2 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/package.json +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-wasmfile-debug-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/tsup.config.ts b/packages/variant-quickjs-wasmfile-debug-asyncify/tsup.config.ts index 20b4be35..be8403fb 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/tsup.config.ts +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], external: ["@jitl/quickjs-wasmfile-debug-asyncify/emscripten-module"], - formats: ["esm", "cjs"], + format: ["esm", "cjs"], clean: false, }) diff --git a/packages/variant-quickjs-wasmfile-debug-sync/Makefile b/packages/variant-quickjs-wasmfile-debug-sync/Makefile index 1e379e0b..10075fa1 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/Makefile +++ b/packages/variant-quickjs-wasmfile-debug-sync/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-wasmfile-debug-sync/package.json b/packages/variant-quickjs-wasmfile-debug-sync/package.json index d14559f1..aef52149 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/package.json +++ b/packages/variant-quickjs-wasmfile-debug-sync/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-wasmfile-debug-sync", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { diff --git a/packages/variant-quickjs-wasmfile-debug-sync/tsup.config.ts b/packages/variant-quickjs-wasmfile-debug-sync/tsup.config.ts index 308bc138..89164775 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/tsup.config.ts +++ b/packages/variant-quickjs-wasmfile-debug-sync/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], external: ["@jitl/quickjs-wasmfile-debug-sync/emscripten-module"], - formats: ["esm", "cjs"], + format: ["esm", "cjs"], clean: false, }) diff --git a/packages/variant-quickjs-wasmfile-release-asyncify/Makefile b/packages/variant-quickjs-wasmfile-release-asyncify/Makefile index 809201bb..467cbe41 100644 --- a/packages/variant-quickjs-wasmfile-release-asyncify/Makefile +++ b/packages/variant-quickjs-wasmfile-release-asyncify/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-wasmfile-release-asyncify/package.json b/packages/variant-quickjs-wasmfile-release-asyncify/package.json index 6f063e66..984722a1 100644 --- a/packages/variant-quickjs-wasmfile-release-asyncify/package.json +++ b/packages/variant-quickjs-wasmfile-release-asyncify/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-wasmfile-release-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { diff --git a/packages/variant-quickjs-wasmfile-release-asyncify/tsup.config.ts b/packages/variant-quickjs-wasmfile-release-asyncify/tsup.config.ts index 336b998c..b2b3fed9 100644 --- a/packages/variant-quickjs-wasmfile-release-asyncify/tsup.config.ts +++ b/packages/variant-quickjs-wasmfile-release-asyncify/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], external: ["@jitl/quickjs-wasmfile-release-asyncify/emscripten-module"], - formats: ["esm", "cjs"], + format: ["esm", "cjs"], clean: false, }) diff --git a/packages/variant-quickjs-wasmfile-release-sync/Makefile b/packages/variant-quickjs-wasmfile-release-sync/Makefile index 750e7b6c..8b19b6aa 100644 --- a/packages/variant-quickjs-wasmfile-release-sync/Makefile +++ b/packages/variant-quickjs-wasmfile-release-sync/Makefile @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/packages/variant-quickjs-wasmfile-release-sync/package.json b/packages/variant-quickjs-wasmfile-release-sync/package.json index d0773477..402f798b 100644 --- a/packages/variant-quickjs-wasmfile-release-sync/package.json +++ b/packages/variant-quickjs-wasmfile-release-sync/package.json @@ -1,7 +1,7 @@ { "name": "@jitl/quickjs-wasmfile-release-sync", "license": "MIT", - "version": "0.30.0", + "version": "0.31.0", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { diff --git a/packages/variant-quickjs-wasmfile-release-sync/tsup.config.ts b/packages/variant-quickjs-wasmfile-release-sync/tsup.config.ts index 09592773..c6b1441d 100644 --- a/packages/variant-quickjs-wasmfile-release-sync/tsup.config.ts +++ b/packages/variant-quickjs-wasmfile-release-sync/tsup.config.ts @@ -1,8 +1,7 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ entry: ["src/index.ts", "src/ffi.ts"], external: ["@jitl/quickjs-wasmfile-release-sync/emscripten-module"], - formats: ["esm", "cjs"], + format: ["esm", "cjs"], clean: false, }) diff --git a/scripts/prepareVariants.ts b/scripts/prepareVariants.ts index 7c683b4d..f29040b1 100755 --- a/scripts/prepareVariants.ts +++ b/scripts/prepareVariants.ts @@ -34,6 +34,7 @@ enum CLibrary { enum EmscriptenInclusion { SingleFile = "singlefile", Separate = "wasm", + AsmJs = "asmjs", } // https://github.com/emscripten-core/emscripten/blob/7bed0e2477000603c26766897e1f455c08bc3358/src/settings.js#L647 @@ -124,6 +125,22 @@ const targets = { browser: SEPARATE_FILE_INCLUSION.browser, }, }), + "asmjs-mjs": makeTarget({ + description: `Compiled to pure Javascript, no WebAssembly required.`, + emscriptenInclusion: EmscriptenInclusion.AsmJs, + releaseMode: ReleaseMode.Release, + syncMode: SyncMode.Sync, + library: CLibrary.QuickJS, + exports: { + import: { + emscriptenEnvironment: [ + EmscriptenEnvironment.web, + EmscriptenEnvironment.worker, + EmscriptenEnvironment.node, + ], + }, + }, + }), } type TargetSpec = Partial & @@ -205,6 +222,7 @@ const ReleaseModeFlags = { const EmscriptenInclusionFlags = { [EmscriptenInclusion.Separate]: [], [EmscriptenInclusion.SingleFile]: [`-s SINGLE_FILE=1`], + [EmscriptenInclusion.AsmJs]: [`-s WASM=0`, `-s SINGLE_FILE=1`], } function getCflags(targetName: string, variant: BuildVariant) { @@ -283,7 +301,6 @@ interface FinalVariant { dir: string packageJson: PackageJson variant: BuildVariant - indexJs: string } async function main() { @@ -348,6 +365,32 @@ async function main() { main: js ? "./dist/index.js" : "./dist/index.mjs", module: mjs ? "./dist/index.mjs" : undefined, } + const ffiExports = { + types: js ? "./dist/ffi.d.ts" : "./dist/ffi.d.mts", + import: mjs ? "./dist/ffi.mjs" : "./dist/ffi.js", + require: js ? "./dist/ffi.js" : undefined, + default: js ? "./dist/ffi.js" : "./dist/ffi.mjs", + } + const emscriptenExports = { + types: variant.exports.browser + ? "./dist/emscripten-module.browser.d.ts" + : "./dist/emscripten-module.d.ts", + iife: variant.exports.require ? "./dist/emscripten-module.cjs" : undefined, + workerd: variant.exports.workerd ? "./dist/emscripten-module.cloudflare.cjs" : undefined, + browser: variant.exports.browser ? "./dist/emscripten-module.browser.mjs" : undefined, + import: variant.exports.import + ? "./dist/emscripten-module.mjs" + : variant.exports.browser + ? "./dist/emscripten-module.browser.mjs" + : "./dist/emscripten-module.cjs", + require: variant.exports.require ? "./dist/emscripten-module.cjs" : undefined, + default: variant.exports.require ? "./dist/emscripten-module.cjs" : undefined, + } + emscriptenExports.default = + emscriptenExports.default ?? + emscriptenExports.require ?? + emscriptenExports.import ?? + emscriptenExports.browser const packageJson: PackageJson = { name: `@jitl/${basename}`, @@ -384,33 +427,13 @@ async function main() { default: indexExports.main, }, "./package.json": "./package.json", - "./ffi": { - types: "./dist/ffi.d.ts", - import: mjs ? "./dist/ffi.mjs" : "./dist/ffi.js", - require: js ? "./dist/ffi.js" : undefined, - default: js ? "./dist/ffi.js" : "./dist/ffi.mjs", - }, + "./ffi": + variant.emscriptenInclusion !== EmscriptenInclusion.AsmJs ? ffiExports : undefined, "./wasm": variant.emscriptenInclusion === EmscriptenInclusion.Separate ? "./dist/emscripten-module.wasm" : undefined, - "./emscripten-module": { - types: variant.exports.browser - ? "./dist/emscripten-module.browser.d.ts" - : "./dist/emscripten-module.d.ts", - iife: variant.exports.require ? "./dist/emscripten-module.cjs" : undefined, - workerd: variant.exports.workerd - ? "./dist/emscripten-module.cloudflare.cjs" - : undefined, - browser: variant.exports.browser ? "./dist/emscripten-module.browser.mjs" : undefined, - import: variant.exports.import - ? "./dist/emscripten-module.mjs" - : variant.exports.browser - ? "./dist/emscripten-module.browser.mjs" - : "./dist/emscripten-module.cjs", - require: variant.exports.require ? "./dist/emscripten-module.cjs" : undefined, - default: variant.exports.require ? "./dist/emscripten-module.cjs" : undefined, - }, + "./emscripten-module": emscriptenExports, }, dependencies: { "@jitl/quickjs-ffi-types": "workspace:*", @@ -434,14 +457,19 @@ async function main() { targetName, dir: path.relative(repoRoot, dir), packageJson, - indexJs: path.relative(repoRoot, path.join(dist, "index.js")), variant, } if (finalVariant.dir in variantsJson) { throw new Error(`Duplicate variant dir ${finalVariant.dir}`) } - variantsJson[finalVariant.dir] = finalVariant + variantsJson[finalVariant.dir] = { + ...finalVariant, + packageJson: { + ...finalVariant.packageJson, + version: "(omitted)", + }, + } await writePretty(path.join(dir, "package.json"), JSON.stringify(packageJson)) await writePretty(path.join(dir, "LICENSE"), renderLicense(targetName, variant)) @@ -470,6 +498,7 @@ async function main() { const describeInclusion = { [EmscriptenInclusion.SingleFile]: `The WASM runtime is included directly in the JS file. Use if you run into issues with missing .wasm files when building or deploying your app.`, [EmscriptenInclusion.Separate]: `Has a separate .wasm file. May offer better caching in your browser, and reduces the size of your JS bundle. If you have issues, try a 'singlefile' variant.`, + [EmscriptenInclusion.AsmJs]: `The C library code is compiled to Javascript, no WebAssembly used. Sometimes called "asmjs". This is the slowest possible option, and is intended for constrained environments that do not support WebAssembly, like quickjs-for-quickjs.`, } const describeMode = { @@ -728,6 +757,24 @@ function renderIndexTs( [SyncMode.Asyncify]: "QuickJSAsyncVariant", }[variant.syncMode] + if (variant.emscriptenInclusion === EmscriptenInclusion.AsmJs) { + // Eager loading please! + return ` +import type { ${variantTypeName} } from '@jitl/quickjs-ffi-types' +import moduleLoader from '${packageJson.name}/emscripten-module' +import { ${className} } from './ffi.js' +/** +${docComment} + */ +const variant: ${variantTypeName} = { + type: '${modeName}', + importFFI: () => Promise.resolve(${className}), + importModuleLoader: () => Promise.resolve(moduleLoader), +} as const +export default variant +` + } + return ` import type { ${variantTypeName} } from '@jitl/quickjs-ffi-types' @@ -769,16 +816,26 @@ function getTsupExtensions(variant: BuildVariant) { function renderTsupConfig(variant: BuildVariant, packageJson: PackageJson): string { const { js, mjs } = getTsupExtensions(variant) + const external: string[] = [] + const needsExternal = + [variant.exports.browser, variant.exports.import, variant.exports.require].filter(Boolean) + .length > 1 + if (needsExternal) { + external.push(`${packageJson.name}/emscripten-module`) + } + + const entry = ["src/index.ts"] + if (variant.emscriptenInclusion !== EmscriptenInclusion.AsmJs) { + entry.push("src/ffi.ts") + } + const formats = [mjs && "esm", js && "cjs"].filter(Boolean) return ` import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" - export default extendConfig({ - entry: ["src/index.ts", "src/ffi.ts"], - external: [ - "${packageJson.name}/emscripten-module", - ], - formats: ${JSON.stringify(formats)}, + entry: ${JSON.stringify(entry)}, + external: ${JSON.stringify(external)}, + format: ${JSON.stringify(formats)}, clean: false, }) ` diff --git a/templates/Variant.mk b/templates/Variant.mk index 2bfcf7e2..fd4711d3 100644 --- a/templates/Variant.mk +++ b/templates/Variant.mk @@ -1,6 +1,6 @@ # Tools -EMSDK_VERSION=3.1.64 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 +EMSDK_VERSION=3.1.65 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.65 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts @@ -38,7 +38,6 @@ EMCC_EXPORTED_FUNCS+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.json EMCC_EXPORTED_FUNCS_ASYNCIFY+=-s EXPORTED_FUNCTIONS=@$(BUILD_WRAPPER)/symbols.asyncify.json # Emscripten options -CFLAGS_WASM+=-s WASM=1 CFLAGS_WASM+=-s EXPORTED_RUNTIME_METHODS=@../../exportedRuntimeMethods.json CFLAGS_WASM+=-s MODULARIZE=1 CFLAGS_WASM+=-s IMPORTED_MEMORY=1 # Allow passing WASM memory to Emscripten diff --git a/variants.json b/variants.json index 6264c434..853cf8f0 100644 --- a/variants.json +++ b/variants.json @@ -6,7 +6,7 @@ "packageJson": { "name": "@jitl/quickjs-wasmfile-debug-sync", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -51,7 +51,6 @@ }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-wasmfile-debug-sync/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "debug", @@ -73,7 +72,7 @@ "packageJson": { "name": "@jitl/quickjs-wasmfile-debug-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -118,7 +117,6 @@ }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-wasmfile-debug-asyncify/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "debug", @@ -140,7 +138,7 @@ "packageJson": { "name": "@jitl/quickjs-wasmfile-release-sync", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -185,7 +183,6 @@ }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-wasmfile-release-sync/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "release", @@ -207,7 +204,7 @@ "packageJson": { "name": "@jitl/quickjs-wasmfile-release-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -252,7 +249,6 @@ }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-wasmfile-release-asyncify/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "release", @@ -274,7 +270,7 @@ "packageJson": { "name": "@jitl/quickjs-ng-wasmfile-debug-sync", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -319,7 +315,6 @@ }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-ng-wasmfile-debug-sync/dist/index.js", "variant": { "library": "quickjs-ng", "releaseMode": "debug", @@ -341,7 +336,7 @@ "packageJson": { "name": "@jitl/quickjs-ng-wasmfile-debug-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -386,7 +381,6 @@ }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-ng-wasmfile-debug-asyncify/dist/index.js", "variant": { "library": "quickjs-ng", "releaseMode": "debug", @@ -408,7 +402,7 @@ "packageJson": { "name": "@jitl/quickjs-ng-wasmfile-release-sync", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -453,7 +447,6 @@ }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-ng-wasmfile-release-sync/dist/index.js", "variant": { "library": "quickjs-ng", "releaseMode": "release", @@ -475,7 +468,7 @@ "packageJson": { "name": "@jitl/quickjs-ng-wasmfile-release-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -520,7 +513,6 @@ }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-ng-wasmfile-release-asyncify/dist/index.js", "variant": { "library": "quickjs-ng", "releaseMode": "release", @@ -542,7 +534,7 @@ "packageJson": { "name": "@jitl/quickjs-singlefile-cjs-debug-sync", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with the WASM data embedded into a universal (Node and Browser compatible) CommonJS module.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -582,7 +574,6 @@ }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-singlefile-cjs-debug-sync/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "debug", @@ -599,7 +590,7 @@ "packageJson": { "name": "@jitl/quickjs-singlefile-cjs-debug-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with the WASM data embedded into a universal (Node and Browser compatible) CommonJS module.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -639,7 +630,6 @@ }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-singlefile-cjs-debug-asyncify/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "debug", @@ -656,7 +646,7 @@ "packageJson": { "name": "@jitl/quickjs-singlefile-cjs-release-sync", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with the WASM data embedded into a universal (Node and Browser compatible) CommonJS module.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -696,7 +686,6 @@ }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-singlefile-cjs-release-sync/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "release", @@ -713,7 +702,7 @@ "packageJson": { "name": "@jitl/quickjs-singlefile-cjs-release-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with the WASM data embedded into a universal (Node and Browser compatible) CommonJS module.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -753,7 +742,6 @@ }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-singlefile-cjs-release-asyncify/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "release", @@ -770,7 +758,7 @@ "packageJson": { "name": "@jitl/quickjs-singlefile-mjs-debug-sync", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with the WASM data embedded into a NodeJS ESModule.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -795,18 +783,18 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.d.ts", - "import": "./dist/emscripten-module.mjs" + "import": "./dist/emscripten-module.mjs", + "default": "./dist/emscripten-module.mjs" } }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-singlefile-mjs-debug-sync/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "debug", @@ -823,7 +811,7 @@ "packageJson": { "name": "@jitl/quickjs-singlefile-mjs-debug-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with the WASM data embedded into a NodeJS ESModule.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -848,18 +836,18 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.d.ts", - "import": "./dist/emscripten-module.mjs" + "import": "./dist/emscripten-module.mjs", + "default": "./dist/emscripten-module.mjs" } }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-singlefile-mjs-debug-asyncify/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "debug", @@ -876,7 +864,7 @@ "packageJson": { "name": "@jitl/quickjs-singlefile-mjs-release-sync", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with the WASM data embedded into a NodeJS ESModule.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -901,18 +889,18 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.d.ts", - "import": "./dist/emscripten-module.mjs" + "import": "./dist/emscripten-module.mjs", + "default": "./dist/emscripten-module.mjs" } }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-singlefile-mjs-release-sync/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "release", @@ -929,7 +917,7 @@ "packageJson": { "name": "@jitl/quickjs-singlefile-mjs-release-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with the WASM data embedded into a NodeJS ESModule.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -954,18 +942,18 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.d.ts", - "import": "./dist/emscripten-module.mjs" + "import": "./dist/emscripten-module.mjs", + "default": "./dist/emscripten-module.mjs" } }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-singlefile-mjs-release-asyncify/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "release", @@ -982,7 +970,7 @@ "packageJson": { "name": "@jitl/quickjs-singlefile-browser-debug-sync", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with the WASM data embedded into a browser ESModule.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -1008,19 +996,19 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.browser.d.ts", "browser": "./dist/emscripten-module.browser.mjs", - "import": "./dist/emscripten-module.browser.mjs" + "import": "./dist/emscripten-module.browser.mjs", + "default": "./dist/emscripten-module.browser.mjs" } }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-singlefile-browser-debug-sync/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "debug", @@ -1037,7 +1025,7 @@ "packageJson": { "name": "@jitl/quickjs-singlefile-browser-debug-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with the WASM data embedded into a browser ESModule.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -1063,19 +1051,19 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.browser.d.ts", "browser": "./dist/emscripten-module.browser.mjs", - "import": "./dist/emscripten-module.browser.mjs" + "import": "./dist/emscripten-module.browser.mjs", + "default": "./dist/emscripten-module.browser.mjs" } }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-singlefile-browser-debug-asyncify/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "debug", @@ -1092,7 +1080,7 @@ "packageJson": { "name": "@jitl/quickjs-singlefile-browser-release-sync", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with the WASM data embedded into a browser ESModule.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -1118,19 +1106,19 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.browser.d.ts", "browser": "./dist/emscripten-module.browser.mjs", - "import": "./dist/emscripten-module.browser.mjs" + "import": "./dist/emscripten-module.browser.mjs", + "default": "./dist/emscripten-module.browser.mjs" } }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-singlefile-browser-release-sync/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "release", @@ -1147,7 +1135,7 @@ "packageJson": { "name": "@jitl/quickjs-singlefile-browser-release-asyncify", "license": "MIT", - "version": "0.30.0", + "version": "(omitted)", "description": "Variant of quickjs library: Variant with the WASM data embedded into a browser ESModule.", "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, @@ -1173,19 +1161,19 @@ }, "./package.json": "./package.json", "./ffi": { - "types": "./dist/ffi.d.ts", + "types": "./dist/ffi.d.mts", "import": "./dist/ffi.mjs", "default": "./dist/ffi.mjs" }, "./emscripten-module": { "types": "./dist/emscripten-module.browser.d.ts", "browser": "./dist/emscripten-module.browser.mjs", - "import": "./dist/emscripten-module.browser.mjs" + "import": "./dist/emscripten-module.browser.mjs", + "default": "./dist/emscripten-module.browser.mjs" } }, "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } }, - "indexJs": "packages/variant-quickjs-singlefile-browser-release-asyncify/dist/index.js", "variant": { "library": "quickjs", "releaseMode": "release", @@ -1194,5 +1182,53 @@ "emscriptenInclusion": "singlefile", "exports": { "browser": { "emscriptenEnvironment": ["web", "worker"] } } } + }, + "packages/variant-quickjs-asmjs-mjs-release-sync": { + "basename": "quickjs-asmjs-mjs-release-sync", + "targetName": "asmjs-mjs", + "dir": "packages/variant-quickjs-asmjs-mjs-release-sync", + "packageJson": { + "name": "@jitl/quickjs-asmjs-mjs-release-sync", + "license": "MIT", + "version": "(omitted)", + "description": "Variant of quickjs library: Compiled to pure Javascript, no WebAssembly required.", + "sideEffects": false, + "repository": { "type": "git", "url": "https://github.com/justjake/quickjs-emscripten" }, + "author": { "name": "Jake Teton-Landis", "url": "https://jake.tl" }, + "scripts": { + "build": "yarn build:c && yarn build:ts", + "build:c": "make -j2", + "build:ts": "npx tsup", + "check:types": "npx tsc --project . --noEmit", + "clean": "make clean", + "prepare": "yarn clean && yarn build" + }, + "files": ["LICENSE", "README.md", "dist/**/*", "!dist/*.tsbuildinfo"], + "types": "./dist/index.d.mts", + "main": "./dist/index.mjs", + "module": "./dist/index.mjs", + "exports": { + ".": { + "types": "./dist/index.d.mts", + "import": "./dist/index.mjs", + "default": "./dist/index.mjs" + }, + "./package.json": "./package.json", + "./emscripten-module": { + "types": "./dist/emscripten-module.d.ts", + "import": "./dist/emscripten-module.mjs", + "default": "./dist/emscripten-module.mjs" + } + }, + "dependencies": { "@jitl/quickjs-ffi-types": "workspace:*" } + }, + "variant": { + "library": "quickjs", + "releaseMode": "release", + "syncMode": "sync", + "description": "Compiled to pure Javascript, no WebAssembly required.", + "emscriptenInclusion": "asmjs", + "exports": { "import": { "emscriptenEnvironment": ["web", "worker", "node"] } } + } } } diff --git a/yarn.lock b/yarn.lock index 36155294..11477327 100644 --- a/yarn.lock +++ b/yarn.lock @@ -613,6 +613,14 @@ __metadata: languageName: node linkType: hard +"@jitl/quickjs-asmjs-mjs-release-sync@workspace:*, @jitl/quickjs-asmjs-mjs-release-sync@workspace:packages/variant-quickjs-asmjs-mjs-release-sync": + version: 0.0.0-use.local + resolution: "@jitl/quickjs-asmjs-mjs-release-sync@workspace:packages/variant-quickjs-asmjs-mjs-release-sync" + dependencies: + "@jitl/quickjs-ffi-types": "workspace:*" + languageName: unknown + linkType: soft + "@jitl/quickjs-ffi-types@workspace:*, @jitl/quickjs-ffi-types@workspace:packages/quickjs-ffi-types": version: 0.0.0-use.local resolution: "@jitl/quickjs-ffi-types@workspace:packages/quickjs-ffi-types" @@ -5565,6 +5573,16 @@ __metadata: languageName: unknown linkType: soft +"quickjs-for-quickjs@workspace:packages/quickjs-for-quickjs": + version: 0.0.0-use.local + resolution: "quickjs-for-quickjs@workspace:packages/quickjs-for-quickjs" + dependencies: + "@jitl/quickjs-asmjs-mjs-release-sync": "workspace:*" + "@jitl/tsconfig": "workspace:*" + quickjs-emscripten-core: "workspace:*" + languageName: unknown + linkType: soft + "range-parser@npm:~1.2.1": version: 1.2.1 resolution: "range-parser@npm:1.2.1"