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