diff --git a/.eslintignore b/.eslintignore index 382555c7..13e7ff95 100644 --- a/.eslintignore +++ b/.eslintignore @@ -12,3 +12,4 @@ temp __mock__ target scripts +triples/index.js diff --git a/.prettierignore b/.prettierignore index c349d985..5e027279 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,4 @@ target node_modules scripts +triples/index.js diff --git a/generate-triplelist.js b/generate-triplelist.js index 80a01882..cbb39a26 100644 --- a/generate-triplelist.js +++ b/generate-triplelist.js @@ -1,15 +1,23 @@ const { readFileSync, writeFileSync } = require('fs') const { join } = require('path') +const esbuild = require('esbuild') const { groupBy, mapValues } = require('lodash') -const prettier = require('prettier') const { parseTriple } = require('./cli/scripts/parse-triple') -const rawLists = readFileSync(join(__dirname, 'triples', 'target-list'), 'utf8') +const RAW_LIST = readFileSync(join(__dirname, 'triples', 'target-list'), 'utf8') -const tripleLists = rawLists - .trim() +const SUPPORTED_PLATFORM = new Set([ + 'darwin', + 'ios', + 'android', + 'win32', + 'linux', + 'freebsd', +]) + +const tripleLists = RAW_LIST.trim() .split('\n') .filter((line) => !line.startsWith('wasm') && line.trim().length) .map(parseTriple) @@ -19,22 +27,22 @@ const tripleLists = rawLists }, {}) const platformArchTriples = mapValues( - groupBy([...Object.values(tripleLists)], 'platform'), + groupBy( + Object.values(tripleLists).filter((k) => + SUPPORTED_PLATFORM.has(k.platform), + ), + 'platform', + ), (v) => groupBy(v, 'arch'), ) const fileContent = ` -module.exports = ${JSON.stringify(tripleLists, null, 2)} - module.exports.platformArchTriples = ${JSON.stringify(platformArchTriples)} ` writeFileSync( join(__dirname, 'triples', 'index.js'), - prettier.format(fileContent, { - semi: false, - singleQuote: true, - trailingComma: 'es5', - parser: 'typescript', - }), + esbuild.transformSync(fileContent, { + minify: true, + }).code, ) diff --git a/package.json b/package.json index 1f80c196..c54769df 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "benny": "^3.6.15", "c8": "^7.7.3", "cross-env": "^7.0.3", + "esbuild": "^0.12.15", "eslint": "^7.31.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.23.4", diff --git a/triples/README.md b/triples/README.md index 425fa24f..1c19c1ca 100644 --- a/triples/README.md +++ b/triples/README.md @@ -1,5 +1,8 @@ # `@napi-rs/triples` +[![install size](https://packagephobia.com/badge?p=@napi-rs/triples)](https://packagephobia.com/result?p=@napi-rs/triples) +[![Downloads](https://img.shields.io/npm/dm/@napi-rs/triples.svg?sanitize=true)](https://npmcharts.com/compare/@napi-rs/triples?minimal=true) + > Rust build triples definitions ## Usage diff --git a/triples/index.d.ts b/triples/index.d.ts index a6792330..cd123efd 100644 --- a/triples/index.d.ts +++ b/triples/index.d.ts @@ -6,12 +6,8 @@ interface Triple { raw: string } -declare const Triples: Triple[] & { - platformArchTriples: { - [index: string]: { - [index: string]: Triple[] - } +export const platformArchTriples: { + [index: string]: { + [index: string]: Triple[] } } - -export = Triples diff --git a/triples/index.js b/triples/index.js index 535a4ea9..64a63ab4 100644 --- a/triples/index.js +++ b/triples/index.js @@ -1,1309 +1 @@ -module.exports = { - 'aarch64-apple-darwin': { - platform: 'darwin', - arch: 'arm64', - abi: null, - platformArchABI: 'darwin-arm64', - raw: 'aarch64-apple-darwin', - }, - 'aarch64-apple-ios': { - platform: 'ios', - arch: 'arm64', - abi: null, - platformArchABI: 'ios-arm64', - raw: 'aarch64-apple-ios', - }, - 'aarch64-fuchsia': { - platform: 'fuchsia', - arch: 'arm64', - abi: null, - platformArchABI: 'fuchsia-arm64', - raw: 'aarch64-fuchsia', - }, - 'aarch64-linux-android': { - platform: 'android', - arch: 'arm64', - abi: null, - platformArchABI: 'android-arm64', - raw: 'aarch64-linux-android', - }, - 'aarch64-pc-windows-msvc': { - platform: 'win32', - arch: 'arm64', - abi: 'msvc', - platformArchABI: 'win32-arm64-msvc', - raw: 'aarch64-pc-windows-msvc', - }, - 'aarch64-unknown-linux-gnu': { - platform: 'linux', - arch: 'arm64', - abi: 'gnu', - platformArchABI: 'linux-arm64-gnu', - raw: 'aarch64-unknown-linux-gnu', - }, - 'aarch64-unknown-linux-musl': { - platform: 'linux', - arch: 'arm64', - abi: 'musl', - platformArchABI: 'linux-arm64-musl', - raw: 'aarch64-unknown-linux-musl', - }, - 'aarch64-unknown-none': { - platform: 'none', - arch: 'arm64', - abi: null, - platformArchABI: 'none-arm64', - raw: 'aarch64-unknown-none', - }, - 'aarch64-unknown-none-softfloat': { - platform: 'none', - arch: 'arm64', - abi: 'softfloat', - platformArchABI: 'none-arm64-softfloat', - raw: 'aarch64-unknown-none-softfloat', - }, - 'arm-linux-androideabi': { - platform: 'androideabi', - arch: 'arm', - abi: null, - platformArchABI: 'androideabi-arm', - raw: 'arm-linux-androideabi', - }, - 'arm-unknown-linux-gnueabi': { - platform: 'linux', - arch: 'arm', - abi: 'gnueabi', - platformArchABI: 'linux-arm-gnueabi', - raw: 'arm-unknown-linux-gnueabi', - }, - 'arm-unknown-linux-gnueabihf': { - platform: 'linux', - arch: 'arm', - abi: 'gnueabihf', - platformArchABI: 'linux-arm-gnueabihf', - raw: 'arm-unknown-linux-gnueabihf', - }, - 'arm-unknown-linux-musleabi': { - platform: 'linux', - arch: 'arm', - abi: 'musleabi', - platformArchABI: 'linux-arm-musleabi', - raw: 'arm-unknown-linux-musleabi', - }, - 'arm-unknown-linux-musleabihf': { - platform: 'linux', - arch: 'arm', - abi: 'musleabihf', - platformArchABI: 'linux-arm-musleabihf', - raw: 'arm-unknown-linux-musleabihf', - }, - 'armebv7r-none-eabi': { - platform: 'eabi', - arch: 'armebv7r', - abi: null, - platformArchABI: 'eabi-armebv7r', - raw: 'armebv7r-none-eabi', - }, - 'armebv7r-none-eabihf': { - platform: 'eabihf', - arch: 'armebv7r', - abi: null, - platformArchABI: 'eabihf-armebv7r', - raw: 'armebv7r-none-eabihf', - }, - 'armv5te-unknown-linux-gnueabi': { - platform: 'linux', - arch: 'armv5te', - abi: 'gnueabi', - platformArchABI: 'linux-armv5te-gnueabi', - raw: 'armv5te-unknown-linux-gnueabi', - }, - 'armv5te-unknown-linux-musleabi': { - platform: 'linux', - arch: 'armv5te', - abi: 'musleabi', - platformArchABI: 'linux-armv5te-musleabi', - raw: 'armv5te-unknown-linux-musleabi', - }, - 'armv7-linux-androideabi': { - platform: 'androideabi', - arch: 'arm', - abi: null, - platformArchABI: 'androideabi-arm', - raw: 'armv7-linux-androideabi', - }, - 'armv7-unknown-linux-gnueabi': { - platform: 'linux', - arch: 'arm', - abi: 'gnueabi', - platformArchABI: 'linux-arm-gnueabi', - raw: 'armv7-unknown-linux-gnueabi', - }, - 'armv7-unknown-linux-gnueabihf': { - platform: 'linux', - arch: 'arm', - abi: 'gnueabihf', - platformArchABI: 'linux-arm-gnueabihf', - raw: 'armv7-unknown-linux-gnueabihf', - }, - 'armv7-unknown-linux-musleabi': { - platform: 'linux', - arch: 'arm', - abi: 'musleabi', - platformArchABI: 'linux-arm-musleabi', - raw: 'armv7-unknown-linux-musleabi', - }, - 'armv7-unknown-linux-musleabihf': { - platform: 'linux', - arch: 'arm', - abi: 'musleabihf', - platformArchABI: 'linux-arm-musleabihf', - raw: 'armv7-unknown-linux-musleabihf', - }, - 'armv7a-none-eabi': { - platform: 'eabi', - arch: 'armv7a', - abi: null, - platformArchABI: 'eabi-armv7a', - raw: 'armv7a-none-eabi', - }, - 'armv7r-none-eabi': { - platform: 'eabi', - arch: 'armv7r', - abi: null, - platformArchABI: 'eabi-armv7r', - raw: 'armv7r-none-eabi', - }, - 'armv7r-none-eabihf': { - platform: 'eabihf', - arch: 'armv7r', - abi: null, - platformArchABI: 'eabihf-armv7r', - raw: 'armv7r-none-eabihf', - }, - 'asmjs-unknown-emscripten': { - platform: 'emscripten', - arch: 'asmjs', - abi: null, - platformArchABI: 'emscripten-asmjs', - raw: 'asmjs-unknown-emscripten', - }, - 'i586-pc-windows-msvc': { - platform: 'win32', - arch: 'i586', - abi: 'msvc', - platformArchABI: 'win32-i586-msvc', - raw: 'i586-pc-windows-msvc', - }, - 'i586-unknown-linux-gnu': { - platform: 'linux', - arch: 'i586', - abi: 'gnu', - platformArchABI: 'linux-i586-gnu', - raw: 'i586-unknown-linux-gnu', - }, - 'i586-unknown-linux-musl': { - platform: 'linux', - arch: 'i586', - abi: 'musl', - platformArchABI: 'linux-i586-musl', - raw: 'i586-unknown-linux-musl', - }, - 'i686-linux-android': { - platform: 'android', - arch: 'ia32', - abi: null, - platformArchABI: 'android-ia32', - raw: 'i686-linux-android', - }, - 'i686-pc-windows-gnu': { - platform: 'win32', - arch: 'ia32', - abi: 'gnu', - platformArchABI: 'win32-ia32-gnu', - raw: 'i686-pc-windows-gnu', - }, - 'i686-pc-windows-msvc': { - platform: 'win32', - arch: 'ia32', - abi: 'msvc', - platformArchABI: 'win32-ia32-msvc', - raw: 'i686-pc-windows-msvc', - }, - 'i686-unknown-freebsd': { - platform: 'freebsd', - arch: 'ia32', - abi: null, - platformArchABI: 'freebsd-ia32', - raw: 'i686-unknown-freebsd', - }, - 'i686-unknown-linux-gnu': { - platform: 'linux', - arch: 'ia32', - abi: 'gnu', - platformArchABI: 'linux-ia32-gnu', - raw: 'i686-unknown-linux-gnu', - }, - 'i686-unknown-linux-musl': { - platform: 'linux', - arch: 'ia32', - abi: 'musl', - platformArchABI: 'linux-ia32-musl', - raw: 'i686-unknown-linux-musl', - }, - 'mips-unknown-linux-gnu': { - platform: 'linux', - arch: 'mips', - abi: 'gnu', - platformArchABI: 'linux-mips-gnu', - raw: 'mips-unknown-linux-gnu', - }, - 'mips-unknown-linux-musl': { - platform: 'linux', - arch: 'mips', - abi: 'musl', - platformArchABI: 'linux-mips-musl', - raw: 'mips-unknown-linux-musl', - }, - 'mips64-unknown-linux-gnuabi64': { - platform: 'linux', - arch: 'mips64', - abi: 'gnuabi64', - platformArchABI: 'linux-mips64-gnuabi64', - raw: 'mips64-unknown-linux-gnuabi64', - }, - 'mips64-unknown-linux-muslabi64': { - platform: 'linux', - arch: 'mips64', - abi: 'muslabi64', - platformArchABI: 'linux-mips64-muslabi64', - raw: 'mips64-unknown-linux-muslabi64', - }, - 'mips64el-unknown-linux-gnuabi64': { - platform: 'linux', - arch: 'mips64el', - abi: 'gnuabi64', - platformArchABI: 'linux-mips64el-gnuabi64', - raw: 'mips64el-unknown-linux-gnuabi64', - }, - 'mips64el-unknown-linux-muslabi64': { - platform: 'linux', - arch: 'mips64el', - abi: 'muslabi64', - platformArchABI: 'linux-mips64el-muslabi64', - raw: 'mips64el-unknown-linux-muslabi64', - }, - 'mipsel-unknown-linux-gnu': { - platform: 'linux', - arch: 'mipsel', - abi: 'gnu', - platformArchABI: 'linux-mipsel-gnu', - raw: 'mipsel-unknown-linux-gnu', - }, - 'mipsel-unknown-linux-musl': { - platform: 'linux', - arch: 'mipsel', - abi: 'musl', - platformArchABI: 'linux-mipsel-musl', - raw: 'mipsel-unknown-linux-musl', - }, - 'nvptx64-nvidia-cuda': { - platform: 'cuda', - arch: 'nvptx64', - abi: null, - platformArchABI: 'cuda-nvptx64', - raw: 'nvptx64-nvidia-cuda', - }, - 'powerpc-unknown-linux-gnu': { - platform: 'linux', - arch: 'powerpc', - abi: 'gnu', - platformArchABI: 'linux-powerpc-gnu', - raw: 'powerpc-unknown-linux-gnu', - }, - 'powerpc64-unknown-linux-gnu': { - platform: 'linux', - arch: 'powerpc64', - abi: 'gnu', - platformArchABI: 'linux-powerpc64-gnu', - raw: 'powerpc64-unknown-linux-gnu', - }, - 'powerpc64le-unknown-linux-gnu': { - platform: 'linux', - arch: 'powerpc64le', - abi: 'gnu', - platformArchABI: 'linux-powerpc64le-gnu', - raw: 'powerpc64le-unknown-linux-gnu', - }, - 'riscv32i-unknown-none-elf': { - platform: 'none', - arch: 'riscv32i', - abi: 'elf', - platformArchABI: 'none-riscv32i-elf', - raw: 'riscv32i-unknown-none-elf', - }, - 'riscv32imac-unknown-none-elf': { - platform: 'none', - arch: 'riscv32imac', - abi: 'elf', - platformArchABI: 'none-riscv32imac-elf', - raw: 'riscv32imac-unknown-none-elf', - }, - 'riscv32imc-unknown-none-elf': { - platform: 'none', - arch: 'riscv32imc', - abi: 'elf', - platformArchABI: 'none-riscv32imc-elf', - raw: 'riscv32imc-unknown-none-elf', - }, - 'riscv64gc-unknown-linux-gnu': { - platform: 'linux', - arch: 'riscv64gc', - abi: 'gnu', - platformArchABI: 'linux-riscv64gc-gnu', - raw: 'riscv64gc-unknown-linux-gnu', - }, - 'riscv64gc-unknown-none-elf': { - platform: 'none', - arch: 'riscv64gc', - abi: 'elf', - platformArchABI: 'none-riscv64gc-elf', - raw: 'riscv64gc-unknown-none-elf', - }, - 'riscv64imac-unknown-none-elf': { - platform: 'none', - arch: 'riscv64imac', - abi: 'elf', - platformArchABI: 'none-riscv64imac-elf', - raw: 'riscv64imac-unknown-none-elf', - }, - 's390x-unknown-linux-gnu': { - platform: 'linux', - arch: 's390x', - abi: 'gnu', - platformArchABI: 'linux-s390x-gnu', - raw: 's390x-unknown-linux-gnu', - }, - 'sparc64-unknown-linux-gnu': { - platform: 'linux', - arch: 'sparc64', - abi: 'gnu', - platformArchABI: 'linux-sparc64-gnu', - raw: 'sparc64-unknown-linux-gnu', - }, - 'sparcv9-sun-solaris': { - platform: 'solaris', - arch: 'sparcv9', - abi: null, - platformArchABI: 'solaris-sparcv9', - raw: 'sparcv9-sun-solaris', - }, - 'thumbv6m-none-eabi': { - platform: 'eabi', - arch: 'thumbv6m', - abi: null, - platformArchABI: 'eabi-thumbv6m', - raw: 'thumbv6m-none-eabi', - }, - 'thumbv7em-none-eabi': { - platform: 'eabi', - arch: 'thumbv7em', - abi: null, - platformArchABI: 'eabi-thumbv7em', - raw: 'thumbv7em-none-eabi', - }, - 'thumbv7em-none-eabihf': { - platform: 'eabihf', - arch: 'thumbv7em', - abi: null, - platformArchABI: 'eabihf-thumbv7em', - raw: 'thumbv7em-none-eabihf', - }, - 'thumbv7m-none-eabi': { - platform: 'eabi', - arch: 'thumbv7m', - abi: null, - platformArchABI: 'eabi-thumbv7m', - raw: 'thumbv7m-none-eabi', - }, - 'thumbv7neon-linux-androideabi': { - platform: 'androideabi', - arch: 'thumbv7neon', - abi: null, - platformArchABI: 'androideabi-thumbv7neon', - raw: 'thumbv7neon-linux-androideabi', - }, - 'thumbv7neon-unknown-linux-gnueabihf': { - platform: 'linux', - arch: 'thumbv7neon', - abi: 'gnueabihf', - platformArchABI: 'linux-thumbv7neon-gnueabihf', - raw: 'thumbv7neon-unknown-linux-gnueabihf', - }, - 'thumbv8m.base-none-eabi': { - platform: 'eabi', - arch: 'thumbv8m.base', - abi: null, - platformArchABI: 'eabi-thumbv8m.base', - raw: 'thumbv8m.base-none-eabi', - }, - 'thumbv8m.main-none-eabi': { - platform: 'eabi', - arch: 'thumbv8m.main', - abi: null, - platformArchABI: 'eabi-thumbv8m.main', - raw: 'thumbv8m.main-none-eabi', - }, - 'thumbv8m.main-none-eabihf': { - platform: 'eabihf', - arch: 'thumbv8m.main', - abi: null, - platformArchABI: 'eabihf-thumbv8m.main', - raw: 'thumbv8m.main-none-eabihf', - }, - 'x86_64-apple-darwin': { - platform: 'darwin', - arch: 'x64', - abi: null, - platformArchABI: 'darwin-x64', - raw: 'x86_64-apple-darwin', - }, - 'x86_64-apple-ios': { - platform: 'ios', - arch: 'x64', - abi: null, - platformArchABI: 'ios-x64', - raw: 'x86_64-apple-ios', - }, - 'x86_64-fortanix-unknown-sgx': { - platform: 'unknown', - arch: 'x64', - abi: 'sgx', - platformArchABI: 'unknown-x64-sgx', - raw: 'x86_64-fortanix-unknown-sgx', - }, - 'x86_64-fuchsia': { - platform: 'fuchsia', - arch: 'x64', - abi: null, - platformArchABI: 'fuchsia-x64', - raw: 'x86_64-fuchsia', - }, - 'x86_64-linux-android': { - platform: 'android', - arch: 'x64', - abi: null, - platformArchABI: 'android-x64', - raw: 'x86_64-linux-android', - }, - 'x86_64-pc-windows-gnu': { - platform: 'win32', - arch: 'x64', - abi: 'gnu', - platformArchABI: 'win32-x64-gnu', - raw: 'x86_64-pc-windows-gnu', - }, - 'x86_64-pc-windows-msvc': { - platform: 'win32', - arch: 'x64', - abi: 'msvc', - platformArchABI: 'win32-x64-msvc', - raw: 'x86_64-pc-windows-msvc', - }, - 'x86_64-rumprun-netbsd': { - platform: 'netbsd', - arch: 'x64', - abi: null, - platformArchABI: 'netbsd-x64', - raw: 'x86_64-rumprun-netbsd', - }, - 'x86_64-sun-solaris': { - platform: 'solaris', - arch: 'x64', - abi: null, - platformArchABI: 'solaris-x64', - raw: 'x86_64-sun-solaris', - }, - 'x86_64-unknown-freebsd': { - platform: 'freebsd', - arch: 'x64', - abi: null, - platformArchABI: 'freebsd-x64', - raw: 'x86_64-unknown-freebsd', - }, - 'x86_64-unknown-illumos': { - platform: 'illumos', - arch: 'x64', - abi: null, - platformArchABI: 'illumos-x64', - raw: 'x86_64-unknown-illumos', - }, - 'x86_64-unknown-linux-gnu': { - platform: 'linux', - arch: 'x64', - abi: 'gnu', - platformArchABI: 'linux-x64-gnu', - raw: 'x86_64-unknown-linux-gnu', - }, - 'x86_64-unknown-linux-gnux32': { - platform: 'linux', - arch: 'x64', - abi: 'gnux32', - platformArchABI: 'linux-x64-gnux32', - raw: 'x86_64-unknown-linux-gnux32', - }, - 'x86_64-unknown-linux-musl': { - platform: 'linux', - arch: 'x64', - abi: 'musl', - platformArchABI: 'linux-x64-musl', - raw: 'x86_64-unknown-linux-musl', - }, - 'x86_64-unknown-netbsd': { - platform: 'netbsd', - arch: 'x64', - abi: null, - platformArchABI: 'netbsd-x64', - raw: 'x86_64-unknown-netbsd', - }, - 'x86_64-unknown-redox': { - platform: 'redox', - arch: 'x64', - abi: null, - platformArchABI: 'redox-x64', - raw: 'x86_64-unknown-redox', - }, -} - -module.exports.platformArchTriples = { - darwin: { - arm64: [ - { - platform: 'darwin', - arch: 'arm64', - abi: null, - platformArchABI: 'darwin-arm64', - raw: 'aarch64-apple-darwin', - }, - ], - x64: [ - { - platform: 'darwin', - arch: 'x64', - abi: null, - platformArchABI: 'darwin-x64', - raw: 'x86_64-apple-darwin', - }, - ], - }, - ios: { - arm64: [ - { - platform: 'ios', - arch: 'arm64', - abi: null, - platformArchABI: 'ios-arm64', - raw: 'aarch64-apple-ios', - }, - ], - x64: [ - { - platform: 'ios', - arch: 'x64', - abi: null, - platformArchABI: 'ios-x64', - raw: 'x86_64-apple-ios', - }, - ], - }, - fuchsia: { - arm64: [ - { - platform: 'fuchsia', - arch: 'arm64', - abi: null, - platformArchABI: 'fuchsia-arm64', - raw: 'aarch64-fuchsia', - }, - ], - x64: [ - { - platform: 'fuchsia', - arch: 'x64', - abi: null, - platformArchABI: 'fuchsia-x64', - raw: 'x86_64-fuchsia', - }, - ], - }, - android: { - arm64: [ - { - platform: 'android', - arch: 'arm64', - abi: null, - platformArchABI: 'android-arm64', - raw: 'aarch64-linux-android', - }, - ], - ia32: [ - { - platform: 'android', - arch: 'ia32', - abi: null, - platformArchABI: 'android-ia32', - raw: 'i686-linux-android', - }, - ], - x64: [ - { - platform: 'android', - arch: 'x64', - abi: null, - platformArchABI: 'android-x64', - raw: 'x86_64-linux-android', - }, - ], - }, - win32: { - arm64: [ - { - platform: 'win32', - arch: 'arm64', - abi: 'msvc', - platformArchABI: 'win32-arm64-msvc', - raw: 'aarch64-pc-windows-msvc', - }, - ], - i586: [ - { - platform: 'win32', - arch: 'i586', - abi: 'msvc', - platformArchABI: 'win32-i586-msvc', - raw: 'i586-pc-windows-msvc', - }, - ], - ia32: [ - { - platform: 'win32', - arch: 'ia32', - abi: 'gnu', - platformArchABI: 'win32-ia32-gnu', - raw: 'i686-pc-windows-gnu', - }, - { - platform: 'win32', - arch: 'ia32', - abi: 'msvc', - platformArchABI: 'win32-ia32-msvc', - raw: 'i686-pc-windows-msvc', - }, - ], - x64: [ - { - platform: 'win32', - arch: 'x64', - abi: 'gnu', - platformArchABI: 'win32-x64-gnu', - raw: 'x86_64-pc-windows-gnu', - }, - { - platform: 'win32', - arch: 'x64', - abi: 'msvc', - platformArchABI: 'win32-x64-msvc', - raw: 'x86_64-pc-windows-msvc', - }, - ], - }, - linux: { - arm64: [ - { - platform: 'linux', - arch: 'arm64', - abi: 'gnu', - platformArchABI: 'linux-arm64-gnu', - raw: 'aarch64-unknown-linux-gnu', - }, - { - platform: 'linux', - arch: 'arm64', - abi: 'musl', - platformArchABI: 'linux-arm64-musl', - raw: 'aarch64-unknown-linux-musl', - }, - ], - arm: [ - { - platform: 'linux', - arch: 'arm', - abi: 'gnueabi', - platformArchABI: 'linux-arm-gnueabi', - raw: 'arm-unknown-linux-gnueabi', - }, - { - platform: 'linux', - arch: 'arm', - abi: 'gnueabihf', - platformArchABI: 'linux-arm-gnueabihf', - raw: 'arm-unknown-linux-gnueabihf', - }, - { - platform: 'linux', - arch: 'arm', - abi: 'musleabi', - platformArchABI: 'linux-arm-musleabi', - raw: 'arm-unknown-linux-musleabi', - }, - { - platform: 'linux', - arch: 'arm', - abi: 'musleabihf', - platformArchABI: 'linux-arm-musleabihf', - raw: 'arm-unknown-linux-musleabihf', - }, - { - platform: 'linux', - arch: 'arm', - abi: 'gnueabi', - platformArchABI: 'linux-arm-gnueabi', - raw: 'armv7-unknown-linux-gnueabi', - }, - { - platform: 'linux', - arch: 'arm', - abi: 'gnueabihf', - platformArchABI: 'linux-arm-gnueabihf', - raw: 'armv7-unknown-linux-gnueabihf', - }, - { - platform: 'linux', - arch: 'arm', - abi: 'musleabi', - platformArchABI: 'linux-arm-musleabi', - raw: 'armv7-unknown-linux-musleabi', - }, - { - platform: 'linux', - arch: 'arm', - abi: 'musleabihf', - platformArchABI: 'linux-arm-musleabihf', - raw: 'armv7-unknown-linux-musleabihf', - }, - ], - armv5te: [ - { - platform: 'linux', - arch: 'armv5te', - abi: 'gnueabi', - platformArchABI: 'linux-armv5te-gnueabi', - raw: 'armv5te-unknown-linux-gnueabi', - }, - { - platform: 'linux', - arch: 'armv5te', - abi: 'musleabi', - platformArchABI: 'linux-armv5te-musleabi', - raw: 'armv5te-unknown-linux-musleabi', - }, - ], - i586: [ - { - platform: 'linux', - arch: 'i586', - abi: 'gnu', - platformArchABI: 'linux-i586-gnu', - raw: 'i586-unknown-linux-gnu', - }, - { - platform: 'linux', - arch: 'i586', - abi: 'musl', - platformArchABI: 'linux-i586-musl', - raw: 'i586-unknown-linux-musl', - }, - ], - ia32: [ - { - platform: 'linux', - arch: 'ia32', - abi: 'gnu', - platformArchABI: 'linux-ia32-gnu', - raw: 'i686-unknown-linux-gnu', - }, - { - platform: 'linux', - arch: 'ia32', - abi: 'musl', - platformArchABI: 'linux-ia32-musl', - raw: 'i686-unknown-linux-musl', - }, - ], - mips: [ - { - platform: 'linux', - arch: 'mips', - abi: 'gnu', - platformArchABI: 'linux-mips-gnu', - raw: 'mips-unknown-linux-gnu', - }, - { - platform: 'linux', - arch: 'mips', - abi: 'musl', - platformArchABI: 'linux-mips-musl', - raw: 'mips-unknown-linux-musl', - }, - ], - mips64: [ - { - platform: 'linux', - arch: 'mips64', - abi: 'gnuabi64', - platformArchABI: 'linux-mips64-gnuabi64', - raw: 'mips64-unknown-linux-gnuabi64', - }, - { - platform: 'linux', - arch: 'mips64', - abi: 'muslabi64', - platformArchABI: 'linux-mips64-muslabi64', - raw: 'mips64-unknown-linux-muslabi64', - }, - ], - mips64el: [ - { - platform: 'linux', - arch: 'mips64el', - abi: 'gnuabi64', - platformArchABI: 'linux-mips64el-gnuabi64', - raw: 'mips64el-unknown-linux-gnuabi64', - }, - { - platform: 'linux', - arch: 'mips64el', - abi: 'muslabi64', - platformArchABI: 'linux-mips64el-muslabi64', - raw: 'mips64el-unknown-linux-muslabi64', - }, - ], - mipsel: [ - { - platform: 'linux', - arch: 'mipsel', - abi: 'gnu', - platformArchABI: 'linux-mipsel-gnu', - raw: 'mipsel-unknown-linux-gnu', - }, - { - platform: 'linux', - arch: 'mipsel', - abi: 'musl', - platformArchABI: 'linux-mipsel-musl', - raw: 'mipsel-unknown-linux-musl', - }, - ], - powerpc: [ - { - platform: 'linux', - arch: 'powerpc', - abi: 'gnu', - platformArchABI: 'linux-powerpc-gnu', - raw: 'powerpc-unknown-linux-gnu', - }, - ], - powerpc64: [ - { - platform: 'linux', - arch: 'powerpc64', - abi: 'gnu', - platformArchABI: 'linux-powerpc64-gnu', - raw: 'powerpc64-unknown-linux-gnu', - }, - ], - powerpc64le: [ - { - platform: 'linux', - arch: 'powerpc64le', - abi: 'gnu', - platformArchABI: 'linux-powerpc64le-gnu', - raw: 'powerpc64le-unknown-linux-gnu', - }, - ], - riscv64gc: [ - { - platform: 'linux', - arch: 'riscv64gc', - abi: 'gnu', - platformArchABI: 'linux-riscv64gc-gnu', - raw: 'riscv64gc-unknown-linux-gnu', - }, - ], - s390x: [ - { - platform: 'linux', - arch: 's390x', - abi: 'gnu', - platformArchABI: 'linux-s390x-gnu', - raw: 's390x-unknown-linux-gnu', - }, - ], - sparc64: [ - { - platform: 'linux', - arch: 'sparc64', - abi: 'gnu', - platformArchABI: 'linux-sparc64-gnu', - raw: 'sparc64-unknown-linux-gnu', - }, - ], - thumbv7neon: [ - { - platform: 'linux', - arch: 'thumbv7neon', - abi: 'gnueabihf', - platformArchABI: 'linux-thumbv7neon-gnueabihf', - raw: 'thumbv7neon-unknown-linux-gnueabihf', - }, - ], - x64: [ - { - platform: 'linux', - arch: 'x64', - abi: 'gnu', - platformArchABI: 'linux-x64-gnu', - raw: 'x86_64-unknown-linux-gnu', - }, - { - platform: 'linux', - arch: 'x64', - abi: 'gnux32', - platformArchABI: 'linux-x64-gnux32', - raw: 'x86_64-unknown-linux-gnux32', - }, - { - platform: 'linux', - arch: 'x64', - abi: 'musl', - platformArchABI: 'linux-x64-musl', - raw: 'x86_64-unknown-linux-musl', - }, - ], - }, - none: { - arm64: [ - { - platform: 'none', - arch: 'arm64', - abi: null, - platformArchABI: 'none-arm64', - raw: 'aarch64-unknown-none', - }, - { - platform: 'none', - arch: 'arm64', - abi: 'softfloat', - platformArchABI: 'none-arm64-softfloat', - raw: 'aarch64-unknown-none-softfloat', - }, - ], - riscv32i: [ - { - platform: 'none', - arch: 'riscv32i', - abi: 'elf', - platformArchABI: 'none-riscv32i-elf', - raw: 'riscv32i-unknown-none-elf', - }, - ], - riscv32imac: [ - { - platform: 'none', - arch: 'riscv32imac', - abi: 'elf', - platformArchABI: 'none-riscv32imac-elf', - raw: 'riscv32imac-unknown-none-elf', - }, - ], - riscv32imc: [ - { - platform: 'none', - arch: 'riscv32imc', - abi: 'elf', - platformArchABI: 'none-riscv32imc-elf', - raw: 'riscv32imc-unknown-none-elf', - }, - ], - riscv64gc: [ - { - platform: 'none', - arch: 'riscv64gc', - abi: 'elf', - platformArchABI: 'none-riscv64gc-elf', - raw: 'riscv64gc-unknown-none-elf', - }, - ], - riscv64imac: [ - { - platform: 'none', - arch: 'riscv64imac', - abi: 'elf', - platformArchABI: 'none-riscv64imac-elf', - raw: 'riscv64imac-unknown-none-elf', - }, - ], - }, - androideabi: { - arm: [ - { - platform: 'androideabi', - arch: 'arm', - abi: null, - platformArchABI: 'androideabi-arm', - raw: 'arm-linux-androideabi', - }, - { - platform: 'androideabi', - arch: 'arm', - abi: null, - platformArchABI: 'androideabi-arm', - raw: 'armv7-linux-androideabi', - }, - ], - thumbv7neon: [ - { - platform: 'androideabi', - arch: 'thumbv7neon', - abi: null, - platformArchABI: 'androideabi-thumbv7neon', - raw: 'thumbv7neon-linux-androideabi', - }, - ], - }, - eabi: { - armebv7r: [ - { - platform: 'eabi', - arch: 'armebv7r', - abi: null, - platformArchABI: 'eabi-armebv7r', - raw: 'armebv7r-none-eabi', - }, - ], - armv7a: [ - { - platform: 'eabi', - arch: 'armv7a', - abi: null, - platformArchABI: 'eabi-armv7a', - raw: 'armv7a-none-eabi', - }, - ], - armv7r: [ - { - platform: 'eabi', - arch: 'armv7r', - abi: null, - platformArchABI: 'eabi-armv7r', - raw: 'armv7r-none-eabi', - }, - ], - thumbv6m: [ - { - platform: 'eabi', - arch: 'thumbv6m', - abi: null, - platformArchABI: 'eabi-thumbv6m', - raw: 'thumbv6m-none-eabi', - }, - ], - thumbv7em: [ - { - platform: 'eabi', - arch: 'thumbv7em', - abi: null, - platformArchABI: 'eabi-thumbv7em', - raw: 'thumbv7em-none-eabi', - }, - ], - thumbv7m: [ - { - platform: 'eabi', - arch: 'thumbv7m', - abi: null, - platformArchABI: 'eabi-thumbv7m', - raw: 'thumbv7m-none-eabi', - }, - ], - 'thumbv8m.base': [ - { - platform: 'eabi', - arch: 'thumbv8m.base', - abi: null, - platformArchABI: 'eabi-thumbv8m.base', - raw: 'thumbv8m.base-none-eabi', - }, - ], - 'thumbv8m.main': [ - { - platform: 'eabi', - arch: 'thumbv8m.main', - abi: null, - platformArchABI: 'eabi-thumbv8m.main', - raw: 'thumbv8m.main-none-eabi', - }, - ], - }, - eabihf: { - armebv7r: [ - { - platform: 'eabihf', - arch: 'armebv7r', - abi: null, - platformArchABI: 'eabihf-armebv7r', - raw: 'armebv7r-none-eabihf', - }, - ], - armv7r: [ - { - platform: 'eabihf', - arch: 'armv7r', - abi: null, - platformArchABI: 'eabihf-armv7r', - raw: 'armv7r-none-eabihf', - }, - ], - thumbv7em: [ - { - platform: 'eabihf', - arch: 'thumbv7em', - abi: null, - platformArchABI: 'eabihf-thumbv7em', - raw: 'thumbv7em-none-eabihf', - }, - ], - 'thumbv8m.main': [ - { - platform: 'eabihf', - arch: 'thumbv8m.main', - abi: null, - platformArchABI: 'eabihf-thumbv8m.main', - raw: 'thumbv8m.main-none-eabihf', - }, - ], - }, - emscripten: { - asmjs: [ - { - platform: 'emscripten', - arch: 'asmjs', - abi: null, - platformArchABI: 'emscripten-asmjs', - raw: 'asmjs-unknown-emscripten', - }, - ], - }, - freebsd: { - ia32: [ - { - platform: 'freebsd', - arch: 'ia32', - abi: null, - platformArchABI: 'freebsd-ia32', - raw: 'i686-unknown-freebsd', - }, - ], - x64: [ - { - platform: 'freebsd', - arch: 'x64', - abi: null, - platformArchABI: 'freebsd-x64', - raw: 'x86_64-unknown-freebsd', - }, - ], - }, - cuda: { - nvptx64: [ - { - platform: 'cuda', - arch: 'nvptx64', - abi: null, - platformArchABI: 'cuda-nvptx64', - raw: 'nvptx64-nvidia-cuda', - }, - ], - }, - solaris: { - sparcv9: [ - { - platform: 'solaris', - arch: 'sparcv9', - abi: null, - platformArchABI: 'solaris-sparcv9', - raw: 'sparcv9-sun-solaris', - }, - ], - x64: [ - { - platform: 'solaris', - arch: 'x64', - abi: null, - platformArchABI: 'solaris-x64', - raw: 'x86_64-sun-solaris', - }, - ], - }, - unknown: { - x64: [ - { - platform: 'unknown', - arch: 'x64', - abi: 'sgx', - platformArchABI: 'unknown-x64-sgx', - raw: 'x86_64-fortanix-unknown-sgx', - }, - ], - }, - netbsd: { - x64: [ - { - platform: 'netbsd', - arch: 'x64', - abi: null, - platformArchABI: 'netbsd-x64', - raw: 'x86_64-rumprun-netbsd', - }, - { - platform: 'netbsd', - arch: 'x64', - abi: null, - platformArchABI: 'netbsd-x64', - raw: 'x86_64-unknown-netbsd', - }, - ], - }, - illumos: { - x64: [ - { - platform: 'illumos', - arch: 'x64', - abi: null, - platformArchABI: 'illumos-x64', - raw: 'x86_64-unknown-illumos', - }, - ], - }, - redox: { - x64: [ - { - platform: 'redox', - arch: 'x64', - abi: null, - platformArchABI: 'redox-x64', - raw: 'x86_64-unknown-redox', - }, - ], - }, -} +module.exports.platformArchTriples={darwin:{arm64:[{platform:"darwin",arch:"arm64",abi:null,platformArchABI:"darwin-arm64",raw:"aarch64-apple-darwin"}],x64:[{platform:"darwin",arch:"x64",abi:null,platformArchABI:"darwin-x64",raw:"x86_64-apple-darwin"}]},ios:{arm64:[{platform:"ios",arch:"arm64",abi:null,platformArchABI:"ios-arm64",raw:"aarch64-apple-ios"}],x64:[{platform:"ios",arch:"x64",abi:null,platformArchABI:"ios-x64",raw:"x86_64-apple-ios"}]},android:{arm64:[{platform:"android",arch:"arm64",abi:null,platformArchABI:"android-arm64",raw:"aarch64-linux-android"}],ia32:[{platform:"android",arch:"ia32",abi:null,platformArchABI:"android-ia32",raw:"i686-linux-android"}],x64:[{platform:"android",arch:"x64",abi:null,platformArchABI:"android-x64",raw:"x86_64-linux-android"}]},win32:{arm64:[{platform:"win32",arch:"arm64",abi:"msvc",platformArchABI:"win32-arm64-msvc",raw:"aarch64-pc-windows-msvc"}],i586:[{platform:"win32",arch:"i586",abi:"msvc",platformArchABI:"win32-i586-msvc",raw:"i586-pc-windows-msvc"}],ia32:[{platform:"win32",arch:"ia32",abi:"gnu",platformArchABI:"win32-ia32-gnu",raw:"i686-pc-windows-gnu"},{platform:"win32",arch:"ia32",abi:"msvc",platformArchABI:"win32-ia32-msvc",raw:"i686-pc-windows-msvc"}],x64:[{platform:"win32",arch:"x64",abi:"gnu",platformArchABI:"win32-x64-gnu",raw:"x86_64-pc-windows-gnu"},{platform:"win32",arch:"x64",abi:"msvc",platformArchABI:"win32-x64-msvc",raw:"x86_64-pc-windows-msvc"}]},linux:{arm64:[{platform:"linux",arch:"arm64",abi:"gnu",platformArchABI:"linux-arm64-gnu",raw:"aarch64-unknown-linux-gnu"},{platform:"linux",arch:"arm64",abi:"musl",platformArchABI:"linux-arm64-musl",raw:"aarch64-unknown-linux-musl"}],arm:[{platform:"linux",arch:"arm",abi:"gnueabi",platformArchABI:"linux-arm-gnueabi",raw:"arm-unknown-linux-gnueabi"},{platform:"linux",arch:"arm",abi:"gnueabihf",platformArchABI:"linux-arm-gnueabihf",raw:"arm-unknown-linux-gnueabihf"},{platform:"linux",arch:"arm",abi:"musleabi",platformArchABI:"linux-arm-musleabi",raw:"arm-unknown-linux-musleabi"},{platform:"linux",arch:"arm",abi:"musleabihf",platformArchABI:"linux-arm-musleabihf",raw:"arm-unknown-linux-musleabihf"},{platform:"linux",arch:"arm",abi:"gnueabi",platformArchABI:"linux-arm-gnueabi",raw:"armv7-unknown-linux-gnueabi"},{platform:"linux",arch:"arm",abi:"gnueabihf",platformArchABI:"linux-arm-gnueabihf",raw:"armv7-unknown-linux-gnueabihf"},{platform:"linux",arch:"arm",abi:"musleabi",platformArchABI:"linux-arm-musleabi",raw:"armv7-unknown-linux-musleabi"},{platform:"linux",arch:"arm",abi:"musleabihf",platformArchABI:"linux-arm-musleabihf",raw:"armv7-unknown-linux-musleabihf"}],armv5te:[{platform:"linux",arch:"armv5te",abi:"gnueabi",platformArchABI:"linux-armv5te-gnueabi",raw:"armv5te-unknown-linux-gnueabi"},{platform:"linux",arch:"armv5te",abi:"musleabi",platformArchABI:"linux-armv5te-musleabi",raw:"armv5te-unknown-linux-musleabi"}],i586:[{platform:"linux",arch:"i586",abi:"gnu",platformArchABI:"linux-i586-gnu",raw:"i586-unknown-linux-gnu"},{platform:"linux",arch:"i586",abi:"musl",platformArchABI:"linux-i586-musl",raw:"i586-unknown-linux-musl"}],ia32:[{platform:"linux",arch:"ia32",abi:"gnu",platformArchABI:"linux-ia32-gnu",raw:"i686-unknown-linux-gnu"},{platform:"linux",arch:"ia32",abi:"musl",platformArchABI:"linux-ia32-musl",raw:"i686-unknown-linux-musl"}],mips:[{platform:"linux",arch:"mips",abi:"gnu",platformArchABI:"linux-mips-gnu",raw:"mips-unknown-linux-gnu"},{platform:"linux",arch:"mips",abi:"musl",platformArchABI:"linux-mips-musl",raw:"mips-unknown-linux-musl"}],mips64:[{platform:"linux",arch:"mips64",abi:"gnuabi64",platformArchABI:"linux-mips64-gnuabi64",raw:"mips64-unknown-linux-gnuabi64"},{platform:"linux",arch:"mips64",abi:"muslabi64",platformArchABI:"linux-mips64-muslabi64",raw:"mips64-unknown-linux-muslabi64"}],mips64el:[{platform:"linux",arch:"mips64el",abi:"gnuabi64",platformArchABI:"linux-mips64el-gnuabi64",raw:"mips64el-unknown-linux-gnuabi64"},{platform:"linux",arch:"mips64el",abi:"muslabi64",platformArchABI:"linux-mips64el-muslabi64",raw:"mips64el-unknown-linux-muslabi64"}],mipsel:[{platform:"linux",arch:"mipsel",abi:"gnu",platformArchABI:"linux-mipsel-gnu",raw:"mipsel-unknown-linux-gnu"},{platform:"linux",arch:"mipsel",abi:"musl",platformArchABI:"linux-mipsel-musl",raw:"mipsel-unknown-linux-musl"}],powerpc:[{platform:"linux",arch:"powerpc",abi:"gnu",platformArchABI:"linux-powerpc-gnu",raw:"powerpc-unknown-linux-gnu"}],powerpc64:[{platform:"linux",arch:"powerpc64",abi:"gnu",platformArchABI:"linux-powerpc64-gnu",raw:"powerpc64-unknown-linux-gnu"}],powerpc64le:[{platform:"linux",arch:"powerpc64le",abi:"gnu",platformArchABI:"linux-powerpc64le-gnu",raw:"powerpc64le-unknown-linux-gnu"}],riscv64gc:[{platform:"linux",arch:"riscv64gc",abi:"gnu",platformArchABI:"linux-riscv64gc-gnu",raw:"riscv64gc-unknown-linux-gnu"}],s390x:[{platform:"linux",arch:"s390x",abi:"gnu",platformArchABI:"linux-s390x-gnu",raw:"s390x-unknown-linux-gnu"}],sparc64:[{platform:"linux",arch:"sparc64",abi:"gnu",platformArchABI:"linux-sparc64-gnu",raw:"sparc64-unknown-linux-gnu"}],thumbv7neon:[{platform:"linux",arch:"thumbv7neon",abi:"gnueabihf",platformArchABI:"linux-thumbv7neon-gnueabihf",raw:"thumbv7neon-unknown-linux-gnueabihf"}],x64:[{platform:"linux",arch:"x64",abi:"gnu",platformArchABI:"linux-x64-gnu",raw:"x86_64-unknown-linux-gnu"},{platform:"linux",arch:"x64",abi:"gnux32",platformArchABI:"linux-x64-gnux32",raw:"x86_64-unknown-linux-gnux32"},{platform:"linux",arch:"x64",abi:"musl",platformArchABI:"linux-x64-musl",raw:"x86_64-unknown-linux-musl"}]},freebsd:{ia32:[{platform:"freebsd",arch:"ia32",abi:null,platformArchABI:"freebsd-ia32",raw:"i686-unknown-freebsd"}],x64:[{platform:"freebsd",arch:"x64",abi:null,platformArchABI:"freebsd-x64",raw:"x86_64-unknown-freebsd"}]}}; diff --git a/triples/package.json b/triples/package.json index c77a2bc7..fb747d54 100644 --- a/triples/package.json +++ b/triples/package.json @@ -12,7 +12,7 @@ "registry": "https://registry.npmjs.org/", "access": "public" }, - "files": ["index.js", "index.d.ts", "target-list"], + "files": ["index.js", "index.d.ts"], "repository": { "type": "git", "url": "git+https://github.com/napi-rs/napi-rs.git" diff --git a/triples/target-list b/triples/target-list index 23836e7b..c0f4dfab 100644 --- a/triples/target-list +++ b/triples/target-list @@ -72,9 +72,9 @@ x86_64-apple-ios x86_64-fortanix-unknown-sgx x86_64-fuchsia x86_64-linux-android +x86_64-pc-solaris x86_64-pc-windows-gnu x86_64-pc-windows-msvc -x86_64-rumprun-netbsd x86_64-sun-solaris x86_64-unknown-freebsd x86_64-unknown-illumos diff --git a/yarn.lock b/yarn.lock index b7b93430..aee94c08 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2604,6 +2604,11 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" +esbuild@^0.12.15: + version "0.12.15" + resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.12.15.tgz#9d99cf39aeb2188265c5983e983e236829f08af0" + integrity sha512-72V4JNd2+48eOVCXx49xoSWHgC3/cCy96e7mbXKY+WOWghN00cCmlGnwVLRhRHorvv0dgCyuMYBZlM2xDM5OQw== + escalade@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -4441,6 +4446,7 @@ minipass-fetch@^1.3.0, minipass-fetch@^1.3.2: resolved "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.3.3.tgz#34c7cea038c817a8658461bf35174551dce17a0a" integrity sha512-akCrLDWfbdAWkMLBxJEeWTdNsjML+dt5YgOI4gJ53vuO0vrmYQkUPxa6j6V65s9CcePIr2SSWqjT2EcrNseryQ== dependencies: + encoding "^0.1.12" minipass "^3.1.0" minipass-sized "^1.0.3" minizlib "^2.0.0"