@parcel/rust 2.14.5-canary.3449 → 2.15.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/index.d.ts +73 -58
- package/index.js +169 -138
- package/package.json +12 -12
package/index.d.ts
CHANGED
@@ -4,82 +4,97 @@
|
|
4
4
|
/* auto-generated by NAPI-RS */
|
5
5
|
|
6
6
|
export interface JsMacroError {
|
7
|
-
kind: number
|
8
|
-
message: string
|
7
|
+
kind: number;
|
8
|
+
message: string;
|
9
9
|
}
|
10
|
-
export declare function findAncestorFile(
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
export declare function
|
16
|
-
export declare function
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
export declare function
|
21
|
-
export declare function
|
22
|
-
export declare function
|
10
|
+
export declare function findAncestorFile(
|
11
|
+
filenames: Array<string>,
|
12
|
+
from: string,
|
13
|
+
root: string,
|
14
|
+
): string | null;
|
15
|
+
export declare function findFirstFile(names: Array<string>): string | null;
|
16
|
+
export declare function findNodeModule(
|
17
|
+
module: string,
|
18
|
+
from: string,
|
19
|
+
): string | null;
|
20
|
+
export declare function hashString(s: string): string;
|
21
|
+
export declare function hashBuffer(buf: Buffer): string;
|
22
|
+
export declare function optimizeImage(kind: string, buf: Buffer): Buffer;
|
23
|
+
export declare function transformHtml(opts: object): unknown;
|
24
|
+
export declare function packageHtml(opts: object): unknown;
|
25
|
+
export declare function optimizeHtml(opts: object): unknown;
|
26
|
+
export declare function transformSvg(opts: object): unknown;
|
27
|
+
export declare function packageSvg(opts: object): unknown;
|
28
|
+
export declare function optimizeSvg(opts: object): unknown;
|
29
|
+
export declare function svgReact(opts: object): unknown;
|
23
30
|
export interface JsFileSystemOptions {
|
24
|
-
read: (...args: any[]) => any
|
25
|
-
readLink: (...args: any[]) => any
|
26
|
-
kind: (...args: any[]) => any
|
27
|
-
includeNodeModules?: NapiSideEffectsVariants
|
31
|
+
read: (...args: any[]) => any;
|
32
|
+
readLink: (...args: any[]) => any;
|
33
|
+
kind: (...args: any[]) => any;
|
34
|
+
includeNodeModules?: NapiSideEffectsVariants;
|
28
35
|
}
|
29
36
|
export interface FileSystem {
|
30
|
-
fs?: JsFileSystemOptions
|
31
|
-
includeNodeModules?: NapiSideEffectsVariants
|
32
|
-
conditions?: number
|
33
|
-
moduleDirResolver?: (...args: any[]) => any
|
34
|
-
mode: number
|
35
|
-
entries?: number
|
36
|
-
extensions?: Array<string
|
37
|
-
packageExports: boolean
|
38
|
-
typescript?: boolean
|
37
|
+
fs?: JsFileSystemOptions;
|
38
|
+
includeNodeModules?: NapiSideEffectsVariants;
|
39
|
+
conditions?: number;
|
40
|
+
moduleDirResolver?: (...args: any[]) => any;
|
41
|
+
mode: number;
|
42
|
+
entries?: number;
|
43
|
+
extensions?: Array<string>;
|
44
|
+
packageExports: boolean;
|
45
|
+
typescript?: boolean;
|
39
46
|
}
|
40
47
|
export interface ResolveOptions {
|
41
|
-
filename: string
|
42
|
-
specifierType: string
|
43
|
-
parent: string
|
44
|
-
packageConditions?: Array<string
|
48
|
+
filename: string;
|
49
|
+
specifierType: string;
|
50
|
+
parent: string;
|
51
|
+
packageConditions?: Array<string>;
|
45
52
|
}
|
46
53
|
export interface FilePathCreateInvalidation {
|
47
|
-
filePath: string
|
54
|
+
filePath: string;
|
48
55
|
}
|
49
56
|
export interface FileNameCreateInvalidation {
|
50
|
-
fileName: string
|
51
|
-
aboveFilePath: string
|
57
|
+
fileName: string;
|
58
|
+
aboveFilePath: string;
|
52
59
|
}
|
53
60
|
export interface GlobCreateInvalidation {
|
54
|
-
glob: string
|
61
|
+
glob: string;
|
55
62
|
}
|
56
63
|
export interface ResolveResult {
|
57
|
-
resolution: unknown
|
58
|
-
invalidateOnFileChange: Array<string
|
59
|
-
invalidateOnFileCreate: Array<
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
+
resolution: unknown;
|
65
|
+
invalidateOnFileChange: Array<string>;
|
66
|
+
invalidateOnFileCreate: Array<
|
67
|
+
| FilePathCreateInvalidation
|
68
|
+
| FileNameCreateInvalidation
|
69
|
+
| GlobCreateInvalidation
|
70
|
+
>;
|
71
|
+
query?: string;
|
72
|
+
sideEffects: boolean;
|
73
|
+
error: unknown;
|
74
|
+
moduleType: number;
|
64
75
|
}
|
65
76
|
export interface JsInvalidations {
|
66
|
-
invalidateOnFileChange: Array<string
|
67
|
-
invalidateOnFileCreate: Array<
|
68
|
-
|
77
|
+
invalidateOnFileChange: Array<string>;
|
78
|
+
invalidateOnFileCreate: Array<
|
79
|
+
| FilePathCreateInvalidation
|
80
|
+
| FileNameCreateInvalidation
|
81
|
+
| GlobCreateInvalidation
|
82
|
+
>;
|
83
|
+
invalidateOnStartup: boolean;
|
69
84
|
}
|
70
|
-
export declare function transform(opts: object): unknown
|
71
|
-
export declare function transformAsync(opts: object): object
|
85
|
+
export declare function transform(opts: object): unknown;
|
86
|
+
export declare function transformAsync(opts: object): object;
|
72
87
|
export declare class Hash {
|
73
|
-
constructor()
|
74
|
-
writeString(s: string): void
|
75
|
-
writeBuffer(buf: Buffer): void
|
76
|
-
finish(): string
|
88
|
+
constructor();
|
89
|
+
writeString(s: string): void;
|
90
|
+
writeBuffer(buf: Buffer): void;
|
91
|
+
finish(): string;
|
77
92
|
}
|
78
93
|
export declare class Resolver {
|
79
|
-
constructor(projectRoot: string, options: FileSystem)
|
80
|
-
resolve(options: ResolveOptions): ResolveResult
|
81
|
-
resolveAsync(): object
|
82
|
-
resolveAsync(options: ResolveOptions): object
|
83
|
-
getInvalidations(path: string): JsInvalidations
|
84
|
-
getInvalidations(path: string): JsInvalidations
|
94
|
+
constructor(projectRoot: string, options: FileSystem);
|
95
|
+
resolve(options: ResolveOptions): ResolveResult;
|
96
|
+
resolveAsync(): object;
|
97
|
+
resolveAsync(options: ResolveOptions): object;
|
98
|
+
getInvalidations(path: string): JsInvalidations;
|
99
|
+
getInvalidations(path: string): JsInvalidations;
|
85
100
|
}
|
package/index.js
CHANGED
@@ -5,26 +5,29 @@
|
|
5
5
|
/* auto-generated by NAPI-RS */
|
6
6
|
|
7
7
|
const { existsSync, readFileSync } = require('fs')
|
8
|
-
const {
|
8
|
+
const {join} = require('path');
|
9
9
|
|
10
|
-
const {
|
10
|
+
const {platform, arch} = process;
|
11
11
|
|
12
|
-
let nativeBinding = null
|
13
|
-
let localFileExisted = false
|
14
|
-
let loadError = null
|
12
|
+
let nativeBinding = null;
|
13
|
+
let localFileExisted = false;
|
14
|
+
let loadError = null;
|
15
15
|
|
16
16
|
function isMusl() {
|
17
17
|
// For Node 10
|
18
18
|
if (!process.report || typeof process.report.getReport !== 'function') {
|
19
19
|
try {
|
20
|
-
const lddPath = require('child_process')
|
21
|
-
|
20
|
+
const lddPath = require('child_process')
|
21
|
+
.execSync('which ldd')
|
22
|
+
.toString()
|
23
|
+
.trim();
|
24
|
+
return readFileSync(lddPath, 'utf8').includes('musl');
|
22
25
|
} catch (e) {
|
23
|
-
return true
|
26
|
+
return true;
|
24
27
|
}
|
25
28
|
} else {
|
26
|
-
const {
|
27
|
-
return !glibcVersionRuntime
|
29
|
+
const {glibcVersionRuntime} = process.report.getReport().header;
|
30
|
+
return !glibcVersionRuntime;
|
28
31
|
}
|
29
32
|
}
|
30
33
|
|
@@ -32,300 +35,328 @@ switch (platform) {
|
|
32
35
|
case 'android':
|
33
36
|
switch (arch) {
|
34
37
|
case 'arm64':
|
35
|
-
localFileExisted = existsSync(
|
38
|
+
localFileExisted = existsSync(
|
39
|
+
join(__dirname, 'parcel-node-bindings.android-arm64.node'),
|
40
|
+
);
|
36
41
|
try {
|
37
42
|
if (localFileExisted) {
|
38
|
-
nativeBinding = require('./parcel-node-bindings.android-arm64.node')
|
43
|
+
nativeBinding = require('./parcel-node-bindings.android-arm64.node');
|
39
44
|
} else {
|
40
|
-
nativeBinding = require('@parcel/rust-android-arm64')
|
45
|
+
nativeBinding = require('@parcel/rust-android-arm64');
|
41
46
|
}
|
42
47
|
} catch (e) {
|
43
|
-
loadError = e
|
48
|
+
loadError = e;
|
44
49
|
}
|
45
|
-
break
|
50
|
+
break;
|
46
51
|
case 'arm':
|
47
|
-
localFileExisted = existsSync(
|
52
|
+
localFileExisted = existsSync(
|
53
|
+
join(__dirname, 'parcel-node-bindings.android-arm-eabi.node'),
|
54
|
+
);
|
48
55
|
try {
|
49
56
|
if (localFileExisted) {
|
50
|
-
nativeBinding = require('./parcel-node-bindings.android-arm-eabi.node')
|
57
|
+
nativeBinding = require('./parcel-node-bindings.android-arm-eabi.node');
|
51
58
|
} else {
|
52
|
-
nativeBinding = require('@parcel/rust-android-arm-eabi')
|
59
|
+
nativeBinding = require('@parcel/rust-android-arm-eabi');
|
53
60
|
}
|
54
61
|
} catch (e) {
|
55
|
-
loadError = e
|
62
|
+
loadError = e;
|
56
63
|
}
|
57
|
-
break
|
64
|
+
break;
|
58
65
|
default:
|
59
|
-
throw new Error(`Unsupported architecture on Android ${arch}`)
|
66
|
+
throw new Error(`Unsupported architecture on Android ${arch}`);
|
60
67
|
}
|
61
|
-
break
|
68
|
+
break;
|
62
69
|
case 'win32':
|
63
70
|
switch (arch) {
|
64
71
|
case 'x64':
|
65
72
|
localFileExisted = existsSync(
|
66
|
-
join(__dirname, 'parcel-node-bindings.win32-x64-msvc.node')
|
67
|
-
)
|
73
|
+
join(__dirname, 'parcel-node-bindings.win32-x64-msvc.node'),
|
74
|
+
);
|
68
75
|
try {
|
69
76
|
if (localFileExisted) {
|
70
|
-
nativeBinding = require('./parcel-node-bindings.win32-x64-msvc.node')
|
77
|
+
nativeBinding = require('./parcel-node-bindings.win32-x64-msvc.node');
|
71
78
|
} else {
|
72
|
-
nativeBinding = require('@parcel/rust-win32-x64-msvc')
|
79
|
+
nativeBinding = require('@parcel/rust-win32-x64-msvc');
|
73
80
|
}
|
74
81
|
} catch (e) {
|
75
|
-
loadError = e
|
82
|
+
loadError = e;
|
76
83
|
}
|
77
|
-
break
|
84
|
+
break;
|
78
85
|
case 'ia32':
|
79
86
|
localFileExisted = existsSync(
|
80
|
-
join(__dirname, 'parcel-node-bindings.win32-ia32-msvc.node')
|
81
|
-
)
|
87
|
+
join(__dirname, 'parcel-node-bindings.win32-ia32-msvc.node'),
|
88
|
+
);
|
82
89
|
try {
|
83
90
|
if (localFileExisted) {
|
84
|
-
nativeBinding = require('./parcel-node-bindings.win32-ia32-msvc.node')
|
91
|
+
nativeBinding = require('./parcel-node-bindings.win32-ia32-msvc.node');
|
85
92
|
} else {
|
86
|
-
nativeBinding = require('@parcel/rust-win32-ia32-msvc')
|
93
|
+
nativeBinding = require('@parcel/rust-win32-ia32-msvc');
|
87
94
|
}
|
88
95
|
} catch (e) {
|
89
|
-
loadError = e
|
96
|
+
loadError = e;
|
90
97
|
}
|
91
|
-
break
|
98
|
+
break;
|
92
99
|
case 'arm64':
|
93
100
|
localFileExisted = existsSync(
|
94
|
-
join(__dirname, 'parcel-node-bindings.win32-arm64-msvc.node')
|
95
|
-
)
|
101
|
+
join(__dirname, 'parcel-node-bindings.win32-arm64-msvc.node'),
|
102
|
+
);
|
96
103
|
try {
|
97
104
|
if (localFileExisted) {
|
98
|
-
nativeBinding = require('./parcel-node-bindings.win32-arm64-msvc.node')
|
105
|
+
nativeBinding = require('./parcel-node-bindings.win32-arm64-msvc.node');
|
99
106
|
} else {
|
100
|
-
nativeBinding = require('@parcel/rust-win32-arm64-msvc')
|
107
|
+
nativeBinding = require('@parcel/rust-win32-arm64-msvc');
|
101
108
|
}
|
102
109
|
} catch (e) {
|
103
|
-
loadError = e
|
110
|
+
loadError = e;
|
104
111
|
}
|
105
|
-
break
|
112
|
+
break;
|
106
113
|
default:
|
107
|
-
throw new Error(`Unsupported architecture on Windows: ${arch}`)
|
114
|
+
throw new Error(`Unsupported architecture on Windows: ${arch}`);
|
108
115
|
}
|
109
|
-
break
|
116
|
+
break;
|
110
117
|
case 'darwin':
|
111
|
-
localFileExisted = existsSync(
|
118
|
+
localFileExisted = existsSync(
|
119
|
+
join(__dirname, 'parcel-node-bindings.darwin-universal.node'),
|
120
|
+
);
|
112
121
|
try {
|
113
122
|
if (localFileExisted) {
|
114
|
-
nativeBinding = require('./parcel-node-bindings.darwin-universal.node')
|
123
|
+
nativeBinding = require('./parcel-node-bindings.darwin-universal.node');
|
115
124
|
} else {
|
116
|
-
nativeBinding = require('@parcel/rust-darwin-universal')
|
125
|
+
nativeBinding = require('@parcel/rust-darwin-universal');
|
117
126
|
}
|
118
|
-
break
|
127
|
+
break;
|
119
128
|
} catch {}
|
120
129
|
switch (arch) {
|
121
130
|
case 'x64':
|
122
|
-
localFileExisted = existsSync(
|
131
|
+
localFileExisted = existsSync(
|
132
|
+
join(__dirname, 'parcel-node-bindings.darwin-x64.node'),
|
133
|
+
);
|
123
134
|
try {
|
124
135
|
if (localFileExisted) {
|
125
|
-
nativeBinding = require('./parcel-node-bindings.darwin-x64.node')
|
136
|
+
nativeBinding = require('./parcel-node-bindings.darwin-x64.node');
|
126
137
|
} else {
|
127
|
-
nativeBinding = require('@parcel/rust-darwin-x64')
|
138
|
+
nativeBinding = require('@parcel/rust-darwin-x64');
|
128
139
|
}
|
129
140
|
} catch (e) {
|
130
|
-
loadError = e
|
141
|
+
loadError = e;
|
131
142
|
}
|
132
|
-
break
|
143
|
+
break;
|
133
144
|
case 'arm64':
|
134
145
|
localFileExisted = existsSync(
|
135
|
-
join(__dirname, 'parcel-node-bindings.darwin-arm64.node')
|
136
|
-
)
|
146
|
+
join(__dirname, 'parcel-node-bindings.darwin-arm64.node'),
|
147
|
+
);
|
137
148
|
try {
|
138
149
|
if (localFileExisted) {
|
139
|
-
nativeBinding = require('./parcel-node-bindings.darwin-arm64.node')
|
150
|
+
nativeBinding = require('./parcel-node-bindings.darwin-arm64.node');
|
140
151
|
} else {
|
141
|
-
nativeBinding = require('@parcel/rust-darwin-arm64')
|
152
|
+
nativeBinding = require('@parcel/rust-darwin-arm64');
|
142
153
|
}
|
143
154
|
} catch (e) {
|
144
|
-
loadError = e
|
155
|
+
loadError = e;
|
145
156
|
}
|
146
|
-
break
|
157
|
+
break;
|
147
158
|
default:
|
148
|
-
throw new Error(`Unsupported architecture on macOS: ${arch}`)
|
159
|
+
throw new Error(`Unsupported architecture on macOS: ${arch}`);
|
149
160
|
}
|
150
|
-
break
|
161
|
+
break;
|
151
162
|
case 'freebsd':
|
152
163
|
if (arch !== 'x64') {
|
153
|
-
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
|
164
|
+
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`);
|
154
165
|
}
|
155
|
-
localFileExisted = existsSync(
|
166
|
+
localFileExisted = existsSync(
|
167
|
+
join(__dirname, 'parcel-node-bindings.freebsd-x64.node'),
|
168
|
+
);
|
156
169
|
try {
|
157
170
|
if (localFileExisted) {
|
158
|
-
nativeBinding = require('./parcel-node-bindings.freebsd-x64.node')
|
171
|
+
nativeBinding = require('./parcel-node-bindings.freebsd-x64.node');
|
159
172
|
} else {
|
160
|
-
nativeBinding = require('@parcel/rust-freebsd-x64')
|
173
|
+
nativeBinding = require('@parcel/rust-freebsd-x64');
|
161
174
|
}
|
162
175
|
} catch (e) {
|
163
|
-
loadError = e
|
176
|
+
loadError = e;
|
164
177
|
}
|
165
|
-
break
|
178
|
+
break;
|
166
179
|
case 'linux':
|
167
180
|
switch (arch) {
|
168
181
|
case 'x64':
|
169
182
|
if (isMusl()) {
|
170
183
|
localFileExisted = existsSync(
|
171
|
-
join(__dirname, 'parcel-node-bindings.linux-x64-musl.node')
|
172
|
-
)
|
184
|
+
join(__dirname, 'parcel-node-bindings.linux-x64-musl.node'),
|
185
|
+
);
|
173
186
|
try {
|
174
187
|
if (localFileExisted) {
|
175
|
-
nativeBinding = require('./parcel-node-bindings.linux-x64-musl.node')
|
188
|
+
nativeBinding = require('./parcel-node-bindings.linux-x64-musl.node');
|
176
189
|
} else {
|
177
|
-
nativeBinding = require('@parcel/rust-linux-x64-musl')
|
190
|
+
nativeBinding = require('@parcel/rust-linux-x64-musl');
|
178
191
|
}
|
179
192
|
} catch (e) {
|
180
|
-
loadError = e
|
193
|
+
loadError = e;
|
181
194
|
}
|
182
195
|
} else {
|
183
196
|
localFileExisted = existsSync(
|
184
|
-
join(__dirname, 'parcel-node-bindings.linux-x64-gnu.node')
|
185
|
-
)
|
197
|
+
join(__dirname, 'parcel-node-bindings.linux-x64-gnu.node'),
|
198
|
+
);
|
186
199
|
try {
|
187
200
|
if (localFileExisted) {
|
188
|
-
nativeBinding = require('./parcel-node-bindings.linux-x64-gnu.node')
|
201
|
+
nativeBinding = require('./parcel-node-bindings.linux-x64-gnu.node');
|
189
202
|
} else {
|
190
|
-
nativeBinding = require('@parcel/rust-linux-x64-gnu')
|
203
|
+
nativeBinding = require('@parcel/rust-linux-x64-gnu');
|
191
204
|
}
|
192
205
|
} catch (e) {
|
193
|
-
loadError = e
|
206
|
+
loadError = e;
|
194
207
|
}
|
195
208
|
}
|
196
|
-
break
|
209
|
+
break;
|
197
210
|
case 'arm64':
|
198
211
|
if (isMusl()) {
|
199
212
|
localFileExisted = existsSync(
|
200
|
-
join(__dirname, 'parcel-node-bindings.linux-arm64-musl.node')
|
201
|
-
)
|
213
|
+
join(__dirname, 'parcel-node-bindings.linux-arm64-musl.node'),
|
214
|
+
);
|
202
215
|
try {
|
203
216
|
if (localFileExisted) {
|
204
|
-
nativeBinding = require('./parcel-node-bindings.linux-arm64-musl.node')
|
217
|
+
nativeBinding = require('./parcel-node-bindings.linux-arm64-musl.node');
|
205
218
|
} else {
|
206
|
-
nativeBinding = require('@parcel/rust-linux-arm64-musl')
|
219
|
+
nativeBinding = require('@parcel/rust-linux-arm64-musl');
|
207
220
|
}
|
208
221
|
} catch (e) {
|
209
|
-
loadError = e
|
222
|
+
loadError = e;
|
210
223
|
}
|
211
224
|
} else {
|
212
225
|
localFileExisted = existsSync(
|
213
|
-
join(__dirname, 'parcel-node-bindings.linux-arm64-gnu.node')
|
214
|
-
)
|
226
|
+
join(__dirname, 'parcel-node-bindings.linux-arm64-gnu.node'),
|
227
|
+
);
|
215
228
|
try {
|
216
229
|
if (localFileExisted) {
|
217
|
-
nativeBinding = require('./parcel-node-bindings.linux-arm64-gnu.node')
|
230
|
+
nativeBinding = require('./parcel-node-bindings.linux-arm64-gnu.node');
|
218
231
|
} else {
|
219
|
-
nativeBinding = require('@parcel/rust-linux-arm64-gnu')
|
232
|
+
nativeBinding = require('@parcel/rust-linux-arm64-gnu');
|
220
233
|
}
|
221
234
|
} catch (e) {
|
222
|
-
loadError = e
|
235
|
+
loadError = e;
|
223
236
|
}
|
224
237
|
}
|
225
|
-
break
|
238
|
+
break;
|
226
239
|
case 'arm':
|
227
240
|
if (isMusl()) {
|
228
241
|
localFileExisted = existsSync(
|
229
|
-
join(__dirname, 'parcel-node-bindings.linux-arm-musleabihf.node')
|
230
|
-
)
|
242
|
+
join(__dirname, 'parcel-node-bindings.linux-arm-musleabihf.node'),
|
243
|
+
);
|
231
244
|
try {
|
232
245
|
if (localFileExisted) {
|
233
|
-
nativeBinding = require('./parcel-node-bindings.linux-arm-musleabihf.node')
|
246
|
+
nativeBinding = require('./parcel-node-bindings.linux-arm-musleabihf.node');
|
234
247
|
} else {
|
235
|
-
nativeBinding = require('@parcel/rust-linux-arm-musleabihf')
|
248
|
+
nativeBinding = require('@parcel/rust-linux-arm-musleabihf');
|
236
249
|
}
|
237
250
|
} catch (e) {
|
238
|
-
loadError = e
|
251
|
+
loadError = e;
|
239
252
|
}
|
240
253
|
} else {
|
241
254
|
localFileExisted = existsSync(
|
242
|
-
join(__dirname, 'parcel-node-bindings.linux-arm-gnueabihf.node')
|
243
|
-
)
|
255
|
+
join(__dirname, 'parcel-node-bindings.linux-arm-gnueabihf.node'),
|
256
|
+
);
|
244
257
|
try {
|
245
258
|
if (localFileExisted) {
|
246
|
-
nativeBinding = require('./parcel-node-bindings.linux-arm-gnueabihf.node')
|
259
|
+
nativeBinding = require('./parcel-node-bindings.linux-arm-gnueabihf.node');
|
247
260
|
} else {
|
248
|
-
nativeBinding = require('@parcel/rust-linux-arm-gnueabihf')
|
261
|
+
nativeBinding = require('@parcel/rust-linux-arm-gnueabihf');
|
249
262
|
}
|
250
263
|
} catch (e) {
|
251
|
-
loadError = e
|
264
|
+
loadError = e;
|
252
265
|
}
|
253
266
|
}
|
254
|
-
break
|
267
|
+
break;
|
255
268
|
case 'riscv64':
|
256
269
|
if (isMusl()) {
|
257
270
|
localFileExisted = existsSync(
|
258
|
-
join(__dirname, 'parcel-node-bindings.linux-riscv64-musl.node')
|
259
|
-
)
|
271
|
+
join(__dirname, 'parcel-node-bindings.linux-riscv64-musl.node'),
|
272
|
+
);
|
260
273
|
try {
|
261
274
|
if (localFileExisted) {
|
262
|
-
nativeBinding = require('./parcel-node-bindings.linux-riscv64-musl.node')
|
275
|
+
nativeBinding = require('./parcel-node-bindings.linux-riscv64-musl.node');
|
263
276
|
} else {
|
264
|
-
nativeBinding = require('@parcel/rust-linux-riscv64-musl')
|
277
|
+
nativeBinding = require('@parcel/rust-linux-riscv64-musl');
|
265
278
|
}
|
266
279
|
} catch (e) {
|
267
|
-
loadError = e
|
280
|
+
loadError = e;
|
268
281
|
}
|
269
282
|
} else {
|
270
283
|
localFileExisted = existsSync(
|
271
|
-
join(__dirname, 'parcel-node-bindings.linux-riscv64-gnu.node')
|
272
|
-
)
|
284
|
+
join(__dirname, 'parcel-node-bindings.linux-riscv64-gnu.node'),
|
285
|
+
);
|
273
286
|
try {
|
274
287
|
if (localFileExisted) {
|
275
|
-
nativeBinding = require('./parcel-node-bindings.linux-riscv64-gnu.node')
|
288
|
+
nativeBinding = require('./parcel-node-bindings.linux-riscv64-gnu.node');
|
276
289
|
} else {
|
277
|
-
nativeBinding = require('@parcel/rust-linux-riscv64-gnu')
|
290
|
+
nativeBinding = require('@parcel/rust-linux-riscv64-gnu');
|
278
291
|
}
|
279
292
|
} catch (e) {
|
280
|
-
loadError = e
|
293
|
+
loadError = e;
|
281
294
|
}
|
282
295
|
}
|
283
|
-
break
|
296
|
+
break;
|
284
297
|
case 's390x':
|
285
298
|
localFileExisted = existsSync(
|
286
|
-
join(__dirname, 'parcel-node-bindings.linux-s390x-gnu.node')
|
287
|
-
)
|
299
|
+
join(__dirname, 'parcel-node-bindings.linux-s390x-gnu.node'),
|
300
|
+
);
|
288
301
|
try {
|
289
302
|
if (localFileExisted) {
|
290
|
-
nativeBinding = require('./parcel-node-bindings.linux-s390x-gnu.node')
|
303
|
+
nativeBinding = require('./parcel-node-bindings.linux-s390x-gnu.node');
|
291
304
|
} else {
|
292
|
-
nativeBinding = require('@parcel/rust-linux-s390x-gnu')
|
305
|
+
nativeBinding = require('@parcel/rust-linux-s390x-gnu');
|
293
306
|
}
|
294
307
|
} catch (e) {
|
295
|
-
loadError = e
|
308
|
+
loadError = e;
|
296
309
|
}
|
297
|
-
break
|
310
|
+
break;
|
298
311
|
default:
|
299
|
-
throw new Error(`Unsupported architecture on Linux: ${arch}`)
|
312
|
+
throw new Error(`Unsupported architecture on Linux: ${arch}`);
|
300
313
|
}
|
301
|
-
break
|
314
|
+
break;
|
302
315
|
default:
|
303
|
-
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
|
316
|
+
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`);
|
304
317
|
}
|
305
318
|
|
306
319
|
if (!nativeBinding) {
|
307
320
|
if (loadError) {
|
308
|
-
throw loadError
|
321
|
+
throw loadError;
|
309
322
|
}
|
310
|
-
throw new Error(`Failed to load native binding`)
|
323
|
+
throw new Error(`Failed to load native binding`);
|
311
324
|
}
|
312
325
|
|
313
|
-
const {
|
326
|
+
const {
|
327
|
+
findAncestorFile,
|
328
|
+
findFirstFile,
|
329
|
+
findNodeModule,
|
330
|
+
hashString,
|
331
|
+
hashBuffer,
|
332
|
+
Hash,
|
333
|
+
optimizeImage,
|
334
|
+
transformHtml,
|
335
|
+
packageHtml,
|
336
|
+
optimizeHtml,
|
337
|
+
transformSvg,
|
338
|
+
packageSvg,
|
339
|
+
optimizeSvg,
|
340
|
+
svgReact,
|
341
|
+
Resolver,
|
342
|
+
transform,
|
343
|
+
transformAsync,
|
344
|
+
} = nativeBinding;
|
314
345
|
|
315
|
-
module.exports.findAncestorFile = findAncestorFile
|
316
|
-
module.exports.findFirstFile = findFirstFile
|
317
|
-
module.exports.findNodeModule = findNodeModule
|
318
|
-
module.exports.hashString = hashString
|
319
|
-
module.exports.hashBuffer = hashBuffer
|
320
|
-
module.exports.Hash = Hash
|
321
|
-
module.exports.optimizeImage = optimizeImage
|
322
|
-
module.exports.transformHtml = transformHtml
|
323
|
-
module.exports.packageHtml = packageHtml
|
324
|
-
module.exports.optimizeHtml = optimizeHtml
|
325
|
-
module.exports.transformSvg = transformSvg
|
326
|
-
module.exports.packageSvg = packageSvg
|
327
|
-
module.exports.optimizeSvg = optimizeSvg
|
328
|
-
module.exports.svgReact = svgReact
|
329
|
-
module.exports.Resolver = Resolver
|
330
|
-
module.exports.transform = transform
|
331
|
-
module.exports.transformAsync = transformAsync
|
346
|
+
module.exports.findAncestorFile = findAncestorFile;
|
347
|
+
module.exports.findFirstFile = findFirstFile;
|
348
|
+
module.exports.findNodeModule = findNodeModule;
|
349
|
+
module.exports.hashString = hashString;
|
350
|
+
module.exports.hashBuffer = hashBuffer;
|
351
|
+
module.exports.Hash = Hash;
|
352
|
+
module.exports.optimizeImage = optimizeImage;
|
353
|
+
module.exports.transformHtml = transformHtml;
|
354
|
+
module.exports.packageHtml = packageHtml;
|
355
|
+
module.exports.optimizeHtml = optimizeHtml;
|
356
|
+
module.exports.transformSvg = transformSvg;
|
357
|
+
module.exports.packageSvg = packageSvg;
|
358
|
+
module.exports.optimizeSvg = optimizeSvg;
|
359
|
+
module.exports.svgReact = svgReact;
|
360
|
+
module.exports.Resolver = Resolver;
|
361
|
+
module.exports.transform = transform;
|
362
|
+
module.exports.transformAsync = transformAsync;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@parcel/rust",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.15.0",
|
4
4
|
"license": "MIT",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -23,7 +23,7 @@
|
|
23
23
|
"node": ">= 16.0.0"
|
24
24
|
},
|
25
25
|
"files": [
|
26
|
-
"lib",
|
26
|
+
"lib/*.js",
|
27
27
|
"browser.js",
|
28
28
|
"index.d.ts",
|
29
29
|
"index.js",
|
@@ -33,7 +33,7 @@
|
|
33
33
|
],
|
34
34
|
"devDependencies": {
|
35
35
|
"@napi-rs/cli": "^2.15.2",
|
36
|
-
"napi-wasm": "^1.1.
|
36
|
+
"napi-wasm": "^1.1.3"
|
37
37
|
},
|
38
38
|
"peerDependencies": {
|
39
39
|
"napi-wasm": "^1.1.2"
|
@@ -44,14 +44,14 @@
|
|
44
44
|
}
|
45
45
|
},
|
46
46
|
"optionalDependencies": {
|
47
|
-
"@parcel/rust-darwin-arm64": "2.
|
48
|
-
"@parcel/rust-darwin-x64": "2.
|
49
|
-
"@parcel/rust-linux-arm-gnueabihf": "2.
|
50
|
-
"@parcel/rust-linux-arm64-gnu": "2.
|
51
|
-
"@parcel/rust-linux-arm64-musl": "2.
|
52
|
-
"@parcel/rust-linux-x64-gnu": "2.
|
53
|
-
"@parcel/rust-linux-x64-musl": "2.
|
54
|
-
"@parcel/rust-win32-x64-msvc": "2.
|
47
|
+
"@parcel/rust-darwin-arm64": "2.15.0",
|
48
|
+
"@parcel/rust-darwin-x64": "2.15.0",
|
49
|
+
"@parcel/rust-linux-arm-gnueabihf": "2.15.0",
|
50
|
+
"@parcel/rust-linux-arm64-gnu": "2.15.0",
|
51
|
+
"@parcel/rust-linux-arm64-musl": "2.15.0",
|
52
|
+
"@parcel/rust-linux-x64-gnu": "2.15.0",
|
53
|
+
"@parcel/rust-linux-x64-musl": "2.15.0",
|
54
|
+
"@parcel/rust-win32-x64-msvc": "2.15.0"
|
55
55
|
},
|
56
56
|
"scripts": {
|
57
57
|
"build": "napi build --platform --cargo-cwd ../../../crates/node-bindings",
|
@@ -60,5 +60,5 @@
|
|
60
60
|
"wasm:build": "cargo build -p parcel-node-bindings --target wasm32-unknown-unknown && cp ../../../target/wasm32-unknown-unknown/debug/parcel_node_bindings.wasm .",
|
61
61
|
"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"
|
62
62
|
},
|
63
|
-
"gitHead": "
|
63
|
+
"gitHead": "99ada2e5258f6d4a2c6cdc366c12e4161b0161e6"
|
64
64
|
}
|