@emnapi/runtime 2.0.0-alpha.2 → 2.0.0-alpha.4

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/index.cjs ADDED
@@ -0,0 +1,63 @@
1
+ 'use strict'
2
+ // Mutable CommonJS facade over the ESM build. The v1 package shipped a real
3
+ // CJS entry whose exports object was mutable; generated WASI loaders and
4
+ // @napi-rs/wasm-runtime's runtime.cjs rely on sharing that one mutable
5
+ // exports object (e.g. test harnesses intercept `createContext` around a
6
+ // fresh loader require). The v2 package is ESM-only, and `require()` of an
7
+ // ES module returns a frozen namespace, so restore the contract here. Each
8
+ // export is re-assigned individually (instead of spreading the namespace
9
+ // into `module.exports`) so cjs-module-lexer can statically detect the named
10
+ // exports -- `import()` of this CJS entry must still expose them as module
11
+ // namespace properties. Module-level state (the default-context memoization)
12
+ // lives inside the ESM module itself, so both entries observe the same
13
+ // runtime state.
14
+ const __emnapiRuntime = require('./dist/emnapi.js')
15
+ module.exports.ArrayStore = __emnapiRuntime.ArrayStore
16
+ module.exports.BaseArrayStore = __emnapiRuntime.BaseArrayStore
17
+ module.exports.Context = __emnapiRuntime.Context
18
+ module.exports.CountIdAllocator = __emnapiRuntime.CountIdAllocator
19
+ module.exports.CountIdReuseAllocator = __emnapiRuntime.CountIdReuseAllocator
20
+ module.exports.Disposable = __emnapiRuntime.Disposable
21
+ module.exports.EmnapiError = __emnapiRuntime.EmnapiError
22
+ module.exports.Env = __emnapiRuntime.Env
23
+ module.exports.External = __emnapiRuntime.External
24
+ module.exports.Finalizer = __emnapiRuntime.Finalizer
25
+ module.exports.FunctionTemplate = __emnapiRuntime.FunctionTemplate
26
+ module.exports.HandleScope = __emnapiRuntime.HandleScope
27
+ module.exports.HandleStore = __emnapiRuntime.HandleStore
28
+ module.exports.Isolate = __emnapiRuntime.Isolate
29
+ module.exports.NAPI_VERSION_EXPERIMENTAL = __emnapiRuntime.NAPI_VERSION_EXPERIMENTAL
30
+ module.exports.NODE_API_DEFAULT_MODULE_API_VERSION = __emnapiRuntime.NODE_API_DEFAULT_MODULE_API_VERSION
31
+ module.exports.NODE_API_SUPPORTED_VERSION_MAX = __emnapiRuntime.NODE_API_SUPPORTED_VERSION_MAX
32
+ module.exports.NODE_API_SUPPORTED_VERSION_MIN = __emnapiRuntime.NODE_API_SUPPORTED_VERSION_MIN
33
+ module.exports.NodeEnv = __emnapiRuntime.NodeEnv
34
+ module.exports.NotSupportBufferError = __emnapiRuntime.NotSupportBufferError
35
+ module.exports.NotSupportWeakRefError = __emnapiRuntime.NotSupportWeakRefError
36
+ module.exports.ObjectTemplate = __emnapiRuntime.ObjectTemplate
37
+ module.exports.Persistent = __emnapiRuntime.Persistent
38
+ module.exports.PersistentStore = __emnapiRuntime.PersistentStore
39
+ module.exports.Private = __emnapiRuntime.Private
40
+ module.exports.RefTracker = __emnapiRuntime.RefTracker
41
+ module.exports.Reference = __emnapiRuntime.Reference
42
+ module.exports.ReferenceOwnership = __emnapiRuntime.ReferenceOwnership
43
+ module.exports.ReferenceWithData = __emnapiRuntime.ReferenceWithData
44
+ module.exports.ReferenceWithFinalizer = __emnapiRuntime.ReferenceWithFinalizer
45
+ module.exports.ScopeStore = __emnapiRuntime.ScopeStore
46
+ module.exports.Signature = __emnapiRuntime.Signature
47
+ module.exports.StrongRef = __emnapiRuntime.StrongRef
48
+ module.exports.Template = __emnapiRuntime.Template
49
+ module.exports.TrackedFinalizer = __emnapiRuntime.TrackedFinalizer
50
+ module.exports.TryCatch = __emnapiRuntime.TryCatch
51
+ module.exports.createContext = __emnapiRuntime.createContext
52
+ module.exports.deletePrivate = __emnapiRuntime.deletePrivate
53
+ module.exports.getDefaultContext = __emnapiRuntime.getDefaultContext
54
+ module.exports.getDylinkMetadata = __emnapiRuntime.getDylinkMetadata
55
+ module.exports.getExternalValue = __emnapiRuntime.getExternalValue
56
+ module.exports.getInternalField = __emnapiRuntime.getInternalField
57
+ module.exports.getPrivate = __emnapiRuntime.getPrivate
58
+ module.exports.hasPrivate = __emnapiRuntime.hasPrivate
59
+ module.exports.isExternal = __emnapiRuntime.isExternal
60
+ module.exports.isReferenceType = __emnapiRuntime.isReferenceType
61
+ module.exports.setInternalField = __emnapiRuntime.setInternalField
62
+ module.exports.setPrivate = __emnapiRuntime.setPrivate
63
+ module.exports.version = __emnapiRuntime.version
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emnapi/runtime",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.4",
4
4
  "description": "emnapi runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/emnapi.js",
@@ -8,14 +8,20 @@
8
8
  "types": "./dist/emnapi.d.ts",
9
9
  "sideEffects": false,
10
10
  "exports": {
11
- ".": "./dist/emnapi.js",
11
+ ".": {
12
+ "types": "./dist/emnapi.d.ts",
13
+ "import": "./dist/emnapi.js",
14
+ "require": "./index.cjs",
15
+ "default": "./dist/emnapi.js"
16
+ },
12
17
  "./package.json": "./package.json"
13
18
  },
14
19
  "dependencies": {
15
20
  "tslib": "^2.4.0"
16
21
  },
17
22
  "scripts": {
18
- "build": "rollup -c"
23
+ "build": "rollup -c",
24
+ "test": "node ./test/index.js"
19
25
  },
20
26
  "repository": {
21
27
  "type": "git",