mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Upgrade beta version of next for "with-dynamic-import" example (#2262)
* temporary commit * fixed eslint & parse error when precommit * upgrade new beta version for stability
This commit is contained in:
parent
c72435fe5c
commit
7b62ef3ba6
|
@ -10,7 +10,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"async-reactor": "^1.1.1",
|
"async-reactor": "^1.1.1",
|
||||||
"next": "^3.0.0-beta3",
|
"next": "^3.0.0-beta13",
|
||||||
"react": "^15.4.2",
|
"react": "^15.4.2",
|
||||||
"react-dom": "^15.4.2"
|
"react-dom": "^15.4.2"
|
||||||
},
|
},
|
||||||
|
|
27
flyfile.js
27
flyfile.js
|
@ -2,35 +2,35 @@ const notifier = require('node-notifier')
|
||||||
const childProcess = require('child_process')
|
const childProcess = require('child_process')
|
||||||
const isWindows = /^win/.test(process.platform)
|
const isWindows = /^win/.test(process.platform)
|
||||||
|
|
||||||
export async function compile(fly) {
|
export async function compile (fly) {
|
||||||
await fly.parallel(['bin', 'server', 'lib', 'client'])
|
await fly.parallel(['bin', 'server', 'lib', 'client'])
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function bin(fly, opts) {
|
export async function bin (fly, opts) {
|
||||||
await fly.source(opts.src || 'bin/*').babel().target('dist/bin', {mode: 0755})
|
await fly.source(opts.src || 'bin/*').babel().target('dist/bin', {mode: parseInt('0755', 8)})
|
||||||
notify('Compiled binaries')
|
notify('Compiled binaries')
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function lib(fly, opts) {
|
export async function lib (fly, opts) {
|
||||||
await fly.source(opts.src || 'lib/**/*.js').babel().target('dist/lib')
|
await fly.source(opts.src || 'lib/**/*.js').babel().target('dist/lib')
|
||||||
notify('Compiled lib files')
|
notify('Compiled lib files')
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function server(fly, opts) {
|
export async function server (fly, opts) {
|
||||||
await fly.source(opts.src || 'server/**/*.js').babel().target('dist/server')
|
await fly.source(opts.src || 'server/**/*.js').babel().target('dist/server')
|
||||||
notify('Compiled server files')
|
notify('Compiled server files')
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function client(fly, opts) {
|
export async function client (fly, opts) {
|
||||||
await fly.source(opts.src || 'client/**/*.js').babel().target('dist/client')
|
await fly.source(opts.src || 'client/**/*.js').babel().target('dist/client')
|
||||||
notify('Compiled client files')
|
notify('Compiled client files')
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function copy(fly) {
|
export async function copy (fly) {
|
||||||
await fly.source('pages/**/*.js').target('dist/pages')
|
await fly.source('pages/**/*.js').target('dist/pages')
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function build(fly) {
|
export async function build (fly) {
|
||||||
await fly.serial(['copy', 'compile'])
|
await fly.serial(['copy', 'compile'])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ export default async function (fly) {
|
||||||
await fly.watch('lib/**/*.js', ['lib'])
|
await fly.watch('lib/**/*.js', ['lib'])
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function release(fly) {
|
export async function release (fly) {
|
||||||
await fly.clear('dist').start('build')
|
await fly.clear('dist').start('build')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,24 +52,25 @@ export async function release(fly) {
|
||||||
// Even though we kill this task's process, chromedriver exists throughout
|
// Even though we kill this task's process, chromedriver exists throughout
|
||||||
// the lifetime of the original npm script.
|
// the lifetime of the original npm script.
|
||||||
|
|
||||||
export async function pretest(fly) {
|
export async function pretest (fly) {
|
||||||
const processName = isWindows ? 'chromedriver.cmd' : 'chromedriver'
|
const processName = isWindows ? 'chromedriver.cmd' : 'chromedriver'
|
||||||
|
// eslint-disable-next-line
|
||||||
const chromedriver = childProcess.spawn(processName, { stdio: 'inherit' })
|
const chromedriver = childProcess.spawn(processName, { stdio: 'inherit' })
|
||||||
// We need to do this, otherwise this task's process will keep waiting.
|
// We need to do this, otherwise this task's process will keep waiting.
|
||||||
setTimeout(() => process.exit(0), 2000)
|
setTimeout(() => process.exit(0), 2000)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function posttest(fly) {
|
export async function posttest (fly) {
|
||||||
try {
|
try {
|
||||||
const cmd = isWindows ? 'taskkill /im chromedriver* /t /f' : 'pkill chromedriver'
|
const cmd = isWindows ? 'taskkill /im chromedriver* /t /f' : 'pkill chromedriver'
|
||||||
childProcess.execSync(cmd, { stdio: 'ignore' })
|
childProcess.execSync(cmd, { stdio: 'ignore' })
|
||||||
} catch(err) {
|
} catch (err) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// notification helper
|
// notification helper
|
||||||
function notify(msg) {
|
function notify (msg) {
|
||||||
return notifier.notify({
|
return notifier.notify({
|
||||||
title: '▲ Next',
|
title: '▲ Next',
|
||||||
message: msg,
|
message: msg,
|
||||||
|
|
Loading…
Reference in a new issue