Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1023b72513 | |||
| 0cf436c9a7 | |||
| 77f49eb07a | |||
| 9bc98bf597 | |||
| 7e9a05675c | |||
| e62d728624 | |||
| a0c8d31f03 |
@@ -153,7 +153,7 @@ compile({
|
|||||||
- Path to a user provided icon to be used (Windows only). Requires `--build` to be set.
|
- Path to a user provided icon to be used (Windows only). Requires `--build` to be set.
|
||||||
- #### `rc: object`
|
- #### `rc: object`
|
||||||
- Settings for patching the [node.rc](https://github.com/nodejs/node/blob/master/src/res/node.rc) configuration file (Windows only).
|
- Settings for patching the [node.rc](https://github.com/nodejs/node/blob/master/src/res/node.rc) configuration file (Windows only).
|
||||||
- Example (keys may vary depending ont the version. Reference the file linked above):
|
- Example (keys may vary depending on the version. Reference the file linked above):
|
||||||
```javascript
|
```javascript
|
||||||
{
|
{
|
||||||
CompanyName: "ACME Corp",
|
CompanyName: "ACME Corp",
|
||||||
|
|||||||
+4
-4
@@ -25,15 +25,15 @@ jobs:
|
|||||||
displayName: Install Node
|
displayName: Install Node
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: '10.x'
|
versionSpec: '10.x'
|
||||||
- script: sudo apt-get install -y libc6-dev-i386 gcc-multilib g++-multilib
|
- script: sudo apt-get update && sudo apt-get install -y libc6-dev-i386 gcc-multilib g++-multilib
|
||||||
condition: eq(variables['Agent.JobName'], 'linux')
|
condition: contains(variables['Agent.JobName'], 'linux')
|
||||||
displayName: Install Linux Build Dependencies
|
displayName: Install Linux Build Dependencies
|
||||||
- script: choco install visualcpp-build-tools --version 14.0.25420.1 -fy && npm config set msvs_version 2015
|
- script: choco install visualcpp-build-tools --version 14.0.25420.1 -fy && npm config set msvs_version 2015
|
||||||
condition: startsWith(variables['Agent.JobName'], 'windows_2015')
|
condition: contains(variables['Agent.JobName'], 'windows_2015')
|
||||||
displayName: Install Windows Build Dependencies
|
displayName: Install Windows Build Dependencies
|
||||||
- script: choco install nasm -fy
|
- script: choco install nasm -fy
|
||||||
displayName: Install Windows Assembler (NASM)
|
displayName: Install Windows Assembler (NASM)
|
||||||
condition: startsWith(variables['Agent.JobName'], 'windows')
|
condition: contains(variables['Agent.JobName'], 'windows')
|
||||||
- script: npm install && npm run ci:build
|
- script: npm install && npm run ci:build
|
||||||
displayName: Build Nexe
|
displayName: Build Nexe
|
||||||
env:
|
env:
|
||||||
|
|||||||
Generated
+35
-27
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nexe",
|
"name": "nexe",
|
||||||
"version": "3.2.0",
|
"version": "3.3.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -158,9 +158,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/mocha": {
|
"@types/mocha": {
|
||||||
"version": "5.2.6",
|
"version": "5.2.7",
|
||||||
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz",
|
||||||
"integrity": "sha512-1axi39YdtBI7z957vdqXI4Ac25e7YihYQtJa+Clnxg1zTJEaIRbndt71O3sP4GAMgiAm0pY26/b9BrY4MR/PMw==",
|
"integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/multistream": {
|
"@types/multistream": {
|
||||||
@@ -2529,9 +2529,9 @@
|
|||||||
"integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc="
|
"integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc="
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"version": "1.17.0",
|
"version": "1.18.2",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz",
|
||||||
"integrity": "sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw==",
|
"integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"process-nextick-args": {
|
"process-nextick-args": {
|
||||||
@@ -2614,18 +2614,18 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"resolve": {
|
"resolve": {
|
||||||
"version": "1.10.0",
|
"version": "1.11.1",
|
||||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz",
|
||||||
"integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==",
|
"integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"path-parse": "^1.0.6"
|
"path-parse": "^1.0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"resolve-dependencies": {
|
"resolve-dependencies": {
|
||||||
"version": "2.2.2",
|
"version": "2.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/resolve-dependencies/-/resolve-dependencies-2.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/resolve-dependencies/-/resolve-dependencies-2.2.3.tgz",
|
||||||
"integrity": "sha512-lZARvM5mDaVOBUNam2fbaHYydBBPMlMt6jjlQYvD8D2N//SOlq6iqqFrCWsYkBGYtXgix4EAiTFuZLpt5lXQtA==",
|
"integrity": "sha512-EIZcqEE3q+fWNapzpQ2iiCPal+J7TsLfLnoeGq4h5L4GYjnf4xKzVHN7VBjLGgOJwUs/Z+a6nqA80AhwP7IPlQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@calebboyd/semaphore": "^1.3.1",
|
"@calebboyd/semaphore": "^1.3.1",
|
||||||
"acorn": "^6.0.4",
|
"acorn": "^6.0.4",
|
||||||
@@ -3029,9 +3029,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tapable": {
|
"tapable": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz",
|
||||||
"integrity": "sha512-9I2ydhj8Z9veORCw5PRm4u9uebCn0mcCa6scWoNcbZ6dAtoo2618u9UUzxgmsCOreJpqDDuv61LvwofW7hLcBA=="
|
"integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA=="
|
||||||
},
|
},
|
||||||
"tar-stream": {
|
"tar-stream": {
|
||||||
"version": "1.6.1",
|
"version": "1.6.1",
|
||||||
@@ -3114,16 +3114,24 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ts-node": {
|
"ts-node": {
|
||||||
"version": "8.1.0",
|
"version": "8.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.2.0.tgz",
|
||||||
"integrity": "sha512-34jpuOrxDuf+O6iW1JpgTRDFynUZ1iEqtYruBqh35gICNjN8x+LpVcPAcwzLPi9VU6mdA3ym+x233nZmZp445A==",
|
"integrity": "sha512-m8XQwUurkbYqXrKqr3WHCW310utRNvV5OnRVeISeea7LoCWVcdfeB/Ntl8JYWFh+WRoUAdBgESrzKochQt7sMw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"arg": "^4.1.0",
|
"arg": "^4.1.0",
|
||||||
"diff": "^3.1.0",
|
"diff": "^4.0.1",
|
||||||
"make-error": "^1.1.1",
|
"make-error": "^1.1.1",
|
||||||
"source-map-support": "^0.5.6",
|
"source-map-support": "^0.5.6",
|
||||||
"yn": "^3.0.0"
|
"yn": "^3.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"diff": {
|
||||||
|
"version": "4.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
||||||
|
"integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tslib": {
|
"tslib": {
|
||||||
@@ -3133,9 +3141,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"tslint": {
|
"tslint": {
|
||||||
"version": "5.16.0",
|
"version": "5.17.0",
|
||||||
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.16.0.tgz",
|
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.17.0.tgz",
|
||||||
"integrity": "sha512-UxG2yNxJ5pgGwmMzPMYh/CCnCnh0HfPgtlVRDs1ykZklufFBL1ZoTlWFRz2NQjcoEiDoRp+JyT0lhBbbH/obyA==",
|
"integrity": "sha512-pflx87WfVoYepTet3xLfDOLDm9Jqi61UXIKePOuca0qoAZyrGWonDG9VTbji58Fy+8gciUn8Bt7y69+KEVjc/w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/code-frame": "^7.0.0",
|
"@babel/code-frame": "^7.0.0",
|
||||||
@@ -3144,7 +3152,7 @@
|
|||||||
"commander": "^2.12.1",
|
"commander": "^2.12.1",
|
||||||
"diff": "^3.2.0",
|
"diff": "^3.2.0",
|
||||||
"glob": "^7.1.1",
|
"glob": "^7.1.1",
|
||||||
"js-yaml": "^3.13.0",
|
"js-yaml": "^3.13.1",
|
||||||
"minimatch": "^3.0.4",
|
"minimatch": "^3.0.4",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"resolve": "^1.3.2",
|
"resolve": "^1.3.2",
|
||||||
@@ -3194,9 +3202,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "3.4.5",
|
"version": "3.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.1.tgz",
|
||||||
"integrity": "sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==",
|
"integrity": "sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"unbzip2-stream": {
|
"unbzip2-stream": {
|
||||||
|
|||||||
+7
-7
@@ -2,7 +2,7 @@
|
|||||||
"name": "nexe",
|
"name": "nexe",
|
||||||
"description": "Create a single executable out of your Node.js application",
|
"description": "Create a single executable out of your Node.js application",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "3.2.0",
|
"version": "3.3.0",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"Craig Condon <craig.j.condon@gmail.com> (http://crcn.io)",
|
"Craig Condon <craig.j.condon@gmail.com> (http://crcn.io)",
|
||||||
"Jared Allard <jaredallard@outlook.com>",
|
"Jared Allard <jaredallard@outlook.com>",
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
"multistream": "^2.1.1",
|
"multistream": "^2.1.1",
|
||||||
"ora": "^3.4.0",
|
"ora": "^3.4.0",
|
||||||
"pify": "^4.0.1",
|
"pify": "^4.0.1",
|
||||||
"resolve-dependencies": "^2.2.2",
|
"resolve-dependencies": "^2.2.3",
|
||||||
"rimraf": "^2.6.3"
|
"rimraf": "^2.6.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
"@types/got": "^9.4.4",
|
"@types/got": "^9.4.4",
|
||||||
"@types/minimist": "^1.2.0",
|
"@types/minimist": "^1.2.0",
|
||||||
"@types/mkdirp": "^0.5.2",
|
"@types/mkdirp": "^0.5.2",
|
||||||
"@types/mocha": "^5.2.6",
|
"@types/mocha": "^5.2.7",
|
||||||
"@types/multistream": "^2.1.1",
|
"@types/multistream": "^2.1.1",
|
||||||
"@types/ora": "^3.2.0",
|
"@types/ora": "^3.2.0",
|
||||||
"@types/pify": "3.0.2",
|
"@types/pify": "3.0.2",
|
||||||
@@ -66,11 +66,11 @@
|
|||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
"execa": "^1.0.0",
|
"execa": "^1.0.0",
|
||||||
"mocha": "^6.1.4",
|
"mocha": "^6.1.4",
|
||||||
"prettier": "^1.17.0",
|
"prettier": "^1.18.2",
|
||||||
"ts-node": "^8.1.0",
|
"ts-node": "^8.2.0",
|
||||||
"tslint": "^5.16.0",
|
"tslint": "^5.17.0",
|
||||||
"tslint-config-prettier": "^1.18.0",
|
"tslint-config-prettier": "^1.18.0",
|
||||||
"tslint-plugin-prettier": "^2.0.1",
|
"tslint-plugin-prettier": "^2.0.1",
|
||||||
"typescript": "^3.4.5"
|
"typescript": "^3.5.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-13
@@ -35,6 +35,13 @@ function shimFs(binary: NexeBinary, fs: any = require('fs')) {
|
|||||||
log = (text: string) => process.stderr.write('[nexe] - ' + text + '\n')
|
log = (text: string) => process.stderr.write('[nexe] - ' + text + '\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const winPath = (key: string) => {
|
||||||
|
if (isWin && key.substr(1, 2) === ':\\') {
|
||||||
|
key = key[0].toUpperCase() + key.substr(1)
|
||||||
|
}
|
||||||
|
return key
|
||||||
|
}
|
||||||
|
|
||||||
const getKey = function getKey(filepath: string | Buffer | null): string {
|
const getKey = function getKey(filepath: string | Buffer | null): string {
|
||||||
if (Buffer.isBuffer(filepath)) {
|
if (Buffer.isBuffer(filepath)) {
|
||||||
filepath = filepath.toString()
|
filepath = filepath.toString()
|
||||||
@@ -44,10 +51,7 @@ function shimFs(binary: NexeBinary, fs: any = require('fs')) {
|
|||||||
}
|
}
|
||||||
let key = path.resolve(baseDir, filepath)
|
let key = path.resolve(baseDir, filepath)
|
||||||
|
|
||||||
if (isWin && key.substr(1, 2) === ':\\') {
|
return winPath(key)
|
||||||
key = key[0].toUpperCase() + key.substr(1)
|
|
||||||
}
|
|
||||||
return key
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const statTime = function() {
|
const statTime = function() {
|
||||||
@@ -102,7 +106,7 @@ function shimFs(binary: NexeBinary, fs: any = require('fs')) {
|
|||||||
const entry = manifest[filepath]
|
const entry = manifest[filepath]
|
||||||
const absolutePath = getKey(filepath)
|
const absolutePath = getKey(filepath)
|
||||||
const longPath = makeLong(absolutePath)
|
const longPath = makeLong(absolutePath)
|
||||||
const normalizedPath = path.normalize(filepath)
|
const normalizedPath = winPath(path.normalize(filepath))
|
||||||
|
|
||||||
if (!manifest[absolutePath]) {
|
if (!manifest[absolutePath]) {
|
||||||
manifest[absolutePath] = entry
|
manifest[absolutePath] = entry
|
||||||
@@ -192,19 +196,19 @@ function shimFs(binary: NexeBinary, fs: any = require('fs')) {
|
|||||||
const encoding = fileOpts(options).encoding
|
const encoding = fileOpts(options).encoding
|
||||||
callback = typeof options === 'function' ? options : callback
|
callback = typeof options === 'function' ? options : callback
|
||||||
|
|
||||||
fs.open(blobPath, 'r', function(err: Error, fd: number) {
|
originalFsMethods.open(blobPath, 'r', function(err: Error, fd: number) {
|
||||||
if (err) return callback(err, null)
|
if (err) return callback(err, null)
|
||||||
fs.read(fd, Buffer.alloc(length), 0, length, resourceOffset, function(
|
originalFsMethods.read(fd, Buffer.alloc(length), 0, length, resourceOffset, function(
|
||||||
error: Error,
|
error: Error,
|
||||||
bytesRead: number,
|
bytesRead: number,
|
||||||
result: Buffer
|
result: Buffer
|
||||||
) {
|
) {
|
||||||
if (error) {
|
if (error) {
|
||||||
return fs.close(fd, function() {
|
return originalFsMethods.close(fd, function() {
|
||||||
callback(error, null)
|
callback(error, null)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
fs.close(fd, function(err: Error) {
|
originalFsMethods.close(fd, function(err: Error) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err, result)
|
return callback(err, result)
|
||||||
}
|
}
|
||||||
@@ -223,7 +227,7 @@ function shimFs(binary: NexeBinary, fs: any = require('fs')) {
|
|||||||
const resourceOffset = resourceStart + offset
|
const resourceOffset = resourceStart + offset
|
||||||
const opts = fileOpts(options)
|
const opts = fileOpts(options)
|
||||||
|
|
||||||
return fs.createReadStream(
|
return originalFsMethods.createReadStream(
|
||||||
blobPath,
|
blobPath,
|
||||||
Object.assign({}, opts, {
|
Object.assign({}, opts, {
|
||||||
start: resourceOffset,
|
start: resourceOffset,
|
||||||
@@ -240,10 +244,10 @@ function shimFs(binary: NexeBinary, fs: any = require('fs')) {
|
|||||||
const [offset, length] = entry
|
const [offset, length] = entry
|
||||||
const resourceOffset = resourceStart + offset
|
const resourceOffset = resourceStart + offset
|
||||||
const encoding = fileOpts(options).encoding
|
const encoding = fileOpts(options).encoding
|
||||||
const fd = fs.openSync(process.execPath, 'r')
|
const fd = originalFsMethods.openSync(process.execPath, 'r')
|
||||||
const result = Buffer.alloc(length)
|
const result = Buffer.alloc(length)
|
||||||
fs.readSync(fd, result, 0, length, resourceOffset)
|
originalFsMethods.readSync(fd, result, 0, length, resourceOffset)
|
||||||
fs.closeSync(fd)
|
originalFsMethods.closeSync(fd)
|
||||||
return encoding ? result.toString(encoding) : result
|
return encoding ? result.toString(encoding) : result
|
||||||
},
|
},
|
||||||
statSync: function statSync(filepath: string | Buffer) {
|
statSync: function statSync(filepath: string | Buffer) {
|
||||||
|
|||||||
+1
-1
@@ -80,7 +80,7 @@ const alias = {
|
|||||||
b: 'build',
|
b: 'build',
|
||||||
n: 'name',
|
n: 'name',
|
||||||
r: 'resource',
|
r: 'resource',
|
||||||
a: 'resource',
|
a: 'asset',
|
||||||
p: 'python',
|
p: 'python',
|
||||||
f: 'flag',
|
f: 'flag',
|
||||||
c: 'configure',
|
c: 'configure',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { NexeCompiler } from '../compiler'
|
import { NexeCompiler } from '../compiler'
|
||||||
import { parse } from 'cherow'
|
import { parse } from 'cherow'
|
||||||
import { semverGt } from '../util'
|
import { wrap, semverGt } from '../util'
|
||||||
|
|
||||||
function walkSome(node: any, visit: Function) {
|
function walkSome(node: any, visit: Function) {
|
||||||
if (!node || typeof node.type !== 'string' || node._visited) {
|
if (!node || typeof node.type !== 'string' || node._visited) {
|
||||||
@@ -29,6 +29,8 @@ export default async function main(compiler: NexeCompiler, next: () => Promise<v
|
|||||||
|
|
||||||
if (version.startsWith('4.')) {
|
if (version.startsWith('4.')) {
|
||||||
bootFile = 'src/node.js'
|
bootFile = 'src/node.js'
|
||||||
|
} else if (semverGt(version, '11.99')) {
|
||||||
|
bootFile = 'lib/internal/bootstrap/pre_execution.js'
|
||||||
} else if (semverGt(version, '9.10.1')) {
|
} else if (semverGt(version, '9.10.1')) {
|
||||||
bootFile = 'lib/internal/bootstrap/node.js'
|
bootFile = 'lib/internal/bootstrap/node.js'
|
||||||
}
|
}
|
||||||
@@ -56,9 +58,23 @@ export default async function main(compiler: NexeCompiler, next: () => Promise<v
|
|||||||
fileLines.splice(location.start.line, 0, '{{replace:lib/fs/bootstrap.js}}' + '\n')
|
fileLines.splice(location.start.line, 0, '{{replace:lib/fs/bootstrap.js}}' + '\n')
|
||||||
file.contents = fileLines.join('\n')
|
file.contents = fileLines.join('\n')
|
||||||
|
|
||||||
await compiler.setFileContentsAsync(
|
if (semverGt(version, '11.99')) {
|
||||||
'lib/_third_party_main.js',
|
await compiler.replaceInFileAsync(
|
||||||
'{{replace:lib/patches/boot-nexe.js}}'
|
bootFile,
|
||||||
)
|
'initializePolicy();',
|
||||||
|
'initializePolicy();\n' + wrap('{{replace:lib/patches/boot-nexe.js}}')
|
||||||
|
)
|
||||||
|
await compiler.replaceInFileAsync(
|
||||||
|
'src/node.cc',
|
||||||
|
'MaybeLocal<Value> StartMainThreadExecution(Environment* env) {',
|
||||||
|
'MaybeLocal<Value> StartMainThreadExecution(Environment* env) {\n' +
|
||||||
|
' return StartExecution(env, "internal/main/run_main_module");\n'
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
await compiler.setFileContentsAsync(
|
||||||
|
'lib/_third_party_main.js',
|
||||||
|
'{{replace:lib/patches/boot-nexe.js}}'
|
||||||
|
)
|
||||||
|
}
|
||||||
return next()
|
return next()
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-2
@@ -2,7 +2,7 @@ import { NexeCompiler, NexeError } from '../compiler'
|
|||||||
import { resolve, relative } from 'path'
|
import { resolve, relative } from 'path'
|
||||||
import { each } from '@calebboyd/semaphore'
|
import { each } from '@calebboyd/semaphore'
|
||||||
import resolveFiles, { resolveFileNameSync } from 'resolve-dependencies'
|
import resolveFiles, { resolveFileNameSync } from 'resolve-dependencies'
|
||||||
import { dequote, STDIN_FLAG } from '../util'
|
import { dequote, STDIN_FLAG, semverGt } from '../util'
|
||||||
import { Readable } from 'stream'
|
import { Readable } from 'stream'
|
||||||
|
|
||||||
function getStdIn(stdin: Readable): Promise<string> {
|
function getStdIn(stdin: Readable): Promise<string> {
|
||||||
@@ -29,7 +29,12 @@ export default async function bundle(compiler: NexeCompiler, next: any) {
|
|||||||
const { bundle, cwd, input: inputPath } = compiler.options
|
const { bundle, cwd, input: inputPath } = compiler.options
|
||||||
let input = inputPath
|
let input = inputPath
|
||||||
compiler.entrypoint = './' + relative(cwd, input)
|
compiler.entrypoint = './' + relative(cwd, input)
|
||||||
compiler.startup = ';require("module").runMain();'
|
|
||||||
|
if (semverGt(compiler.target.version, '11.99')) {
|
||||||
|
compiler.startup = ''
|
||||||
|
} else {
|
||||||
|
compiler.startup = ';require("module").runMain();'
|
||||||
|
}
|
||||||
|
|
||||||
if (!bundle) {
|
if (!bundle) {
|
||||||
await compiler.addResource(resolve(cwd, input))
|
await compiler.addResource(resolve(cwd, input))
|
||||||
|
|||||||
+2
-2
@@ -41,7 +41,7 @@ async function build() {
|
|||||||
else if (isWindows) target = windowsBuild
|
else if (isWindows) target = windowsBuild
|
||||||
else if (isMac) target = macBuild
|
else if (isMac) target = macBuild
|
||||||
else if (isLinux) target = linux
|
else if (isLinux) target = linux
|
||||||
if (buildHost === 'alpine') target = alpine
|
if (buildHost.includes('alpine')) target = alpine
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
return console.log('Nothing to build...')
|
return console.log('Nothing to build...')
|
||||||
@@ -67,7 +67,7 @@ async function build() {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
[/*'arm7l', 'arm6l', 'arm64', */ 'alpine'].includes(target.platform) &&
|
[/*'arm7l', 'arm6l', 'arm64', */ 'alpine'].includes(target.platform) &&
|
||||||
buildHost === 'alpine'
|
buildHost.includes('alpine')
|
||||||
) {
|
) {
|
||||||
await runDockerBuild(target)
|
await runDockerBuild(target)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
-58
@@ -1,58 +0,0 @@
|
|||||||
import { NexeTarget } from '../lib/releases'
|
|
||||||
import got = require('got')
|
|
||||||
import * as assert from 'assert'
|
|
||||||
import { getTarget } from '../lib/target'
|
|
||||||
const { env } = process
|
|
||||||
|
|
||||||
export function triggerMacBuild(release: NexeTarget, branch: string) {
|
|
||||||
assert.ok(env.CIRCLE_TOKEN)
|
|
||||||
const circle = `https://circleci.com/api/v1.1/project/github/nexe/nexe/tree/${branch}?circle-token=${
|
|
||||||
env.CIRCLE_TOKEN
|
|
||||||
}`
|
|
||||||
return got(circle, {
|
|
||||||
json: true,
|
|
||||||
body: {
|
|
||||||
build_parameters: {
|
|
||||||
NEXE_VERSION: release.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function triggerDockerBuild(release: NexeTarget, branch: string) {
|
|
||||||
assert.ok(env.TRAVIS_TOKEN)
|
|
||||||
const travis = `https://api.travis-ci.org/repo/nexe%2Fnexe/requests`
|
|
||||||
return got(travis, {
|
|
||||||
json: true,
|
|
||||||
body: {
|
|
||||||
request: {
|
|
||||||
branch: branch,
|
|
||||||
config: {
|
|
||||||
merge_mode: 'deep_merge',
|
|
||||||
env: {
|
|
||||||
//use matrix so that secure global variable is merged
|
|
||||||
matrix: {
|
|
||||||
NEXE_VERSION: release.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
headers: {
|
|
||||||
'Travis-API-Version': '3',
|
|
||||||
Authorization: `token ${env.TRAVIS_TOKEN}`
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function triggerWindowsBuild(release: NexeTarget) {
|
|
||||||
const version = 'NEXE_VERSION' in env ? env.NEXE_VERSION!.trim() : release.toString()
|
|
||||||
if (getTarget(version).version.startsWith('10.')) {
|
|
||||||
if ((env.APPVEYOR_BUILD_WORKER_IMAGE || '').includes('2017')) {
|
|
||||||
env.NEXE_VERSION = version
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
env.NEXE_VERSION = version
|
|
||||||
}
|
|
||||||
return Promise.resolve()
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user