@tailwindcss/oxide 4.1.13 → 4.1.14

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