@rolldown/binding-wasm32-wasi 1.0.0-beta.9-commit.ca4e9dd → 1.0.0-rc.1
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/package.json +12 -12
- package/rolldown-binding.wasi-browser.js +41 -24
- package/rolldown-binding.wasi.cjs +62 -24
- package/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/LICENSE +0 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rolldown/binding-wasm32-wasi",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
4
|
"cpu": [
|
|
5
5
|
"wasm32"
|
|
6
6
|
],
|
|
@@ -14,29 +14,29 @@
|
|
|
14
14
|
],
|
|
15
15
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
16
16
|
"keywords": [
|
|
17
|
-
"
|
|
18
|
-
"parcel",
|
|
17
|
+
"bundler",
|
|
19
18
|
"esbuild",
|
|
19
|
+
"parcel",
|
|
20
|
+
"rolldown",
|
|
20
21
|
"rollup",
|
|
21
|
-
"
|
|
22
|
-
"rolldown"
|
|
22
|
+
"webpack"
|
|
23
23
|
],
|
|
24
24
|
"homepage": "https://rolldown.rs/",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"engines": {
|
|
27
|
-
"node": ">=14.
|
|
28
|
-
},
|
|
29
|
-
"publishConfig": {
|
|
30
|
-
"registry": "https://registry.npmjs.org/",
|
|
31
|
-
"access": "public"
|
|
27
|
+
"node": ">=14.0.0"
|
|
32
28
|
},
|
|
33
29
|
"repository": {
|
|
34
30
|
"type": "git",
|
|
35
|
-
"url": "https://github.com/rolldown/rolldown.git",
|
|
31
|
+
"url": "git+https://github.com/rolldown/rolldown.git",
|
|
36
32
|
"directory": "packages/rolldown"
|
|
37
33
|
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"registry": "https://registry.npmjs.org/",
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
38
|
"browser": "rolldown-binding.wasi-browser.js",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@napi-rs/wasm-runtime": "^
|
|
40
|
+
"@napi-rs/wasm-runtime": "^1.1.1"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
WASI as __WASI,
|
|
6
6
|
} from '@napi-rs/wasm-runtime'
|
|
7
7
|
import { memfs } from '@napi-rs/wasm-runtime/fs'
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
|
|
10
10
|
export const { fs: __fs, vol: __volume } = memfs()
|
|
11
11
|
|
|
@@ -17,8 +17,10 @@ const __wasi = new __WASI({
|
|
|
17
17
|
},
|
|
18
18
|
})
|
|
19
19
|
|
|
20
|
+
const __wasmUrl = new URL('./rolldown-binding.wasm32-wasi.wasm', import.meta.url).href
|
|
20
21
|
const __emnapiContext = __emnapiGetDefaultContext()
|
|
21
22
|
|
|
23
|
+
|
|
22
24
|
const __sharedMemory = new WebAssembly.Memory({
|
|
23
25
|
initial: 16384,
|
|
24
26
|
maximum: 65536,
|
|
@@ -61,49 +63,64 @@ const {
|
|
|
61
63
|
},
|
|
62
64
|
})
|
|
63
65
|
export default __napiModule.exports
|
|
66
|
+
export const minify = __napiModule.exports.minify
|
|
67
|
+
export const minifySync = __napiModule.exports.minifySync
|
|
68
|
+
export const Severity = __napiModule.exports.Severity
|
|
69
|
+
export const ParseResult = __napiModule.exports.ParseResult
|
|
70
|
+
export const ExportExportNameKind = __napiModule.exports.ExportExportNameKind
|
|
71
|
+
export const ExportImportNameKind = __napiModule.exports.ExportImportNameKind
|
|
72
|
+
export const ExportLocalNameKind = __napiModule.exports.ExportLocalNameKind
|
|
73
|
+
export const ImportNameKind = __napiModule.exports.ImportNameKind
|
|
74
|
+
export const parse = __napiModule.exports.parse
|
|
75
|
+
export const parseSync = __napiModule.exports.parseSync
|
|
76
|
+
export const rawTransferSupported = __napiModule.exports.rawTransferSupported
|
|
77
|
+
export const ResolverFactory = __napiModule.exports.ResolverFactory
|
|
78
|
+
export const EnforceExtension = __napiModule.exports.EnforceExtension
|
|
79
|
+
export const ModuleType = __napiModule.exports.ModuleType
|
|
80
|
+
export const sync = __napiModule.exports.sync
|
|
81
|
+
export const HelperMode = __napiModule.exports.HelperMode
|
|
82
|
+
export const isolatedDeclaration = __napiModule.exports.isolatedDeclaration
|
|
83
|
+
export const isolatedDeclarationSync = __napiModule.exports.isolatedDeclarationSync
|
|
84
|
+
export const moduleRunnerTransform = __napiModule.exports.moduleRunnerTransform
|
|
85
|
+
export const moduleRunnerTransformSync = __napiModule.exports.moduleRunnerTransformSync
|
|
86
|
+
export const transform = __napiModule.exports.transform
|
|
87
|
+
export const transformSync = __napiModule.exports.transformSync
|
|
64
88
|
export const BindingBundleEndEventData = __napiModule.exports.BindingBundleEndEventData
|
|
65
89
|
export const BindingBundleErrorEventData = __napiModule.exports.BindingBundleErrorEventData
|
|
90
|
+
export const BindingBundler = __napiModule.exports.BindingBundler
|
|
66
91
|
export const BindingCallableBuiltinPlugin = __napiModule.exports.BindingCallableBuiltinPlugin
|
|
67
|
-
export const
|
|
92
|
+
export const BindingChunkingContext = __napiModule.exports.BindingChunkingContext
|
|
93
|
+
export const BindingDecodedMap = __napiModule.exports.BindingDecodedMap
|
|
94
|
+
export const BindingDevEngine = __napiModule.exports.BindingDevEngine
|
|
95
|
+
export const BindingMagicString = __napiModule.exports.BindingMagicString
|
|
68
96
|
export const BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
69
97
|
export const BindingNormalizedOptions = __napiModule.exports.BindingNormalizedOptions
|
|
70
98
|
export const BindingOutputAsset = __napiModule.exports.BindingOutputAsset
|
|
71
99
|
export const BindingOutputChunk = __napiModule.exports.BindingOutputChunk
|
|
72
|
-
export const BindingOutputs = __napiModule.exports.BindingOutputs
|
|
73
100
|
export const BindingPluginContext = __napiModule.exports.BindingPluginContext
|
|
74
101
|
export const BindingRenderedChunk = __napiModule.exports.BindingRenderedChunk
|
|
75
102
|
export const BindingRenderedChunkMeta = __napiModule.exports.BindingRenderedChunkMeta
|
|
76
103
|
export const BindingRenderedModule = __napiModule.exports.BindingRenderedModule
|
|
104
|
+
export const BindingSourceMap = __napiModule.exports.BindingSourceMap
|
|
77
105
|
export const BindingTransformPluginContext = __napiModule.exports.BindingTransformPluginContext
|
|
78
106
|
export const BindingWatcher = __napiModule.exports.BindingWatcher
|
|
107
|
+
export const BindingWatcherBundler = __napiModule.exports.BindingWatcherBundler
|
|
79
108
|
export const BindingWatcherChangeData = __napiModule.exports.BindingWatcherChangeData
|
|
80
109
|
export const BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
|
|
81
|
-
export const Bundler = __napiModule.exports.Bundler
|
|
82
110
|
export const ParallelJsPluginRegistry = __napiModule.exports.ParallelJsPluginRegistry
|
|
83
|
-
export const
|
|
84
|
-
export const
|
|
111
|
+
export const ScheduledBuild = __napiModule.exports.ScheduledBuild
|
|
112
|
+
export const TraceSubscriberGuard = __napiModule.exports.TraceSubscriberGuard
|
|
113
|
+
export const BindingAttachDebugInfo = __napiModule.exports.BindingAttachDebugInfo
|
|
85
114
|
export const BindingBuiltinPluginName = __napiModule.exports.BindingBuiltinPluginName
|
|
86
|
-
export const
|
|
87
|
-
export const BindingJsx = __napiModule.exports.BindingJsx
|
|
115
|
+
export const BindingChunkModuleOrderBy = __napiModule.exports.BindingChunkModuleOrderBy
|
|
88
116
|
export const BindingLogLevel = __napiModule.exports.BindingLogLevel
|
|
89
117
|
export const BindingPluginOrder = __napiModule.exports.BindingPluginOrder
|
|
90
|
-
export const
|
|
91
|
-
export const
|
|
92
|
-
export const
|
|
93
|
-
export const
|
|
118
|
+
export const BindingPropertyReadSideEffects = __napiModule.exports.BindingPropertyReadSideEffects
|
|
119
|
+
export const BindingPropertyWriteSideEffects = __napiModule.exports.BindingPropertyWriteSideEffects
|
|
120
|
+
export const BindingRebuildStrategy = __napiModule.exports.BindingRebuildStrategy
|
|
121
|
+
export const createTokioRuntime = __napiModule.exports.createTokioRuntime
|
|
94
122
|
export const FilterTokenKind = __napiModule.exports.FilterTokenKind
|
|
95
|
-
export const
|
|
96
|
-
export const HelperMode = __napiModule.exports.HelperMode
|
|
97
|
-
export const ImportNameKind = __napiModule.exports.ImportNameKind
|
|
98
|
-
export const isolatedDeclaration = __napiModule.exports.isolatedDeclaration
|
|
99
|
-
export const moduleRunnerTransform = __napiModule.exports.moduleRunnerTransform
|
|
100
|
-
export const parseAsync = __napiModule.exports.parseAsync
|
|
101
|
-
export const parseSync = __napiModule.exports.parseSync
|
|
102
|
-
export const parseSyncRaw = __napiModule.exports.parseSyncRaw
|
|
103
|
-
export const rawTransferSupported = __napiModule.exports.rawTransferSupported
|
|
123
|
+
export const initTraceSubscriber = __napiModule.exports.initTraceSubscriber
|
|
104
124
|
export const registerPlugins = __napiModule.exports.registerPlugins
|
|
105
|
-
export const Severity = __napiModule.exports.Severity
|
|
106
125
|
export const shutdownAsyncRuntime = __napiModule.exports.shutdownAsyncRuntime
|
|
107
126
|
export const startAsyncRuntime = __napiModule.exports.startAsyncRuntime
|
|
108
|
-
export const sync = __napiModule.exports.sync
|
|
109
|
-
export const transform = __napiModule.exports.transform
|
|
@@ -39,7 +39,7 @@ if (__nodeFs.existsSync(__wasmDebugFilePath)) {
|
|
|
39
39
|
__wasmFilePath = __wasmDebugFilePath
|
|
40
40
|
} else if (!__nodeFs.existsSync(__wasmFilePath)) {
|
|
41
41
|
try {
|
|
42
|
-
__wasmFilePath =
|
|
42
|
+
__wasmFilePath = require.resolve('@rolldown/binding-wasm32-wasi/rolldown-binding.wasm32-wasi.wasm')
|
|
43
43
|
} catch {
|
|
44
44
|
throw new Error('Cannot find rolldown-binding.wasm32-wasi.wasm file, and @rolldown/binding-wasm32-wasi package is not installed.')
|
|
45
45
|
}
|
|
@@ -65,6 +65,29 @@ const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule
|
|
|
65
65
|
worker.onmessage = ({ data }) => {
|
|
66
66
|
__wasmCreateOnMessageForFsProxy(__nodeFs)(data)
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
// The main thread of Node.js waits for all the active handles before exiting.
|
|
70
|
+
// But Rust threads are never waited without `thread::join`.
|
|
71
|
+
// So here we hack the code of Node.js to prevent the workers from being referenced (active).
|
|
72
|
+
// According to https://github.com/nodejs/node/blob/19e0d472728c79d418b74bddff588bea70a403d0/lib/internal/worker.js#L415,
|
|
73
|
+
// a worker is consist of two handles: kPublicPort and kHandle.
|
|
74
|
+
{
|
|
75
|
+
const kPublicPort = Object.getOwnPropertySymbols(worker).find(s =>
|
|
76
|
+
s.toString().includes("kPublicPort")
|
|
77
|
+
);
|
|
78
|
+
if (kPublicPort) {
|
|
79
|
+
worker[kPublicPort].ref = () => {};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const kHandle = Object.getOwnPropertySymbols(worker).find(s =>
|
|
83
|
+
s.toString().includes("kHandle")
|
|
84
|
+
);
|
|
85
|
+
if (kHandle) {
|
|
86
|
+
worker[kHandle].ref = () => {};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
worker.unref();
|
|
90
|
+
}
|
|
68
91
|
return worker
|
|
69
92
|
},
|
|
70
93
|
overwriteImports(importObject) {
|
|
@@ -85,49 +108,64 @@ const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule
|
|
|
85
108
|
},
|
|
86
109
|
})
|
|
87
110
|
module.exports = __napiModule.exports
|
|
111
|
+
module.exports.minify = __napiModule.exports.minify
|
|
112
|
+
module.exports.minifySync = __napiModule.exports.minifySync
|
|
113
|
+
module.exports.Severity = __napiModule.exports.Severity
|
|
114
|
+
module.exports.ParseResult = __napiModule.exports.ParseResult
|
|
115
|
+
module.exports.ExportExportNameKind = __napiModule.exports.ExportExportNameKind
|
|
116
|
+
module.exports.ExportImportNameKind = __napiModule.exports.ExportImportNameKind
|
|
117
|
+
module.exports.ExportLocalNameKind = __napiModule.exports.ExportLocalNameKind
|
|
118
|
+
module.exports.ImportNameKind = __napiModule.exports.ImportNameKind
|
|
119
|
+
module.exports.parse = __napiModule.exports.parse
|
|
120
|
+
module.exports.parseSync = __napiModule.exports.parseSync
|
|
121
|
+
module.exports.rawTransferSupported = __napiModule.exports.rawTransferSupported
|
|
122
|
+
module.exports.ResolverFactory = __napiModule.exports.ResolverFactory
|
|
123
|
+
module.exports.EnforceExtension = __napiModule.exports.EnforceExtension
|
|
124
|
+
module.exports.ModuleType = __napiModule.exports.ModuleType
|
|
125
|
+
module.exports.sync = __napiModule.exports.sync
|
|
126
|
+
module.exports.HelperMode = __napiModule.exports.HelperMode
|
|
127
|
+
module.exports.isolatedDeclaration = __napiModule.exports.isolatedDeclaration
|
|
128
|
+
module.exports.isolatedDeclarationSync = __napiModule.exports.isolatedDeclarationSync
|
|
129
|
+
module.exports.moduleRunnerTransform = __napiModule.exports.moduleRunnerTransform
|
|
130
|
+
module.exports.moduleRunnerTransformSync = __napiModule.exports.moduleRunnerTransformSync
|
|
131
|
+
module.exports.transform = __napiModule.exports.transform
|
|
132
|
+
module.exports.transformSync = __napiModule.exports.transformSync
|
|
88
133
|
module.exports.BindingBundleEndEventData = __napiModule.exports.BindingBundleEndEventData
|
|
89
134
|
module.exports.BindingBundleErrorEventData = __napiModule.exports.BindingBundleErrorEventData
|
|
135
|
+
module.exports.BindingBundler = __napiModule.exports.BindingBundler
|
|
90
136
|
module.exports.BindingCallableBuiltinPlugin = __napiModule.exports.BindingCallableBuiltinPlugin
|
|
91
|
-
module.exports.
|
|
137
|
+
module.exports.BindingChunkingContext = __napiModule.exports.BindingChunkingContext
|
|
138
|
+
module.exports.BindingDecodedMap = __napiModule.exports.BindingDecodedMap
|
|
139
|
+
module.exports.BindingDevEngine = __napiModule.exports.BindingDevEngine
|
|
140
|
+
module.exports.BindingMagicString = __napiModule.exports.BindingMagicString
|
|
92
141
|
module.exports.BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
93
142
|
module.exports.BindingNormalizedOptions = __napiModule.exports.BindingNormalizedOptions
|
|
94
143
|
module.exports.BindingOutputAsset = __napiModule.exports.BindingOutputAsset
|
|
95
144
|
module.exports.BindingOutputChunk = __napiModule.exports.BindingOutputChunk
|
|
96
|
-
module.exports.BindingOutputs = __napiModule.exports.BindingOutputs
|
|
97
145
|
module.exports.BindingPluginContext = __napiModule.exports.BindingPluginContext
|
|
98
146
|
module.exports.BindingRenderedChunk = __napiModule.exports.BindingRenderedChunk
|
|
99
147
|
module.exports.BindingRenderedChunkMeta = __napiModule.exports.BindingRenderedChunkMeta
|
|
100
148
|
module.exports.BindingRenderedModule = __napiModule.exports.BindingRenderedModule
|
|
149
|
+
module.exports.BindingSourceMap = __napiModule.exports.BindingSourceMap
|
|
101
150
|
module.exports.BindingTransformPluginContext = __napiModule.exports.BindingTransformPluginContext
|
|
102
151
|
module.exports.BindingWatcher = __napiModule.exports.BindingWatcher
|
|
152
|
+
module.exports.BindingWatcherBundler = __napiModule.exports.BindingWatcherBundler
|
|
103
153
|
module.exports.BindingWatcherChangeData = __napiModule.exports.BindingWatcherChangeData
|
|
104
154
|
module.exports.BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
|
|
105
|
-
module.exports.Bundler = __napiModule.exports.Bundler
|
|
106
155
|
module.exports.ParallelJsPluginRegistry = __napiModule.exports.ParallelJsPluginRegistry
|
|
107
|
-
module.exports.
|
|
108
|
-
module.exports.
|
|
156
|
+
module.exports.ScheduledBuild = __napiModule.exports.ScheduledBuild
|
|
157
|
+
module.exports.TraceSubscriberGuard = __napiModule.exports.TraceSubscriberGuard
|
|
158
|
+
module.exports.BindingAttachDebugInfo = __napiModule.exports.BindingAttachDebugInfo
|
|
109
159
|
module.exports.BindingBuiltinPluginName = __napiModule.exports.BindingBuiltinPluginName
|
|
110
|
-
module.exports.
|
|
111
|
-
module.exports.BindingJsx = __napiModule.exports.BindingJsx
|
|
160
|
+
module.exports.BindingChunkModuleOrderBy = __napiModule.exports.BindingChunkModuleOrderBy
|
|
112
161
|
module.exports.BindingLogLevel = __napiModule.exports.BindingLogLevel
|
|
113
162
|
module.exports.BindingPluginOrder = __napiModule.exports.BindingPluginOrder
|
|
114
|
-
module.exports.
|
|
115
|
-
module.exports.
|
|
116
|
-
module.exports.
|
|
117
|
-
module.exports.
|
|
163
|
+
module.exports.BindingPropertyReadSideEffects = __napiModule.exports.BindingPropertyReadSideEffects
|
|
164
|
+
module.exports.BindingPropertyWriteSideEffects = __napiModule.exports.BindingPropertyWriteSideEffects
|
|
165
|
+
module.exports.BindingRebuildStrategy = __napiModule.exports.BindingRebuildStrategy
|
|
166
|
+
module.exports.createTokioRuntime = __napiModule.exports.createTokioRuntime
|
|
118
167
|
module.exports.FilterTokenKind = __napiModule.exports.FilterTokenKind
|
|
119
|
-
module.exports.
|
|
120
|
-
module.exports.HelperMode = __napiModule.exports.HelperMode
|
|
121
|
-
module.exports.ImportNameKind = __napiModule.exports.ImportNameKind
|
|
122
|
-
module.exports.isolatedDeclaration = __napiModule.exports.isolatedDeclaration
|
|
123
|
-
module.exports.moduleRunnerTransform = __napiModule.exports.moduleRunnerTransform
|
|
124
|
-
module.exports.parseAsync = __napiModule.exports.parseAsync
|
|
125
|
-
module.exports.parseSync = __napiModule.exports.parseSync
|
|
126
|
-
module.exports.parseSyncRaw = __napiModule.exports.parseSyncRaw
|
|
127
|
-
module.exports.rawTransferSupported = __napiModule.exports.rawTransferSupported
|
|
168
|
+
module.exports.initTraceSubscriber = __napiModule.exports.initTraceSubscriber
|
|
128
169
|
module.exports.registerPlugins = __napiModule.exports.registerPlugins
|
|
129
|
-
module.exports.Severity = __napiModule.exports.Severity
|
|
130
170
|
module.exports.shutdownAsyncRuntime = __napiModule.exports.shutdownAsyncRuntime
|
|
131
171
|
module.exports.startAsyncRuntime = __napiModule.exports.startAsyncRuntime
|
|
132
|
-
module.exports.sync = __napiModule.exports.sync
|
|
133
|
-
module.exports.transform = __napiModule.exports.transform
|
|
Binary file
|
package/LICENSE
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024-present VoidZero Inc. & Contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
22
|
-
|
|
23
|
-
end of terms and conditions
|
|
24
|
-
|
|
25
|
-
The licenses of externally maintained libraries from which parts of the Software is derived are listed [here](https://github.com/rolldown/rolldown/blob/main/THIRD-PARTY-LICENSE).
|