@rolldown/binding-wasm32-wasi 1.2.18 → 1.3.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 CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "@rolldown/binding-wasm32-wasi",
3
- "version": "1.2.18",
3
+ "version": "1.3.1",
4
+ "cpu": [
5
+ "wasm32"
6
+ ],
4
7
  "main": "rolldown-binding.wasi.cjs",
5
8
  "files": [
6
9
  "rolldown-binding.wasm32-wasi.wasm",
@@ -1529,3 +1529,4 @@ export const resetNativeMemoryStats = __napiModule.exports.resetNativeMemoryStat
1529
1529
  export const resolveTsconfig = __napiModule.exports.resolveTsconfig
1530
1530
  export const shutdownAsyncRuntime = __napiModule.exports.shutdownAsyncRuntime
1531
1531
  export const startAsyncRuntime = __napiModule.exports.startAsyncRuntime
1532
+ export const Watcher = __napiModule.exports.Watcher
@@ -1,4 +1,4 @@
1
- // napi-rs-artifact-metadata:{"version":2,"rootEntry":"binding.cjs","exports":["LegalCommentsMode","minify","minifySync","Severity","ParseResult","ExportExportNameKind","ExportImportNameKind","ExportLocalNameKind","ImportNameKind","parse","parseSync","rawTransferSupported","ResolverFactory","EnforceExtension","ModuleType","sync","HelperMode","isolatedDeclaration","isolatedDeclarationSync","moduleRunnerTransform","moduleRunnerTransformSync","transform","transformSync","BindingBundleEndEventData","BindingBundleErrorEventData","BindingBundler","BindingCallableBuiltinPlugin","BindingChunkingContext","BindingDecodedMap","BindingDevEngine","BindingLoadPluginContext","BindingMagicString","BindingModuleInfo","BindingNormalizedOptions","BindingOutputAsset","BindingOutputChunk","BindingPluginContext","BindingRenderedChunk","BindingRenderedChunkMeta","BindingRenderedModule","BindingSourceMap","BindingTransformPluginContext","BindingWatcher","BindingWatcherBundler","BindingWatcherChangeData","BindingWatcherEvent","ParallelJsPluginRegistry","TraceSubscriberGuard","TsconfigCache","BindingAttachDebugInfo","BindingBuiltinPluginName","BindingChunkModuleOrderBy","BindingErrorStage","BindingLogLevel","BindingPluginOrder","BindingPropertyReadSideEffects","BindingPropertyWriteSideEffects","BindingRebuildStrategy","collapseSourcemaps","enhancedTransform","enhancedTransformSync","FilterTokenKind","getNativeMemoryStats","initTraceSubscriber","registerPlugins","resetNativeMemoryStats","resolveTsconfig","shutdownAsyncRuntime","startAsyncRuntime"],"managedRootEntries":["browser.js","binding.cjs","rolldown-binding.wasm","rolldown-binding.debug.wasm"]}
1
+ // napi-rs-artifact-metadata:{"version":2,"rootEntry":"binding.cjs","exports":["LegalCommentsMode","minify","minifySync","Severity","ParseResult","ExportExportNameKind","ExportImportNameKind","ExportLocalNameKind","ImportNameKind","parse","parseSync","rawTransferSupported","ResolverFactory","EnforceExtension","ModuleType","sync","HelperMode","isolatedDeclaration","isolatedDeclarationSync","moduleRunnerTransform","moduleRunnerTransformSync","transform","transformSync","BindingBundleEndEventData","BindingBundleErrorEventData","BindingBundler","BindingCallableBuiltinPlugin","BindingChunkingContext","BindingDecodedMap","BindingDevEngine","BindingLoadPluginContext","BindingMagicString","BindingModuleInfo","BindingNormalizedOptions","BindingOutputAsset","BindingOutputChunk","BindingPluginContext","BindingRenderedChunk","BindingRenderedChunkMeta","BindingRenderedModule","BindingSourceMap","BindingTransformPluginContext","BindingWatcher","BindingWatcherBundler","BindingWatcherChangeData","BindingWatcherEvent","ParallelJsPluginRegistry","TraceSubscriberGuard","TsconfigCache","BindingAttachDebugInfo","BindingBuiltinPluginName","BindingChunkModuleOrderBy","BindingErrorStage","BindingLogLevel","BindingPluginOrder","BindingPropertyReadSideEffects","BindingPropertyWriteSideEffects","BindingRebuildStrategy","collapseSourcemaps","enhancedTransform","enhancedTransformSync","FilterTokenKind","getNativeMemoryStats","initTraceSubscriber","registerPlugins","resetNativeMemoryStats","resolveTsconfig","shutdownAsyncRuntime","startAsyncRuntime","Watcher"],"managedRootEntries":["browser.js","binding.cjs","rolldown-binding.wasm","rolldown-binding.debug.wasm"]}
2
2
  /* eslint-disable */
3
3
  /* auto-generated by NAPI-RS */
4
4
 
@@ -2366,3 +2366,4 @@ module.exports.resetNativeMemoryStats = __napiModule.exports.resetNativeMemorySt
2366
2366
  module.exports.resolveTsconfig = __napiModule.exports.resolveTsconfig
2367
2367
  module.exports.shutdownAsyncRuntime = __napiModule.exports.shutdownAsyncRuntime
2368
2368
  module.exports.startAsyncRuntime = __napiModule.exports.startAsyncRuntime
2369
+ module.exports.Watcher = __napiModule.exports.Watcher
@@ -1629,8 +1629,13 @@ export declare class BindingDevEngine {
1629
1629
  * This is called when a dynamically imported module is first requested at runtime.
1630
1630
  * The module was previously stubbed with a proxy, and now we need to compile the
1631
1631
  * actual module and its dependencies.
1632
+ * Failures come back as `BindingErrors`, the same shape the build and HMR callbacks
1633
+ * use, rather than as a napi error carrying a formatted string. A lazy compile runs the
1634
+ * full plugin pipeline, so what fails here is usually a user plugin - and `to_binding_error`
1635
+ * hands its thrown JS error back untouched, keeping the stack and the diagnostic's module
1636
+ * id instead of flattening both into a message.
1632
1637
  */
1633
- compileEntry(moduleId: string, clientId: string): Promise<BindingLazyChunkOutput>
1638
+ compileEntry(moduleId: string, clientId: string): Promise<BindingResult<BindingLazyChunkOutput>>
1634
1639
  /**
1635
1640
  * Same data the plugin-context `getModuleInfo` returns, readable from the engine
1636
1641
  * handle at any time (no hook context needed).
@@ -1822,7 +1827,7 @@ export declare class BindingOutputChunk {
1822
1827
  }
1823
1828
 
1824
1829
  export declare class BindingPluginContext {
1825
- load(specifier: string, sideEffects: boolean | 'no-treeshake' | undefined, packageJsonPath?: string): Promise<void>
1830
+ load(rawId: string, attributes: Record<string, string>, sideEffects: boolean | 'no-treeshake' | undefined, packageJsonPath?: string): Promise<void>
1826
1831
  resolve(specifier: string, importer?: string | undefined | null, extraOptions?: BindingPluginContextResolveOptions | undefined | null): Promise<BindingPluginContextResolvedId | null>
1827
1832
  emitFile(file: BindingEmittedAsset, assetFilename?: string | undefined | null, fnSanitizedFileName?: string | undefined | null): string
1828
1833
  emitChunk(file: BindingEmittedChunk): string
@@ -2019,6 +2024,8 @@ export interface BindingChecksOptions {
2019
2024
  sourcemapBroken?: boolean
2020
2025
  namespaceConflict?: boolean
2021
2026
  shimmedExport?: boolean
2027
+ deprecatedImportAssertion?: boolean
2028
+ invalidImportAttribute?: boolean
2022
2029
  }
2023
2030
 
2024
2031
  export interface BindingChunkImportMap {
@@ -2100,12 +2107,7 @@ export interface BindingDevtoolsOptions {
2100
2107
  export interface BindingDevWatchOptions {
2101
2108
  enabled?: boolean
2102
2109
  skipWrite?: boolean
2103
- usePolling?: boolean
2104
- pollInterval?: number
2105
- useDebounce?: boolean
2106
- debounceDuration?: number
2107
- compareContentsForPolling?: boolean
2108
- debounceTickRate?: number
2110
+ watcher?: BindingWatcherFileWatcherOptions
2109
2111
  include?: Array<BindingStringOrRegex>
2110
2112
  exclude?: Array<BindingStringOrRegex>
2111
2113
  }
@@ -2311,6 +2313,7 @@ export interface BindingExperimentalOptions {
2311
2313
  nativeMagicString?: boolean
2312
2314
  chunkOptimization?: boolean | BindingChunkOptimizationOptions
2313
2315
  lazyBarrel?: boolean
2316
+ importAttributes?: boolean
2314
2317
  }
2315
2318
 
2316
2319
  export interface BindingFilterToken {
@@ -2363,6 +2366,16 @@ export interface BindingHookJsResolveIdOutput {
2363
2366
  id: string
2364
2367
  external?: boolean | 'absolute' | 'relative'
2365
2368
  moduleSideEffects?: boolean | 'no-treeshake'
2369
+ /**
2370
+ * @internal The package json path resolved by oxc resolver, so that the caller can hand it
2371
+ * back to rolldown instead of making it infer the module format from the id alone.
2372
+ */
2373
+ packageJsonPath?: string
2374
+ }
2375
+
2376
+ export interface BindingHookLoadExtraArgs {
2377
+ rawId: string
2378
+ attributes: Record<string, string>
2366
2379
  }
2367
2380
 
2368
2381
  export interface BindingHookLoadOutput {
@@ -2381,6 +2394,19 @@ export interface BindingHookRenderChunkOutput {
2381
2394
  map?: BindingSourcemap | null
2382
2395
  }
2383
2396
 
2397
+ /**
2398
+ * The extra arguments of `resolveDynamicImport`. Empty attributes and a raw id equal to the
2399
+ * importer are left out, and `bindingify-build-hooks.ts` fills them in.
2400
+ */
2401
+ export interface BindingHookResolveDynamicImportExtraArgs {
2402
+ /** The import attributes of the import being resolved. Omitted when empty. */
2403
+ attributes?: Record<string, string>
2404
+ /** The importer without its import attributes. Omitted when equal to the importer. */
2405
+ importerRawId?: string
2406
+ /** The import attributes of the importer itself. Omitted when empty. */
2407
+ importerAttributes?: Record<string, string>
2408
+ }
2409
+
2384
2410
  export interface BindingHookResolveFileUrlArgs {
2385
2411
  /** Preliminary filename of the chunk containing the reference. */
2386
2412
  chunkId: string
@@ -2412,6 +2438,12 @@ export interface BindingHookResolveIdExtraArgs {
2412
2438
  * - `hot-accept`: `import.meta.hot.accept('./lib.js', () => {})`
2413
2439
  */
2414
2440
  kind: 'import-statement' | 'dynamic-import' | 'require-call' | 'import-rule' | 'url-token' | 'new-url' | 'hot-accept'
2441
+ /** The import attributes of the import being resolved. Omitted when empty. */
2442
+ attributes?: Record<string, string>
2443
+ /** The importer without its import attributes. Omitted when equal to the importer. */
2444
+ importerRawId?: string
2445
+ /** The import attributes of the importer itself. Omitted when empty. */
2446
+ importerAttributes?: Record<string, string>
2415
2447
  }
2416
2448
 
2417
2449
  export interface BindingHookResolveIdOutput {
@@ -2424,6 +2456,11 @@ export interface BindingHookResolveIdOutput {
2424
2456
  * we could get the related package json object via the path string.
2425
2457
  */
2426
2458
  packageJsonPath?: string | null
2459
+ /**
2460
+ * Replaces the import attributes of the import. `{}` removes them. Ignored without
2461
+ * `experimental.importAttributes`.
2462
+ */
2463
+ attributes?: Record<string, string>
2427
2464
  }
2428
2465
 
2429
2466
  export type BindingHookSideEffects = boolean | string
@@ -2720,7 +2757,9 @@ export interface BindingOverwriteOptions {
2720
2757
  }
2721
2758
 
2722
2759
  export interface BindingPluginContextResolvedId {
2760
+ /** The resolved id without its import attributes. */
2723
2761
  id: string
2762
+ attributes: Record<string, string>
2724
2763
  packageJsonPath?: string
2725
2764
  external: boolean | 'absolute' | 'relative'
2726
2765
  moduleSideEffects?: boolean | 'no-treeshake'
@@ -2741,6 +2780,7 @@ export interface BindingPluginContextResolveOptions {
2741
2780
  skipSelf?: boolean
2742
2781
  custom?: number
2743
2782
  vitePluginCustom?: BindingVitePluginCustom
2783
+ attributes?: Record<string, string>
2744
2784
  }
2745
2785
 
2746
2786
  export interface BindingPluginHookMeta {
@@ -2755,9 +2795,9 @@ export interface BindingPluginOptions {
2755
2795
  resolveId?: (ctx: BindingPluginContext, specifier: string, importer: Nullable<string>, options: BindingHookResolveIdExtraArgs) => MaybePromise<VoidNullable<BindingHookResolveIdOutput>>
2756
2796
  resolveIdMeta?: BindingPluginHookMeta
2757
2797
  resolveIdFilter?: BindingHookFilter
2758
- resolveDynamicImport?: (ctx: BindingPluginContext, specifier: string, importer: Nullable<string>) => MaybePromise<VoidNullable<BindingHookResolveIdOutput>>
2798
+ resolveDynamicImport?: (ctx: BindingPluginContext, specifier: string, importer: Nullable<string>, options: BindingHookResolveDynamicImportExtraArgs) => MaybePromise<VoidNullable<BindingHookResolveIdOutput>>
2759
2799
  resolveDynamicImportMeta?: BindingPluginHookMeta
2760
- load?: (ctx: BindingLoadPluginContext, id: string) => MaybePromise<VoidNullable<BindingHookLoadOutput>>
2800
+ load?: (ctx: BindingLoadPluginContext, id: string, options: Nullable<BindingHookLoadExtraArgs>) => MaybePromise<VoidNullable<BindingHookLoadOutput>>
2761
2801
  loadMeta?: BindingPluginHookMeta
2762
2802
  loadFilter?: BindingHookFilter
2763
2803
  transform?: (ctx: BindingTransformPluginContext, id: string, code: string, module_type: BindingTransformHookExtraArgs) => MaybePromise<VoidNullable<BindingHookTransformOutput>>
@@ -2909,6 +2949,8 @@ export interface BindingSourceMapOptions {
2909
2949
 
2910
2950
  export interface BindingTransformHookExtraArgs {
2911
2951
  moduleType: string
2952
+ rawId?: string
2953
+ attributes?: Record<string, string>
2912
2954
  }
2913
2955
 
2914
2956
  export interface BindingTreeshake {
@@ -3112,17 +3154,21 @@ export interface BindingViteTransformPluginConfig {
3112
3154
  yarnPnp?: boolean
3113
3155
  }
3114
3156
 
3115
- export interface BindingWatchOption {
3116
- skipWrite?: boolean
3117
- include?: Array<BindingStringOrRegex>
3118
- exclude?: Array<BindingStringOrRegex>
3119
- buildDelay?: number
3157
+ export interface BindingWatcherFileWatcherOptions {
3120
3158
  usePolling?: boolean
3121
3159
  pollInterval?: number
3122
3160
  compareContentsForPolling?: boolean
3123
3161
  useDebounce?: boolean
3124
3162
  debounceDelay?: number
3125
3163
  debounceTickRate?: number
3164
+ }
3165
+
3166
+ export interface BindingWatchOption {
3167
+ skipWrite?: boolean
3168
+ include?: Array<BindingStringOrRegex>
3169
+ exclude?: Array<BindingStringOrRegex>
3170
+ buildDelay?: number
3171
+ watcher?: BindingWatcherFileWatcherOptions
3126
3172
  onInvalidate?: ((id: string) => void) | undefined
3127
3173
  }
3128
3174
 
@@ -3165,21 +3211,24 @@ export interface JsOutputAsset {
3165
3211
  source: BindingAssetSource
3166
3212
  }
3167
3213
 
3214
+ /**
3215
+ * What a `generateBundle` or `writeBundle` hook changed in an output chunk. A field that is left
3216
+ * out is a property the plugin did not change, so the chunk keeps its value, which is never copied
3217
+ * through JavaScript. See `collectChunkChange` in
3218
+ * `packages/rolldown/src/utils/transform-to-rollup-output.ts`.
3219
+ */
3168
3220
  export interface JsOutputChunk {
3169
- name: string
3170
- isEntry: boolean
3171
- isDynamicEntry: boolean
3172
- facadeModuleId?: string
3173
- moduleIds: Array<string>
3174
- exports: Array<string>
3175
3221
  filename: string
3176
- modules: Record<string, BindingRenderedModule>
3177
- imports: Array<string>
3178
- dynamicImports: Array<string>
3179
- code: string
3180
- map?: BindingSourcemap
3181
- sourcemapFilename?: string
3182
- preliminaryFilename: string
3222
+ /**
3223
+ * Always sent. Besides its value, it tells a chunk apart from a `JsOutputAsset`, which has no
3224
+ * `isEntry`, when napi picks a side of `Either<JsOutputChunk, JsOutputAsset>`.
3225
+ */
3226
+ isEntry: boolean
3227
+ code?: string
3228
+ /** `null` removes the map. */
3229
+ map?: BindingSourcemap | null
3230
+ imports?: Array<string>
3231
+ dynamicImports?: Array<string>
3183
3232
  }
3184
3233
 
3185
3234
  /** Error emitted from native side, it only contains kind and message, no stack trace. */
@@ -3188,6 +3237,10 @@ export interface NativeError {
3188
3237
  message: string
3189
3238
  /** The id of the file associated with the error */
3190
3239
  id?: string
3240
+ /** The name of the plugin that threw the error */
3241
+ plugin?: string
3242
+ /** Code frame around the error location */
3243
+ frame?: string
3191
3244
  /** The exporter associated with the error (for import/export errors) */
3192
3245
  exporter?: string
3193
3246
  /** Location information (line, column, file) */
@@ -3236,3 +3289,31 @@ export declare function startAsyncRuntime(): void
3236
3289
  export interface ViteImportGlobMeta {
3237
3290
  isSubImportsPattern?: boolean
3238
3291
  }
3292
+
3293
+ export declare class Watcher {
3294
+ constructor(callback: (arg0: WatcherEvent) => void, options?: WatcherOptions | undefined | null)
3295
+ add(paths: Array<string>): void
3296
+ remove(paths: Array<string>): void
3297
+ isWatched(path: string, isIgnored?: ((arg: string) => boolean) | undefined | null): boolean
3298
+ close(): void
3299
+ ref(): void
3300
+ unref(): void
3301
+ }
3302
+
3303
+ export interface WatcherEvent {
3304
+ kind: string
3305
+ path?: string
3306
+ isDir?: boolean
3307
+ error?: string
3308
+ }
3309
+
3310
+ export interface WatcherOptions {
3311
+ usePolling?: boolean
3312
+ pollInterval?: number
3313
+ compareContentsForPolling?: boolean
3314
+ useDebounce?: boolean
3315
+ debounceDelay?: number
3316
+ debounceTickRate?: number
3317
+ followSymlinks?: boolean
3318
+ ignored?: Array<string>
3319
+ }
Binary file