@tailwindcss/oxide 0.0.0-insiders.d38554d → 0.0.0-insiders.d42b34a

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 (2) hide show
  1. package/index.js +331 -119
  2. package/package.json +20 -21
package/index.js CHANGED
@@ -3,9 +3,6 @@
3
3
  // @ts-nocheck
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
- const { createRequire } = require('node:module')
7
- require = createRequire(__filename)
8
-
9
6
  const { readFileSync } = require('node:fs')
10
7
  let nativeBinding = null
11
8
  const loadErrors = []
@@ -66,9 +63,9 @@ const isMuslFromChildProcess = () => {
66
63
  function requireNative() {
67
64
  if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
68
65
  try {
69
- nativeBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
66
+ return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
70
67
  } catch (err) {
71
- loadErrors.push(err);
68
+ loadErrors.push(err)
72
69
  }
73
70
  } else if (process.platform === 'android') {
74
71
  if (process.arch === 'arm64') {
@@ -78,11 +75,15 @@ function requireNative() {
78
75
  loadErrors.push(e)
79
76
  }
80
77
  try {
81
- return require('@tailwindcss/oxide-android-arm64')
78
+ const binding = require('@tailwindcss/oxide-android-arm64')
79
+ const bindingPackageVersion = require('@tailwindcss/oxide-android-arm64/package.json').version
80
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
+ }
83
+ return binding
82
84
  } catch (e) {
83
85
  loadErrors.push(e)
84
86
  }
85
-
86
87
  } else if (process.arch === 'arm') {
87
88
  try {
88
89
  return require('./tailwindcss-oxide.android-arm-eabi.node')
@@ -90,27 +91,53 @@ function requireNative() {
90
91
  loadErrors.push(e)
91
92
  }
92
93
  try {
93
- return require('@tailwindcss/oxide-android-arm-eabi')
94
+ const binding = require('@tailwindcss/oxide-android-arm-eabi')
95
+ const bindingPackageVersion = require('@tailwindcss/oxide-android-arm-eabi/package.json').version
96
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
+ }
99
+ return binding
94
100
  } catch (e) {
95
101
  loadErrors.push(e)
96
102
  }
97
-
98
103
  } else {
99
104
  loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
100
105
  }
101
106
  } else if (process.platform === 'win32') {
102
107
  if (process.arch === 'x64') {
108
+ if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {
109
+ try {
110
+ return require('./tailwindcss-oxide.win32-x64-gnu.node')
111
+ } catch (e) {
112
+ loadErrors.push(e)
113
+ }
103
114
  try {
115
+ const binding = require('@tailwindcss/oxide-win32-x64-gnu')
116
+ const bindingPackageVersion = require('@tailwindcss/oxide-win32-x64-gnu/package.json').version
117
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
+ }
120
+ return binding
121
+ } catch (e) {
122
+ loadErrors.push(e)
123
+ }
124
+ } else {
125
+ try {
104
126
  return require('./tailwindcss-oxide.win32-x64-msvc.node')
105
127
  } catch (e) {
106
128
  loadErrors.push(e)
107
129
  }
108
130
  try {
109
- return require('@tailwindcss/oxide-win32-x64-msvc')
131
+ const binding = require('@tailwindcss/oxide-win32-x64-msvc')
132
+ const bindingPackageVersion = require('@tailwindcss/oxide-win32-x64-msvc/package.json').version
133
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
+ }
136
+ return binding
110
137
  } catch (e) {
111
138
  loadErrors.push(e)
112
139
  }
113
-
140
+ }
114
141
  } else if (process.arch === 'ia32') {
115
142
  try {
116
143
  return require('./tailwindcss-oxide.win32-ia32-msvc.node')
@@ -118,11 +145,15 @@ function requireNative() {
118
145
  loadErrors.push(e)
119
146
  }
120
147
  try {
121
- return require('@tailwindcss/oxide-win32-ia32-msvc')
148
+ const binding = require('@tailwindcss/oxide-win32-ia32-msvc')
149
+ const bindingPackageVersion = require('@tailwindcss/oxide-win32-ia32-msvc/package.json').version
150
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
+ }
153
+ return binding
122
154
  } catch (e) {
123
155
  loadErrors.push(e)
124
156
  }
125
-
126
157
  } else if (process.arch === 'arm64') {
127
158
  try {
128
159
  return require('./tailwindcss-oxide.win32-arm64-msvc.node')
@@ -130,26 +161,34 @@ function requireNative() {
130
161
  loadErrors.push(e)
131
162
  }
132
163
  try {
133
- return require('@tailwindcss/oxide-win32-arm64-msvc')
164
+ const binding = require('@tailwindcss/oxide-win32-arm64-msvc')
165
+ const bindingPackageVersion = require('@tailwindcss/oxide-win32-arm64-msvc/package.json').version
166
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
+ }
169
+ return binding
134
170
  } catch (e) {
135
171
  loadErrors.push(e)
136
172
  }
137
-
138
173
  } else {
139
174
  loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
140
175
  }
