@nielspeter/eess-mermaid 0.3.0 → 0.4.0
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/dist/cli/commands/check.d.ts.map +1 -1
- package/dist/cli/commands/check.js +141 -13
- package/dist/cli/commands/check.js.map +1 -1
- package/dist/cli/commands/explain.d.ts.map +1 -1
- package/dist/cli/commands/explain.js +7 -1
- package/dist/cli/commands/explain.js.map +1 -1
- package/dist/cli/import-config.d.ts +17 -0
- package/dist/cli/import-config.d.ts.map +1 -0
- package/dist/cli/import-config.js +28 -0
- package/dist/cli/import-config.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +3 -9
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/load-rules.d.ts +24 -5
- package/dist/cli/load-rules.d.ts.map +1 -1
- package/dist/cli/load-rules.js +39 -9
- package/dist/cli/load-rules.js.map +1 -1
- package/dist/cli/resolve-config.d.ts.map +1 -1
- package/dist/cli/resolve-config.js +12 -38
- package/dist/cli/resolve-config.js.map +1 -1
- package/dist/cli/watch.d.ts +8 -0
- package/dist/cli/watch.d.ts.map +1 -1
- package/dist/cli/watch.js +3 -110
- package/dist/cli/watch.js.map +1 -1
- package/dist/conditions/class.d.ts.map +1 -1
- package/dist/conditions/class.js +26 -33
- package/dist/conditions/class.js.map +1 -1
- package/dist/core/index.d.ts +3 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +7 -1
- package/dist/core/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/parser/langium-services.d.ts +18 -0
- package/dist/parser/langium-services.d.ts.map +1 -0
- package/dist/parser/langium-services.js +14 -0
- package/dist/parser/langium-services.js.map +1 -0
- package/dist/parser/parse-class-diagram.d.ts +2 -4
- package/dist/parser/parse-class-diagram.d.ts.map +1 -1
- package/dist/parser/parse-class-diagram.js +8 -30
- package/dist/parser/parse-class-diagram.js.map +1 -1
- package/dist/parser/parse-er-diagram.d.ts.map +1 -1
- package/dist/parser/parse-er-diagram.js +3 -23
- package/dist/parser/parse-er-diagram.js.map +1 -1
- package/dist/parser/parse-with-grammar.d.ts +22 -0
- package/dist/parser/parse-with-grammar.d.ts.map +1 -0
- package/dist/parser/parse-with-grammar.js +37 -0
- package/dist/parser/parse-with-grammar.js.map +1 -0
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/check.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/check.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAA+B,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAIjF,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,MAAM,EAAE,YAAY,GAAG,MAAM,CAAA;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AA4ED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAqG/D"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { detectFormat } from '@nielspeter/eess';
|
|
1
|
+
import { collectResult, detectFormat, finishPreset, isArchConfigError, reportViolations, } from '@nielspeter/eess';
|
|
2
|
+
import { basename } from 'node:path';
|
|
2
3
|
import { loadRuleFiles } from '../load-rules.js';
|
|
3
4
|
function isArchRuleError(value) {
|
|
4
5
|
if (value === null || typeof value !== 'object')
|
|
@@ -7,23 +8,142 @@ function isArchRuleError(value) {
|
|
|
7
8
|
// because the rule file may load its own copy of the kernel. Match by name.
|
|
8
9
|
return 'name' in value && typeof value.name === 'string' && value.name === 'ArchRuleError';
|
|
9
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* A rule file the loader refused — bug 0269.
|
|
13
|
+
*
|
|
14
|
+
* Its message is the loader's own, verbatim: that text names the offending entry
|
|
15
|
+
* by index and says what a builder must be, which is exactly what the reader
|
|
16
|
+
* needs and is not this function's to paraphrase.
|
|
17
|
+
*/
|
|
18
|
+
function reportRuleFileMisconfigured(file, detail, options) {
|
|
19
|
+
const violation = {
|
|
20
|
+
rule: 'rule file: misconfigured',
|
|
21
|
+
ruleId: 'cli/rule-file-misconfigured',
|
|
22
|
+
// BASENAME: with the full path here the terminal rendered `<path>:1 — <path>`,
|
|
23
|
+
// the same string twice on one line. `eess-ts` uses the basename for the
|
|
24
|
+
// same reason, recorded in its own finding module.
|
|
25
|
+
element: basename(file),
|
|
26
|
+
file,
|
|
27
|
+
line: 1,
|
|
28
|
+
message: `${basename(file)} could not be loaded, so its rules enforced nothing in this run.`,
|
|
29
|
+
because: 'a rule file that cannot be loaded enforces nothing, and a silent skip is a green gate over an absent rule',
|
|
30
|
+
// The loader's own text names the offending entry by index and says what a
|
|
31
|
+
// builder must be. That IS the fix, so it is the suggestion rather than a
|
|
32
|
+
// paraphrase of it.
|
|
33
|
+
suggestion: detail,
|
|
34
|
+
bypassFilters: true,
|
|
35
|
+
};
|
|
36
|
+
reportViolations(collectResult([violation], { examined: 0 }), options);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A rule file that loaded and contributed no rules — bug 0269.
|
|
40
|
+
*
|
|
41
|
+
* `eess-ts` has `ruleFileContributedNoRules` for this; the mermaid dialect had
|
|
42
|
+
* no equivalent and simply counted zero. Unsuppressable, because a file that
|
|
43
|
+
* enforces nothing is a configuration fault rather than a finding about a
|
|
44
|
+
* diagram.
|
|
45
|
+
*/
|
|
46
|
+
function reportContributedNoRules(file, options) {
|
|
47
|
+
const violation = {
|
|
48
|
+
rule: 'rule file: contributed no rules',
|
|
49
|
+
ruleId: 'cli/rule-file-contributed-no-rules',
|
|
50
|
+
element: basename(file),
|
|
51
|
+
file,
|
|
52
|
+
line: 1,
|
|
53
|
+
message: `${basename(file)} loaded but contributed no rules, so this run enforced nothing from it.`,
|
|
54
|
+
because: 'a rule file that contributes no rules cannot fail, and a gate that cannot fail is worth less than no gate',
|
|
55
|
+
// `message` says what happened, `because` why it matters, `suggestion` what
|
|
56
|
+
// to do — the split `eess-ts` uses and `CLAUDE.md` promises ("every violation
|
|
57
|
+
// surfaces its rationale, a `Fix:` line, and a `Docs:` link where present").
|
|
58
|
+
// The first cut put the whole remedy in `message` and left `suggestion`
|
|
59
|
+
// unset, so the terminal printed no `Fix:` and a JSON consumer keying on
|
|
60
|
+
// `suggestion` got null.
|
|
61
|
+
suggestion: 'Export the builders you meant to check: `export default [ …builders ]`, or a ' +
|
|
62
|
+
'function returning that array. A single un-arrayed builder is not accepted. ' +
|
|
63
|
+
'If the file is deliberately empty, delete it rather than leaving a rule file ' +
|
|
64
|
+
'that enforces nothing.',
|
|
65
|
+
bypassFilters: true,
|
|
66
|
+
};
|
|
67
|
+
// No try/catch: `reportViolations` escalates to a throw only for the emitter's
|
|
68
|
+
// own ids (ADR-014 §5), and this is not one of them. Swallowing a throw here
|
|
69
|
+
// would hide a real defect, and the repo's own `every discarded error carries a
|
|
70
|
+
// written reason` rule is right to refuse it.
|
|
71
|
+
reportViolations(collectResult([violation], { examined: 0 }), options);
|
|
72
|
+
}
|
|
10
73
|
export async function runCheck(args) {
|
|
11
74
|
const started = Date.now();
|
|
12
75
|
const format = args.format === 'auto' ? detectFormat() : args.format;
|
|
13
76
|
const options = { format };
|
|
14
77
|
const loadOptions = { fresh: args.fresh };
|
|
15
|
-
|
|
78
|
+
// **Per rule file, and through the receipt** — bug 0269. This loop used to
|
|
79
|
+
// call `builder.check(options)` and count the throws, which never looks at
|
|
80
|
+
// what the rule examined: a hand-rolled `{ check: () => {} }` was a counted
|
|
81
|
+
// rule and a green tick. It now reads `violations()` — the receipt every
|
|
82
|
+
// builder already carries — and hands it to the kernel's gate, which is the
|
|
83
|
+
// wiring `eess-ts` gained in plan 0263 Phase 2.
|
|
84
|
+
//
|
|
85
|
+
// Per file rather than over one flat array, so the finding can name the rule
|
|
86
|
+
// file it came from. An emitter finding carries `file: ''` by construction (the
|
|
87
|
+
// fault is the verdict, not a place in anyone's code), and "which rule file"
|
|
88
|
+
// is the first thing the reader needs — bug 0026's seam, in the dialect that
|
|
89
|
+
// had not learned it yet.
|
|
90
|
+
// Rules that failed, and findings about a rule FILE, counted apart. A
|
|
91
|
+
// file-level finding is not a failing rule, and folding them together printed
|
|
92
|
+
// `1 of 0 rules failing` — the same nonsense `eess-ts` printed as `2 of 1 rule
|
|
93
|
+
// failing` when it double-counted, caught there in review.
|
|
16
94
|
let failures = 0;
|
|
17
|
-
|
|
95
|
+
let fileFindings = 0;
|
|
96
|
+
let ruleCount = 0;
|
|
97
|
+
for (const file of args.ruleFiles) {
|
|
98
|
+
let builders;
|
|
18
99
|
try {
|
|
19
|
-
|
|
100
|
+
builders = await loadRuleFiles([file], loadOptions);
|
|
20
101
|
}
|
|
21
102
|
catch (error) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
103
|
+
// A misconfigured rule file is a FINDING, not a stack trace. The loader
|
|
104
|
+
// now rejects a non-builder loudly (it used to drop it silently, turning a
|
|
105
|
+
// rule that ran and failed into a green run), and without this catch that
|
|
106
|
+
// loudness reached the adopter as an uncaught `ArchConfigError` with a
|
|
107
|
+
// Node stack frame — and abandoned every remaining rule file. `eess-ts`
|
|
108
|
+
// reports the same class as `ruleFileMisconfigured`; this is its
|
|
109
|
+
// counterpart.
|
|
110
|
+
if (!isArchConfigError(error))
|
|
26
111
|
throw error;
|
|
112
|
+
fileFindings++;
|
|
113
|
+
reportRuleFileMisconfigured(file, error.message, options);
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
// A rule file that loads cleanly and contributes nothing enforces nothing.
|
|
117
|
+
// Measured before this: `export default []` printed
|
|
118
|
+
// `✓ eess-mermaid — 0 rules across 1 file · 0 failing` and exited 0 — the
|
|
119
|
+
// zero denominator under a tick that `CLAUDE.md` calls a red flag.
|
|
120
|
+
if (builders.length === 0) {
|
|
121
|
+
fileFindings++;
|
|
122
|
+
reportContributedNoRules(file, options);
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
ruleCount += builders.length;
|
|
126
|
+
for (const builder of builders) {
|
|
127
|
+
const receipt = builder.violations();
|
|
128
|
+
const gated = finishPreset(receipt, { report: 'return' });
|
|
129
|
+
if (gated.length === 0)
|
|
130
|
+
continue;
|
|
131
|
+
failures++;
|
|
132
|
+
const attributed = gated.map((v) => v.file === '' ? { ...v, file, line: v.line === 0 ? 1 : v.line } : v);
|
|
133
|
+
try {
|
|
134
|
+
// `gated.examined`, not `receipt.examined`. A bare array has no
|
|
135
|
+
// `examined` at all, so re-wrapping with the RAW receipt's value hands
|
|
136
|
+
// `reportViolations` a receipt that claims no evidence — and its gate
|
|
137
|
+
// appends a SECOND `emitter/no-receipt`, printing the same finding twice.
|
|
138
|
+
// Measured: `[1 of 2]` and `[2 of 2]`, one attributed and one not. The
|
|
139
|
+
// gated receipt already carries the corrected count.
|
|
140
|
+
reportViolations(collectResult(attributed, { examined: gated.examined }), options);
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
// The gate's own finding escalates to a throw inside `reportViolations`
|
|
144
|
+
// (ADR-014 §5). It is already counted and already printed.
|
|
145
|
+
if (!isArchRuleError(error))
|
|
146
|
+
throw error;
|
|
27
147
|
}
|
|
28
148
|
}
|
|
29
149
|
}
|
|
@@ -32,13 +152,21 @@ export async function runCheck(args) {
|
|
|
32
152
|
if (format === 'terminal') {
|
|
33
153
|
const ms = Date.now() - started;
|
|
34
154
|
const time = ms < 1000 ? `${ms}ms` : `${(ms / 1000).toFixed(2)}s`;
|
|
35
|
-
const rules =
|
|
155
|
+
const rules = ruleCount;
|
|
36
156
|
const files = args.ruleFiles.length;
|
|
37
157
|
const scope = `${rules} rule${rules === 1 ? '' : 's'} across ${files} file${files === 1 ? '' : 's'}`;
|
|
38
|
-
|
|
39
|
-
?
|
|
40
|
-
:
|
|
158
|
+
const fileNote = fileFindings === 0
|
|
159
|
+
? ''
|
|
160
|
+
: ` · ${fileFindings} rule-file finding${fileFindings === 1 ? '' : 's'}`;
|
|
161
|
+
// "0 of 0 rules failing" is noise: when nothing loaded, the finding IS the
|
|
162
|
+
// denominator, so say that instead of dressing a zero as a ratio.
|
|
163
|
+
const line = failures === 0 && fileFindings === 0
|
|
164
|
+
? `✓ eess-mermaid — ${scope} · 0 failing (${time})`
|
|
165
|
+
: rules === 0
|
|
166
|
+
? `✗ eess-mermaid — ${scope}${fileNote} (${time})`
|
|
167
|
+
: `✗ eess-mermaid — ${failures} of ${scope} failing${fileNote} (${time})`;
|
|
168
|
+
process.stderr.write(`\n${line}\n`);
|
|
41
169
|
}
|
|
42
|
-
return failures;
|
|
170
|
+
return failures + fileFindings;
|
|
43
171
|
}
|
|
44
172
|
//# sourceMappingURL=check.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../../src/cli/commands/check.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../../src/cli/commands/check.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,aAAa,EAA0C,MAAM,kBAAkB,CAAA;AAQxF,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC7D,+EAA+E;IAC/E,4EAA4E;IAC5E,OAAO,MAAM,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KA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;QAC/E,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,CAAA;IACrC,CAAC;IAED,OAAO,QAAQ,GAAG,YAAY,CAAA;AAChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/explain.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/explain.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAcD,wBAAsB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBjE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isDescribable } from '@nielspeter/eess/internal';
|
|
1
2
|
import { loadRuleFiles } from '../load-rules.js';
|
|
2
3
|
function isRuleDescription(value) {
|
|
3
4
|
return value !== null && typeof value === 'object';
|
|
@@ -6,7 +7,12 @@ export async function runExplain(args) {
|
|
|
6
7
|
const builders = await loadRuleFiles(args.ruleFiles);
|
|
7
8
|
const rules = [];
|
|
8
9
|
for (const builder of builders) {
|
|
9
|
-
|
|
10
|
+
// `isDescribable` from the kernel, not a `describeRule` member on the
|
|
11
|
+
// dialect's own builder type — bug 0269's review. The local
|
|
12
|
+
// `RuleBuilderLike` copy carried `describeRule?` solely for this loop, and
|
|
13
|
+
// keeping the copy is what made ADR-014's Tier-1 mechanism untrue of this
|
|
14
|
+
// dialect. `eess-ts`'s `explain` already reads it this way.
|
|
15
|
+
if (!isDescribable(builder))
|
|
10
16
|
continue;
|
|
11
17
|
const desc = builder.describeRule();
|
|
12
18
|
if (isRuleDescription(desc))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explain.js","sourceRoot":"","sources":["../../../src/cli/commands/explain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AI,EAAE,CAAC;QAC3B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAA;IAC7C,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;IACjE,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,KAA4B;IAClD,MAAM,MAAM,GAAG,2DAA2D,CAAA;IAC1E,MAAM,IAAI,GAAG,KAAK;SACf,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,IAAI,EAAE,MAAM,CAAC,CAAC,UAAU,IAAI,EAAE,IAAI,CAAC;SAC9F,IAAI,CAAC,IAAI,CAAC,CAAA;IACb,OAAO,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;AAC7B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load a config or rule module — natively when Node can, via jiti when it cannot.
|
|
3
|
+
*
|
|
4
|
+
* **This closes a live bug, not just a duplication.** `resolve-config.ts` used a
|
|
5
|
+
* bare `await import()`, and `CONFIG_FILENAMES` lists `.ts` files — so an
|
|
6
|
+
* `eess-mermaid.config.ts` in a `"type": "commonjs"` project (what `npm init -y`
|
|
7
|
+
* writes) was refused by Node and the config silently did not load. `eess-ts`
|
|
8
|
+
* has handled that since bug 0074; this package had `jiti` as a dependency the
|
|
9
|
+
* whole time and never used it.
|
|
10
|
+
*
|
|
11
|
+
* Native first, and that ordering is the design: a module loaded through jiti
|
|
12
|
+
* gets jiti's own registry, so the copy of the kernel it imports is a different
|
|
13
|
+
* instance from the CLI's. `isModuleFormatRefusal` keeps the fallback narrow —
|
|
14
|
+
* a broad catch would re-execute a file that had already run.
|
|
15
|
+
*/
|
|
16
|
+
export declare function importConfigModule(file: string): Promise<unknown>;
|
|
17
|
+
//# sourceMappingURL=import-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-config.d.ts","sourceRoot":"","sources":["../../src/cli/import-config.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOvE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createJiti } from 'jiti';
|
|
2
|
+
import { isModuleFormatRefusal } from '@nielspeter/eess/internal';
|
|
3
|
+
/**
|
|
4
|
+
* Load a config or rule module — natively when Node can, via jiti when it cannot.
|
|
5
|
+
*
|
|
6
|
+
* **This closes a live bug, not just a duplication.** `resolve-config.ts` used a
|
|
7
|
+
* bare `await import()`, and `CONFIG_FILENAMES` lists `.ts` files — so an
|
|
8
|
+
* `eess-mermaid.config.ts` in a `"type": "commonjs"` project (what `npm init -y`
|
|
9
|
+
* writes) was refused by Node and the config silently did not load. `eess-ts`
|
|
10
|
+
* has handled that since bug 0074; this package had `jiti` as a dependency the
|
|
11
|
+
* whole time and never used it.
|
|
12
|
+
*
|
|
13
|
+
* Native first, and that ordering is the design: a module loaded through jiti
|
|
14
|
+
* gets jiti's own registry, so the copy of the kernel it imports is a different
|
|
15
|
+
* instance from the CLI's. `isModuleFormatRefusal` keeps the fallback narrow —
|
|
16
|
+
* a broad catch would re-execute a file that had already run.
|
|
17
|
+
*/
|
|
18
|
+
export async function importConfigModule(file) {
|
|
19
|
+
try {
|
|
20
|
+
return await import(file);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
if (!isModuleFormatRefusal(error))
|
|
24
|
+
throw error;
|
|
25
|
+
return createJiti(import.meta.url).import(file);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=import-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-config.js","sourceRoot":"","sources":["../../src/cli/import-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAEjE;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAY;IACnD,IAAI,CAAC;QACH,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC;YAAE,MAAM,KAAK,CAAA;QAC9C,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACjD,CAAC;AACH,CAAC"}
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AA2GA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA+CvD"}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { requireRuleFiles } from '@nielspeter/eess/internal';
|
|
1
2
|
import { parseArgs } from 'node:util';
|
|
2
3
|
import { readFileSync } from 'node:fs';
|
|
3
4
|
import { fileURLToPath } from 'node:url';
|
|
@@ -47,15 +48,8 @@ function parseCliArgs(args) {
|
|
|
47
48
|
strict: true,
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
|
-
function requireRuleFiles(ruleFiles) {
|
|
51
|
-
if (ruleFiles.length > 0)
|
|
52
|
-
return true;
|
|
53
|
-
console.error('Error: No rule files specified. Pass rule files as arguments or set them in eess-mermaid.config.ts.');
|
|
54
|
-
process.exitCode = 1;
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
51
|
async function handleCheck(ruleFiles, values, config, format) {
|
|
58
|
-
if (!requireRuleFiles(ruleFiles))
|
|
52
|
+
if (!requireRuleFiles(ruleFiles, 'eess-mermaid.config.ts'))
|
|
59
53
|
return;
|
|
60
54
|
if (values.watch === true) {
|
|
61
55
|
const watchDirs = config.watchDirs ?? ['src'];
|
|
@@ -80,7 +74,7 @@ async function handleCheck(ruleFiles, values, config, format) {
|
|
|
80
74
|
}
|
|
81
75
|
}
|
|
82
76
|
async function handleExplain(ruleFiles, markdown) {
|
|
83
|
-
if (!requireRuleFiles(ruleFiles))
|
|
77
|
+
if (!requireRuleFiles(ruleFiles, 'eess-mermaid.config.ts'))
|
|
84
78
|
return;
|
|
85
79
|
const explainArgs = { ruleFiles, markdown };
|
|
86
80
|
await runExplain(explainArgs);
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAkB,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAoB,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,aAAa,EAAqB,MAAM,YAAY,CAAA;AAE7D,SAAS,UAAU;IACjB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,O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M,MAAM,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACjD,MAAM,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;IAC/F,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAA;IAC1D,MAAM,MAAM,GACV,SAAS,KAAK,UAAU;QACxB,SAAS,KAAK,MAAM;QACpB,SAAS,KAAK,QAAQ;QACtB,SAAS,KAAK,MAAM;QAClB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,MAAM,CAAA;IAEZ,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACxB,MAAM,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACtD,CAAC;SAAM,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAA;IACjD,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,2BAA2B,OAAO,0BAA0B,CAAC,CAAA;QAC3E,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;IACtB,CAAC;AACH,CAAC"}
|
package/dist/cli/load-rules.d.ts
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { RuleBuilderLike } from '@nielspeter/eess';
|
|
2
|
+
/**
|
|
3
|
+
* **The kernel's shape, re-exported rather than re-declared** — bug 0269's
|
|
4
|
+
* review.
|
|
5
|
+
*
|
|
6
|
+
* This dialect kept a local copy, and the first cut of the fix edited that copy
|
|
7
|
+
* to require `violations`. That left ADR-014's Tier-1 mechanism
|
|
8
|
+
* ("`RuleBuilderLike`'s single member; `npm run typecheck` across all six
|
|
9
|
+
* packages") untrue of the dialect the ADR had just named, because the type this
|
|
10
|
+
* package typechecks against was its own three-member one.
|
|
11
|
+
*
|
|
12
|
+
* The receipt is what the CLI now keys on: the loader used to accept anything
|
|
13
|
+
* with a `check` method, which any hand-rolled object satisfies, so
|
|
14
|
+
* `export default [{ check: () => {} }]` was counted as a rule and the run
|
|
15
|
+
* printed `✓ eess-mermaid — 1 rule across 1 file · 0 failing`. Every real
|
|
16
|
+
* builder already had the receipt — `ClassRuleBuilder` extends the kernel's
|
|
17
|
+
* `TerminalBuilder` — which is why this was a wiring fix and not the
|
|
18
|
+
* dialect-wide contract change the bug record first supposed.
|
|
19
|
+
*
|
|
20
|
+
* `describeRule` was the only reason for a local shape; `isDescribable` in
|
|
21
|
+
* `@nielspeter/eess/internal` answers it, which is what `eess-ts`'s `explain`
|
|
22
|
+
* already uses.
|
|
23
|
+
*/
|
|
24
|
+
export type { RuleBuilderLike } from '@nielspeter/eess';
|
|
6
25
|
export interface LoadOptions {
|
|
7
26
|
fresh?: boolean;
|
|
8
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-rules.d.ts","sourceRoot":"","sources":["../../src/cli/load-rules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"load-rules.d.ts","sourceRoot":"","sources":["../../src/cli/load-rules.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAEvD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAEvD,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAUD,wBAAsB,aAAa,CACjC,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,eAAe,EAAE,CAAC,CAmC5B"}
|
package/dist/cli/load-rules.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { createJiti } from 'jiti';
|
|
3
|
+
import { ArchConfigError } from '@nielspeter/eess';
|
|
3
4
|
let cachedJiti;
|
|
4
5
|
function getJiti(fresh) {
|
|
5
6
|
if (fresh)
|
|
@@ -15,12 +16,26 @@ export async function loadRuleFiles(files, options) {
|
|
|
15
16
|
const resolved = path.resolve(file);
|
|
16
17
|
const mod = await jiti.import(resolved);
|
|
17
18
|
const exported = extractDefault(mod);
|
|
18
|
-
const items = resolveExported(exported);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const items = resolveExported(exported, resolved);
|
|
20
|
+
// A non-builder in the default-export array is a LOUD ERROR, never a silent
|
|
21
|
+
// skip — the rule `eess-ts`'s loader states and this one did not have.
|
|
22
|
+
//
|
|
23
|
+
// Measured on the branch that tightened the guard without porting the
|
|
24
|
+
// loudness: a rule file holding one real builder and one hand-rolled
|
|
25
|
+
// `{ check() { throw … } }` went from **exit 1** (the hand-rolled rule ran
|
|
26
|
+
// and threw) to `✓ eess-mermaid — 1 rule across 1 file · 0 failing`, exit 0.
|
|
27
|
+
// A rule that ran and failed simply stopped existing, under a denominator
|
|
28
|
+
// that still said one rule was there. A silently-dropped rule is a
|
|
29
|
+
// green-but-empty gate, which is the defect this tool exists to forbid.
|
|
30
|
+
items.forEach((item, index) => {
|
|
31
|
+
if (!isRuleBuilderLike(item)) {
|
|
32
|
+
throw new ArchConfigError('loadRuleFiles', `Rule file "${resolved}": default export entry [${index}] is not a rule builder ` +
|
|
33
|
+
`(got ${describeValue(item)}). Every entry must be a builder that can report what ` +
|
|
34
|
+
`it examined — e.g. \`classes(diagram(…)).should()…\`. An object with only a ` +
|
|
35
|
+
`\`check()\` method cannot say what it examined, so it cannot be gated.`);
|
|
22
36
|
}
|
|
23
|
-
|
|
37
|
+
builders.push(item);
|
|
38
|
+
});
|
|
24
39
|
}
|
|
25
40
|
return builders;
|
|
26
41
|
}
|
|
@@ -28,7 +43,7 @@ export async function loadRuleFiles(files, options) {
|
|
|
28
43
|
* Resolve the exported value to an array of unknowns.
|
|
29
44
|
* Supports: direct arrays, or factory functions returning arrays.
|
|
30
45
|
*/
|
|
31
|
-
function resolveExported(exported) {
|
|
46
|
+
function resolveExported(exported, file) {
|
|
32
47
|
if (Array.isArray(exported)) {
|
|
33
48
|
return exported;
|
|
34
49
|
}
|
|
@@ -40,7 +55,20 @@ function resolveExported(exported) {
|
|
|
40
55
|
return result;
|
|
41
56
|
}
|
|
42
57
|
}
|
|
43
|
-
|
|
58
|
+
// Loud, for the same reason as the entry check above: a default export of the
|
|
59
|
+
// wrong shape used to make the file contribute zero rules silently.
|
|
60
|
+
throw new ArchConfigError('loadRuleFiles', `Rule file "${file}": default export must be an array of rule builders, or a ` +
|
|
61
|
+
`function returning one (got ${describeValue(exported)}). Add ` +
|
|
62
|
+
'`export default [ …builders ]`.');
|
|
63
|
+
}
|
|
64
|
+
function describeValue(value) {
|
|
65
|
+
if (value === null)
|
|
66
|
+
return 'null';
|
|
67
|
+
if (value === undefined)
|
|
68
|
+
return 'undefined';
|
|
69
|
+
if (Array.isArray(value))
|
|
70
|
+
return 'an array';
|
|
71
|
+
return typeof value;
|
|
44
72
|
}
|
|
45
73
|
function extractDefault(mod) {
|
|
46
74
|
if (mod === null || mod === undefined || typeof mod !== 'object') {
|
|
@@ -56,7 +84,9 @@ function isRuleBuilderLike(value) {
|
|
|
56
84
|
if (value === null || value === undefined || typeof value !== 'object') {
|
|
57
85
|
return false;
|
|
58
86
|
}
|
|
59
|
-
// Structural
|
|
60
|
-
|
|
87
|
+
// Structural, and keyed on the RECEIPT rather than on `check` — bug 0269. A
|
|
88
|
+
// builder that cannot say what it examined cannot be gated, and counting it as
|
|
89
|
+
// a rule is how a hand-rolled no-op earned a green tick and a denominator.
|
|
90
|
+
return 'violations' in value && typeof value.violations === 'function';
|
|
61
91
|
}
|
|
62
92
|
//# sourceMappingURL=load-rules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-rules.js","sourceRoot":"","sources":["../../src/cli/load-rules.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"load-rules.js","sourceRoot":"","sources":["../../src/cli/load-rules.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AA+BlD,IAAI,UAAqD,CAAA;AAEzD,SAAS,OAAO,CAAC,KAAc;IAC7B,IAAI,KAAK;QAAE,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAA;IACrF,IAAI,CAAC,UAAU;QAAE,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzD,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAAe,EACf,OAAqB;IAErB,MAAM,QAAQ,GAAsB,EAAE,CAAA;IACtC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,KAAK,KAAK,IAAI,CAAC,CAAA;IAE7C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACnC,MAAM,GAAG,GAAY,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QAEhD,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,CAA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C;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAA;IACjC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,WAAW,CAAA;IAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,UAAU,CAAA;IAC3C,OAAO,OAAO,KAAK,CAAA;AACrB,CAAC;AAED,SAAS,cAAc,CAAC,GAAY;IAClC,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACjE,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,yEAAyE;IACzE,IAAI,SAAS,IAAI,GAAG,EAAE,CAAC;QACrB,OAAO,GAAG,CAAC,OAAO,CAAA;IACpB,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvE,OAAO,KAAK,CAAA;IACd,CAAC;IACD,4EAA4E;IAC5E,+EAA+E;IAC/E,2EAA2E;IAC3E,OAAO,YAAY,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,UAAU,CAAA;AACxE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-config.d.ts","sourceRoot":"","sources":["../../src/cli/resolve-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve-config.d.ts","sourceRoot":"","sources":["../../src/cli/resolve-config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAgB5C,wBAAsB,aAAa,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAK7E"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import
|
|
2
|
+
import { findConfigFile, extractSharedConfig } from '@nielspeter/eess/internal';
|
|
3
|
+
import { importConfigModule } from './import-config.js';
|
|
4
|
+
/**
|
|
5
|
+
* Resolve CLI configuration from an explicit path or by searching for one.
|
|
6
|
+
*
|
|
7
|
+
* Finding the file and validating the loaded module are the kernel's — they were
|
|
8
|
+
* duplicated with `eess-ts` (`findConfigFile` scored 100%). What is this
|
|
9
|
+
* dialect's is which filenames to look for.
|
|
10
|
+
*/
|
|
3
11
|
const CONFIG_FILENAMES = [
|
|
4
12
|
'eess-mermaid.config.ts',
|
|
5
13
|
'eess-mermaid.config.js',
|
|
@@ -7,44 +15,10 @@ const CONFIG_FILENAMES = [
|
|
|
7
15
|
'mermaidunit.config.js',
|
|
8
16
|
];
|
|
9
17
|
export async function resolveConfig(explicitPath) {
|
|
10
|
-
const configPath = explicitPath ?? findConfigFile();
|
|
18
|
+
const configPath = explicitPath ?? findConfigFile(CONFIG_FILENAMES);
|
|
11
19
|
if (configPath === undefined)
|
|
12
20
|
return {};
|
|
13
|
-
const mod = await
|
|
14
|
-
return
|
|
15
|
-
}
|
|
16
|
-
function findConfigFile() {
|
|
17
|
-
const cwd = process.cwd();
|
|
18
|
-
for (const name of CONFIG_FILENAMES) {
|
|
19
|
-
const candidate = path.join(cwd, name);
|
|
20
|
-
if (fs.existsSync(candidate))
|
|
21
|
-
return candidate;
|
|
22
|
-
}
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
function isRecord(value) {
|
|
26
|
-
return value !== null && typeof value === 'object';
|
|
27
|
-
}
|
|
28
|
-
function extractDefault(mod) {
|
|
29
|
-
if (!isRecord(mod))
|
|
30
|
-
return {};
|
|
31
|
-
if (!('default' in mod))
|
|
32
|
-
return {};
|
|
33
|
-
const defaultExport = mod.default;
|
|
34
|
-
if (!isRecord(defaultExport))
|
|
35
|
-
return {};
|
|
36
|
-
const obj = defaultExport;
|
|
37
|
-
const config = {};
|
|
38
|
-
const format = obj['format'];
|
|
39
|
-
if (format === 'terminal' || format === 'json' || format === 'github' || format === 'auto') {
|
|
40
|
-
config.format = format;
|
|
41
|
-
}
|
|
42
|
-
if (Array.isArray(obj['rules'])) {
|
|
43
|
-
config.rules = obj['rules'].filter((r) => typeof r === 'string');
|
|
44
|
-
}
|
|
45
|
-
if (Array.isArray(obj['watchDirs'])) {
|
|
46
|
-
config.watchDirs = obj['watchDirs'].filter((r) => typeof r === 'string');
|
|
47
|
-
}
|
|
48
|
-
return config;
|
|
21
|
+
const mod = await importConfigModule(path.resolve(configPath));
|
|
22
|
+
return extractSharedConfig(mod);
|
|
49
23
|
}
|
|
50
24
|
//# sourceMappingURL=resolve-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-config.js","sourceRoot":"","sources":["../../src/cli/resolve-config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"resolve-config.js","sourceRoot":"","sources":["../../src/cli/resolve-config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAGvD;;;;;;GAMG;AACH,MAAM,gBAAgB,GAAG;IACvB,wBAAwB;IACxB,wBAAwB;IACxB,uBAAuB;IACvB,uBAAuB;CACxB,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,YAAqB;IACvD,MAAM,UAAU,GAAG,YAAY,IAAI,cAAc,CAAC,gBAAgB,CAAC,CAAA;IACnE,IAAI,UAAU,KAAK,SAAS;QAAE,OAAO,EAAE,CAAA;IACvC,MAAM,GAAG,GAAY,MAAM,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;IACvE,OAAO,mBAAmB,CAAC,GAAG,CAAC,CAAA;AACjC,CAAC"}
|
package/dist/cli/watch.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Watch mode for `eess-mermaid`.
|
|
3
|
+
*
|
|
4
|
+
* The scheduling and the watch loop live in the kernel — they were duplicated
|
|
5
|
+
* with `eess-ts` and the copies drifted, one of them keeping an `instanceof`
|
|
6
|
+
* check the other had already replaced (see `@nielspeter/eess`'s `watch.ts`).
|
|
7
|
+
* What is dialect-specific is only which filenames count as a change.
|
|
8
|
+
*/
|
|
1
9
|
export interface WatchOptions {
|
|
2
10
|
watchDirs: string[];
|
|
3
11
|
watchFiles: string[];
|
package/dist/cli/watch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/cli/watch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/cli/watch.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAKD,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAEzD"}
|