@venizia/vulcan 0.4.9-0 → 0.4.9-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/extensions/vulcan-guards.ts +48 -41
- package/base/hooks/antigravity-guards.ts +2 -2
- package/base/hooks/codex-guards.ts +15 -5
- package/base/hooks/guard-git.ts +8 -8
- package/base/hooks/guard-manifest.ts +4 -5
- package/base/hooks/guard-outside.ts +8 -8
- package/base/hooks/guard-package.ts +5 -6
- package/base/hooks/guard-remote-hosts.ts +6 -7
- package/base/hooks/guard-scripting.ts +5 -6
- package/base/hooks/guard-writes.ts +8 -9
- package/base/hooks/post-tool.ts +2 -2
- package/base/hooks/prompt-submit.ts +2 -2
- package/base/hooks/session-start.ts +3 -3
- package/base/hooks/stop.ts +2 -2
- package/base/hooks/subagent-start.ts +2 -2
- package/base/skills/docs-update/SKILL.md +4 -2
- package/base/skills/visualize-work/SKILL.md +9 -0
- package/package.json +3 -3
- package/src/agents/atlas-block.ts +43 -43
- package/src/agents/codex-hooks.ts +45 -43
- package/src/agents/detect.ts +19 -16
- package/src/agents/exclude.ts +96 -97
- package/src/agents/hooks-json.ts +38 -36
- package/src/agents/local.ts +46 -43
- package/src/agents/prompt.ts +45 -42
- package/src/agents/render.ts +201 -195
- package/src/agents/resolve.ts +133 -134
- package/src/agents/table.ts +12 -8
- package/src/commands/add.command.ts +2 -2
- package/src/commands/agents.command.ts +11 -17
- package/src/commands/clean.command.ts +6 -6
- package/src/commands/doctor.command.ts +4 -4
- package/src/commands/init.command.ts +12 -8
- package/src/commands/preset.command.ts +2 -2
- package/src/commands/profile.command.ts +42 -49
- package/src/commands/sync.command.ts +109 -111
- package/src/commands/upgrade.command.ts +80 -75
- package/src/commands/visualize.command.ts +7 -13
- package/src/commands/x.command.ts +55 -50
- package/src/common/format.ts +23 -21
- package/src/common/json.ts +8 -5
- package/src/common/layout-folder.ts +94 -91
- package/src/common/paths.ts +14 -12
- package/src/config/loader.ts +52 -49
- package/src/config/packages.ts +14 -11
- package/src/config/schema.ts +3 -3
- package/src/create/add-app.ts +519 -509
- package/src/create/add-lib.ts +237 -240
- package/src/create/bunfig.ts +26 -23
- package/src/create/checks.ts +36 -34
- package/src/create/diff.ts +21 -23
- package/src/create/dockerignore.ts +26 -24
- package/src/create/files.ts +7 -5
- package/src/create/init-monorepo.ts +75 -80
- package/src/create/lib-preset.ts +59 -63
- package/src/create/manifest-json.ts +10 -4
- package/src/create/names.ts +217 -210
- package/src/create/next.ts +26 -23
- package/src/create/plan.ts +15 -12
- package/src/create/preset-diff.ts +301 -303
- package/src/create/preset-menu.ts +38 -32
- package/src/create/preset.ts +202 -197
- package/src/create/process.ts +79 -72
- package/src/create/scratch.ts +48 -49
- package/src/create/workspace.ts +404 -396
- package/src/doctor/checks.ts +1027 -1014
- package/src/doctor/makefile.ts +17 -13
- package/src/doctor/runner.ts +88 -118
- package/src/doctor/skills.ts +97 -95
- package/src/doctor/tags.ts +42 -37
- package/src/hooks/codex-patch.ts +25 -22
- package/src/hooks/command-view.ts +44 -39
- package/src/hooks/decision.ts +37 -37
- package/src/hooks/guard-git.ts +51 -49
- package/src/hooks/guard-manifest.ts +58 -55
- package/src/hooks/guard-outside.ts +93 -91
- package/src/hooks/guard-package.ts +82 -79
- package/src/hooks/guard-scripting.ts +19 -14
- package/src/hooks/guard-writes.ts +154 -149
- package/src/hooks/owner-reply.ts +127 -127
- package/src/hooks/post-tool.ts +94 -93
- package/src/hooks/project-guards.ts +65 -62
- package/src/hooks/project-tmp.ts +27 -24
- package/src/hooks/remote-hosts.ts +153 -130
- package/src/hooks/session-digest.ts +98 -101
- package/src/hooks/shell.ts +509 -499
- package/src/hooks/subagent-card.ts +11 -7
- package/src/hooks/trusted-scripts.ts +106 -104
- package/src/init/scaffold.ts +135 -132
- package/src/local/clean.ts +38 -36
- package/src/local/format.ts +21 -17
- package/src/local/scan.ts +144 -138
- package/src/manifest/render.ts +110 -104
- package/src/owner/card.ts +51 -46
- package/src/owner/profile.ts +99 -93
- package/src/owner/reply-switch.ts +9 -6
- package/src/owner/shape.ts +71 -69
- package/src/owner/survey.ts +173 -171
- package/src/owner/view.ts +62 -59
- package/src/owner/violations.ts +119 -123
- package/src/rules/base.ts +15 -11
- package/src/rules/parser.ts +39 -32
- package/src/rules/slots.ts +8 -6
- package/src/signals/claims.ts +30 -28
- package/src/signals/classify.ts +38 -33
- package/src/signals/loop.ts +39 -37
- package/src/signals/state.ts +79 -81
- package/src/skills/frontmatter.ts +28 -28
- package/src/sync/agent-files.ts +217 -199
- package/src/sync/agent-removal.ts +56 -59
- package/src/sync/atlas-block.ts +45 -43
- package/src/sync/base-rules.ts +32 -30
- package/src/sync/claude-launch.ts +36 -34
- package/src/sync/exclude.ts +77 -69
- package/src/sync/local-choice.ts +50 -47
- package/src/sync/planner.ts +59 -61
- package/src/sync/prune.ts +52 -48
- package/src/sync/settings.ts +166 -167
- package/src/ui/capability.ts +12 -7
- package/src/ui/keyboard.ts +38 -38
- package/src/ui/prompt.ts +79 -77
- package/src/visualize/assets.ts +33 -24
- package/src/visualize/charts.ts +179 -176
- package/src/visualize/compare-css.ts +3 -2
- package/src/visualize/compare-render.ts +9 -7
- package/src/visualize/diagrams.ts +189 -174
- package/src/visualize/grid-span.ts +34 -0
- package/src/visualize/icons.ts +7 -5
- package/src/visualize/kinds-render.ts +50 -45
- package/src/visualize/kinds-validate.ts +12 -10
- package/src/visualize/labels.ts +21 -17
- package/src/visualize/layout.ts +112 -97
- package/src/visualize/page.ts +92 -104
- package/src/visualize/render.ts +143 -140
- package/src/visualize/sections.ts +395 -384
- package/src/visualize/sources.ts +2 -2
- package/src/visualize/theme.ts +12 -10
- package/src/visualize/validate.ts +13 -9
- package/src/wiki/anchors.ts +38 -36
- package/src/wiki/command.ts +4 -4
- package/src/wiki/source-links.ts +46 -44
|
@@ -38,122 +38,125 @@ export class LayoutKeys {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (typeof folder !== 'string' || folder === '') {
|
|
46
|
-
return 'a folder is a non-empty string';
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (folder.includes('\\')) {
|
|
50
|
-
return `'${folder}' has a backslash: a folder is written with '/'`;
|
|
51
|
-
}
|
|
41
|
+
/** Whether `inner` is `outer` or sits below it. */
|
|
42
|
+
const isWithin = (opts: { inner: string; outer: string }): boolean =>
|
|
43
|
+
opts.inner === opts.outer || opts.inner.startsWith(`${opts.outer}/`);
|
|
52
44
|
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
export class LayoutFolder {
|
|
46
|
+
private static entriesOf(opts: { layout: ILayout }): { key: string; folder: string }[] {
|
|
47
|
+
return LayoutKeys.ALL.flatMap((key) =>
|
|
48
|
+
LayoutFolder.layoutFoldersOf({ value: opts.layout[key] }).map((folder) => ({ key, folder })),
|
|
49
|
+
);
|
|
55
50
|
}
|
|
56
51
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return `'${folder}' has more than ${LayoutFolderLimits.MAX_SEGMENTS} segments`;
|
|
61
|
-
}
|
|
52
|
+
/** Why a layout folder is not one, or undefined when it is: 1 to 4 segments, each a plain lower-case name. */
|
|
53
|
+
static layoutFolderProblem(opts: { folder: unknown }): string | undefined {
|
|
54
|
+
const { folder } = opts;
|
|
62
55
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return `'${folder}' has an empty segment`;
|
|
56
|
+
if (typeof folder !== 'string' || folder === '') {
|
|
57
|
+
return 'a folder is a non-empty string';
|
|
66
58
|
}
|
|
67
59
|
|
|
68
|
-
if (
|
|
69
|
-
return `'${folder}'
|
|
60
|
+
if (folder.includes('\\')) {
|
|
61
|
+
return `'${folder}' has a backslash: a folder is written with '/'`;
|
|
70
62
|
}
|
|
71
63
|
|
|
72
|
-
if (
|
|
73
|
-
return `'${folder}'
|
|
64
|
+
if (folder.startsWith('/') || folder.endsWith('/')) {
|
|
65
|
+
return `'${folder}' starts or ends with '/': a folder is a path from the project root`;
|
|
74
66
|
}
|
|
75
67
|
|
|
76
|
-
|
|
77
|
-
|
|
68
|
+
const segments = folder.split('/');
|
|
69
|
+
|
|
70
|
+
if (segments.length > LayoutFolderLimits.MAX_SEGMENTS) {
|
|
71
|
+
return `'${folder}' has more than ${LayoutFolderLimits.MAX_SEGMENTS} segments`;
|
|
78
72
|
}
|
|
79
|
-
}
|
|
80
73
|
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
for (const segment of segments) {
|
|
75
|
+
if (segment === '') {
|
|
76
|
+
return `'${folder}' has an empty segment`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (segment === '..' || segment === '.') {
|
|
80
|
+
return `'${folder}' climbs or repeats a folder ('${segment}')`;
|
|
81
|
+
}
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
if (LayoutFolderLimits.FORBIDDEN_SEGMENTS.has(segment)) {
|
|
84
|
+
return `'${folder}' goes through '${segment}'`;
|
|
85
|
+
}
|
|
87
86
|
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
if (!LayoutFolderLimits.SEGMENT_PATTERN.test(segment)) {
|
|
88
|
+
return `'${folder}' has the segment '${segment}': lowercase letters, digits and '-', starting with a letter or digit`;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return undefined;
|
|
90
93
|
}
|
|
91
94
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
};
|
|
95
|
+
/** The folders a layout value names, in order: a string is one, a list is its strings. Nothing is validated. */
|
|
96
|
+
static layoutFoldersOf(opts: { value: unknown }): string[] {
|
|
97
|
+
const { value } = opts;
|
|
96
98
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
if (typeof value === 'string') {
|
|
100
|
+
return [value];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return Array.isArray(value)
|
|
104
|
+
? value.filter((entry): entry is string => typeof entry === 'string')
|
|
105
|
+
: [];
|
|
106
|
+
}
|
|
100
107
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
) {
|
|
123
|
-
problems.push(
|
|
124
|
-
`layout.${entry.key} '${entry.folder}' and layout.${other.key} '${other.folder}' are nested: a package path must belong to exactly one folder`,
|
|
125
|
-
);
|
|
108
|
+
/** A folder listed twice or under two keys, and a folder inside another: a package path must belong to exactly one folder. */
|
|
109
|
+
static layoutOverlapProblems(opts: { layout: ILayout }): string[] {
|
|
110
|
+
const entries = LayoutFolder.entriesOf({ layout: opts.layout }).filter(
|
|
111
|
+
(entry) => LayoutFolder.layoutFolderProblem({ folder: entry.folder }) === undefined,
|
|
112
|
+
);
|
|
113
|
+
const problems: string[] = [];
|
|
114
|
+
|
|
115
|
+
for (const [index, entry] of entries.entries()) {
|
|
116
|
+
for (const other of entries.slice(index + 1)) {
|
|
117
|
+
if (entry.folder === other.folder) {
|
|
118
|
+
problems.push(
|
|
119
|
+
`layout.${other.key} names '${other.folder}' again (also layout.${entry.key}): a folder belongs to one kind of code`,
|
|
120
|
+
);
|
|
121
|
+
} else if (
|
|
122
|
+
isWithin({ inner: entry.folder, outer: other.folder }) ||
|
|
123
|
+
isWithin({ inner: other.folder, outer: entry.folder })
|
|
124
|
+
) {
|
|
125
|
+
problems.push(
|
|
126
|
+
`layout.${entry.key} '${entry.folder}' and layout.${other.key} '${other.folder}' are nested: a package path must belong to exactly one folder`,
|
|
127
|
+
);
|
|
128
|
+
}
|
|
126
129
|
}
|
|
127
130
|
}
|
|
131
|
+
|
|
132
|
+
return problems;
|
|
128
133
|
}
|
|
129
134
|
|
|
130
|
-
|
|
131
|
-
}
|
|
135
|
+
/** The layout value with `folder` in it: unchanged when it is there already, a string that grows into a list otherwise. */
|
|
136
|
+
static withLayoutFolder(opts: { value: TLayoutValue | undefined; folder: string }): TLayoutValue {
|
|
137
|
+
const folders = LayoutFolder.layoutFoldersOf({ value: opts.value });
|
|
132
138
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
folder: string;
|
|
137
|
-
}): TLayoutValue => {
|
|
138
|
-
const folders = layoutFoldersOf({ value: opts.value });
|
|
139
|
+
if (folders.includes(opts.folder)) {
|
|
140
|
+
return opts.value ?? opts.folder;
|
|
141
|
+
}
|
|
139
142
|
|
|
140
|
-
|
|
141
|
-
return opts.value ?? opts.folder;
|
|
143
|
+
return folders.length === 0 ? opts.folder : [...folders, opts.folder];
|
|
142
144
|
}
|
|
143
145
|
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
(folder) => layoutFolderProblem({ folder }) === undefined,
|
|
151
|
-
);
|
|
146
|
+
/** The valid folders of a layout value; a manifest is read through this, never trusted. */
|
|
147
|
+
static valid(opts: { value: unknown }): string[] {
|
|
148
|
+
return LayoutFolder.layoutFoldersOf({ value: opts.value }).filter(
|
|
149
|
+
(folder) => LayoutFolder.layoutFolderProblem({ folder }) === undefined,
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
152
|
|
|
153
|
-
/** The folders as a sentence part: `'a'`, or `'a', 'b'`. */
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
/** The folders as a sentence part: `'a'`, or `'a', 'b'`. */
|
|
154
|
+
static describe(opts: { folders: string[] }): string {
|
|
155
|
+
return opts.folders.map((folder) => `'${folder}'`).join(', ');
|
|
156
|
+
}
|
|
156
157
|
|
|
157
|
-
/** What an error says when a flag must pick among several listed folders. */
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
/** What an error says when a flag must pick among several listed folders. */
|
|
159
|
+
static listedNote(opts: { folders: string[] }): string {
|
|
160
|
+
return `the layout lists ${LayoutFolder.describe({ folders: opts.folders })}`;
|
|
161
|
+
}
|
|
162
|
+
}
|
package/src/common/paths.ts
CHANGED
|
@@ -9,19 +9,21 @@ export const BASE_DIRECTORY = join(PACKAGE_ROOT, 'base');
|
|
|
9
9
|
|
|
10
10
|
export const PACKAGE_NAME = '@venizia/vulcan';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
export class BaseDirectory {
|
|
13
|
+
/**
|
|
14
|
+
* The base as a project reaches it: through `node_modules/@venizia/vulcan` when that resolves to this
|
|
15
|
+
* package. bun's isolated install keeps the files in a hashed store directory that every upgrade
|
|
16
|
+
* replaces, so a link to the real path dies with the next upgrade; the stable path does not.
|
|
17
|
+
* Anywhere else - no install, or another copy installed - the real directory.
|
|
18
|
+
*/
|
|
19
|
+
static stableOf(opts: { root: string }): string {
|
|
20
|
+
const installed = join(opts.root, 'node_modules', PACKAGE_NAME, 'base');
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
22
|
+
return existsSync(installed) && realpathSync(installed) === realpathSync(BASE_DIRECTORY)
|
|
23
|
+
? installed
|
|
24
|
+
: BASE_DIRECTORY;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
25
27
|
|
|
26
28
|
export const VULCAN_VERSION: string = JSON.parse(
|
|
27
29
|
readFileSync(join(PACKAGE_ROOT, 'package.json'), 'utf8'),
|
package/src/config/loader.ts
CHANGED
|
@@ -12,65 +12,68 @@ type TLoadResult =
|
|
|
12
12
|
const describeError = (opts: { error: unknown }): string =>
|
|
13
13
|
opts.error instanceof Error ? opts.error.message : String(opts.error);
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export const loadConfig = async (opts: { root: string }): Promise<TLoadResult> => {
|
|
22
|
-
const files = findConfigFiles({ root: opts.root });
|
|
23
|
-
|
|
24
|
-
if (files.length === 0) {
|
|
25
|
-
return {
|
|
26
|
-
ok: false,
|
|
27
|
-
error: `no ${ConfigConstants.DIRECTORY}/${ConfigConstants.BASENAME}.* found in ${opts.root}`,
|
|
28
|
-
};
|
|
15
|
+
export class ConfigLoader {
|
|
16
|
+
/** Every `.configs/vulcan.config.<ext>` present, in lookup order. */
|
|
17
|
+
static findFiles(opts: { root: string }): string[] {
|
|
18
|
+
return ConfigExtensions.LOOKUP_ORDER.map((extension) =>
|
|
19
|
+
join(opts.root, ConfigConstants.DIRECTORY, `${ConfigConstants.BASENAME}.${extension}`),
|
|
20
|
+
).filter((file) => existsSync(file));
|
|
29
21
|
}
|
|
30
22
|
|
|
31
|
-
|
|
32
|
-
const
|
|
23
|
+
static async load(opts: { root: string }): Promise<TLoadResult> {
|
|
24
|
+
const files = ConfigLoader.findFiles({ root: opts.root });
|
|
33
25
|
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
if (files.length === 0) {
|
|
27
|
+
return {
|
|
28
|
+
ok: false,
|
|
29
|
+
error: `no ${ConfigConstants.DIRECTORY}/${ConfigConstants.BASENAME}.* found in ${opts.root}`,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
36
32
|
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
if (files.length > 1) {
|
|
34
|
+
const names = files.map((file) => relative(opts.root, file)).join(', ');
|
|
39
35
|
|
|
40
|
-
|
|
36
|
+
return { ok: false, error: `more than one config - keep exactly one of: ${names}` };
|
|
37
|
+
}
|
|
41
38
|
|
|
42
|
-
|
|
43
|
-
const
|
|
39
|
+
const [file] = files;
|
|
40
|
+
const shown = relative(opts.root, file);
|
|
44
41
|
|
|
45
|
-
loaded
|
|
46
|
-
} catch (error) {
|
|
47
|
-
return { ok: false, file, error: `${shown}: failed to load - ${describeError({ error })}` };
|
|
48
|
-
}
|
|
42
|
+
let loaded: { default?: unknown };
|
|
49
43
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
ok: false,
|
|
53
|
-
file,
|
|
54
|
-
error: `${shown}: no default export - write 'export default { ... }'`,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
44
|
+
try {
|
|
45
|
+
const imported = await import(pathToFileURL(file).href);
|
|
57
46
|
|
|
58
|
-
|
|
47
|
+
loaded = imported;
|
|
48
|
+
} catch (error) {
|
|
49
|
+
return { ok: false, file, error: `${shown}: failed to load - ${describeError({ error })}` };
|
|
50
|
+
}
|
|
59
51
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
52
|
+
if (loaded.default === undefined) {
|
|
53
|
+
return {
|
|
54
|
+
ok: false,
|
|
55
|
+
file,
|
|
56
|
+
error: `${shown}: no default export - write 'export default { ... }'`,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
67
59
|
|
|
68
|
-
|
|
69
|
-
})
|
|
70
|
-
.join('\n');
|
|
60
|
+
const parsed = VULCAN_CONFIG_SCHEMA.safeParse(loaded.default);
|
|
71
61
|
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
if (!parsed.success) {
|
|
63
|
+
const issues = parsed.error.issues
|
|
64
|
+
.map((issue) => {
|
|
65
|
+
const path =
|
|
66
|
+
issue.code === 'unrecognized_keys'
|
|
67
|
+
? issue.keys.join(', ')
|
|
68
|
+
: issue.path.join('.') || '(root)';
|
|
74
69
|
|
|
75
|
-
|
|
76
|
-
}
|
|
70
|
+
return ` ${path}: ${issue.message}`;
|
|
71
|
+
})
|
|
72
|
+
.join('\n');
|
|
73
|
+
|
|
74
|
+
return { ok: false, file, error: `${shown}: invalid config\n${issues}` };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return { ok: true, file, config: parsed.data };
|
|
78
|
+
}
|
|
79
|
+
}
|
package/src/config/packages.ts
CHANGED
|
@@ -15,14 +15,17 @@ export interface IProjectPackage {
|
|
|
15
15
|
presetKind?: TLibraryKind;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
opts
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
export class ProjectPackages {
|
|
19
|
+
/** The project's packages in release order. */
|
|
20
|
+
static resolve(opts: { config: TResolvedConfig }): IProjectPackage[] {
|
|
21
|
+
return opts.config.packages.map((entry) => ({
|
|
22
|
+
dir: entry.dir,
|
|
23
|
+
name: entry.name,
|
|
24
|
+
path: entry.path ?? `${DEFAULT_PACKAGES_DIRECTORY}/${entry.dir}`,
|
|
25
|
+
aliases: entry.aliases,
|
|
26
|
+
retired: entry.retired,
|
|
27
|
+
...(entry.kind === undefined ? {} : { kind: entry.kind }),
|
|
28
|
+
...(entry.presetKind === undefined ? {} : { presetKind: entry.presetKind }),
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/config/schema.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isAbsolute } from 'node:path';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
3
|
+
import { LayoutFolder } from '../common/layout-folder.ts';
|
|
4
4
|
import { OWNER_SCHEMA } from '../owner/schema.ts';
|
|
5
5
|
import {
|
|
6
6
|
CodingAgents,
|
|
@@ -54,7 +54,7 @@ const PUSH_TARGET = z
|
|
|
54
54
|
|
|
55
55
|
/** A layout folder: 1 to 4 plain segments, never climbing, never absolute (the validator `guard-package` shares). */
|
|
56
56
|
const LAYOUT_FOLDER = z.string().superRefine((value, context) => {
|
|
57
|
-
const problem = layoutFolderProblem({ folder: value });
|
|
57
|
+
const problem = LayoutFolder.layoutFolderProblem({ folder: value });
|
|
58
58
|
|
|
59
59
|
if (problem !== undefined) {
|
|
60
60
|
context.addIssue({ code: 'custom', message: problem });
|
|
@@ -212,7 +212,7 @@ export const VULCAN_CONFIG_SCHEMA = z.strictObject({
|
|
|
212
212
|
other: LAYOUT_VALUE.optional(),
|
|
213
213
|
})
|
|
214
214
|
.superRefine((layout, context) => {
|
|
215
|
-
for (const problem of layoutOverlapProblems({ layout })) {
|
|
215
|
+
for (const problem of LayoutFolder.layoutOverlapProblems({ layout })) {
|
|
216
216
|
context.addIssue({ code: 'custom', message: problem });
|
|
217
217
|
}
|
|
218
218
|
})
|