141
176
  } else if (process.platform === 'darwin') {
142
177
  try {
143
- return require('./tailwindcss-oxide.darwin-universal.node')
144
- } catch (e) {
145
- loadErrors.push(e)
146
- }
147
- try {
148
- return require('@tailwindcss/oxide-darwin-universal')
149
- } catch (e) {
150
- loadErrors.push(e)
151
- }
152
-
178
+ return require('./tailwindcss-oxide.darwin-universal.node')
179
+ } catch (e) {
180
+ loadErrors.push(e)
181
+ }
182
+ try {
183
+ const binding = require('@tailwindcss/oxide-darwin-universal')
184
+ const bindingPackageVersion = require('@tailwindcss/oxide-darwin-universal/package.json').version
185
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
+ }
188
+ return binding
189
+ } catch (e) {
190
+ loadErrors.push(e)
191
+ }
153
192
  if (process.arch === 'x64') {
154
193
  try {
155
194
  return require('./tailwindcss-oxide.darwin-x64.node')
@@ -157,11 +196,15 @@ function requireNative() {
157
196
  loadErrors.push(e)
158
197
  }
159
198
  try {
160
- return require('@tailwindcss/oxide-darwin-x64')
199
+ const binding = require('@tailwindcss/oxide-darwin-x64')
200
+ const bindingPackageVersion = require('@tailwindcss/oxide-darwin-x64/package.json').version
201
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
+ }
204
+ return binding
161
205
  } catch (e) {
162
206
  loadErrors.push(e)
163
207
  }
164
-
165
208
  } else if (process.arch === 'arm64') {
166
209
  try {
167
210
  return require('./tailwindcss-oxide.darwin-arm64.node')
@@ -169,11 +212,15 @@ function requireNative() {
169
212
  loadErrors.push(e)
170
213
  }
171
214
  try {
172
- return require('@tailwindcss/oxide-darwin-arm64')
215
+ const binding = require('@tailwindcss/oxide-darwin-arm64')
216
+ const bindingPackageVersion = require('@tailwindcss/oxide-darwin-arm64/package.json').version
217
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
+ }
220
+ return binding
173
221
  } catch (e) {
174
222
  loadErrors.push(e)
175
223
  }
176
-
177
224
  } else {
178
225
  loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
179
226
  }
@@ -185,11 +232,15 @@ function requireNative() {
185
232
  loadErrors.push(e)
186
233
  }
187
234
  try {
188
- return require('@tailwindcss/oxide-freebsd-x64')
235
+ const binding = require('@tailwindcss/oxide-freebsd-x64')
236
+ const bindingPackageVersion = require('@tailwindcss/oxide-freebsd-x64/package.json').version
237
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
+ }
240
+ return binding
189
241
  } catch (e) {
190
242
  loadErrors.push(e)
191
243
  }
