-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathonerepo.config.ts
79 lines (72 loc) · 2.11 KB
/
onerepo.config.ts
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
import type { Config } from 'onerepo';
import { docgen } from '@onerepo/plugin-docgen';
import { eslint } from '@onerepo/plugin-eslint';
import { jest } from '@onerepo/plugin-jest';
import { vitest } from '@onerepo/plugin-vitest';
import { prettier } from '@onerepo/plugin-prettier';
import { typescript } from '@onerepo/plugin-typescript';
import { performanceWriter } from '@onerepo/plugin-performance-writer';
export default {
root: true,
changes: {
filenames: 'human',
prompts: 'guided',
formatting: {
commit: '([${ref.short}](https://github.com/paularmstrong/onerepo/commit/${ref}))',
footer:
'> View the full changelog: [${fromRef.short}...${throughRef.short}](https://github.com/paularmstrong/onerepo/compare/${fromRef}...${throughRef})',
},
},
dependencies: {
dedupe: true,
},
templateDir: './config/templates',
validation: {
schema: './config/graph-schema.ts',
},
ignore: ['**/README.md', '**/CHANGELOG.md'],
plugins: [
docgen({
outWorkspace: 'root',
outFile: './docs/src/content/docs/plugins/docgen/example.mdx',
format: 'markdown',
safeWrite: true,
}),
jest(),
vitest(),
eslint({ extensions: ['ts', 'tsx', 'js', 'jsx', 'cjs', 'mjs', 'astro'] }),
prettier(),
typescript({ tsconfig: 'tsconfig.json', useProjectReferences: true }),
performanceWriter(),
],
tasks: {
'pre-commit': {
serial: [
{ match: '**/onerepo.config.*', cmd: ['$0 codeowners sync --add'] },
['$0 lint --staged --add', '$0 format --staged --add'],
'$0 tsc --staged',
],
parallel: [{ match: '**/package.json', cmd: '$0 graph verify' }, '$0 change verify'],
},
'pre-merge': {
serial: [['$0 lint --all --no-fix', '$0 format --check'], '$0 test -a', '$0 jest -a', '$0 tsc', '$0 build'],
parallel: [
{ match: '**/package.json', cmd: '$0 graph verify' },
{ match: '**/onerepo.config.*', cmd: ['$0 codeowners verify'] },
'$0 change verify',
],
},
build: {
serial: ['$0 build -w ${workspaces}'],
},
'pre-publish': {
serial: ['$0 build -w ${workspaces}'],
},
},
codeowners: {
'*': ['@paularmstrong'],
},
vcs: {
autoSyncHooks: true,
},
} satisfies Config;