From 55c95b46630c4fceccba3e4321d21c56f82e2f36 Mon Sep 17 00:00:00 2001 From: calebboyd Date: Sat, 30 Sep 2017 15:04:55 -0500 Subject: [PATCH] docs: elaborate on target --- README.md | 11 ++++++++++- src/target.ts | 1 + test/target.spec.ts | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 93a8355..2cf193f 100644 --- a/README.md +++ b/README.md @@ -87,8 +87,17 @@ compile({ - Output executable file path - default: same as `name` with an OS specific extension. - #### `target: string | object` - - Combination of platform-arch-version. e.g. `'win32-ia32-6.10.3'` + - An object or string describing platform-arch-version. e.g. `'windows-ia32-6.10.3'` - each segment is optional, and will be merged with the current environment + - Examples: ([full list](https://github.com/nexe/nexe/releases)) + - `'win32-x86-8.6.0` + - `{ platform: 'alpine' }` + - `darwin-8.6.0` + - `linux-x64` + - `macos-8.4.0` + + See [test/target.spec.ts](test/target.spec.ts) + - If the [`build`](#build-boolean) flag is set, the platform portion of the target is ignored. - default: `process` - #### `bundle: string | boolean` - If a string is provided it must be a valid relative module path diff --git a/src/target.ts b/src/target.ts index d703695..8df3ff4 100644 --- a/src/target.ts +++ b/src/target.ts @@ -28,6 +28,7 @@ const prettyPlatform: { [key: string]: NodePlatform } = { //TODO arm const prettyArch: { [key: string]: NodeArch } = { x86: 'x86', + amd64: 'x64', ia32: 'x86', x32: 'x86', x64: 'x64' diff --git a/test/target.spec.ts b/test/target.spec.ts index ac82af7..fc1a8dd 100644 --- a/test/target.spec.ts +++ b/test/target.spec.ts @@ -10,7 +10,9 @@ describe('Targets', () => { ['win-ia32-6.11.2', 'windows-x86-6.11.2'], [{ version: '6.11.2', platform: 'win', arch: 'ia32' }, 'windows-x86-6.11.2'], ['win32-x64-6.11.2', 'windows-x64-6.11.2'], + ['win-amd64-6.11.2', 'windows-x64-6.11.2'], ['darwin-x64-v8.4.0', 'mac-x64-8.4.0'], + ['macos-x64-v8.4.0', 'mac-x64-8.4.0'], ['static-x86-6.10.3', 'alpine-x86-6.10.3'], ['linux-x32', `linux-x86-${process.version.slice(1)}`], ['alpine-notsupported-6.10.3', `alpine-${arch}-6.10.3`],