ddd-ts-kit 0.23.0 → 0.23.1
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/CHANGELOG.md +22 -0
- package/dist/check/explain/clean-docs.js +1 -1
- package/dist/check/explain/clean-docs.js.map +1 -1
- package/dist/check/fixtures/clean-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/clean-fixtures.js +16 -0
- package/dist/check/fixtures/clean-fixtures.js.map +1 -1
- package/dist/check/rules/clean-function-size.js +10 -2
- package/dist/check/rules/clean-function-size.js.map +1 -1
- package/dist/commands/doctor.d.ts +4 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +15 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/doctor/diagnose.d.ts +9 -0
- package/dist/doctor/diagnose.d.ts.map +1 -0
- package/dist/doctor/diagnose.js +34 -0
- package/dist/doctor/diagnose.js.map +1 -0
- package/dist/doctor/doctor-finding.d.ts +11 -0
- package/dist/doctor/doctor-finding.d.ts.map +1 -0
- package/dist/doctor/doctor-finding.js +2 -0
- package/dist/doctor/doctor-finding.js.map +1 -0
- package/dist/doctor/format-diagnosis.d.ts +4 -0
- package/dist/doctor/format-diagnosis.d.ts.map +1 -0
- package/dist/doctor/format-diagnosis.js +25 -0
- package/dist/doctor/format-diagnosis.js.map +1 -0
- package/dist/doctor/package-findings.d.ts +8 -0
- package/dist/doctor/package-findings.d.ts.map +1 -0
- package/dist/doctor/package-findings.js +21 -0
- package/dist/doctor/package-findings.js.map +1 -0
- package/dist/doctor/permission-findings.d.ts +5 -0
- package/dist/doctor/permission-findings.d.ts.map +1 -0
- package/dist/doctor/permission-findings.js +16 -0
- package/dist/doctor/permission-findings.js.map +1 -0
- package/dist/doctor/script-findings.d.ts +5 -0
- package/dist/doctor/script-findings.d.ts.map +1 -0
- package/dist/doctor/script-findings.js +12 -0
- package/dist/doctor/script-findings.js.map +1 -0
- package/dist/help/notes.d.ts +1 -1
- package/dist/help/notes.d.ts.map +1 -1
- package/dist/help/notes.js +6 -1
- package/dist/help/notes.js.map +1 -1
- package/dist/help/usage.d.ts +1 -1
- package/dist/help/usage.d.ts.map +1 -1
- package/dist/help/usage.js +1 -0
- package/dist/help/usage.js.map +1 -1
- package/dist/init/agent-permissions.d.ts +8 -0
- package/dist/init/agent-permissions.d.ts.map +1 -0
- package/dist/init/agent-permissions.js +55 -0
- package/dist/init/agent-permissions.js.map +1 -0
- package/dist/init/manifest/versions.js +24 -24
- package/dist/init/write-agent-settings.d.ts.map +1 -1
- package/dist/init/write-agent-settings.js +1 -54
- package/dist/init/write-agent-settings.js.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +2 -0
- package/dist/run.js.map +1 -1
- package/dist/slice/changed-entries.d.ts +7 -0
- package/dist/slice/changed-entries.d.ts.map +1 -0
- package/dist/slice/changed-entries.js +20 -0
- package/dist/slice/changed-entries.js.map +1 -0
- package/dist/slice/changed-entry.d.ts +6 -0
- package/dist/slice/changed-entry.d.ts.map +1 -0
- package/dist/slice/changed-entry.js +2 -0
- package/dist/slice/changed-entry.js.map +1 -0
- package/dist/slice/format-slice-verification.d.ts.map +1 -1
- package/dist/slice/format-slice-verification.js +10 -0
- package/dist/slice/format-slice-verification.js.map +1 -1
- package/dist/slice/plan-staging.d.ts +13 -0
- package/dist/slice/plan-staging.d.ts.map +1 -0
- package/dist/slice/plan-staging.js +52 -0
- package/dist/slice/plan-staging.js.map +1 -0
- package/dist/slice/slice-verification.d.ts +3 -0
- package/dist/slice/slice-verification.d.ts.map +1 -1
- package/dist/slice/staging-plan.d.ts +6 -0
- package/dist/slice/staging-plan.d.ts.map +1 -0
- package/dist/slice/staging-plan.js +2 -0
- package/dist/slice/staging-plan.js.map +1 -0
- package/dist/slice/verify-slice.d.ts.map +1 -1
- package/dist/slice/verify-slice.js +3 -2
- package/dist/slice/verify-slice.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/briefing-of.js +1 -1
- package/dist/worker/briefing-of.js.map +1 -1
- package/package.json +2 -2
- package/templates/pipeline/package-scripts.json +1 -1
- package/dist/slice/paths-to-stage.d.ts +0 -6
- package/dist/slice/paths-to-stage.d.ts.map +0 -1
- package/dist/slice/paths-to-stage.js +0 -13
- package/dist/slice/paths-to-stage.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,28 @@ What each version changes for someone who uses the kit. The packages of `package
|
|
|
4
4
|
together, under one version; the notes of each [GitHub release](https://github.com/gbourgeat/ddd-ts-kit/releases)
|
|
5
5
|
list the pull requests behind it.
|
|
6
6
|
|
|
7
|
+
## 0.23.1
|
|
8
|
+
|
|
9
|
+
**`verify-slice` proposes to stage the paths of the slice only.** In 0.23.0 it listed every path
|
|
10
|
+
`git status` reported in the repository as the paths to commit: a file of another context or of
|
|
11
|
+
the platform, an editor's folder, notes or a document left at the root of a shared checkout. The
|
|
12
|
+
list is now closed: the files of the context, an end-to-end spec of `test/e2e/`, a working
|
|
13
|
+
migration with its snapshot and the journal, and the derived files `regenerate` rewrites when git
|
|
14
|
+
already tracks them. Every other changed path is listed as left out, never to stage with the
|
|
15
|
+
slice; `--json` gives `toStage` and `leftOut`. The briefing and the `context-builder` agent say
|
|
16
|
+
that a path left out is never staged nor deleted. Upgrade from 0.23.0 now.
|
|
17
|
+
|
|
18
|
+
**`doctor` lists what an upgrade left to do.** `npx ddd-ts-kit doctor` compares the project with
|
|
19
|
+
what the installed version writes: the scripts of `package.json` (missing, or written otherwise),
|
|
20
|
+
the packages of the kit (missing, or at another range) and the permissions of
|
|
21
|
+
`.claude/settings.json` (missing). `npx ddd-ts-kit init` adds what is missing and leaves what the
|
|
22
|
+
project wrote. `--strict` exits 1 while something is missing. The version gap the plugin says at
|
|
23
|
+
session start points to it.
|
|
24
|
+
|
|
25
|
+
**`clean/function-size` does not count one parameter typed `Actor` or `Date`.** Who acts and when
|
|
26
|
+
are the context of an intention rather than its input: `invoice.issue(lines, customer, actor,
|
|
27
|
+
now)` counts three. The rule reports less, never more.
|
|
28
|
+
|
|
7
29
|
## 0.23.0
|
|
8
30
|
|
|
9
31
|
**A domain event declares its name once, with `NamedDomainEvent`.** `export class InvoiceIssued
|
|
@@ -7,7 +7,7 @@ export function parseFile(text: string) { return text.split('\\n').map(parseLine
|
|
|
7
7
|
function parseLine(line: string) {}`,
|
|
8
8
|
},
|
|
9
9
|
'clean/function-size': {
|
|
10
|
-
why: 'A long function mixes several levels of abstraction, and its parts can be neither named nor tested alone. More than three parameters usually travel together because they are one concept without a type: name it, as a typed props object or a value object (`Invoice.draft({ customer, lines, currency, draftedAt })`), rather than adding a fourth parameter. Small functions with few arguments are what makes the stepdown order readable. The limits are configurable under `limits`, up to a ceiling: no function is longer than 100 lines, describe callbacks, module files and tests included, and that ceiling is an error whatever the severity of the rule. A `describe` longer than that covers several behaviours: the spec file holds one top-level `describe` per behaviour (a nested one counts in its parent), and a second spec file is needed only past the 350 lines of `clean/file-size`.',
|
|
10
|
+
why: 'A long function mixes several levels of abstraction, and its parts can be neither named nor tested alone. More than three parameters usually travel together because they are one concept without a type: name it, as a typed props object or a value object (`Invoice.draft({ customer, lines, currency, draftedAt })`), rather than adding a fourth parameter. One parameter typed `Actor` or `Date`, who acts and when, is the context of an intention and is not counted. Small functions with few arguments are what makes the stepdown order readable. The limits are configurable under `limits`, up to a ceiling: no function is longer than 100 lines, describe callbacks, module files and tests included, and that ceiling is an error whatever the severity of the rule. A `describe` longer than that covers several behaviours: the spec file holds one top-level `describe` per behaviour (a nested one counts in its parent), and a second spec file is needed only past the 350 lines of `clean/file-size`.',
|
|
11
11
|
bad: `function issue(id: string, customer: string, amount: number, currency: string, dueOn: Date) {}`,
|
|
12
12
|
good: `function issue(id: string, customer: CustomerId, total: Money) {}`,
|
|
13
13
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean-docs.js","sourceRoot":"","sources":["../../../src/check/explain/clean-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAsC;IAC3D,gBAAgB,EAAE;QAChB,GAAG,EAAE,4RAA4R;QACjS,GAAG,EAAE;qFAC4E;QACjF,IAAI,EAAE;oCAC0B;KACjC;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"clean-docs.js","sourceRoot":"","sources":["../../../src/check/explain/clean-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAsC;IAC3D,gBAAgB,EAAE;QAChB,GAAG,EAAE,4RAA4R;QACjS,GAAG,EAAE;qFAC4E;QACjF,IAAI,EAAE;oCAC0B;KACjC;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,89BAA89B;QACn+B,GAAG,EAAE,gGAAgG;QACrG,IAAI,EAAE,mEAAmE;KAC1E;IACD,6BAA6B,EAAE;QAC7B,GAAG,EAAE,yOAAyO;QAC9O,GAAG,EAAE,qEAAqE;QAC1E,IAAI,EAAE,8CAA8C;KACrD;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,kPAAkP;QACvP,GAAG,EAAE;;iCAEwB;QAC7B,IAAI,EAAE;+BACqB;KAC5B;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,6PAA6P;QAClQ,GAAG,EAAE,2DAA2D;QAChE,IAAI,EAAE,uEAAuE;KAC9E;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,+NAA+N;QACpO,GAAG,EAAE,kCAAkC;QACvC,IAAI,EAAE;2BACiB;KACxB;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/clean-fixtures.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAY5C,eAAO,MAAM,cAAc,EAAE,SAAS,OAAO,
|
|
1
|
+
{"version":3,"file":"clean-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/clean-fixtures.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAY5C,eAAO,MAAM,cAAc,EAAE,SAAS,OAAO,EAuR5C,CAAC"}
|
|
@@ -78,6 +78,22 @@ export const CLEAN_FIXTURES = [
|
|
|
78
78
|
[ADAPTER]: 'export class InMemoryInvoiceRepository {\n constructor(\n readonly a: string,\n readonly b: string,\n readonly c: string,\n readonly d: string,\n ) {}\n\n find(id: string, options: { limit: number; offset: number }, fallback = id): string {\n return id + options.limit + fallback;\n }\n}\n',
|
|
79
79
|
}),
|
|
80
80
|
},
|
|
81
|
+
{
|
|
82
|
+
ruleId: 'clean/function-size',
|
|
83
|
+
name: 'three parameters and the instant of the intention, which is not counted',
|
|
84
|
+
expect: 'pass',
|
|
85
|
+
files: project({
|
|
86
|
+
[ISSUE]: 'export function issue(id: string, customer: string, amount: number, now: Date): string {\n return id + customer + amount + now.toISOString();\n}\n',
|
|
87
|
+
}),
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
ruleId: 'clean/function-size',
|
|
91
|
+
name: 'four parameters besides the actor',
|
|
92
|
+
expect: { file: ISSUE },
|
|
93
|
+
files: project({
|
|
94
|
+
[ISSUE]: 'export function issue(id: string, customer: string, amount: number, currency: string, actor: Actor): string {\n return id + customer + amount + currency + String(actor);\n}\n',
|
|
95
|
+
}),
|
|
96
|
+
},
|
|
81
97
|
{
|
|
82
98
|
ruleId: 'clean/function-size',
|
|
83
99
|
name: 'a function with four parameters',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/clean-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa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,yFAAyF,CAAC,CACrG;KACF;IACD;QACE,MAAM,EAAE,wBAAwB;QAChC,IAAI,EAAE,6BAA6B;QACnC,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;QACzB,KAAK,EAAE,OAAO,CACZ,OAAO,CACL,+JAA+J,CAChK,CACF;KACF;CACF,CAAC;AAEF,iEAAiE;AACjE,SAAS,eAAe,CAAC,KAAa;IACpC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,eAAe,KAAK,QAAQ,CAAC,CAAC;IAE5F,OAAO,MAAM,CAAC,6CAA6C,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,GAAG,CAAC,CAAC;AAClG,CAAC"}
|
|
@@ -33,7 +33,7 @@ function measured(file) {
|
|
|
33
33
|
const measure = (shape, label) => ({
|
|
34
34
|
label,
|
|
35
35
|
line: shape.line,
|
|
36
|
-
parameters: shape.parameters
|
|
36
|
+
parameters: countedParameters(shape.parameters),
|
|
37
37
|
bodyLines: shape.bodyLines,
|
|
38
38
|
isComposition,
|
|
39
39
|
});
|
|
@@ -63,13 +63,21 @@ function ceilingFlaw(label, bodyLines) {
|
|
|
63
63
|
fix: SPLIT_FIX,
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
+
/** A parameter typed `Actor` or `Date`: who acts and when, the context of an intention rather than its input. */
|
|
67
|
+
const CONTEXT_PARAMETER = /^[\w$]+\s*:\s*(?:Actor|Date)\s*$/;
|
|
68
|
+
/** The parameters a signature is judged on: one that carries the actor or the instant is not counted. */
|
|
69
|
+
function countedParameters(parameters) {
|
|
70
|
+
return parameters.some((parameter) => CONTEXT_PARAMETER.test(parameter.trim()))
|
|
71
|
+
? parameters.length - 1
|
|
72
|
+
: parameters.length;
|
|
73
|
+
}
|
|
66
74
|
function tooManyParameters(shape, limits) {
|
|
67
75
|
if (shape.isInjected || shape.parameters <= limits.maxParameters) {
|
|
68
76
|
return [];
|
|
69
77
|
}
|
|
70
78
|
return [
|
|
71
79
|
{
|
|
72
|
-
message: `${shape.label} takes ${shape.parameters} parameters (limit ${limits.maxParameters}).`,
|
|
80
|
+
message: `${shape.label} takes ${shape.parameters} parameters (limit ${limits.maxParameters}, an actor or an instant not counted).`,
|
|
73
81
|
fix: 'Group the parameters that travel together into a typed props object or a value object (`Invoice.draft({ customer, lines, currency, draftedAt })`): they are a concept that has no name yet. Never add one more parameter, nor split the function only to get under the limit.',
|
|
74
82
|
},
|
|
75
83
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean-function-size.js","sourceRoot":"","sources":["../../../src/check/rules/clean-function-size.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAe,MAAM,uBAAuB,CAAC;AAO5E,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAalD,MAAM,SAAS,GACb,8VAA8V,CAAC;AAEjW,MAAM,CAAC,MAAM,iBAAiB,GAAS;IACrC,EAAE,EAAE,qBAAqB;IACzB,WAAW,EAAE,yGAAyG,sBAAsB,8DAA8D;IAC1M,KAAK,EAAE,MAAM;IACb,GAAG,CAAC,OAAO;QACT,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1C,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;QAElC,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACpC,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAe,EAAE;gBAC7D,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,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C,UAAU,CAAC,MAAM,GAAG,CAAC;QACvB,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC;AACxB,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAe,EAAE,MAAc;IACxD,IAAI,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;QACjE,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO;QACL;YACE,OAAO,EAAE,GAAG,KAAK,CAAC,KAAK,UAAU,KAAK,CAAC,UAAU,sBAAsB,MAAM,CAAC,aAAa,wCAAwC;YACnI,GAAG,EAAE,+QAA+Q;SACrR;KACF,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,KAAe,EAAE,MAAc;IAC9C,IAAI,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,SAAS,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;QACtE,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO;QACL,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,KAAK,OAAO,KAAK,CAAC,SAAS,sBAAsB,MAAM,CAAC,gBAAgB,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE;KACnH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,yHAAyH;AACzH,eAAO,MAAM,aAAa,EAAE,OAS3B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { readConfig } from '../config/index.js';
|
|
2
|
+
import { diagnose } from '../doctor/diagnose.js';
|
|
3
|
+
import { formatDiagnosis } from '../doctor/format-diagnosis.js';
|
|
4
|
+
import { VERSION } from '../version.js';
|
|
5
|
+
import { Arguments } from './arguments.js';
|
|
6
|
+
/** What an upgrade left to do in the project: the scripts, packages and permissions this version writes and it lacks. */
|
|
7
|
+
export const doctorCommand = (argv, io) => {
|
|
8
|
+
const args = Arguments.parse(argv, { strict: { type: 'boolean', default: false } });
|
|
9
|
+
const root = args.projectRoot;
|
|
10
|
+
const { config } = readConfig(root);
|
|
11
|
+
const findings = diagnose(root, config);
|
|
12
|
+
io.out(args.json ? JSON.stringify({ version: VERSION, findings }, null, 2) : formatDiagnosis(findings, VERSION));
|
|
13
|
+
return args.flag('strict') && findings.some((finding) => finding.problem !== 'written otherwise') ? 1 : 0;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,yHAAyH;AACzH,MAAM,CAAC,MAAM,aAAa,GAAY,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE;IACjD,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IACpF,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC;IAC9B,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAExC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IAEjH,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,KAAK,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5G,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Config } from '../config/index.js';
|
|
2
|
+
import type { DoctorFinding } from './doctor-finding.js';
|
|
3
|
+
/**
|
|
4
|
+
* What the project lacks of what this version of the kit writes, the steps an upgrade leaves to do:
|
|
5
|
+
* scripts, packages of the kit, permissions of the agents. Settings the project does not have
|
|
6
|
+
* are not judged: an agent may run elsewhere than Claude Code.
|
|
7
|
+
*/
|
|
8
|
+
export declare function diagnose(root: string, config: Config): DoctorFinding[];
|
|
9
|
+
//# sourceMappingURL=diagnose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnose.d.ts","sourceRoot":"","sources":["../../src/doctor/diagnose.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKzD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,EAAE,CAgBtE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { isRecord } from '../config/values/is-record.js';
|
|
4
|
+
import { packageFindings } from './package-findings.js';
|
|
5
|
+
import { permissionFindings } from './permission-findings.js';
|
|
6
|
+
import { scriptFindings } from './script-findings.js';
|
|
7
|
+
/**
|
|
8
|
+
* What the project lacks of what this version of the kit writes, the steps an upgrade leaves to do:
|
|
9
|
+
* scripts, packages of the kit, permissions of the agents. Settings the project does not have
|
|
10
|
+
* are not judged: an agent may run elsewhere than Claude Code.
|
|
11
|
+
*/
|
|
12
|
+
export function diagnose(root, config) {
|
|
13
|
+
const manifest = readJson(path.join(root, 'package.json'));
|
|
14
|
+
const scripts = isRecord(manifest) && isRecord(manifest['scripts']) ? manifest['scripts'] : {};
|
|
15
|
+
const installed = {
|
|
16
|
+
...(isRecord(manifest) && isRecord(manifest['dependencies']) ? manifest['dependencies'] : {}),
|
|
17
|
+
...(isRecord(manifest) && isRecord(manifest['devDependencies']) ? manifest['devDependencies'] : {}),
|
|
18
|
+
};
|
|
19
|
+
const settingsFile = path.join(root, '.claude', 'settings.json');
|
|
20
|
+
return [
|
|
21
|
+
...scriptFindings(config, scripts),
|
|
22
|
+
...packageFindings(config, installed),
|
|
23
|
+
...(fs.existsSync(settingsFile) ? permissionFindings(config, readJson(settingsFile)) : []),
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
function readJson(file) {
|
|
27
|
+
try {
|
|
28
|
+
return JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=diagnose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../src/doctor/diagnose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAA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5B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** One thing a project lacks, or writes otherwise, compared with what this version of the kit writes. */
|
|
2
|
+
export interface DoctorFinding {
|
|
3
|
+
readonly area: 'script' | 'package' | 'permission';
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly problem: 'missing' | 'other version' | 'written otherwise';
|
|
6
|
+
/** What this version writes. */
|
|
7
|
+
readonly expected: string;
|
|
8
|
+
/** What the project has, when it has something. */
|
|
9
|
+
readonly found?: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=doctor-finding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-finding.d.ts","sourceRoot":"","sources":["../../src/doctor/doctor-finding.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,YAAY,CAAC;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,eAAe,GAAG,mBAAmB,CAAC;IACpE,gCAAgC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-finding.js","sourceRoot":"","sources":["../../src/doctor/doctor-finding.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DoctorFinding } from './doctor-finding.js';
|
|
2
|
+
/** The findings by area, each with what this version writes, then how to take what is missing. */
|
|
3
|
+
export declare function formatDiagnosis(findings: readonly DoctorFinding[], version: string): string;
|
|
4
|
+
//# sourceMappingURL=format-diagnosis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-diagnosis.d.ts","sourceRoot":"","sources":["../../src/doctor/format-diagnosis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,kGAAkG;AAClG,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAQ3F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** The findings by area, each with what this version writes, then how to take what is missing. */
|
|
2
|
+
export function formatDiagnosis(findings, version) {
|
|
3
|
+
if (findings.length === 0) {
|
|
4
|
+
return `The project has what ddd-ts-kit ${version} writes: scripts, packages of the kit and permissions.`;
|
|
5
|
+
}
|
|
6
|
+
return [`Compared with what ddd-ts-kit ${version} writes:`, ...findings.map(lineOf), '', ...fixesOf(findings)].join('\n');
|
|
7
|
+
}
|
|
8
|
+
function lineOf({ area, name, problem, expected, found }) {
|
|
9
|
+
const yours = found === undefined ? '' : `; yours: ${found}`;
|
|
10
|
+
return ` ${area} ${name}: ${problem} (${version(area)}${expected}${yours})`;
|
|
11
|
+
}
|
|
12
|
+
function version(area) {
|
|
13
|
+
return area === 'package' ? 'range ' : '';
|
|
14
|
+
}
|
|
15
|
+
function fixesOf(findings) {
|
|
16
|
+
const fixes = ['fix: `npx ddd-ts-kit init` adds what is missing and leaves what the project wrote; then install.'];
|
|
17
|
+
if (findings.some((finding) => finding.area === 'package' && finding.problem === 'other version')) {
|
|
18
|
+
fixes.push('fix: upgrade `ddd-ts-kit` and every `@ddd-ts-kit/*` package together, to the ranges above; the steps of each version are in node_modules/ddd-ts-kit/CHANGELOG.md.');
|
|
19
|
+
}
|
|
20
|
+
if (findings.some((finding) => finding.problem === 'written otherwise')) {
|
|
21
|
+
fixes.push("note: a script written otherwise may be yours on purpose; `npx ddd-ts-kit init --force` writes the kit's version over it.");
|
|
22
|
+
}
|
|
23
|
+
return fixes;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=format-diagnosis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-diagnosis.js","sourceRoot":"","sources":["../../src/doctor/format-diagnosis.ts"],"names":[],"mappings":"AAEA,kGAAkG;AAClG,MAAM,UAAU,eAAe,CAAC,QAAkC,EAAE,OAAe;IACjF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,mCAAmC,OAAO,wDAAwD,CAAC;IAC5G,CAAC;IAED,OAAO,CAAC,iCAAiC,OAAO,UAAU,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CACjH,IAAI,CACL,CAAC;AACJ,CAAC;AAED,SAAS,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAiB;IACrE,MAAM,KAAK,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,EAAE,CAAC;IAE7D,OAAO,KAAK,IAAI,IAAI,IAAI,KAAK,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,QAAQ,GAAG,KAAK,GAAG,CAAC;AAC/E,CAAC;AAED,SAAS,OAAO,CAAC,IAA2B;IAC1C,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5C,CAAC;AAED,SAAS,OAAO,CAAC,QAAkC;IACjD,MAAM,KAAK,GAAG,CAAC,kGAAkG,CAAC,CAAC;IAEnH,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,OAAO,KAAK,eAAe,CAAC,EAAE,CAAC;QAClG,KAAK,CAAC,IAAI,CACR,mKAAmK,CACpK,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,KAAK,mBAAmB,CAAC,EAAE,CAAC;QACxE,KAAK,CAAC,IAAI,CACR,2HAA2H,CAC5H,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Config } from '../config/index.js';
|
|
2
|
+
import type { DoctorFinding } from './doctor-finding.js';
|
|
3
|
+
/**
|
|
4
|
+
* The packages of the kit the project needs for its stack, missing or at another range than this
|
|
5
|
+
* version writes: they are upgraded together, never one alone.
|
|
6
|
+
*/
|
|
7
|
+
export declare function packageFindings(config: Config, installed: Readonly<Record<string, unknown>>): DoctorFinding[];
|
|
8
|
+
//# sourceMappingURL=package-findings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-findings.d.ts","sourceRoot":"","sources":["../../src/doctor/package-findings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKzD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,aAAa,EAAE,CAe7G"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { dependenciesFor } from '../init/manifest/dependencies-for.js';
|
|
2
|
+
/** The packages of the kit are released together: each one at the range this version writes. */
|
|
3
|
+
const OF_THE_KIT = /^(?:ddd-ts-kit|@ddd-ts-kit\/.+)$/;
|
|
4
|
+
/**
|
|
5
|
+
* The packages of the kit the project needs for its stack, missing or at another range than this
|
|
6
|
+
* version writes: they are upgraded together, never one alone.
|
|
7
|
+
*/
|
|
8
|
+
export function packageFindings(config, installed) {
|
|
9
|
+
const wanted = dependenciesFor(config);
|
|
10
|
+
const expected = { ...wanted.dependencies, ...wanted.devDependencies };
|
|
11
|
+
return Object.entries(expected)
|
|
12
|
+
.filter(([name]) => OF_THE_KIT.test(name))
|
|
13
|
+
.flatMap(([name, range]) => {
|
|
14
|
+
const found = installed[name];
|
|
15
|
+
if (typeof found !== 'string') {
|
|
16
|
+
return [{ area: 'package', name, problem: 'missing', expected: range }];
|
|
17
|
+
}
|
|
18
|
+
return found === range ? [] : [{ area: 'package', name, problem: 'other version', expected: range, found }];
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=package-findings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-findings.js","sourceRoot":"","sources":["../../src/doctor/package-findings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAGvE,gGAAgG;AAChG,MAAM,UAAU,GAAG,kCAAkC,CAAC;AAEtD;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc,EAAE,SAA4C;IAC1F,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,EAAE,GAAG,MAAM,CAAC,YAAY,EAAE,GAAG,MAAM,CAAC,eAAe,EAAE,CAAC;IAEvE,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;SAC5B,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACzC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAmB,EAAE;QAC1C,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QAE9B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1E,CAAC;QAED,OAAO,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9G,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Config } from '../config/index.js';
|
|
2
|
+
import type { DoctorFinding } from './doctor-finding.js';
|
|
3
|
+
/** The permissions of `.claude/settings.json` this version writes that the project's settings lack. */
|
|
4
|
+
export declare function permissionFindings(config: Config, settings: unknown): DoctorFinding[];
|
|
5
|
+
//# sourceMappingURL=permission-findings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permission-findings.d.ts","sourceRoot":"","sources":["../../src/doctor/permission-findings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAIjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,uGAAuG;AACvG,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,aAAa,EAAE,CAcrF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AGENT_PERMISSIONS } from '../init/agent-permissions.js';
|
|
2
|
+
import { isRecord } from '../config/values/is-record.js';
|
|
3
|
+
import { inDialect } from '../package-manager/in-dialect.js';
|
|
4
|
+
/** The permissions of `.claude/settings.json` this version writes that the project's settings lack. */
|
|
5
|
+
export function permissionFindings(config, settings) {
|
|
6
|
+
const permissions = isRecord(settings) && isRecord(settings['permissions']) ? settings['permissions'] : {};
|
|
7
|
+
return Object.entries(AGENT_PERMISSIONS).flatMap(([kind, rules]) => {
|
|
8
|
+
const present = permissions[kind];
|
|
9
|
+
const held = Array.isArray(present) ? present : [];
|
|
10
|
+
return rules
|
|
11
|
+
.map((rule) => inDialect(rule, config.stack.packageManager))
|
|
12
|
+
.filter((rule) => !held.includes(rule))
|
|
13
|
+
.map((rule) => ({ area: 'permission', name: `${kind} ${rule}`, problem: 'missing', expected: rule }));
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=permission-findings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permission-findings.js","sourceRoot":"","sources":["../../src/doctor/permission-findings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAG7D,uGAAuG;AACvG,MAAM,UAAU,kBAAkB,CAAC,MAAc,EAAE,QAAiB;IAClE,MAAM,WAAW,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAE3G,OAAO,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE;QACjE,MAAM,OAAO,GAAY,WAAW,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QAEnD,OAAO,KAAK;aACT,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;aAC3D,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;aACtC,GAAG,CACF,CAAC,IAAI,EAAiB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,IAAI,IAAI,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAC/G,CAAC;IACN,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Config } from '../config/index.js';
|
|
2
|
+
import type { DoctorFinding } from './doctor-finding.js';
|
|
3
|
+
/** The scripts this version writes that package.json lacks, then the ones it writes otherwise. */
|
|
4
|
+
export declare function scriptFindings(config: Config, scripts: Readonly<Record<string, unknown>>): DoctorFinding[];
|
|
5
|
+
//# sourceMappingURL=script-findings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-findings.d.ts","sourceRoot":"","sources":["../../src/doctor/script-findings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,kGAAkG;AAClG,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,aAAa,EAAE,CAU1G"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { scriptsFor } from '../init/manifest/scripts-for.js';
|
|
2
|
+
/** The scripts this version writes that package.json lacks, then the ones it writes otherwise. */
|
|
3
|
+
export function scriptFindings(config, scripts) {
|
|
4
|
+
return Object.entries(scriptsFor(config)).flatMap(([name, expected]) => {
|
|
5
|
+
const found = scripts[name];
|
|
6
|
+
if (typeof found !== 'string') {
|
|
7
|
+
return [{ area: 'script', name, problem: 'missing', expected }];
|
|
8
|
+
}
|
|
9
|
+
return found === expected ? [] : [{ area: 'script', name, problem: 'written otherwise', expected, found }];
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=script-findings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-findings.js","sourceRoot":"","sources":["../../src/doctor/script-findings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAG7D,kGAAkG;AAClG,MAAM,UAAU,cAAc,CAAC,MAAc,EAAE,OAA0C;IACvF,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAmB,EAAE;QACtF,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAE5B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;QAClE,CAAC;QAED,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7G,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/help/notes.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** What a line of the usage cannot say about a command or a flag. */
|
|
2
|
-
export declare const NOTES = " affected what a pull request has to run: the contexts a change set reaches through the context\n map (a changed context and the contexts downstream of it), as filters for the test\n runner and the linter; everything when a shared path changed or without --base\n build-aliases after the compiler: rewrites the import aliases left in the emitted .js and .d.ts files\n into relative paths, so that plain node runs the output (tsconfig.build.json by default)\n drizzle-generate the db:generate of a Drizzle project: drizzle-kit generate --name, which without a terminal\n fails and names the fix when drizzle-kit would ask whether a column or table is renamed,\n where drizzle-kit alone writes nothing and exits 0\n error-factories moves a project from one class per error to static factories on one error class per\n concept: --plan writes error-factories.plan.json, where each class is given its concept;\n --apply follows it (classes, specs, every usage, \"stack.refusals\" in the config)\n value-objects moves the value objects of a project from a Result to factories that return the value or\n throw: every create returning Result<T, E> returns T, err(..) is thrown, unwrap(..) of\n them goes, specs assert expectRefusal(() => ..), \"stack.valueObjects\" becomes throwing\n controllers moves the function routes of a project, or of one context, to controller classes: each\n <name>.route.ts becomes <resource>/<name>/<name>.controller.ts behind the route group of\n its resource, its schema files and its spec follow; a context is turned whole or not at all\n describe one context as facts: use cases, routes, events, ports, policies, gateways, dependencies\n status the next step of docs/architecture/plan.md, the slices of docs/architecture/slices.md by\n status and by owner, and the TODO(domain), TODO(platform), it.todo and TODO(review) left in\n each context; --workers shows instead each worktree holding .ddd-ts-kit/worker.json (branch,\n context, rows, base, commits ahead, files changed since the base, its report), then the\n contexts and the files more than one worker holds\n sdk the typed client of each document of the contract, a workspace package under\n clients/<document> without runtime dependency: typed errors keyed by the error codes,\n credentials per security scheme; records \"sdk\" in the config the first time, wires the\n scripts (docs:generate regenerates it, docs:check compares it, ci:build builds it);\n --check writes nothing and exits 1 while a client differs from its contract\n todo those markers as file:line, in the project or in one context\n worker-scope a git worktree on the branch build/<context> (by default ../<project>-<context>), cut from\n --base <ref> (by default the current branch, refused from a worker's worktree), its\n .ddd-ts-kit/worker.json, and the briefing of the worker of that context; --rows <id,...>\n briefs those rows of slices.md only, with their rules; an existing worktree or branch\n that does not contain the base is refused\n verify-slice closes a slice before its commit, in one run: the regenerate script, check on the files\n changed since --since (new ones included), the test script for the context; then the\n changed files past 300 of the 350 lines,
|
|
2
|
+
export declare const NOTES = " affected what a pull request has to run: the contexts a change set reaches through the context\n map (a changed context and the contexts downstream of it), as filters for the test\n runner and the linter; everything when a shared path changed or without --base\n build-aliases after the compiler: rewrites the import aliases left in the emitted .js and .d.ts files\n into relative paths, so that plain node runs the output (tsconfig.build.json by default)\n drizzle-generate the db:generate of a Drizzle project: drizzle-kit generate --name, which without a terminal\n fails and names the fix when drizzle-kit would ask whether a column or table is renamed,\n where drizzle-kit alone writes nothing and exits 0\n error-factories moves a project from one class per error to static factories on one error class per\n concept: --plan writes error-factories.plan.json, where each class is given its concept;\n --apply follows it (classes, specs, every usage, \"stack.refusals\" in the config)\n value-objects moves the value objects of a project from a Result to factories that return the value or\n throw: every create returning Result<T, E> returns T, err(..) is thrown, unwrap(..) of\n them goes, specs assert expectRefusal(() => ..), \"stack.valueObjects\" becomes throwing\n controllers moves the function routes of a project, or of one context, to controller classes: each\n <name>.route.ts becomes <resource>/<name>/<name>.controller.ts behind the route group of\n its resource, its schema files and its spec follow; a context is turned whole or not at all\n doctor what an upgrade left to do: the scripts, the packages of the kit (at the ranges of this\n version) and the agent permissions this version writes that the project lacks or writes\n otherwise; init adds what is missing; --strict exits 1 while something is missing\n describe one context as facts: use cases, routes, events, ports, policies, gateways, dependencies\n status the next step of docs/architecture/plan.md, the slices of docs/architecture/slices.md by\n status and by owner, and the TODO(domain), TODO(platform), it.todo and TODO(review) left in\n each context; --workers shows instead each worktree holding .ddd-ts-kit/worker.json (branch,\n context, rows, base, commits ahead, files changed since the base, its report), then the\n contexts and the files more than one worker holds\n sdk the typed client of each document of the contract, a workspace package under\n clients/<document> without runtime dependency: typed errors keyed by the error codes,\n credentials per security scheme; records \"sdk\" in the config the first time, wires the\n scripts (docs:generate regenerates it, docs:check compares it, ci:build builds it);\n --check writes nothing and exits 1 while a client differs from its contract\n todo those markers as file:line, in the project or in one context\n worker-scope a git worktree on the branch build/<context> (by default ../<project>-<context>), cut from\n --base <ref> (by default the current branch, refused from a worker's worktree), its\n .ddd-ts-kit/worker.json, and the briefing of the worker of that context; --rows <id,...>\n briefs those rows of slices.md only, with their rules; an existing worktree or branch\n that does not contain the base is refused\n verify-slice closes a slice before its commit, in one run: the regenerate script, check on the files\n changed since --since (new ones included), the test script for the context; then the\n changed files past 300 of the 350 lines, the paths of the slice to stage (its context, an\n end-to-end spec, a working migration, the derived files git tracks) and every other\n changed path, left out and never to stage with it; exits 1 while a step fails\n --commit-size the files and lines about to be committed against \"commit\" in the config (20 files and\n 600 lines by default, generated files not counted); --staged reads the index only;\n advisory, --strict exits 1 when over\n --stored-events docs records the shape of each version of the stored events in stored-events.lock.json,\n never rewriting a recorded one: run it once the shape of a version is the one to store;\n docs --check fails while a declared version is not recorded\n --sdk init records \"sdk\" in the config and generates the clients with the project\n --local-only generate refuses, and writes nothing, when the kind would write outside its context;\n \"generate --help --json\" says which kinds do";
|
|
3
3
|
//# sourceMappingURL=notes.d.ts.map
|
package/dist/help/notes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../../src/help/notes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../../src/help/notes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,KAAK,qjKAkD8C,CAAC"}
|
package/dist/help/notes.js
CHANGED
|
@@ -16,6 +16,9 @@ export const NOTES = ` affected what a pull request has to run: the con
|
|
|
16
16
|
controllers moves the function routes of a project, or of one context, to controller classes: each
|
|
17
17
|
<name>.route.ts becomes <resource>/<name>/<name>.controller.ts behind the route group of
|
|
18
18
|
its resource, its schema files and its spec follow; a context is turned whole or not at all
|
|
19
|
+
doctor what an upgrade left to do: the scripts, the packages of the kit (at the ranges of this
|
|
20
|
+
version) and the agent permissions this version writes that the project lacks or writes
|
|
21
|
+
otherwise; init adds what is missing; --strict exits 1 while something is missing
|
|
19
22
|
describe one context as facts: use cases, routes, events, ports, policies, gateways, dependencies
|
|
20
23
|
status the next step of docs/architecture/plan.md, the slices of docs/architecture/slices.md by
|
|
21
24
|
status and by owner, and the TODO(domain), TODO(platform), it.todo and TODO(review) left in
|
|
@@ -35,7 +38,9 @@ export const NOTES = ` affected what a pull request has to run: the con
|
|
|
35
38
|
that does not contain the base is refused
|
|
36
39
|
verify-slice closes a slice before its commit, in one run: the regenerate script, check on the files
|
|
37
40
|
changed since --since (new ones included), the test script for the context; then the
|
|
38
|
-
changed files past 300 of the 350 lines,
|
|
41
|
+
changed files past 300 of the 350 lines, the paths of the slice to stage (its context, an
|
|
42
|
+
end-to-end spec, a working migration, the derived files git tracks) and every other
|
|
43
|
+
changed path, left out and never to stage with it; exits 1 while a step fails
|
|
39
44
|
--commit-size the files and lines about to be committed against "commit" in the config (20 files and
|
|
40
45
|
600 lines by default, generated files not counted); --staged reads the index only;
|
|
41
46
|
advisory, --strict exits 1 when over
|
package/dist/help/notes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notes.js","sourceRoot":"","sources":["../../src/help/notes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,CAAC,MAAM,KAAK,GAAG
|
|
1
|
+
{"version":3,"file":"notes.js","sourceRoot":"","sources":["../../src/help/notes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEAkD2C,CAAC"}
|
package/dist/help/usage.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Every command of the CLI and its flags, as `--help` prints them and docs/guides/commands.md shows them. */
|
|
2
|
-
export declare const USAGE = "Usage\n ddd-ts-kit init [--http express|fastify|hono|nest|none]\n [--validation zod|class-validator|typebox|standard-schema|none]\n [--di tsyringe|nest|manual] [--tests vitest|jest]\n [--orm drizzle|knex|prisma|typeorm|custom|none] [--database postgres|mysql|sqlite|none]\n [--events in-memory|outbox] [--docs-ui swagger|scalar|redoc|none]\n [--ci github|gitlab|both|none] [--ci-extras <extra>,...|none]\n [--authn jwt|keycloak|none] [--authz rbac|abac|rebac|custom]\n [--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis] [--http-cache none|varnish]\n [--storage local|s3|none]\n [--audit on|off]\n [--errors none|sentry] [--logger stdout|pino|winston] [--style declared|explicit] [--assembly barrel|discovery]\n [--dependencies signature|listed] [--refusals factories|classes]\n [--routes controllers|functions] [--representations negotiated|json] [--forms on|off]\n [--value-objects throwing|result] [--literals named|free] [--values classes|free] [--tenancy none|shared-table] [--queue database|redis|memory]\n [--schemas shared|per-route]\n [--package-manager npm|pnpm] [--allow-no-outbox \"<reason>\"] [--import-alias '$<name>/']\n [--import-extension none|js] [--sdk]\n [--context <name>:<core|supporting|generic>]... [--preset identity]... [--dry-run] [--force]\n ddd-ts-kit generate <kind> ... [--term \"<Term>=<meaning>\"]... [--allow-name] [--local-only] [--dry-run] [--force] (alias: g)\n ddd-ts-kit generate --help --json\n ddd-ts-kit list [--context <name>]\n ddd-ts-kit describe <context>\n ddd-ts-kit status [--workers]\n ddd-ts-kit todo [<context>]\n ddd-ts-kit worker-scope <context> [--base <ref>] [--rows <id,...>] [--worktree <path>] [--branch <name>] [--dry-run]\n ddd-ts-kit verify-slice <context> --since <git-ref>\n ddd-ts-kit docs [--check] [--stored-events]\n ddd-ts-kit sdk [--check] [--dry-run]\n ddd-ts-kit depcruise-config [--check|--write]\n ddd-ts-kit build-aliases [--project <tsconfig>]\n ddd-ts-kit drizzle-generate --name <what-it-does> [--custom]\n ddd-ts-kit error-factories --plan | --apply [--dry-run]\n ddd-ts-kit controllers [<context>] [--dry-run]\n ddd-ts-kit value-objects [--dry-run]\n ddd-ts-kit affected [--base <git-ref>] [--head <git-ref>] [--format text|json|github|env]\n ddd-ts-kit check [paths...] [--rule <id>]... [--format text|json|github|gitlab] [--changed-since <git-ref>] [--self]\n ddd-ts-kit check --clean-only <dir>... [--rule <id>]... [--format text|json|github]\n ddd-ts-kit check --commit-size [--staged] [--strict]\n ddd-ts-kit check-file <path>\n ddd-ts-kit rules\n ddd-ts-kit explain <rule-id>\n\nEvery command accepts --json (machine-readable output) and --cwd <dir> (project root).";
|
|
2
|
+
export declare const USAGE = "Usage\n ddd-ts-kit init [--http express|fastify|hono|nest|none]\n [--validation zod|class-validator|typebox|standard-schema|none]\n [--di tsyringe|nest|manual] [--tests vitest|jest]\n [--orm drizzle|knex|prisma|typeorm|custom|none] [--database postgres|mysql|sqlite|none]\n [--events in-memory|outbox] [--docs-ui swagger|scalar|redoc|none]\n [--ci github|gitlab|both|none] [--ci-extras <extra>,...|none]\n [--authn jwt|keycloak|none] [--authz rbac|abac|rebac|custom]\n [--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis] [--http-cache none|varnish]\n [--storage local|s3|none]\n [--audit on|off]\n [--errors none|sentry] [--logger stdout|pino|winston] [--style declared|explicit] [--assembly barrel|discovery]\n [--dependencies signature|listed] [--refusals factories|classes]\n [--routes controllers|functions] [--representations negotiated|json] [--forms on|off]\n [--value-objects throwing|result] [--literals named|free] [--values classes|free] [--tenancy none|shared-table] [--queue database|redis|memory]\n [--schemas shared|per-route]\n [--package-manager npm|pnpm] [--allow-no-outbox \"<reason>\"] [--import-alias '$<name>/']\n [--import-extension none|js] [--sdk]\n [--context <name>:<core|supporting|generic>]... [--preset identity]... [--dry-run] [--force]\n ddd-ts-kit generate <kind> ... [--term \"<Term>=<meaning>\"]... [--allow-name] [--local-only] [--dry-run] [--force] (alias: g)\n ddd-ts-kit generate --help --json\n ddd-ts-kit list [--context <name>]\n ddd-ts-kit describe <context>\n ddd-ts-kit status [--workers]\n ddd-ts-kit doctor [--strict]\n ddd-ts-kit todo [<context>]\n ddd-ts-kit worker-scope <context> [--base <ref>] [--rows <id,...>] [--worktree <path>] [--branch <name>] [--dry-run]\n ddd-ts-kit verify-slice <context> --since <git-ref>\n ddd-ts-kit docs [--check] [--stored-events]\n ddd-ts-kit sdk [--check] [--dry-run]\n ddd-ts-kit depcruise-config [--check|--write]\n ddd-ts-kit build-aliases [--project <tsconfig>]\n ddd-ts-kit drizzle-generate --name <what-it-does> [--custom]\n ddd-ts-kit error-factories --plan | --apply [--dry-run]\n ddd-ts-kit controllers [<context>] [--dry-run]\n ddd-ts-kit value-objects [--dry-run]\n ddd-ts-kit affected [--base <git-ref>] [--head <git-ref>] [--format text|json|github|env]\n ddd-ts-kit check [paths...] [--rule <id>]... [--format text|json|github|gitlab] [--changed-since <git-ref>] [--self]\n ddd-ts-kit check --clean-only <dir>... [--rule <id>]... [--format text|json|github]\n ddd-ts-kit check --commit-size [--staged] [--strict]\n ddd-ts-kit check-file <path>\n ddd-ts-kit rules\n ddd-ts-kit explain <rule-id>\n\nEvery command accepts --json (machine-readable output) and --cwd <dir> (project root).";
|
|
3
3
|
//# sourceMappingURL=usage.d.ts.map
|
package/dist/help/usage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/help/usage.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,eAAO,MAAM,KAAK,+
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/help/usage.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,eAAO,MAAM,KAAK,+8FA4CqE,CAAC"}
|
package/dist/help/usage.js
CHANGED
|
@@ -23,6 +23,7 @@ export const USAGE = `Usage
|
|
|
23
23
|
ddd-ts-kit list [--context <name>]
|
|
24
24
|
ddd-ts-kit describe <context>
|
|
25
25
|
ddd-ts-kit status [--workers]
|
|
26
|
+
ddd-ts-kit doctor [--strict]
|
|
26
27
|
ddd-ts-kit todo [<context>]
|
|
27
28
|
ddd-ts-kit worker-scope <context> [--base <ref>] [--rows <id,...>] [--worktree <path>] [--branch <name>] [--dry-run]
|
|
28
29
|
ddd-ts-kit verify-slice <context> --since <git-ref>
|
package/dist/help/usage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/help/usage.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,MAAM,CAAC,MAAM,KAAK,GAAG
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/help/usage.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uFA4CkE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type AgentPermissions = Readonly<Record<'allow' | 'deny' | 'ask', readonly string[]>>;
|
|
2
|
+
/**
|
|
3
|
+
* What an agent may do in the project without asking, what it never does, and what it asks
|
|
4
|
+
* for. Permissions only: nothing here changes how the agent behaves otherwise.
|
|
5
|
+
*/
|
|
6
|
+
export declare const AGENT_PERMISSIONS: AgentPermissions;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=agent-permissions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-permissions.d.ts","sourceRoot":"","sources":["../../src/init/agent-permissions.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,GAAG,MAAM,GAAG,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;AAEtF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,gBAiD/B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an agent may do in the project without asking, what it never does, and what it asks
|
|
3
|
+
* for. Permissions only: nothing here changes how the agent behaves otherwise.
|
|
4
|
+
*/
|
|
5
|
+
export const AGENT_PERMISSIONS = {
|
|
6
|
+
allow: [
|
|
7
|
+
'Bash(npx ddd-ts-kit check *)',
|
|
8
|
+
'Bash(npx ddd-ts-kit verify-slice *)',
|
|
9
|
+
'Bash(npx ddd-ts-kit list *)',
|
|
10
|
+
'Bash(npx ddd-ts-kit generate *)',
|
|
11
|
+
'Bash(npx ddd-ts-kit docs *)',
|
|
12
|
+
'Bash(npx ddd-ts-kit explain *)',
|
|
13
|
+
'Bash(npx ddd-ts-kit rules)',
|
|
14
|
+
'Bash(npm run verify)',
|
|
15
|
+
'Bash(npm run typecheck)',
|
|
16
|
+
'Bash(npm run lint *)',
|
|
17
|
+
'Bash(npm test *)',
|
|
18
|
+
'Bash(npm run test:e2e *)',
|
|
19
|
+
'Bash(npm run regenerate)',
|
|
20
|
+
'Bash(npm run docs:generate)',
|
|
21
|
+
'Bash(npm run docs:check)',
|
|
22
|
+
'Bash(npm run openapi:generate)',
|
|
23
|
+
'Bash(npm run openapi:check)',
|
|
24
|
+
'Bash(npm run events:generate)',
|
|
25
|
+
'Bash(npm run events:check)',
|
|
26
|
+
],
|
|
27
|
+
// Secrets, then the generated contracts: those are regenerated, never edited. In a deny
|
|
28
|
+
// list, a pattern starting with `!` carves its matches out of the rules before it
|
|
29
|
+
// (gitignore negation), which keeps `.env.example`, documentation, readable.
|
|
30
|
+
deny: [
|
|
31
|
+
'Read(./.env)',
|
|
32
|
+
'Read(./.env.*)',
|
|
33
|
+
'Read(!./.env.example)',
|
|
34
|
+
'Edit(./openapi/**)',
|
|
35
|
+
'Edit(./docs/integration/asyncapi.*)',
|
|
36
|
+
'Edit(./docs/integration/event-catalog.md)',
|
|
37
|
+
],
|
|
38
|
+
// Then the files that hold the rules and the pipeline: changing one is a decision of the
|
|
39
|
+
// project owner, the same list as the editor hook of the plugin asks about.
|
|
40
|
+
ask: [
|
|
41
|
+
'Bash(git push *)',
|
|
42
|
+
'Bash(npm publish *)',
|
|
43
|
+
'Edit(./ddd-ts-kit.config.json)',
|
|
44
|
+
'Edit(./eslint.config.mjs)',
|
|
45
|
+
'Edit(./biome.json)',
|
|
46
|
+
'Edit(./.dependency-cruiser.cjs)',
|
|
47
|
+
'Edit(./knip.json)',
|
|
48
|
+
'Edit(./lefthook.yml)',
|
|
49
|
+
'Edit(./.gitlab-ci.yml)',
|
|
50
|
+
'Edit(./.github/workflows/**)',
|
|
51
|
+
'Edit(./.claude/settings.json)',
|
|
52
|
+
'Edit(./.github/copilot/settings.json)',
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=agent-permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-permissions.js","sourceRoot":"","sources":["../../src/init/agent-permissions.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAqB;IACjD,KAAK,EAAE;QACL,8BAA8B;QAC9B,qCAAqC;QACrC,6BAA6B;QAC7B,iCAAiC;QACjC,6BAA6B;QAC7B,gCAAgC;QAChC,4BAA4B;QAC5B,sBAAsB;QACtB,yBAAyB;QACzB,sBAAsB;QACtB,kBAAkB;QAClB,0BAA0B;QAC1B,0BAA0B;QAC1B,6BAA6B;QAC7B,0BAA0B;QAC1B,gCAAgC;QAChC,6BAA6B;QAC7B,+BAA+B;QAC/B,4BAA4B;KAC7B;IACD,wFAAwF;IACxF,kFAAkF;IAClF,6EAA6E;IAC7E,IAAI,EAAE;QACJ,cAAc;QACd,gBAAgB;QAChB,uBAAuB;QACvB,oBAAoB;QACpB,qCAAqC;QACrC,2CAA2C;KAC5C;IACD,yFAAyF;IACzF,4EAA4E;IAC5E,GAAG,EAAE;QACH,kBAAkB;QAClB,qBAAqB;QACrB,gCAAgC;QAChC,2BAA2B;QAC3B,oBAAoB;QACpB,iCAAiC;QACjC,mBAAmB;QACnB,sBAAsB;QACtB,wBAAwB;QACxB,8BAA8B;QAC9B,+BAA+B;QAC/B,uCAAuC;KACxC;CACF,CAAC"}
|