This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Takefile
83 lines (81 loc) · 2.12 KB
/
Takefile
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
const { join } = require('path');
module.exports = (take) => {
take.options.shell.printStdout = true;
take.options.shell.printStderr = true;
return {
'': {
desc: 'Clean & build',
deps: ['clean', 'build']
},
build: {
desc: 'Builds Take',
async execute() {
await take.exec('tsc');
}
},
clean: {
desc: 'Cleans up build output',
async execute() {
await take.exec('rm', '-rf', 'dist');
}
},
test: {
desc: 'Tests Take',
async execute() {
// use ts-node to allow proper source mapping and not require building
await take.exec(
'./node_modules/.bin/nyc',
'./node_modules/mocha/bin/mocha',
'-r', 'ts-node/register',
'-r', 'source-map-support/register',
'test/**/*.spec.ts'
);
},
children: {
'run-local': {
desc: 'Runs the local version of take using ts-node and the given arguments',
async execute(...args) {
console.log('--- execution output ---');
await take.shell(
'ts-node',
[
'-P', '../tsconfig.json',
'../src/bin/cli.ts', ...args
],
{
echo: false,
spawn: {
cwd: join(__dirname, 'test')
}
}
);
}
},
coverage: {
async execute() {
await take.exec('nyc report --reporter=text-lcov | coveralls');
}
}
}
},
lint: {
desc: 'Lints the src/ folder',
async execute() {
await take.exec('tslint', '--project', '.');
await take.exec('tslint', '--project', 'test');
}
},
publish: {
desc: 'Publishes Take to npm',
deps: [
':', ':test'
],
async execute() {
await take.exec('yarn', 'publish');
await take.exec('git', 'push', 'origin', '--tags');
await take.exec('git', 'push');
await take.exec('yarn', 'global', 'upgrade', '@luvies/take', '--latest');
}
}
};
};