refactor: move startup scripts to shims, add plugins

This commit is contained in:
calebboyd
2017-09-26 20:16:03 -05:00
parent b822984776
commit 11fa087e9d
26 changed files with 2573 additions and 3205 deletions
-1
View File
@@ -1 +0,0 @@
package-lock=false
+5 -3
View File
@@ -1,4 +1,4 @@
import { NexeCompiler } from 'nexe'
import { NexeCompiler, NexeOptions } from 'nexe'
import { readFileSync } from 'fs'
import { join } from 'path'
@@ -9,6 +9,8 @@ interface NexeDaemonOptions {
executable: string
}
type DaemonOptions = NexeOptions & { daemon: { windows: NexeDaemonOptions } }
function renderWinswConfig(options: any) {
return '<configuration>\r\n' +
`${Object.keys(options).reduce((config: string, element: string) => {
@@ -16,7 +18,7 @@ function renderWinswConfig(options: any) {
}, '')}</configuration>\r\n`
}
export default function daemon (compiler: NexeCompiler, next: () => Promise<void>) {
export default function daemon (compiler: NexeCompiler<DaemonOptions>, next: () => Promise<void>) {
if (compiler.target.platform !== 'windows') {
return next()
}
@@ -42,7 +44,7 @@ export default function daemon (compiler: NexeCompiler, next: () => Promise<void
'./nexe/plugin/daemon/app.js',
Buffer.from(compiler.input)
)
compiler.input = `{{replace:plugins/nexe-daemon/nexe-deamon.js}}`
compiler.input = '{{replace:plugins/nexe-daemon/lib/nexe-daemon.js}}'
return next()
}
+4
View File
@@ -0,0 +1,4 @@
console.log('hello world')
if (true) {
console.log('wat')
}
+1 -1
View File
@@ -3,7 +3,7 @@
"target": "es5",
"module": "commonjs",
"lib": [ "es2016" ],
"outDir": ".",
"outDir": "lib",
"strict": true
},
"include": [
File diff suppressed because it is too large Load Diff