-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtasks.ts
More file actions
63 lines (61 loc) · 2.66 KB
/
tasks.ts
File metadata and controls
63 lines (61 loc) · 2.66 KB
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
import { Task } from 'tasksmith'
const VERSION = '0.11.4'
// ------------------------------------------------------------------
// Clean
// ------------------------------------------------------------------
Task.run('clean', () => Task.folder('target').delete())
// ------------------------------------------------------------------
// Format
// ------------------------------------------------------------------
Task.run('format', () => Task.shell('deno fmt src test'))
// ------------------------------------------------------------------
// Lint
// ------------------------------------------------------------------
Task.run('lint', () => Task.shell('deno lint src'))
// ------------------------------------------------------------------
// Start
// ------------------------------------------------------------------
Task.run('start', () => Task.shell('deno run -A --watch example/index.ts'))
// ------------------------------------------------------------------
// Test
// ------------------------------------------------------------------
Task.run('test', async (filter: string = '') =>
Task.shell('deno lint src').catch(() => null).then(() =>
Task.test.run(['test/parsebox'], { filter }))
)
// ------------------------------------------------------------------
// Fast
// ------------------------------------------------------------------
Task.run('fast', async (filter: string = '') => Task.test.run(['test/parsebox'], { watch: true, noCheck: true, filter }))
// ------------------------------------------------------------------
// Report
// ------------------------------------------------------------------
Task.run('report', async () => Task.test.report(['test/parsebox']))
// ------------------------------------------------------------------
// Build
// ------------------------------------------------------------------
Task.run('build', () => Task.build.dual('src', {
compiler: '6.0.3',
outdir: 'target/build',
additional: ['license', 'readme.md'],
packageJson: {
name: '@sinclair/parsebox',
description: 'Parser Combinators in the TypeScript Type System',
version: VERSION,
keywords: ['typescript', 'parser', 'combinator'],
license: 'MIT',
author: 'sinclairzx81',
repository: {
type: 'git',
url: 'https://github.com/sinclairzx81/parsebox'
}
},
}))
// ------------------------------------------------------------------
// Publish
// ------------------------------------------------------------------
Task.run('publish', async (target: string = `target/build`) => {
const { version } = JSON.parse(await Task.file(`${target}/package.json`).read())
await Task.shell(`git tag ${version}`)
await Task.shell(`git push origin ${version}`)
})