@ohos-rs/oxk 0.3.0 → 0.3.1-beta.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.
Files changed (4) hide show
  1. package/bin/format.js +220 -46
  2. package/bin/oxk.js +237 -21
  3. package/index.js +56 -53
  4. package/package.json +17 -16
package/bin/format.js CHANGED
@@ -1,63 +1,237 @@
1
- const { readFileSync, writeFileSync } = require('fs')
2
- const { relative } = require('path')
3
- const { format } = require('../format.js')
1
+ const { existsSync, readFileSync, writeFileSync } = require('node:fs')
2
+ const path = require('node:path')
4
3
  const { glob } = require('glob')
5
4
 
6
- async function formatFiles(files) {
7
- if (files.length === 0) {
8
- console.error('Error: No files specified for formatting')
9
- process.exit(1)
5
+ const { format } = require('../index.js')
6
+
7
+ const CONFIG_FILES = ['.oxfmtrc.json', '.oxfmtrc.jsonc']
8
+ const RECOVERABLE_ERROR_PATTERNS = [
9
+ 'Unsupported file type',
10
+ 'requires external formatter support',
11
+ 'External formatter is required',
12
+ ]
13
+
14
+ function stripJsonComments(text) {
15
+ let result = ''
16
+ let inString = false
17
+ let stringQuote = ''
18
+ let isEscaped = false
19
+ let inLineComment = false
20
+ let inBlockComment = false
21
+
22
+ for (let index = 0; index < text.length; index += 1) {
23
+ const char = text[index]
24
+ const next = text[index + 1]
25
+
26
+ if (inLineComment) {
27
+ if (char === '\n') {
28
+ inLineComment = false
29
+ result += char
30
+ }
31
+ continue
32
+ }
33
+
34
+ if (inBlockComment) {
35
+ if (char === '*' && next === '/') {
36
+ inBlockComment = false
37
+ index += 1
38
+ }
39
+ continue
40
+ }
41
+
42
+ if (inString) {
43
+ result += char
44
+ if (isEscaped) {
45
+ isEscaped = false
46
+ } else if (char === '\\') {
47
+ isEscaped = true
48
+ } else if (char === stringQuote) {
49
+ inString = false
50
+ stringQuote = ''
51
+ }
52
+ continue
53
+ }
54
+
55
+ if (char === '"' || char === "'") {
56
+ inString = true
57
+ stringQuote = char
58
+ result += char
59
+ continue
60
+ }
61
+
62
+ if (char === '/' && next === '/') {
63
+ inLineComment = true
64
+ index += 1
65
+ continue
66
+ }
67
+
68
+ if (char === '/' && next === '*') {
69
+ inBlockComment = true
70
+ index += 1
71
+ continue
72
+ }
73
+
74
+ result += char
10
75
  }
11
76
 
12
- let hasErrors = false
13
- let formattedCount = 0
14
- const allFiles = new Set() // Use Set to avoid duplicates
15
-
16
- // Use glob to expand patterns
17
- for (const filePattern of files) {
18
- try {
19
- const matchedFiles = await glob(filePattern, {
20
- absolute: true,
21
- ignore: ['**/node_modules/**'],
22
- })
23
- matchedFiles.forEach((file) => allFiles.add(file))
24
- } catch (error) {
25
- console.error(`Error expanding pattern "${filePattern}":`, error.message)
26
- hasErrors = true
77
+ return result
78
+ }
79
+
80
+ function resolveConfigPath(cwd, explicitPath) {
81
+ if (explicitPath) {
82
+ const resolved = path.resolve(cwd, explicitPath)
83
+ if (!existsSync(resolved)) {
84
+ throw new Error(`Failed to read ${resolved}: File not found`)
27
85
  }
86
+ return resolved
28
87
  }
29
88
 
30
- if (allFiles.size === 0) {
31
- console.error('Error: No files found matching the specified patterns')
32
- process.exit(1)
89
+ let current = cwd
90
+ for (;;) {
91
+ for (const filename of CONFIG_FILES) {
92
+ const candidate = path.join(current, filename)
93
+ if (existsSync(candidate)) {
94
+ return candidate
95
+ }
96
+ }
97
+
98
+ const parent = path.dirname(current)
99
+ if (parent === current) {
100
+ return undefined
101
+ }
102
+ current = parent
33
103
  }
104
+ }
105
+
106
+ function loadConfig(cwd, explicitPath) {
107
+ const configPath = resolveConfigPath(cwd, explicitPath)
108
+ if (!configPath) {
109
+ return { config: {}, ignorePatterns: [] }
110
+ }
111
+
112
+ const raw = readFileSync(configPath, 'utf8')
113
+ const parsed = JSON.parse(stripJsonComments(raw))
114
+ const ignorePatterns = Array.isArray(parsed.ignorePatterns) ? parsed.ignorePatterns : []
115
+ return { config: parsed, ignorePatterns }
116
+ }
117
+
118
+ function mergeConfig(baseConfig, cliOptions) {
119
+ return { ...baseConfig, ...cliOptions }
120
+ }
121
+
122
+ async function expandPatterns(patterns, cwd) {
123
+ const results = new Set()
124
+
125
+ for (const pattern of patterns) {
126
+ const absolutePattern = path.resolve(cwd, pattern)
127
+ const matches = await glob(absolutePattern, {
128
+ absolute: true,
129
+ dot: true,
130
+ nodir: true,
131
+ follow: false,
132
+ })
34
133
 
35
- for (const filePath of allFiles) {
36
- try {
37
- const sourceText = readFileSync(filePath, 'utf-8')
38
- // Use relative path for format function (it expects the original file name)
39
- const relativePath = relative(process.cwd(), filePath)
40
-
41
- const result = await format(relativePath, sourceText)
42
-
43
- if (result.errors.length > 0) {
44
- console.error(`Error formatting ${relativePath}:`)
45
- result.errors.forEach((err) => console.error(` ${err}`))
46
- hasErrors = true
47
- } else {
48
- writeFileSync(filePath, result.code, 'utf-8')
49
- console.log(`Formatted: ${relativePath}`)
50
- formattedCount++
134
+ for (const match of matches) {
135
+ results.add(path.resolve(match))
136
+ }
137
+ }
138
+
139
+ return results
140
+ }
141
+
142
+ function isRecoverableError(errors) {
143
+ return errors.every((error) => RECOVERABLE_ERROR_PATTERNS.some((pattern) => error.includes(pattern)))
144
+ }
145
+
146
+ async function runWithConcurrency(items, limit, worker) {
147
+ let index = 0
148
+ const workers = Array.from({ length: Math.max(1, Math.min(limit, items.length || 1)) }, async () => {
149
+ for (;;) {
150
+ const current = index
151
+ index += 1
152
+ if (current >= items.length) {
153
+ return
51
154
  }
52
- } catch (error) {
53
- console.error(`Error processing ${filePath}:`, error.message)
54
- hasErrors = true
155
+ await worker(items[current])
156
+ }
157
+ })
158
+
159
+ await Promise.all(workers)
160
+ }
161
+
162
+ function printErrors(filePath, errors, prefix) {
163
+ console.error(`${prefix} ${filePath}:`)
164
+ for (const error of errors) {
165
+ console.error(` ${error}`)
166
+ }
167
+ }
168
+
169
+ async function formatFiles({ patterns, configPath, excludes, threadCount, cliOptions }) {
170
+ const cwd = process.cwd()
171
+
172
+ if (patterns.length === 0) {
173
+ throw new Error('Missing file pattern')
174
+ }
175
+
176
+ const { config, ignorePatterns } = loadConfig(cwd, configPath)
177
+ const mergedConfig = mergeConfig(config, cliOptions)
178
+ const allExcludes = excludes.concat(ignorePatterns)
179
+
180
+ const files = await expandPatterns(patterns, cwd)
181
+ if (allExcludes.length > 0) {
182
+ const excludedFiles = await expandPatterns(allExcludes, cwd)
183
+ for (const excluded of excludedFiles) {
184
+ files.delete(excluded)
55
185
  }
56
186
  }
57
187
 
188
+ const sortedFiles = Array.from(files).sort()
189
+ if (sortedFiles.length === 0) {
190
+ throw new Error('No files matched the provided patterns (after excludes)')
191
+ }
192
+
193
+ let formattedCount = 0
194
+ let hasRecoverableErrors = false
195
+ let fatalError = null
196
+
197
+ await runWithConcurrency(sortedFiles, threadCount, async (filePath) => {
198
+ if (fatalError) {
199
+ return
200
+ }
201
+
202
+ const sourceText = readFileSync(filePath, 'utf8')
203
+ if (sourceText.length === 0) {
204
+ return
205
+ }
206
+
207
+ const displayPath = path.relative(cwd, filePath) || filePath
208
+ const result = await format(displayPath, sourceText, mergedConfig)
209
+
210
+ if (result.errors.length === 0) {
211
+ writeFileSync(filePath, result.code, 'utf8')
212
+ console.log(`Formatted: ${displayPath}`)
213
+ formattedCount += 1
214
+ return
215
+ }
216
+
217
+ if (isRecoverableError(result.errors)) {
218
+ printErrors(displayPath, result.errors, 'Warning formatting')
219
+ hasRecoverableErrors = true
220
+ return
221
+ }
222
+
223
+ fatalError = { filePath: displayPath, errors: result.errors }
224
+ })
225
+
226
+ if (fatalError) {
227
+ printErrors(fatalError.filePath, fatalError.errors, 'Error formatting')
228
+ process.exitCode = 1
229
+ return
230
+ }
231
+
58
232
  console.log(`\nFormatted ${formattedCount} file(s)`)
59
- if (hasErrors) {
60
- process.exit(1)
233
+ if (hasRecoverableErrors) {
234
+ process.exitCode = 1
61
235
  }
62
236
  }
63
237
 
package/bin/oxk.js CHANGED
@@ -1,10 +1,39 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const VERSION = require('../package.json').version
4
-
5
- // Import command modules
6
4
  const { formatFiles } = require('./format.js')
7
5
 
6
+ function parseBoolean(value, flagName) {
7
+ if (value === 'true') {
8
+ return true
9
+ }
10
+ if (value === 'false') {
11
+ return false
12
+ }
13
+ throw new Error(`${flagName} must be 'true' or 'false'`)
14
+ }
15
+
16
+ function parseInteger(value, flagName) {
17
+ const parsed = Number.parseInt(value, 10)
18
+ if (!Number.isInteger(parsed) || parsed <= 0) {
19
+ throw new Error(`${flagName} must be a positive integer`)
20
+ }
21
+ return parsed
22
+ }
23
+
24
+ function parseOptionValue(args, index, token) {
25
+ if (token.includes('=')) {
26
+ const [, inlineValue] = token.split(/=(.*)/s)
27
+ return { value: inlineValue, nextIndex: index }
28
+ }
29
+
30
+ const value = args[index + 1]
31
+ if (value == null) {
32
+ throw new Error(`Missing value for ${token}`)
33
+ }
34
+ return { value, nextIndex: index + 1 }
35
+ }
36
+
8
37
  function showHelp() {
9
38
  console.log(`
10
39
  oxk - An ArkTS/ArkUI tool based on OXC
@@ -14,14 +43,35 @@ Usage:
14
43
 
15
44
  Commands:
16
45
  format Format files
17
- lint Lint files (not yet supported)
18
46
 
19
- Options:
47
+ Global Options:
20
48
  --help, -h Show help
21
49
  --version, -v Show version
22
50
 
51
+ Format Options:
52
+ --config PATH
53
+ --thread, -t THREAD
54
+ --exclude PATTERN
55
+ --indent-style STYLE
56
+ --indent-width WIDTH
57
+ --line-ending ENDING
58
+ --line-width WIDTH
59
+ --quote-style STYLE
60
+ --jsx-quote-style STYLE
61
+ --trailing-commas VALUE
62
+ --semicolons VALUE
63
+ --arrow-parentheses VALUE
64
+ --bracket-spacing VALUE
65
+ --bracket-same-line VALUE
66
+ --attribute-position VALUE
67
+ --expand VALUE
68
+ --experimental-operator-position VALUE
69
+ --experimental-ternaries VALUE
70
+ --embedded-language-formatting VALUE
71
+
23
72
  Examples:
24
73
  oxk format src/**/*.ets
74
+ oxk format --exclude dist/** --config .oxfmtrc.json "src/**/*.{ts,ets}"
25
75
  `)
26
76
  }
27
77
 
@@ -29,7 +79,177 @@ function showVersion() {
29
79
  console.log(`oxk v${VERSION}`)
30
80
  }
31
81
 
32
- // Main CLI handler
82
+ function parseFormatArgs(args) {
83
+ const formatArgs = {
84
+ patterns: [],
85
+ excludes: [],
86
+ threadCount: 1,
87
+ configPath: undefined,
88
+ cliOptions: {},
89
+ }
90
+
91
+ for (let index = 0; index < args.length; index += 1) {
92
+ const token = args[index]
93
+
94
+ if (token === '--help' || token === '-h') {
95
+ return { help: true }
96
+ }
97
+
98
+ if (!token.startsWith('-')) {
99
+ formatArgs.patterns.push(token)
100
+ continue
101
+ }
102
+
103
+ switch (token.split('=')[0]) {
104
+ case '--config': {
105
+ const { value, nextIndex } = parseOptionValue(args, index, token)
106
+ formatArgs.configPath = value
107
+ index = nextIndex
108
+ break
109
+ }
110
+ case '--thread':
111
+ case '-t': {
112
+ const { value, nextIndex } = parseOptionValue(args, index, token)
113
+ formatArgs.threadCount = parseInteger(value, '--thread')
114
+ index = nextIndex
115
+ break
116
+ }
117
+ case '--exclude': {
118
+ const { value, nextIndex } = parseOptionValue(args, index, token)
119
+ formatArgs.excludes.push(value)
120
+ index = nextIndex
121
+ break
122
+ }
123
+ case '--indent-style': {
124
+ const { value, nextIndex } = parseOptionValue(args, index, token)
125
+ if (value !== 'tab' && value !== 'space') {
126
+ throw new Error("--indent-style must be 'tab' or 'space'")
127
+ }
128
+ formatArgs.cliOptions.useTabs = value === 'tab'
129
+ index = nextIndex
130
+ break
131
+ }
132
+ case '--indent-width': {
133
+ const { value, nextIndex } = parseOptionValue(args, index, token)
134
+ formatArgs.cliOptions.tabWidth = parseInteger(value, '--indent-width')
135
+ index = nextIndex
136
+ break
137
+ }
138
+ case '--line-ending': {
139
+ const { value, nextIndex } = parseOptionValue(args, index, token)
140
+ formatArgs.cliOptions.endOfLine = value
141
+ index = nextIndex
142
+ break
143
+ }
144
+ case '--line-width': {
145
+ const { value, nextIndex } = parseOptionValue(args, index, token)
146
+ formatArgs.cliOptions.printWidth = parseInteger(value, '--line-width')
147
+ index = nextIndex
148
+ break
149
+ }
150
+ case '--quote-style': {
151
+ const { value, nextIndex } = parseOptionValue(args, index, token)
152
+ if (value !== 'single' && value !== 'double') {
153
+ throw new Error("--quote-style must be 'single' or 'double'")
154
+ }
155
+ formatArgs.cliOptions.singleQuote = value === 'single'
156
+ index = nextIndex
157
+ break
158
+ }
159
+ case '--jsx-quote-style': {
160
+ const { value, nextIndex } = parseOptionValue(args, index, token)
161
+ if (value !== 'single' && value !== 'double') {
162
+ throw new Error("--jsx-quote-style must be 'single' or 'double'")
163
+ }
164
+ formatArgs.cliOptions.jsxSingleQuote = value === 'single'
165
+ index = nextIndex
166
+ break
167
+ }
168
+ case '--trailing-commas': {
169
+ const { value, nextIndex } = parseOptionValue(args, index, token)
170
+ formatArgs.cliOptions.trailingComma = value
171
+ index = nextIndex
172
+ break
173
+ }
174
+ case '--semicolons': {
175
+ const { value, nextIndex } = parseOptionValue(args, index, token)
176
+ if (value !== 'always' && value !== 'as-needed') {
177
+ throw new Error("--semicolons must be 'always' or 'as-needed'")
178
+ }
179
+ formatArgs.cliOptions.semi = value === 'always'
180
+ index = nextIndex
181
+ break
182
+ }
183
+ case '--arrow-parentheses': {
184
+ const { value, nextIndex } = parseOptionValue(args, index, token)
185
+ if (value !== 'always' && value !== 'as-needed') {
186
+ throw new Error("--arrow-parentheses must be 'always' or 'as-needed'")
187
+ }
188
+ formatArgs.cliOptions.arrowParens = value === 'always' ? 'always' : 'avoid'
189
+ index = nextIndex
190
+ break
191
+ }
192
+ case '--bracket-spacing': {
193
+ const { value, nextIndex } = parseOptionValue(args, index, token)
194
+ formatArgs.cliOptions.bracketSpacing = parseBoolean(value, '--bracket-spacing')
195
+ index = nextIndex
196
+ break
197
+ }
198
+ case '--bracket-same-line': {
199
+ const { value, nextIndex } = parseOptionValue(args, index, token)
200
+ formatArgs.cliOptions.bracketSameLine = parseBoolean(value, '--bracket-same-line')
201
+ index = nextIndex
202
+ break
203
+ }
204
+ case '--attribute-position': {
205
+ const { value, nextIndex } = parseOptionValue(args, index, token)
206
+ if (value !== 'auto' && value !== 'multiline') {
207
+ throw new Error("--attribute-position must be 'auto' or 'multiline'")
208
+ }
209
+ formatArgs.cliOptions.singleAttributePerLine = value === 'multiline'
210
+ index = nextIndex
211
+ break
212
+ }
213
+ case '--expand': {
214
+ const { value, nextIndex } = parseOptionValue(args, index, token)
215
+ if (!['auto', 'always', 'never'].includes(value)) {
216
+ throw new Error("--expand must be 'auto', 'always', or 'never'")
217
+ }
218
+ formatArgs.cliOptions.objectWrap = value === 'auto' ? 'preserve' : 'collapse'
219
+ index = nextIndex
220
+ break
221
+ }
222
+ case '--experimental-operator-position': {
223
+ const { value, nextIndex } = parseOptionValue(args, index, token)
224
+ formatArgs.cliOptions.experimentalOperatorPosition = value
225
+ index = nextIndex
226
+ break
227
+ }
228
+ case '--experimental-ternaries': {
229
+ const { value, nextIndex } = parseOptionValue(args, index, token)
230
+ formatArgs.cliOptions.experimentalTernaries = parseBoolean(value, '--experimental-ternaries')
231
+ index = nextIndex
232
+ break
233
+ }
234
+ case '--embedded-language-formatting': {
235
+ const { value, nextIndex } = parseOptionValue(args, index, token)
236
+ formatArgs.cliOptions.embeddedLanguageFormatting = value
237
+ index = nextIndex
238
+ break
239
+ }
240
+ case '--experimental-sort-imports': {
241
+ const { nextIndex } = parseOptionValue(args, index, token)
242
+ index = nextIndex
243
+ break
244
+ }
245
+ default:
246
+ throw new Error(`Unknown option: ${token}`)
247
+ }
248
+ }
249
+
250
+ return { help: false, formatArgs }
251
+ }
252
+
33
253
  async function main() {
34
254
  const args = process.argv.slice(2)
35
255
 
@@ -39,37 +259,33 @@ async function main() {
39
259
  }
40
260
 
41
261
  const command = args[0]
42
-
43
- // Handle global options
44
262
  if (command === '--help' || command === '-h') {
45
263
  showHelp()
46
264
  process.exit(0)
47
265
  }
48
-
49
266
  if (command === '--version' || command === '-v') {
50
267
  showVersion()
51
268
  process.exit(0)
52
269
  }
53
270
 
54
- // Handle commands by calling functions directly
55
- const remainingArgs = args.slice(1)
271
+ if (command !== 'format') {
272
+ console.error(`Unknown command: ${command}`)
273
+ console.error("Run 'oxk --help' for usage information")
274
+ process.exit(1)
275
+ }
56
276
 
57
277
  try {
58
- switch (command) {
59
- case 'format':
60
- await formatFiles(remainingArgs)
61
- break
62
-
63
- default:
64
- console.error(`Unknown command: ${command}`)
65
- console.error("Run 'oxk --help' for usage information")
66
- process.exit(1)
278
+ const { help, formatArgs } = parseFormatArgs(args.slice(1))
279
+ if (help) {
280
+ showHelp()
281
+ process.exit(0)
67
282
  }
283
+
284
+ await formatFiles(formatArgs)
68
285
  } catch (error) {
69
- console.error('Unexpected error:', error)
286
+ console.error(error instanceof Error ? error.message : String(error))
70
287
  process.exit(1)
71
288
  }
72
289
  }
73
290
 
74
- // Run the CLI
75
291
  main()
package/index.js CHANGED
@@ -77,8 +77,8 @@ 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 (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
82
  }
83
83
  return binding
84
84
  } catch (e) {
@@ -93,8 +93,8 @@ function requireNative() {
93
93
  try {
94
94
  const binding = require('@ohos-rs/oxk-android-arm-eabi')
95
95
  const bindingPackageVersion = require('@ohos-rs/oxk-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
98
  }
99
99
  return binding
100
100
  } catch (e) {
@@ -114,8 +114,8 @@ function requireNative() {
114
114
  try {
115
115
  const binding = require('@ohos-rs/oxk-win32-x64-gnu')
116
116
  const bindingPackageVersion = require('@ohos-rs/oxk-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
119
  }
120
120
  return binding
121
121
  } catch (e) {
@@ -130,8 +130,8 @@ function requireNative() {
130
130
  try {
131
131
  const binding = require('@ohos-rs/oxk-win32-x64-msvc')
132
132
  const bindingPackageVersion = require('@ohos-rs/oxk-win32-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
135
  }
136
136
  return binding
137
137
  } catch (e) {
@@ -147,8 +147,8 @@ function requireNative() {
147
147
  try {
148
148
  const binding = require('@ohos-rs/oxk-win32-ia32-msvc')
149
149
  const bindingPackageVersion = require('@ohos-rs/oxk-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
152
  }
153
153
  return binding
154
154
  } catch (e) {
@@ -163,8 +163,8 @@ function requireNative() {
163
163
  try {
164
164
  const binding = require('@ohos-rs/oxk-win32-arm64-msvc')
165
165
  const bindingPackageVersion = require('@ohos-rs/oxk-win32-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
168
  }
169
169
  return binding
170
170
  } catch (e) {
@@ -182,8 +182,8 @@ function requireNative() {
182
182
  try {
183
183
  const binding = require('@ohos-rs/oxk-darwin-universal')
184
184
  const bindingPackageVersion = require('@ohos-rs/oxk-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
187
  }
188
188
  return binding
189
189
  } catch (e) {
@@ -198,8 +198,8 @@ function requireNative() {
198
198
  try {
199
199
  const binding = require('@ohos-rs/oxk-darwin-x64')
200
200
  const bindingPackageVersion = require('@ohos-rs/oxk-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
203
  }
204
204
  return binding
205
205
  } catch (e) {
@@ -214,8 +214,8 @@ function requireNative() {
214
214
  try {
215
215
  const binding = require('@ohos-rs/oxk-darwin-arm64')
216
216
  const bindingPackageVersion = require('@ohos-rs/oxk-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
219
  }
220
220
  return binding
221
221
  } catch (e) {
@@ -234,8 +234,8 @@ function requireNative() {
234
234
  try {
235
235
  const binding = require('@ohos-rs/oxk-freebsd-x64')
236
236
  const bindingPackageVersion = require('@ohos-rs/oxk-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
239
  }
240
240
  return binding
241
241
  } catch (e) {
@@ -250,8 +250,8 @@ function requireNative() {
250
250
  try {
251
251
  const binding = require('@ohos-rs/oxk-freebsd-arm64')
252
252
  const bindingPackageVersion = require('@ohos-rs/oxk-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
255
  }
256
256
  return binding
257
257
  } catch (e) {
@@ -271,8 +271,8 @@ function requireNative() {
271
271
  try {
272
272
  const binding = require('@ohos-rs/oxk-linux-x64-musl')
273
273
  const bindingPackageVersion = require('@ohos-rs/oxk-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
276
  }
277
277
  return binding
278
278
  } catch (e) {
@@ -287,8 +287,8 @@ function requireNative() {
287
287
  try {
288
288
  const binding = require('@ohos-rs/oxk-linux-x64-gnu')
289
289
  const bindingPackageVersion = require('@ohos-rs/oxk-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
292
  }
293
293
  return binding
294
294
  } catch (e) {
@@ -305,8 +305,8 @@ function requireNative() {
305
305
  try {
306
306
  const binding = require('@ohos-rs/oxk-linux-arm64-musl')
307
307
  const bindingPackageVersion = require('@ohos-rs/oxk-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
310
  }
311
311
  return binding
312
312
  } catch (e) {
@@ -321,8 +321,8 @@ function requireNative() {
321
321
  try {
322
322
  const binding = require('@ohos-rs/oxk-linux-arm64-gnu')
323
323
  const bindingPackageVersion = require('@ohos-rs/oxk-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
326
  }
327
327
  return binding
328
328
  } catch (e) {
@@ -339,8 +339,8 @@ function requireNative() {
339
339
  try {
340
340
  const binding = require('@ohos-rs/oxk-linux-arm-musleabihf')
341
341
  const bindingPackageVersion = require('@ohos-rs/oxk-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
344
  }
345
345
  return binding
346
346
  } catch (e) {
@@ -355,8 +355,8 @@ function requireNative() {
355
355
  try {
356
356
  const binding = require('@ohos-rs/oxk-linux-arm-gnueabihf')
357
357
  const bindingPackageVersion = require('@ohos-rs/oxk-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
360
  }
361
361
  return binding
362
362
  } catch (e) {
@@ -373,8 +373,8 @@ function requireNative() {
373
373
  try {
374
374
  const binding = require('@ohos-rs/oxk-linux-loong64-musl')
375
375
  const bindingPackageVersion = require('@ohos-rs/oxk-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
378
  }
379
379
  return binding
380
380
  } catch (e) {
@@ -389,8 +389,8 @@ function requireNative() {
389
389
  try {
390
390
  const binding = require('@ohos-rs/oxk-linux-loong64-gnu')
391
391
  const bindingPackageVersion = require('@ohos-rs/oxk-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
394
  }
395
395
  return binding
396
396
  } catch (e) {
@@ -407,8 +407,8 @@ function requireNative() {
407
407
  try {
408
408
  const binding = require('@ohos-rs/oxk-linux-riscv64-musl')
409
409
  const bindingPackageVersion = require('@ohos-rs/oxk-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
412
  }
413
413
  return binding
414
414
  } catch (e) {
@@ -423,8 +423,8 @@ function requireNative() {
423
423
  try {
424
424
  const binding = require('@ohos-rs/oxk-linux-riscv64-gnu')
425
425
  const bindingPackageVersion = require('@ohos-rs/oxk-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
428
  }
429
429
  return binding
430
430
  } catch (e) {
@@ -440,8 +440,8 @@ function requireNative() {
440
440
  try {
441
441
  const binding = require('@ohos-rs/oxk-linux-ppc64-gnu')
442
442
  const bindingPackageVersion = require('@ohos-rs/oxk-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
445
  }
446
446
  return binding
447
447
  } catch (e) {
@@ -456,8 +456,8 @@ function requireNative() {
456
456
  try {
457
457
  const binding = require('@ohos-rs/oxk-linux-s390x-gnu')
458
458
  const bindingPackageVersion = require('@ohos-rs/oxk-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
461
  }
462
462
  return binding
463
463
  } catch (e) {
@@ -476,8 +476,8 @@ function requireNative() {
476
476
  try {
477
477
  const binding = require('@ohos-rs/oxk-openharmony-arm64')
478
478
  const bindingPackageVersion = require('@ohos-rs/oxk-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
481
  }
482
482
  return binding
483
483
  } catch (e) {
@@ -492,8 +492,8 @@ function requireNative() {
492
492
  try {
493
493
  const binding = require('@ohos-rs/oxk-openharmony-x64')
494
494
  const bindingPackageVersion = require('@ohos-rs/oxk-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
497
  }
498
498
  return binding
499
499
  } catch (e) {
@@ -508,8 +508,8 @@ function requireNative() {
508
508
  try {
509
509
  const binding = require('@ohos-rs/oxk-openharmony-arm')
510
510
  const bindingPackageVersion = require('@ohos-rs/oxk-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '0.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ throw new Error(`Native binding package version mismatch, expected 0.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
@@ -571,5 +571,8 @@ if (!nativeBinding) {
571
571
  throw new Error(`Failed to load native binding`)
572
572
  }
573
573
 
574
+ const nativeFormat = nativeBinding.format
575
+ const format = (...args) => Promise.resolve(nativeFormat(...args))
576
+
574
577
  module.exports = nativeBinding
575
- module.exports.format = nativeBinding.format
578
+ module.exports.format = format
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ohos-rs/oxk",
3
- "version": "0.3.0",
3
+ "version": "0.3.1-beta.0",
4
4
  "description": "An ArkTS/ArkUI tool based on oxc",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -9,7 +9,7 @@
9
9
  "oxk": "./bin/oxk.js"
10
10
  },
11
11
  "repository": {
12
- "url": "git+git@github.com:ohos-rs/oxc-ark.git",
12
+ "url": "git+https://github.com/ohos-rs/oxc-ark.git",
13
13
  "type": "git"
14
14
  },
15
15
  "license": "MIT",
@@ -81,6 +81,7 @@
81
81
  "lint": "oxlint",
82
82
  "prepublishOnly": "napi prepublish -t npm",
83
83
  "test": "ava",
84
+ "test:build": "pnpm run build:debug && pnpm run test",
84
85
  "version": "napi version"
85
86
  },
86
87
  "dependencies": {
@@ -122,19 +123,19 @@
122
123
  ]
123
124
  },
124
125
  "optionalDependencies": {
125
- "@ohos-rs/oxk-darwin-x64": "0.3.0",
126
- "@ohos-rs/oxk-darwin-arm64": "0.3.0",
127
- "@ohos-rs/oxk-linux-x64-gnu": "0.3.0",
128
- "@ohos-rs/oxk-win32-x64-msvc": "0.3.0",
129
- "@ohos-rs/oxk-linux-x64-musl": "0.3.0",
130
- "@ohos-rs/oxk-linux-arm64-gnu": "0.3.0",
131
- "@ohos-rs/oxk-win32-ia32-msvc": "0.3.0",
132
- "@ohos-rs/oxk-linux-arm-gnueabihf": "0.3.0",
133
- "@ohos-rs/oxk-android-arm64": "0.3.0",
134
- "@ohos-rs/oxk-freebsd-x64": "0.3.0",
135
- "@ohos-rs/oxk-linux-arm64-musl": "0.3.0",
136
- "@ohos-rs/oxk-win32-arm64-msvc": "0.3.0",
137
- "@ohos-rs/oxk-android-arm-eabi": "0.3.0",
138
- "@ohos-rs/oxk-wasm32-wasi": "0.3.0"
126
+ "@ohos-rs/oxk-darwin-x64": "0.3.1-beta.0",
127
+ "@ohos-rs/oxk-darwin-arm64": "0.3.1-beta.0",
128
+ "@ohos-rs/oxk-linux-x64-gnu": "0.3.1-beta.0",
129
+ "@ohos-rs/oxk-win32-x64-msvc": "0.3.1-beta.0",
130
+ "@ohos-rs/oxk-linux-x64-musl": "0.3.1-beta.0",
131
+ "@ohos-rs/oxk-linux-arm64-gnu": "0.3.1-beta.0",
132
+ "@ohos-rs/oxk-win32-ia32-msvc": "0.3.1-beta.0",
133
+ "@ohos-rs/oxk-linux-arm-gnueabihf": "0.3.1-beta.0",
134
+ "@ohos-rs/oxk-android-arm64": "0.3.1-beta.0",
135
+ "@ohos-rs/oxk-freebsd-x64": "0.3.1-beta.0",
136
+ "@ohos-rs/oxk-linux-arm64-musl": "0.3.1-beta.0",
137
+ "@ohos-rs/oxk-win32-arm64-msvc": "0.3.1-beta.0",
138
+ "@ohos-rs/oxk-android-arm-eabi": "0.3.1-beta.0",
139
+ "@ohos-rs/oxk-wasm32-wasi": "0.3.1-beta.0"
139
140
  }
140
141
  }