Repository navigation
Expand file tree
/
Copy pathknip.config.js
More file actions
113 lines (108 loc) · 4.84 KB
/
Copy pathknip.config.js
File metadata and controls
113 lines (108 loc) · 4.84 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
Knip is an export–import dependency checker.
If you want to use it, call pnpm knip.
You can also add " && knip" to "pre-push" and "check" in the root package.json
to make it part of your development process.
Some exports may throw errors during setup because the configuration below is prepared
for the full version of the Workflow Builder.
But knip is a very useful tool, so after resolving these issues, it will be useful for you.
*/
/**
* @type {import('knip').KnipConfig}
*/
export default {
ignore: ['.claude/**'],
workspaces: {
'apps/demo': {
entry: ['src/main.tsx'],
project: ['src/**/*.{ts,tsx}', '!src/app/plugins/**/libs/**/*.{ts,tsx}'],
ignoreDependencies: ['anymatch', 'javascript-obfuscator', 'html-to-image', 'jspdf', 'libavoid-js', 'web-worker'],
},
'apps/icons': {
entry: ['index.ts', 'src/generate-icons.ts'],
project: '**/*.{ts,tsx}',
// svgr is run as a binary from generate-icons.ts, never imported, so knip
// cannot see it. Removing it sends the icons build back to fetching svgr
// over the network on every run.
ignoreDependencies: ['@phosphor-icons/core', '@svgr/cli'],
},
'apps/tools': {
entry: ['src/scripts/*.ts'],
project: 'src/**/*.ts',
},
'packages/types': {
project: '**/*.ts',
},
'packages/sdk': {
entry: ['src/index.ts', 'src/**/*.{ts,tsx}', 'vite.config.mts'],
project: ['src/**/*.{ts,tsx}', 'vite.config.mts'],
},
'apps/backend': {
entry: ['src/server.ts', 'drizzle.config.ts'],
},
'packages/execution-core': {
entry: ['src/index.ts'],
},
'packages/ai-config': {
entry: ['src/index.ts'],
},
'packages/temporal-connection': {
// test/fixtures/tls-probe-workflow.ts is handed to Temporal's bundler by path, so nothing imports it
entry: ['src/index.ts', 'test/fixtures/tls-probe-workflow.ts'],
project: ['src/**/*.ts', 'test/**/*.ts'],
// Never imported here, but Temporal's workflow bundler resolves it from this
// workspace while compiling the test fixture.
ignoreDependencies: ['@temporalio/workflow'],
},
'apps/execution-worker': {
entry: ['src/engines/temporal/worker.ts', 'src/engines/temporal/workflows.ts'],
// @temporalio/workflow is never imported by this app's code, but Temporal's
// workflow bundler resolves it from *here* while compiling workflows.ts (the
// re-exported runner imports it), so it has to be installed in this workspace.
// Removing it makes the bundler fail at worker startup, not at build time.
// @temporalio/plugin is a peer of @workflowbuilder/temporal that this app has to satisfy; the
// plugin instance comes from @workflowbuilder/temporal, so the name is never imported here.
ignoreDependencies: ['@temporalio/workflow', '@temporalio/plugin'],
},
'apps/docs': {
entry: ['astro.config.mjs', 'src/components/**/*.astro'],
project: ['**/*.{mjs,ts,astro}'],
ignoreDependencies: ['@iconify-json/ph'],
},
'packages/ui': {
entry: ['src/index.ts', 'vite.config.mts', 'scripts/check-built-css.ts'],
project: ['src/**/*.{ts,tsx}', '*.mts', 'scripts/**/*.ts'],
// Built tokens are copied by relative path (../tokens/dist) in vite.config,
// and the fontsource families feed the post-build font generator - real
// dependencies knip's JS/TS walk cannot see.
ignoreDependencies: ['@workflowbuilder/ui-tokens', '@fontsource/poppins', '@fontsource/inter'],
},
'packages/tokens': {
entry: ['src/index.ts'],
project: ['src/**/*.ts', 'config.ts'],
},
'packages/mcp-server': {
entry: ['src/index.ts', 'scripts/*.ts'],
// The fixture sources are TypeDoc input, read through the generated JSON next to them.
project: ['src/**/*.ts', 'scripts/**/*.ts', '!src/__fixtures__/typedoc-src/**'],
},
'packages/temporal': {
// test/fixtures/workflows.ts is an entry in its own right: the bundling test
// hands it to Temporal's workflow bundler by path, so nothing imports it.
entry: [
'src/index.ts',
'src/client/index.ts',
'src/workflow/index.ts',
'tsup.config.ts',
'test/fixtures/workflows.ts',
],
project: ['src/**/*.ts', 'test/**/*.ts', 'tsup.config.ts'],
// Both are bundled into dist through src/core-contract.ts, which imports them
// by relative path (see the note there), so the workspace deps are real even
// though they are never imported by name. @temporalio/worker is an optional peer
// (a consumer that runs a Worker supplies it) that only the tests import, from the
// devDependency; knip flags every referenced optional peer, so it is listed here.
ignoreDependencies: ['@workflow-builder/execution-core', '@workflow-builder/types', '@temporalio/worker'],
},
},
};