192
-
193
244
  } else if (process.arch === 'arm64') {
194
245
  try {
195
246
  return require('./tailwindcss-oxide.freebsd-arm64.node')
@@ -197,11 +248,15 @@ function requireNative() {
197
248
  loadErrors.push(e)
198
249
  }
199
250
  try {
200
- return require('@tailwindcss/oxide-freebsd-arm64')
251
+ const binding = require('@tailwindcss/oxide-freebsd-arm64')
252
+ const bindingPackageVersion = require('@tailwindcss/oxide-freebsd-arm64/package.json').version
253
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
+ }
256
+ return binding
201
257
  } catch (e) {
202
258
  loadErrors.push(e)
203
259
  }
204
-
205
260
  } else {
206
261
  loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
207
262
  }
@@ -209,133 +264,259 @@ function requireNative() {
209
264
  if (process.arch === 'x64') {
210
265
  if (isMusl()) {
211
266
  try {
212
- return require('./tailwindcss-oxide.linux-x64-musl.node')
213
- } catch (e) {
214
- loadErrors.push(e)
215
- }
216
- try {
217
- return require('@tailwindcss/oxide-linux-x64-musl')
218
- } catch (e) {
219
- loadErrors.push(e)
220
- }
221
-
267
+ return require('./tailwindcss-oxide.linux-x64-musl.node')
268
+ } catch (e) {
269
+ loadErrors.push(e)
270
+ }
271
+ try {
272
+ const binding = require('@tailwindcss/oxide-linux-x64-musl')
273
+ const bindingPackageVersion = require('@tailwindcss/oxide-linux-x64-musl/package.json').version
274
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
+ }
277
+ return binding
278
+ } catch (e) {
279
+ loadErrors.push(e)
280
+ }
222
281
  } else {
223
282
  try {
224
- return require('./tailwindcss-oxide.linux-x64-gnu.node')
225
- } catch (e) {
226
- loadErrors.push(e)
227
- }
228
- try {
229
- return require('@tailwindcss/oxide-linux-x64-gnu')
230
- } catch (e) {
231
- loadErrors.push(e)
232
- }
233
-
283
+ return require('./tailwindcss-oxide.linux-x64-gnu.node')
284
+ } catch (e) {
285
+ loadErrors.push(e)
286
+ }
287
+ try {
288
+ const binding = require('@tailwindcss/oxide-linux-x64-gnu')
289
+ const bindingPackageVersion = require('@tailwindcss/oxide-linux-x64-gnu/package.json').version
290
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
+ }
293
+ return binding
294
+ } catch (e) {
295
+ loadErrors.push(e)
296
+ }
234
297
  }
235
298
  } else if (process.arch === 'arm64') {
236
299
  if (isMusl()) {
237
300
  try {
238
- return require('./tailwindcss-oxide.linux-arm64-musl.node')
239
- } catch (e) {
240
- loadErrors.push(e)
241
- }
242
- try {
243
- return require('@tailwindcss/oxide-linux-arm64-musl')
244
- } catch (e) {
245
- loadErrors.push(e)
246
- }
247
-
301
+ return require('./tailwindcss-oxide.linux-arm64-musl.node')
302
+ } catch (e) {
303
+ loadErrors.push(e)
304
+ }
305
+ try {
306
+ const binding = require('@tailwindcss/oxide-linux-arm64-musl')
307
+ const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm64-musl/package.json').version
308
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
+ }
311
+ return binding
312
+ } catch (e) {
313
+ loadErrors.push(e)
314
+ }
248
315
  } else {
249
316
  try {
250
- return require('./tailwindcss-oxide.linux-arm64-gnu.node')
251
- } catch (e) {
252
- loadErrors.push(e)
253
- }
254
- try {
255
- return require('@tailwindcss/oxide-linux-arm64-gnu')
256
- } catch (e) {
257
- loadErrors.push(e)
258
- }
259
-
317
+ return require('./tailwindcss-oxide.linux-arm64-gnu.node')
318
+ } catch (e) {
319
+ loadErrors.push(e)
320
+ }
321
+ try {
322
+ const binding = require('@tailwindcss/oxide-linux-arm64-gnu')
323
+ const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm64-gnu/package.json').version
324
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
+ }
327
+ return binding
328
+ } catch (e) {
329
+ loadErrors.push(e)
330
+ }
260
331
  }
