@parcel/rust 2.12.1-dev.3207 → 2.12.1-dev.3229

Sign up to get free protection for your applications and to get access to all the features.
package/index.d.ts CHANGED
@@ -7,8 +7,54 @@ 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
+ }
10
45
  export function initSentry(): void
11
46
  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
12
58
  export function findAncestorFile(filenames: Array<string>, from: string, root: string): string | null
13
59
  export function findFirstFile(names: Array<string>): string | null
14
60
  export function findNodeModule(module: string, from: string): string | null
package/index.js CHANGED
@@ -295,10 +295,12 @@ if (!nativeBinding) {
295
295
  throw new Error(`Failed to load native binding`)
296
296
  }
297
297
 
298
- const { initSentry, closeSentry, findAncestorFile, findFirstFile, findNodeModule, hashString, hashBuffer, Hash, optimizeImage, Resolver, transform, transformAsync } = nativeBinding
298
+ const { initSentry, closeSentry, napiRunConfigRequest, napiRunEntryRequest, findAncestorFile, findFirstFile, findNodeModule, hashString, hashBuffer, Hash, optimizeImage, 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
302
304
  module.exports.findAncestorFile = findAncestorFile
303
305
  module.exports.findFirstFile = findFirstFile
304
306
  module.exports.findNodeModule = findNodeModule
package/index.js.flow CHANGED
@@ -3,21 +3,29 @@ import type {FileCreateInvalidation} from '@parcel/types';
3
3
 
4
4
  declare export var init: void | (() => void);
5
5
 
6
+ export type ProjectPath = any;
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,
16
+ }
17
+ export interface RequestOptions {
18
+ }
19
+
6
20
  declare export function initSentry(): void;
7
21
  declare export function closeSentry(): void;
8
- declare export function findAncestorFile(
9
- filenames: Array<string>,
10
- from: string,
11
- root: string,
12
- ): string | null;
13
- declare export function findFirstFile(names: Array<string>): string | null;
14
- declare export function findNodeModule(
15
- module: string,
16
- from: string,
17
- ): string | null;
18
- declare export function hashString(s: string): string;
19
- declare export function hashBuffer(buf: Buffer): string;
20
- declare export function optimizeImage(kind: string, buf: Buffer): Buffer;
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
21
29
  export interface JsFileSystemOptions {
22
30
  canonicalize: string => string;
23
31
  read: string => Buffer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/rust",
3
- "version": "2.12.1-dev.3207+ddaa72fad",
3
+ "version": "2.12.1-dev.3229+795716bf4",
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": "ddaa72fad245c2d5b065df71ad1a18f17d518c8c"
43
+ "gitHead": "795716bf4650f012262eade20f8dc1cfd1f02580"
44
44
  }