Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ac0afb0dd | |||
| 23f550818b | |||
| 3d18eae18a | |||
| 6f553d0fba | |||
| aba3047191 | |||
| 52b58a107d | |||
| ec734e4fb1 | |||
| 7c755e666f |
@@ -164,6 +164,10 @@ compile({
|
||||
- default: `false`
|
||||
- #### `fakeArgv: boolean`
|
||||
- fake the entry point file name (`process.argv[1]`). If nexe was used with stdin this will be `'[stdin]'`.
|
||||
- #### `ghToken: string`
|
||||
- Provide a Github Token for accessing nexe releases
|
||||
- This is usually needed in CI environments
|
||||
- default: `process.env.GITHUB_TOKEN`
|
||||
- #### `sourceUrl: string`
|
||||
- Provide an alternate url for the node source code
|
||||
- Note: temporary files will still be created for this under the specified version
|
||||
|
||||
+7
-1
@@ -1,3 +1,9 @@
|
||||
dependencies:
|
||||
override:
|
||||
- export NVS_HOME="$HOME/.nvs" && git clone https://github.com/jasongin/nvs "$NVS_HOME" && . "$NVS_HOME/nvs.sh" install
|
||||
- nvs add lts && nvs link lts && nvs use default
|
||||
- npm i yarn -g
|
||||
- yarn
|
||||
test:
|
||||
override:
|
||||
- npm run asset-compile
|
||||
- yarn run asset-compile
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
"name": "nexe",
|
||||
"description": "Create a single executable out of your Node.js application",
|
||||
"license": "MIT",
|
||||
"version": "2.0.0-rc.16",
|
||||
"version": "2.0.0-rc.21",
|
||||
"contributors": [
|
||||
"Craig Condon <craig.j.condon@gmail.com> (http://crcn.io)",
|
||||
"Jared Allard <jaredallard@outlook.com>",
|
||||
@@ -38,7 +38,7 @@
|
||||
"app-builder": "^5.1.0",
|
||||
"chalk": "^1.1.3",
|
||||
"download": "^6.2.0",
|
||||
"fuse-box": "^2.3.4-beta.5",
|
||||
"fuse-box": "^2.3.4-beta.11",
|
||||
"globby": "^6.1.0",
|
||||
"minimist": "^1.2.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { createHash } from 'crypto'
|
||||
import * as path from 'path'
|
||||
import * as fs from 'fs'
|
||||
|
||||
export interface EmbedNodeModuleOptions {
|
||||
[key: string]: { additionalFiles: string[] } | true
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
//TODO
|
||||
@@ -185,6 +185,9 @@ export class NexeCompiler<T extends NexeOptions = NexeOptions> {
|
||||
'User-Agent': 'nexe (https://www.npmjs.com/package/nexe)'
|
||||
}
|
||||
}
|
||||
if (this.options.ghToken) {
|
||||
downloadOptions.headers.Authorization = 'token ' + this.options.ghToken
|
||||
}
|
||||
const githubRelease = await getLatestGitRelease(downloadOptions)
|
||||
const assetName = target.toString()
|
||||
const asset = githubRelease.assets.find(x => x.name === assetName)
|
||||
|
||||
+11
-8
@@ -33,6 +33,7 @@ export interface NexeOptions {
|
||||
plugins: (string | NexePatch)[]
|
||||
native: any
|
||||
empty: boolean
|
||||
ghToken: string
|
||||
sourceUrl?: string
|
||||
enableStdIn?: boolean
|
||||
python?: string
|
||||
@@ -81,7 +82,8 @@ const alias = {
|
||||
m: 'make',
|
||||
h: 'help',
|
||||
l: 'loglevel',
|
||||
'fake-argv': 'fakeArgv'
|
||||
'fake-argv': 'fakeArgv',
|
||||
'gh-token': 'ghToken',
|
||||
}
|
||||
const argv = parseArgv(process.argv, { alias, default: { ...defaults, enableStdIn: true } })
|
||||
const g = c.gray
|
||||
@@ -218,19 +220,20 @@ function normalizeOptions(input?: Partial<NexeOptions>): NexeOptions {
|
||||
options.loglevel = extractLogLevel(options)
|
||||
options.flags = flatten(opts.flag, options.flags)
|
||||
options.targets = flatten(opts.target, options.targets).map(getTarget)
|
||||
if (!options.targets.length) {
|
||||
options.targets.push(getTarget())
|
||||
}
|
||||
options.ghToken = options.ghToken || process.env.GITHUB_TOKEN || ''
|
||||
options.make = flatten(options.vcBuild, options.make)
|
||||
options.configure = flatten(options.configure)
|
||||
options.resources = flatten(opts.resource, options.resources)
|
||||
options.rc = options.rc || extractCliMap(/^rc-.*/, options)
|
||||
options.output = isWindows
|
||||
? `${(options.output || options.name).replace(/\.exe$/, '')}.exe`
|
||||
: `${options.output || options.name}`
|
||||
options.output =
|
||||
(options.targets[0] as NexeTarget).platform === 'windows'
|
||||
? `${(options.output || options.name).replace(/\.exe$/, '')}.exe`
|
||||
: `${options.output || options.name}`
|
||||
options.output = resolve(cwd, options.output)
|
||||
|
||||
if (!options.targets.length) {
|
||||
options.targets.push(getTarget())
|
||||
}
|
||||
|
||||
if (options.build) {
|
||||
const { arch } = options.targets[0] as NexeTarget
|
||||
if (isWindows) {
|
||||
|
||||
@@ -32,7 +32,6 @@ async function getJson<T>(url: string, options?: any) {
|
||||
return JSON.parse((await got(url, options)).body) as T
|
||||
}
|
||||
|
||||
//TODO only build the latest of each major...?
|
||||
function isBuildableVersion(version: string) {
|
||||
const major = +version.split('.')[0]
|
||||
return !~[0, 1, 2, 3, 4, 5, 7].indexOf(major) || version === '4.8.4'
|
||||
|
||||
+3
-3
@@ -23,13 +23,13 @@ export default function(compiler: NexeCompiler, next: () => Promise<void>) {
|
||||
|
||||
//compiler.shims.push(wrap('{/{replace:lib/steps/shim-require.js}}'))
|
||||
|
||||
if (compiler.options.fakeArgv) {
|
||||
if (compiler.options.fakeArgv !== false) {
|
||||
const nty = !process.stdin.isTTY
|
||||
const input = nty ? '[stdin]' : compiler.options.input
|
||||
const input = nty ? '[stdin]' : JSON.stringify(compiler.options.input)
|
||||
compiler.shims.push(
|
||||
wrap(`
|
||||
var r = require('path').resolve;
|
||||
process.argv.splice(1,0, ${nty ? `'${input}'` : `r("${input}")`});`)
|
||||
process.argv.splice(1,0, ${nty ? `'${input}'` : `r(${input})`});`)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1000,9 +1000,9 @@ fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2:
|
||||
mkdirp ">=0.5 0"
|
||||
rimraf "2"
|
||||
|
||||
fuse-box@^2.3.4-beta.5:
|
||||
version "2.3.4-beta.9"
|
||||
resolved "https://registry.yarnpkg.com/fuse-box/-/fuse-box-2.3.4-beta.9.tgz#e52054eac8d4fbe8bcc6130bb418ae645fb2adea"
|
||||
fuse-box@^2.3.4-beta.11:
|
||||
version "2.3.4-beta.11"
|
||||
resolved "https://registry.yarnpkg.com/fuse-box/-/fuse-box-2.3.4-beta.11.tgz#76c0e6938e0e73ea00676f46d8691c6efa226d40"
|
||||
dependencies:
|
||||
acorn "^5.1.2"
|
||||
acorn-jsx "^4.0.1"
|
||||
|
||||
Reference in New Issue
Block a user