@parcel/rust 2.12.1-dev.3231 → 2.12.1-dev.3260

Sign up to get free protection for your applications and to get access to all the features.
package/index.d.ts CHANGED
@@ -7,54 +7,8 @@ export interface JsMacroError {
7
7
  kind: number
8
8
  message: string
9
9
  }
10
- export interface ConfigKeyChange {
11
- filePath: ProjectPath
12
- configKey: string
13
- }
14
- export interface InternalFileCreateInvalidation {
15
- filePath?: ProjectPath
16
- glob?: InternalGlob
17
- fileName?: string
18
- aboveFilePath?: ProjectPath
19
- }
20
- export interface ConfigRequest {
21
- id: string
22
- invalidateOnFileChange: Array<ProjectPath>
23
- invalidateOnConfigKeyChange: Array<ConfigKeyChange>
24
- invalidateOnFileCreate: Array<InternalFileCreateInvalidation>
25
- invalidateOnEnvChange: Array<string>
26
- invalidateOnOptionChange: Array<string>
27
- invalidateOnStartup: boolean
28
- invalidateOnBuild: boolean
29
- }
30
- export interface RequestOptions {
31
-
32
- }
33
- export interface Entry {
34
- filePath: ProjectPath
35
- packagePath: ProjectPath
36
- }
37
- export interface EntryResult {
38
- entries: Array<Entry>
39
- files: Array<ProjectPath>
40
- globs: Array<string>
41
- }
42
- export interface EntryRequestInput {
43
- projectPath: string
44
- }
45
10
  export function initSentry(): void
46
11
  export function closeSentry(): void
47
- /**
48
- * JavaScript API for running a config request.
49
- * At the moment the request fields themselves will be copied on call.
50
- *
51
- * This is not efficient but can be worked around when it becomes an issue.
52
- *
53
- * This should have exhaustive unit-tests on `packages/core/core/test/requests/ConfigRequest.test.js`.
54
- */
55
- export function napiRunConfigRequest(configRequest: ConfigRequest, api: object, options: object): void
56
- /** napi entry-point for `run_entry_request`. */
57
- export function napiRunEntryRequest(entryRequest: EntryRequestInput, api: object, options: object): EntryResult
58
12
  export function findAncestorFile(filenames: Array<string>, from: string, root: string): string | null
59
13
  export function findFirstFile(names: Array<string>): string | null
60
14
  export function findNodeModule(module: string, from: string): string | null
@@ -117,6 +71,12 @@ export class Hash {
117
71
  writeBuffer(buf: Buffer): void
118
72
  finish(): string
119
73
  }
