@tailwindcss/oxide
Advanced tools
+27
-16
@@ -1,5 +0,19 @@ | ||
| /* tslint:disable */ | ||
| /* auto-generated by NAPI-RS */ | ||
| /* eslint-disable */ | ||
| export declare class Scanner { | ||
| constructor(opts: ScannerOptions) | ||
| scan(): Array<string> | ||
| scanFiles(input: Array<ChangedContent>): Array<string> | ||
| getCandidatesWithPositions(input: ChangedContent): Array<CandidateWithPosition> | ||
| get files(): Array<string> | ||
| get globs(): Array<GlobEntry> | ||
| get normalizedSources(): Array<GlobEntry> | ||
| } | ||
| /* auto-generated by NAPI-RS */ | ||
| export interface CandidateWithPosition { | ||
| /** The candidate string */ | ||
| candidate: string | ||
| /** The position of the candidate inside the content file */ | ||
| position: number | ||
| } | ||
@@ -14,2 +28,3 @@ export interface ChangedContent { | ||
| } | ||
| export interface GlobEntry { | ||
@@ -21,19 +36,15 @@ /** Base path of the glob */ | ||
| } | ||
| export interface ScannerOptions { | ||
| /** Glob sources */ | ||
| sources?: Array<GlobEntry> | ||
| sources?: Array<SourceEntry> | ||
| } | ||
| export interface CandidateWithPosition { | ||
| /** The candidate string */ | ||
| candidate: string | ||
| /** The position of the candidate inside the content file */ | ||
| position: number | ||
| export interface SourceEntry { | ||
| /** Base path of the glob */ | ||
| base: string | ||
| /** Glob pattern */ | ||
| pattern: string | ||
| /** Negated flag */ | ||
| negated: boolean | ||
| } | ||
| export declare class Scanner { | ||
| constructor(opts: ScannerOptions) | ||
| scan(): Array<string> | ||
| scanFiles(input: Array<ChangedContent>): Array<string> | ||
| getCandidatesWithPositions(input: ChangedContent): Array<CandidateWithPosition> | ||
| get files(): Array<string> | ||
| get globs(): Array<GlobEntry> | ||
| } |
+516
-256
@@ -1,309 +0,570 @@ | ||
| /* tslint:disable */ | ||
| // prettier-ignore | ||
| /* eslint-disable */ | ||
| /* prettier-ignore */ | ||
| // @ts-nocheck | ||
| /* auto-generated by NAPI-RS */ | ||
| const { existsSync, readFileSync } = require('fs') | ||
| const { join } = require('path') | ||
| const { readFileSync } = require('node:fs') | ||
| let nativeBinding = null | ||
| const loadErrors = [] | ||
| const { platform, arch } = process | ||
| const isMusl = () => { | ||
| let musl = false | ||
| if (process.platform === 'linux') { | ||
| musl = isMuslFromFilesystem() | ||
| if (musl === null) { | ||
| musl = isMuslFromReport() | ||
| } | ||
| if (musl === null) { | ||
| musl = isMuslFromChildProcess() | ||
| } | ||
| } | ||
| return musl | ||
| } | ||
| let nativeBinding = null | ||
| let localFileExisted = false | ||
| let loadError = null | ||
| const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-') | ||
| function isMusl() { | ||
| // For Node 10 | ||
| if (!process.report || typeof process.report.getReport !== 'function') { | ||
| try { | ||
| const lddPath = require('child_process').execSync('which ldd').toString().trim() | ||
| return readFileSync(lddPath, 'utf8').includes('musl') | ||
| } catch (e) { | ||
| const isMuslFromFilesystem = () => { | ||
| try { | ||
| return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl') | ||
| } catch { | ||
| return null | ||
| } | ||
| } | ||
| const isMuslFromReport = () => { | ||
| let report = null | ||
| if (typeof process.report?.getReport === 'function') { | ||
| process.report.excludeNetwork = true | ||
| report = process.report.getReport() | ||
| } | ||
| if (!report) { | ||
| return null | ||
| } | ||
| if (report.header && report.header.glibcVersionRuntime) { | ||
| return false | ||
| } | ||
| if (Array.isArray(report.sharedObjects)) { | ||
| if (report.sharedObjects.some(isFileMusl)) { | ||
| return true | ||
| } | ||
| } else { | ||
| const { glibcVersionRuntime } = process.report.getReport().header | ||
| return !glibcVersionRuntime | ||
| } | ||
| return false | ||
| } | ||
| switch (platform) { | ||
| case 'android': | ||
| switch (arch) { | ||
| case 'arm64': | ||
| localFileExisted = existsSync(join(__dirname, 'tailwindcss-oxide.android-arm64.node')) | ||
| const isMuslFromChildProcess = () => { | ||
| try { | ||
| return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl') | ||
| } catch (e) { | ||
| // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false | ||
| return false | ||
| } | ||
| } | ||
| function requireNative() { | ||
| if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) { | ||
| try { | ||
| return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH); | ||
| } catch (err) { | ||
| loadErrors.push(err) | ||
| } | ||
| } else if (process.platform === 'android') { | ||
| if (process.arch === 'arm64') { | ||
| try { | ||
| return require('./tailwindcss-oxide.android-arm64.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-android-arm64') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-android-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'arm') { | ||
| try { | ||
| return require('./tailwindcss-oxide.android-arm-eabi.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| 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.2228a57' && 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.2228a57 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 Android ${process.arch}`)) | ||
| } | ||
| } else if (process.platform === 'win32') { | ||
| if (process.arch === 'x64') { | ||
| if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') { | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.android-arm64.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-android-arm64') | ||
| } | ||
| 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.2228a57' && 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.2228a57 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') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| 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.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| } else if (process.arch === 'ia32') { | ||
| try { | ||
| return require('./tailwindcss-oxide.win32-ia32-msvc.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| 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.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
| try { | ||
| return require('./tailwindcss-oxide.win32-arm64-msvc.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| 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.2228a57' && 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.2228a57 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 Windows: ${process.arch}`)) | ||
| } | ||
| } else if (process.platform === 'darwin') { | ||
| try { | ||
| 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.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| if (process.arch === 'x64') { | ||
| try { | ||
| return require('./tailwindcss-oxide.darwin-x64.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-darwin-x64') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-darwin-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
| try { | ||
| return require('./tailwindcss-oxide.darwin-arm64.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-darwin-arm64') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-darwin-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.2228a57' && 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.2228a57 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 macOS: ${process.arch}`)) | ||
| } | ||
| } else if (process.platform === 'freebsd') { | ||
| if (process.arch === 'x64') { | ||
| try { | ||
| return require('./tailwindcss-oxide.freebsd-x64.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-freebsd-x64') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-freebsd-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
| try { | ||
| return require('./tailwindcss-oxide.freebsd-arm64.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-freebsd-arm64') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-freebsd-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.2228a57' && 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.2228a57 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 FreeBSD: ${process.arch}`)) | ||
| } | ||
| } else if (process.platform === 'linux') { | ||
| if (process.arch === 'x64') { | ||
| if (isMusl()) { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-x64-musl.node') | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 'arm': | ||
| localFileExisted = existsSync(join(__dirname, 'tailwindcss-oxide.android-arm-eabi.node')) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.android-arm-eabi.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-android-arm-eabi') | ||
| 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.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| default: | ||
| throw new Error(`Unsupported architecture on Android ${arch}`) | ||
| } | ||
| break | ||
| case 'win32': | ||
| switch (arch) { | ||
| case 'x64': | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'tailwindcss-oxide.win32-x64-msvc.node') | ||
| ) | ||
| } else { | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.win32-x64-msvc.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-win32-x64-msvc') | ||
| } | ||
| return require('./tailwindcss-oxide.linux-x64-gnu.node') | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 'ia32': | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'tailwindcss-oxide.win32-ia32-msvc.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.win32-ia32-msvc.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-win32-ia32-msvc') | ||
| 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.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 'arm64': | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'tailwindcss-oxide.win32-arm64-msvc.node') | ||
| ) | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
| if (isMusl()) { | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.win32-arm64-msvc.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-win32-arm64-msvc') | ||
| 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.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| default: | ||
| throw new Error(`Unsupported architecture on Windows: ${arch}`) | ||
| } | ||
| break | ||
| case 'darwin': | ||
| localFileExisted = existsSync(join(__dirname, 'tailwindcss-oxide.darwin-universal.node')) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.darwin-universal.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-darwin-universal') | ||
| } | ||
| break | ||
| } catch {} | ||
| switch (arch) { | ||
| case 'x64': | ||
| localFileExisted = existsSync(join(__dirname, 'tailwindcss-oxide.darwin-x64.node')) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.darwin-x64.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-darwin-x64') | ||
| 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.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 'arm64': | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'tailwindcss-oxide.darwin-arm64.node') | ||
| ) | ||
| } | ||
| } else if (process.arch === 'arm') { | ||
| if (isMusl()) { | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.darwin-arm64.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-darwin-arm64') | ||
| 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.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| default: | ||
| throw new Error(`Unsupported architecture on macOS: ${arch}`) | ||
| } | ||
| break | ||
| case 'freebsd': | ||
| if (arch !== 'x64') { | ||
| throw new Error(`Unsupported architecture on FreeBSD: ${arch}`) | ||
| } | ||
| localFileExisted = existsSync(join(__dirname, 'tailwindcss-oxide.freebsd-x64.node')) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.freebsd-x64.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-freebsd-x64') | ||
| } | ||
| } catch (e) { | ||
| loadError = e | ||
| } | ||
| break | ||
| case 'linux': | ||
| switch (arch) { | ||
| case 'x64': | ||
| if (isMusl()) { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'tailwindcss-oxide.linux-x64-musl.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.linux-x64-musl.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-linux-x64-musl') | ||
| } | ||
| } catch (e) { | ||
| loadError = e | ||
| 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.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| } else { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'tailwindcss-oxide.linux-x64-gnu.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.linux-x64-gnu.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-linux-x64-gnu') | ||
| } | ||
| } catch (e) { | ||
| loadError = e | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 'arm64': | ||
| if (isMusl()) { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'tailwindcss-oxide.linux-arm64-musl.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.linux-arm64-musl.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-linux-arm64-musl') | ||
| } | ||
| } catch (e) { | ||
| loadError = 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.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| } else { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'tailwindcss-oxide.linux-arm64-gnu.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.linux-arm64-gnu.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-linux-arm64-gnu') | ||
| } | ||
| } catch (e) { | ||
| loadError = e | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 'arm': | ||
| if (isMusl()) { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'tailwindcss-oxide.linux-arm-musleabihf.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.linux-arm-musleabihf.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-linux-arm-musleabihf') | ||
| } | ||
| } catch (e) { | ||
| loadError = 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.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| } else { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'tailwindcss-oxide.linux-arm-gnueabihf.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.linux-arm-gnueabihf.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-linux-arm-gnueabihf') | ||
| } | ||
| } catch (e) { | ||
| loadError = e | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 'riscv64': | ||
| if (isMusl()) { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'tailwindcss-oxide.linux-riscv64-musl.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.linux-riscv64-musl.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-linux-riscv64-musl') | ||
| } | ||
| } catch (e) { | ||
| loadError = 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.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| } else { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'tailwindcss-oxide.linux-riscv64-gnu.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.linux-riscv64-gnu.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-linux-riscv64-gnu') | ||
| } | ||
| } catch (e) { | ||
| loadError = e | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 's390x': | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'tailwindcss-oxide.linux-s390x-gnu.node') | ||
| ) | ||
| } else { | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./tailwindcss-oxide.linux-s390x-gnu.node') | ||
| } else { | ||
| nativeBinding = require('@tailwindcss/oxide-linux-s390x-gnu') | ||
| 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.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| default: | ||
| throw new Error(`Unsupported architecture on Linux: ${arch}`) | ||
| } | ||
| } else if (process.arch === 'ppc64') { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-ppc64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| 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.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 's390x') { | ||
| try { | ||
| return require('./tailwindcss-oxide.linux-s390x-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| 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.2228a57' && 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.2228a57 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}`)) | ||
| } | ||
| break | ||
| default: | ||
| throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`) | ||
| } else if (process.platform === 'openharmony') { | ||
| if (process.arch === 'arm64') { | ||
| try { | ||
| return require('./tailwindcss-oxide.openharmony-arm64.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-openharmony-arm64') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'x64') { | ||
| try { | ||
| return require('./tailwindcss-oxide.openharmony-x64.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-openharmony-x64') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.2228a57' && 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.2228a57 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'arm') { | ||
| try { | ||
| return require('./tailwindcss-oxide.openharmony-arm.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@tailwindcss/oxide-openharmony-arm') | ||
| const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-arm/package.json').version | ||
| if (bindingPackageVersion !== '0.0.0-insiders.2228a57' && 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.2228a57 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 OpenHarmony: ${process.arch}`)) | ||
| } | ||
| } else { | ||
| loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`)) | ||
| } | ||
| } | ||
| nativeBinding = requireNative() | ||
| if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { | ||
| let wasiBinding = null | ||
| let wasiBindingError = null | ||
| try { | ||
| wasiBinding = require('./tailwindcss-oxide.wasi.cjs') | ||
| nativeBinding = wasiBinding | ||
| } catch (err) { | ||
| if (process.env.NAPI_RS_FORCE_WASI) { | ||
| wasiBindingError = err | ||
| } | ||
| } | ||
| if (!nativeBinding) { | ||
| try { | ||
| wasiBinding = require('@tailwindcss/oxide-wasm32-wasi') | ||
| nativeBinding = wasiBinding | ||
| } catch (err) { | ||
| if (process.env.NAPI_RS_FORCE_WASI) { | ||
| wasiBindingError.cause = err | ||
| loadErrors.push(err) | ||
| } | ||
| } | ||
| } | ||
| 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 | ||
| } | ||
| } | ||
| if (!nativeBinding) { | ||
| if (loadError) { | ||
| throw loadError | ||
| if (loadErrors.length > 0) { | ||
| 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 | ||
| }), | ||
| }, | ||
| ) | ||
| } | ||
@@ -313,4 +574,3 @@ throw new Error(`Failed to load native binding`) | ||
| const { Scanner } = nativeBinding | ||
| module.exports.Scanner = Scanner | ||
| module.exports = nativeBinding | ||
| module.exports.Scanner = nativeBinding.Scanner |
+43
-31
| { | ||
| "name": "@tailwindcss/oxide", | ||
| "version": "0.0.0-insiders.221855b", | ||
| "version": "0.0.0-insiders.2228a57", | ||
| "repository": { | ||
@@ -12,16 +12,22 @@ "type": "git", | ||
| "napi": { | ||
| "name": "tailwindcss-oxide", | ||
| "triples": { | ||
| "additional": [ | ||
| "armv7-linux-androideabi", | ||
| "aarch64-linux-android", | ||
| "aarch64-apple-darwin", | ||
| "aarch64-unknown-linux-gnu", | ||
| "aarch64-unknown-linux-musl", | ||
| "armv7-unknown-linux-gnueabihf", | ||
| "x86_64-unknown-linux-musl", | ||
| "x86_64-unknown-freebsd", | ||
| "i686-pc-windows-msvc", | ||
| "aarch64-pc-windows-msvc" | ||
| ] | ||
| "binaryName": "tailwindcss-oxide", | ||
| "packageName": "@tailwindcss/oxide", | ||
| "targets": [ | ||
| "armv7-linux-androideabi", | ||
| "aarch64-linux-android", | ||
| "aarch64-apple-darwin", | ||
| "aarch64-unknown-linux-gnu", | ||
| "aarch64-unknown-linux-musl", | ||
| "armv7-unknown-linux-gnueabihf", | ||
| "x86_64-unknown-linux-musl", | ||
| "x86_64-unknown-freebsd", | ||
| "i686-pc-windows-msvc", | ||
| "aarch64-pc-windows-msvc", | ||
| "wasm32-wasip1-threads" | ||
| ], | ||
| "wasm": { | ||
| "initialMemory": 16384, | ||
| "browser": { | ||
| "fs": true | ||
| } | ||
| } | ||
@@ -31,6 +37,8 @@ }, | ||
| "devDependencies": { | ||
| "@napi-rs/cli": "^2.18.4" | ||
| "@napi-rs/cli": "3.4.1", | ||
| "@napi-rs/wasm-runtime": "^1.1.1", | ||
| "emnapi": "1.8.1" | ||
| }, | ||
| "engines": { | ||
| "node": ">= 10" | ||
| "node": ">= 20" | ||
| }, | ||
@@ -46,21 +54,25 @@ "files": [ | ||
| "optionalDependencies": { | ||
| "@tailwindcss/oxide-android-arm64": "0.0.0-insiders.221855b", | ||
| "@tailwindcss/oxide-darwin-x64": "0.0.0-insiders.221855b", | ||
| "@tailwindcss/oxide-linux-arm-gnueabihf": "0.0.0-insiders.221855b", | ||
| "@tailwindcss/oxide-linux-arm64-gnu": "0.0.0-insiders.221855b", | ||
| "@tailwindcss/oxide-freebsd-x64": "0.0.0-insiders.221855b", | ||
| "@tailwindcss/oxide-linux-x64-gnu": "0.0.0-insiders.221855b", | ||
| "@tailwindcss/oxide-linux-arm64-musl": "0.0.0-insiders.221855b", | ||
| "@tailwindcss/oxide-linux-x64-musl": "0.0.0-insiders.221855b", | ||
| "@tailwindcss/oxide-win32-x64-msvc": "0.0.0-insiders.221855b", | ||
| "@tailwindcss/oxide-win32-arm64-msvc": "0.0.0-insiders.221855b", | ||
| "@tailwindcss/oxide-darwin-arm64": "0.0.0-insiders.221855b" | ||
| "@tailwindcss/oxide-android-arm64": "0.0.0-insiders.2228a57", | ||
| "@tailwindcss/oxide-darwin-x64": "0.0.0-insiders.2228a57", | ||
| "@tailwindcss/oxide-darwin-arm64": "0.0.0-insiders.2228a57", | ||
| "@tailwindcss/oxide-freebsd-x64": "0.0.0-insiders.2228a57", | ||
| "@tailwindcss/oxide-linux-arm-gnueabihf": "0.0.0-insiders.2228a57", | ||
| "@tailwindcss/oxide-linux-arm64-gnu": "0.0.0-insiders.2228a57", | ||
| "@tailwindcss/oxide-linux-arm64-musl": "0.0.0-insiders.2228a57", | ||
| "@tailwindcss/oxide-linux-x64-gnu": "0.0.0-insiders.2228a57", | ||
| "@tailwindcss/oxide-wasm32-wasi": "0.0.0-insiders.2228a57", | ||
| "@tailwindcss/oxide-linux-x64-musl": "0.0.0-insiders.2228a57", | ||
| "@tailwindcss/oxide-win32-x64-msvc": "0.0.0-insiders.2228a57", | ||
| "@tailwindcss/oxide-win32-arm64-msvc": "0.0.0-insiders.2228a57" | ||
| }, | ||
| "scripts": { | ||
| "artifacts": "napi artifacts", | ||
| "build": "napi build --platform --release --no-const-enum", | ||
| "build": "pnpm run build:platform && pnpm run build:wasm", | ||
| "build:platform": "napi build --platform --release", | ||
| "postbuild:platform": "node ./scripts/move-artifacts.mjs", | ||
| "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" | ||
| } | ||
| } |
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 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
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
29896
119.6%607
78.01%12
9.09%3
200%60
5900%2
100%