@ohos-rs/oxk 0.6.0 → 0.7.1
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/bin/format.js +4 -232
- package/bin/oxk.js +14 -0
- package/configuration_schema.json +2530 -16
- package/format.d.ts +12 -0
- package/format.js +24 -2
- package/index.d.ts +13 -0
- package/index.js +236 -76
- package/oxlint-runtime/js_config.cjs +6 -6
- package/oxlint-runtime/plugins.cjs +8 -8
- package/package.json +23 -16
package/format.d.ts
CHANGED
|
@@ -17,6 +17,18 @@ export declare function format(
|
|
|
17
17
|
|
|
18
18
|
export declare function formatLsp(): Promise<boolean>
|
|
19
19
|
|
|
20
|
+
export interface FormatFilesOptions {
|
|
21
|
+
patterns: string[]
|
|
22
|
+
excludes: string[]
|
|
23
|
+
ignorePaths: string[]
|
|
24
|
+
withNodeModules: boolean
|
|
25
|
+
threadCount: number
|
|
26
|
+
configPath?: string
|
|
27
|
+
cliOptions?: Record<string, any>
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export declare function formatFiles(args: FormatFilesOptions): Promise<boolean>
|
|
31
|
+
|
|
20
32
|
// Re-export the raw format function for advanced usage
|
|
21
33
|
export { format as formatRaw } from './index.js'
|
|
22
34
|
export type { FormatResult } from './index.d.ts'
|
package/format.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
// Convenience wrapper that automatically uses Prettier for external formatter callbacks
|
|
2
|
-
const {
|
|
2
|
+
const {
|
|
3
|
+
format: napiFormat,
|
|
4
|
+
formatFiles: napiFormatFiles,
|
|
5
|
+
formatLsp,
|
|
6
|
+
} = require("./index.js");
|
|
3
7
|
|
|
4
8
|
// Lazy load Prettier
|
|
5
9
|
let prettierCache;
|
|
@@ -111,6 +115,24 @@ async function format(fileName, sourceText, options) {
|
|
|
111
115
|
);
|
|
112
116
|
}
|
|
113
117
|
|
|
118
|
+
async function formatFiles(args) {
|
|
119
|
+
return napiFormatFiles(
|
|
120
|
+
{
|
|
121
|
+
patterns: args.patterns,
|
|
122
|
+
excludes: args.excludes,
|
|
123
|
+
ignorePaths: args.ignorePaths,
|
|
124
|
+
withNodeModules: args.withNodeModules,
|
|
125
|
+
threadCount: args.threadCount,
|
|
126
|
+
configPath: args.configPath,
|
|
127
|
+
cliOptions: args.cliOptions,
|
|
128
|
+
},
|
|
129
|
+
resolvePlugins,
|
|
130
|
+
(options, tagName, code) => formatEmbeddedCode({ options, tagName, code }),
|
|
131
|
+
(options, parserName, fileName, code) =>
|
|
132
|
+
formatFile({ options, parserName, fileName, code }),
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
114
136
|
// Re-export the raw format function for advanced usage
|
|
115
137
|
function formatRaw(
|
|
116
138
|
fileName,
|
|
@@ -131,4 +153,4 @@ function formatRaw(
|
|
|
131
153
|
);
|
|
132
154
|
}
|
|
133
155
|
|
|
134
|
-
module.exports = { format, formatRaw, formatLsp };
|
|
156
|
+
module.exports = { format, formatFiles, formatRaw, formatLsp };
|
package/index.d.ts
CHANGED
|
@@ -96,6 +96,19 @@ export declare const enum ExportLocalNameKind {
|
|
|
96
96
|
*/
|
|
97
97
|
export declare function format(filename: string, sourceText: string, options?: any | undefined | null, initExternalFormatterCb?: (numThreads: number) => Promise<string[]>, formatEmbeddedCb?: (options: Record<string, any>, tagName: string, code: string) => Promise<string>, formatFileCb?: (options: Record<string, any>, parserName: string, fileName: string, code: string) => Promise<string>): Promise<FormatResult>
|
|
98
98
|
|
|
99
|
+
/** Run the oxfmt-compatible formatter over files. */
|
|
100
|
+
export declare function formatFiles(args: FormatFilesArgs, initExternalFormatterCb: (numThreads: number) => Promise<string[]>, formatEmbeddedCb: (options: Record<string, any>, tagName: string, code: string) => Promise<string>, formatFileCb: (options: Record<string, any>, parserName: string, fileName: string, code: string) => Promise<string>): Promise<boolean>
|
|
101
|
+
|
|
102
|
+
export interface FormatFilesArgs {
|
|
103
|
+
patterns: Array<string>
|
|
104
|
+
excludes: Array<string>
|
|
105
|
+
ignorePaths: Array<string>
|
|
106
|
+
withNodeModules: boolean
|
|
107
|
+
threadCount: number
|
|
108
|
+
configPath?: string
|
|
109
|
+
cliOptions?: any
|
|
110
|
+
}
|
|
111
|
+
|
|
99
112
|
/** Run the oxfmt-compatible formatter language server. */
|
|
100
113
|
export declare function formatLsp(): Promise<boolean>
|
|
101
114
|
|
package/index.js
CHANGED
|
@@ -63,7 +63,7 @@ const isMuslFromChildProcess = () => {
|
|
|
63
63
|
function requireNative() {
|
|
64
64
|
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
|
|
65
65
|
try {
|
|
66
|
-
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)
|
|
66
|
+
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)
|
|
67
67
|
} catch (err) {
|
|
68
68
|
loadErrors.push(err)
|
|
69
69
|
}
|
|
@@ -77,8 +77,14 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('@ohos-rs/oxk-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('@ohos-rs/oxk-android-arm64/package.json').version
|
|
80
|
-
if (
|
|
81
|
-
|
|
80
|
+
if (
|
|
81
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
82
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
83
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
84
|
+
) {
|
|
85
|
+
throw new Error(
|
|
86
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
87
|
+
)
|
|
82
88
|
}
|
|
83
89
|
return binding
|
|
84
90
|
} catch (e) {
|
|
@@ -93,8 +99,14 @@ function requireNative() {
|
|
|
93
99
|
try {
|
|
94
100
|
const binding = require('@ohos-rs/oxk-android-arm-eabi')
|
|
95
101
|
const bindingPackageVersion = require('@ohos-rs/oxk-android-arm-eabi/package.json').version
|
|
96
|
-
if (
|
|
97
|
-
|
|
102
|
+
if (
|
|
103
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
104
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
105
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
106
|
+
) {
|
|
107
|
+
throw new Error(
|
|
108
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
109
|
+
)
|
|
98
110
|
}
|
|
99
111
|
return binding
|
|
100
112
|
} catch (e) {
|
|
@@ -105,38 +117,53 @@ function requireNative() {
|
|
|
105
117
|
}
|
|
106
118
|
} else if (process.platform === 'win32') {
|
|
107
119
|
if (process.arch === 'x64') {
|
|
108
|
-
if (
|
|
120
|
+
if (
|
|
121
|
+
process.config?.variables?.shlib_suffix === 'dll.a' ||
|
|
122
|
+
process.config?.variables?.node_target_type === 'shared_library'
|
|
123
|
+
) {
|
|
109
124
|
try {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
125
|
+
return require('./oxk.win32-x64-gnu.node')
|
|
126
|
+
} catch (e) {
|
|
127
|
+
loadErrors.push(e)
|
|
128
|
+
}
|
|
129
|
+
try {
|
|
130
|
+
const binding = require('@ohos-rs/oxk-win32-x64-gnu')
|
|
131
|
+
const bindingPackageVersion = require('@ohos-rs/oxk-win32-x64-gnu/package.json').version
|
|
132
|
+
if (
|
|
133
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
134
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
135
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
136
|
+
) {
|
|
137
|
+
throw new Error(
|
|
138
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
return binding
|
|
142
|
+
} catch (e) {
|
|
143
|
+
loadErrors.push(e)
|
|
119
144
|
}
|
|
120
|
-
return binding
|
|
121
|
-
} catch (e) {
|
|
122
|
-
loadErrors.push(e)
|
|
123
|
-
}
|
|
124
145
|
} else {
|
|
125
146
|
try {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
147
|
+
return require('./oxk.win32-x64-msvc.node')
|
|
148
|
+
} catch (e) {
|
|
149
|
+
loadErrors.push(e)
|
|
150
|
+
}
|
|
151
|
+
try {
|
|
152
|
+
const binding = require('@ohos-rs/oxk-win32-x64-msvc')
|
|
153
|
+
const bindingPackageVersion = require('@ohos-rs/oxk-win32-x64-msvc/package.json').version
|
|
154
|
+
if (
|
|
155
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
156
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
157
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
158
|
+
) {
|
|
159
|
+
throw new Error(
|
|
160
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
return binding
|
|
164
|
+
} catch (e) {
|
|
165
|
+
loadErrors.push(e)
|
|
135
166
|
}
|
|
136
|
-
return binding
|
|
137
|
-
} catch (e) {
|
|
138
|
-
loadErrors.push(e)
|
|
139
|
-
}
|
|
140
167
|
}
|
|
141
168
|
} else if (process.arch === 'ia32') {
|
|
142
169
|
try {
|
|
@@ -147,8 +174,14 @@ function requireNative() {
|
|
|
147
174
|
try {
|
|
148
175
|
const binding = require('@ohos-rs/oxk-win32-ia32-msvc')
|
|
149
176
|
const bindingPackageVersion = require('@ohos-rs/oxk-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (
|
|
151
|
-
|
|
177
|
+
if (
|
|
178
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
179
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
180
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
181
|
+
) {
|
|
182
|
+
throw new Error(
|
|
183
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
184
|
+
)
|
|
152
185
|
}
|
|
153
186
|
return binding
|
|
154
187
|
} catch (e) {
|
|
@@ -163,8 +196,14 @@ function requireNative() {
|
|
|
163
196
|
try {
|
|
164
197
|
const binding = require('@ohos-rs/oxk-win32-arm64-msvc')
|
|
165
198
|
const bindingPackageVersion = require('@ohos-rs/oxk-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (
|
|
167
|
-
|
|
199
|
+
if (
|
|
200
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
201
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
202
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
203
|
+
) {
|
|
204
|
+
throw new Error(
|
|
205
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
206
|
+
)
|
|
168
207
|
}
|
|
169
208
|
return binding
|
|
170
209
|
} catch (e) {
|
|
@@ -182,8 +221,14 @@ function requireNative() {
|
|
|
182
221
|
try {
|
|
183
222
|
const binding = require('@ohos-rs/oxk-darwin-universal')
|
|
184
223
|
const bindingPackageVersion = require('@ohos-rs/oxk-darwin-universal/package.json').version
|
|
185
|
-
if (
|
|
186
|
-
|
|
224
|
+
if (
|
|
225
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
226
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
227
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
228
|
+
) {
|
|
229
|
+
throw new Error(
|
|
230
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
231
|
+
)
|
|
187
232
|
}
|
|
188
233
|
return binding
|
|
189
234
|
} catch (e) {
|
|
@@ -198,8 +243,14 @@ function requireNative() {
|
|
|
198
243
|
try {
|
|
199
244
|
const binding = require('@ohos-rs/oxk-darwin-x64')
|
|
200
245
|
const bindingPackageVersion = require('@ohos-rs/oxk-darwin-x64/package.json').version
|
|
201
|
-
if (
|
|
202
|
-
|
|
246
|
+
if (
|
|
247
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
248
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
249
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
250
|
+
) {
|
|
251
|
+
throw new Error(
|
|
252
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
253
|
+
)
|
|
203
254
|
}
|
|
204
255
|
return binding
|
|
205
256
|
} catch (e) {
|
|
@@ -214,8 +265,14 @@ function requireNative() {
|
|
|
214
265
|
try {
|
|
215
266
|
const binding = require('@ohos-rs/oxk-darwin-arm64')
|
|
216
267
|
const bindingPackageVersion = require('@ohos-rs/oxk-darwin-arm64/package.json').version
|
|
217
|
-
if (
|
|
218
|
-
|
|
268
|
+
if (
|
|
269
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
270
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
271
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
272
|
+
) {
|
|
273
|
+
throw new Error(
|
|
274
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
275
|
+
)
|
|
219
276
|
}
|
|
220
277
|
return binding
|
|
221
278
|
} catch (e) {
|
|
@@ -234,8 +291,14 @@ function requireNative() {
|
|
|
234
291
|
try {
|
|
235
292
|
const binding = require('@ohos-rs/oxk-freebsd-x64')
|
|
236
293
|
const bindingPackageVersion = require('@ohos-rs/oxk-freebsd-x64/package.json').version
|
|
237
|
-
if (
|
|
238
|
-
|
|
294
|
+
if (
|
|
295
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
296
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
297
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
298
|
+
) {
|
|
299
|
+
throw new Error(
|
|
300
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
301
|
+
)
|
|
239
302
|
}
|
|
240
303
|
return binding
|
|
241
304
|
} catch (e) {
|
|
@@ -250,8 +313,14 @@ function requireNative() {
|
|
|
250
313
|
try {
|
|
251
314
|
const binding = require('@ohos-rs/oxk-freebsd-arm64')
|
|
252
315
|
const bindingPackageVersion = require('@ohos-rs/oxk-freebsd-arm64/package.json').version
|
|
253
|
-
if (
|
|
254
|
-
|
|
316
|
+
if (
|
|
317
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
318
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
319
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
320
|
+
) {
|
|
321
|
+
throw new Error(
|
|
322
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
323
|
+
)
|
|
255
324
|
}
|
|
256
325
|
return binding
|
|
257
326
|
} catch (e) {
|
|
@@ -271,8 +340,14 @@ function requireNative() {
|
|
|
271
340
|
try {
|
|
272
341
|
const binding = require('@ohos-rs/oxk-linux-x64-musl')
|
|
273
342
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-x64-musl/package.json').version
|
|
274
|
-
if (
|
|
275
|
-
|
|
343
|
+
if (
|
|
344
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
345
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
346
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
347
|
+
) {
|
|
348
|
+
throw new Error(
|
|
349
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
350
|
+
)
|
|
276
351
|
}
|
|
277
352
|
return binding
|
|
278
353
|
} catch (e) {
|
|
@@ -287,8 +362,14 @@ function requireNative() {
|
|
|
287
362
|
try {
|
|
288
363
|
const binding = require('@ohos-rs/oxk-linux-x64-gnu')
|
|
289
364
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-x64-gnu/package.json').version
|
|
290
|
-
if (
|
|
291
|
-
|
|
365
|
+
if (
|
|
366
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
367
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
368
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
369
|
+
) {
|
|
370
|
+
throw new Error(
|
|
371
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
372
|
+
)
|
|
292
373
|
}
|
|
293
374
|
return binding
|
|
294
375
|
} catch (e) {
|
|
@@ -305,8 +386,14 @@ function requireNative() {
|
|
|
305
386
|
try {
|
|
306
387
|
const binding = require('@ohos-rs/oxk-linux-arm64-musl')
|
|
307
388
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-arm64-musl/package.json').version
|
|
308
|
-
if (
|
|
309
|
-
|
|
389
|
+
if (
|
|
390
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
391
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
392
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
393
|
+
) {
|
|
394
|
+
throw new Error(
|
|
395
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
396
|
+
)
|
|
310
397
|
}
|
|
311
398
|
return binding
|
|
312
399
|
} catch (e) {
|
|
@@ -321,8 +408,14 @@ function requireNative() {
|
|
|
321
408
|
try {
|
|
322
409
|
const binding = require('@ohos-rs/oxk-linux-arm64-gnu')
|
|
323
410
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (
|
|
325
|
-
|
|
411
|
+
if (
|
|
412
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
413
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
414
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
415
|
+
) {
|
|
416
|
+
throw new Error(
|
|
417
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
418
|
+
)
|
|
326
419
|
}
|
|
327
420
|
return binding
|
|
328
421
|
} catch (e) {
|
|
@@ -339,8 +432,14 @@ function requireNative() {
|
|
|
339
432
|
try {
|
|
340
433
|
const binding = require('@ohos-rs/oxk-linux-arm-musleabihf')
|
|
341
434
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (
|
|
343
|
-
|
|
435
|
+
if (
|
|
436
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
437
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
438
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
439
|
+
) {
|
|
440
|
+
throw new Error(
|
|
441
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
442
|
+
)
|
|
344
443
|
}
|
|
345
444
|
return binding
|
|
346
445
|
} catch (e) {
|
|
@@ -355,8 +454,14 @@ function requireNative() {
|
|
|
355
454
|
try {
|
|
356
455
|
const binding = require('@ohos-rs/oxk-linux-arm-gnueabihf')
|
|
357
456
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (
|
|
359
|
-
|
|
457
|
+
if (
|
|
458
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
459
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
460
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
461
|
+
) {
|
|
462
|
+
throw new Error(
|
|
463
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
464
|
+
)
|
|
360
465
|
}
|
|
361
466
|
return binding
|
|
362
467
|
} catch (e) {
|
|
@@ -373,8 +478,14 @@ function requireNative() {
|
|
|
373
478
|
try {
|
|
374
479
|
const binding = require('@ohos-rs/oxk-linux-loong64-musl')
|
|
375
480
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-loong64-musl/package.json').version
|
|
376
|
-
if (
|
|
377
|
-
|
|
481
|
+
if (
|
|
482
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
483
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
484
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
485
|
+
) {
|
|
486
|
+
throw new Error(
|
|
487
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
488
|
+
)
|
|
378
489
|
}
|
|
379
490
|
return binding
|
|
380
491
|
} catch (e) {
|
|
@@ -389,8 +500,14 @@ function requireNative() {
|
|
|
389
500
|
try {
|
|
390
501
|
const binding = require('@ohos-rs/oxk-linux-loong64-gnu')
|
|
391
502
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (
|
|
393
|
-
|
|
503
|
+
if (
|
|
504
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
505
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
506
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
507
|
+
) {
|
|
508
|
+
throw new Error(
|
|
509
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
510
|
+
)
|
|
394
511
|
}
|
|
395
512
|
return binding
|
|
396
513
|
} catch (e) {
|
|
@@ -407,8 +524,14 @@ function requireNative() {
|
|
|
407
524
|
try {
|
|
408
525
|
const binding = require('@ohos-rs/oxk-linux-riscv64-musl')
|
|
409
526
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (
|
|
411
|
-
|
|
527
|
+
if (
|
|
528
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
529
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
530
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
531
|
+
) {
|
|
532
|
+
throw new Error(
|
|
533
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
534
|
+
)
|
|
412
535
|
}
|
|
413
536
|
return binding
|
|
414
537
|
} catch (e) {
|
|
@@ -423,8 +546,14 @@ function requireNative() {
|
|
|
423
546
|
try {
|
|
424
547
|
const binding = require('@ohos-rs/oxk-linux-riscv64-gnu')
|
|
425
548
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (
|
|
427
|
-
|
|
549
|
+
if (
|
|
550
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
551
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
552
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
553
|
+
) {
|
|
554
|
+
throw new Error(
|
|
555
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
556
|
+
)
|
|
428
557
|
}
|
|
429
558
|
return binding
|
|
430
559
|
} catch (e) {
|
|
@@ -440,8 +569,14 @@ function requireNative() {
|
|
|
440
569
|
try {
|
|
441
570
|
const binding = require('@ohos-rs/oxk-linux-ppc64-gnu')
|
|
442
571
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (
|
|
444
|
-
|
|
572
|
+
if (
|
|
573
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
574
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
575
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
576
|
+
) {
|
|
577
|
+
throw new Error(
|
|
578
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
579
|
+
)
|
|
445
580
|
}
|
|
446
581
|
return binding
|
|
447
582
|
} catch (e) {
|
|
@@ -456,8 +591,14 @@ function requireNative() {
|
|
|
456
591
|
try {
|
|
457
592
|
const binding = require('@ohos-rs/oxk-linux-s390x-gnu')
|
|
458
593
|
const bindingPackageVersion = require('@ohos-rs/oxk-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (
|
|
460
|
-
|
|
594
|
+
if (
|
|
595
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
596
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
597
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
598
|
+
) {
|
|
599
|
+
throw new Error(
|
|
600
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
601
|
+
)
|
|
461
602
|
}
|
|
462
603
|
return binding
|
|
463
604
|
} catch (e) {
|
|
@@ -476,8 +617,14 @@ function requireNative() {
|
|
|
476
617
|
try {
|
|
477
618
|
const binding = require('@ohos-rs/oxk-openharmony-arm64')
|
|
478
619
|
const bindingPackageVersion = require('@ohos-rs/oxk-openharmony-arm64/package.json').version
|
|
479
|
-
if (
|
|
480
|
-
|
|
620
|
+
if (
|
|
621
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
622
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
623
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
624
|
+
) {
|
|
625
|
+
throw new Error(
|
|
626
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
627
|
+
)
|
|
481
628
|
}
|
|
482
629
|
return binding
|
|
483
630
|
} catch (e) {
|
|
@@ -492,8 +639,14 @@ function requireNative() {
|
|
|
492
639
|
try {
|
|
493
640
|
const binding = require('@ohos-rs/oxk-openharmony-x64')
|
|
494
641
|
const bindingPackageVersion = require('@ohos-rs/oxk-openharmony-x64/package.json').version
|
|
495
|
-
if (
|
|
496
|
-
|
|
642
|
+
if (
|
|
643
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
644
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
645
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
646
|
+
) {
|
|
647
|
+
throw new Error(
|
|
648
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
649
|
+
)
|
|
497
650
|
}
|
|
498
651
|
return binding
|
|
499
652
|
} catch (e) {
|
|
@@ -508,8 +661,14 @@ function requireNative() {
|
|
|
508
661
|
try {
|
|
509
662
|
const binding = require('@ohos-rs/oxk-openharmony-arm')
|
|
510
663
|
const bindingPackageVersion = require('@ohos-rs/oxk-openharmony-arm/package.json').version
|
|
511
|
-
if (
|
|
512
|
-
|
|
664
|
+
if (
|
|
665
|
+
bindingPackageVersion !== '0.7.1' &&
|
|
666
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
667
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
668
|
+
) {
|
|
669
|
+
throw new Error(
|
|
670
|
+
`Native binding package version mismatch, expected 0.7.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
671
|
+
)
|
|
513
672
|
}
|
|
514
673
|
return binding
|
|
515
674
|
} catch (e) {
|
|
@@ -577,6 +736,7 @@ module.exports.ExportExportNameKind = nativeBinding.ExportExportNameKind
|
|
|
577
736
|
module.exports.ExportImportNameKind = nativeBinding.ExportImportNameKind
|
|
578
737
|
module.exports.ExportLocalNameKind = nativeBinding.ExportLocalNameKind
|
|
579
738
|
module.exports.format = nativeBinding.format
|
|
739
|
+
module.exports.formatFiles = nativeBinding.formatFiles
|
|
580
740
|
module.exports.formatLsp = nativeBinding.formatLsp
|
|
581
741
|
module.exports.ImportNameKind = nativeBinding.ImportNameKind
|
|
582
742
|
module.exports.lint = nativeBinding.lint
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
1
|
+
var L=Object.create;var g=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var v=(t,n)=>{for(var e in n)g(t,e,{get:n[e],enumerable:!0})},y=(t,n,e,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of T(n))!F.call(t,r)&&r!==e&&g(t,r,{get:()=>n[r],enumerable:!(o=N(n,r))||o.enumerable});return t};var U=(t,n,e)=>(e=t!=null?L($(t)):{},y(n||!t||!t.__esModule?g(e,"default",{value:t,enumerable:!0}):e,t)),M=t=>y(g({},"__esModule",{value:!0}),t);var q={};v(q,{loadJsConfigs:()=>J,loadVitePlusConfigs:()=>R});module.exports=M(q);var j=require("node:url");var d=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);var E=require("node:path"),b=require("node:url"),_="^20.19.0 || >=22.18.0",A=new Set([".ts",".mts",".cts"]);function V(t){if(!t.startsWith("file:"))return t;try{return(0,b.fileURLToPath)(t)}catch{return t}}function D(t){let n=(0,E.extname)(V(t)).toLowerCase();return A.has(n)}function I(t){if(t?.code==="ERR_UNKNOWN_FILE_EXTENSION")return!0;let n=t?.message;return typeof n=="string"&&/unknown(?: or unsupported)? file extension/i.test(n)}function W(t){return t instanceof Error?t.message:String(t)}function x(t,n,e=process.version){return!D(n)||!I(t)?null:`${W(t)}
|
|
2
2
|
|
|
3
|
-
TypeScript config files require Node.js ${
|
|
4
|
-
Detected Node.js ${
|
|
5
|
-
Please upgrade Node.js or use a JSON config file instead.`}var d=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function
|
|
3
|
+
TypeScript config files require Node.js ${_}.
|
|
4
|
+
Detected Node.js ${e}.
|
|
5
|
+
Please upgrade Node.js or use a JSON config file instead.`}async function m(t,n){let e=(0,j.pathToFileURL)(t);e.searchParams.set("cache",n.toString());let o;try{o=await import(e.href)}catch(r){let i=x(r,t);throw i?new Error(i,{cause:r}):r}if(o.default===void 0)throw new Error("Configuration file has no default export.");if(!d(o.default))throw new Error("Configuration file must have a default export that is an object.");return o.default}var k=null;async function w(t,n){k??=import("vite-plus");let{resolveConfig:e}=await k,o=await e({configFile:t},"build");if(!(n in o))return null;let r=o[n];if(!d(r))throw new Error(`The \`${n}\` field in the default export must be an object.`);return r}function h(t){try{if(t instanceof Error){let{stack:e}=t;if(typeof e=="string"&&e!=="")return e}let{message:n}=t;if(typeof n=="string"&&n!=="")return n}catch{}return"Unknown error"}var H=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function S(t){let n=new WeakSet,e=new WeakSet,o=[],r=[],i=(a,u,c)=>{let s=c===-1?`${u} -> ${u}`:[...r.slice(c),u].join(" -> ");return`\`extends\` contains a circular reference.
|
|
6
6
|
|
|
7
|
-
${
|
|
8
|
-
Cycle: ${
|
|
7
|
+
${a} points back to ${u}
|
|
8
|
+
Cycle: ${s}`},f=(a,u)=>{if(n.has(a))return;if(e.has(a)){let s=o.indexOf(a),l=s===-1?"<unknown>":r[s];throw new Error(i(u,l,s))}e.add(a),o.push(a),r.push(u);let c=a.extends;if(c!==void 0){if(!Array.isArray(c))throw new Error("`extends` must be an array of config objects (strings/paths are not supported).");for(let s=0;s<c.length;s++){let l=c[s];if(!H(l))throw new Error(`\`extends[${s}]\` must be a config object (strings/paths are not supported).`);let C=`${u}.extends[${s}]`;if(e.has(l)){let p=o.indexOf(l),O=p===-1?"<unknown>":r[p];throw new Error(i(C,O,p))}f(l,C)}}e.delete(a),o.pop(),r.pop(),n.add(a)};f(t,"<root>")}async function K(t,n){let e=await m(t,n);return S(e),{path:t,config:e}}async function X(t){let n=await w(t,"lint");return n===null?{path:t,config:null}:(S(n),{path:t,config:n})}async function P(t,n){try{let e=await Promise.allSettled(t.map(n)),o=[],r=[];for(let i=0;i<e.length;i++){let f=e[i];f.status==="fulfilled"?o.push(f.value):r.push({path:t[i],error:h(f.reason)})}return r.length>0?JSON.stringify({Failures:r}):JSON.stringify({Success:o})}catch(e){return JSON.stringify({Error:h(e)})}}var J=t=>{let n=Date.now();return P(t,e=>K(e,n))},R=t=>P(t,X);0&&(module.exports={loadJsConfigs,loadVitePlusConfigs});
|