-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.js
31 lines (27 loc) · 1.14 KB
/
tasks.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Cleans the project.
export async function clean() {
await folder('target').delete().exec()
}
// Runs the example project.
export async function start(target = 'target/example') {
await file(`${target}/index.js`).create().exec()
await Promise.all([
shell(`tsc-bundle example/tsconfig.json --outFile ${target}/index.js --watch`).exec(),
shell(`cd ${target} && smoke-run index.js -x node index.js`).exec()
])
}
// Runs the specs for this project.
export async function spec(target = 'target/spec') {
await shell(`tsc-bundle ./spec/tsconfig.json --outFile ${target}/index.js`).exec()
await shell(`cd ${target} && mocha ./index.js`).exec()
}
// Builds this package and packs it for npm publishing.
export async function build(target = 'target/build') {
await clean()
await shell(`tsc -p ./src/tsconfig.json --outDir ${target}`).exec()
await folder(`${target}`).add('package.json').exec()
await folder(`${target}`).add('readme.md').exec()
await folder(`${target}`).add('license').exec()
await shell(`cd ${target} && npm pack`).exec()
// npm publish sinclair-servicebox-0.x.x.tgz --access=public
}