261
332
  } else if (process.arch === 'arm') {
262
333
  if (isMusl()) {
263
334
  try {
264
- return require('./tailwindcss-oxide.linux-arm-musleabihf.node')
265
- } catch (e) {
266
- loadErrors.push(e)
267
- }
268
- try {
269
- return require('@tailwindcss/oxide-linux-arm-musleabihf')
270
- } catch (e) {
271
- loadErrors.push(e)
335
+ return require('./tailwindcss-oxide.linux-arm-musleabihf.node')
336
+ } catch (e) {
337
+ loadErrors.push(e)
338
+ }
339
+ try {
340
+ const binding = require('@tailwindcss/oxide-linux-arm-musleabihf')
341
+ const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm-musleabihf/package.json').version
342
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
+ }
345
+ return binding
346
+ } catch (e) {
347
+ loadErrors.push(e)
348
+ }
349
+ } else {
350
+ try {
351
+ return require('./tailwindcss-oxide.linux-arm-gnueabihf.node')
352
+ } catch (e) {
353
+ loadErrors.push(e)
354
+ }
355
+ try {
356
+ const binding = require('@tailwindcss/oxide-linux-arm-gnueabihf')
357
+ const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm-gnueabihf/package.json').version
358
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
+ }
361
+ return binding
362
+ } catch (e) {
363
+ loadErrors.push(e)
364
+ }
365
+ }
366
+ } else if (process.arch === 'loong64') {
367
+ if (isMusl()) {
368
+ try {
369
+ return require('./tailwindcss-oxide.linux-loong64-musl.node')
370
+ } catch (e) {
371
+ loadErrors.push(e)
372
+ }
373
+ try {
374
+ const binding = require('@tailwindcss/oxide-linux-loong64-musl')
375
+ const bindingPackageVersion = require('@tailwindcss/oxide-linux-loong64-musl/package.json').version
376
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
+ }
379
+ return binding
380
+ } catch (e) {
381
+ loadErrors.push(e)
382
+ }
383
+ } else {
384
+ try {
385
+ return require('./tailwindcss-oxide.linux-loong64-gnu.node')
386
+ } catch (e) {
387
+ loadErrors.push(e)
388
+ }
389
+ try {
390
+ const binding = require('@tailwindcss/oxide-linux-loong64-gnu')
391
+ const bindingPackageVersion = require('@tailwindcss/oxide-linux-loong64-gnu/package.json').version
392
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
+ }
395
+ return binding
396
+ } catch (e) {
397
+ loadErrors.push(e)
398
+ }
272
399
  }
273
-
400
+ } else if (process.arch === 'riscv64') {
401
+ if (isMusl()) {
402
+ try {
403
+ return require('./tailwindcss-oxide.linux-riscv64-musl.node')
404
+ } catch (e) {
405
+ loadErrors.push(e)
406
+ }
407
+ try {
408
+ const binding = require('@tailwindcss/oxide-linux-riscv64-musl')
409
+ const bindingPackageVersion = require('@tailwindcss/oxide-linux-riscv64-musl/package.json').version
410
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
+ }
413
+ return binding
414
+ } catch (e) {
415
+ loadErrors.push(e)
416
+ }
274
417
  } else {
275
418
  try {
276
- return require('./tailwindcss-oxide.linux-arm-gnueabihf.node')
419
+ return require('./tailwindcss-oxide.linux-riscv64-gnu.node')
420
+ } catch (e) {
421
+ loadErrors.push(e)
422
+ }
423
+ try {
424
+ const binding = require('@tailwindcss/oxide-linux-riscv64-gnu')
425
+ const bindingPackageVersion = require('@tailwindcss/oxide-linux-riscv64-gnu/package.json').version
426
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
+ }
429
+ return binding
430
+ } catch (e) {
431
+ loadErrors.push(e)
432
+ }
433
+ }
434
+ } else if (process.arch === 'ppc64') {
435
+ try {
436
+ return require('./tailwindcss-oxide.linux-ppc64-gnu.node')
277
437
  } catch (e) {
278
438
  loadErrors.push(e)
279
439
  }
280
440
  try {
281
- return require('@tailwindcss/oxide-linux-arm-gnueabihf')
441
+ const binding = require('@tailwindcss/oxide-linux-ppc64-gnu')
442
+ const bindingPackageVersion = require('@tailwindcss/oxide-linux-ppc64-gnu/package.json').version
443
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
+ }
446
+ return binding
282
447
  } catch (e) {
283
448
  loadErrors.push(e)
284
449
  }
