cli: add universal-apple-darwin platform

This commit is contained in:
Tadas Dailyda 2022-12-13 14:56:41 +02:00 committed by LongYinan
parent 328b84eb8f
commit cc9c650949
3 changed files with 6 additions and 1 deletions

View file

@ -47,7 +47,10 @@ export class CreateNpmDirCommand extends Command {
name: `${packageName}-${platformDetail.platformArchABI}`, name: `${packageName}-${platformDetail.platformArchABI}`,
version, version,
os: [platformDetail.platform], os: [platformDetail.platform],
cpu: [platformDetail.arch], cpu:
platformDetail.arch !== 'universal'
? [platformDetail.arch]
: undefined,
main: binaryFileName, main: binaryFileName,
files: [binaryFileName], files: [binaryFileName],
...pick( ...pick(

View file

@ -45,6 +45,7 @@ const SupportedPlatforms: string[] = [
'x86_64-unknown-freebsd', 'x86_64-unknown-freebsd',
'i686-pc-windows-msvc', 'i686-pc-windows-msvc',
'armv7-linux-androideabi', 'armv7-linux-androideabi',
'universal-apple-darwin',
] ]
export class NewProjectCommand extends Command { export class NewProjectCommand extends Command {

View file

@ -13,6 +13,7 @@ type NodeJSArch =
| 's390x' | 's390x'
| 'x32' | 'x32'
| 'x64' | 'x64'
| 'universal'
const CpuToNodeArch: { [index: string]: NodeJSArch } = { const CpuToNodeArch: { [index: string]: NodeJSArch } = {
x86_64: 'x64', x86_64: 'x64',