@componentor/quickjs-wasmfile-debug-sync 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +47 -0
- package/README.md +88 -0
- package/dist/emscripten-module.browser.d.ts +14 -0
- package/dist/emscripten-module.browser.mjs +5277 -0
- package/dist/emscripten-module.cjs +5335 -0
- package/dist/emscripten-module.cloudflare.cjs +5265 -0
- package/dist/emscripten-module.cloudflare.d.ts +14 -0
- package/dist/emscripten-module.d.ts +14 -0
- package/dist/emscripten-module.mjs +5420 -0
- package/dist/emscripten-module.wasm +0 -0
- package/dist/emscripten-module.wasm.map +1 -0
- package/dist/ffi.d.mts +86 -0
- package/dist/ffi.d.ts +86 -0
- package/dist/ffi.js +2 -0
- package/dist/ffi.js.map +1 -0
- package/dist/ffi.mjs +2 -0
- package/dist/ffi.mjs.map +1 -0
- package/dist/index.d.mts +20 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
quickjs-emscripten:
|
|
2
|
+
The MIT License
|
|
3
|
+
|
|
4
|
+
quickjs-emscripten copyright (c) 2019-2024 Jake Teton-Landis
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
quickjs:
|
|
26
|
+
QuickJS Javascript Engine
|
|
27
|
+
|
|
28
|
+
Copyright (c) 2017-2021 Fabrice Bellard
|
|
29
|
+
Copyright (c) 2017-2021 Charlie Gordon
|
|
30
|
+
|
|
31
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
32
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
33
|
+
in the Software without restriction, including without limitation the rights
|
|
34
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
35
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
36
|
+
furnished to do so, subject to the following conditions:
|
|
37
|
+
|
|
38
|
+
The above copyright notice and this permission notice shall be included in
|
|
39
|
+
all copies or substantial portions of the Software.
|
|
40
|
+
|
|
41
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
42
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
43
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
44
|
+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
45
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
46
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
47
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# @componentor/quickjs-wasmfile-debug-sync
|
|
2
|
+
|
|
3
|
+
Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.
|
|
4
|
+
|
|
5
|
+
This generated package is part of [quickjs-emscripten](https://github.com/componentor/quickjs-emscripten).
|
|
6
|
+
It contains a variant of the quickjs WASM library, and can be used with @componentor/quickjs-emscripten-core.
|
|
7
|
+
|
|
8
|
+
```typescript
|
|
9
|
+
import variant from "@componentor/quickjs-wasmfile-debug-sync"
|
|
10
|
+
import { newQuickJSWASMModuleFromVariant } from "@componentor/quickjs-emscripten-core"
|
|
11
|
+
const QuickJS = await newQuickJSWASMModuleFromVariant(variant)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This variant was built with the following settings:
|
|
15
|
+
|
|
16
|
+
## Library: quickjs
|
|
17
|
+
|
|
18
|
+
The original [bellard/quickjs](https://github.com/bellard/quickjs) library.
|
|
19
|
+
|
|
20
|
+
Version [2024-02-14+36911f0d](https://github.com/bellard/quickjs/commit/36911f0d3ab1a4c190a4d5cbe7c2db225a455389) vendored to quickjs-emscripten on 2024-06-15.
|
|
21
|
+
|
|
22
|
+
## Release mode: debug
|
|
23
|
+
|
|
24
|
+
Enables assertions and memory sanitizers. Try to run your tests against debug variants, in addition to your preferred production variant, to catch more bugs.
|
|
25
|
+
|
|
26
|
+
## Exports: require import browser workerd
|
|
27
|
+
|
|
28
|
+
Exports the following in package.json for the package entrypoint:
|
|
29
|
+
|
|
30
|
+
- Exports a NodeJS-compatible CommonJS module, which is faster to load and run compared to an ESModule.
|
|
31
|
+
- Exports a NodeJS-compatible ESModule. Cannot be imported synchronously from a NodeJS CommonJS module.
|
|
32
|
+
- Exports a browser-compatible ESModule, designed to work in browsers and browser-like environments.
|
|
33
|
+
- Targets Cloudflare Workers.
|
|
34
|
+
|
|
35
|
+
## Extra async magic? No
|
|
36
|
+
|
|
37
|
+
The default, normal build. Note that both variants support regular async functions.
|
|
38
|
+
|
|
39
|
+
## Single-file, or separate .wasm file? wasm
|
|
40
|
+
|
|
41
|
+
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.
|
|
42
|
+
|
|
43
|
+
## More details
|
|
44
|
+
|
|
45
|
+
Full variant JSON description:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"library": "quickjs",
|
|
50
|
+
"releaseMode": "debug",
|
|
51
|
+
"syncMode": "sync",
|
|
52
|
+
"description": "Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.",
|
|
53
|
+
"emscriptenInclusion": "wasm",
|
|
54
|
+
"exports": {
|
|
55
|
+
"require": {
|
|
56
|
+
"emscriptenEnvironment": ["node"]
|
|
57
|
+
},
|
|
58
|
+
"import": {
|
|
59
|
+
"emscriptenEnvironment": ["node"]
|
|
60
|
+
},
|
|
61
|
+
"browser": {
|
|
62
|
+
"emscriptenEnvironment": ["web", "worker"]
|
|
63
|
+
},
|
|
64
|
+
"workerd": {
|
|
65
|
+
"emscriptenEnvironment": ["web"]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Variant-specific Emscripten build flags:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
[
|
|
75
|
+
"-O0",
|
|
76
|
+
"-DQTS_DEBUG_MODE",
|
|
77
|
+
"-DDUMP_LEAKS=1",
|
|
78
|
+
"-gsource-map",
|
|
79
|
+
"-s ASSERTIONS=1",
|
|
80
|
+
"--pre-js $(TEMPLATES)/pre-extension.js",
|
|
81
|
+
"--pre-js $(TEMPLATES)/pre-sourceMapJson.js",
|
|
82
|
+
"--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js",
|
|
83
|
+
"--pre-js $(TEMPLATES)/pre-wasmMemory.js",
|
|
84
|
+
"-DQTS_SANITIZE_LEAK",
|
|
85
|
+
"-fsanitize=leak",
|
|
86
|
+
"-g2"
|
|
87
|
+
]
|
|
88
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Generated from ../../templates/emscripten-module.SYNC.d.ts
|
|
2
|
+
import type {
|
|
3
|
+
EmscriptenModuleLoader,
|
|
4
|
+
QuickJSEmscriptenModule,
|
|
5
|
+
} from "@componentor/quickjs-ffi-types"
|
|
6
|
+
/**
|
|
7
|
+
* Emscripten module built from the unmodified [`quickjs/quickjs.h`](../quickjs/quickjs.h)
|
|
8
|
+
* and our FFI support functions [c/interface.c](../c/interface.c).
|
|
9
|
+
*
|
|
10
|
+
* Note that emscripten modules returned by a `MODULARIZE=1` emscripten build
|
|
11
|
+
* (like this one) load asynchronously.
|
|
12
|
+
*/
|
|
13
|
+
declare const ModuleLoader: EmscriptenModuleLoader<QuickJSEmscriptenModule>
|
|
14
|
+
export default ModuleLoader
|