diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5f5d011 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,213 @@ +name: Release NPM Package + +on: + - push +# on: +# push: +# branches: +# - main +# paths: +# - npm/sovra/package.json # Please only commit this file, so we don't need to wait for test CI to pass. + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +jobs: + # check: + # name: Check version + # runs-on: ubuntu-latest + # outputs: + # version: ${{ env.version }} + # version_changed: ${{ steps.version.outputs.changed }} + # steps: + # - uses: actions/checkout@v4 + + # - name: Check version changes + # uses: EndBug/version-check@v2 + # id: version + # with: + # static-checking: localIsNew + # file-url: https://unpkg.com/sovra@latest/package.json + # file-name: npm/sovra/package.json + + # - name: Set version name + # if: steps.version.outputs.changed == 'true' + # run: | + # echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})" + # echo "version=${{ steps.version.outputs.version }}" >> $GITHUB_ENV + + build: + # needs: check + # if: needs.check.outputs.version_changed == 'true' + # env: + # version: ${{ needs.check.outputs.version }} + # outputs: + # version: ${{ env.version }} + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + target: x86_64-pc-windows-msvc + code-target: win32-x64-msvc + + - os: windows-latest + target: aarch64-pc-windows-msvc + code-target: win32-arm64-msvc + + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + code-target: linux-x64-gnu + + - os: ubuntu-latest + target: aarch64-unknown-linux-gnu + code-target: linux-arm64-gnu + + - os: ubuntu-latest + target: x86_64-unknown-linux-musl + code-target: linux-x64-musl + + - os: ubuntu-latest + target: aarch64-unknown-linux-musl + code-target: linux-arm64-musl + + - os: macos-13 + target: x86_64-apple-darwin + code-target: darwin-x64 + + - os: macos-14 # M1 + target: aarch64-apple-darwin + code-target: darwin-arm64 + + name: Package ${{ matrix.target }} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - name: Setup + uses: ./.github/actions/setup + + ### install musl dependencies ### + # + - uses: mlugg/setup-zig@v1 + if: ${{ contains(matrix.target, 'musl') }} + with: + version: 0.11.0 + + - name: Install cargo-zigbuild + if: ${{ contains(matrix.target, 'musl') }} + uses: taiki-e/install-action@v2 + with: + tool: cargo-zigbuild + + ### install non-musl dependencies ### + + - name: Install cross + if: ${{ !contains(matrix.target, 'musl') }} + uses: taiki-e/install-action@cross + + ### Build + + - name: Add Rust Target + run: rustup target add ${{ matrix.target }} + + - name: Build with cross + if: ${{ !contains(matrix.target, 'musl') }} + run: cross build --release -p sovra_napi --target=${{ matrix.target }} + + - name: Build with zig + if: ${{ contains(matrix.target, 'musl') }} + env: + RUSTFLAGS: "-C target-feature=-crt-static" + run: cargo zigbuild --release -p sovra_napi --target=${{ matrix.target }} + + ### Build Done + + - name: Move file on ${{ matrix.os }} + run: | + shopt -s extglob + ls target/${{ matrix.target }}/release/*.@(so|dll|dylib) + mv target/${{ matrix.target }}/release/*.@(so|dll|dylib) napi/sovra.${{ matrix.code-target }}.node + ls napi + + - name: Test + working-directory: napi + if: ${{ contains(matrix.target, 'x86') && !contains(matrix.target, 'musl') }} # Need docker for aarch64 + run: node test/sanity.spec.mjs + + # The binary is zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss + - name: Archive Binary + if: runner.os == 'Windows' + run: 7z a ${{ matrix.code-target }}.zip napi/sovra.${{ matrix.code-target }}.node + + # The binary is zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss + - name: Archive Binary + if: runner.os != 'Windows' + run: tar czf ${{ matrix.code-target }}.tar.gz napi/sovra.${{ matrix.code-target }}.node + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + name: binaries-${{ matrix.code-target }} + path: | + *.zip + *.tar.gz + + publish: + name: Publish NAPI + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + needs: + - build + steps: + - uses: actions/checkout@v4 + + - name: Setup + uses: ./.github/actions/setup + + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + merge-multiple: true + + - name: Unzip + uses: montudor/action-zip@v1 + with: + args: unzip -qq *.zip -d . + + - name: Untar + run: ls *.gz | xargs -i tar xvf {} + + - name: Generate npm packages + run: | + ls + ls napi + node npm/sovra/scripts/generate-packages.mjs + cat npm/sovra/package.json + for package in npm/sovra* + do + ls $package + cat $package/package.json + echo '----' + done + + - name: Publish npm packages + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + # NOTE: The trailing slash on $package/ changes it to publishing the directory + run: | + # publish subpackages first + for package in npm/sovra-* + do + npm publish $package/ --provenance --access public + done + # publish root package last + npm publish npm/sovra/ --provenance --access public diff --git a/.gitignore b/.gitignore index 9a89f55..994fe9f 100644 --- a/.gitignore +++ b/.gitignore @@ -23,11 +23,8 @@ Cargo.lock node_modules !/fixtures/modules/node_modules -/npm/* -!/npm/package.json +/npm/*/* +!/npm/sovra/scripts +!/npm/sovra/package.json -/napi/* -!/napi/src -!/napi/test -!/napi/*.rs -!/napi/Cargo.toml +/napi/*.node diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..ae64359 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +//registry.npmjs.org/:_authToken=${NPM_TOKEN} diff --git a/napi/index.d.ts b/napi/index.d.ts new file mode 100644 index 0000000..a5947bd --- /dev/null +++ b/napi/index.d.ts @@ -0,0 +1,194 @@ +/* auto-generated by NAPI-RS */ +/* eslint-disable */ +export interface AffectedResult { + files: Array + errors: Array +} + +export declare function getAffected(testFiles: Array, changedFiles: Array, resolveOptions: NapiResolveOptions): AffectedResult + +/** + * Module Resolution Options + * + * Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). + * + * See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples + */ +export interface NapiResolveOptions { + /** + * Path to TypeScript configuration file. + * + * Default `None` + */ + tsconfig?: TsconfigOptions + /** + * Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. + * + * For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> + * AliasValue::Path(String)` + * Create aliases to import or require certain modules more easily. + * A trailing $ can also be added to the given object's keys to signify an exact match. + */ + alias?: Record> + /** + * A list of alias fields in description files. + * Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). + * Can be a path to json object such as `["path", "to", "exports"]`. + * + * Default `[]` + */ + aliasFields?: (string | string[])[] + /** + * Condition names for exports field which defines entry points of a package. + * The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. + * + * Default `[]` + */ + conditionNames?: Array + /** + * The JSON files to use for descriptions. (There was once a `bower.json`.) + * + * Default `["package.json"]` + */ + descriptionFiles?: Array + /** + * A list of exports fields in description files. + * Can be a path to json object such as `["path", "to", "exports"]`. + * + * Default `[["exports"]]`. + */ + exportsFields?: (string | string[])[] + /** + * Fields from `package.json` which are used to provide the internal requests of a package + * (requests starting with # are considered internal). + * + * Can be a path to a JSON object such as `["path", "to", "imports"]`. + * + * Default `[["imports"]]`. + */ + importsFields?: (string | string[])[] + /** + * An object which maps extension to extension aliases. + * + * Default `{}` + */ + extensionAlias?: Record> + /** + * Attempt to resolve these extensions in order. + * If multiple files share the same name but have different extensions, + * will resolve the one with the extension listed first in the array and skip the rest. + * + * Default `[".js", ".json", ".node"]` + */ + extensions?: Array + /** + * Redirect module requests when normal resolving fails. + * + * Default `[]` + */ + fallback?: Record> + /** + * Request passed to resolve is already fully specified and extensions or main files are not resolved for it (they are still resolved for internal requests). + * + * See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) + * + * Default `false` + */ + fullySpecified?: boolean + /** + * A list of main fields in description files + * + * Default `["main"]`. + */ + mainFields?: string | string[] + /** + * The filename to be used while resolving directories. + * + * Default `["index"]` + */ + mainFiles?: Array + /** + * A list of directories to resolve modules from, can be absolute path or folder name. + * + * Default `["node_modules"]` + */ + modules?: string | string[] + /** + * Resolve to a context instead of a file. + * + * Default `false` + */ + resolveToContext?: boolean + /** + * Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. + * + * Default `false` + */ + preferRelative?: boolean + /** + * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. + * + * Default `false` + */ + preferAbsolute?: boolean + /** + * A list of resolve restrictions to restrict the paths that a request can be resolved on. + * + * Default `[]` + */ + restrictions?: Array + /** + * A list of directories where requests of server-relative URLs (starting with '/') are resolved. + * On non-Windows systems these requests are resolved as an absolute path first. + * + * Default `[]` + */ + roots?: Array + /** + * Whether to resolve symlinks to their symlinked location. + * When enabled, symlinked resources are resolved to their real path, not their symlinked location. + * Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). + * + * Default `true` + */ + symlinks?: boolean + /** + * Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. + * For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. + * + * Default `false` + */ + builtinModules?: boolean +} + +/** + * Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. + * Use struct because napi don't support structured union now + */ +export interface Restriction { + path?: string + regex?: string +} + +/** + * Tsconfig Options + * + * Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) + */ +export interface TsconfigOptions { + /** + * Allows you to specify where to find the TypeScript configuration file. + * You may provide + * * a relative path to the configuration file. It will be resolved relative to cwd. + * * an absolute path to the configuration file. + */ + configFile: string + /** + * Support for Typescript Project References. + * + * * `'auto'`: use the `references` field from tsconfig of `config_file`. + * * `string[]`: manually provided relative or absolute path. + */ + references?: 'auto' | string[] +} + diff --git a/napi/index.js b/napi/index.js new file mode 100644 index 0000000..8a8010b --- /dev/null +++ b/napi/index.js @@ -0,0 +1,364 @@ +// prettier-ignore +/* eslint-disable */ +/* auto-generated by NAPI-RS */ + +const { readFileSync } = require('fs') + +let nativeBinding = null +const loadErrors = [] + +const isMusl = () => { + let musl = false + if (process.platform === 'linux') { + musl = isMuslFromFilesystem() + if (musl === null) { + musl = isMuslFromReport() + } + if (musl === null) { + musl = isMuslFromChildProcess() + } + } + return musl +} + +const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-') + +const isMuslFromFilesystem = () => { + try { + return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl') + } catch { + return null + } +} + +const isMuslFromReport = () => { + const report = typeof process.report.getReport === 'function' ? process.report.getReport() : null + if (!report) { + return null + } + if (report.header && report.header.glibcVersionRuntime) { + return false + } + if (Array.isArray(report.sharedObjects)) { + if (report.sharedObjects.some(isFileMusl)) { + return true + } + } + return false +} + +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.platform === 'android') { + if (process.arch === 'arm64') { + try { + return require('./sovra.android-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-android-arm64') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'arm') { + try { + return require('./sovra.android-arm-eabi.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-android-arm-eabi') + } 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') { + try { + return require('./sovra.win32-x64-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-win32-x64-msvc') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'ia32') { + try { + return require('./sovra.win32-ia32-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-win32-ia32-msvc') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'arm64') { + try { + return require('./sovra.win32-arm64-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-win32-arm64-msvc') + } catch (e) { + loadErrors.push(e) + } + + } else { + loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`)) + } + } else if (process.platform === 'darwin') { + try { + return require('./sovra.darwin-universal.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-darwin-universal') + } catch (e) { + loadErrors.push(e) + } + + if (process.arch === 'x64') { + try { + return require('./sovra.darwin-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-darwin-x64') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'arm64') { + try { + return require('./sovra.darwin-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-darwin-arm64') + } 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('./sovra.freebsd-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-freebsd-x64') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'arm64') { + try { + return require('./sovra.freebsd-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-freebsd-arm64') + } 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('./sovra.linux-x64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-linux-x64-musl') + } catch (e) { + loadErrors.push(e) + } + + } else { + try { + return require('./sovra.linux-x64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-linux-x64-gnu') + } catch (e) { + loadErrors.push(e) + } + + } + } else if (process.arch === 'arm64') { + if (isMusl()) { + try { + return require('./sovra.linux-arm64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-linux-arm64-musl') + } catch (e) { + loadErrors.push(e) + } + + } else { + try { + return require('./sovra.linux-arm64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-linux-arm64-gnu') + } catch (e) { + loadErrors.push(e) + } + + } + } else if (process.arch === 'arm') { + if (isMusl()) { + try { + return require('./sovra.linux-arm-musleabihf.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-linux-arm-musleabihf') + } catch (e) { + loadErrors.push(e) + } + + } else { + try { + return require('./sovra.linux-arm-gnueabihf.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-linux-arm-gnueabihf') + } catch (e) { + loadErrors.push(e) + } + + } + } else if (process.arch === 'riscv64') { + if (isMusl()) { + try { + return require('./sovra.linux-riscv64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-linux-riscv64-musl') + } catch (e) { + loadErrors.push(e) + } + + } else { + try { + return require('./sovra.linux-riscv64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-linux-riscv64-gnu') + } catch (e) { + loadErrors.push(e) + } + + } + } else if (process.arch === 'ppc64') { + try { + return require('./sovra.linux-ppc64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-linux-ppc64-gnu') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 's390x') { + try { + return require('./sovra.linux-s390x-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@sovra/binding-linux-s390x-gnu') + } catch (e) { + loadErrors.push(e) + } + + } else { + loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`)) + } + } else { + loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`)) + } +} + +nativeBinding = requireNative() + +if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { + try { + nativeBinding = require('./sovra.wasi.cjs') + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + loadErrors.push(err) + } + } + if (!nativeBinding) { + try { + nativeBinding = require('@sovra/binding-wasm32-wasi') + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + loadErrors.push(err) + } + } + } +} + +if (!nativeBinding) { + 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(`Failed to load native binding`) +} + +module.exports.getAffected = nativeBinding.getAffected diff --git a/npm/package.json b/npm/sovra/package.json similarity index 93% rename from npm/package.json rename to npm/sovra/package.json index e2bd251..50d60e8 100644 --- a/npm/package.json +++ b/npm/sovra/package.json @@ -29,8 +29,7 @@ "aarch64-unknown-linux-musl", "armv7-unknown-linux-gnueabihf", "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" + "aarch64-apple-darwin" ] }, "funding": { diff --git a/npm/sovra/scripts/generate-packages.mjs b/npm/sovra/scripts/generate-packages.mjs new file mode 100644 index 0000000..3869abc --- /dev/null +++ b/npm/sovra/scripts/generate-packages.mjs @@ -0,0 +1,121 @@ +// Code copied from [Oxc](https://github.com/oxc-project/oxc/blob/main/npm/oxc-parser/scripts/generate-packages.mjs) + +import * as fs from "node:fs"; +import { resolve } from "node:path"; +import { fileURLToPath } from "node:url"; + +const SOVRA_ROOT = resolve(fileURLToPath(import.meta.url), "../.."); +const PACKAGES_ROOT = resolve(SOVRA_ROOT, ".."); +const BINARY_ROOT = resolve(SOVRA_ROOT, "../../napi"); +const MANIFEST_PATH = resolve(SOVRA_ROOT, "package.json"); + +console.log("SOVRA_ROOT", SOVRA_ROOT); +console.log("PACKAGES_ROOT", PACKAGES_ROOT); +console.log("BINARY_ROOT", BINARY_ROOT); +console.log("MANIFEST_PATH", MANIFEST_PATH); + +const LIBC_MAPPING = { + gnu: "glibc", + musl: "musl", +}; + +const rootManifest = JSON.parse( + fs.readFileSync(MANIFEST_PATH).toString("utf-8") +); + +function package_name(target) { + return `@sovra/binding-${target}`; +} +function generateNativePackage(target) { + const binaryName = `sovra.${target}.node`; + + const packageRoot = resolve(PACKAGES_ROOT, `sovra-${target}`); + const binarySource = resolve(BINARY_ROOT, binaryName); + const binaryTarget = resolve(packageRoot, binaryName); + + // Remove the directory just in case it already exists (it's autogenerated + // so there shouldn't be anything important there anyway) + fs.rmSync(packageRoot, { recursive: true, force: true }); + + // Create the package directory + console.log(`Create directory ${packageRoot}`); + fs.mkdirSync(packageRoot); + + // Generate the package.json manifest + const { version, author, license, homepage, bugs, repository } = rootManifest; + + const triple = target.split("-"); + const platform = triple[0]; + const arch = triple[1]; + const libc = triple[2] && + LIBC_MAPPING[triple[2]] && { libc: [LIBC_MAPPING[triple[2]]] }; + const manifest = { + name: package_name(target), + version, + main: binaryName, + license, + author, + bugs, + homepage, + repository, + files: [binaryName], + cpu: [arch], + os: [platform], + ...libc, + }; + + const manifestPath = resolve(packageRoot, "package.json"); + console.log(`Create manifest ${manifestPath}`); + fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2)); + + console.log(`Copy binary ${binaryTarget}`); + fs.copyFileSync(binarySource, binaryTarget); +} + +function writeManifest() { + const packageRoot = resolve(PACKAGES_ROOT, "sovra"); + const manifestPath = resolve(packageRoot, "package.json"); + + console.log("packageRoot", packageRoot); + + const manifestData = JSON.parse( + fs.readFileSync(manifestPath).toString("utf-8") + ); + + const nativePackages = TARGETS.map((target) => [ + package_name(target), + rootManifest.version, + ]); + + manifestData["version"] = rootManifest.version; + manifestData["optionalDependencies"] = Object.fromEntries(nativePackages); + + console.log("manifestPath", manifestPath); + console.log("manifestData", manifestData); + + const content = JSON.stringify(manifestData, null, 2); + fs.writeFileSync(manifestPath, content); + + let files = ["index.js", "index.d.ts"]; + for (const file of files) { + fs.copyFileSync(resolve(BINARY_ROOT, file), resolve(packageRoot, file)); + } +} + +// NOTE: Must update npm/sovra/package.json +const TARGETS = [ + "win32-x64-msvc", + "win32-arm64-msvc", + "linux-x64-gnu", + "linux-arm64-gnu", + "linux-x64-musl", + "linux-arm64-musl", + "darwin-x64", + "darwin-arm64", +]; + +for (const target of TARGETS) { + generateNativePackage(target); +} + +writeManifest(); diff --git a/package.json b/package.json index 4baf31a..25e4a41 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "private": true, "version": "0.0.0", "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build": "napi build --platform --release --package-json-path npm/sovra/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/sovra/package.json --manifest-path napi/Cargo.toml", "prepublishOnly": "napi pre-publish -t npm" }, "devDependencies": { @@ -19,5 +19,6 @@ "funding": { "url": "https://github.com/sponsors/oblador" }, - "optionalDependencies": {} + "optionalDependencies": {}, + "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610" }