74
+ export class ParcelNapi {
75
+ constructor(options: object)
76
+ testingTempFsReadToString(path: string): Promise<string>
77
+ testingTempFsIsFile(path: string): Promise<boolean>
78
+ testingTempFsIsDir(path: string): Promise<boolean>
79
+ }
120
80
  export class Resolver {
121
81
  constructor(projectRoot: string, options: FileSystem)
122
82
  resolve(options: ResolveOptions): ResolveResult
package/index.js CHANGED
@@ -295,12 +295,10 @@ if (!nativeBinding) {
295
295
  throw new Error(`Failed to load native binding`)
296
296
  }
297
297
 
298
- const { initSentry, closeSentry, napiRunConfigRequest, napiRunEntryRequest, findAncestorFile, findFirstFile, findNodeModule, hashString, hashBuffer, Hash, optimizeImage, Resolver, transform, transformAsync } = nativeBinding
298
+ const { initSentry, closeSentry, findAncestorFile, findFirstFile, findNodeModule, hashString, hashBuffer, Hash, optimizeImage, ParcelNapi, Resolver, transform, transformAsync } = nativeBinding
299
299
 
300
300
  module.exports.initSentry = initSentry
301
301
  module.exports.closeSentry = closeSentry
302
- module.exports.napiRunConfigRequest = napiRunConfigRequest
303
- module.exports.napiRunEntryRequest = napiRunEntryRequest
304
302
  module.exports.findAncestorFile = findAncestorFile
305
303
  module.exports.findFirstFile = findFirstFile
306
304
  module.exports.findNodeModule = findNodeModule
@@ -308,6 +306,7 @@ module.exports.hashString = hashString
308
306
  module.exports.hashBuffer = hashBuffer
309
307
  module.exports.Hash = Hash
310
308
  module.exports.optimizeImage = optimizeImage
309
+ module.exports.ParcelNapi = ParcelNapi
311
310
  module.exports.Resolver = Resolver
312
311
  module.exports.transform = transform
313
312
  module.exports.transformAsync = transformAsync
package/index.js.flow CHANGED
@@ -5,27 +5,48 @@ declare export var init: void | (() => void);
5
5
 
6
6
  export type ProjectPath = any;
7
7
  export interface ConfigRequest {
8
- id: string,
9
- invalidateOnFileChange: Array<ProjectPath>,
10
- invalidateOnConfigKeyChange: Array<any>,
11
- invalidateOnFileCreate: Array<any>,
12
- invalidateOnEnvChange: Array<string>,
13
- invalidateOnOptionChange: Array<string>,
14
- invalidateOnStartup: boolean,
15
- invalidateOnBuild: boolean,
8
+ id: string;
9
+ invalidateOnFileChange: Array<ProjectPath>;
10
+ invalidateOnConfigKeyChange: Array<any>;
11
+ invalidateOnFileCreate: Array<any>;
12
+ invalidateOnEnvChange: Array<string>;
13
+ invalidateOnOptionChange: Array<string>;
14
+ invalidateOnStartup: boolean;
15
+ invalidateOnBuild: boolean;
16
+ }
17
+ export interface RequestOptions {}
18
+
19
+ export interface ParcelNapiOptions {
20
+ fs?: any;
16
21
  }
17
- export interface RequestOptions {
22
+
23
+ declare export class ParcelNapi {
24
+ constructor(options: ParcelNapiOptions): ParcelNapi;
25
+ testingTempFsReadToString(path: string): string;
26
+ testingTempFsIsDir(path: string): boolean;
27
+ testingTempFsIsFile(path: string): boolean;
18
28
  }
19
29
 
20
30
  declare export function initSentry(): void;
21
31
  declare export function closeSentry(): void;
22
- declare export function napiRunConfigRequest(configRequest: ConfigRequest, api: any, options: any): void
23
- declare export function findAncestorFile(filenames: Array<string>, from: string, root: string): string | null
24
- declare export function findFirstFile(names: Array<string>): string | null
25
- declare export function findNodeModule(module: string, from: string): string | null
26
- declare export function hashString(s: string): string
27
- declare export function hashBuffer(buf: Buffer): string
28
- declare export function optimizeImage(kind: string, buf: Buffer): Buffer
32
+ declare export function napiRunConfigRequest(
33
+ configRequest: ConfigRequest,
34
+ api: any,
35
+ options: any,
36
+ ): void;
37
+ declare export function findAncestorFile(
38
+ filenames: Array<string>,
39
+ from: string,
40
+ root: string,
41
+ ): string | null;
42
+ declare export function findFirstFile(names: Array<string>): string | null;
43
+ declare export function findNodeModule(
44
+ module: string,
45
+ from: string,
46
+ ): string | null;
47
+ declare export function hashString(s: string): string;
48
+ declare export function hashBuffer(buf: Buffer): string;
49
+ declare export function optimizeImage(kind: string, buf: Buffer): Buffer;
29
50
  export interface JsFileSystemOptions {
30
51
  canonicalize: string => string;
31
52
  read: string => Buffer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/rust",
3
- "version": "2.12.1-dev.3231+5b10f3ae4",
3
+ "version": "2.12.1-dev.3260+339350eb3",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -40,5 +40,5 @@
40
40
  "wasm:build": "cargo build -p parcel-node-bindings --target wasm32-unknown-unknown && cp ../../../target/wasm32-unknown-unknown/debug/parcel_node_bindings.wasm .",
41
41
  "wasm:build-release": "CARGO_PROFILE_RELEASE_LTO=true cargo build -p parcel-node-bindings --target wasm32-unknown-unknown --release && wasm-opt --strip-debug -O ../../../target/wasm32-unknown-unknown/release/parcel_node_bindings.wasm -o parcel_node_bindings.wasm"
42
42
  },
43
- "gitHead": "5b10f3ae49b33948e5de2d3ebc88c4a6d32a8a95"
43
+ "gitHead": "339350eb31fd33849cb1efe5fd7ad2cb096319f0"
44
44
  }