285
-
286
- }
287
- } else if (process.arch === 'riscv64') {
288
- if (isMusl()) {
289
- try {
290
- return require('./tailwindcss-oxide.linux-riscv64-musl.node')
450
+ } else if (process.arch === 's390x') {
451
+ try {
452
+ return require('./tailwindcss-oxide.linux-s390x-gnu.node')
291
453
  } catch (e) {
292
454
  loadErrors.push(e)
293
455
  }
294
456
  try {
295
- return require('@tailwindcss/oxide-linux-riscv64-musl')
457
+ const binding = require('@tailwindcss/oxide-linux-s390x-gnu')
458
+ const bindingPackageVersion = require('@tailwindcss/oxide-linux-s390x-gnu/package.json').version
459
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
+ }
462
+ return binding
296
463
  } catch (e) {
297
464
  loadErrors.push(e)
298
465
  }
299
-
300
- } else {
301
- try {
302
- return require('./tailwindcss-oxide.linux-riscv64-gnu.node')
466
+ } else {
467
+ loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
468
+ }
469
+ } else if (process.platform === 'openharmony') {
470
+ if (process.arch === 'arm64') {
471
+ try {
472
+ return require('./tailwindcss-oxide.openharmony-arm64.node')
303
473
  } catch (e) {
304
474
  loadErrors.push(e)
305
475
  }
306
476
  try {
307
- return require('@tailwindcss/oxide-linux-riscv64-gnu')
477
+ const binding = require('@tailwindcss/oxide-openharmony-arm64')
478
+ const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-arm64/package.json').version
479
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
+ }
482
+ return binding
308
483
  } catch (e) {
309
484
  loadErrors.push(e)
310
485
  }
311
-
312
- }
313
- } else if (process.arch === 'ppc64') {
486
+ } else if (process.arch === 'x64') {
314
487
  try {
315
- return require('./tailwindcss-oxide.linux-ppc64-gnu.node')
488
+ return require('./tailwindcss-oxide.openharmony-x64.node')
316
489
  } catch (e) {
317
490
  loadErrors.push(e)
318
491
  }
319
492
  try {
320
- return require('@tailwindcss/oxide-linux-ppc64-gnu')
493
+ const binding = require('@tailwindcss/oxide-openharmony-x64')
494
+ const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-x64/package.json').version
495
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
+ }
498
+ return binding
321
499
  } catch (e) {
322
500
  loadErrors.push(e)
323
501
  }
