-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.js
76 lines (68 loc) · 3.03 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
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
const Start = require('start').default,
reporter = require('octopus-start-reporter'),
modules = require('octopus-start-preset-modules'),
dependencies = require('octopus-start-preset-dependencies'),
startTasks = require('octopus-start-tasks'),
startModulesTasks = require('octopus-start-modules-tasks'),
prepush = require('octopus-start-preset-prepush'),
idea = require('octopus-start-preset-idea'),
depcheck = require('octopus-start-preset-depcheck'),
markdownMagic = require('markdown-magic');
const start = Start(reporter());
module.exports['modules:list'] = () => start(modules.list());
module.exports['modules:where'] = moduleName => start(modules.where(moduleName));
module.exports['modules:sync'] = () => start(modules.sync());
module.exports['deps:sync'] = () => start(dependencies.sync());
module.exports['deps:unmanaged'] = () => start(dependencies.unmanaged());
module.exports['deps:extraneous'] = () => start(dependencies.extraneous());
module.exports['deps:latest'] = () => start(dependencies.latest());
module.exports['idea'] = () => start(idea());
module.exports['init'] = () => start(prepush());
module.exports['depcheck'] = () => start(depcheck({ignoreMatches: ['start-simple-cli']}));
module.exports.sync = () => start(
modules.sync(),
dependencies.sync(),
dependencies.unmanaged(),
dependencies.extraneous(),
module.exports.docs
)
module.exports.bootstrap = () => start(
startModulesTasks.modules.load(),
startModulesTasks.modules.removeUnchanged('bootstrap'),
startModulesTasks.iter.async()((module, input, asyncReporter) => Start(asyncReporter)(
startTasks.ifTrue(module.dependencies.length > 0)(() =>
Start(asyncReporter)(startModulesTasks.module.exec(module)(`npm link ${module.dependencies.map(item => item.name).join(' ')}`))
),
startModulesTasks.module.exec(module)('npm install --cache-min 3600 && npm link'),
startModulesTasks.module.markBuilt(module, 'bootstrap')
))
)
module.exports.test = () => start(
startModulesTasks.modules.load(),
startModulesTasks.modules.removeUnchanged('test'),
startModulesTasks.iter.async()((module, input, asyncReporter) => Start(asyncReporter)(
startModulesTasks.module.exec(module)('npm run test'),
startModulesTasks.module.markBuilt(module, 'test')
))
)
module.exports.clean = () => start(
startModulesTasks.modules.load(),
startModulesTasks.iter.async()((module, input, asyncReporter) => Start(asyncReporter)(
startModulesTasks.module.exec(module)('rm -rf node_modules && rm -rf target && rm -f npm-shrinkwarp.json && rm -f yarn.lock && rm -f npm-debug.log*')
)
)
)
module.exports.release = () => start(
startModulesTasks.modules.load(),
startModulesTasks.iter.async()((module, input, asyncReporter) => Start(asyncReporter)(
startModulesTasks.module.exec(module)('npm run release'),
startModulesTasks.module.exec(module)('npm publish || true')
))
)
module.exports.docs = () => start(() => {
return function generateDocs(log /*, reporter*/) {
return Promise.resolve().then(() => {
markdownMagic('./*.md');
})
}
});