@tailwindcss/oxide
Advanced tools
+311
-113
@@ -6,5 +6,2 @@ // prettier-ignore | ||
| const { createRequire } = require('node:module') | ||
| require = createRequire(__filename) | ||
| const { readFileSync } = require('node:fs') | ||
@@ -70,5 +67,5 @@ let nativeBinding = null | ||
| try { | ||
| nativeBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH); | ||
| return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH); | ||
| } catch (err) { | ||
| loadErrors.push(err); | ||
| loadErrors.push(err) | ||
| } | ||
@@ -83,7 +80,11 @@ } else if (process.platform === 'android') { | ||
| try { | ||
| return require('@tailwindcss/oxide-android-arm64') | ||
| const binding = require('@tailwindcss/oxide-android-arm64') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-android-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'arm') { | ||
@@ -96,7 +97,11 @@ try { | ||
| try { | ||
| return require('@tailwindcss/oxide-android-arm-eabi') | ||
| const binding = require('@tailwindcss/oxide-android-arm-eabi') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-android-arm-eabi/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
@@ -107,3 +112,20 @@ loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`)) | ||
| if (process.arch === 'x64') { | ||
| if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') { | ||
| try { | ||
| return require('./tailwindcss-oxide.win32-x64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-win32-x64-gnu') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-win32-x64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| try { | ||
| return require('./tailwindcss-oxide.win32-x64-msvc.node') | ||
@@ -114,7 +136,12 @@ } catch (e) { | ||
| try { | ||
| return require('@tailwindcss/oxide-win32-x64-msvc') | ||
| const binding = require('@tailwindcss/oxide-win32-x64-msvc') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-win32-x64-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| } else if (process.arch === 'ia32') { | ||
@@ -127,7 +154,11 @@ try { | ||
| try { | ||
| return require('@tailwindcss/oxide-win32-ia32-msvc') | ||
| const binding = require('@tailwindcss/oxide-win32-ia32-msvc') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-win32-ia32-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
@@ -140,7 +171,11 @@ try { | ||
| try { | ||
| return require('@tailwindcss/oxide-win32-arm64-msvc') | ||
| const binding = require('@tailwindcss/oxide-win32-arm64-msvc') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-win32-arm64-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
@@ -151,12 +186,16 @@ loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`)) | ||
| try { | ||
| return require('./tailwindcss-oxide.darwin-universal.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| return require('./tailwindcss-oxide.darwin-universal.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-darwin-universal') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-darwin-universal/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| try { | ||
| return require('@tailwindcss/oxide-darwin-universal') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| if (process.arch === 'x64') { | ||
@@ -169,7 +208,11 @@ try { | ||
| try { | ||
| return require('@tailwindcss/oxide-darwin-x64') | ||
| const binding = require('@tailwindcss/oxide-darwin-x64') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-darwin-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
@@ -182,7 +225,11 @@ try { | ||
| try { | ||
| return require('@tailwindcss/oxide-darwin-arm64') | ||
| const binding = require('@tailwindcss/oxide-darwin-arm64') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-darwin-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
@@ -199,7 +246,11 @@ loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`)) | ||
| try { | ||
| return require('@tailwindcss/oxide-freebsd-x64') | ||
| const binding = require('@tailwindcss/oxide-freebsd-x64') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-freebsd-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
@@ -212,7 +263,11 @@ try { | ||
| try { | ||
| return require('@tailwindcss/oxide-freebsd-arm64') | ||
| const binding = require('@tailwindcss/oxide-freebsd-arm64') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-freebsd-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
@@ -225,67 +280,172 @@ loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`)) | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-x64-musl.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| return require('@tailwindcss/oxide-linux-x64-musl') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| return require('./tailwindcss-oxide.linux-x64-musl.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-linux-x64-musl') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-linux-x64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-x64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| return require('./tailwindcss-oxide.linux-x64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-linux-x64-gnu') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-linux-x64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| try { | ||
| return require('@tailwindcss/oxide-linux-x64-gnu') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
| if (isMusl()) { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-arm64-musl.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| return require('@tailwindcss/oxide-linux-arm64-musl') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| return require('./tailwindcss-oxide.linux-arm64-musl.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-linux-arm64-musl') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-arm64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| return require('./tailwindcss-oxide.linux-arm64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-linux-arm64-gnu') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| try { | ||
| return require('@tailwindcss/oxide-linux-arm64-gnu') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| } else if (process.arch === 'arm') { | ||
| if (isMusl()) { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-arm-musleabihf.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| return require('./tailwindcss-oxide.linux-arm-musleabihf.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-linux-arm-musleabihf') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm-musleabihf/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-arm-gnueabihf.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-linux-arm-gnueabihf') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm-gnueabihf/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| try { | ||
| return require('@tailwindcss/oxide-linux-arm-musleabihf') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } else if (process.arch === 'loong64') { | ||
| if (isMusl()) { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-loong64-musl.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-linux-loong64-musl') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-linux-loong64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-loong64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-linux-loong64-gnu') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-linux-loong64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| } else if (process.arch === 'riscv64') { | ||
| if (isMusl()) { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-riscv64-musl.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-linux-riscv64-musl') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-linux-riscv64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-arm-gnueabihf.node') | ||
| return require('./tailwindcss-oxide.linux-riscv64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-linux-riscv64-gnu') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-linux-riscv64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| } else if (process.arch === 'ppc64') { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-ppc64-gnu.node') | ||
| } catch (e) { | ||
@@ -295,12 +455,14 @@ loadErrors.push(e) | ||
| try { | ||
| return require('@tailwindcss/oxide-linux-arm-gnueabihf') | ||
| const binding = require('@tailwindcss/oxide-linux-ppc64-gnu') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-linux-ppc64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| } else if (process.arch === 'riscv64') { | ||
| if (isMusl()) { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-riscv64-musl.node') | ||
| } else if (process.arch === 's390x') { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-s390x-gnu.node') | ||
| } catch (e) { | ||
@@ -310,10 +472,18 @@ loadErrors.push(e) | ||
| try { | ||
| return require('@tailwindcss/oxide-linux-riscv64-musl') | ||
| const binding = require('@tailwindcss/oxide-linux-s390x-gnu') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-linux-s390x-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-riscv64-gnu.node') | ||
| } else { | ||
| loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`)) | ||
| } | ||
| } else if (process.platform === 'openharmony') { | ||
| if (process.arch === 'arm64') { | ||
| try { | ||
| return require('./tailwindcss-oxide.openharmony-arm64.node') | ||
| } catch (e) { | ||
@@ -323,11 +493,14 @@ loadErrors.push(e) | ||
| try { | ||
| return require('@tailwindcss/oxide-linux-riscv64-gnu') | ||
| const binding = require('@tailwindcss/oxide-openharmony-arm64') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| } else if (process.arch === 'ppc64') { | ||
| } else if (process.arch === 'x64') { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-ppc64-gnu.node') | ||
| return require('./tailwindcss-oxide.openharmony-x64.node') | ||
| } catch (e) { | ||
@@ -337,10 +510,14 @@ loadErrors.push(e) | ||
| try { | ||
| return require('@tailwindcss/oxide-linux-ppc64-gnu') | ||
| const binding = require('@tailwindcss/oxide-openharmony-x64') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 's390x') { | ||
| } else if (process.arch === 'arm') { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-s390x-gnu.node') | ||
| return require('./tailwindcss-oxide.openharmony-arm.node') | ||
| } catch (e) { | ||
@@ -350,9 +527,13 @@ loadErrors.push(e) | ||
| try { | ||
| return require('@tailwindcss/oxide-linux-s390x-gnu') | ||
| const binding = require('@tailwindcss/oxide-openharmony-arm') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-arm/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.257dc58' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.0-insiders.257dc58 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`)) | ||
| loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`)) | ||
| } | ||
@@ -367,7 +548,10 @@ } else { | ||
| if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { | ||
| let wasiBinding = null | ||
| let wasiBindingError = null | ||
| try { | ||
| nativeBinding = require('./tailwindcss-oxide.wasi.cjs') | ||
| wasiBinding = require('./tailwindcss-oxide.wasi.cjs') | ||
| nativeBinding = wasiBinding | ||
| } catch (err) { | ||
| if (process.env.NAPI_RS_FORCE_WASI) { | ||
| loadErrors.push(err) | ||
| wasiBindingError = err | ||
| } | ||
@@ -377,5 +561,7 @@ } | ||
| try { | ||
| nativeBinding = require('@tailwindcss/oxide-wasm32-wasi') | ||
| wasiBinding = require('@tailwindcss/oxide-wasm32-wasi') | ||
| nativeBinding = wasiBinding | ||
| } catch (err) { | ||
| if (process.env.NAPI_RS_FORCE_WASI) { | ||
| wasiBindingError.cause = err | ||
| loadErrors.push(err) | ||
@@ -385,2 +571,7 @@ } | ||
| } | ||
| if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) { | ||
| const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error') | ||
| error.cause = wasiBindingError | ||
| throw error | ||
| } | ||
| } | ||
@@ -390,7 +581,13 @@ | ||
| if (loadErrors.length > 0) { | ||
| // TODO Link to documentation with potential fixes | ||
| // - The package owner could build/publish bindings for this arch | ||
| // - The user may need to bundle the correct files | ||
| // - The user may need to re-install node_modules to get new packages | ||
| throw new Error('Failed to load native binding', { cause: loadErrors }) | ||
| throw new Error( | ||
| `Cannot find native binding. ` + | ||
| `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` + | ||
| 'Please try `npm i` again after removing both package-lock.json and node_modules directory.', | ||
| { | ||
| cause: loadErrors.reduce((err, cur) => { | ||
| cur.cause = err | ||
| return cur | ||
| }), | ||
| }, | ||
| ) | ||
| } | ||
@@ -400,2 +597,3 @@ throw new Error(`Failed to load native binding`) | ||
| module.exports = nativeBinding | ||
| module.exports.Scanner = nativeBinding.Scanner |
+20
-21
| { | ||
| "name": "@tailwindcss/oxide", | ||
| "version": "0.0.0-insiders.25539e3", | ||
| "version": "0.0.0-insiders.257dc58", | ||
| "repository": { | ||
@@ -36,8 +36,8 @@ "type": "git", | ||
| "devDependencies": { | ||
| "@napi-rs/cli": "^3.0.0-alpha.77", | ||
| "@napi-rs/wasm-runtime": "^0.2.8", | ||
| "emnapi": "1.3.1" | ||
| "@napi-rs/cli": "3.4.1", | ||
| "@napi-rs/wasm-runtime": "^1.1.1", | ||
| "emnapi": "1.8.1" | ||
| }, | ||
| "engines": { | ||
| "node": ">= 10" | ||
| "node": ">= 20" | ||
| }, | ||
@@ -53,26 +53,25 @@ "files": [ | ||
| "optionalDependencies": { | ||
| "@tailwindcss/oxide-darwin-x64": "0.0.0-insiders.25539e3", | ||
| "@tailwindcss/oxide-freebsd-x64": "0.0.0-insiders.25539e3", | ||
| "@tailwindcss/oxide-linux-arm64-gnu": "0.0.0-insiders.25539e3", | ||
| "@tailwindcss/oxide-android-arm64": "0.0.0-insiders.25539e3", | ||
| "@tailwindcss/oxide-linux-arm-gnueabihf": "0.0.0-insiders.25539e3", | ||
| "@tailwindcss/oxide-linux-arm64-musl": "0.0.0-insiders.25539e3", | ||
| "@tailwindcss/oxide-linux-x64-gnu": "0.0.0-insiders.25539e3", | ||
| "@tailwindcss/oxide-linux-x64-musl": "0.0.0-insiders.25539e3", | ||
| "@tailwindcss/oxide-wasm32-wasi": "0.0.0-insiders.25539e3", | ||
| "@tailwindcss/oxide-win32-x64-msvc": "0.0.0-insiders.25539e3", | ||
| "@tailwindcss/oxide-darwin-arm64": "0.0.0-insiders.25539e3", | ||
| "@tailwindcss/oxide-win32-arm64-msvc": "0.0.0-insiders.25539e3" | ||
| "@tailwindcss/oxide-android-arm64": "0.0.0-insiders.257dc58", | ||
| "@tailwindcss/oxide-darwin-x64": "0.0.0-insiders.257dc58", | ||
| "@tailwindcss/oxide-linux-arm-gnueabihf": "0.0.0-insiders.257dc58", | ||
| "@tailwindcss/oxide-linux-arm64-gnu": "0.0.0-insiders.257dc58", | ||
| "@tailwindcss/oxide-linux-arm64-musl": "0.0.0-insiders.257dc58", | ||
| "@tailwindcss/oxide-linux-x64-gnu": "0.0.0-insiders.257dc58", | ||
| "@tailwindcss/oxide-linux-x64-musl": "0.0.0-insiders.257dc58", | ||
| "@tailwindcss/oxide-darwin-arm64": "0.0.0-insiders.257dc58", | ||
| "@tailwindcss/oxide-freebsd-x64": "0.0.0-insiders.257dc58", | ||
| "@tailwindcss/oxide-win32-arm64-msvc": "0.0.0-insiders.257dc58", | ||
| "@tailwindcss/oxide-win32-x64-msvc": "0.0.0-insiders.257dc58", | ||
| "@tailwindcss/oxide-wasm32-wasi": "0.0.0-insiders.257dc58" | ||
| }, | ||
| "scripts": { | ||
| "artifacts": "napi artifacts", | ||
| "build": "pnpm run build:platform && pnpm run build:wasm", | ||
| "build:platform": "napi build --platform --release --no-const-enum", | ||
| "build:platform": "napi build --platform --release", | ||
| "postbuild:platform": "node ./scripts/move-artifacts.mjs", | ||
| "build:wasm": "napi build --release --target wasm32-wasip1-threads --no-const-enum", | ||
| "build:wasm": "napi build --release --target wasm32-wasip1-threads", | ||
| "postbuild:wasm": "node ./scripts/move-artifacts.mjs", | ||
| "dev": "cargo watch --quiet --shell 'npm run build'", | ||
| "build:debug": "napi build --platform --no-const-enum", | ||
| "build:debug": "napi build --platform", | ||
| "version": "napi version" | ||
| } | ||
| } |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
29896
108.39%607
56.44%1
-50%60
900%