@parcel/rust 2.12.1-nightly.3141 → 2.13.0

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/browser.js CHANGED
@@ -1,5 +1,3 @@
1
- /* global WebAssembly, crypto */
2
-
3
1
  const {Environment, napi} = require('napi-wasm');
4
2
 
5
3
  let env;
package/index.d.ts CHANGED
@@ -7,17 +7,16 @@ export interface JsMacroError {
7
7
  kind: number
8
8
  message: string
9
9
  }
10
- export function findAncestorFile(filenames: Array<string>, from: string, root: string): string | null
11
- export function findFirstFile(names: Array<string>): string | null
12
- export function findNodeModule(module: string, from: string): string | null
13
- export function hashString(s: string): string
14
- export function hashBuffer(buf: Buffer): string
15
- export function optimizeImage(kind: string, buf: Buffer): Buffer
10
+ export declare function findAncestorFile(filenames: Array<string>, from: string, root: string): string | null
11
+ export declare function findFirstFile(names: Array<string>): string | null
12
+ export declare function findNodeModule(module: string, from: string): string | null
13
+ export declare function hashString(s: string): string
14
+ export declare function hashBuffer(buf: Buffer): string
15
+ export declare function optimizeImage(kind: string, buf: Buffer): Buffer
16
16
  export interface JsFileSystemOptions {
17
- canonicalize: (...args: any[]) => any
18
17
  read: (...args: any[]) => any
19
- isFile: (...args: any[]) => any
20
- isDir: (...args: any[]) => any
18
+ readLink: (...args: any[]) => any
19
+ kind: (...args: any[]) => any
21
20
  includeNodeModules?: NapiSideEffectsVariants
22
21
  }
23
22
  export interface FileSystem {
@@ -61,15 +60,15 @@ export interface JsInvalidations {
61
60
  invalidateOnFileCreate: Array<FilePathCreateInvalidation | FileNameCreateInvalidation | GlobCreateInvalidation>
62
61
  invalidateOnStartup: boolean
63
62
  }
64
- export function transform(opts: object): unknown
65
- export function transformAsync(opts: object): object
66
- export class Hash {
63
+ export declare function transform(opts: object): unknown
64
+ export declare function transformAsync(opts: object): object
65
+ export declare class Hash {
67
66
  constructor()
68
67
  writeString(s: string): void
69
68
  writeBuffer(buf: Buffer): void
70
69
  finish(): string
71
70
  }
72
- export class Resolver {
71
+ export declare class Resolver {
73
72
  constructor(projectRoot: string, options: FileSystem)
74
73
  resolve(options: ResolveOptions): ResolveResult
75
74
  resolveAsync(): object
package/index.js CHANGED
@@ -224,17 +224,32 @@ switch (platform) {
224
224
  }
225
225
  break
226
226
  case 'arm':
227
- localFileExisted = existsSync(
228
- join(__dirname, 'parcel-node-bindings.linux-arm-gnueabihf.node')
229
- )
230
- try {
231
- if (localFileExisted) {
232
- nativeBinding = require('./parcel-node-bindings.linux-arm-gnueabihf.node')
233
- } else {
234
- nativeBinding = require('@parcel/rust-linux-arm-gnueabihf')
227
+ if (isMusl()) {
228
+ localFileExisted = existsSync(
229
+ join(__dirname, 'parcel-node-bindings.linux-arm-musleabihf.node')
230
+ )
231
+ try {
232
+ if (localFileExisted) {
233
+ nativeBinding = require('./parcel-node-bindings.linux-arm-musleabihf.node')
234
+ } else {
235
+ nativeBinding = require('@parcel/rust-linux-arm-musleabihf')
236
+ }
237
+ } catch (e) {
238
+ loadError = e
239
+ }
240
+ } else {
241
+ localFileExisted = existsSync(
242
+ join(__dirname, 'parcel-node-bindings.linux-arm-gnueabihf.node')
243
+ )
244
+ try {
245
+ if (localFileExisted) {
246
+ nativeBinding = require('./parcel-node-bindings.linux-arm-gnueabihf.node')
247
+ } else {
248
+ nativeBinding = require('@parcel/rust-linux-arm-gnueabihf')
249
+ }
250
+ } catch (e) {
251
+ loadError = e
235
252
  }
236
- } catch (e) {
237
- loadError = e
238
253
  }
239
254
  break
240
255
  case 'riscv64':
package/index.js.flow CHANGED
@@ -3,17 +3,23 @@ import type {FileCreateInvalidation} from '@parcel/types';
3
3
 
4
4
  declare export var init: void | (() => void);
5
5
 
6
- declare export function findAncestorFile(filenames: Array<string>, from: string, root: string): string | null
7
- declare export function findFirstFile(names: Array<string>): string | null
8
- declare export function findNodeModule(module: string, from: string): string | null
9
- declare export function hashString(s: string): string
10
- declare export function hashBuffer(buf: Buffer): string
11
- declare export function optimizeImage(kind: string, buf: Buffer): Buffer
6
+ declare export function findAncestorFile(
7
+ filenames: Array<string>,
8
+ from: string,
9
+ root: string,
10
+ ): string | null;
11
+ declare export function findFirstFile(names: Array<string>): string | null;
12
+ declare export function findNodeModule(
13
+ module: string,
14
+ from: string,
15
+ ): string | null;
16
+ declare export function hashString(s: string): string;
17
+ declare export function hashBuffer(buf: Buffer): string;
18
+ declare export function optimizeImage(kind: string, buf: Buffer): Buffer;
12
19
  export interface JsFileSystemOptions {
13
- canonicalize: string => string;
20
+ readLink: string => string;
14
21
  read: string => Buffer;
15
- isFile: string => boolean;
16
- isDir: string => boolean;
22
+ kind: string => number;
17
23
  includeNodeModules?: boolean | Array<string> | {|[string]: boolean|};
18
24
  }
19
25
  export interface FileSystem {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/rust",
3
- "version": "2.12.1-nightly.3141+4042e306a",
3
+ "version": "2.13.0",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -19,7 +19,7 @@
19
19
  "name": "parcel-node-bindings"
20
20
  },
21
21
  "engines": {
22
- "node": ">= 12.0.0"
22
+ "node": ">= 16.0.0"
23
23
  },
24
24
  "files": [
25
25
  "browser.js",
@@ -31,13 +31,14 @@
31
31
  ],
32
32
  "devDependencies": {
33
33
  "@napi-rs/cli": "^2.15.2",
34
- "napi-wasm": "^1.0.1"
34
+ "napi-wasm": "^1.1.2"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "napi build --platform --cargo-cwd ../../../crates/node-bindings",
38
+ "build-canary": "napi build --platform --profile canary --cargo-cwd ../../../crates/node-bindings",
38
39
  "build-release": "napi build --platform --release --cargo-cwd ../../../crates/node-bindings",
39
40
  "wasm:build": "cargo build -p parcel-node-bindings --target wasm32-unknown-unknown && cp ../../../target/wasm32-unknown-unknown/debug/parcel_node_bindings.wasm .",
40
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"
41
42
  },
42
- "gitHead": "4042e306aef005f9bf407a189681b4049599719d"
43
+ "gitHead": "a53f8f3ba1025c7ea8653e9719e0a61ef9717079"
43
44
  }