324
-
325
- } else if (process.arch === 's390x') {
502
+ } else if (process.arch === 'arm') {
326
503
  try {
327
- return require('./tailwindcss-oxide.linux-s390x-gnu.node')
504
+ return require('./tailwindcss-oxide.openharmony-arm.node')
328
505
  } catch (e) {
329
506
  loadErrors.push(e)
330
507
  }
331
508
  try {
332
- return require('@tailwindcss/oxide-linux-s390x-gnu')
509
+ const binding = require('@tailwindcss/oxide-openharmony-arm')
510
+ const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-arm/package.json').version
511
+ if (bindingPackageVersion !== '0.0.0-insiders.d42b34a' && 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.0-insiders.d42b34a but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
+ }
514
+ return binding
333
515
  } catch (e) {
334
516
  loadErrors.push(e)
335
517
  }
336
-
337
518
  } else {
338
- loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
519
+ loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`))
339
520
  }
340
521
  } else {
341
522
  loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
@@ -344,34 +525,65 @@ function requireNative() {
344
525
 
345
526
  nativeBinding = requireNative()
346
527
 
347
- if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
528
+ // NAPI_RS_FORCE_WASI is a tri-state flag:
529
+ // unset / any other value → native binding preferred, WASI is only a fallback
530
+ // 'true' → force WASI fallback even if native loaded
531
+ // 'error' → force WASI and throw if no WASI binding is found
532
+ // Treating any non-empty string as truthy (the historical behavior) meant
533
+ // NAPI_RS_FORCE_WASI=false, NAPI_RS_FORCE_WASI=0, etc. inadvertently triggered
534
+ // the WASI path, causing ENOENT for packages shipped without a .wasi.cjs file.
535
+ const forceWasi =
536
+ process.env.NAPI_RS_FORCE_WASI === 'true' || process.env.NAPI_RS_FORCE_WASI === 'error'
537
+
538
+ if (!nativeBinding || forceWasi) {
539
+ let wasiBinding = null
540
+ let wasiBindingError = null
348
541
  try {
349
- nativeBinding = require('./tailwindcss-oxide.wasi.cjs')
542
+ wasiBinding = require('./tailwindcss-oxide.wasi.cjs')
543
+ nativeBinding = wasiBinding
350
544
  } catch (err) {
351
- if (process.env.NAPI_RS_FORCE_WASI) {
352
- loadErrors.push(err)
545
+ if (forceWasi) {
546
+ wasiBindingError = err
353
547
  }
354
548
  }
355
- if (!nativeBinding) {
549
+ if (!nativeBinding || forceWasi) {
356
550
  try {
357
- nativeBinding = require('@tailwindcss/oxide-wasm32-wasi')
551
+ wasiBinding = require('@tailwindcss/oxide-wasm32-wasi')
552
+ nativeBinding = wasiBinding
358
553
  } catch (err) {
359
- if (process.env.NAPI_RS_FORCE_WASI) {
554
+ if (forceWasi) {
555
+ if (!wasiBindingError) {
556
+ wasiBindingError = err
557
+ } else {
558
+ wasiBindingError.cause = err
559
+ }
360
560
  loadErrors.push(err)
361
561
  }
362
562
  }
363
563
  }
564
+ if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {
565
+ const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error')
566
+ error.cause = wasiBindingError
567
+ throw error
568
+ }
364
569
  }
365
570
 
366
571
  if (!nativeBinding) {
367
572
  if (loadErrors.length > 0) {
368
- // TODO Link to documentation with potential fixes
369
- // - The package owner could build/publish bindings for this arch
370
- // - The user may need to bundle the correct files
371
- // - The user may need to re-install node_modules to get new packages
372
- throw new Error('Failed to load native binding', { cause: loadErrors })
573
+ throw new Error(
574
+ `Cannot find native binding. ` +
575
+ `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
576
+ 'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
577
+ {
578
+ cause: loadErrors.reduce((err, cur) => {
579
+ cur.cause = err
580
+ return cur
581
+ }),
582
+ },
583
+ )
373
584
  }
374
585
  throw new Error(`Failed to load native binding`)
375
586
  }
376
587
 
588
+ module.exports = nativeBinding
377
589
  module.exports.Scanner = nativeBinding.Scanner
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailwindcss/oxide",
3
- "version": "0.0.0-insiders.d38554d",
3
+ "version": "0.0.0-insiders.d42b34a",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/tailwindlabs/tailwindcss.git",
@@ -33,12 +33,12 @@
33
33
  },
34
34
  "license": "MIT",
35
35
  "devDependencies": {
36
- "@napi-rs/cli": "^3.0.0-alpha.78",
37
- "@napi-rs/wasm-runtime": "^0.2.9",
38
- "emnapi": "1.4.3"
36
+ "@napi-rs/cli": "3.7.0",
37
+ "@napi-rs/wasm-runtime": "^1.1.4",
38
+ "emnapi": "1.10.0"
39
39
  },
