@atlaspack/rust 2.12.1-dev.3450 → 2.12.1-dev.3460

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.d.ts CHANGED
@@ -88,7 +88,6 @@ export interface InlineRequiresOptimizerResult {
88
88
  sourceMap?: string
89
89
  }
90
90
  export function runInlineRequiresOptimizer(input: InlineRequiresOptimizerInput): InlineRequiresOptimizerResult
91
- export function replaceHashReferences(input: Buffer, hashRefToNameHash: Record<string, string>): Buffer
92
91
  export interface JsFileSystemOptions {
93
92
  canonicalize: (...args: any[]) => any
94
93
  read: (...args: any[]) => any
package/index.js CHANGED
@@ -310,7 +310,7 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { initTracingSubscriber, Lmdb, findAncestorFile, findFirstFile, findNodeModule, hashString, hashBuffer, Hash, optimizeImage, createAssetId, AtlaspackNapi, createDependencyId, createEnvironmentId, initializeMonitoring, closeMonitoring, registerWorker, runInlineRequiresOptimizer, replaceHashReferences, Resolver, transform, transformAsync } = nativeBinding
313
+ const { initTracingSubscriber, Lmdb, findAncestorFile, findFirstFile, findNodeModule, hashString, hashBuffer, Hash, optimizeImage, createAssetId, AtlaspackNapi, createDependencyId, createEnvironmentId, initializeMonitoring, closeMonitoring, registerWorker, runInlineRequiresOptimizer, Resolver, transform, transformAsync } = nativeBinding
314
314
 
315
315
  module.exports.initTracingSubscriber = initTracingSubscriber
316
316
  module.exports.Lmdb = Lmdb
@@ -329,7 +329,6 @@ module.exports.initializeMonitoring = initializeMonitoring
329
329
  module.exports.closeMonitoring = closeMonitoring
330
330
  module.exports.registerWorker = registerWorker
331
331
  module.exports.runInlineRequiresOptimizer = runInlineRequiresOptimizer
332
- module.exports.replaceHashReferences = replaceHashReferences
333
332
  module.exports.Resolver = Resolver
334
333
  module.exports.transform = transform
335
334
  module.exports.transformAsync = transformAsync
package/index.js.flow CHANGED
@@ -11,6 +11,10 @@ declare export var init: void | (() => void);
11
11
 
12
12
  export type Transferable = {||};
13
13
 
14
+ export type JsCallable<Args: $ReadOnlyArray<mixed>, Return> = (
15
+ ...Args
16
+ ) => Return | Promise<Return>;
17
+
14
18
  export type ProjectPath = any;
15
19
  export interface ConfigRequest {
16
20
  id: string;
@@ -25,11 +29,12 @@ export interface ConfigRequest {
25
29
  export interface RequestOptions {}
26
30
 
27
31
  export interface FileSystem {
28
- canonicalize(path: FilePath): FilePath;
29
- cwd(): FilePath;
30
- isDir(path: FilePath): boolean;
31
- isFile(path: FilePath): boolean;
32
- readFile(path: FilePath, encoding?: Encoding): string;
32
+ canonicalize: JsCallable<[FilePath], FilePath>;
33
+ createDirectory: JsCallable<[FilePath], Promise<void>>;
34
+ cwd: JsCallable<[], FilePath>;
35
+ isDir: JsCallable<[FilePath], boolean>;
36
+ isFile: JsCallable<[FilePath], boolean>;
37
+ readFile: JsCallable<[FilePath, Encoding], string>;
33
38
  }
34
39
 
35
40
  export type AtlaspackNapiOptions = {|
@@ -127,36 +132,36 @@ export type Engines = {|
127
132
  browsers?: string | string[],
128
133
  electron?: string,
129
134
  node?: string,
130
- |}
135
+ |};
131
136
 
132
137
  export type Environment = {|
133
- context: string,
134
- engines: Engines,
135
- includeNodeModules: IncludeNodeModules,
136
- isLibrary: boolean,
137
- loc?: SourceLocation,
138
- outputFormat: string,
139
- shouldScopeHoist: boolean,
140
- shouldOptimize: boolean,
141
- sourceMap?: {|
138
+ context: string,
139
+ engines: Engines,
140
+ includeNodeModules: IncludeNodeModules,
141
+ isLibrary: boolean,
142
+ loc?: SourceLocation,
143
+ outputFormat: string,
144
+ shouldScopeHoist: boolean,
145
+ shouldOptimize: boolean,
146
+ sourceMap?: {|
142
147
  inline?: boolean,
143
148
  inlineSources?: boolean,
144
149
  sourceRoot?: string,
145
150
  |},
146
- sourceType: string,
147
- |}
151
+ sourceType: string,
152
+ |};
148
153
 
149
154
  export type SourceLocation = {|
150
155
  filePath: string,
151
156
  start: {|
152
- line: number,
153
- column: number
157
+ line: number,
158
+ column: number,
154
159
  |},
155
160
  end: {|
156
- line: number,
157
- column: number
161
+ line: number,
162
+ column: number,
158
163
  |},
159
- |}
164
+ |};
160
165
 
161
166
  export type Symbol = {|
162
167
  local: string,
@@ -165,7 +170,7 @@ export type Symbol = {|
165
170
  isWeak: boolean,
166
171
  isEsmExport: boolean,
167
172
  selfReferenced: boolean,
168
- |}
173
+ |};
169
174
 
170
175
  export type Target = {|
171
176
  distDir: string,
@@ -174,14 +179,14 @@ export type Target = {|
174
179
  loc?: SourceLocation,
175
180
  name: string,
176
181
  publicUrl: string,
177
- |}
182
+ |};
178
183
 
179
184
  export type Dependency = {|
180
185
  bundleBehavior?: number,
181
186
  env: Environment,
182
187
  loc: SourceLocation,
183
188
  meta?: any,
184
- packageConditions: number,
189
+ packageConditions: number[],
185
190
  pipeline?: string,
186
191
  priority: number,
187
192
  range?: string,
@@ -198,41 +203,41 @@ export type Dependency = {|
198
203
  needsStableName: boolean,
199
204
  shouldWrap: boolean,
200
205
  isEsm: boolean,
201
- placeholder?: string,
202
- |}
206
+ placeholder?: string,
207
+ |};
203
208
 
204
209
  export type RpcAssetResult = {|
205
- id: String,
206
- bundleBehavior: number,
210
+ id: string,
211
+ bundleBehavior: ?number,
207
212
  filePath: string,
208
213
  type: string,
209
214
  code: Array<number>,
210
215
  meta: any,
211
- pipeline?: string,
216
+ pipeline?: ?string,
212
217
  query?: string,
213
218
  symbols?: Symbol[],
214
- uniqueKey?: string,
219
+ uniqueKey?: ?string,
215
220
  sideEffects: boolean,
216
221
  isBundleSplittable: boolean,
217
222
  isSource: boolean,
218
- |}
223
+ |};
219
224
 
220
225
  export type RpcTransformerOpts = {|
221
226
  resolveFrom: string,
222
227
  specifier: string,
223
228
  options: RpcPluginOptions,
224
229
  asset: Asset,
225
- |}
230
+ |};
226
231
 
