-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_compile.mjs
executable file
·64 lines (55 loc) · 1.75 KB
/
_compile.mjs
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
#!/usr/bin/env node
import jsmake from "./jsmake.js";
jsmake.includeSource('_compile.mjs')
jsmake.includeSource('jsmake.js')
jsmake.includeSource('package.json')
jsmake.includeSource('README.md')
jsmake.includeSource('jsmake.d.ts')
jsmake.includeSource('index.js')
jsmake.includeSource('tsconfig.json')
jsmake.includeSource('.hintrc')
jsmake.includeSource('LICENSE')
jsmake.task('publish', async () => {
await jsmake.buildTask('cleandbg')
if (jsmake.newer('jsmake.js', 'jsmake.d.ts')) {
await jsmake.buildTask('gendecl')
}
await jsmake.buildTask('push-git-for-release')
await jsmake.nodePack.patch()
await jsmake.nodePack.publish()
})
jsmake.task('cleandbg', async () => {
jsmake.dir('.', (path) => {
if (!jsmake.isIncluded(path) && !path.startsWith('.')) {
jsmake.rm(path)
console.log(`Cleared: ${path}`)
}
})
})
jsmake.task('debug', async () => {
await jsmake.dir(".", (fn) => {
console.log(`${fn} : ${jsmake.isIncluded(fn)}`)
})
console.log(jsmake.exists("jsmake.js"))
console.log(jsmake.newer('jsmake.js', 'package.json'))
console.log(jsmake.git.isGitted())
await jsmake.shell("echo hello,world");
await jsmake.shellRaw(["echo", "hello, world !!!"])
await jsmake.shell("lsd -l")
await jsmake.shell("echo \"Hello, World!\"")
})
jsmake.task('gendecl', async () => {
await jsmake.npm('run', 'gen_decl')
})
jsmake.task('push-git-for-release', async () => {
if (!jsmake.git.isGitted()) {
await jsmake.buildTask('enable-git')
}
await jsmake.git.add('.')
await jsmake.git.commit('[chore] ready for release')
await jsmake.git.push()
});
jsmake.task('enable-git', async () => {
await jsmake.git.init()
})
jsmake.build()