40
40
  "engines": {
41
- "node": ">= 10"
41
+ "node": ">= 20"
42
42
  },
43
43
  "files": [
44
44
  "index.js",
@@ -49,28 +49,27 @@
49
49
  "access": "public"
50
50
  },
51
51
  "optionalDependencies": {
52
- "@tailwindcss/oxide-android-arm64": "0.0.0-insiders.d38554d",
53
- "@tailwindcss/oxide-darwin-arm64": "0.0.0-insiders.d38554d",
54
- "@tailwindcss/oxide-darwin-x64": "0.0.0-insiders.d38554d",
55
- "@tailwindcss/oxide-linux-arm-gnueabihf": "0.0.0-insiders.d38554d",
56
- "@tailwindcss/oxide-linux-arm64-musl": "0.0.0-insiders.d38554d",
57
- "@tailwindcss/oxide-linux-x64-gnu": "0.0.0-insiders.d38554d",
58
- "@tailwindcss/oxide-linux-x64-musl": "0.0.0-insiders.d38554d",
59
- "@tailwindcss/oxide-freebsd-x64": "0.0.0-insiders.d38554d",
60
- "@tailwindcss/oxide-wasm32-wasi": "0.0.0-insiders.d38554d",
61
- "@tailwindcss/oxide-win32-x64-msvc": "0.0.0-insiders.d38554d",
62
- "@tailwindcss/oxide-win32-arm64-msvc": "0.0.0-insiders.d38554d",
63
- "@tailwindcss/oxide-linux-arm64-gnu": "0.0.0-insiders.d38554d"
52
+ "@tailwindcss/oxide-android-arm64": "0.0.0-insiders.d42b34a",
53
+ "@tailwindcss/oxide-darwin-arm64": "0.0.0-insiders.d42b34a",
54
+ "@tailwindcss/oxide-darwin-x64": "0.0.0-insiders.d42b34a",
55
+ "@tailwindcss/oxide-linux-arm-gnueabihf": "0.0.0-insiders.d42b34a",
56
+ "@tailwindcss/oxide-linux-arm64-gnu": "0.0.0-insiders.d42b34a",
57
+ "@tailwindcss/oxide-wasm32-wasi": "0.0.0-insiders.d42b34a",
58
+ "@tailwindcss/oxide-linux-x64-gnu": "0.0.0-insiders.d42b34a",
59
+ "@tailwindcss/oxide-linux-arm64-musl": "0.0.0-insiders.d42b34a",
60
+ "@tailwindcss/oxide-linux-x64-musl": "0.0.0-insiders.d42b34a",
61
+ "@tailwindcss/oxide-win32-arm64-msvc": "0.0.0-insiders.d42b34a",
62
+ "@tailwindcss/oxide-freebsd-x64": "0.0.0-insiders.d42b34a",
63
+ "@tailwindcss/oxide-win32-x64-msvc": "0.0.0-insiders.d42b34a"
64
64
  },
65
65
  "scripts": {
66
- "artifacts": "napi artifacts",
67
66
  "build": "pnpm run build:platform && pnpm run build:wasm",
68
- "build:platform": "napi build --platform --release --no-const-enum",
67
+ "build:platform": "napi build --platform --release",
69
68
  "postbuild:platform": "node ./scripts/move-artifacts.mjs",
70
- "build:wasm": "napi build --release --target wasm32-wasip1-threads --no-const-enum",
69
+ "build:wasm": "napi build --release --target wasm32-wasip1-threads",
71
70
  "postbuild:wasm": "node ./scripts/move-artifacts.mjs",
72
71
  "dev": "cargo watch --quiet --shell 'npm run build'",
73
- "build:debug": "napi build --platform --no-const-enum",
72
+ "build:debug": "napi build --platform",
74
73
  "version": "napi version"
75
74
  }
76
75
  }