@r_masseater/msch 0.98.0 → 0.100.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/README.md +1 -18
- package/dist/cargo-inputs.mjs +2 -2
- package/dist/cli.mjs +5215 -1075
- package/dist/cli.mjs.map +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +2 -2
- package/dist/decision-rules.d.mts +1 -1
- package/dist/decision-rules.mjs +1 -1
- package/dist/{define-lint-preset-YcRo_ZW9.mjs → define-lint-preset-BnOZuTNT.mjs} +29 -133
- package/dist/define-lint-preset-BnOZuTNT.mjs.map +1 -0
- package/dist/{ignored-directories-D-7Rm_2X.mjs → ignored-directories-DVyp8bfD.mjs} +2 -2
- package/dist/{ignored-directories-D-7Rm_2X.mjs.map → ignored-directories-DVyp8bfD.mjs.map} +1 -1
- package/dist/{index-Dm0Gg9wS.d.mts → index-Cdap8t_F.d.mts} +2 -2
- package/dist/{index-CUrewm-i.d.mts → index-DbmdHsLx.d.mts} +43 -21
- package/dist/lint-rules.mjs +145 -17
- package/dist/lint-rules.mjs.map +1 -1
- package/dist/lint.d.mts +2 -2
- package/dist/lint.mjs +1 -1
- package/dist/oxlint.mjs +4 -3
- package/dist/oxlint.mjs.map +1 -1
- package/dist/{problem-DbuTeNvL.mjs → problem-BTQ96CJ5.mjs} +2 -2
- package/dist/{problem-DbuTeNvL.mjs.map → problem-BTQ96CJ5.mjs.map} +1 -1
- package/dist/{published-3eokcs_D.mjs → published-O6THHxdC.mjs} +172 -6
- package/dist/published-O6THHxdC.mjs.map +1 -0
- package/dist/{repository-files-DSwKJnrj.mjs → repository-files-BwjF-kJ8.mjs} +2 -2
- package/dist/{repository-files-DSwKJnrj.mjs.map → repository-files-BwjF-kJ8.mjs.map} +1 -1
- package/dist/{repository-text-DE4rRWEZ.mjs → repository-text-qZQSVg9L.mjs} +8 -8
- package/dist/repository-text-qZQSVg9L.mjs.map +1 -0
- package/dist/workspace-settings.d.mts +1 -1
- package/dist/workspace-settings.mjs +3 -4
- package/dist/workspace-settings.mjs.map +1 -1
- package/package.json +5 -13
- package/skills/msch-checks/SKILL.md +10 -10
- package/skills/msch-publishing/SKILL.md +12 -12
- package/skills/msch-repository-config/SKILL.md +2 -2
- package/dist/base-revision-Bl-4nxAd.mjs +0 -15
- package/dist/base-revision-Bl-4nxAd.mjs.map +0 -1
- package/dist/changed.d.mts +0 -1
- package/dist/changed.mjs +0 -245
- package/dist/changed.mjs.map +0 -1
- package/dist/cli-contract-D7btWrEu.mjs +0 -5
- package/dist/cli-contract-D7btWrEu.mjs.map +0 -1
- package/dist/define-lint-preset-YcRo_ZW9.mjs.map +0 -1
- package/dist/exits.d.mts +0 -1
- package/dist/exits.mjs +0 -40
- package/dist/exits.mjs.map +0 -1
- package/dist/judge.d.mts +0 -1
- package/dist/judge.mjs +0 -415
- package/dist/judge.mjs.map +0 -1
- package/dist/lookup-report-L5OLXRMf.mjs +0 -29
- package/dist/lookup-report-L5OLXRMf.mjs.map +0 -1
- package/dist/manifest-texts-DPgsV8kj.mjs +0 -19
- package/dist/manifest-texts-DPgsV8kj.mjs.map +0 -1
- package/dist/output-DAvdel9H.mjs +0 -33
- package/dist/output-DAvdel9H.mjs.map +0 -1
- package/dist/package-routes-BQWX5ttU.mjs +0 -73
- package/dist/package-routes-BQWX5ttU.mjs.map +0 -1
- package/dist/package-versions-sx15IGwA.mjs +0 -92
- package/dist/package-versions-sx15IGwA.mjs.map +0 -1
- package/dist/pass-records-BcAAWgiQ.mjs +0 -437
- package/dist/pass-records-BcAAWgiQ.mjs.map +0 -1
- package/dist/publish.d.mts +0 -1
- package/dist/publish.mjs +0 -1596
- package/dist/publish.mjs.map +0 -1
- package/dist/published-3eokcs_D.mjs.map +0 -1
- package/dist/published.d.mts +0 -1
- package/dist/published.mjs +0 -134
- package/dist/published.mjs.map +0 -1
- package/dist/refs.d.mts +0 -1
- package/dist/refs.mjs +0 -232
- package/dist/refs.mjs.map +0 -1
- package/dist/registries-DePiYd3D.mjs +0 -11
- package/dist/registries-DePiYd3D.mjs.map +0 -1
- package/dist/registry-releases-BBtz4wGE.mjs +0 -62
- package/dist/registry-releases-BBtz4wGE.mjs.map +0 -1
- package/dist/repository-text-DE4rRWEZ.mjs.map +0 -1
- package/dist/runtime-Djm7zMwu.mjs +0 -13
- package/dist/runtime-Djm7zMwu.mjs.map +0 -1
- package/dist/specifiers-BrCyPubD.mjs +0 -32
- package/dist/specifiers-BrCyPubD.mjs.map +0 -1
- package/dist/tree-sitter-BfzHNwTR.mjs +0 -41
- package/dist/tree-sitter-BfzHNwTR.mjs.map +0 -1
- package/dist/unbumped.d.mts +0 -1
- package/dist/unbumped.mjs +0 -19
- package/dist/unbumped.mjs.map +0 -1
- package/dist/upstream-exits-4bn4gblF.mjs +0 -357
- package/dist/upstream-exits-4bn4gblF.mjs.map +0 -1
- package/dist/upstream-record-DRNGym9S.mjs +0 -136
- package/dist/upstream-record-DRNGym9S.mjs.map +0 -1
- package/dist/upstream.d.mts +0 -1
- package/dist/upstream.mjs +0 -104
- package/dist/upstream.mjs.map +0 -1
- package/dist/workspace-manifest-BAVyPzbA.mjs +0 -8
- package/dist/workspace-manifest-BAVyPzbA.mjs.map +0 -1
- package/dist/workspace-projects-MpL8K7Nz.mjs +0 -172
- package/dist/workspace-projects-MpL8K7Nz.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-revision-Bl-4nxAd.mjs","names":[],"sources":["../src/shared/lib/base-revision.ts"],"sourcesContent":["import { Config, Effect, Option } from \"effect\";\n\nimport { RepositoryFiles } from \"./repository-files.ts\";\n\nconst DEFAULT_BASE = \"origin/main\";\n\n/** @internal */\nexport const baseName = Config.option(Config.String(\"VPA_BASE\")).pipe(\n Effect.orDie,\n Effect.map(Option.getOrElse(() => DEFAULT_BASE)),\n);\n\n/** @internal */\nexport const baseRevision = Effect.fn(\"baseRevision\")(function* baseRevision(root: string) {\n const files = yield* RepositoryFiles;\n const base = yield* baseName;\n return yield* files.mergeBase(root, base);\n});\n"],"mappings":";;;AAIA,MAAM,eAAe;;AAGrB,MAAa,WAAW,OAAO,OAAO,OAAO,OAAO,UAAU,CAAC,CAAC,CAAC,KAC/D,OAAO,OACP,OAAO,IAAI,OAAO,gBAAgB,YAAY,CAAC,CACjD;;AAGA,MAAa,eAAe,OAAO,GAAG,cAAc,CAAC,CAAC,UAAU,aAAa,MAAc;CACzF,MAAM,QAAQ,OAAO;CACrB,MAAM,OAAO,OAAO;CACpB,OAAO,OAAO,MAAM,UAAU,MAAM,IAAI;AAC1C,CAAC"}
|
package/dist/changed.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
package/dist/changed.mjs
DELETED
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { t as ProblemsFound } from "./output-DAvdel9H.mjs";
|
|
3
|
-
import { t as runCli } from "./runtime-Djm7zMwu.mjs";
|
|
4
|
-
import { i as installedPackages, n as keepOnly, r as recordsIn, s as workspaceClosure } from "./pass-records-BcAAWgiQ.mjs";
|
|
5
|
-
import { r as RepositoryFiles, t as MSCH_CACHE } from "./repository-files-DSwKJnrj.mjs";
|
|
6
|
-
import { r as workspaceDirectories } from "./workspace-projects-MpL8K7Nz.mjs";
|
|
7
|
-
import { Array, Effect, Option, Order, Record, Schema, Stdio, Stream, String as String$1, pipe } from "effect";
|
|
8
|
-
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
9
|
-
import { dual } from "effect/Function";
|
|
10
|
-
// src/features/run-changed/model/batches.ts
|
|
11
|
-
const ARITY = 2;
|
|
12
|
-
const NO_BATCHES = [];
|
|
13
|
-
const EMPTY_BATCH = {
|
|
14
|
-
units: [],
|
|
15
|
-
sources: 0
|
|
16
|
-
};
|
|
17
|
-
const bySourcesDescending = Order.mapInput(Order.flip(Order.Number), (unit) => unit.sources);
|
|
18
|
-
const byName = Order.mapInput(Order.String, (unit) => unit.name);
|
|
19
|
-
const added = (batch, unit) => ({
|
|
20
|
-
units: [...batch.units, unit],
|
|
21
|
-
sources: batch.sources + unit.sources
|
|
22
|
-
});
|
|
23
|
-
const joined = (batches, unit, index) => pipe(Array.modify(batches, index, (batch) => added(batch, unit)), Option.getOrElse(() => batches));
|
|
24
|
-
const placed = (batches, unit, limit) => pipe(batches, Array.findFirstIndex((batch) => batch.sources + unit.sources <= limit), Option.match({
|
|
25
|
-
onNone: () => [...batches, added(EMPTY_BATCH, unit)],
|
|
26
|
-
onSome: (index) => joined(batches, unit, index)
|
|
27
|
-
}));
|
|
28
|
-
const filled = (batches, units, limit) => Array.matchLeft(units, {
|
|
29
|
-
onEmpty: () => batches,
|
|
30
|
-
onNonEmpty: (unit, rest) => filled(placed(batches, unit, limit), rest, limit)
|
|
31
|
-
});
|
|
32
|
-
const batched = (units, limit) => {
|
|
33
|
-
const ordered = pipe(units, Array.sortBy(bySourcesDescending, byName));
|
|
34
|
-
return pipe(filled(NO_BATCHES, ordered, limit), Array.map((batch) => batch.units));
|
|
35
|
-
};
|
|
36
|
-
/** @internal */
|
|
37
|
-
const batchesOf = dual(ARITY, batched);
|
|
38
|
-
// src/features/run-changed/model/records.ts
|
|
39
|
-
const RECORDS = [...MSCH_CACHE, "changed"];
|
|
40
|
-
const ARGUMENT_SEPARATOR$1 = "\0";
|
|
41
|
-
const recordsOf = Effect.fn("recordsOf")(function* recordsOf(root, command) {
|
|
42
|
-
const files = yield* RepositoryFiles;
|
|
43
|
-
const name = yield* files.hash(Array.join(command, ARGUMENT_SEPARATOR$1));
|
|
44
|
-
return yield* recordsIn(files.join(root, ...RECORDS, name));
|
|
45
|
-
});
|
|
46
|
-
// src/features/run-changed/model/units.ts
|
|
47
|
-
const SEPARATOR = "/";
|
|
48
|
-
const FIELD_SEPARATOR = "\0";
|
|
49
|
-
const LINE_SEPARATOR = "\n";
|
|
50
|
-
const EMPTY = "";
|
|
51
|
-
const READ_CONCURRENCY = 16;
|
|
52
|
-
const SOURCE_FILE = /\.[cm]?[jt]sx?$/u;
|
|
53
|
-
const SHARED_CONFIG = /^(?:[^/]+\.config\.[cm]?[jt]s|tsconfig(?:\.[^/]+)?\.json|\.gitignore)$/u;
|
|
54
|
-
const memberOf = (names) => (file) => pipe(names, Array.findFirst((name) => String$1.startsWith(`${name}${SEPARATOR}`)(file)), Option.getOrElse(() => "."));
|
|
55
|
-
const entryOf = ([file, digest]) => `${file}${FIELD_SEPARATOR}${digest}`;
|
|
56
|
-
const digested = Effect.fn("digested")(function* digested(root, file) {
|
|
57
|
-
const files = yield* RepositoryFiles;
|
|
58
|
-
const digest = yield* files.hashFile(files.join(root, file));
|
|
59
|
-
return [file, Option.getOrElse(digest, () => EMPTY)];
|
|
60
|
-
});
|
|
61
|
-
const hashed = (lines) => Effect.gen(function* hashLines() {
|
|
62
|
-
return yield* (yield* RepositoryFiles).hash(Array.join(lines, LINE_SEPARATOR));
|
|
63
|
-
});
|
|
64
|
-
const ownedBy = (listing, name) => Option.getOrElse(Record.get(listing.owned, name), () => []);
|
|
65
|
-
const entriesIn = (listing, name) => pipe(ownedBy(listing, name), Array.map(entryOf));
|
|
66
|
-
const sourcesIn = (listing, name) => pipe(ownedBy(listing, name), Array.filter(([file]) => SOURCE_FILE.test(file))).length;
|
|
67
|
-
const closureOf = Effect.fn("closureOf")(function* closureOf(root, name) {
|
|
68
|
-
const files = yield* RepositoryFiles;
|
|
69
|
-
const directories = yield* workspaceClosure(files.join(root, name));
|
|
70
|
-
const names = pipe(directories, Array.map((directory) => files.relative(root, directory)), Array.filter(String$1.isNonEmpty));
|
|
71
|
-
return Array.sort(names, Order.String);
|
|
72
|
-
});
|
|
73
|
-
const memberIn = (listing) => (name) => Effect.gen(function* readMember() {
|
|
74
|
-
const files = yield* RepositoryFiles;
|
|
75
|
-
return {
|
|
76
|
-
name,
|
|
77
|
-
sources: sourcesIn(listing, name),
|
|
78
|
-
digest: yield* hashed(entriesIn(listing, name)),
|
|
79
|
-
installed: yield* installedPackages(listing.root, files.join(listing.root, name)),
|
|
80
|
-
closure: yield* closureOf(listing.root, name)
|
|
81
|
-
};
|
|
82
|
-
});
|
|
83
|
-
const reached = (members) => (closure) => pipe(members, Array.filter(({ name }) => Array.contains(closure, name)));
|
|
84
|
-
const linesOf = (found) => {
|
|
85
|
-
const installed = pipe(found, Array.flatMap((member) => member.installed), Array.dedupe);
|
|
86
|
-
const digests = pipe(found, Array.map(({ name, digest }) => entryOf([name, digest])));
|
|
87
|
-
return [...Array.sort(installed, Order.String), ...digests];
|
|
88
|
-
};
|
|
89
|
-
const sharedKey = Effect.fn("sharedKey")(function* sharedKey(listing, members) {
|
|
90
|
-
const installed = yield* installedPackages(listing.root, listing.root);
|
|
91
|
-
const closure = yield* closureOf(listing.root, EMPTY);
|
|
92
|
-
const config = pipe(ownedBy(listing, "."), Array.filter(([file]) => SHARED_CONFIG.test(file)), Array.map(entryOf));
|
|
93
|
-
return yield* hashed([
|
|
94
|
-
...installed,
|
|
95
|
-
...config,
|
|
96
|
-
...linesOf(reached(members)(closure))
|
|
97
|
-
]);
|
|
98
|
-
});
|
|
99
|
-
const rootPaths = (listing) => pipe(ownedBy(listing, "."), Array.map(([file]) => file), Array.map((file) => {
|
|
100
|
-
const [top] = String$1.split(file, SEPARATOR);
|
|
101
|
-
if (pipe(listing.names, Array.some((name) => String$1.startsWith(`${top}${SEPARATOR}`)(name)))) return file;
|
|
102
|
-
return top;
|
|
103
|
-
}), Array.dedupe);
|
|
104
|
-
const rootUnit = Effect.fn("rootUnit")(function* rootUnit(listing, shared) {
|
|
105
|
-
const key = yield* hashed([
|
|
106
|
-
shared,
|
|
107
|
-
".",
|
|
108
|
-
...entriesIn(listing, ".")
|
|
109
|
-
]);
|
|
110
|
-
return {
|
|
111
|
-
name: ".",
|
|
112
|
-
paths: rootPaths(listing),
|
|
113
|
-
key,
|
|
114
|
-
sources: sourcesIn(listing, ".")
|
|
115
|
-
};
|
|
116
|
-
});
|
|
117
|
-
const memberUnit = (shared, members) => (member) => hashed([
|
|
118
|
-
shared,
|
|
119
|
-
member.name,
|
|
120
|
-
...linesOf(reached(members)(member.closure))
|
|
121
|
-
]).pipe(Effect.map((key) => ({
|
|
122
|
-
name: member.name,
|
|
123
|
-
paths: [member.name],
|
|
124
|
-
key,
|
|
125
|
-
sources: member.sources
|
|
126
|
-
})));
|
|
127
|
-
const unitsOf = Effect.fn("unitsOf")(function* unitsOf(root) {
|
|
128
|
-
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
129
|
-
const names = yield* workspaceDirectories(root);
|
|
130
|
-
const entries = yield* Effect.forEach(listed, (file) => digested(root, file), { concurrency: READ_CONCURRENCY });
|
|
131
|
-
const listing = {
|
|
132
|
-
root,
|
|
133
|
-
names,
|
|
134
|
-
owned: Array.groupBy(entries, ([file]) => memberOf(names)(file))
|
|
135
|
-
};
|
|
136
|
-
const members = yield* Effect.forEach(names, memberIn(listing), { concurrency: READ_CONCURRENCY });
|
|
137
|
-
const shared = yield* sharedKey(listing, members);
|
|
138
|
-
const units = yield* Effect.forEach(members, memberUnit(shared, members), { concurrency: 1 });
|
|
139
|
-
return [yield* rootUnit(listing, shared), ...units];
|
|
140
|
-
});
|
|
141
|
-
// src/features/run-changed/model/run.ts
|
|
142
|
-
const SUCCESS$1 = 0;
|
|
143
|
-
const LIST_SEPARATOR = ", ";
|
|
144
|
-
const ARGUMENT_SEPARATOR = " ";
|
|
145
|
-
const EVERYTHING = "everything";
|
|
146
|
-
const SINGLE_BATCH = 1;
|
|
147
|
-
const report = Effect.fn("report")(function* report(text) {
|
|
148
|
-
const stdio = yield* Stdio.Stdio;
|
|
149
|
-
yield* Stream.make(`msch-changed: ${text}\n`).pipe(Stream.run(stdio.stderr()), Effect.orDie);
|
|
150
|
-
});
|
|
151
|
-
const pathsOf = (units, changed) => {
|
|
152
|
-
if (changed.length === units.length) return [];
|
|
153
|
-
return pipe(changed, Array.flatMap(({ paths }) => paths));
|
|
154
|
-
};
|
|
155
|
-
const namesOf = (units, changed) => {
|
|
156
|
-
if (changed.length === units.length) return EVERYTHING;
|
|
157
|
-
return pipe(changed, Array.map(({ name }) => name), Array.join(LIST_SEPARATOR));
|
|
158
|
-
};
|
|
159
|
-
const exitCodeOf = Effect.fn("exitCodeOf")(function* exitCodeOf(root, [command, ...args]) {
|
|
160
|
-
const code = yield* (yield* ChildProcessSpawner.ChildProcessSpawner).exitCode(ChildProcess.make(command, args, {
|
|
161
|
-
cwd: root,
|
|
162
|
-
extendEnv: true,
|
|
163
|
-
stdin: "ignore",
|
|
164
|
-
stdout: "inherit",
|
|
165
|
-
stderr: "inherit"
|
|
166
|
-
}));
|
|
167
|
-
return Number(code);
|
|
168
|
-
});
|
|
169
|
-
const keyOf = ({ key }) => key;
|
|
170
|
-
const keysAfter = (plan, records, batch) => {
|
|
171
|
-
const current = pipe(plan.units, Array.map(keyOf));
|
|
172
|
-
const kept = pipe(records.passed, Array.filter((key) => Array.contains(current, key)));
|
|
173
|
-
return Array.dedupe([...kept, ...pipe(batch, Array.map(keyOf))]);
|
|
174
|
-
};
|
|
175
|
-
const ranBatch = Effect.fn("ranBatch")(function* ranBatch(plan, batch) {
|
|
176
|
-
const code = yield* exitCodeOf(plan.root, [...plan.command, ...pathsOf(plan.units, batch)]);
|
|
177
|
-
const records = yield* recordsOf(plan.root, plan.command);
|
|
178
|
-
const keys = keysAfter(plan, records, batch);
|
|
179
|
-
yield* Effect.when(keepOnly(records, keys), Effect.succeed(code === SUCCESS$1));
|
|
180
|
-
return code;
|
|
181
|
-
});
|
|
182
|
-
const ran = Effect.fn("ran")(function* ran(plan, batchSources) {
|
|
183
|
-
const batches = batchesOf(plan.changed, batchSources);
|
|
184
|
-
yield* Effect.when(report(`${String(batches.length)} batches of at most ${String(batchSources)} source files`), Effect.succeed(batches.length > SINGLE_BATCH));
|
|
185
|
-
const codes = yield* Effect.forEach(batches, (batch) => ranBatch(plan, batch), { concurrency: 1 });
|
|
186
|
-
return pipe(codes, Array.findFirst((code) => code !== SUCCESS$1), Option.getOrElse(() => SUCCESS$1));
|
|
187
|
-
});
|
|
188
|
-
/** @internal */
|
|
189
|
-
const runChanged = Effect.fn("runChanged")(function* runChanged(root, { command, batchSources }) {
|
|
190
|
-
const units = yield* unitsOf(root);
|
|
191
|
-
const records = yield* recordsOf(root, command);
|
|
192
|
-
const changed = pipe(units, Array.filter(({ key }) => !Array.contains(records.passed, key)));
|
|
193
|
-
const since = `since \`${Array.join(command, ARGUMENT_SEPARATOR)}\` last passed`;
|
|
194
|
-
if (!Array.isReadonlyArrayNonEmpty(changed)) {
|
|
195
|
-
yield* report(`nothing changed ${since}`);
|
|
196
|
-
return SUCCESS$1;
|
|
197
|
-
}
|
|
198
|
-
yield* report(`${String(changed.length)} of ${String(units.length)} changed ${since}: ${namesOf(units, changed)}`);
|
|
199
|
-
return yield* ran({
|
|
200
|
-
root,
|
|
201
|
-
command,
|
|
202
|
-
units,
|
|
203
|
-
changed
|
|
204
|
-
}, batchSources);
|
|
205
|
-
});
|
|
206
|
-
// src/features/run-changed/model/invocation.ts
|
|
207
|
-
const FLAG = "--batch-sources";
|
|
208
|
-
const NO_LIMIT = Number.POSITIVE_INFINITY;
|
|
209
|
-
const SMALLEST_LIMIT = 1;
|
|
210
|
-
/** @internal */
|
|
211
|
-
const invocationOf = (args) => {
|
|
212
|
-
const [first, limit, ...command] = args;
|
|
213
|
-
if (first !== FLAG) return Option.some({
|
|
214
|
-
batchSources: NO_LIMIT,
|
|
215
|
-
command: args
|
|
216
|
-
});
|
|
217
|
-
const batchSources = Number(limit);
|
|
218
|
-
if (!Number.isInteger(batchSources) || batchSources < SMALLEST_LIMIT) return Option.none();
|
|
219
|
-
return Option.liftPredicate(Array.isReadonlyArrayNonEmpty)(command).pipe(Option.map((rest) => ({
|
|
220
|
-
batchSources,
|
|
221
|
-
command: rest
|
|
222
|
-
})));
|
|
223
|
-
};
|
|
224
|
-
// bin/msch-changed.ts
|
|
225
|
-
const SUCCESS = 0;
|
|
226
|
-
const ONE_FAILURE = 1;
|
|
227
|
-
const USAGE = "usage: msch-changed [--batch-sources <count>] <command> [arguments]. Runs the command with the paths of the workspaces whose inputs changed since it last passed, in batches of at most <count> source files.";
|
|
228
|
-
const taggedError = Schema.TaggedError;
|
|
229
|
-
var UsageError = class extends taggedError()("UsageError", { message: Schema.String }) {};
|
|
230
|
-
const invocation = Effect.gen(function* invocation() {
|
|
231
|
-
const args = yield* (yield* Stdio.Stdio).args;
|
|
232
|
-
const parsed = Option.liftPredicate(Array.isReadonlyArrayNonEmpty)(args).pipe(Option.flatMap(invocationOf));
|
|
233
|
-
if (Option.isNone(parsed)) return yield* UsageError.make({ message: USAGE });
|
|
234
|
-
return parsed.value;
|
|
235
|
-
});
|
|
236
|
-
const changed = Effect.gen(function* changed() {
|
|
237
|
-
const files = yield* RepositoryFiles;
|
|
238
|
-
const parsed = yield* invocation;
|
|
239
|
-
if ((yield* runChanged(files.resolve("."), parsed)) !== SUCCESS) return yield* ProblemsFound.make({ count: ONE_FAILURE });
|
|
240
|
-
return yield* Effect.void;
|
|
241
|
-
});
|
|
242
|
-
runCli("msch-changed")(changed);
|
|
243
|
-
export {};
|
|
244
|
-
|
|
245
|
-
//# sourceMappingURL=changed.mjs.map
|
package/dist/changed.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"changed.mjs","names":["Arr","ARGUMENT_SEPARATOR","Arr","Arr","Str","Rec","SUCCESS","Arr","Arr","Arr"],"sources":["../src/features/run-changed/model/batches.ts","../src/features/run-changed/model/records.ts","../src/features/run-changed/model/units.ts","../src/features/run-changed/model/run.ts","../src/features/run-changed/model/invocation.ts","../bin/msch-changed.ts"],"sourcesContent":["import { Array as Arr, Option, Order, pipe } from \"effect\";\nimport { dual } from \"effect/Function\";\n\nimport type { Unit } from \"./units.ts\";\n\ninterface Batch {\n readonly units: readonly Unit[];\n readonly sources: number;\n}\n\nconst ARITY = 2;\nconst NO_BATCHES: readonly Batch[] = [];\nconst EMPTY_BATCH: Batch = { units: [], sources: 0 };\n\nconst bySourcesDescending = Order.mapInput(Order.flip(Order.Number), (unit: Unit) => unit.sources);\nconst byName = Order.mapInput(Order.String, (unit: Unit) => unit.name);\n\nconst added = (batch: Batch, unit: Unit): Batch => ({\n units: [...batch.units, unit],\n sources: batch.sources + unit.sources,\n});\n\nconst joined = (batches: readonly Batch[], unit: Unit, index: number): readonly Batch[] =>\n pipe(\n Arr.modify(batches, index, (batch) => added(batch, unit)),\n Option.getOrElse(() => batches),\n );\n\nconst placed = (batches: readonly Batch[], unit: Unit, limit: number): readonly Batch[] =>\n pipe(\n batches,\n Arr.findFirstIndex((batch) => batch.sources + unit.sources <= limit),\n Option.match({\n onNone: () => [...batches, added(EMPTY_BATCH, unit)],\n onSome: (index) => joined(batches, unit, index),\n }),\n );\n\nconst filled = (\n batches: readonly Batch[],\n units: readonly Unit[],\n limit: number,\n): readonly Batch[] =>\n Arr.matchLeft(units, {\n onEmpty: () => batches,\n onNonEmpty: (unit, rest) => filled(placed(batches, unit, limit), rest, limit),\n });\n\nconst batched = (units: readonly Unit[], limit: number): readonly (readonly Unit[])[] => {\n const ordered = pipe(units, Arr.sortBy(bySourcesDescending, byName));\n return pipe(\n filled(NO_BATCHES, ordered, limit),\n Arr.map((batch) => batch.units),\n );\n};\n\n/** @internal */\nexport const batchesOf: {\n (limit: number): (units: readonly Unit[]) => readonly (readonly Unit[])[];\n (units: readonly Unit[], limit: number): readonly (readonly Unit[])[];\n} = dual(ARITY, batched);\n","import { Array as Arr, Effect } from \"effect\";\n\nimport { recordsIn } from \"#/shared/lib/pass-records.ts\";\nimport { MSCH_CACHE, RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst RECORDS = [...MSCH_CACHE, \"changed\"] as const;\nconst ARGUMENT_SEPARATOR = \"\\0\";\n\nexport const recordsOf = Effect.fn(\"recordsOf\")(function* recordsOf(\n root: string,\n command: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const name = yield* files.hash(Arr.join(command, ARGUMENT_SEPARATOR));\n return yield* recordsIn(files.join(root, ...RECORDS, name));\n});\n","import { Array as Arr, Effect, Option, Order, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { installedPackages, workspaceClosure } from \"#/entities/project/index.ts\";\nimport { workspaceDirectories } from \"#/entities/workspace/index.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst SEPARATOR = \"/\";\nconst FIELD_SEPARATOR = \"\\0\";\nconst LINE_SEPARATOR = \"\\n\";\nconst EMPTY = \"\";\nconst READ_CONCURRENCY = 16;\nconst SOURCE_FILE = /\\.[cm]?[jt]sx?$/u;\nconst SHARED_CONFIG = /^(?:[^/]+\\.config\\.[cm]?[jt]s|tsconfig(?:\\.[^/]+)?\\.json|\\.gitignore)$/u;\n\nexport const ROOT_UNIT = \".\";\n\nexport interface Unit {\n readonly name: string;\n readonly paths: readonly string[];\n readonly key: string;\n readonly sources: number;\n}\n\ninterface Member {\n readonly name: string;\n readonly sources: number;\n readonly digest: string;\n readonly installed: readonly string[];\n readonly closure: readonly string[];\n}\n\ntype Entry = readonly [file: string, digest: string];\n\ninterface Listing {\n readonly root: string;\n readonly names: readonly string[];\n readonly owned: Readonly<Record<string, readonly Entry[]>>;\n}\n\nconst memberOf =\n (names: readonly string[]) =>\n (file: string): string =>\n pipe(\n names,\n Arr.findFirst((name) => Str.startsWith(`${name}${SEPARATOR}`)(file)),\n Option.getOrElse(() => ROOT_UNIT),\n );\n\nconst entryOf = ([file, digest]: Entry): string => `${file}${FIELD_SEPARATOR}${digest}`;\n\nconst digested = Effect.fn(\"digested\")(function* digested(root: string, file: string) {\n const files = yield* RepositoryFiles;\n const digest = yield* files.hashFile(files.join(root, file));\n return [file, Option.getOrElse(digest, () => EMPTY)] as const;\n});\n\nconst hashed = (lines: readonly string[]): Effect.Effect<string, never, RepositoryFiles> =>\n Effect.gen(function* hashLines() {\n const files = yield* RepositoryFiles;\n return yield* files.hash(Arr.join(lines, LINE_SEPARATOR));\n });\n\nconst ownedBy = (listing: Listing, name: string): readonly Entry[] =>\n Option.getOrElse(Rec.get(listing.owned, name), (): readonly Entry[] => []);\n\nconst entriesIn = (listing: Listing, name: string): readonly string[] =>\n pipe(ownedBy(listing, name), Arr.map(entryOf));\n\nconst sourcesIn = (listing: Listing, name: string): number =>\n pipe(\n ownedBy(listing, name),\n Arr.filter(([file]) => SOURCE_FILE.test(file)),\n ).length;\n\nconst closureOf = Effect.fn(\"closureOf\")(function* closureOf(root: string, name: string) {\n const files = yield* RepositoryFiles;\n const directories = yield* workspaceClosure(files.join(root, name));\n const names = pipe(\n directories,\n Arr.map((directory) => files.relative(root, directory)),\n Arr.filter(Str.isNonEmpty),\n );\n return Arr.sort(names, Order.String);\n});\n\nconst memberIn =\n (listing: Listing) =>\n (name: string): Effect.Effect<Member, never, RepositoryFiles> =>\n Effect.gen(function* readMember() {\n const files = yield* RepositoryFiles;\n return {\n name,\n sources: sourcesIn(listing, name),\n digest: yield* hashed(entriesIn(listing, name)),\n installed: yield* installedPackages(listing.root, files.join(listing.root, name)),\n closure: yield* closureOf(listing.root, name),\n };\n });\n\nconst reached =\n (members: readonly Member[]) =>\n (closure: readonly string[]): readonly Member[] =>\n pipe(\n members,\n Arr.filter(({ name }) => Arr.contains(closure, name)),\n );\n\nconst linesOf = (found: readonly Member[]): readonly string[] => {\n const installed = pipe(\n found,\n Arr.flatMap((member) => member.installed),\n Arr.dedupe,\n );\n const digests = pipe(\n found,\n Arr.map(({ name, digest }) => entryOf([name, digest])),\n );\n return [...Arr.sort(installed, Order.String), ...digests];\n};\n\nconst sharedKey = Effect.fn(\"sharedKey\")(function* sharedKey(\n listing: Listing,\n members: readonly Member[],\n) {\n const installed = yield* installedPackages(listing.root, listing.root);\n const closure = yield* closureOf(listing.root, EMPTY);\n const config = pipe(\n ownedBy(listing, ROOT_UNIT),\n Arr.filter(([file]) => SHARED_CONFIG.test(file)),\n Arr.map(entryOf),\n );\n return yield* hashed([...installed, ...config, ...linesOf(reached(members)(closure))]);\n});\n\nconst rootPaths = (listing: Listing): readonly string[] =>\n pipe(\n ownedBy(listing, ROOT_UNIT),\n Arr.map(([file]) => file),\n Arr.map((file) => {\n const [top] = Str.split(file, SEPARATOR);\n const holdsMembers = pipe(\n listing.names,\n Arr.some((name) => Str.startsWith(`${top}${SEPARATOR}`)(name)),\n );\n if (holdsMembers) {\n return file;\n }\n return top;\n }),\n Arr.dedupe,\n );\n\nconst rootUnit = Effect.fn(\"rootUnit\")(function* rootUnit(listing: Listing, shared: string) {\n const key = yield* hashed([shared, ROOT_UNIT, ...entriesIn(listing, ROOT_UNIT)]);\n return {\n name: ROOT_UNIT,\n paths: rootPaths(listing),\n key,\n sources: sourcesIn(listing, ROOT_UNIT),\n } satisfies Unit;\n});\n\nconst memberUnit =\n (shared: string, members: readonly Member[]) =>\n (member: Member): Effect.Effect<Unit, never, RepositoryFiles> =>\n hashed([shared, member.name, ...linesOf(reached(members)(member.closure))]).pipe(\n Effect.map((key) => ({\n name: member.name,\n paths: [member.name],\n key,\n sources: member.sources,\n })),\n );\n\nexport const unitsOf = Effect.fn(\"unitsOf\")(function* unitsOf(root: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.listedFiles(root);\n const names = yield* workspaceDirectories(root);\n const entries = yield* Effect.forEach(listed, (file) => digested(root, file), {\n concurrency: READ_CONCURRENCY,\n });\n const owned = Arr.groupBy(entries, ([file]) => memberOf(names)(file));\n const listing: Listing = { root, names, owned };\n const members = yield* Effect.forEach(names, memberIn(listing), {\n concurrency: READ_CONCURRENCY,\n });\n const shared = yield* sharedKey(listing, members);\n const units = yield* Effect.forEach(members, memberUnit(shared, members), { concurrency: 1 });\n return [yield* rootUnit(listing, shared), ...units];\n});\n","import { Array as Arr, Effect, Option, Stdio, Stream, pipe } from \"effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nimport { keepOnly } from \"#/shared/lib/pass-records.ts\";\nimport type { Records } from \"#/shared/lib/pass-records.ts\";\n\nimport { batchesOf } from \"./batches.ts\";\nimport type { Invocation } from \"./invocation.ts\";\nimport { recordsOf } from \"./records.ts\";\nimport { unitsOf } from \"./units.ts\";\nimport type { Unit } from \"./units.ts\";\n\nconst SUCCESS = 0;\nconst LIST_SEPARATOR = \", \";\nconst ARGUMENT_SEPARATOR = \" \";\nconst EVERYTHING = \"everything\";\nconst SINGLE_BATCH = 1;\n\nconst report = Effect.fn(\"report\")(function* report(text: string) {\n const stdio = yield* Stdio.Stdio;\n yield* Stream.make(`msch-changed: ${text}\\n`).pipe(Stream.run(stdio.stderr()), Effect.orDie);\n});\n\nconst pathsOf = (units: readonly Unit[], changed: readonly Unit[]): readonly string[] => {\n if (changed.length === units.length) {\n return [];\n }\n return pipe(\n changed,\n Arr.flatMap(({ paths }) => paths),\n );\n};\n\nconst namesOf = (units: readonly Unit[], changed: readonly Unit[]): string => {\n if (changed.length === units.length) {\n return EVERYTHING;\n }\n return pipe(\n changed,\n Arr.map(({ name }) => name),\n Arr.join(LIST_SEPARATOR),\n );\n};\n\nconst exitCodeOf = Effect.fn(\"exitCodeOf\")(function* exitCodeOf(\n root: string,\n [command, ...args]: readonly [string, ...string[]],\n) {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const code = yield* spawner.exitCode(\n ChildProcess.make(command, args, {\n cwd: root,\n extendEnv: true,\n stdin: \"ignore\",\n stdout: \"inherit\",\n stderr: \"inherit\",\n }),\n );\n return Number(code);\n});\n\ninterface Plan {\n readonly root: string;\n readonly command: readonly [string, ...string[]];\n readonly units: readonly Unit[];\n readonly changed: readonly Unit[];\n}\n\nconst keyOf = ({ key }: Unit): string => key;\n\nconst keysAfter = (plan: Plan, records: Records, batch: readonly Unit[]): readonly string[] => {\n const current = pipe(plan.units, Arr.map(keyOf));\n const kept = pipe(\n records.passed,\n Arr.filter((key) => Arr.contains(current, key)),\n );\n return Arr.dedupe([...kept, ...pipe(batch, Arr.map(keyOf))]);\n};\n\nconst ranBatch = Effect.fn(\"ranBatch\")(function* ranBatch(plan: Plan, batch: readonly Unit[]) {\n const code = yield* exitCodeOf(plan.root, [...plan.command, ...pathsOf(plan.units, batch)]);\n const records = yield* recordsOf(plan.root, plan.command);\n const keys = keysAfter(plan, records, batch);\n yield* Effect.when(keepOnly(records, keys), Effect.succeed(code === SUCCESS));\n return code;\n});\n\nconst ran = Effect.fn(\"ran\")(function* ran(plan: Plan, batchSources: number) {\n const batches = batchesOf(plan.changed, batchSources);\n yield* Effect.when(\n report(`${String(batches.length)} batches of at most ${String(batchSources)} source files`),\n Effect.succeed(batches.length > SINGLE_BATCH),\n );\n const codes = yield* Effect.forEach(batches, (batch) => ranBatch(plan, batch), {\n concurrency: 1,\n });\n return pipe(\n codes,\n Arr.findFirst((code) => code !== SUCCESS),\n Option.getOrElse(() => SUCCESS),\n );\n});\n\n/** @internal */\nexport const runChanged = Effect.fn(\"runChanged\")(function* runChanged(\n root: string,\n { command, batchSources }: Invocation,\n) {\n const units = yield* unitsOf(root);\n const records = yield* recordsOf(root, command);\n const changed = pipe(\n units,\n Arr.filter(({ key }) => !Arr.contains(records.passed, key)),\n );\n const since = `since \\`${Arr.join(command, ARGUMENT_SEPARATOR)}\\` last passed`;\n if (!Arr.isReadonlyArrayNonEmpty(changed)) {\n yield* report(`nothing changed ${since}`);\n return SUCCESS;\n }\n yield* report(\n `${String(changed.length)} of ${String(units.length)} changed ${since}: ${namesOf(units, changed)}`,\n );\n return yield* ran({ root, command, units, changed }, batchSources);\n});\n","import { Array as Arr, Option } from \"effect\";\n\nconst FLAG = \"--batch-sources\";\nconst NO_LIMIT = Number.POSITIVE_INFINITY;\nconst SMALLEST_LIMIT = 1;\n\nexport interface Invocation {\n readonly batchSources: number;\n readonly command: readonly [string, ...string[]];\n}\n\n/** @internal */\nexport const invocationOf = (args: readonly [string, ...string[]]): Option.Option<Invocation> => {\n const [first, limit, ...command] = args;\n if (first !== FLAG) {\n return Option.some({ batchSources: NO_LIMIT, command: args });\n }\n const batchSources = Number(limit);\n if (!Number.isInteger(batchSources) || batchSources < SMALLEST_LIMIT) {\n return Option.none();\n }\n return Option.liftPredicate(Arr.isReadonlyArrayNonEmpty)(command).pipe(\n Option.map((rest) => ({ batchSources, command: rest })),\n );\n};\n","#!/usr/bin/env node\nimport { Array as Arr, Effect, Option, Schema, Stdio } from \"effect\";\n\nimport { ProblemsFound } from \"#/app/output.ts\";\nimport { runCli } from \"#/app/runtime.ts\";\nimport { invocationOf, runChanged } from \"#/features/run-changed/index.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst SUCCESS = 0;\nconst ONE_FAILURE = 1;\nconst USAGE =\n \"usage: msch-changed [--batch-sources <count>] <command> [arguments]. Runs the command with the paths of the workspaces whose inputs changed since it last passed, in batches of at most <count> source files.\";\n\nconst taggedError = Schema.TaggedError;\n\nclass UsageError extends taggedError<UsageError, { readonly brand: unique symbol }>()(\n \"UsageError\",\n { message: Schema.String },\n) {}\n\nconst invocation = Effect.gen(function* invocation() {\n const stdio = yield* Stdio.Stdio;\n const args = yield* stdio.args;\n const parsed = Option.liftPredicate(Arr.isReadonlyArrayNonEmpty)(args).pipe(\n Option.flatMap(invocationOf),\n );\n if (Option.isNone(parsed)) {\n return yield* UsageError.make({ message: USAGE });\n }\n return parsed.value;\n});\n\nconst changed = Effect.gen(function* changed() {\n const files = yield* RepositoryFiles;\n const parsed = yield* invocation;\n const code = yield* runChanged(files.resolve(\".\"), parsed);\n if (code !== SUCCESS) {\n return yield* ProblemsFound.make({ count: ONE_FAILURE });\n }\n return yield* Effect.void;\n});\n\nrunCli(\"msch-changed\")(changed);\n"],"mappings":";;;;;;;;;;AAUA,MAAM,QAAQ;AACd,MAAM,aAA+B,CAAC;AACtC,MAAM,cAAqB;CAAE,OAAO,CAAC;CAAG,SAAS;AAAE;AAEnD,MAAM,sBAAsB,MAAM,SAAS,MAAM,KAAK,MAAM,MAAM,IAAI,SAAe,KAAK,OAAO;AACjG,MAAM,SAAS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AAA,CACD;CAC1B,MAAM,SAAS,OAAO,cAAcC,MAAI,uBAAuB,CAAC,CAAC,IAAI,CAAC,CAAC,KACrE,OAAO,QAAQ,YAAY,CAC7B;CACA,IAAI,OAAO,OAAO,MAAM,GACtB,OAAO,OAAO,WAAW,KAAK,EAAE,SAAS,MAAM,CAAC;CAElD,OAAO,OAAO;AAChB,CAAC;AAED,MAAM,UAAU,OAAO,IAAI,UAAU,UAAU;CAC7C,MAAM,QAAQ,OAAO;CACrB,MAAM,SAAS,OAAO;CAEtB,KAAI,OADgB,WAAW,MAAM,QAAQ,GAAG,GAAG,MAAM,OAC5C,SACX,OAAO,OAAO,cAAc,KAAK,EAAE,OAAO,YAAY,CAAC;CAEzD,OAAO,OAAO,OAAO;AACvB,CAAC;AAED,OAAO,cAAc,CAAC,CAAC,OAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-contract-D7btWrEu.mjs","names":[],"sources":["../src/shared/lib/cli-contract.ts"],"sourcesContent":["export const JSON_FLAG = \"--json\";\n"],"mappings":";AAAA,MAAa,YAAY"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"define-lint-preset-YcRo_ZW9.mjs","names":["Rec","Arr","Str","effectPresets","decisionPlugin","shadcn","Str","Arr","Rec"],"sources":["../src/shared/config/exempt.ts","../src/features/define-lint-preset/config/lint-overrides.config.ts","../src/features/define-lint-preset/config/decision-rules.ts","../src/features/define-lint-preset/config/web-guidance.config.ts","../src/features/define-lint-preset/config/lint.config.ts","../src/features/define-lint-preset/config/test-rules.config.ts","../src/features/define-lint-preset/config/preset.ts","../src/features/define-lint-preset/config/required-stack.config.ts","../src/features/define-lint-preset/config/traced-rules.config.ts","../src/features/define-lint-preset/config/remotion-rules.config.ts","../src/features/define-lint-preset/config/video-rules.config.ts","../src/features/define-lint-preset/config/structure.config.ts","../src/features/define-lint-preset/config/kuromojin.config.ts","../src/features/define-lint-preset/config/textlint-presets.config.ts","../src/features/define-lint-preset/config/textlint-filters.config.ts","../src/features/define-lint-preset/config/markdown.config.ts"],"sourcesContent":["export const generated = [\n \"**/routeTree.gen.ts\",\n \"**/generated/**\",\n \"**/drizzle/**/snapshot.json\",\n \".claude/skills/**\",\n \".intent/**\",\n \"AGENTS.md\",\n \"CLAUDE.md\",\n \"**/CHANGELOG.md\",\n \".github/release-please/*manifest.json\",\n \"**/.release-please-manifest.json\",\n \"**/*.d.*.ts\",\n \"**/src-tauri/gen/**\",\n];\n\nconst checkerInputs = [\"**/fixtures/**\"];\n\nconst vendored = [\"**/upstream/**\"];\n\nexport const exempt = [...generated, ...checkerInputs, ...vendored];\n","const LOGPUSH = 'Property[key.name=\"logpush\"]:not([value.value=false])';\nconst LOGPUSH_MESSAGE =\n \"Worker には logpush: true を付ける。付けないと、その Worker のログが Logpush に流れない\";\n\nconst CPU_LIMIT = 'Property[key.name=\"limits\"]:has(Property[key.name=\"cpuMs\"])';\nconst CPU_LIMIT_MESSAGE =\n \"コードを動かす Worker には limits.cpuMs を付け、本番の CPU 時間の最大値をわずかに上回る値にする。付けないと、1 回の暴走が上限の CPU 時間まで請求される\";\n\nconst UNATTRIBUTED_MODEL_CALL =\n \"モデルの呼び出しは AI Gateway を通し、呼び出し元を metadata に載せる。載せないと、費用やエラーを後から呼び出し元で引けない\";\n\nconst UNGATED_MODEL_CALL =\n \"モデルの呼び出しは AI Gateway を通す。通らない呼び出しには日ごとの費用の上限が掛からず、無料枠を超えた分がそのまま請求される\";\n\nconst MODEL_RUN =\n 'CallExpression[callee.property.name=\"run\"]:matches([callee.object.name=\"AI\"], [callee.object.property.name=\"AI\"])';\n\nconst AI_RUN_URL =\n \":matches(Literal[value=/ai.run/], TemplateLiteral:has(TemplateElement[value.raw=/ai.run/]))\";\n\nconst AI_RUN_REQUEST = `CallExpression:has(> ${AI_RUN_URL})`;\n\nexport const cloudflareResourceSyntax: readonly Readonly<{ selector: string; message: string }>[] =\n [\n {\n selector: `CallExpression[callee.object.name=\"Workers\"][callee.property.name=\"Worker\"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,\n message: LOGPUSH_MESSAGE,\n },\n {\n selector: `CallExpression[callee.object.name=\"Website\"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,\n message: LOGPUSH_MESSAGE,\n },\n {\n selector: `CallExpression[callee.object.name=/^(Workers|Website)$/] > ObjectExpression.arguments:has(Property[key.name=\"main\"]):not(:has(${CPU_LIMIT}))`,\n message: CPU_LIMIT_MESSAGE,\n },\n {\n selector: `CallExpression[callee.object.name=\"Website\"]:not([callee.property.name=\"StaticSite\"]) > ObjectExpression.arguments:not(:has(${CPU_LIMIT}))`,\n message: CPU_LIMIT_MESSAGE,\n },\n {\n selector: `${MODEL_RUN}[arguments.length<3]`,\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector: `${MODEL_RUN} > .arguments:nth-child(3):not(Identifier[name=\"options\"])`,\n message: `${UNGATED_MODEL_CALL}。AI.run の第 3 引数には、runWorkersAi の call が受け取る options をそのまま渡す`,\n },\n {\n selector: `${AI_RUN_REQUEST} > ObjectExpression.arguments:not(:has(Property[key.name=\"headers\"]))`,\n message: `${UNGATED_MODEL_CALL}。REST の /ai/run を呼ぶときは、headers に cf-aig-gateway-id を付ける`,\n },\n {\n selector: `${AI_RUN_REQUEST} > ObjectExpression.arguments > Property[key.name=\"headers\"] > ObjectExpression:not(:has(Property[key.value=\"cf-aig-gateway-id\"]))`,\n message: `${UNGATED_MODEL_CALL}。REST の /ai/run を呼ぶときは、headers に cf-aig-gateway-id を付ける`,\n },\n {\n selector:\n 'CallExpression[callee.name=\"runWorkersAi\"] > ObjectExpression > Property[key.name=\"call\"] > ArrowFunctionExpression[params.length=0]',\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector:\n 'CallExpression[callee.name=\"createAI\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"metadata\"]))',\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector:\n 'ObjectExpression:has(Property[key.value=\"cf-aig-gateway-id\"]):not(:has(Property[key.value=\"cf-aig-metadata\"]))',\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector:\n 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"collectLogs\"][value.value=true]))',\n message:\n \"AI Gateway には collectLogs: true を付ける。付けないと、モデルの呼び出しが後から引けない\",\n },\n {\n selector:\n 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"spendLimits\"] > ObjectExpression > Property[key.name=\"enabled\"][value.value=true]))',\n message:\n \"AI Gateway には spendLimits を enabled: true で付け、日ごとの費用の上限を掛ける。付けないと、従量課金のモデルの呼び出しが上限なく請求される\",\n },\n {\n selector:\n 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"cacheTtl\"]))',\n message:\n \"AI Gateway には cacheTtl を付け、同じ問いの答えをキャッシュする。付けないと、同じ問いにも毎回課金される\",\n },\n ];\nexport const removalPolicySyntax: Readonly<{ selector: string; message: string }> = {\n selector:\n 'CallExpression[callee.object.name=/^(D1|R2)$/][callee.property.name=/^(Database|Bucket)$/]:not(CallExpression[callee.property.name=\"pipe\"][arguments.0.callee.object.name=\"RemovalPolicy\"] > MemberExpression.callee > CallExpression.object)',\n message:\n \"D1 と R2 は作り直すと中身が消えるので、alchemy の RemovalPolicy.protect() を .pipe で付けて置き換えと削除を止める\",\n};\n\nexport const removalPolicyOverride: {\n files: string[];\n excludeFiles: string[];\n rules: Readonly<Record<string, [\"error\", ...unknown[]]>>;\n} = {\n files: [\"**/*.ts\"],\n excludeFiles: [\"**/*.test.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\"error\", ...cloudflareResourceSyntax, removalPolicySyntax],\n },\n};\n\nexport const alchemyOverride: {\n files: string[];\n rules: Readonly<Record<string, [\"error\", ...unknown[]]>>;\n} = {\n files: [\"**/alchemy.run.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\n \"error\",\n ...cloudflareResourceSyntax,\n removalPolicySyntax,\n {\n selector: 'CallExpression[callee.name=\"Stack\"]:not([arguments.0.name=\"APP_NAME\"])',\n message: \"スタック名には app-name.ts の APP_NAME を渡す\",\n },\n {\n selector:\n 'Program:not(:has(YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n message:\n \"スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する\",\n },\n {\n selector:\n 'CallExpression[callee.name=\"Stack\"] > .arguments:nth-child(3):not(:has(FunctionExpression > BlockStatement > ExpressionStatement:nth-last-child(2) > YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n message:\n \"スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する\",\n },\n ],\n },\n};\n\nexport const commandsOverride: {\n files: string[];\n rules: Readonly<Record<string, \"off\">>;\n} = {\n files: [\"bin/**\"],\n rules: {\n \"node/no-process-env\": \"off\",\n \"node/no-sync\": \"off\",\n \"effecttsgo/node-builtin-import\": \"off\",\n },\n};\n","import { createDecisionPlugin, defineDecisionRule } from \"@r_masseater/oxlint-plugin-decision\";\n\nexport default createDecisionPlugin({\n name: \"stack\",\n rules: [\n defineDecisionRule({\n id: \"exclusive-status\",\n target: \"file\",\n question:\n \"Does this code represent one piece of state with several boolean flags or optional fields whose combinations can contradict each other, instead of one exclusive status expressed as a discriminated union? Answer no when every state is a single exclusive status, or when the file holds no such state. A violation needs two or more booleans or optional fields that describe the same piece of state; a single boolean value, parameter, return value or field is not a violation, and a union of objects told apart by a status or kind field is already an exclusive status. A constant configuration object whose shape a library fixes, such as an OpenFeature flag definition, holds no state and is not a violation.\",\n message: \"状態は排他的なstatusを持つ判別共用体で表し、booleanフラグの組を使わない。\",\n cutoff: 0.8,\n }),\n defineDecisionRule({\n id: \"server-state-tanstack-query\",\n target: \"file\",\n question:\n \"Does this code fetch, cache or synchronize server data on the client with something other than TanStack Query, such as fetch inside useEffect, SWR or a hand-written cache? Answer no when server data on the client goes only through TanStack Query, or when the file handles none. Creating an API client such as a better-auth or Eden client, which fetches nothing until a query calls it, is not a violation.\",\n message: \"サーバー状態はTanStack Queryだけで扱う。\",\n cutoff: 0.8,\n }),\n defineDecisionRule({\n id: \"ui-state-effect-atom\",\n target: \"file\",\n question:\n \"Does this code hold client-side UI state with something other than effect-atom, such as useState, useReducer, React context used as a store, zustand, jotai or redux? Answer no when client-side UI state is held only by effect-atom, or when the file holds none. effect-atom is Atom from effect/reactivity, read and written through @effect/atom-react hooks such as useAtomValue and useAtomSet. Creating a TanStack Query QueryClient or configuring the router, which hold no UI state, is not a violation.\",\n message: \"UI状態はeffect-atomだけで扱う。\",\n cutoff: 0.8,\n }),\n ],\n});\n","import type { UserConfig } from \"vite-plus\";\n\ntype LintRules = NonNullable<NonNullable<UserConfig[\"lint\"]>[\"rules\"]>;\n\nexport const webGuidanceRules = {\n \"jsx-a11y/no-redundant-roles\": [\"error\", { ul: [\"list\"], ol: [\"list\"] }],\n \"jsx-a11y/no-noninteractive-tabindex\": [\"error\", { tags: [\"section\"], roles: [\"tabpanel\"] }],\n} satisfies LintRules;\n","import { presets as effectPresets } from \"@effect/tsgo/oxlint-presets\";\nimport htmlReact from \"@html-eslint/eslint-plugin-react\";\nimport eslintReact from \"@r_masseater/oxlint-typed-rules/react\";\nimport { Array as Arr, Record as Rec, String as Str, Struct, pipe } from \"effect\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\n\nimport decisionPlugin from \"./decision-rules.ts\";\n\nconst asErrors = (names: readonly string[]): Readonly<Record<string, \"error\">> =>\n Rec.fromEntries(\n pipe(\n names,\n Arr.map((name) => [name, \"error\"] as const),\n ),\n );\n\nexport const allRulesOf = ({\n prefix,\n rules,\n}: Readonly<{ prefix: string; rules: Readonly<Record<string, unknown>> }>): Readonly<\n Record<string, \"error\">\n> =>\n asErrors(\n pipe(\n Rec.keys(rules),\n Arr.map((rule) => `${prefix}/${rule}`),\n ),\n );\n\nconst reactHooksRuleNames = pipe(\n Struct.keys(reactHooks.configs[\"recommended-latest\"].rules),\n Arr.map(Str.replace(\"react-hooks/\", \"react-hooks-js/\")),\n);\n\nconst reactHooksRules = asErrors(reactHooksRuleNames);\n\nconst eslintReactRuleNames = pipe(\n Rec.keys(eslintReact.configs[\"strict-typescript\"].rules ?? {}),\n Arr.filter(\n (name) => !(Str.replace(\"@eslint-react/\", \"react-hooks-js/\")(name) in reactHooksRules),\n ),\n);\n\nconst effectRuleNames = pipe(\n Rec.values(effectPresets),\n Arr.flatMap((preset) => Struct.keys(preset.rules ?? {})),\n);\n\nexport const pluginRules: Readonly<Record<string, \"error\">> = {\n ...asErrors(Rec.keys(htmlReact.configs.all.rules ?? {})),\n ...reactHooksRules,\n ...asErrors(eslintReactRuleNames),\n ...asErrors(effectRuleNames),\n};\n\nexport const decisionPluginName = decisionPlugin.meta.name;\n\nexport const decisionRules = allRulesOf({\n prefix: decisionPluginName,\n rules: decisionPlugin.rules,\n});\n\nexport const decisionTestRules = pipe(\n decisionRules,\n Rec.map(() => \"off\" as const),\n);\n\nexport const shadcnRestyleContracts = [\n { pattern: \"^Table(Head|Cell)$\", allow: [\"text-alignment\", \"fvn-spacing\"] },\n { pattern: \"^TableCaption$\", allow: [\"caption\", \"text-alignment\", \"mt-*\", \"mb-*\"] },\n];\n\nexport { webGuidanceRules } from \"./web-guidance.config.ts\";\n","import type { UserConfig } from \"vite-plus\";\n\ntype LintRules = NonNullable<NonNullable<UserConfig[\"lint\"]>[\"rules\"]>;\n\nconst NO_TEST_DOUBLES =\n \"依存の振る舞いを差し替えない。Effect の Layer を差し替えるか、本物の実装を使う\";\n\nexport const testRules = {\n \"vitest/expect-expect\": [\n \"error\",\n { assertFunctionNames: [\"expect\", \"expect*\", \"assert*\", \"waitFor*\", \"run\", \"*.run\"] },\n ],\n \"vitest/valid-expect\": [\"error\", { maxArgs: 2 }],\n \"vitest/valid-title\": [\"error\", { allowArguments: true }],\n \"vitest/prefer-called-times\": \"off\",\n \"vitest/prefer-import-in-mock\": \"off\",\n \"vitest/no-standalone-expect\": \"off\",\n \"vitest/no-conditional-in-test\": \"off\",\n \"vitest/require-test-timeout\": \"off\",\n \"vitest/prefer-expect-assertions\": \"off\",\n \"vitest/require-top-level-describe\": \"off\",\n \"vitest/no-importing-vitest-globals\": \"off\",\n \"vitest/require-hook\": \"off\",\n \"vitest/no-hooks\": \"off\",\n \"vitest/consistent-test-it\": \"off\",\n \"vitest/prefer-describe-function-title\": \"off\",\n \"vitest/prefer-lowercase-title\": \"off\",\n \"vitest/prefer-to-be-truthy\": \"off\",\n \"vitest/prefer-to-be-falsy\": \"off\",\n \"vitest/padding-around-after-all-blocks\": \"off\",\n \"vitest/padding-around-test-blocks\": \"off\",\n \"vitest/max-expects\": \"off\",\n} satisfies LintRules;\n\nconst NO_FLAKE_MASKING =\n \"再試行や flakyTest で不安定なテストを隠さない。待つ対象のイベントを await して直す\";\n\nexport const testDoubleSyntax: readonly Readonly<{ selector: string; message: string }>[] = [\n {\n selector: 'CallExpression[callee.object.name=\"vi\"][callee.property.name=/^(mock|doMock)$/]',\n message: NO_TEST_DOUBLES,\n },\n {\n selector: 'CallExpression[callee.object.name=\"vi\"][callee.property.name=\"stubGlobal\"]',\n message: NO_TEST_DOUBLES,\n },\n];\n\nexport const flakeMaskingSyntax: readonly Readonly<{ selector: string; message: string }>[] = [\n { selector: 'Property[key.name=\"retry\"]', message: NO_FLAKE_MASKING },\n { selector: 'MemberExpression[property.name=\"retry\"]', message: NO_FLAKE_MASKING },\n { selector: 'MemberExpression[property.name=\"flakyTest\"]', message: NO_FLAKE_MASKING },\n];\n","import { fileURLToPath } from \"node:url\";\n\nimport tanstackQuery from \"@r_masseater/oxlint-typed-rules/tanstack-query\";\nimport tanstackRouter from \"@r_masseater/oxlint-typed-rules/tanstack-router\";\nimport { plugin as shadcn } from \"@shadcn/lint\";\nimport baselineJs from \"eslint-plugin-baseline-js\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport { DECISION_MODEL, DECISION_TIMEOUT_MS, generated } from \"#/shared/config/index.ts\";\n\nimport {\n alchemyOverride,\n cloudflareResourceSyntax,\n removalPolicyOverride,\n commandsOverride,\n} from \"./lint-overrides.config.ts\";\nimport {\n allRulesOf,\n decisionPluginName,\n pluginRules,\n shadcnRestyleContracts,\n webGuidanceRules,\n} from \"./lint.config.ts\";\nimport { flakeMaskingSyntax, testDoubleSyntax, testRules } from \"./test-rules.config.ts\";\n\ntype LintConfig = NonNullable<UserConfig[\"lint\"]>;\n\nconst resolved = (specifier: string): string => fileURLToPath(import.meta.resolve(specifier));\n\nconst typedRules = \"@r_masseater/oxlint-typed-rules\";\n\nconst jsPlugins = [\n { name: \"vite-plus\", specifier: resolved(\"vite-plus/oxlint-plugin\") },\n { name: \"tanstack-query\", specifier: resolved(`${typedRules}/tanstack-query`) },\n { name: \"tanstack-router\", specifier: resolved(`${typedRules}/tanstack-router`) },\n { name: \"tanstack-start\", specifier: resolved(`${typedRules}/tanstack-start`) },\n { name: \"drizzle\", specifier: resolved(`${typedRules}/drizzle`) },\n { name: \"react-hooks-js\", specifier: resolved(\"eslint-plugin-react-hooks\") },\n { name: \"@eslint-react\", specifier: resolved(`${typedRules}/react`) },\n { name: \"@remotion\", specifier: resolved(`${typedRules}/remotion`) },\n { name: \"shadcn\", specifier: resolved(\"@shadcn/lint\") },\n { name: \"baseline-js\", specifier: resolved(\"eslint-plugin-baseline-js\") },\n { name: \"@html-eslint/react\", specifier: resolved(\"@html-eslint/eslint-plugin-react\") },\n { name: \"eslint-js\", specifier: resolved(\"oxlint-plugin-eslint\") },\n { name: decisionPluginName, specifier: resolved(\"@r_masseater/msch/decision-rules\") },\n { name: \"msch-lint\", specifier: resolved(\"@r_masseater/msch/lint-rules\") },\n];\n\nconst rules = {\n \"vite-plus/prefer-vite-plus-imports\": \"error\",\n \"tanstack-start/no-async-client-component\": \"error\",\n \"tanstack-start/no-client-code-in-server-component\": \"error\",\n ...allRulesOf({ prefix: \"tanstack-query\", rules: tanstackQuery.rules }),\n ...allRulesOf({ prefix: \"tanstack-router\", rules: tanstackRouter.rules }),\n \"drizzle/enforce-delete-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n \"drizzle/enforce-update-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n ...allRulesOf({ prefix: \"shadcn\", rules: shadcn.rules }),\n \"shadcn/no-restyle\": [\"error\", { contracts: shadcnRestyleContracts }],\n ...allRulesOf({ prefix: \"baseline-js\", rules: baselineJs.rules }),\n ...baselineJs.configs.recommended().rules,\n \"baseline-js/use-baseline\": [\n \"error\",\n {\n available: \"widely\",\n ignoreFeatures: [\"top-level-await\"],\n includeWebApis: { preset: \"auto\" },\n includeJsBuiltins: { preset: \"auto\" },\n },\n ],\n ...pluginRules,\n \"eslint/capitalized-comments\": \"off\",\n \"eslint/sort-imports\": \"off\",\n \"eslint/sort-keys\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/exports-last\": \"off\",\n ...testRules,\n ...webGuidanceRules,\n \"msch-lint/array-from-async\": \"error\",\n \"msch-lint/ecosystem-readers\": \"error\",\n \"msch-lint/explicit-import-path\": \"error\",\n \"msch-lint/get-or-insert\": \"error\",\n \"msch-lint/mcp-tool-layer\": \"error\",\n \"msch-lint/main-through-node-main\": \"error\",\n \"msch-lint/inline-exports\": \"error\",\n \"msch-lint/ui-state-in-atoms\": \"error\",\n \"msch-lint/no-hand-written-sql\": \"error\",\n \"msch-lint/platform-node-by-module\": \"error\",\n \"msch-lint/readonly-parameters\": \"error\",\n \"msch-lint/separate-min-max\": \"error\",\n \"msch-lint/typed-calls-not-reflect\": \"error\",\n \"react/react-in-jsx-scope\": \"off\",\n \"eslint/no-undef\": \"off\",\n \"typescript/promise-function-async\": \"off\",\n \"react/forbid-component-props\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n \"node/no-top-level-await\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"eslint/new-cap\": [\"error\", { capIsNew: false }],\n \"eslint/one-var\": [\"error\", \"never\"],\n \"unicorn/relative-url-style\": [\"error\", \"always\"],\n \"eslint/id-length\": [\"error\", { exceptions: [\"x\", \"y\"] }],\n \"jsdoc/check-tag-names\": [\"error\", { definedTags: [\"msch\", \"stability\"] }],\n \"jsdoc/require-param\": [\"error\", { exemptedBy: [\"inheritdoc\", \"internal\", \"msch\", \"stability\"] }],\n \"jsdoc/require-returns\": [\n \"error\",\n { exemptedBy: [\"inheritdoc\", \"internal\", \"msch\", \"stability\"] },\n ],\n \"eslint-js/no-restricted-syntax\": [\"error\", ...cloudflareResourceSyntax],\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"eslint/no-duplicate-imports\": [\"error\", { allowSeparateTypeImports: true }],\n \"react/function-component-definition\": [\n \"error\",\n { namedComponents: \"arrow-function\", unnamedComponents: \"arrow-function\" },\n ],\n \"typescript/no-empty-interface\": [\"error\", { allowSingleExtends: true }],\n \"typescript/no-empty-object-type\": [\"error\", { allowInterfaces: \"with-single-extends\" }],\n \"react/jsx-filename-extension\": [\"error\", { extensions: [\".tsx\"] }],\n \"react/only-export-components\": [\"error\", { allowExportNames: [\"Route\"] }],\n} satisfies LintConfig[\"rules\"];\n\nconst actionScriptsOverride = {\n files: [\".github/**/*.ts\"],\n rules: {\n \"baseline-js/use-baseline\": \"off\",\n \"effecttsgo/async-function\": \"off\",\n \"effecttsgo/global-console\": \"off\",\n \"effecttsgo/global-fetch\": \"off\",\n \"effecttsgo/global-json\": \"off\",\n \"effecttsgo/missing-pipeable-signature\": \"off\",\n \"effecttsgo/node-builtin-import\": \"off\",\n \"effecttsgo/prefer-effect-array\": \"off\",\n \"effecttsgo/prefer-effect-record\": \"off\",\n \"effecttsgo/prefer-effect-string\": \"off\",\n \"effecttsgo/process-env\": \"off\",\n \"eslint/no-console\": \"off\",\n \"eslint/no-undefined\": \"off\",\n \"import/no-relative-parent-imports\": \"off\",\n \"node/no-process-env\": \"off\",\n \"node/no-sync\": \"off\",\n \"oxc/no-async-await\": \"off\",\n \"unicorn/no-process-exit\": \"off\",\n },\n} satisfies NonNullable<LintConfig[\"overrides\"]>[number];\n\nconst overrides = [\n removalPolicyOverride,\n actionScriptsOverride,\n alchemyOverride,\n {\n files: [\"**/*.config.ts\", \"**/alchemy.*.ts\", \"**/decision-rules.ts\"],\n rules: { \"import/no-default-export\": \"off\" },\n },\n commandsOverride,\n {\n files: [\"**/bin/**\"],\n rules: { \"baseline-js/use-baseline\": \"off\" },\n },\n {\n files: [\"**/*.test.ts\", \"**/*.test.tsx\", \"**/*.test.support.ts\", \"**/vite.config.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\n \"error\",\n ...cloudflareResourceSyntax,\n ...flakeMaskingSyntax,\n ...testDoubleSyntax,\n ],\n },\n },\n {\n files: [\"**/vite.config.ts\"],\n rules: {\n \"eslint/max-lines\": \"off\",\n \"eslint/max-lines-per-function\": \"off\",\n \"baseline-js/use-baseline\": \"off\",\n },\n },\n] satisfies LintConfig[\"overrides\"];\n\nexport const lint = {\n ignorePatterns: generated,\n plugins: [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"react\",\n \"react-perf\",\n \"jsx-a11y\",\n \"jsdoc\",\n \"vitest\",\n \"promise\",\n \"node\",\n \"effecttsgo\",\n ],\n categories: {\n correctness: \"error\",\n suspicious: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n style: \"error\",\n restriction: \"error\",\n nursery: \"error\",\n },\n jsPlugins,\n rules,\n overrides,\n settings: {\n [decisionPluginName]: {\n model: DECISION_MODEL,\n timeoutMs: DECISION_TIMEOUT_MS,\n ci: \"skip\",\n },\n },\n options: {\n typeAware: true,\n typeCheck: true,\n denyWarnings: true,\n reportUnusedDisableDirectives: \"error\",\n },\n} satisfies LintConfig;\n","const UI_STATE = \"UI 状態は effect-atom だけで扱う\";\n\nexport const INSTRUMENTATION = \"計装は Effect のトレーシングだけで扱う\";\nconst INFRASTRUCTURE = \"インフラは Alchemy の IaC と Cloudflare だけで扱い、wrangler は使わない\";\n\nexport const requiredStack: Readonly<Record<string, readonly string[]>> = {\n [UI_STATE]: [\n \"zustand\",\n \"jotai\",\n \"valtio\",\n \"recoil\",\n \"mobx\",\n \"mobx-*\",\n \"redux\",\n \"@reduxjs/*\",\n \"react-redux\",\n \"xstate\",\n \"@xstate/*\",\n \"nanostores\",\n \"@nanostores/*\",\n \"@preact/signals*\",\n ],\n \"サーバー状態は TanStack Query と Eden だけで扱う\": [\n \"swr\",\n \"react-query\",\n \"@apollo/*\",\n \"urql\",\n \"@urql/*\",\n \"axios\",\n \"ky\",\n \"ofetch\",\n \"got\",\n \"node-fetch\",\n \"graphql-request\",\n \"@trpc/*\",\n ],\n \"ルーティングとサーバーは TanStack Start と Elysia だけで扱う\": [\n \"react-router\",\n \"react-router-dom\",\n \"next\",\n \"@remix-run/*\",\n \"wouter\",\n \"express\",\n \"hono\",\n \"fastify\",\n \"koa\",\n \"@nestjs/*\",\n ],\n \"データベースは Drizzle だけで扱い、スキーマはマイグレーションで生成する\": [\n \"prisma\",\n \"@prisma/*\",\n \"typeorm\",\n \"sequelize\",\n \"kysely\",\n \"knex\",\n \"@mikro-orm/*\",\n \"better-sqlite3\",\n \"pg\",\n \"mysql2\",\n ],\n \"認証は better-auth だけで扱う\": [\n \"next-auth\",\n \"@auth/*\",\n \"lucia\",\n \"passport\",\n \"passport-*\",\n \"@clerk/*\",\n \"firebase/auth\",\n \"@supabase/*\",\n ],\n \"UI は shadcn/ui と Tailwind CSS だけで組む\": [\n \"@mui/*\",\n \"antd\",\n \"@chakra-ui/*\",\n \"@mantine/*\",\n \"styled-components\",\n \"@emotion/*\",\n \"bootstrap\",\n \"react-bootstrap\",\n ],\n \"検証、日時、ログ、関数型ユーティリティは Effect だけで扱う\": [\n \"zod\",\n \"yup\",\n \"joi\",\n \"valibot\",\n \"arktype\",\n \"io-ts\",\n \"superstruct\",\n \"moment\",\n \"dayjs\",\n \"date-fns\",\n \"luxon\",\n \"winston\",\n \"pino\",\n \"bunyan\",\n \"loglevel\",\n \"lodash\",\n \"lodash-es\",\n \"ramda\",\n \"rxjs\",\n \"fp-ts\",\n \"neverthrow\",\n \"ts-results\",\n \"purify-ts\",\n ],\n \"CSV は effect/encoding の Csv だけで読み書きする\": [\n \"papaparse\",\n \"csv-parse\",\n \"csv-parser\",\n \"csv-stringify\",\n \"fast-csv\",\n \"@fast-csv/*\",\n \"d3-dsv\",\n ],\n \"tar は effect/encoding の Tar だけで読み書きする\": [\n \"modern-tar\",\n \"nanotar\",\n \"tar\",\n \"tar-stream\",\n \"tar-fs\",\n \"tar-js\",\n \"tarts\",\n \"it-tar\",\n ],\n \"エージェントスキルは vite.config.ts の skills に書き、msch --prepare で入れる\": [\"skills\"],\n \"フィーチャーフラグは OpenFeature だけで扱う\": [\n \"launchdarkly-*\",\n \"@launchdarkly/*\",\n \"@growthbook/*\",\n \"unleash-client\",\n \"flagsmith\",\n \"@vercel/flags\",\n ],\n \"テストは Vitest と Playwright だけで扱う\": [\n \"jest\",\n \"jest-*\",\n \"@jest/*\",\n \"ts-jest\",\n \"mocha\",\n \"jasmine\",\n \"jasmine-core\",\n \"ava\",\n \"cypress\",\n \"tap\",\n \"uvu\",\n ],\n \"決済は Stripe だけで扱う\": [\n \"@paypal/*\",\n \"paypal-rest-sdk\",\n \"braintree\",\n \"@paddle/*\",\n \"@lemonsqueezy/*\",\n \"square\",\n ],\n \"整形は Vite+ の vp fmt だけで扱う\": [\n \"prettier\",\n \"prettier-plugin-*\",\n \"@prettier/*\",\n \"@biomejs/*\",\n \"dprint\",\n ],\n \"lint は Vite+ の vp lint だけで扱い、ESLint のプラグインは oxlint の JS プラグインとして読む\": [\n \"eslint\",\n \"@eslint/*\",\n \"eslint-config-*\",\n \"tslint\",\n \"standard\",\n \"xo\",\n ],\n [INSTRUMENTATION]: [\"@opentelemetry/*\", \"dd-trace\", \"newrelic\"],\n [INFRASTRUCTURE]: [\n \"wrangler\",\n \"miniflare\",\n \"@cloudflare/vite-plugin\",\n \"@vercel/*\",\n \"@netlify/*\",\n \"aws-cdk\",\n \"aws-cdk-lib\",\n \"@pulumi/*\",\n \"cdktf\",\n ],\n};\n","export const tracedRules = {\n \"msch-lint/traced-elysia\": \"error\",\n \"msch-lint/traced-effect-run\": \"error\",\n} as const;\n","import remotion from \"@r_masseater/oxlint-typed-rules/remotion\";\n\nimport { allRulesOf } from \"./lint.config.ts\";\n\nexport const remotionRules = allRulesOf({ prefix: \"@remotion\", rules: remotion.rules });\n","import type { VideoIntro } from \"#/shared/config/index.ts\";\n\nexport interface VideoSayOptions {\n readonly terms?: Readonly<Record<string, string>>;\n readonly banned?: Readonly<Record<string, string>>;\n readonly maxEmphasis?: number;\n}\n\nexport interface VideoSeriesOptions {\n readonly values?: Readonly<Record<string, string>>;\n readonly voices?: readonly string[];\n readonly opener?: string;\n readonly closer?: string;\n readonly intro?: VideoIntro;\n readonly introValues?: Readonly<Record<string, string>>;\n readonly afterIntro?: Readonly<Record<string, string>>;\n}\n\nexport interface VideoRulesOptions {\n readonly say: VideoSayOptions;\n readonly series: Readonly<Record<string, VideoSeriesOptions>>;\n readonly banned?: Readonly<Record<string, string>>;\n}\n\nexport const videoRules = ({ say, series, banned = {} }: VideoRulesOptions) =>\n ({\n \"msch-lint/video-say\": [\"error\", say],\n \"msch-lint/video-readings\": \"error\",\n \"msch-lint/video-series\": [\"error\", { series, banned }],\n }) as const;\n","import type { WismConfig } from \"@r_masseater/wism\";\nimport { rustCrate, skill, structure, workspace } from \"@r_masseater/wism/presets\";\nimport { Array as Arr, Predicate, String as Str, pipe } from \"effect\";\n\nconst NEGATION = \"!\";\nconst isIgnore = Predicate.not(Str.startsWith(NEGATION));\n\nexport interface StructureOptions {\n readonly members: readonly string[];\n readonly ignorePatterns: readonly string[];\n}\n\nexport const structureOf = ({ members, ignorePatterns }: StructureOptions): WismConfig =>\n structure({\n kinds: [workspace({ paths: members }), rustCrate(), skill()],\n ignores: pipe(ignorePatterns, Arr.filter(isIgnore)),\n });\n","import { createRequire, registerHooks } from \"node:module\";\n\nexport const KUROMOJIN = \"kuromojin\";\nconst ON_Y8 = \"@r_masseater/y8/kuromojin\";\n\nexport const requireWithY8Kuromojin = (parentUrl: string): NodeJS.Require => {\n registerHooks({\n resolve: (specifier, context, nextResolve) => {\n if (specifier === KUROMOJIN) {\n return nextResolve(ON_Y8, { ...context, parentURL: import.meta.url });\n }\n return nextResolve(specifier, context);\n },\n });\n return createRequire(parentUrl);\n};\n","import presetJa from \"@r_masseater/textlint-rule-preset-ja\";\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Option, Predicate, Record as Rec, pipe } from \"effect\";\n\nimport { JAPANESE } from \"#/shared/config/index.ts\";\n\nimport { requireWithY8Kuromojin } from \"./kuromojin.config.ts\";\n\ntype Preset = NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"presets\"]>[string];\ntype Rule = Preset[\"rules\"][string];\ntype Reporter = Extract<Rule, (...args: never) => unknown>;\ntype Fixable = Exclude<Rule, Reporter>;\n\nconst NO_HANDLERS = {};\n\nconst isPreset = (value: unknown): value is Preset =>\n Predicate.hasProperty(value, \"rules\") &&\n Predicate.isObject(value.rules) &&\n Predicate.hasProperty(value, \"rulesConfig\") &&\n Predicate.isObject(value.rulesConfig);\n\nconst presetIn = (value: unknown): Option.Option<Preset> => {\n if (isPreset(value)) {\n return Option.some(value);\n }\n if (Predicate.hasProperty(value, \"default\")) {\n return presetIn(value.default);\n }\n return Option.none();\n};\n\nconst required = requireWithY8Kuromojin(import.meta.url);\n\nconst presetOf = (specifier: string, loaded: unknown): Preset =>\n Option.getOrThrowWith(\n presetIn(loaded),\n () => new TypeError(`${specifier} does not export a textlint preset`),\n );\n\nconst japaneseOnly =\n (reporter: Reporter): Reporter =>\n (context, options) => {\n if (JAPANESE.test(context.getSource())) {\n return reporter(context, options);\n }\n return NO_HANDLERS;\n };\n\nconst forJapanese = (rule: Reporter | Readonly<Fixable>): Rule => {\n if (Predicate.isFunction(rule)) {\n return japaneseOnly(rule);\n }\n return { linter: japaneseOnly(rule.linter), fixer: japaneseOnly(rule.fixer) };\n};\n\nconst japanesePreset = (specifier: string, loaded: unknown): Preset => {\n const { rules, rulesConfig } = presetOf(specifier, loaded);\n return { rules: pipe(rules, Rec.map(forJapanese)), rulesConfig };\n};\n\nexport const textlintPresets: NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"presets\"]> = {\n \"@r_masseater/preset-ja\": japanesePreset(\"@r_masseater/textlint-rule-preset-ja\", presetJa),\n \"@textlint-ja/preset-ai-writing\": japanesePreset(\n \"@textlint-ja/textlint-rule-preset-ai-writing\",\n required(\"@textlint-ja/textlint-rule-preset-ai-writing\"),\n ),\n \"preset-ja-technical-writing\": japanesePreset(\n \"textlint-rule-preset-ja-technical-writing\",\n required(\"textlint-rule-preset-ja-technical-writing\"),\n ),\n};\n","import { createRequire } from \"node:module\";\n\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Option, Predicate, pipe } from \"effect\";\n\ntype Filter = NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"filterModules\"]>[string];\n\nconst isFilter = (value: unknown): value is Filter => Predicate.isFunction(value);\n\nconst filterIn = (specifier: string, loaded: unknown): Filter =>\n pipe(\n Option.liftPredicate(loaded, isFilter),\n Option.getOrThrowWith(() => new TypeError(`${specifier} does not export a textlint filter`)),\n );\n\nexport const textlintFilters: NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"filterModules\"]> =\n {\n comments: filterIn(\n \"textlint-filter-rule-comments\",\n createRequire(import.meta.url)(\"textlint-filter-rule-comments\"),\n ),\n };\n","import type { Y8Config } from \"@r_masseater/y8\";\nimport { recommended } from \"@r_masseater/y8/presets\";\nimport type { RecommendedOptions } from \"@r_masseater/y8/presets\";\nimport { Option } from \"effect\";\n\nimport { exempt } from \"#/shared/config/index.ts\";\n\ntype SkillNames = NonNullable<NonNullable<RecommendedOptions[\"skills\"]>[\"skillNames\"]>;\n\nconst skillNamesOf = (indexSkill: Option.Option<string>): SkillNames =>\n Option.match(indexSkill, {\n onNone: (): SkillNames => ({}),\n onSome: (index): SkillNames => ({ index }),\n });\n\nconst docsOf = (indexSkill: Option.Option<string>): RecommendedOptions => {\n const skillNames = skillNamesOf(indexSkill);\n return {\n agents: {\n sections: [[\"Tech stack\"], [\"Commands\"], [\"Rules\"]],\n commands: [\"Commands\"],\n stack: [\"Tech stack\"],\n skillNames,\n },\n skills: { skillNames },\n };\n};\n\nexport const MARKDOWN_IGNORES = [\".agents/skills/**\", \"CHANGELOG.md\", \"**/CLAUDE.md\", ...exempt];\n\nexport const MARKDOWN_RULES = { \"agnix/XP-001\": \"off\" } as const;\n\nexport interface MarkdownOptions {\n readonly indexSkill: Option.Option<string>;\n readonly docs?: RecommendedOptions;\n}\n\nexport const markdownOf = ({ indexSkill, docs = {} }: MarkdownOptions): Y8Config => {\n const base = docsOf(indexSkill);\n return {\n extends: [\n recommended({\n ...base,\n ...docs,\n agents: { ...base.agents, ...docs.agents },\n skills: { ...base.skills, ...docs.skills },\n }),\n ],\n rules: MARKDOWN_RULES,\n reportUnusedDirectives: true,\n ignores: MARKDOWN_IGNORES,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,MAAa,YAAY;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,gBAAgB,CAAC,gBAAgB;AAEvC,MAAM,WAAW,CAAC,gBAAgB;AAElC,MAAa,SAAS;CAAC,GAAG;CAAW,GAAG;CAAe,GAAG;AAAQ;;ACnBlE,MAAM,UAAU;AAChB,MAAM,kBACJ;AAEF,MAAM,YAAY;AAClB,MAAM,oBACJ;AAEF,MAAM,0BACJ;AAEF,MAAM,qBACJ;AAEF,MAAM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;EACX,IAAI;CACN,EACF;CACA,SAAS;EACP,WAAW;EACX,WAAW;EACX,cAAc;EACd,+BAA+B;CACjC;AACF;;AC9NA,MAAM,WAAW;AAEjB,MAAa,kBAAkB;AAC/B,MAAM,iBAAiB;AAEvB,MAAa,gBAA6D;EACvE,WAAW;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uCAAuC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,8CAA8C;EAC5C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,4CAA4C;EAC1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yBAAyB;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uCAAuC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,qCAAqC;EACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yCAAyC;EACvC;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yCAAyC;EACvC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,8DAA8D,CAAC,QAAQ;CACvE,gCAAgC;EAC9B;EACA;EACA;EACA;EACA;EACA;CACF;CACA,kCAAkC;EAChC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,oBAAoB;EAClB;EACA;EACA;EACA;EACA;EACA;CACF;CACA,4BAA4B;EAC1B;EACA;EACA;EACA;EACA;CACF;CACA,sEAAsE;EACpE;EACA;EACA;EACA;EACA;EACA;CACF;EACC,kBAAkB;EAAC;EAAoB;EAAY;CAAU;EAC7D,iBAAiB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF;;ACr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ACpB;EACF;EACA,QAAQ,EAAE,WAAW;CACvB;AACF;AAEA,MAAa,mBAAmB;CAAC;CAAqB;CAAgB;CAAgB,GAAG;AAAM;AAE/F,MAAa,iBAAiB,EAAE,gBAAgB,MAAM;AAOtD,MAAa,cAAc,EAAE,YAAY,OAAO,CAAC,QAAmC;CAClF,MAAM,OAAO,OAAO,UAAU;CAC9B,OAAO;EACL,SAAS,CACP,YAAY;GACV,GAAG;GACH,GAAG;GACH,QAAQ;IAAE,GAAG,KAAK;IAAQ,GAAG,KAAK;GAAO;GACzC,QAAQ;IAAE,GAAG,KAAK;IAAQ,GAAG,KAAK;GAAO;EAC3C,CAAC,CACH;EACA,OAAO;EACP,wBAAwB;EACxB,SAAS;CACX;AACF"}
|
package/dist/exits.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
package/dist/exits.mjs
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { t as lookupReport } from "./lookup-report-L5OLXRMf.mjs";
|
|
3
|
-
import { t as runCli } from "./runtime-Djm7zMwu.mjs";
|
|
4
|
-
import { n as upstreamExitsMet } from "./upstream-exits-4bn4gblF.mjs";
|
|
5
|
-
import { r as RepositoryFiles } from "./repository-files-DSwKJnrj.mjs";
|
|
6
|
-
import { Array, Effect, Schema, pipe } from "effect";
|
|
7
|
-
// bin/msch-exits.ts
|
|
8
|
-
const MetRow = Schema.Struct({
|
|
9
|
-
file: Schema.String,
|
|
10
|
-
line: Schema.Finite,
|
|
11
|
-
section: Schema.String,
|
|
12
|
-
key: Schema.String,
|
|
13
|
-
condition: Schema.String,
|
|
14
|
-
outcome: Schema.Literals(["met", "unchecked"])
|
|
15
|
-
});
|
|
16
|
-
const VERDICTS = {
|
|
17
|
-
met: "is met. Remove the deviation and run verify.",
|
|
18
|
-
unchecked: "could not be checked. Check it by hand or rerun where the lookup is reachable."
|
|
19
|
-
};
|
|
20
|
-
const describeRow = (row) => `${row.file}:${String(row.line)} ${row.section} ${row.key}: the exit condition ${row.condition} ${VERDICTS[row.outcome]}`;
|
|
21
|
-
const rowsIn = Effect.fn("rowsIn")(function* rowsIn(root) {
|
|
22
|
-
const files = yield* RepositoryFiles;
|
|
23
|
-
const met = yield* upstreamExitsMet(root);
|
|
24
|
-
return pipe(met, Array.map(({ file, met: { entry, condition, outcome } }) => ({
|
|
25
|
-
file: files.relative(root, file),
|
|
26
|
-
line: entry.line,
|
|
27
|
-
section: entry.section,
|
|
28
|
-
key: entry.key,
|
|
29
|
-
condition,
|
|
30
|
-
outcome
|
|
31
|
-
})));
|
|
32
|
-
});
|
|
33
|
-
runCli("msch-exits")(lookupReport({
|
|
34
|
-
row: MetRow,
|
|
35
|
-
rows: rowsIn,
|
|
36
|
-
describe: describeRow
|
|
37
|
-
}));
|
|
38
|
-
export {};
|
|
39
|
-
|
|
40
|
-
//# sourceMappingURL=exits.mjs.map
|
package/dist/exits.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exits.mjs","names":["Arr"],"sources":["../bin/msch-exits.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Array as Arr, Effect, Schema, pipe } from \"effect\";\n\nimport { lookupReport } from \"#/app/lookup-report.ts\";\nimport { runCli } from \"#/app/runtime.ts\";\nimport { upstreamExitsMet } from \"#/features/check-upstream-exits/index.ts\";\nimport type { FileExit } from \"#/features/check-upstream-exits/index.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst MetRow = Schema.Struct({\n file: Schema.String,\n line: Schema.Finite,\n section: Schema.String,\n key: Schema.String,\n condition: Schema.String,\n outcome: Schema.Literals([\"met\", \"unchecked\"]),\n});\n\ntype MetRowType = typeof MetRow.Type;\n\nconst VERDICTS: Readonly<Record<MetRowType[\"outcome\"], string>> = {\n met: \"is met. Remove the deviation and run verify.\",\n unchecked: \"could not be checked. Check it by hand or rerun where the lookup is reachable.\",\n};\n\nconst describeRow = (row: MetRowType): string =>\n `${row.file}:${String(row.line)} ${row.section} ${row.key}: the exit condition ${row.condition} ${VERDICTS[row.outcome]}`;\n\nconst rowsIn = Effect.fn(\"rowsIn\")(function* rowsIn(root: string) {\n const files = yield* RepositoryFiles;\n const met = yield* upstreamExitsMet(root);\n return pipe(\n met,\n Arr.map(({ file, met: { entry, condition, outcome } }: FileExit): MetRowType => ({\n file: files.relative(root, file),\n line: entry.line,\n section: entry.section,\n key: entry.key,\n condition,\n outcome,\n })),\n );\n});\n\nrunCli(\"msch-exits\")(lookupReport({ row: MetRow, rows: rowsIn, describe: describeRow }));\n"],"mappings":";;;;;;;AASA,MAAM,SAAS,OAAO,OAAO;CAC3B,MAAM,OAAO;CACb,MAAM,OAAO;CACb,SAAS,OAAO;CAChB,KAAK,OAAO;CACZ,WAAW,OAAO;CAClB,SAAS,OAAO,SAAS,CAAC,OAAO,WAAW,CAAC;AAC/C,CAAC;AAID,MAAM,WAA4D;CAChE,KAAK;CACL,WAAW;AACb;AAEA,MAAM,eAAe,QACnB,GAAG,IAAI,KAAK,GAAG,OAAO,IAAI,IAAI,EAAE,GAAG,IAAI,QAAQ,GAAG,IAAI,IAAI,uBAAuB,IAAI,UAAU,GAAG,SAAS,IAAI;AAEjH,MAAM,SAAS,OAAO,GAAG,QAAQ,CAAC,CAAC,UAAU,OAAO,MAAc;CAChE,MAAM,QAAQ,OAAO;CACrB,MAAM,MAAM,OAAO,iBAAiB,IAAI;CACxC,OAAO,KACL,KACAA,MAAI,KAAK,EAAE,MAAM,KAAK,EAAE,OAAO,WAAW,iBAAuC;EAC/E,MAAM,MAAM,SAAS,MAAM,IAAI;EAC/B,MAAM,MAAM;EACZ,SAAS,MAAM;EACf,KAAK,MAAM;EACX;EACA;CACF,EAAE,CACJ;AACF,CAAC;AAED,OAAO,YAAY,CAAC,CAAC,aAAa;CAAE,KAAK;CAAQ,MAAM;CAAQ,UAAU;AAAY,CAAC,CAAC"}
|
package/dist/judge.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|