From 109b5e97a0d1601273462587a12fef900dc9a921 Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 26 Nov 2023 19:45:25 +0100 Subject: [PATCH] allow presets in manifest - `neon rust-target` recognizes presets in the manifest and knows how to expand them based on the FAMILY.json database - `neon add-target` no longer automatically expands the preset in the manifest, allowing for more readable manifests - integration test `sniff-bytes` uses presets in the manifest for testing --- README.md | 16 ++++ pkgs/cli/index.js | 87 +++++++++++++------ src/cli/src/commands/add-target.ts | 6 +- src/cli/src/commands/rust-target.ts | 3 +- src/cli/src/manifest.ts | 85 ++++++++++++++---- src/cli/src/target.ts | 18 ++-- .../sniff-bytes/npm/darwin-arm64/README.md | 3 + .../sniff-bytes/npm/darwin-arm64/package.json | 10 +-- .../sniff-bytes/npm/darwin-x64/README.md | 3 + .../sniff-bytes/npm/darwin-x64/package.json | 24 +++++ .../npm/linux-arm-gnueabihf/README.md | 3 + .../npm/linux-arm-gnueabihf/package.json | 24 +++++ .../sniff-bytes/npm/linux-x64-gnu/README.md | 3 + .../npm/linux-x64-gnu/package.json | 10 +-- test/integration/sniff-bytes/package.json | 10 ++- 15 files changed, 234 insertions(+), 71 deletions(-) create mode 100644 test/integration/sniff-bytes/npm/darwin-arm64/README.md create mode 100644 test/integration/sniff-bytes/npm/darwin-x64/README.md create mode 100644 test/integration/sniff-bytes/npm/darwin-x64/package.json create mode 100644 test/integration/sniff-bytes/npm/linux-arm-gnueabihf/README.md create mode 100644 test/integration/sniff-bytes/npm/linux-arm-gnueabihf/package.json create mode 100644 test/integration/sniff-bytes/npm/linux-x64-gnu/README.md diff --git a/README.md b/README.md index 40e0fc37..d3039b6e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,19 @@ # `@neon-rs` Experimental packaging and distribution tooling for [Neon](https://neon-bindings.com). + +# Build Workflow of a Neon Project + +``` +( Start ) ---- npm run build ----> ( .node ) ---- npm run pack-target ----> ( .tgz ) ---- npm publish ----> [ npm ] + \ \ \ \ \ + \ \ \ \ +--- npm run cross ----> ( .node ) ---- npm run pack-target ----> ( .tgz ) ---- npm publish ----> [ npm ] + \ \ \ \ + \ \ \ +--- npm run cross ----> ( .node ) ---- npm run pack-target ----> ( .tgz ) ---- npm publish ----> [ npm ] + \ \ \ + \ \ +--- npm run cross ----> ( .node ) ---- npm run pack-target ----> ( .tgz ) ---- npm publish ----> [ npm ] + \ \ + \ +--- npm run cross ----> ( .node ) ---- npm run pack-target ----> ( .tgz ) ---- npm publish ----> [ npm ] + \ + +--- npm run cross ----> ( .node ) ---- npm run pack-target ----> ( .tgz ) ---- npm publish ----> [ npm ] +``` diff --git a/pkgs/cli/index.js b/pkgs/cli/index.js index d446641a..109a9a9c 100755 --- a/pkgs/cli/index.js +++ b/pkgs/cli/index.js @@ -12052,12 +12052,12 @@ function assertIsNodeTarget(x) { throw new RangeError(`invalid Node target: ${x}`); } } -function isTargetFamilyKey(x) { +function isTargetPreset(x) { return (typeof x === 'string') && (x in family_namespaceObject); } -function assertIsTargetFamilyKey(x) { - if (!isTargetFamilyKey(x)) { - throw new RangeError(`invalid target family name: ${x}`); +function assertIsTargetPreset(x) { + if (!isTargetPreset(x)) { + throw new RangeError(`invalid target family preset: ${x}`); } } function lookupTargetFamily(key) { @@ -12071,7 +12071,7 @@ function merge(maps) { return merged; } function expandTargetFamily(family) { - return isTargetFamilyKey(family) + return isTargetPreset(family) ? expandTargetFamily(lookupTargetFamily(family)) : Array.isArray(family) ? merge(family.map(expandTargetFamily)) @@ -12175,6 +12175,19 @@ function assertIsTargetMap(json, path) { } } } +function assertIsTargetFamily(json, path) { + if (typeof json === 'string') { + assertIsTargetPreset(json); + return; + } + if (Array.isArray(json)) { + for (const elt of json) { + assertIsTargetPreset(elt); + } + return; + } + assertIsTargetMap(json, path); +} function assertIsBinaryV1(json) { assertHasProps(['binary'], json, "neon"); const binary = json.binary; @@ -12218,7 +12231,7 @@ function assertIsSourceCfg(json) { if (typeof json.org !== 'string') { throw new TypeError(`expected "neon.org" to be a string, found ${json.org}`); } - assertIsTargetMap(json.targets, "neon.targets"); + assertIsTargetFamily(json.targets, "neon.targets"); } function assertIsPreamble(json) { if (!json || typeof json !== 'object') { @@ -12355,11 +12368,13 @@ function normalizeSourceCfg(json) { } class SourceManifest extends AbstractManifest { _sourceJSON; + _expandedTargets; constructor(json) { super(json); this._upgraded = normalizeSourceCfg(this._json); assertHasSourceCfg(this._json); this._sourceJSON = this._json; + this._expandedTargets = expandTargetFamily(this._sourceJSON.neon.targets); } static async load(dir) { return new SourceManifest(await readManifest(dir)); @@ -12369,18 +12384,21 @@ class SourceManifest extends AbstractManifest { } packageNames() { const cfg = this.cfg(); - return Object.keys(cfg.targets).map(key => `${cfg.org}/${key}`); + return Object.keys(this._expandedTargets).map(key => `${cfg.org}/${key}`); } packageFor(target) { const cfg = this.cfg(); - for (const key in cfg.targets) { - const value = cfg.targets[key]; + for (const key in this._expandedTargets) { + const value = this._expandedTargets[key]; if (value === target) { return `${cfg.org}/${key}`; } } return undefined; } + rustTargetFor(node) { + return this._expandedTargets[node]; + } manifestFor(target) { const targetInfo = getTargetDescriptor(target); const name = this.packageFor(target); @@ -12416,11 +12434,10 @@ class SourceManifest extends AbstractManifest { } async addTargetPair(pair) { const { node, rust } = pair; - const targets = this.cfg().targets; - if (targets[node] === rust) { + if (this._expandedTargets[node] === rust) { return null; } - targets[node] = rust; + this._expandedTargets[node] = rust; await this.save(); return pair; } @@ -12434,22 +12451,43 @@ class SourceManifest extends AbstractManifest { async addRustTarget(target) { return await this.addTargetPair({ node: rust2Node(target), rust: target }); } - async addTargets(family) { - const targets = this.cfg().targets; - let modified = []; + filterNewTargets(family) { + let newTargets = []; for (const [key, value] of Object.entries(family)) { const node = key; const rust = value; - if (targets[node] === rust) { + if (this._expandedTargets[node] === rust) { continue; } - targets[node] = rust; - modified.push({ node, rust }); + newTargets.push({ node, rust }); } - if (modified.length) { - await this.save(); + return newTargets; + } + async addTargets(family, opts = {}) { + let newTargets = this.filterNewTargets(family); + if (!newTargets.length) { + return []; + } + for (const { node, rust } of newTargets) { + if (opts.targetsSrc) { + opts.targetsSrc[node] = rust; + } + this._expandedTargets[node] = rust; + } + await this.save(); + return newTargets; + } + async addTargetPreset(preset) { + const targetsSrc = this.cfg().targets; + if (typeof targetsSrc === 'string') { + this.cfg().targets = [targetsSrc, preset]; + return this.addTargets(expandTargetFamily(preset)); + } + if (Array.isArray(targetsSrc)) { + targetsSrc.push(preset); + return this.addTargets(expandTargetFamily(preset)); } - return modified; + return this.addTargets(expandTargetFamily(preset), { targetsSrc }); } async updateTargets(log, bundle) { const packages = this.packageNames(); @@ -12752,8 +12790,8 @@ class AddTarget { this.log(`adding Node target ${this._target}`); return optionArray(await sourceManifest.addNodeTarget(this._target)); } - else if (isTargetFamilyKey(this._target)) { - return sourceManifest.addTargets(expandTargetFamily(this._target)); + else if (isTargetPreset(this._target)) { + return sourceManifest.addTargetPreset(this._target); } else { throw new Error(`unrecognized target ${this._target}`); @@ -12909,8 +12947,7 @@ class RustTarget { this.log(`reading package.json`); const sourceManifest = await SourceManifest.load(); this.log(`manifest: ${sourceManifest.stringify()}`); - const targets = sourceManifest.cfg().targets; - const rust = targets[this._target]; + const rust = sourceManifest.rustTargetFor(this._target); if (!rust) { throw new Error(`no Rust target found for ${this._target}`); } diff --git a/src/cli/src/commands/add-target.ts b/src/cli/src/commands/add-target.ts index a27014a3..c18d00b5 100644 --- a/src/cli/src/commands/add-target.ts +++ b/src/cli/src/commands/add-target.ts @@ -2,7 +2,7 @@ import * as fs from 'node:fs/promises'; import * as path from 'node:path'; import commandLineArgs from 'command-line-args'; import { Command, CommandDetail, CommandSection } from '../command.js'; -import { expandTargetFamily, getCurrentTarget, isNodeTarget, isRustTarget, isTargetFamilyKey, NodeTarget, RustTarget, TargetPair } from '../target.js'; +import { getCurrentTarget, isNodeTarget, isRustTarget, isTargetPreset, TargetPair } from '../target.js'; import { SourceManifest } from '../manifest.js'; function optionArray(option: T | undefined | null): T[] { @@ -116,8 +116,8 @@ export default class AddTarget implements Command { } else if (isNodeTarget(this._target)) { this.log(`adding Node target ${this._target}`); return optionArray(await sourceManifest.addNodeTarget(this._target)); - } else if (isTargetFamilyKey(this._target)) { - return sourceManifest.addTargets(expandTargetFamily(this._target)); + } else if (isTargetPreset(this._target)) { + return sourceManifest.addTargetPreset(this._target); } else { throw new Error(`unrecognized target ${this._target}`); } diff --git a/src/cli/src/commands/rust-target.ts b/src/cli/src/commands/rust-target.ts index 0ab811c1..116f336c 100644 --- a/src/cli/src/commands/rust-target.ts +++ b/src/cli/src/commands/rust-target.ts @@ -84,8 +84,7 @@ export default class RustTarget implements Command { const sourceManifest = await SourceManifest.load(); this.log(`manifest: ${sourceManifest.stringify()}`); - const targets = sourceManifest.cfg().targets; - const rust = targets[this._target]; + const rust = sourceManifest.rustTargetFor(this._target); if (!rust) { throw new Error(`no Rust target found for ${this._target}`); } diff --git a/src/cli/src/manifest.ts b/src/cli/src/manifest.ts index 0934438d..d4704368 100644 --- a/src/cli/src/manifest.ts +++ b/src/cli/src/manifest.ts @@ -1,7 +1,7 @@ import { execa } from 'execa'; import * as fs from 'node:fs/promises'; import * as path from 'node:path'; -import { RustTarget, NodeTarget, isRustTarget, isNodeTarget, assertIsRustTarget, assertIsNodeTarget, getTargetDescriptor, node2Rust, rust2Node, TargetMap, TargetPair } from './target.js'; +import { assertIsTargetPreset, RustTarget, NodeTarget, isRustTarget, isNodeTarget, assertIsRustTarget, assertIsNodeTarget, getTargetDescriptor, node2Rust, rust2Node, TargetFamily, TargetMap, TargetPair, TargetPreset, expandTargetFamily } from './target.js'; export interface BinaryCfg { type: "binary", @@ -75,6 +75,22 @@ function assertIsTargetMap(json: unknown, path: string): asserts json is TargetM } } +function assertIsTargetFamily(json: unknown, path: string): asserts json is TargetFamily { + if (typeof json === 'string') { + assertIsTargetPreset(json); + return; + } + + if (Array.isArray(json)) { + for (const elt of json) { + assertIsTargetPreset(elt); + } + return; + } + + assertIsTargetMap(json, path); +} + function assertIsBinaryV1(json: unknown): asserts json is BinaryV1 { assertHasProps(['binary'], json, "neon"); const binary = json.binary; @@ -116,7 +132,7 @@ function assertIsSourceV1(json: unknown): asserts json is SourceV1 { export interface SourceCfg { type: "source"; org: string; - targets: TargetMap; + targets: TargetFamily; } function assertIsSourceCfg(json: unknown): asserts json is SourceCfg { @@ -127,7 +143,7 @@ function assertIsSourceCfg(json: unknown): asserts json is SourceCfg { if (typeof json.org !== 'string') { throw new TypeError(`expected "neon.org" to be a string, found ${json.org}`); } - assertIsTargetMap(json.targets, "neon.targets"); + assertIsTargetFamily(json.targets, "neon.targets"); } type Preamble = { @@ -299,14 +315,18 @@ function normalizeSourceCfg(json: object): boolean { return true; } +type AddTargetsOptions = { targetsSrc?: TargetMap }; + export class SourceManifest extends AbstractManifest { private _sourceJSON: HasSourceCfg; + private _expandedTargets: TargetMap; constructor(json: unknown) { super(json); this._upgraded = normalizeSourceCfg(this._json); assertHasSourceCfg(this._json); this._sourceJSON = this._json; + this._expandedTargets = expandTargetFamily(this._sourceJSON.neon.targets); } static async load(dir?: string | undefined): Promise { @@ -319,13 +339,13 @@ export class SourceManifest extends AbstractManifest { packageNames(): string[] { const cfg = this.cfg(); - return Object.keys(cfg.targets).map(key => `${cfg.org}/${key}`); + return Object.keys(this._expandedTargets).map(key => `${cfg.org}/${key}`); } packageFor(target: RustTarget): string | undefined { const cfg = this.cfg(); - for (const key in cfg.targets) { - const value = cfg.targets[key as NodeTarget]; + for (const key in this._expandedTargets) { + const value = this._expandedTargets[key as NodeTarget]; if (value === target) { return `${cfg.org}/${key}`; } @@ -333,6 +353,10 @@ export class SourceManifest extends AbstractManifest { return undefined; } + rustTargetFor(node: NodeTarget): RustTarget | undefined { + return this._expandedTargets[node]; + } + manifestFor(target: RustTarget): BinaryManifest { const targetInfo = getTargetDescriptor(target); const name = this.packageFor(target); @@ -374,13 +398,12 @@ export class SourceManifest extends AbstractManifest { async addTargetPair(pair: TargetPair): Promise { const { node, rust } = pair; - const targets = this.cfg().targets; - if (targets[node] === rust) { + if (this._expandedTargets[node] === rust) { return null; } - targets[node] = rust; + this._expandedTargets[node] = rust; await this.save(); return pair; } @@ -397,27 +420,53 @@ export class SourceManifest extends AbstractManifest { return await this.addTargetPair({ node: rust2Node(target), rust: target }); } - async addTargets(family: TargetMap): Promise { - const targets = this.cfg().targets; - let modified = []; + filterNewTargets(family: TargetMap): TargetPair[] { + let newTargets = []; for (const [key, value] of Object.entries(family)) { const node: NodeTarget = key as NodeTarget; const rust: RustTarget = value; - if (targets[node] === rust) { + if (this._expandedTargets[node] === rust) { continue; } - targets[node] = rust; - modified.push({ node, rust }); + newTargets.push({ node, rust }); + } + + return newTargets; + } + + async addTargets(family: TargetMap, opts: AddTargetsOptions = {}): Promise { + let newTargets = this.filterNewTargets(family); + if (!newTargets.length) { + return []; + } + + for (const { node, rust } of newTargets) { + if (opts.targetsSrc) { + opts.targetsSrc[node] = rust; + } + this._expandedTargets[node] = rust; + } + await this.save(); + return newTargets; + } + + async addTargetPreset(preset: TargetPreset): Promise { + const targetsSrc = this.cfg().targets; + + if (typeof targetsSrc === 'string') { + this.cfg().targets = [targetsSrc, preset]; + return this.addTargets(expandTargetFamily(preset)); } - if (modified.length) { - await this.save(); + if (Array.isArray(targetsSrc)) { + targetsSrc.push(preset); + return this.addTargets(expandTargetFamily(preset)); } - return modified; + return this.addTargets(expandTargetFamily(preset), { targetsSrc }); } async updateTargets(log: (msg: string) => void, bundle: string | null) { diff --git a/src/cli/src/target.ts b/src/cli/src/target.ts index 0032fcef..b1165e9c 100644 --- a/src/cli/src/target.ts +++ b/src/cli/src/target.ts @@ -28,15 +28,15 @@ export function assertIsNodeTarget(x: unknown): asserts x is NodeTarget { } } -export type TargetFamilyKey = keyof(typeof FAMILY); +export type TargetPreset = keyof(typeof FAMILY); -export function isTargetFamilyKey(x: unknown): x is TargetFamilyKey { +export function isTargetPreset(x: unknown): x is TargetPreset { return (typeof x === 'string') && (x in FAMILY); } -export function assertIsTargetFamilyKey(x: unknown): asserts x is TargetFamilyKey { - if (!isTargetFamilyKey(x)) { - throw new RangeError(`invalid target family name: ${x}`); +export function assertIsTargetPreset(x: unknown): asserts x is TargetPreset { + if (!isTargetPreset(x)) { + throw new RangeError(`invalid target family preset: ${x}`); } } @@ -44,11 +44,11 @@ export type TargetPair = { node: NodeTarget, rust: RustTarget }; export type TargetMap = { [key in NodeTarget]?: RustTarget }; export type TargetFamily = - TargetFamilyKey - | TargetFamilyKey[] + TargetPreset + | TargetPreset[] | TargetMap; -function lookupTargetFamily(key: TargetFamilyKey): TargetFamily { +function lookupTargetFamily(key: TargetPreset): TargetFamily { return FAMILY[key] as TargetFamily; } @@ -61,7 +61,7 @@ function merge(maps: TargetMap[]): TargetMap { } export function expandTargetFamily(family: TargetFamily): TargetMap { - return isTargetFamilyKey(family) + return isTargetPreset(family) ? expandTargetFamily(lookupTargetFamily(family)) : Array.isArray(family) ? merge(family.map(expandTargetFamily)) diff --git a/test/integration/sniff-bytes/npm/darwin-arm64/README.md b/test/integration/sniff-bytes/npm/darwin-arm64/README.md new file mode 100644 index 00000000..3302cd3a --- /dev/null +++ b/test/integration/sniff-bytes/npm/darwin-arm64/README.md @@ -0,0 +1,3 @@ +# `@sniff-bytes/darwin-arm64` + +Prebuilt binary package for `@neon-integration-tests/sniff-bytes` on `darwin-arm64`. diff --git a/test/integration/sniff-bytes/npm/darwin-arm64/package.json b/test/integration/sniff-bytes/npm/darwin-arm64/package.json index 765dc82d..4fdff91f 100644 --- a/test/integration/sniff-bytes/npm/darwin-arm64/package.json +++ b/test/integration/sniff-bytes/npm/darwin-arm64/package.json @@ -1,7 +1,7 @@ { "name": "@sniff-bytes/darwin-arm64", - "description": "Prebuilt binary package for `sniff-bytes` on `darwin-arm64`.", - "version": "0.1.11", + "description": "Prebuilt binary package for `@neon-integration-tests/sniff-bytes` on `darwin-arm64`.", + "version": "1.0.0", "os": [ "darwin" ], @@ -12,7 +12,6 @@ "files": [ "index.node" ], - "license": "MIT", "neon": { "type": "binary", "rust": "aarch64-apple-darwin", @@ -20,5 +19,6 @@ "platform": "darwin", "arch": "arm64", "abi": null - } -} + }, + "license": "MIT" +} \ No newline at end of file diff --git a/test/integration/sniff-bytes/npm/darwin-x64/README.md b/test/integration/sniff-bytes/npm/darwin-x64/README.md new file mode 100644 index 00000000..8aa5928b --- /dev/null +++ b/test/integration/sniff-bytes/npm/darwin-x64/README.md @@ -0,0 +1,3 @@ +# `@sniff-bytes/darwin-x64` + +Prebuilt binary package for `@neon-integration-tests/sniff-bytes` on `darwin-x64`. diff --git a/test/integration/sniff-bytes/npm/darwin-x64/package.json b/test/integration/sniff-bytes/npm/darwin-x64/package.json new file mode 100644 index 00000000..765f1518 --- /dev/null +++ b/test/integration/sniff-bytes/npm/darwin-x64/package.json @@ -0,0 +1,24 @@ +{ + "name": "@sniff-bytes/darwin-x64", + "description": "Prebuilt binary package for `@neon-integration-tests/sniff-bytes` on `darwin-x64`.", + "version": "1.0.0", + "os": [ + "darwin" + ], + "cpu": [ + "x64" + ], + "main": "index.node", + "files": [ + "index.node" + ], + "neon": { + "type": "binary", + "rust": "x86_64-apple-darwin", + "node": "darwin-x64", + "platform": "darwin", + "arch": "x64", + "abi": null + }, + "license": "MIT" +} \ No newline at end of file diff --git a/test/integration/sniff-bytes/npm/linux-arm-gnueabihf/README.md b/test/integration/sniff-bytes/npm/linux-arm-gnueabihf/README.md new file mode 100644 index 00000000..f4f13900 --- /dev/null +++ b/test/integration/sniff-bytes/npm/linux-arm-gnueabihf/README.md @@ -0,0 +1,3 @@ +# `@sniff-bytes/linux-arm-gnueabihf` + +Prebuilt binary package for `@neon-integration-tests/sniff-bytes` on `linux-arm-gnueabihf`. diff --git a/test/integration/sniff-bytes/npm/linux-arm-gnueabihf/package.json b/test/integration/sniff-bytes/npm/linux-arm-gnueabihf/package.json new file mode 100644 index 00000000..05322bca --- /dev/null +++ b/test/integration/sniff-bytes/npm/linux-arm-gnueabihf/package.json @@ -0,0 +1,24 @@ +{ + "name": "@sniff-bytes/linux-arm-gnueabihf", + "description": "Prebuilt binary package for `@neon-integration-tests/sniff-bytes` on `linux-arm-gnueabihf`.", + "version": "1.0.0", + "os": [ + "linux" + ], + "cpu": [ + "arm" + ], + "main": "index.node", + "files": [ + "index.node" + ], + "neon": { + "type": "binary", + "rust": "armv7-unknown-linux-gnueabihf", + "node": "linux-arm-gnueabihf", + "platform": "linux", + "arch": "arm", + "abi": "gnueabihf" + }, + "license": "MIT" +} \ No newline at end of file diff --git a/test/integration/sniff-bytes/npm/linux-x64-gnu/README.md b/test/integration/sniff-bytes/npm/linux-x64-gnu/README.md new file mode 100644 index 00000000..8258f37a --- /dev/null +++ b/test/integration/sniff-bytes/npm/linux-x64-gnu/README.md @@ -0,0 +1,3 @@ +# `@sniff-bytes/linux-x64-gnu` + +Prebuilt binary package for `@neon-integration-tests/sniff-bytes` on `linux-x64-gnu`. diff --git a/test/integration/sniff-bytes/npm/linux-x64-gnu/package.json b/test/integration/sniff-bytes/npm/linux-x64-gnu/package.json index 66fd9288..f8ed0018 100644 --- a/test/integration/sniff-bytes/npm/linux-x64-gnu/package.json +++ b/test/integration/sniff-bytes/npm/linux-x64-gnu/package.json @@ -1,7 +1,7 @@ { "name": "@sniff-bytes/linux-x64-gnu", - "description": "Prebuilt binary package for `sniff-bytes` on `linux-x64-gnu`.", - "version": "1.0", + "description": "Prebuilt binary package for `@neon-integration-tests/sniff-bytes` on `linux-x64-gnu`.", + "version": "1.0.0", "os": [ "linux" ], @@ -12,7 +12,6 @@ "files": [ "index.node" ], - "license": "MIT", "neon": { "type": "binary", "rust": "x86_64-unknown-linux-gnu", @@ -20,5 +19,6 @@ "platform": "linux", "arch": "x64", "abi": "gnu" - } -} + }, + "license": "MIT" +} \ No newline at end of file diff --git a/test/integration/sniff-bytes/package.json b/test/integration/sniff-bytes/package.json index 09828a68..9619dd7d 100644 --- a/test/integration/sniff-bytes/package.json +++ b/test/integration/sniff-bytes/package.json @@ -36,10 +36,10 @@ "neon": { "type": "source", "org": "@sniff-bytes", - "targets": { - "linux-x64-gnu": "x86_64-unknown-linux-gnu", - "darwin-arm64": "aarch64-apple-darwin" - } + "targets": [ + "linux", + "macos" + ] }, "devDependencies": { "@neon-rs/cli": "*", @@ -51,6 +51,8 @@ }, "optionalDependencies": { "@sniff-bytes/darwin-arm64": "1.0.0", + "@sniff-bytes/darwin-x64": "1.0.0", + "@sniff-bytes/linux-arm-gnueabihf": "1.0.0", "@sniff-bytes/linux-x64-gnu": "1.0.0" } }