227
232
  export type RpcHmrOptions = {|
228
233
  port?: number,
229
234
  host?: string,
230
- |}
235
+ |};
231
236
 
232
237
  export type RpcPluginOptions = {|
233
238
  hmrOptions?: RpcHmrOptions,
234
239
  projectRoot: string,
235
- |}
240
+ |};
236
241
 
237
242
  export type Asset = {|
238
243
  id: string,
@@ -265,7 +270,7 @@ export type Asset = {|
265
270
  |}>,
266
271
  configPath?: string,
267
272
  configKeyPath?: string,
268
- |}
273
+ |};
269
274
 
270
275
  declare export class Resolver {
271
276
  constructor(projectRoot: string, options: ResolverOptions): Resolver;
@@ -332,11 +337,6 @@ declare export function createAssetId(params: mixed): string;
332
337
  declare export function createDependencyId(params: mixed): string;
333
338
  declare export function createEnvironmentId(params: mixed): string;
334
339
 
335
- declare export function replaceHashReferences(
336
- input: Buffer,
337
- hashRefToNameHash: {[key: string]: string},
338
- ): Buffer;
339
-
340
340
  export interface ResolverOptions {
341
341
  fs?: JsFileSystemOptions;
342
342
  includeNodeModules?: IncludeNodeModules;
@@ -348,16 +348,19 @@ export interface ResolverOptions {
348
348
  }
349
349
 
350
350
  export interface JsFileSystemOptions {
351
- canonicalize: string => string;
352
- read: string => Buffer;
353
- isFile: string => boolean;
354
- isDir: string => boolean;
351
+ canonicalize: (string) => string;
352
+ read: (string) => Buffer;
353
+ isFile: (string) => boolean;
354
+ isDir: (string) => boolean;
355
355
  includeNodeModules?: IncludeNodeModules;
356
356
  }
357
357
 
358
358
  // Types below break IDE highlighting, place them at the bottom of the file
359
359
 
360
- export type IncludeNodeModules = boolean | Array<string> | {|[string]: boolean|}
360
+ export type IncludeNodeModules =
361
+ | boolean
362
+ | Array<string>
363
+ | {|[string]: boolean|};
361
364
 
362
365
  export type Resolution =
363
366
  | {|type: 'Path', value: string|}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/rust",
3
- "version": "2.12.1-dev.3450+58845ef87",
3
+ "version": "2.12.1-dev.3460+340817991",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -37,5 +37,5 @@
37
37
  "wasm:build": "cargo build -p atlaspack-node-bindings --target wasm32-unknown-unknown && cp ../../../target/wasm32-unknown-unknown/debug/atlaspack_node_bindings.wasm .",
38
38
  "wasm:build-release": "CARGO_PROFILE_RELEASE_LTO=true cargo build -p atlaspack-node-bindings --target wasm32-unknown-unknown --release && wasm-opt --strip-debug -O ../../../target/wasm32-unknown-unknown/release/atlaspack_node_bindings.wasm -o atlaspack_node_bindings.wasm"
39
39
  },
40
- "gitHead": "58845ef87446fcedb7d7d8876440c64184645cbb"
40
+ "gitHead": "3408179911d6c67e2bdad99e545dd7a0a9a6782c"
41
41
  }