@r_masseater/msch 0.94.0 → 0.95.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 -1
- package/dist/{base-revision-C9RxuIMK.mjs → base-revision-uiUwYlbc.mjs} +2 -2
- package/dist/{base-revision-C9RxuIMK.mjs.map → base-revision-uiUwYlbc.mjs.map} +1 -1
- package/dist/cargo-inputs.mjs +2 -2
- package/dist/changed.mjs +5 -5
- package/dist/cli.mjs +496 -382
- package/dist/cli.mjs.map +1 -1
- package/dist/collections-CdEHfcEj.mjs +6 -0
- package/dist/collections-CdEHfcEj.mjs.map +1 -0
- package/dist/config-BBdsNPSO.mjs.map +1 -1
- package/dist/config.mjs +1 -1
- package/dist/decision-rules.mjs +1 -1
- package/dist/{define-lint-preset-GWsBHDRn.mjs → define-lint-preset-BjHY5WNt.mjs} +57 -38
- package/dist/define-lint-preset-BjHY5WNt.mjs.map +1 -0
- package/dist/exits.mjs +4 -4
- package/dist/{ignored-directories-Ce-45yzO.mjs → ignored-directories-BRRODOoG.mjs} +2 -2
- package/dist/{ignored-directories-Ce-45yzO.mjs.map → ignored-directories-BRRODOoG.mjs.map} +1 -1
- package/dist/index-skill-Bf5Ish11.mjs +19 -0
- package/dist/index-skill-Bf5Ish11.mjs.map +1 -0
- package/dist/judge.mjs +4 -4
- package/dist/lint.mjs +1 -1
- package/dist/{lookup-report-DVJg0K4Z.mjs → lookup-report-BWiDFlSS.mjs} +3 -3
- package/dist/{lookup-report-DVJg0K4Z.mjs.map → lookup-report-BWiDFlSS.mjs.map} +1 -1
- package/dist/{manifest-texts-B69vIp7o.mjs → manifest-texts-Bhlz2Z2_.mjs} +2 -2
- package/dist/{manifest-texts-B69vIp7o.mjs.map → manifest-texts-Bhlz2Z2_.mjs.map} +1 -1
- package/dist/{output-B_YPmKad.mjs → output-B4GNchqH.mjs} +3 -3
- package/dist/{output-B_YPmKad.mjs.map → output-B4GNchqH.mjs.map} +1 -1
- package/dist/oxlint.mjs +2 -2
- package/dist/package-routes-BdYpOLTv.mjs +73 -0
- package/dist/package-routes-BdYpOLTv.mjs.map +1 -0
- package/dist/{package-versions-PMKDR-bJ.mjs → package-versions-BLtKon6D.mjs} +4 -4
- package/dist/{package-versions-PMKDR-bJ.mjs.map → package-versions-BLtKon6D.mjs.map} +1 -1
- package/dist/{pass-records-CBvMwfN3.mjs → pass-records-ljpQ--tm.mjs} +4 -4
- package/dist/{pass-records-CBvMwfN3.mjs.map → pass-records-ljpQ--tm.mjs.map} +1 -1
- package/dist/{problem-CUIz4TEI.mjs → problem-Bi4Kgg9b.mjs} +2 -2
- package/dist/{problem-CUIz4TEI.mjs.map → problem-Bi4Kgg9b.mjs.map} +1 -1
- package/dist/publish.mjs +23 -87
- package/dist/publish.mjs.map +1 -1
- package/dist/{published-B5LA4ZlS.mjs → published-BGur-Htr.mjs} +9 -5
- package/dist/{published-B5LA4ZlS.mjs.map → published-BGur-Htr.mjs.map} +1 -1
- package/dist/published.mjs +15 -18
- package/dist/published.mjs.map +1 -1
- package/dist/refs.mjs +7 -7
- package/dist/refs.mjs.map +1 -1
- package/dist/registries-DePiYd3D.mjs +11 -0
- package/dist/registries-DePiYd3D.mjs.map +1 -0
- package/dist/{registry-releases-Dj6jH8Yt.mjs → registry-releases-CaO-8xAO.mjs} +3 -3
- package/dist/registry-releases-CaO-8xAO.mjs.map +1 -0
- package/dist/{repository-files-B6PEvKWe.mjs → repository-files-hbJpQ1i0.mjs} +9 -5
- package/dist/repository-files-hbJpQ1i0.mjs.map +1 -0
- package/dist/{runtime-C8OGDSk9.mjs → runtime-BdEuIL6Z.mjs} +2 -2
- package/dist/{runtime-C8OGDSk9.mjs.map → runtime-BdEuIL6Z.mjs.map} +1 -1
- package/dist/unbumped.mjs +5 -5
- package/dist/{upstream-exits-nTTh2qcD.mjs → upstream-exits-BC8ofnVa.mjs} +7 -7
- package/dist/{upstream-exits-nTTh2qcD.mjs.map → upstream-exits-BC8ofnVa.mjs.map} +1 -1
- package/dist/{upstream-record-DlluH3fY.mjs → upstream-record-I5ZgAwk-.mjs} +3 -2
- package/dist/{upstream-record-DlluH3fY.mjs.map → upstream-record-I5ZgAwk-.mjs.map} +1 -1
- package/dist/upstream.mjs +7 -8
- package/dist/upstream.mjs.map +1 -1
- package/dist/{workspace-projects-B-vCr6bx.mjs → workspace-projects-DnWDM8G1.mjs} +2 -2
- package/dist/{workspace-projects-B-vCr6bx.mjs.map → workspace-projects-DnWDM8G1.mjs.map} +1 -1
- package/dist/workspace-settings.mjs +4 -4
- package/package.json +4 -5
- package/skills/msch-checks/SKILL.md +3 -3
- package/skills/msch-publishing/SKILL.md +4 -4
- package/skills/msch-repository-config/SKILL.md +20 -33
- package/skills/msch-workspace-settings/SKILL.md +1 -0
- package/src/app/vite.d.ts +1 -34
- package/dist/credential-broker-PkIpsaMh.mjs +0 -29
- package/dist/credential-broker-PkIpsaMh.mjs.map +0 -1
- package/dist/define-lint-preset-GWsBHDRn.mjs.map +0 -1
- package/dist/owner-settings-BAh-fFKg.mjs +0 -122
- package/dist/owner-settings-BAh-fFKg.mjs.map +0 -1
- package/dist/package-routes-DQmhjX07.mjs +0 -82
- package/dist/package-routes-DQmhjX07.mjs.map +0 -1
- package/dist/registry-releases-Dj6jH8Yt.mjs.map +0 -1
- package/dist/repository-files-B6PEvKWe.mjs.map +0 -1
- package/dist/wake.d.mts +0 -1
- package/dist/wake.mjs +0 -34
- package/dist/wake.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as valueKey, S as schemaTypeOf, _ as formatValues, a as nearestManifestDirectory, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as installedPackages, l as mentions$1, m as isObjectType, n as keepOnly, o as projectInputs, p as describeLibraryType, r as recordsIn, t as contentKey, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./pass-records-
|
|
3
|
-
import { n as NODE_MODULES, o as TOOL_NAME$1, r as RepositoryFiles,
|
|
2
|
+
import { C as valueKey, S as schemaTypeOf, _ as formatValues, a as nearestManifestDirectory, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as installedPackages, l as mentions$1, m as isObjectType, n as keepOnly, o as projectInputs, p as describeLibraryType, r as recordsIn, t as contentKey, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./pass-records-ljpQ--tm.mjs";
|
|
3
|
+
import { n as NODE_MODULES, o as TOOL_NAME$1, r as RepositoryFiles, t as MSCH_CACHE } from "./repository-files-hbJpQ1i0.mjs";
|
|
4
4
|
import { t as workspaceManifest } from "./workspace-manifest-BAVyPzbA.mjs";
|
|
5
|
-
import { a as workspaceDeviations, c as tomlSourceComments, d as problemAtIndex, i as cargoDeviations, l as yamlSourceComments, o as collectNodes, r as WORKSPACE_SECTIONS, s as isRecord, t as checkUpstreamExits, u as positionOf } from "./upstream-exits-
|
|
5
|
+
import { a as workspaceDeviations, c as tomlSourceComments, d as problemAtIndex, i as cargoDeviations, l as yamlSourceComments, o as collectNodes, r as WORKSPACE_SECTIONS, s as isRecord, t as checkUpstreamExits, u as positionOf } from "./upstream-exits-BC8ofnVa.mjs";
|
|
6
6
|
import { a as parent, i as join, n as isInside, t as baseName } from "./path-DUttmo2s.mjs";
|
|
7
|
-
import { i as workspaceProjects, n as unmatchedWorkspacePatterns, o as installedManifest, r as workspaceDirectories, s as readManifest, t as publishedProjects } from "./workspace-projects-
|
|
8
|
-
import { $ as isIdentifier, A as uniqueByReference, B as getTextOfJSDocComment, C as moduleSpecifierOf, E as referencedSymbols, F as SymbolFlags, G as isCallExpression, H as isArrowFunction, I as SyntaxKind, J as isEnumDeclaration, K as isClassDeclaration, L as getJSDocTags, O as symbolAt, P as SignatureKind, Q as isFunctionExpression, S as moduleSpecifierLiteralOf, St as isVariableStatement, T as propertyNamesOf, U as isBinaryExpression, V as isArrayLiteralExpression, W as isBlock, X as isExpressionStatement, Y as isExportDeclaration, Z as isFunctionDeclaration, _ as isGenericDeclaration, _t as isTypeLiteralNode, a as problemAtPosition, at as isNumericLiteral, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, ct as isPropertyAccessExpression, d as contains, dt as isSatisfiesExpression, et as isImportDeclaration, f as declarationsOf, ft as isSignatureDeclaration, g as isExternalDeclaration, gt as isTypeAliasDeclaration, h as importedModulesOf, ht as isStringLiteral, i as problemAt$7, it as isNewExpression, k as symbolAtLocation, l as childrenOf$1, lt as isPropertyAssignment, m as descendantsOf, mt as isSpreadElement, nt as isModuleBlock, o as problemInFile, ot as isObjectLiteralExpression, p as declaresAType, pt as isSourceFile, q as isElementAccessExpression, rt as isModuleDeclaration, s as sortProblems, st as isParenthesizedExpression, t as ProblemList, tt as isInterfaceDeclaration, u as columnOf, ut as isReturnStatement, v as isInsideAny, vt as isTypeReferenceNode, w as packageOf$1, x as lineOf$3, xt as isVariableDeclarationList, y as isOutsideDeclaration, yt as isUnionTypeNode, z as getNameOfDeclaration } from "./problem-
|
|
9
|
-
import { A as
|
|
7
|
+
import { i as workspaceProjects, n as unmatchedWorkspacePatterns, o as installedManifest, r as workspaceDirectories, s as readManifest, t as publishedProjects } from "./workspace-projects-DnWDM8G1.mjs";
|
|
8
|
+
import { $ as isIdentifier, A as uniqueByReference, B as getTextOfJSDocComment, C as moduleSpecifierOf, E as referencedSymbols, F as SymbolFlags, G as isCallExpression, H as isArrowFunction, I as SyntaxKind, J as isEnumDeclaration, K as isClassDeclaration, L as getJSDocTags, O as symbolAt, P as SignatureKind, Q as isFunctionExpression, S as moduleSpecifierLiteralOf, St as isVariableStatement, T as propertyNamesOf, U as isBinaryExpression, V as isArrayLiteralExpression, W as isBlock, X as isExpressionStatement, Y as isExportDeclaration, Z as isFunctionDeclaration, _ as isGenericDeclaration, _t as isTypeLiteralNode, a as problemAtPosition, at as isNumericLiteral, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, ct as isPropertyAccessExpression, d as contains, dt as isSatisfiesExpression, et as isImportDeclaration, f as declarationsOf, ft as isSignatureDeclaration, g as isExternalDeclaration, gt as isTypeAliasDeclaration, h as importedModulesOf, ht as isStringLiteral, i as problemAt$7, it as isNewExpression, k as symbolAtLocation, l as childrenOf$1, lt as isPropertyAssignment, m as descendantsOf, mt as isSpreadElement, nt as isModuleBlock, o as problemInFile, ot as isObjectLiteralExpression, p as declaresAType, pt as isSourceFile, q as isElementAccessExpression, rt as isModuleDeclaration, s as sortProblems, st as isParenthesizedExpression, t as ProblemList, tt as isInterfaceDeclaration, u as columnOf, ut as isReturnStatement, v as isInsideAny, vt as isTypeReferenceNode, w as packageOf$1, x as lineOf$3, xt as isVariableDeclarationList, y as isOutsideDeclaration, yt as isUnionTypeNode, z as getNameOfDeclaration } from "./problem-Bi4Kgg9b.mjs";
|
|
9
|
+
import { A as childrenOf$2, F as stringsIn, M as literalOf, N as nestedValues, O as workspaceConfigOf, P as propertyValue, _ as RUN_TASKS, a as workspaceConfigs, b as hasVerifyTask, c as publicEntriesOf, d as bundledEntries, f as deployEntries, i as publishedWorkspaces, j as keyName, k as KeySchema, m as shadcnUiOf, o as entryNameOf, r as packedWorkspaces, s as isBinEntry, u as workspaceLinks, v as VERIFY_TASK, y as definesTask } from "./published-BGur-Htr.mjs";
|
|
10
10
|
import { r as JAPANESE } from "./config-BBdsNPSO.mjs";
|
|
11
|
-
import {
|
|
11
|
+
import { d as RENOVATE_PRESET, f as SELF_NAME } from "./package-routes-BdYpOLTv.mjs";
|
|
12
12
|
import { n as readTree, t as loadLanguage } from "./tree-sitter-BfzHNwTR.mjs";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { t as groupOf } from "./collections-CdEHfcEj.mjs";
|
|
14
|
+
import { n as baseRevision, t as baseName$1 } from "./base-revision-uiUwYlbc.mjs";
|
|
15
|
+
import { a as presentFiles, i as listedFiles, n as isScannedText, o as scanText, r as isToolVersions, t as upstreamRecords } from "./upstream-record-I5ZgAwk-.mjs";
|
|
15
16
|
import { a as offsetIn$1, i as namedCatalogsOf, n as manifestPattern, o as quoted$1, r as manifestSpecifiers, s as specifiedIn, t as fieldsOf } from "./specifiers-BrCyPubD.mjs";
|
|
16
|
-
import { t as
|
|
17
|
-
import { t as
|
|
18
|
-
import {
|
|
19
|
-
import { t as
|
|
17
|
+
import { i as withTrailingSlash, n as PUBLIC_REGISTRY, r as scopeOfName, t as INSTALL_REGISTRY } from "./registries-DePiYd3D.mjs";
|
|
18
|
+
import { n as FRONTMATTER, r as splitFrontmatter, t as isIndexSkill } from "./index-skill-Bf5Ish11.mjs";
|
|
19
|
+
import { t as checkPackageVersions } from "./package-versions-BLtKon6D.mjs";
|
|
20
|
+
import { t as manifestTexts } from "./manifest-texts-Bhlz2Z2_.mjs";
|
|
21
|
+
import { i as writeProblems, n as failWhenAny, r as writeJsonProblems } from "./output-B4GNchqH.mjs";
|
|
22
|
+
import { t as runCli } from "./runtime-BdEuIL6Z.mjs";
|
|
20
23
|
import "./cli-contract-D7btWrEu.mjs";
|
|
21
24
|
import { builtinModules, isBuiltin } from "node:module";
|
|
22
25
|
import { VpToolsError, findCiDrift, runVpa } from "@r_masseater/vite-plus-adopt";
|
|
@@ -188,7 +191,7 @@ const namedWorkspaces = Effect.fn("namedWorkspaces")(function* namedWorkspaces(r
|
|
|
188
191
|
return pipe(projects, Array$1.map(namedIn((directory) => files.basename(directory))));
|
|
189
192
|
});
|
|
190
193
|
// src/entities/workspace/model/cargo-crates.ts
|
|
191
|
-
const SEPARATOR$
|
|
194
|
+
const SEPARATOR$25 = "/";
|
|
192
195
|
const SUCCESS$2 = 0;
|
|
193
196
|
const CrateTarget = Schema.Struct({ kind: Schema.Array(Schema.String) });
|
|
194
197
|
const CrateDependency = Schema.Struct({ path: Schema.optional(Schema.String) });
|
|
@@ -228,24 +231,15 @@ const cratesIn = Effect.fn("cratesIn")(function* cratesIn(root) {
|
|
|
228
231
|
}, Effect.scoped);
|
|
229
232
|
/** @internal */
|
|
230
233
|
const owningWorkspace = (directories) => (directory) => {
|
|
231
|
-
const owners = pipe(directories, Array$1.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$
|
|
234
|
+
const owners = pipe(directories, Array$1.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$25}`)(directory)));
|
|
232
235
|
return Array$1.last(Array$1.sort(owners, String$1.Order));
|
|
233
236
|
};
|
|
234
|
-
// src/shared/lib/frontmatter.ts
|
|
235
|
-
const FRONTMATTER = /^---\n(?<yaml>[\s\S]*?)\n---\n/u;
|
|
236
|
-
const START$30 = 0;
|
|
237
|
-
const Fields = Schema.Record(Schema.String, Schema.Unknown);
|
|
238
|
-
const decodeFields$1 = Schema.decodeUnknownOption(Fields);
|
|
239
|
-
const splitFrontmatter = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.flatMap((found) => pipe(groupOf("yaml")(found), Option.flatMap(Option.liftThrowable((yaml) => parse$1(yaml))), Option.flatMap(decodeFields$1), Option.map((fields) => ({
|
|
240
|
-
fields,
|
|
241
|
-
body: String$1.slice(found[START$30].length)(source)
|
|
242
|
-
})))));
|
|
243
237
|
// src/entities/workspace/model/plugins.ts
|
|
244
238
|
const PLUGIN_FILE$3 = ".claude-plugin/plugin.json";
|
|
245
239
|
const SKILLS_DIRECTORY = "skills";
|
|
246
240
|
const SKILL_FILE$3 = "SKILL.md";
|
|
247
241
|
const CONCURRENCY$4 = 16;
|
|
248
|
-
const SEPARATOR$
|
|
242
|
+
const SEPARATOR$24 = "/";
|
|
249
243
|
const PluginManifest$1 = Schema.fromJsonString(Schema.Struct({
|
|
250
244
|
name: Schema.String,
|
|
251
245
|
description: Schema.optionalKey(Schema.String),
|
|
@@ -261,7 +255,7 @@ const skillIn = Effect.fn("skillIn")(function* skillIn(scan, { plugin, skills },
|
|
|
261
255
|
const directory = files.join(skills, name);
|
|
262
256
|
const file = files.join(directory, SKILL_FILE$3);
|
|
263
257
|
const source = yield* files.readFile(file);
|
|
264
|
-
const prefix = `${files.relative(scan.root, directory)}${SEPARATOR$
|
|
258
|
+
const prefix = `${files.relative(scan.root, directory)}${SEPARATOR$24}`;
|
|
265
259
|
const inside = pipe(scan.listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.map((entry) => files.join(scan.root, entry)));
|
|
266
260
|
return pipe(source, Option.flatMap((text) => pipe(splitFrontmatter(text), Option.map((frontmatter) => ({
|
|
267
261
|
plugin,
|
|
@@ -274,7 +268,7 @@ const skillIn = Effect.fn("skillIn")(function* skillIn(scan, { plugin, skills },
|
|
|
274
268
|
})))));
|
|
275
269
|
});
|
|
276
270
|
const filesUnder = Effect.fn("filesUnder")(function* filesUnder(scan, directory) {
|
|
277
|
-
const prefix = `${(yield* RepositoryFiles).relative(scan.root, directory)}${SEPARATOR$
|
|
271
|
+
const prefix = `${(yield* RepositoryFiles).relative(scan.root, directory)}${SEPARATOR$24}`;
|
|
278
272
|
return pipe(scan.listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.map(String$1.slice(prefix.length)));
|
|
279
273
|
});
|
|
280
274
|
const skillsOf = Effect.fn("skillsOf")(function* skillsOf(scan, plugin, directory) {
|
|
@@ -604,12 +598,12 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
|
|
|
604
598
|
// src/features/check-overrides/model/git-subpath.ts
|
|
605
599
|
const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
|
|
606
600
|
const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
|
|
607
|
-
const RULE$
|
|
601
|
+
const RULE$78 = "git-subpath-dependency";
|
|
608
602
|
const WHOLE_MATCH$4 = 0;
|
|
609
603
|
const problemAt$6 = ({ file }, source) => (found) => ({
|
|
610
604
|
file,
|
|
611
605
|
...positionOf(source)(found.index ?? WHOLE_MATCH$4),
|
|
612
|
-
rule: RULE$
|
|
606
|
+
rule: RULE$78,
|
|
613
607
|
message: `Git subpath dependencies are banned. Publish the package to npm and depend on a released version instead of \`${String$1.trim(found[WHOLE_MATCH$4])}\`.`
|
|
614
608
|
});
|
|
615
609
|
const problemsIn$25 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$6(entry, source)));
|
|
@@ -620,13 +614,13 @@ const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(r
|
|
|
620
614
|
return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$25);
|
|
621
615
|
});
|
|
622
616
|
// src/features/check-overrides/model/restricted-rules.ts
|
|
623
|
-
const RULE$
|
|
617
|
+
const RULE$77 = "unnamed-restriction";
|
|
624
618
|
const WHOLE_MATCH$3 = 0;
|
|
625
619
|
const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-(?:imports|properties)\\b`, "gu");
|
|
626
620
|
const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
|
|
627
621
|
file: entry.file,
|
|
628
622
|
...positionOf(source)(found.index ?? WHOLE_MATCH$3),
|
|
629
|
-
rule: RULE$
|
|
623
|
+
rule: RULE$77,
|
|
630
624
|
message: `${found[WHOLE_MATCH$3]} is not used in this repository, because its name does not say what an entry protects. Ban a package in dependencyRules.banned, and write any other restriction as a rule in msch-lint whose name states the intent.`
|
|
631
625
|
})));
|
|
632
626
|
/** @internal */
|
|
@@ -635,13 +629,13 @@ const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRe
|
|
|
635
629
|
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$24);
|
|
636
630
|
});
|
|
637
631
|
// src/features/check-overrides/model/type-exemptions.ts
|
|
638
|
-
const RULE$
|
|
632
|
+
const RULE$76 = "named-type-exemption";
|
|
639
633
|
const WHOLE_MATCH$2 = 0;
|
|
640
634
|
const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
|
|
641
635
|
const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
|
|
642
636
|
file: entry.file,
|
|
643
637
|
...positionOf(source)(found.index ?? WHOLE_MATCH$2),
|
|
644
|
-
rule: RULE$
|
|
638
|
+
rule: RULE$76,
|
|
645
639
|
message: "exempts a type from a lint rule by its name. Such a list is written by hand for every dependency and only grows. msch-lint/readonly-parameters reads where each type is declared and exempts the types of packages and of the language by itself, so remove the entry. For another rule, add a rule to msch-lint that reads the declaration."
|
|
646
640
|
})));
|
|
647
641
|
/** @internal */
|
|
@@ -650,60 +644,51 @@ const checkTypeExemptions = Effect.fn("checkTypeExemptions")(function* checkType
|
|
|
650
644
|
return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$23);
|
|
651
645
|
});
|
|
652
646
|
// src/features/check-overrides/model/package-registry.ts
|
|
653
|
-
const RULE$
|
|
647
|
+
const RULE$75 = "package-registry";
|
|
654
648
|
const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
|
|
655
649
|
const NPMRC = /(?:^|\/)\.npmrc$/u;
|
|
656
650
|
const WORKSPACE_REGISTRY = /^registry:/mu;
|
|
657
651
|
const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
|
|
658
|
-
const START$
|
|
659
|
-
const
|
|
660
|
-
if (registry === DEFAULT_SETTINGS.installRegistry) return `Installs go through Takumi Guard (${registry}), which blocks known-malicious packages before they are installed.`;
|
|
661
|
-
return `Installs go through ${registry}, the registry msch.installs.registry in the root vite.config.ts names.`;
|
|
662
|
-
};
|
|
663
|
-
const requiredOf = (registry) => ({
|
|
664
|
-
registry,
|
|
665
|
-
reason: reasonOf(registry)
|
|
666
|
-
});
|
|
652
|
+
const START$30 = 0;
|
|
653
|
+
const REASON$1 = `Installs go through Takumi Guard (${INSTALL_REGISTRY}), which blocks known-malicious packages before they are installed.`;
|
|
667
654
|
const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
|
|
668
655
|
const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
|
|
669
|
-
const isRequired = (
|
|
670
|
-
const offsetIn = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$
|
|
671
|
-
const workspaceProblem = (
|
|
656
|
+
const isRequired = (found) => withTrailingSlash(found) === INSTALL_REGISTRY;
|
|
657
|
+
const offsetIn = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$30));
|
|
658
|
+
const workspaceProblem = ({ file, source }, registry) => ({
|
|
672
659
|
file,
|
|
673
660
|
...positionOf(source)(offsetIn(WORKSPACE_REGISTRY.exec(source))),
|
|
674
|
-
rule: RULE$
|
|
661
|
+
rule: RULE$75,
|
|
675
662
|
message: Option.match(registry, {
|
|
676
|
-
onNone: () => `${
|
|
677
|
-
onSome: (value) => `${
|
|
663
|
+
onNone: () => `${REASON$1} Set \`registry: ${INSTALL_REGISTRY}\` in ${WORKSPACE_FILE$6}.`,
|
|
664
|
+
onSome: (value) => `${REASON$1} \`registry\` is ${value}. Set it to ${INSTALL_REGISTRY}.`
|
|
678
665
|
})
|
|
679
666
|
});
|
|
680
|
-
const npmrcProblems = (
|
|
667
|
+
const npmrcProblems = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array$1.filter((found) => !Option.exists(groupOf("value")(found), isRequired)), Array$1.map((found) => ({
|
|
681
668
|
file: entry.file,
|
|
682
|
-
...positionOf(source)(found.index ?? START$
|
|
683
|
-
rule: RULE$
|
|
684
|
-
message: `${
|
|
669
|
+
...positionOf(source)(found.index ?? START$30),
|
|
670
|
+
rule: RULE$75,
|
|
671
|
+
message: `${REASON$1} This .npmrc overrides it with \`${String$1.trim(found[START$30])}\`. Remove the line.`
|
|
685
672
|
})));
|
|
686
|
-
const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root
|
|
673
|
+
const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
|
|
687
674
|
const files = yield* RepositoryFiles;
|
|
688
675
|
const manifest = yield* workspaceManifest(root);
|
|
689
676
|
const registry = pipe(manifest, Option.flatMap(registryOf));
|
|
690
|
-
const guarded = isRequired(
|
|
677
|
+
const guarded = isRequired(Option.getOrElse(registry, () => PUBLIC_REGISTRY));
|
|
691
678
|
if (Option.isNone(manifest) || guarded) return [];
|
|
692
679
|
const file = files.join(root, WORKSPACE_FILE$6);
|
|
693
680
|
const read = yield* files.readFile(file);
|
|
694
681
|
const source = Option.getOrElse(read, () => "");
|
|
695
|
-
return [workspaceProblem(
|
|
682
|
+
return [workspaceProblem({
|
|
696
683
|
file,
|
|
697
684
|
source
|
|
698
685
|
}, registry)];
|
|
699
686
|
});
|
|
700
687
|
/** @internal */
|
|
701
688
|
const checkPackageRegistry = Effect.fn("checkPackageRegistry")(function* checkPackageRegistry(root) {
|
|
702
|
-
const { installRegistry } = yield* ownerSettings(root);
|
|
703
|
-
const required = requiredOf(installRegistry);
|
|
704
689
|
const listed = yield* listedFiles(root);
|
|
705
|
-
const overrides = yield* scanText(pipe(listed, Array$1.filter(({ name }) => NPMRC.test(name))), npmrcProblems
|
|
706
|
-
return [...yield* checkWorkspace(root
|
|
690
|
+
const overrides = yield* scanText(pipe(listed, Array$1.filter(({ name }) => NPMRC.test(name))), npmrcProblems);
|
|
691
|
+
return [...yield* checkWorkspace(root), ...overrides];
|
|
707
692
|
});
|
|
708
693
|
// src/entities/package/model/stack-catalog.ts
|
|
709
694
|
const STACK_CATALOG = "catalog:stack";
|
|
@@ -2832,8 +2817,7 @@ const scanPublishedManifests = Effect.fn("scanPublishedManifests")(function* sca
|
|
|
2832
2817
|
})), Option.getOrElse(() => [])));
|
|
2833
2818
|
});
|
|
2834
2819
|
// src/features/check-overrides/model/removed-peers.ts
|
|
2835
|
-
const RULE$
|
|
2836
|
-
const MSCH$1 = "@r_masseater/msch";
|
|
2820
|
+
const RULE$74 = "removed-peer";
|
|
2837
2821
|
const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
|
|
2838
2822
|
const REMOVED = "-";
|
|
2839
2823
|
const PARENT_SEPARATOR = ">";
|
|
@@ -2860,7 +2844,7 @@ const problemAt$5 = (file, { key, line, column }) => ({ peer, dependent }) => ({
|
|
|
2860
2844
|
file,
|
|
2861
2845
|
line,
|
|
2862
2846
|
column,
|
|
2863
|
-
rule: RULE$
|
|
2847
|
+
rule: RULE$74,
|
|
2864
2848
|
message: `msch runs ${dependent}, which needs ${peer} as a peer, so removing ${peer} with the override ${key} breaks msch. Remove the override.`
|
|
2865
2849
|
});
|
|
2866
2850
|
const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
|
|
@@ -2872,7 +2856,7 @@ const requiredPeersOf = (dependent, manifest) => pipe(Record.keys(manifest.peerD
|
|
|
2872
2856
|
})));
|
|
2873
2857
|
const mschPeers = Effect.fn("mschPeers")(function* mschPeers() {
|
|
2874
2858
|
const files = yield* RepositoryFiles;
|
|
2875
|
-
const own = findPackageJson(
|
|
2859
|
+
const own = findPackageJson(SELF_NAME, import.meta.url);
|
|
2876
2860
|
if (Option.isNone(own)) return [];
|
|
2877
2861
|
const manifest = yield* readManifest(files.dirname(own.value));
|
|
2878
2862
|
const dependencies = pipe(manifest, Option.map(({ dependencies: held }) => Record.keys(held ?? {})), Option.getOrElse(() => []));
|
|
@@ -2894,7 +2878,7 @@ const checkRemovedPeers = Effect.fn("checkRemovedPeers")(function* checkRemovedP
|
|
|
2894
2878
|
});
|
|
2895
2879
|
});
|
|
2896
2880
|
// src/features/check-placement/model/colocated-git-patterns.ts
|
|
2897
|
-
const RULE$
|
|
2881
|
+
const RULE$73 = "colocated-git-patterns";
|
|
2898
2882
|
const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
|
|
2899
2883
|
const ROOT$3 = ".";
|
|
2900
2884
|
const NEGATION$1 = "!";
|
|
@@ -2941,7 +2925,7 @@ const entriesIn$1 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
|
|
|
2941
2925
|
const toEntry = entryOf$1(absolute, files.basename(file), files.dirname(file));
|
|
2942
2926
|
return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
|
|
2943
2927
|
});
|
|
2944
|
-
const patternProblem = (entry, message) => problemAtPosition(RULE$
|
|
2928
|
+
const patternProblem = (entry, message) => problemAtPosition(RULE$73)(entry.file, {
|
|
2945
2929
|
line: entry.line,
|
|
2946
2930
|
column: FIRST$25
|
|
2947
2931
|
}, message);
|
|
@@ -3004,7 +2988,7 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
|
|
|
3004
2988
|
return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
|
|
3005
2989
|
});
|
|
3006
2990
|
// src/features/check-placement/model/colocated-tests.ts
|
|
3007
|
-
const RULE$
|
|
2991
|
+
const RULE$72 = "colocated-test";
|
|
3008
2992
|
const FIRST$24 = 1;
|
|
3009
2993
|
const READ_CONCURRENCY$32 = 64;
|
|
3010
2994
|
const ROOT_SUBPATH$1 = ".";
|
|
@@ -3027,7 +3011,7 @@ const problemFor$10 = (test, message) => ({
|
|
|
3027
3011
|
file: test.file,
|
|
3028
3012
|
line: FIRST$24,
|
|
3029
3013
|
column: FIRST$24,
|
|
3030
|
-
rule: RULE$
|
|
3014
|
+
rule: RULE$72,
|
|
3031
3015
|
message: `${test.base} ${message}`
|
|
3032
3016
|
});
|
|
3033
3017
|
const groupsOf$2 = (source, pattern, group) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((match) => pipe(Option.fromUndefinedOr(match.groups), Option.flatMap((groups) => Option.fromUndefinedOr(groups[group])))), Array$1.getSomes);
|
|
@@ -3110,7 +3094,7 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
|
|
|
3110
3094
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
3111
3095
|
const RECOMMENDED_LINES = 200;
|
|
3112
3096
|
const FIRST$23 = 1;
|
|
3113
|
-
const RULE$
|
|
3097
|
+
const RULE$71 = "agent-docs-length";
|
|
3114
3098
|
const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
|
|
3115
3099
|
const problemFor$9 = (file) => (lines) => {
|
|
3116
3100
|
if (lines <= RECOMMENDED_LINES) return Option.none();
|
|
@@ -3118,14 +3102,14 @@ const problemFor$9 = (file) => (lines) => {
|
|
|
3118
3102
|
file,
|
|
3119
3103
|
line: 201,
|
|
3120
3104
|
column: FIRST$23,
|
|
3121
|
-
rule: RULE$
|
|
3105
|
+
rule: RULE$71,
|
|
3122
3106
|
message: `has ${String(lines)} lines. Claude Code recommends under ${String(RECOMMENDED_LINES)} lines per file: longer files cost context and are followed less reliably. Cut what the code already tells, and move rules shared across repositories into skills.`
|
|
3123
3107
|
});
|
|
3124
3108
|
};
|
|
3125
3109
|
/** @internal */
|
|
3126
3110
|
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$9(file)(lineCount(source)));
|
|
3127
3111
|
// src/features/check-placement/model/claude-link.ts
|
|
3128
|
-
const RULE$
|
|
3112
|
+
const RULE$70 = "claude-md-link";
|
|
3129
3113
|
const CLAUDE = "CLAUDE.md";
|
|
3130
3114
|
const AGENTS = "AGENTS.md";
|
|
3131
3115
|
const FIRST$22 = 1;
|
|
@@ -3144,7 +3128,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3144
3128
|
file: path,
|
|
3145
3129
|
line: FIRST$22,
|
|
3146
3130
|
column: FIRST$22,
|
|
3147
|
-
rule: RULE$
|
|
3131
|
+
rule: RULE$70,
|
|
3148
3132
|
message: MESSAGE$19
|
|
3149
3133
|
})));
|
|
3150
3134
|
});
|
|
@@ -3153,11 +3137,11 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3153
3137
|
return Array$1.getSomes(found);
|
|
3154
3138
|
});
|
|
3155
3139
|
// src/features/check-placement/model/dangling-links.ts
|
|
3156
|
-
const RULE$
|
|
3157
|
-
const SEPARATOR$
|
|
3140
|
+
const RULE$69 = "dangling-link";
|
|
3141
|
+
const SEPARATOR$23 = "/";
|
|
3158
3142
|
const FIRST$21 = 1;
|
|
3159
3143
|
const READ_CONCURRENCY$29 = 16;
|
|
3160
|
-
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$
|
|
3144
|
+
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$23}`)(name);
|
|
3161
3145
|
/** @internal */
|
|
3162
3146
|
const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
|
|
3163
3147
|
const files = yield* RepositoryFiles;
|
|
@@ -3169,7 +3153,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
3169
3153
|
file,
|
|
3170
3154
|
line: FIRST$21,
|
|
3171
3155
|
column: FIRST$21,
|
|
3172
|
-
rule: RULE$
|
|
3156
|
+
rule: RULE$69,
|
|
3173
3157
|
message: `is a link to ${target}, where no file is tracked. A fresh checkout gets a link to nothing, and GitHub Actions fails to load the repository's actions. Track a file there, such as .gitkeep, or delete the link.`
|
|
3174
3158
|
})));
|
|
3175
3159
|
});
|
|
@@ -3179,7 +3163,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
3179
3163
|
// src/features/check-placement/model/member-sources.ts
|
|
3180
3164
|
const ROOT_WORKSPACE$1 = ".";
|
|
3181
3165
|
const FIRST$20 = 1;
|
|
3182
|
-
const SEPARATOR$
|
|
3166
|
+
const SEPARATOR$22 = "/";
|
|
3183
3167
|
const EXCLUDED$6 = [
|
|
3184
3168
|
":(exclude,attr:linguist-vendored)",
|
|
3185
3169
|
":(exclude,attr:linguist-generated)",
|
|
@@ -3204,7 +3188,7 @@ const fileProblem$1 = ({ file, rule, message }) => ({
|
|
|
3204
3188
|
rule,
|
|
3205
3189
|
message
|
|
3206
3190
|
});
|
|
3207
|
-
const ownerOf$4 = (workspaces) => (name) => pipe(workspaces, Array$1.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$
|
|
3191
|
+
const ownerOf$4 = (workspaces) => (name) => pipe(workspaces, Array$1.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$22}`)(name)), (owners) => Array$1.last(Array$1.sort(owners, byLength$1)), Option.map((workspace) => ({
|
|
3208
3192
|
workspace,
|
|
3209
3193
|
inner: String$1.slice(workspace.length + 1)(name)
|
|
3210
3194
|
})));
|
|
@@ -3227,7 +3211,7 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
|
|
|
3227
3211
|
}));
|
|
3228
3212
|
});
|
|
3229
3213
|
// src/features/check-placement/model/deployed-readme.ts
|
|
3230
|
-
const RULE$
|
|
3214
|
+
const RULE$68 = "deployed-readme";
|
|
3231
3215
|
const ROOT_DIRECTORY$4 = "";
|
|
3232
3216
|
const READ_CONCURRENCY$28 = 16;
|
|
3233
3217
|
const MISSING_MESSAGE$2 = "is missing. This workspace has an Alchemy stack that serves an address, so give it a README.md that says what it is and links its URL.";
|
|
@@ -3267,14 +3251,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
3267
3251
|
const readme = yield* readReadme({
|
|
3268
3252
|
root,
|
|
3269
3253
|
directory,
|
|
3270
|
-
rule: RULE$
|
|
3254
|
+
rule: RULE$68,
|
|
3271
3255
|
missingMessage: MISSING_MESSAGE$2
|
|
3272
3256
|
});
|
|
3273
3257
|
return Result.match(readme, {
|
|
3274
3258
|
onFailure: Option.some,
|
|
3275
3259
|
onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
|
|
3276
3260
|
file,
|
|
3277
|
-
rule: RULE$
|
|
3261
|
+
rule: RULE$68,
|
|
3278
3262
|
message: NO_URL_MESSAGE
|
|
3279
3263
|
})))
|
|
3280
3264
|
});
|
|
@@ -3291,9 +3275,9 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
3291
3275
|
return Array$1.getSomes(found);
|
|
3292
3276
|
});
|
|
3293
3277
|
// src/features/check-placement/model/nested-docs.ts
|
|
3294
|
-
const RULE$
|
|
3295
|
-
const CONFIG_FILE$
|
|
3296
|
-
const SEPARATOR$
|
|
3278
|
+
const RULE$67 = "nested-docs";
|
|
3279
|
+
const CONFIG_FILE$8 = "vite.config.ts";
|
|
3280
|
+
const SEPARATOR$21 = "/";
|
|
3297
3281
|
const READ_CONCURRENCY$27 = 64;
|
|
3298
3282
|
const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
|
|
3299
3283
|
const WORKSPACE_AGENT_DOC = "AGENTS.md";
|
|
@@ -3303,8 +3287,8 @@ const MISSING_RULE = "workspace-agents-md";
|
|
|
3303
3287
|
const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Schema.Literal(true) }) });
|
|
3304
3288
|
const taggedError$6 = Schema.TaggedError;
|
|
3305
3289
|
var RootConfigUnreadable = class extends taggedError$6()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
3306
|
-
const isNested = (name) => String$1.includes(SEPARATOR$
|
|
3307
|
-
const problemFor$8 = problemInFile(RULE$
|
|
3290
|
+
const isNested = (name) => String$1.includes(SEPARATOR$21)(name);
|
|
3291
|
+
const problemFor$8 = problemInFile(RULE$67);
|
|
3308
3292
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
3309
3293
|
const WORKSPACE_AGENT_DOCS_MESSAGE = "belongs only at the repository root or as AGENTS.md directly in a workspace, the directory that holds its package.json. Move what agents need there and delete this file.";
|
|
3310
3294
|
const MISSING_MESSAGE$1 = "has no AGENTS.md next to it. This repository sets msch.workspaceAgentsMd, so every workspace describes what it is for and the rules that apply only there in its own AGENTS.md.";
|
|
@@ -3332,7 +3316,7 @@ const problemIn$6 = Effect.fn("problemIn")(function* problemIn(root, allowed, na
|
|
|
3332
3316
|
});
|
|
3333
3317
|
const allowsWorkspaceAgentDocs = Effect.fn("allowsWorkspaceAgentDocs")(function* allowsWorkspaceAgentDocs(root) {
|
|
3334
3318
|
const files = yield* RepositoryFiles;
|
|
3335
|
-
const file = files.join(root, CONFIG_FILE$
|
|
3319
|
+
const file = files.join(root, CONFIG_FILE$8);
|
|
3336
3320
|
if (!(yield* files.exists(file))) return false;
|
|
3337
3321
|
const config = yield* Effect.tryPromise({
|
|
3338
3322
|
try: () => resolveConfigFromFile(file),
|
|
@@ -3361,26 +3345,26 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3361
3345
|
return [...Array$1.getSomes(found), ...missing];
|
|
3362
3346
|
});
|
|
3363
3347
|
// src/features/check-placement/model/published-readme.ts
|
|
3364
|
-
const RULE$
|
|
3348
|
+
const RULE$66 = "published-readme";
|
|
3365
3349
|
const READ_CONCURRENCY$26 = 16;
|
|
3366
3350
|
const MESSAGE$18 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
3367
3351
|
const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
|
|
3368
|
-
const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root,
|
|
3352
|
+
const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
|
|
3369
3353
|
const readme = yield* readReadme({
|
|
3370
3354
|
root,
|
|
3371
3355
|
directory,
|
|
3372
|
-
rule: RULE$
|
|
3356
|
+
rule: RULE$66,
|
|
3373
3357
|
missingMessage: MISSING_MESSAGE
|
|
3374
3358
|
});
|
|
3375
3359
|
return Result.match(readme, {
|
|
3376
3360
|
onFailure: Option.some,
|
|
3377
|
-
onSuccess: ({ file, source }) => pipe(Option.fromNullishOr(JAPANESE.exec(source)), Option.
|
|
3361
|
+
onSuccess: ({ file, source }) => pipe(Option.fromNullishOr(JAPANESE.exec(source)), Option.map((found) => {
|
|
3378
3362
|
const { line, column } = positionOf(source)(found.index);
|
|
3379
3363
|
return {
|
|
3380
3364
|
file,
|
|
3381
3365
|
line,
|
|
3382
3366
|
column,
|
|
3383
|
-
rule: RULE$
|
|
3367
|
+
rule: RULE$66,
|
|
3384
3368
|
message: MESSAGE$18
|
|
3385
3369
|
};
|
|
3386
3370
|
}))
|
|
@@ -3389,13 +3373,11 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, english, {
|
|
|
3389
3373
|
/** @internal */
|
|
3390
3374
|
const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPublishedReadme(root) {
|
|
3391
3375
|
const projects = yield* publishedProjects(root);
|
|
3392
|
-
const
|
|
3393
|
-
const english = isPublicRegistry(publishRegistry);
|
|
3394
|
-
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, english, project), { concurrency: READ_CONCURRENCY$26 });
|
|
3376
|
+
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$26 });
|
|
3395
3377
|
return Array$1.getSomes(found);
|
|
3396
3378
|
});
|
|
3397
3379
|
// src/features/check-placement/model/published-tests.ts
|
|
3398
|
-
const RULE$
|
|
3380
|
+
const RULE$65 = "published-tests";
|
|
3399
3381
|
const FILE_START = 1;
|
|
3400
3382
|
const TEST_FILE$3 = /\.test\.[cm]?[jt]sx?$/u;
|
|
3401
3383
|
const MESSAGE$17 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
|
|
@@ -3409,7 +3391,7 @@ const problemFor$7 = Effect.fn("problemFor")(function* problemFor(root, listed,
|
|
|
3409
3391
|
file: files.join(absolute, PACKAGE_JSON_FILE),
|
|
3410
3392
|
line: FILE_START,
|
|
3411
3393
|
column: FILE_START,
|
|
3412
|
-
rule: RULE$
|
|
3394
|
+
rule: RULE$65,
|
|
3413
3395
|
message: MESSAGE$17
|
|
3414
3396
|
});
|
|
3415
3397
|
});
|
|
@@ -3423,13 +3405,13 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
|
|
|
3423
3405
|
return Array$1.getSomes(found);
|
|
3424
3406
|
});
|
|
3425
3407
|
// src/features/check-placement/model/root-docs.ts
|
|
3426
|
-
const RULE$
|
|
3427
|
-
const SEPARATOR$
|
|
3408
|
+
const RULE$64 = "root-docs";
|
|
3409
|
+
const SEPARATOR$20 = "/";
|
|
3428
3410
|
const FIRST$19 = 1;
|
|
3429
3411
|
const MARKDOWN$5 = /\.(?:md|mdx|markdown)$/iu;
|
|
3430
3412
|
const ALLOWED = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
|
|
3431
3413
|
const MESSAGE$16 = "is a hand-written document outside the places documents belong. Hand-written text goes only in the root README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md and DESIGN.md, and under docs/. Move what is still true and not already told by the code into one of them, and delete this file.";
|
|
3432
|
-
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$
|
|
3414
|
+
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$20)(name) && MARKDOWN$5.test(name) && !ALLOWED.test(name);
|
|
3433
3415
|
/** @internal */
|
|
3434
3416
|
const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
3435
3417
|
const files = yield* RepositoryFiles;
|
|
@@ -3438,16 +3420,15 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
3438
3420
|
file: files.join(root, name),
|
|
3439
3421
|
line: FIRST$19,
|
|
3440
3422
|
column: FIRST$19,
|
|
3441
|
-
rule: RULE$
|
|
3423
|
+
rule: RULE$64,
|
|
3442
3424
|
message: `${name} ${MESSAGE$16}`
|
|
3443
3425
|
})));
|
|
3444
3426
|
});
|
|
3445
3427
|
// src/features/check-placement/model/root-readme.ts
|
|
3446
|
-
const RULE$
|
|
3428
|
+
const RULE$63 = "root-readme";
|
|
3447
3429
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
3448
3430
|
const READ_CONCURRENCY$25 = 16;
|
|
3449
|
-
const START$
|
|
3450
|
-
const CHECK_POLICY = "@r_masseater/msch";
|
|
3431
|
+
const START$29 = 0;
|
|
3451
3432
|
const MARKETPLACE = ".claude-plugin/marketplace.json";
|
|
3452
3433
|
const RELATIVE$2 = /^\.\//u;
|
|
3453
3434
|
const MarketplacePlugin = Schema.Struct({
|
|
@@ -3459,8 +3440,8 @@ const NO_PLUGINS = {
|
|
|
3459
3440
|
directories: [],
|
|
3460
3441
|
names: []
|
|
3461
3442
|
};
|
|
3462
|
-
const isCheckPolicy = ({ packageName }) => Option.contains(packageName,
|
|
3463
|
-
const messageFor$
|
|
3443
|
+
const isCheckPolicy = ({ packageName }) => Option.contains(packageName, SELF_NAME);
|
|
3444
|
+
const messageFor$3 = (directory) => `names the workspace ${directory}. The root README, AGENTS.md and CLAUDE.md describe the repository as a whole. Write what belongs to the workspace in ${directory}/README.md, or for agents in ${directory}/AGENTS.md.`;
|
|
3464
3445
|
const pluginsOf = (plugins) => {
|
|
3465
3446
|
const directories = pipe(plugins, Array$1.map(({ source }) => source), Array$1.filter(Predicate.isString), Array$1.map(String$1.replace(RELATIVE$2, "")));
|
|
3466
3447
|
const segments = pipe(directories, Array$1.map(baseName));
|
|
@@ -3484,10 +3465,10 @@ const patternFor = (plugins) => ({ directory, names }) => patternOf$1(Option.mat
|
|
|
3484
3465
|
onSome: () => [directory]
|
|
3485
3466
|
}));
|
|
3486
3467
|
const problemsIn$22 = (file, source, plugins) => (workspace) => {
|
|
3487
|
-
const message = messageFor$
|
|
3468
|
+
const message = messageFor$3(workspace.directory);
|
|
3488
3469
|
const at = positionOf(source);
|
|
3489
3470
|
const pattern = patternFor(plugins)(workspace);
|
|
3490
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$
|
|
3471
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$63)(file, at(found.index ?? START$29), message)));
|
|
3491
3472
|
};
|
|
3492
3473
|
const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
|
|
3493
3474
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
@@ -3524,7 +3505,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
3524
3505
|
return Array$1.flatten(found);
|
|
3525
3506
|
});
|
|
3526
3507
|
// src/features/check-placement/model/docs-mirror.ts
|
|
3527
|
-
const RULE$
|
|
3508
|
+
const RULE$62 = "docs-mirror";
|
|
3528
3509
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
3529
3510
|
const MIRROR_LIMIT = 3;
|
|
3530
3511
|
const READ_CONCURRENCY$24 = 16;
|
|
@@ -3549,7 +3530,7 @@ const problemFor$6 = (file, source, mentions) => pipe(Array$1.head(mentions), Op
|
|
|
3549
3530
|
file,
|
|
3550
3531
|
line,
|
|
3551
3532
|
column,
|
|
3552
|
-
rule: RULE$
|
|
3533
|
+
rule: RULE$62,
|
|
3553
3534
|
message: `names ${String(mentions.length)} other workspaces (${describe(mentions)}). The workspace list and each package.json already declare them, so this copy goes stale. Point at the declaration instead of listing it.`
|
|
3554
3535
|
};
|
|
3555
3536
|
}), Option.toArray);
|
|
@@ -3581,7 +3562,7 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
3581
3562
|
return Array$1.flatten(found);
|
|
3582
3563
|
});
|
|
3583
3564
|
// src/features/check-placement/model/ignored-sources.ts
|
|
3584
|
-
const RULE$
|
|
3565
|
+
const RULE$61 = "ignored-sources";
|
|
3585
3566
|
const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
|
|
3586
3567
|
const FIRST$18 = 1;
|
|
3587
3568
|
const MESSAGE$15 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
|
|
@@ -3593,7 +3574,7 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
|
|
|
3593
3574
|
file: files.join(root, file),
|
|
3594
3575
|
line: FIRST$18,
|
|
3595
3576
|
column: FIRST$18,
|
|
3596
|
-
rule: RULE$
|
|
3577
|
+
rule: RULE$61,
|
|
3597
3578
|
message: MESSAGE$15
|
|
3598
3579
|
})));
|
|
3599
3580
|
});
|
|
@@ -12140,7 +12121,7 @@ var english_verbs_default = [
|
|
|
12140
12121
|
const SLICE_RULE$1 = "feature-slice-name";
|
|
12141
12122
|
const ENTRY_RULE$2 = "deploy-entry-name";
|
|
12142
12123
|
const SEGMENT_RULE = "slice-segment-name";
|
|
12143
|
-
const SEPARATOR$
|
|
12124
|
+
const SEPARATOR$18 = "/";
|
|
12144
12125
|
const NEXT$3 = 1;
|
|
12145
12126
|
const WORD_SEPARATOR$1 = "-";
|
|
12146
12127
|
const MINIMUM_WORDS = 2;
|
|
@@ -12166,7 +12147,7 @@ const isVerbObjectBy = (separator) => (slice) => {
|
|
|
12166
12147
|
return words.length >= MINIMUM_WORDS && Option.exists(Array$1.head(words), (word) => VERBS.has(word));
|
|
12167
12148
|
};
|
|
12168
12149
|
const isVerbObject = isVerbObjectBy(WORD_SEPARATOR$1);
|
|
12169
|
-
const misnamedSlice$1 = ({ workspace, inner }) => pipe(Option.liftPredicate(inner, (path) => String$1.startsWith(FEATURES$1)(path) && SCRIPT$1.test(path)), Option.flatMap((path) => Array$1.head(String$1.split(String$1.slice(13)(path), SEPARATOR$
|
|
12150
|
+
const misnamedSlice$1 = ({ workspace, inner }) => pipe(Option.liftPredicate(inner, (path) => String$1.startsWith(FEATURES$1)(path) && SCRIPT$1.test(path)), Option.flatMap((path) => Array$1.head(String$1.split(String$1.slice(13)(path), SEPARATOR$18))), Option.filter((slice) => !isVerbObject(slice)), Option.map((slice) => `${workspace}${SEPARATOR$18}${FEATURES$1}${slice}`));
|
|
12170
12151
|
const SLICE_LAYERS = [
|
|
12171
12152
|
"features",
|
|
12172
12153
|
"entities",
|
|
@@ -12174,26 +12155,26 @@ const SLICE_LAYERS = [
|
|
|
12174
12155
|
"pages"
|
|
12175
12156
|
];
|
|
12176
12157
|
const SLICE_DEPTHS = [3, 4];
|
|
12177
|
-
const pathPrefix = (parts, depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$
|
|
12158
|
+
const pathPrefix = (parts, depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$18);
|
|
12178
12159
|
const isInSliceLayer = (parts) => {
|
|
12179
12160
|
const [source, layer] = parts;
|
|
12180
|
-
return `${source}${SEPARATOR$
|
|
12161
|
+
return `${source}${SEPARATOR$18}` === SOURCE && Array$1.contains(SLICE_LAYERS, layer ?? "");
|
|
12181
12162
|
};
|
|
12182
12163
|
const indexedSlice = (owned) => {
|
|
12183
|
-
const parts = String$1.split(owned.inner, SEPARATOR$
|
|
12164
|
+
const parts = String$1.split(owned.inner, SEPARATOR$18);
|
|
12184
12165
|
const depth = parts.length - NEXT$3;
|
|
12185
|
-
return pipe(Option.liftPredicate(depth, () => isInSliceLayer(parts) && INDEX.test(owned.inner) && Array$1.contains(SLICE_DEPTHS, depth)), Option.map(() => `${owned.workspace}${SEPARATOR$
|
|
12166
|
+
return pipe(Option.liftPredicate(depth, () => isInSliceLayer(parts) && INDEX.test(owned.inner) && Array$1.contains(SLICE_DEPTHS, depth)), Option.map(() => `${owned.workspace}${SEPARATOR$18}${pathPrefix(parts, depth)}`));
|
|
12186
12167
|
};
|
|
12187
12168
|
const misnamedSegment = (slices) => ({ workspace, inner }) => {
|
|
12188
|
-
const parts = String$1.split(inner, SEPARATOR$
|
|
12189
|
-
const insideSlice = (depth) => slices.has(`${workspace}${SEPARATOR$
|
|
12169
|
+
const parts = String$1.split(inner, SEPARATOR$18);
|
|
12170
|
+
const insideSlice = (depth) => slices.has(`${workspace}${SEPARATOR$18}${pathPrefix(parts, depth)}`);
|
|
12190
12171
|
const isSegmentFolder = (depth) => parts.length > depth + NEXT$3 && SCRIPT$1.test(inner) && !SEGMENTS.has(parts[depth] ?? "");
|
|
12191
|
-
return pipe(SLICE_DEPTHS, Array$1.findFirst(insideSlice), Option.filter(isSegmentFolder), Option.map((depth) => `${workspace}${SEPARATOR$
|
|
12172
|
+
return pipe(SLICE_DEPTHS, Array$1.findFirst(insideSlice), Option.filter(isSegmentFolder), Option.map((depth) => `${workspace}${SEPARATOR$18}${pathPrefix(parts, depth + NEXT$3)}`));
|
|
12192
12173
|
};
|
|
12193
12174
|
const deployNamed = ({ workspace, inner }) => {
|
|
12194
12175
|
if (!String$1.startsWith(SOURCE)(inner)) return Option.none();
|
|
12195
|
-
const segments = String$1.split(inner, SEPARATOR$
|
|
12196
|
-
return pipe(Array$1.findFirstIndex(segments, (segment) => DEPLOY_MARKER.test(segment)), Option.map((index) => `${workspace}${SEPARATOR$
|
|
12176
|
+
const segments = String$1.split(inner, SEPARATOR$18);
|
|
12177
|
+
return pipe(Array$1.findFirstIndex(segments, (segment) => DEPLOY_MARKER.test(segment)), Option.map((index) => `${workspace}${SEPARATOR$18}${Array$1.join(Array$1.take(segments, index + NEXT$3), SEPARATOR$18)}`));
|
|
12197
12178
|
};
|
|
12198
12179
|
/** @internal */
|
|
12199
12180
|
const checkSourceNames = Effect.fn("checkSourceNames")(function* checkSourceNames(root) {
|
|
@@ -12316,13 +12297,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
12316
12297
|
return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
|
|
12317
12298
|
});
|
|
12318
12299
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
12319
|
-
const RULE$
|
|
12300
|
+
const RULE$60 = "shadcn-ui-alias";
|
|
12320
12301
|
const FIRST$17 = 1;
|
|
12321
12302
|
const problemOf$10 = (directory, { file, alias }) => ({
|
|
12322
12303
|
file,
|
|
12323
12304
|
line: FIRST$17,
|
|
12324
12305
|
column: FIRST$17,
|
|
12325
|
-
rule: RULE$
|
|
12306
|
+
rule: RULE$60,
|
|
12326
12307
|
message: `aliases.ui "${alias}" in ${directory}/components.json does not resolve to a directory through the imports of ${directory}/package.json. shadcn lint and msch then cannot tell which files are the design-system components. Point the alias at a "#/" import, such as "#/shared/ui", and map "#/*" to "./src/*".`
|
|
12327
12308
|
});
|
|
12328
12309
|
/** @internal */
|
|
@@ -12384,7 +12365,7 @@ const CODE_IN_BIN = "code-in-bin";
|
|
|
12384
12365
|
const BIN = "bin";
|
|
12385
12366
|
const SCRIPTS_DIRECTORY = "scripts";
|
|
12386
12367
|
const WORKFLOW_DIRECTORY$1 = ".github/";
|
|
12387
|
-
const SEPARATOR$
|
|
12368
|
+
const SEPARATOR$17 = "/";
|
|
12388
12369
|
const CURRENT = "./";
|
|
12389
12370
|
const READ_CONCURRENCY$22 = 8;
|
|
12390
12371
|
const FIRST$16 = 1;
|
|
@@ -12422,7 +12403,7 @@ const isCommand$1 = (path) => COMMAND$1.test(path) && !NOT_COMMAND.test(path);
|
|
|
12422
12403
|
const commandFilesIn = Effect.fn("commandFilesIn")(function* commandFilesIn(root, directory) {
|
|
12423
12404
|
const files = yield* RepositoryFiles;
|
|
12424
12405
|
const names = yield* files.readDirectory(files.join(root, directory, BIN));
|
|
12425
|
-
return pipe(names, Array$1.map((name) => `${BIN}${SEPARATOR$
|
|
12406
|
+
return pipe(names, Array$1.map((name) => `${BIN}${SEPARATOR$17}${name}`), Array$1.filter(isCommand$1));
|
|
12426
12407
|
});
|
|
12427
12408
|
const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
12428
12409
|
const files = yield* RepositoryFiles;
|
|
@@ -12431,7 +12412,7 @@ const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
|
12431
12412
|
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$22 });
|
|
12432
12413
|
return pipe(Array$1.getSomes(texts), Array$1.join("\n"));
|
|
12433
12414
|
});
|
|
12434
|
-
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$
|
|
12415
|
+
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$17));
|
|
12435
12416
|
const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array$1.filter(({ path }) => !COMMAND$1.test(path) && !Array$1.contains(entries.all, path)), Array$1.map(({ path, start }) => ({
|
|
12436
12417
|
file,
|
|
12437
12418
|
...positionOf(source)(start),
|
|
@@ -12478,8 +12459,8 @@ const isCommandFile = (path) => isCommand$1(path) || COMMAND_FILE.test(path) &&
|
|
|
12478
12459
|
const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProblems(root, directory) {
|
|
12479
12460
|
const files = yield* RepositoryFiles;
|
|
12480
12461
|
const listed = yield* files.listedFiles(root);
|
|
12481
|
-
const prefix = workspacePath(directory, `${BIN}${SEPARATOR$
|
|
12482
|
-
return pipe(listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.filter((file) => !isCommandFile(`${BIN}${SEPARATOR$
|
|
12462
|
+
const prefix = workspacePath(directory, `${BIN}${SEPARATOR$17}`);
|
|
12463
|
+
return pipe(listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.filter((file) => !isCommandFile(`${BIN}${SEPARATOR$17}${String$1.slice(prefix.length)(file)}`)), Array$1.map((file) => ({
|
|
12483
12464
|
file: files.join(root, file),
|
|
12484
12465
|
line: FIRST$16,
|
|
12485
12466
|
column: FIRST$16,
|
|
@@ -12501,14 +12482,14 @@ const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkComm
|
|
|
12501
12482
|
];
|
|
12502
12483
|
});
|
|
12503
12484
|
// src/features/check-repository-layout/model/path-mention.ts
|
|
12504
|
-
const START$
|
|
12485
|
+
const START$28 = 0;
|
|
12505
12486
|
const QUOTES = ["\"", "'"];
|
|
12506
12487
|
const firstIndex = (source, needles) => {
|
|
12507
12488
|
const found = pipe(needles, Array$1.flatMap((needle) => Option.toArray(String$1.indexOf(needle)(source))));
|
|
12508
12489
|
return Array$1.head(Array$1.sort(found, Order.Number));
|
|
12509
12490
|
};
|
|
12510
12491
|
const quoted = (text) => pipe(QUOTES, Array$1.map((quote) => `${quote}${text}${quote}`));
|
|
12511
|
-
const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$
|
|
12492
|
+
const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$28));
|
|
12512
12493
|
// src/features/check-repository-layout/model/cargo-paths.ts
|
|
12513
12494
|
const MEMBER_LISTS = [
|
|
12514
12495
|
"members",
|
|
@@ -12524,14 +12505,14 @@ const WORKSPACE = "workspace";
|
|
|
12524
12505
|
const PATCH = "patch";
|
|
12525
12506
|
const PATCH_DEPTH = 2;
|
|
12526
12507
|
const WORKSPACE_DEPTH = 1;
|
|
12527
|
-
const START$
|
|
12508
|
+
const START$27 = 0;
|
|
12528
12509
|
const WILDCARD$4 = /[*?[]/u;
|
|
12529
12510
|
const KEY_SEPARATOR = ".";
|
|
12530
12511
|
const decodeTable = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.Unknown));
|
|
12531
12512
|
const decodeStrings = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
12532
12513
|
const decodePath = Schema.decodeUnknownOption(Schema.Struct({ path: Schema.String }));
|
|
12533
|
-
const declaresPath = (trail) => pipe(Array$1.last(trail), Option.exists((name) => Array$1.contains(DEPENDENCY_TABLES, name))) || trail.length === PATCH_DEPTH && Array$1.get(trail, START$
|
|
12534
|
-
const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array$1.get(trail, START$
|
|
12514
|
+
const declaresPath = (trail) => pipe(Array$1.last(trail), Option.exists((name) => Array$1.contains(DEPENDENCY_TABLES, name))) || trail.length === PATCH_DEPTH && Array$1.get(trail, START$27).pipe(Option.exists((name) => name === PATCH));
|
|
12515
|
+
const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array$1.get(trail, START$27).pipe(Option.exists((name) => name === WORKSPACE)) && Array$1.contains(MEMBER_LISTS, key);
|
|
12535
12516
|
const namedPaths = (trail, key, value) => {
|
|
12536
12517
|
const field = Array$1.join([...trail, key], KEY_SEPARATOR);
|
|
12537
12518
|
if (listsMembers(trail, key)) return pipe(decodeStrings(value), Option.getOrElse(() => []), Array$1.filter((member) => !WILDCARD$4.test(member)), Array$1.map((member) => ({
|
|
@@ -12554,7 +12535,7 @@ const cargoMentions = (source) => pipe(Option.liftThrowable(() => getStaticTOMLV
|
|
|
12554
12535
|
})));
|
|
12555
12536
|
// src/features/check-repository-layout/model/path-existence.ts
|
|
12556
12537
|
const WILDCARD$3 = /[*?[]/u;
|
|
12557
|
-
const SEPARATOR$
|
|
12538
|
+
const SEPARATOR$16 = "/";
|
|
12558
12539
|
const FIRST$15 = 0;
|
|
12559
12540
|
/** @internal */
|
|
12560
12541
|
const existsAt = Effect.fn("existsAt")(function* existsAt(root, path) {
|
|
@@ -12570,20 +12551,20 @@ const isDirectoryAt = Effect.fn("isDirectoryAt")(function* isDirectoryAt(root, p
|
|
|
12570
12551
|
/** @internal */
|
|
12571
12552
|
const staticPrefix = (path) => {
|
|
12572
12553
|
const prefix = Array$1.headNonEmpty(String$1.split(path, WILDCARD$3));
|
|
12573
|
-
if (String$1.endsWith(SEPARATOR$
|
|
12554
|
+
if (String$1.endsWith(SEPARATOR$16)(prefix)) return String$1.slice(FIRST$15, -1)(prefix);
|
|
12574
12555
|
return prefix;
|
|
12575
12556
|
};
|
|
12576
12557
|
/** @internal */
|
|
12577
12558
|
const isIgnored = Effect.fn("isIgnored")(function* isIgnored(root, path) {
|
|
12578
12559
|
const prefix = staticPrefix(path);
|
|
12579
12560
|
if (String$1.isEmpty(prefix)) return false;
|
|
12580
|
-
const ignored = yield* (yield* RepositoryFiles).ignoredPaths(root, [prefix, `${prefix}${SEPARATOR$
|
|
12561
|
+
const ignored = yield* (yield* RepositoryFiles).ignoredPaths(root, [prefix, `${prefix}${SEPARATOR$16}`]);
|
|
12581
12562
|
return Array$1.isReadonlyArrayNonEmpty(ignored);
|
|
12582
12563
|
});
|
|
12583
12564
|
// src/features/check-repository-layout/model/tsconfig-paths.ts
|
|
12584
12565
|
const WRAP_OFFSET$2 = 1;
|
|
12585
12566
|
const WILDCARD$2 = /[*?[{]/u;
|
|
12586
|
-
const SEPARATOR$
|
|
12567
|
+
const SEPARATOR$15 = "/";
|
|
12587
12568
|
const RELATIVE$1 = ".";
|
|
12588
12569
|
const JSON_EXTENSION = ".json";
|
|
12589
12570
|
const isObject = (node) => Predicate.isReadonlyObject(node) && node["type"] === "ObjectExpression";
|
|
@@ -12591,7 +12572,7 @@ const firstObject = (node) => {
|
|
|
12591
12572
|
if (isObject(node)) return Option.some(node);
|
|
12592
12573
|
return pipe(childrenOf$2(node), Array$1.findFirst(firstObject));
|
|
12593
12574
|
};
|
|
12594
|
-
const leadingDirectory = (pattern) => pipe(String$1.split(pattern, SEPARATOR$
|
|
12575
|
+
const leadingDirectory = (pattern) => pipe(String$1.split(pattern, SEPARATOR$15), Array$1.takeWhile((segment) => !WILDCARD$2.test(segment)), Array$1.join(SEPARATOR$15));
|
|
12595
12576
|
const listed$2 = (root) => (name, candidatesOf, valuesOf = stringsIn) => pipe(propertyValue(name)(root), Option.toArray, Array$1.flatMap(valuesOf), Array$1.map(({ text, start }) => ({
|
|
12596
12577
|
field: name,
|
|
12597
12578
|
text,
|
|
@@ -12618,7 +12599,7 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
|
|
|
12618
12599
|
])));
|
|
12619
12600
|
});
|
|
12620
12601
|
// src/features/check-repository-layout/model/config-paths.ts
|
|
12621
|
-
const RULE$
|
|
12602
|
+
const RULE$59 = "config-path";
|
|
12622
12603
|
const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
|
|
12623
12604
|
const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
|
|
12624
12605
|
const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
|
|
@@ -12637,7 +12618,7 @@ const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
|
|
|
12637
12618
|
const problemOf$9 = (file, source) => (mention) => ({
|
|
12638
12619
|
file,
|
|
12639
12620
|
...positionOf(source)(mention.index),
|
|
12640
|
-
rule: RULE$
|
|
12621
|
+
rule: RULE$59,
|
|
12641
12622
|
message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
|
|
12642
12623
|
});
|
|
12643
12624
|
const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
|
|
@@ -12662,7 +12643,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
12662
12643
|
return pipe(patterns, Array$1.map((pattern) => ({
|
|
12663
12644
|
file,
|
|
12664
12645
|
...positionOf(source.value)(indexOfText(source.value)(pattern)),
|
|
12665
|
-
rule: RULE$
|
|
12646
|
+
rule: RULE$59,
|
|
12666
12647
|
message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
|
|
12667
12648
|
})));
|
|
12668
12649
|
});
|
|
@@ -12674,32 +12655,32 @@ const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPath
|
|
|
12674
12655
|
return [...Array$1.flatten(found), ...patterns];
|
|
12675
12656
|
});
|
|
12676
12657
|
// src/features/check-repository-layout/model/crates.ts
|
|
12677
|
-
const RULE$
|
|
12658
|
+
const RULE$58 = "unverified-crate";
|
|
12678
12659
|
const VERSION_RULE = "release-version";
|
|
12679
12660
|
const APP_DIRECTORIES = ["", "src-tauri"];
|
|
12680
12661
|
const CARGO_FILE$1 = "Cargo.toml";
|
|
12681
|
-
const CONFIG_FILE$
|
|
12682
|
-
const SEPARATOR$
|
|
12662
|
+
const CONFIG_FILE$7 = "vite.config.ts";
|
|
12663
|
+
const SEPARATOR$14 = "/";
|
|
12683
12664
|
const FIRST$14 = 1;
|
|
12684
12665
|
const READ_CONCURRENCY$20 = 8;
|
|
12685
12666
|
const problemFor$5 = (crate, message) => ({
|
|
12686
12667
|
file: crate.manifest,
|
|
12687
12668
|
line: FIRST$14,
|
|
12688
12669
|
column: FIRST$14,
|
|
12689
|
-
rule: RULE$
|
|
12670
|
+
rule: RULE$58,
|
|
12690
12671
|
message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
|
|
12691
12672
|
});
|
|
12692
12673
|
const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
|
|
12693
12674
|
const files = yield* RepositoryFiles;
|
|
12694
12675
|
const workspace = owningWorkspace(directories)(files.relative(root, files.dirname(crate.manifest)));
|
|
12695
12676
|
if (Option.isNone(workspace)) return Option.some(problemFor$5(crate, "is outside every workspace package"));
|
|
12696
|
-
if (yield* hasVerifyTask(files.join(root, workspace.value, CONFIG_FILE$
|
|
12697
|
-
return Option.some(problemFor$5(crate, `is in ${workspace.value}, whose ${CONFIG_FILE$
|
|
12677
|
+
if (yield* hasVerifyTask(files.join(root, workspace.value, CONFIG_FILE$7))) return Option.none();
|
|
12678
|
+
return Option.some(problemFor$5(crate, `is in ${workspace.value}, whose ${CONFIG_FILE$7} has no verify task`));
|
|
12698
12679
|
});
|
|
12699
12680
|
const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemIn(root, directories, crate) {
|
|
12700
12681
|
const files = yield* RepositoryFiles;
|
|
12701
12682
|
const directory = files.relative(root, files.dirname(crate.manifest));
|
|
12702
|
-
const workspace = pipe(directories, Array$1.findFirst((candidate) => pipe(APP_DIRECTORIES, Array$1.map((inner) => pipe([candidate, inner], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$
|
|
12683
|
+
const workspace = pipe(directories, Array$1.findFirst((candidate) => pipe(APP_DIRECTORIES, Array$1.map((inner) => pipe([candidate, inner], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$14))), Array$1.contains(directory))));
|
|
12703
12684
|
if (Option.isNone(workspace)) return Option.none();
|
|
12704
12685
|
const text = yield* files.readFile(files.join(root, workspace.value, PACKAGE_JSON_FILE));
|
|
12705
12686
|
const version = pipe(text, Option.flatMap(decodePackageJson), Option.flatMap(({ version: own }) => Option.fromUndefinedOr(own)));
|
|
@@ -12722,7 +12703,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
12722
12703
|
return Array$1.getSomes(Array$1.flatten(found));
|
|
12723
12704
|
});
|
|
12724
12705
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
12725
|
-
const RULE$
|
|
12706
|
+
const RULE$57 = "deploy-entry-pattern";
|
|
12726
12707
|
const FALLOW_KEYS = [
|
|
12727
12708
|
"entry",
|
|
12728
12709
|
"entryPoints",
|
|
@@ -12793,7 +12774,7 @@ const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(request) {
|
|
|
12793
12774
|
return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
|
|
12794
12775
|
file: path,
|
|
12795
12776
|
...positionOf(text.value)(start - kind.offset),
|
|
12796
|
-
rule: RULE$
|
|
12777
|
+
rule: RULE$57,
|
|
12797
12778
|
message: `${pattern} ${MESSAGE$14}`
|
|
12798
12779
|
})));
|
|
12799
12780
|
});
|
|
@@ -12826,7 +12807,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
12826
12807
|
return Array$1.flatten(found);
|
|
12827
12808
|
});
|
|
12828
12809
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
12829
|
-
const RULE$
|
|
12810
|
+
const RULE$56 = "listed-entry";
|
|
12830
12811
|
const ENTRY_KEYS = [
|
|
12831
12812
|
"entry",
|
|
12832
12813
|
"entryPoints",
|
|
@@ -12834,7 +12815,7 @@ const ENTRY_KEYS = [
|
|
|
12834
12815
|
];
|
|
12835
12816
|
const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?|\.fallow\/plugins\/[^/]+\.jsonc?)$/u;
|
|
12836
12817
|
const WILDCARD$1 = /[*?{[]/u;
|
|
12837
|
-
const SEPARATOR$
|
|
12818
|
+
const SEPARATOR$13 = "/";
|
|
12838
12819
|
const WRAP_OFFSET = 1;
|
|
12839
12820
|
const READ_CONCURRENCY$18 = 8;
|
|
12840
12821
|
const decodeKey = Schema.decodeUnknownOption(KeySchema);
|
|
@@ -12846,7 +12827,7 @@ const entryPatternsIn = (node) => {
|
|
|
12846
12827
|
})));
|
|
12847
12828
|
return pipe(childrenOf$2(node), Array$1.flatMap(entryPatternsIn));
|
|
12848
12829
|
};
|
|
12849
|
-
const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$
|
|
12830
|
+
const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$13}`)(text))) || String$1.includes(SEPARATOR$13)(text) && !WILDCARD$1.test(text);
|
|
12850
12831
|
const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
|
|
12851
12832
|
const files = yield* RepositoryFiles;
|
|
12852
12833
|
const path = files.join(root, file);
|
|
@@ -12856,7 +12837,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
12856
12837
|
return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
|
|
12857
12838
|
file: path,
|
|
12858
12839
|
...positionOf(text.value)(start),
|
|
12859
|
-
rule: RULE$
|
|
12840
|
+
rule: RULE$56,
|
|
12860
12841
|
message: `${pattern} names files one by one. Let fallow find the file through what declares it: package.json bin and exports, a tool's config file, or the main of the Alchemy resource that deploys it.`
|
|
12861
12842
|
})));
|
|
12862
12843
|
});
|
|
@@ -12868,8 +12849,8 @@ const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallow
|
|
|
12868
12849
|
return Array$1.flatten(found);
|
|
12869
12850
|
});
|
|
12870
12851
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
12871
|
-
const RULE$
|
|
12872
|
-
const CONFIG_FILE$
|
|
12852
|
+
const RULE$55 = "root-workspace-path";
|
|
12853
|
+
const CONFIG_FILE$6 = "vite.config.ts";
|
|
12873
12854
|
const PATH_CHARACTER = /[\w.@/-]/u;
|
|
12874
12855
|
const NAME_CHARACTER = /[\w.@-]/u;
|
|
12875
12856
|
const FIRST$13 = 0;
|
|
@@ -12887,13 +12868,13 @@ const mentions = (directory) => (text) => {
|
|
|
12887
12868
|
const problemsIn$17 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
|
|
12888
12869
|
file,
|
|
12889
12870
|
...positionOf(source)(found.start),
|
|
12890
|
-
rule: RULE$
|
|
12891
|
-
message: `${directory} is a workspace. The root ${CONFIG_FILE$
|
|
12871
|
+
rule: RULE$55,
|
|
12872
|
+
message: `${directory} is a workspace. The root ${CONFIG_FILE$6} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$6}: msch.lint, msch.devDependencies or its verify task.`
|
|
12892
12873
|
})));
|
|
12893
12874
|
/** @internal */
|
|
12894
12875
|
const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* checkRootWorkspacePaths(root) {
|
|
12895
12876
|
const files = yield* RepositoryFiles;
|
|
12896
|
-
const file = files.join(root, CONFIG_FILE$
|
|
12877
|
+
const file = files.join(root, CONFIG_FILE$6);
|
|
12897
12878
|
const source = yield* files.readFile(file);
|
|
12898
12879
|
if (Option.isNone(source)) return [];
|
|
12899
12880
|
const directories = yield* workspaceDirectories(root);
|
|
@@ -12901,8 +12882,8 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
12901
12882
|
return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$17(file, source.value, directories)));
|
|
12902
12883
|
});
|
|
12903
12884
|
// src/features/check-repository-layout/model/hidden-verify.ts
|
|
12904
|
-
const RULE$
|
|
12905
|
-
const CONFIG_FILE$
|
|
12885
|
+
const RULE$54 = "hidden-verify";
|
|
12886
|
+
const CONFIG_FILE$5 = "vite.config.ts";
|
|
12906
12887
|
const FIRST$12 = 1;
|
|
12907
12888
|
const READ_CONCURRENCY$17 = 8;
|
|
12908
12889
|
const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
|
|
@@ -12915,8 +12896,8 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
12915
12896
|
file,
|
|
12916
12897
|
line: FIRST$12,
|
|
12917
12898
|
column: FIRST$12,
|
|
12918
|
-
rule: RULE$
|
|
12919
|
-
message: `${directory} gets its verify task from code outside ${CONFIG_FILE$
|
|
12899
|
+
rule: RULE$54,
|
|
12900
|
+
message: `${directory} gets its verify task from code outside ${CONFIG_FILE$5}. The root verify reads ${CONFIG_FILE$5} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$5}.`
|
|
12920
12901
|
}).pipe(Option.filter(() => verified));
|
|
12921
12902
|
});
|
|
12922
12903
|
/** @internal */
|
|
@@ -12926,7 +12907,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
|
|
|
12926
12907
|
return Array$1.getSomes(found);
|
|
12927
12908
|
});
|
|
12928
12909
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
12929
|
-
const RULE$
|
|
12910
|
+
const RULE$53 = "shared-uncached-task";
|
|
12930
12911
|
const READ_CONCURRENCY$16 = 8;
|
|
12931
12912
|
const SHARED = 2;
|
|
12932
12913
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
@@ -12969,7 +12950,7 @@ const problemsOf$3 = (definitions) => {
|
|
|
12969
12950
|
return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
|
|
12970
12951
|
file,
|
|
12971
12952
|
...position,
|
|
12972
|
-
rule: RULE$
|
|
12953
|
+
rule: RULE$53,
|
|
12973
12954
|
message: `The uncached task ${name} (${command}) is written the same way in ${Array$1.join(directories, ", ")}. Write it once in a shared helper and spread it into each run.tasks, so that a change to it reaches every workspace.`
|
|
12974
12955
|
})));
|
|
12975
12956
|
};
|
|
@@ -12980,7 +12961,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
|
|
|
12980
12961
|
return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
|
|
12981
12962
|
});
|
|
12982
12963
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
12983
|
-
const RULE$
|
|
12964
|
+
const RULE$52 = "unlocked-task";
|
|
12984
12965
|
const READ_CONCURRENCY$15 = 8;
|
|
12985
12966
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
12986
12967
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
@@ -12992,7 +12973,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
|
|
|
12992
12973
|
const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
|
|
12993
12974
|
file,
|
|
12994
12975
|
...positionOf(source)(task.start),
|
|
12995
|
-
rule: RULE$
|
|
12976
|
+
rule: RULE$52,
|
|
12996
12977
|
message: `The task ${keyName(task.key)} runs ${command} with inputs written by hand. It then reruns after every lockfile change, and it does not rerun when a dependency of a dependency moves. Set cache to LOCKED from @r_masseater/msch/locked-inputs.`
|
|
12997
12978
|
})), Option.toArray)));
|
|
12998
12979
|
/** @internal */
|
|
@@ -13047,7 +13028,7 @@ const scalarsIn = (source) => {
|
|
|
13047
13028
|
const ROOT$2 = ".";
|
|
13048
13029
|
const LOCAL$1 = "./";
|
|
13049
13030
|
const NEGATION = "!";
|
|
13050
|
-
const SEPARATOR$
|
|
13031
|
+
const SEPARATOR$12 = "/";
|
|
13051
13032
|
const LINE$1 = "\n";
|
|
13052
13033
|
const UNRESOLVED_MARKERS = [
|
|
13053
13034
|
"${{",
|
|
@@ -13074,7 +13055,7 @@ const withoutLocal = (path) => {
|
|
|
13074
13055
|
const joinPath = (base, path) => {
|
|
13075
13056
|
const relative = withoutLocal(String$1.trim(path));
|
|
13076
13057
|
if (base === ROOT$2) return relative;
|
|
13077
|
-
return `${base}${SEPARATOR$
|
|
13058
|
+
return `${base}${SEPARATOR$12}${relative}`;
|
|
13078
13059
|
};
|
|
13079
13060
|
const reference = (kind, field, base = ROOT$2) => ({ text, offset }) => {
|
|
13080
13061
|
const path = String$1.trim(text);
|
|
@@ -13147,11 +13128,11 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
|
|
|
13147
13128
|
/** @internal */
|
|
13148
13129
|
const producedPaths = (source) => pipe(jobsOf(source), Array$1.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array$1.flatMap(outputPathsOf));
|
|
13149
13130
|
// src/features/check-repository-layout/model/workflow-paths.ts
|
|
13150
|
-
const RULE$
|
|
13131
|
+
const RULE$51 = "workflow-path";
|
|
13151
13132
|
const WORKFLOW_DIRECTORY = ".github/workflows/";
|
|
13152
13133
|
const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
|
|
13153
13134
|
const READ_CONCURRENCY$14 = 8;
|
|
13154
|
-
const SEPARATOR$
|
|
13135
|
+
const SEPARATOR$11 = "/";
|
|
13155
13136
|
const EXPECTED = {
|
|
13156
13137
|
action: "a directory with action.yml",
|
|
13157
13138
|
directory: "a directory",
|
|
@@ -13166,10 +13147,10 @@ const matchesAny = Effect.fn("matchesAny")(function* matchesAny(root, pathspecs)
|
|
|
13166
13147
|
});
|
|
13167
13148
|
const matchesGlob = (root, path) => matchesAny(root, [`:(glob)${path}`]);
|
|
13168
13149
|
const hasAction = Effect.fn("hasAction")(function* hasAction(root, path) {
|
|
13169
|
-
const found = yield* Effect.forEach(ACTION_DEFINITIONS, (name) => existsAt(root, `${path}${SEPARATOR$
|
|
13150
|
+
const found = yield* Effect.forEach(ACTION_DEFINITIONS, (name) => existsAt(root, `${path}${SEPARATOR$11}${name}`), { concurrency: 1 });
|
|
13170
13151
|
return pipe(found, Array$1.some(Boolean));
|
|
13171
13152
|
});
|
|
13172
|
-
const suffixAt = (segments) => (index) => `:(glob)**/${pipe(segments, Array$1.drop(index), Array$1.join(SEPARATOR$
|
|
13153
|
+
const suffixAt = (segments) => (index) => `:(glob)**/${pipe(segments, Array$1.drop(index), Array$1.join(SEPARATOR$11))}`;
|
|
13173
13154
|
const RESOLVERS = {
|
|
13174
13155
|
action: hasAction,
|
|
13175
13156
|
directory: isDirectoryAt,
|
|
@@ -13177,11 +13158,11 @@ const RESOLVERS = {
|
|
|
13177
13158
|
glob: matchesGlob,
|
|
13178
13159
|
script: Effect.fn("findsScript")(function* findsScript(root, path) {
|
|
13179
13160
|
if (yield* existsAt(root, path)) return true;
|
|
13180
|
-
const segments = String$1.split(path, SEPARATOR$
|
|
13161
|
+
const segments = String$1.split(path, SEPARATOR$11);
|
|
13181
13162
|
return yield* matchesAny(root, Array$1.makeBy(segments.length, suffixAt(segments)));
|
|
13182
13163
|
})
|
|
13183
13164
|
};
|
|
13184
|
-
const overlaps = (path) => (produced) => produced === path || String$1.startsWith(`${path}${SEPARATOR$
|
|
13165
|
+
const overlaps = (path) => (produced) => produced === path || String$1.startsWith(`${path}${SEPARATOR$11}`)(produced) || String$1.startsWith(`${produced}${SEPARATOR$11}`)(path);
|
|
13185
13166
|
const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, produced, found) {
|
|
13186
13167
|
const prefix = staticPrefix(found.path);
|
|
13187
13168
|
if (pipe(produced, Array$1.some(overlaps(prefix)))) return false;
|
|
@@ -13191,7 +13172,7 @@ const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, produced, f
|
|
|
13191
13172
|
const problemOf$8 = (file, source) => (found) => ({
|
|
13192
13173
|
file,
|
|
13193
13174
|
...positionOf(source)(found.offset),
|
|
13194
|
-
rule: RULE$
|
|
13175
|
+
rule: RULE$51,
|
|
13195
13176
|
message: `${found.field} names ${found.path}, which is not ${EXPECTED[found.kind]} in this repository. Point it at a path that exists or remove it.`
|
|
13196
13177
|
});
|
|
13197
13178
|
const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
|
|
@@ -13217,9 +13198,9 @@ const ACTION = /^\.github\/actions\/(?<name>[^/]+)\/action\.ya?ml$/u;
|
|
|
13217
13198
|
const FILTER_KEYS = ["paths", "paths-ignore"];
|
|
13218
13199
|
const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
|
|
13219
13200
|
const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
|
|
13220
|
-
const START$
|
|
13201
|
+
const START$26 = 0;
|
|
13221
13202
|
const READ_CONCURRENCY$13 = 8;
|
|
13222
|
-
const SEPARATOR$
|
|
13203
|
+
const SEPARATOR$10 = "/";
|
|
13223
13204
|
const WORD_SEPARATORS = /[-_]/gu;
|
|
13224
13205
|
const SPACE = " ";
|
|
13225
13206
|
const FILTER_MESSAGE = "A workflow that reacts to changes under listed paths needs a new entry for every package and drifts from the packages it is meant to cover. Run the generic pipeline on every push and let it decide from the workspace what changed.";
|
|
@@ -13242,13 +13223,13 @@ const pathFiltersIn = (file, source) => {
|
|
|
13242
13223
|
};
|
|
13243
13224
|
const matching = (workspaces, text) => pipe(workspaces, Array$1.findFirst(({ names }) => Array$1.isReadonlyArrayNonEmpty(names) && Option.isSome(String$1.match(patternOf$1(names))(text))), Option.map(({ directory }) => directory));
|
|
13244
13225
|
const named$1 = (workspaces, text) => Option.orElse(matching(workspaces, text), () => matching(workspaces, String$1.replaceAll(WORD_SEPARATORS, SPACE)(text)));
|
|
13245
|
-
const containing = (workspaces, path) => pipe(workspaces, Array$1.findFirst(({ directory }) => path === directory || String$1.startsWith(`${directory}${SEPARATOR$
|
|
13226
|
+
const containing = (workspaces, path) => pipe(workspaces, Array$1.findFirst(({ directory }) => path === directory || String$1.startsWith(`${directory}${SEPARATOR$10}`)(path)), Option.map(({ directory }) => directory));
|
|
13246
13227
|
const namesIn$2 = (name, source) => {
|
|
13247
13228
|
const root = parseDocument(source).contents;
|
|
13248
13229
|
return [
|
|
13249
13230
|
{
|
|
13250
13231
|
text: name,
|
|
13251
|
-
offset: START$
|
|
13232
|
+
offset: START$26
|
|
13252
13233
|
},
|
|
13253
13234
|
...Option.toArray(stringOf(childOf("name")(root))),
|
|
13254
13235
|
...keysOf(childOf("jobs")(root))
|
|
@@ -13319,14 +13300,14 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
|
|
|
13319
13300
|
});
|
|
13320
13301
|
// src/shared/lib/package-name.ts
|
|
13321
13302
|
const SCOPE$1 = "@";
|
|
13322
|
-
const SEPARATOR$
|
|
13303
|
+
const SEPARATOR$9 = "/";
|
|
13323
13304
|
const SCOPED_SEGMENTS = 2;
|
|
13324
13305
|
const PLAIN_SEGMENTS = 1;
|
|
13325
13306
|
const segmentCount = (specifier) => {
|
|
13326
13307
|
if (String$1.startsWith(SCOPE$1)(specifier)) return SCOPED_SEGMENTS;
|
|
13327
13308
|
return PLAIN_SEGMENTS;
|
|
13328
13309
|
};
|
|
13329
|
-
const packageNameOf = (specifier) => pipe(String$1.split(specifier, SEPARATOR$
|
|
13310
|
+
const packageNameOf = (specifier) => pipe(String$1.split(specifier, SEPARATOR$9), Array$1.take(segmentCount(specifier)), Array$1.join(SEPARATOR$9));
|
|
13330
13311
|
// src/features/measure-install-size/model/import-graph.ts
|
|
13331
13312
|
const RELATIVE = /^\.\.?(?:\/|$)/u;
|
|
13332
13313
|
const SUBPATH_IMPORT$1 = "#";
|
|
@@ -13483,11 +13464,11 @@ const LISTED_LARGEST = 5;
|
|
|
13483
13464
|
const SIZE_CONCURRENCY = 32;
|
|
13484
13465
|
const MEGABYTE = 1e6;
|
|
13485
13466
|
const MEGABYTE_DIGITS = 1;
|
|
13486
|
-
const START$
|
|
13467
|
+
const START$25 = 0;
|
|
13487
13468
|
const SINGLE_ENTRY = 1;
|
|
13488
13469
|
const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
|
|
13489
13470
|
const usageHint = (dependency, entryCount) => {
|
|
13490
|
-
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$
|
|
13471
|
+
if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$25 && dependency.entries.length < entryCount)) return "";
|
|
13491
13472
|
return ` (imported only from ${Array$1.join(dependency.entries, ", ")})`;
|
|
13492
13473
|
};
|
|
13493
13474
|
const listed$1 = ({ largest, entryCount }) => pipe(largest, Array$1.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array$1.join(", "));
|
|
@@ -13496,7 +13477,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
|
|
|
13496
13477
|
const { workspace, total } = overrun;
|
|
13497
13478
|
const config = yield* files.readFile(workspace.configFile);
|
|
13498
13479
|
const source = Option.getOrElse(config, () => "");
|
|
13499
|
-
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$
|
|
13480
|
+
const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$25);
|
|
13500
13481
|
return {
|
|
13501
13482
|
file: workspace.configFile,
|
|
13502
13483
|
...positionOf(source)(index),
|
|
@@ -13513,7 +13494,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
|
|
|
13513
13494
|
const everything = pipe(closures, Array$1.flatMap(([, packages]) => Array$1.fromIterable(packages)), HashSet.fromIterable);
|
|
13514
13495
|
const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
|
|
13515
13496
|
const sizes = HashMap.fromIterable(measured);
|
|
13516
|
-
const sizeOf = (packages) => packages.pipe(Array$1.fromIterable, Array$1.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$
|
|
13497
|
+
const sizeOf = (packages) => packages.pipe(Array$1.fromIterable, Array$1.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$25)), Number$1.sumAll);
|
|
13517
13498
|
return {
|
|
13518
13499
|
closures,
|
|
13519
13500
|
sizeOf,
|
|
@@ -13546,11 +13527,11 @@ const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published,
|
|
|
13546
13527
|
})];
|
|
13547
13528
|
});
|
|
13548
13529
|
const stackProblems = (file, source, dependencies) => {
|
|
13549
|
-
const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$
|
|
13530
|
+
const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$25);
|
|
13550
13531
|
const rest = String$1.slice(section)(source);
|
|
13551
13532
|
return pipe(Record.toEntries(dependencies), Array$1.filter(([, specifier]) => specifier === STACK_CATALOG), Array$1.map(([name]) => ({
|
|
13552
13533
|
file,
|
|
13553
|
-
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$
|
|
13534
|
+
...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$25)),
|
|
13554
13535
|
rule: STACK_DEPENDENCY,
|
|
13555
13536
|
message: `${name} comes from the stack catalog, so every project that installs this package already has it. Move it to peerDependencies and keep it in devDependencies, so the installing project shares one copy.`
|
|
13556
13537
|
})));
|
|
@@ -13573,7 +13554,7 @@ const problemsOf$1 = Effect.fn("problemsOf")(function* problemsOf(workspace, fil
|
|
|
13573
13554
|
}, Record.keys(dependencies));
|
|
13574
13555
|
return [...stackProblems(file, source, dependencies), ...sized];
|
|
13575
13556
|
});
|
|
13576
|
-
const workspaceProblems$
|
|
13557
|
+
const workspaceProblems$2 = Effect.fn("workspaceProblems")(function* workspaceProblems(workspace) {
|
|
13577
13558
|
const files = yield* RepositoryFiles;
|
|
13578
13559
|
const file = files.join(workspace.directory, PACKAGE_JSON_FILE);
|
|
13579
13560
|
const source = yield* files.readFile(file);
|
|
@@ -13585,11 +13566,11 @@ const workspaceProblems$1 = Effect.fn("workspaceProblems")(function* workspacePr
|
|
|
13585
13566
|
/** @internal */
|
|
13586
13567
|
const checkPublishedPackages = Effect.fn("checkPublishedPackages")(function* checkPublishedPackages(root) {
|
|
13587
13568
|
const workspaces = yield* publishedWorkspaces(root);
|
|
13588
|
-
const found = yield* Effect.forEach(workspaces, workspaceProblems$
|
|
13569
|
+
const found = yield* Effect.forEach(workspaces, workspaceProblems$2, { concurrency: 1 });
|
|
13589
13570
|
return Array$1.flatten(found);
|
|
13590
13571
|
});
|
|
13591
13572
|
// src/features/check-migration-order/model/migration-order.ts
|
|
13592
|
-
const RULE$
|
|
13573
|
+
const RULE$50 = "migration-order";
|
|
13593
13574
|
const SNAPSHOT = "snapshot.json";
|
|
13594
13575
|
const MIGRATION = "migration.sql";
|
|
13595
13576
|
const SNAPSHOTS = [`*/${SNAPSHOT}`];
|
|
@@ -13623,7 +13604,7 @@ const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migration
|
|
|
13623
13604
|
file: join(root, file),
|
|
13624
13605
|
line: FIRST$11,
|
|
13625
13606
|
column: FIRST$11,
|
|
13626
|
-
rule: RULE$
|
|
13607
|
+
rule: RULE$50,
|
|
13627
13608
|
message: `${folder} is new, but it sorts before ${latest.folder}, which ${base} already has. A database that has applied ${latest.folder} rejects an earlier migration, so delete ${folder} and generate it again after ${latest.folder}.`
|
|
13628
13609
|
})))), Option.getOrElse(() => []));
|
|
13629
13610
|
/** @internal */
|
|
@@ -13674,7 +13655,7 @@ const unresolvedFrom = (entries) => Effect.acquireUseRelease(Effect.tryPromise({
|
|
|
13674
13655
|
catch: bundleErrorDetail
|
|
13675
13656
|
}), (bundle) => Effect.promise(() => bundle.close())).pipe(Effect.map(({ output }) => unresolvedIn(pipe(output, Array$1.filter(isChunk$1)))));
|
|
13676
13657
|
// src/features/check-plugin-dependencies/model/plugin-dependencies.ts
|
|
13677
|
-
const RULE$
|
|
13658
|
+
const RULE$49 = "plugin-dependencies";
|
|
13678
13659
|
const PLUGIN_FILE$2 = ".claude-plugin/plugin.json";
|
|
13679
13660
|
const LOCK_FILE = "bun.lock";
|
|
13680
13661
|
const SOURCE_FILE = /\.[cm]?[jt]sx?$/u;
|
|
@@ -13683,7 +13664,7 @@ const SUCCESS$1 = 0;
|
|
|
13683
13664
|
const NOT_STARTED = -1;
|
|
13684
13665
|
const DETAIL_LINES = 3;
|
|
13685
13666
|
const PLUGIN_CONCURRENCY = 2;
|
|
13686
|
-
const problemFor$4 = problemInFile(RULE$
|
|
13667
|
+
const problemFor$4 = problemInFile(RULE$49);
|
|
13687
13668
|
const hasDependencies = Effect.fn("hasDependencies")(function* hasDependencies(directory) {
|
|
13688
13669
|
const files = yield* RepositoryFiles;
|
|
13689
13670
|
const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));
|
|
@@ -13886,24 +13867,24 @@ const bundleScopeOf = ({ manifest, workspace }) => ({
|
|
|
13886
13867
|
});
|
|
13887
13868
|
const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(devDependencies), Option.map(Record.filter((specifier) => specifier === STACK_CATALOG)), Option.map(Record.keys), Option.getOrElse(() => []));
|
|
13888
13869
|
// src/features/check-tree-shaking/model/optional-peers.ts
|
|
13889
|
-
const RULE$
|
|
13870
|
+
const RULE$48 = "optional-peer";
|
|
13890
13871
|
const REQUIRED_RULE = "required-peer";
|
|
13891
|
-
const START$
|
|
13872
|
+
const START$24 = 0;
|
|
13892
13873
|
const SINGLE$1 = 1;
|
|
13893
13874
|
const DEPENDENCIES_KEY = "\"dependencies\"";
|
|
13894
13875
|
const PEER_META_KEY = "\"peerDependenciesMeta\"";
|
|
13895
13876
|
const importsPackage = (name) => ({ packages }) => Array$1.contains(packages, name);
|
|
13896
|
-
const labelsOf = (importers) => pipe(importers, Array$1.map(({ entry }) => `\`${entry.label}\``), Array$1.dedupe, Array$1.join(", "));
|
|
13877
|
+
const labelsOf$1 = (importers) => pipe(importers, Array$1.map(({ entry }) => `\`${entry.label}\``), Array$1.dedupe, Array$1.join(", "));
|
|
13897
13878
|
const positionIn = (located, key, name) => {
|
|
13898
|
-
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$
|
|
13879
|
+
const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$24);
|
|
13899
13880
|
const rest = String$1.slice(section)(located.source);
|
|
13900
|
-
return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$
|
|
13881
|
+
return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$24));
|
|
13901
13882
|
};
|
|
13902
13883
|
const problemFor$3 = (located, name, importers) => ({
|
|
13903
13884
|
file: located.file,
|
|
13904
13885
|
...positionIn(located, DEPENDENCIES_KEY, name),
|
|
13905
|
-
rule: RULE$
|
|
13906
|
-
message: `${name} is imported only from ${labelsOf(importers)}, so installing the other entries must not require it. Move it to peerDependencies, mark it optional in peerDependenciesMeta and keep it in devDependencies.`
|
|
13886
|
+
rule: RULE$48,
|
|
13887
|
+
message: `${name} is imported only from ${labelsOf$1(importers)}, so installing the other entries must not require it. Move it to peerDependencies, mark it optional in peerDependenciesMeta and keep it in devDependencies.`
|
|
13907
13888
|
});
|
|
13908
13889
|
const requiredPeerAdvice = (fromStack) => {
|
|
13909
13890
|
if (fromStack) return "Make it a required peer by removing it from peerDependenciesMeta; it comes from the stack catalog, so every project that installs this package already has it.";
|
|
@@ -13917,7 +13898,7 @@ const optionalPeerProblems = ({ located, manifest, used }) => {
|
|
|
13917
13898
|
return pipe(Record.keys(manifest.dependencies ?? {}), Array$1.flatMap((name) => {
|
|
13918
13899
|
const importers = pipe(libraries, Array$1.filter(importsPackage(name)));
|
|
13919
13900
|
const neededByBin = pipe(bins, Array$1.some(importsPackage(name)));
|
|
13920
|
-
if (!(importers.length > START$
|
|
13901
|
+
if (!(importers.length > START$24 && importers.length < libraries.length) || neededByBin) return [];
|
|
13921
13902
|
return [problemFor$3(located, name, importers)];
|
|
13922
13903
|
}));
|
|
13923
13904
|
};
|
|
@@ -13933,14 +13914,14 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
|
|
|
13933
13914
|
file: located.file,
|
|
13934
13915
|
...positionIn(located, PEER_META_KEY, name),
|
|
13935
13916
|
rule: REQUIRED_RULE,
|
|
13936
|
-
message: `${name} is an optional peer, but ${labelsOf(importers)} import it at startup, so installing the package without it breaks them. ${requiredPeerAdvice(Array$1.contains(stack, name))}`
|
|
13917
|
+
message: `${name} is an optional peer, but ${labelsOf$1(importers)} import it at startup, so installing the package without it breaks them. ${requiredPeerAdvice(Array$1.contains(stack, name))}`
|
|
13937
13918
|
}];
|
|
13938
13919
|
}));
|
|
13939
13920
|
};
|
|
13940
13921
|
// src/features/check-tree-shaking/model/side-effects.ts
|
|
13941
|
-
const RULE$
|
|
13922
|
+
const RULE$47 = "side-effects";
|
|
13942
13923
|
const BUNDLE_CONCURRENCY$2 = 4;
|
|
13943
|
-
const START$
|
|
13924
|
+
const START$23 = 0;
|
|
13944
13925
|
const FIRST$10 = 1;
|
|
13945
13926
|
const LISTED_PACKAGES = 4;
|
|
13946
13927
|
const SIDE_EFFECTS_KEY = "\"sideEffects\"";
|
|
@@ -13964,7 +13945,7 @@ const memberExcess = Effect.fn("memberExcess")(function* memberExcess({ scope, e
|
|
|
13964
13945
|
label: entry.label,
|
|
13965
13946
|
member,
|
|
13966
13947
|
...extra
|
|
13967
|
-
}, ({ modules }) => modules > START$
|
|
13948
|
+
}, ({ modules }) => modules > START$23);
|
|
13968
13949
|
});
|
|
13969
13950
|
const excessOf = Effect.fn("excessOf")(function* excessOf(subject) {
|
|
13970
13951
|
const names = yield* exportNamesOf(subject.scope, subject.entry.source);
|
|
@@ -13986,15 +13967,15 @@ const othersOf = (total) => {
|
|
|
13986
13967
|
};
|
|
13987
13968
|
const messageOf$4 = (worst, total) => `importing \`${worst.member}\` from \`${worst.label}\` also bundles ${String(worst.modules)} modules${importsOf(worst.packages)}, which it does not use.${othersOf(total)} Declare "sideEffects": false in package.json so that a bundler drops what nothing imports, and keep a module that must run for its effect out of the package.`;
|
|
13988
13969
|
const largest = Order.mapInput(Order.flip(Order.Number), (excess) => excess.modules);
|
|
13989
|
-
const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$
|
|
13970
|
+
const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$23));
|
|
13990
13971
|
const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
|
|
13991
13972
|
file,
|
|
13992
13973
|
...positionOf(source)(keyIndex$1(source)),
|
|
13993
|
-
rule: RULE$
|
|
13974
|
+
rule: RULE$47,
|
|
13994
13975
|
message: messageOf$4(worst, excesses.length)
|
|
13995
13976
|
})), Option.toArray);
|
|
13996
13977
|
// src/features/check-tree-shaking/model/top-level-effects.ts
|
|
13997
|
-
const RULE$
|
|
13978
|
+
const RULE$46 = "top-level-effect";
|
|
13998
13979
|
const CODE$1 = /\.[cm]?[jt]sx?$/u;
|
|
13999
13980
|
const READ_CONCURRENCY$11 = 16;
|
|
14000
13981
|
const IMPORT_MESSAGE = "imports a module only for its effect, but sideEffects in package.json does not list this file, so a bundler drops the import. Import what the module exports, or list the entry that exists for its effect in sideEffects.";
|
|
@@ -14010,7 +13991,7 @@ const messageOf$3 = (statement) => {
|
|
|
14010
13991
|
const problemsIn$15 = (api) => (file) => (source) => {
|
|
14011
13992
|
const retained = api.createSourceFile(file, source);
|
|
14012
13993
|
const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$7({
|
|
14013
|
-
rule: RULE$
|
|
13994
|
+
rule: RULE$46,
|
|
14014
13995
|
message: messageOf$3(statement)
|
|
14015
13996
|
})(statement)));
|
|
14016
13997
|
retained.dispose();
|
|
@@ -14027,7 +14008,7 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
|
|
|
14027
14008
|
return Array$1.flatten(found);
|
|
14028
14009
|
}, Effect.scoped);
|
|
14029
14010
|
const BUNDLED_RULE = "bundled-side-effects";
|
|
14030
|
-
const START$
|
|
14011
|
+
const START$22 = 0;
|
|
14031
14012
|
const NAME_KEY$2 = "\"name\"";
|
|
14032
14013
|
const packageDirectoryOf = (manifests, files) => (module) => {
|
|
14033
14014
|
const parent = files.dirname(module);
|
|
@@ -14044,7 +14025,7 @@ const undeclaredAt = Effect.fn("undeclaredAt")(function* undeclaredAt(directory)
|
|
|
14044
14025
|
})));
|
|
14045
14026
|
});
|
|
14046
14027
|
const undeclaredMessage = (files, root) => ({ directory, name }) => `bundles modules of \`${name}\`, whose package.json does not declare "sideEffects". A bundler reads that field from the package that owns each module, so it keeps every module that \`${name}\` re-exports, together with what those modules import, even when this package uses none of them. Declare "sideEffects": false in ${files.relative(root, files.join(directory, PACKAGE_JSON_FILE))}, and keep a module that must run for its effect out of that package.`;
|
|
14047
|
-
const nameIndex$1 = (source) => pipe(String$1.indexOf(NAME_KEY$2)(source), Option.getOrElse(() => START$
|
|
14028
|
+
const nameIndex$1 = (source) => pipe(String$1.indexOf(NAME_KEY$2)(source), Option.getOrElse(() => START$22));
|
|
14048
14029
|
/** @internal */
|
|
14049
14030
|
const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(function* bundledSideEffectProblems({ root, directory, located, used }) {
|
|
14050
14031
|
const files = yield* RepositoryFiles;
|
|
@@ -14157,7 +14138,7 @@ const analyse = Effect.fn("analyse")(function* analyse(pack) {
|
|
|
14157
14138
|
];
|
|
14158
14139
|
});
|
|
14159
14140
|
const bundleProblem$1 = (file, error) => [problemInFile(BUNDLE)(file, `does not bundle for the tree-shaking check. ${error.detail}`)];
|
|
14160
|
-
const workspaceProblems = Effect.fn("workspaceProblems")(function* workspaceProblems(root, workspace) {
|
|
14141
|
+
const workspaceProblems$1 = Effect.fn("workspaceProblems")(function* workspaceProblems(root, workspace) {
|
|
14161
14142
|
const found = yield* locatedManifest(workspace);
|
|
14162
14143
|
if (Option.isNone(found)) return [];
|
|
14163
14144
|
const { file, source, manifest } = found.value;
|
|
@@ -14174,11 +14155,11 @@ const workspaceProblems = Effect.fn("workspaceProblems")(function* workspaceProb
|
|
|
14174
14155
|
/** @internal */
|
|
14175
14156
|
const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShaking(root) {
|
|
14176
14157
|
const workspaces = yield* packedWorkspaces(root);
|
|
14177
|
-
const found = yield* Effect.forEach(workspaces, (workspace) => workspaceProblems(root, workspace), { concurrency: 1 });
|
|
14158
|
+
const found = yield* Effect.forEach(workspaces, (workspace) => workspaceProblems$1(root, workspace), { concurrency: 1 });
|
|
14178
14159
|
return Array$1.flatten(found);
|
|
14179
14160
|
});
|
|
14180
14161
|
// src/features/check-typescript-generation/model/typescript-generation.ts
|
|
14181
|
-
const RULE$
|
|
14162
|
+
const RULE$45 = "legacy-typescript";
|
|
14182
14163
|
const LOCKFILE = "pnpm-lock.yaml";
|
|
14183
14164
|
const COMPILER = "typescript";
|
|
14184
14165
|
const CURRENT_MAJOR = 7;
|
|
@@ -14209,12 +14190,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
|
|
|
14209
14190
|
file,
|
|
14210
14191
|
line: lineOf$2(source)(legacy.id),
|
|
14211
14192
|
column: FIRST$9,
|
|
14212
|
-
rule: RULE$
|
|
14193
|
+
rule: RULE$45,
|
|
14213
14194
|
message: messageOf$2(legacy, dependentsOf(Option.getOrElse(nodes, () => []))(legacy.id))
|
|
14214
14195
|
})));
|
|
14215
14196
|
});
|
|
14216
14197
|
// src/features/check-worker-bundles/model/worker-bundles.ts
|
|
14217
|
-
const RULE$
|
|
14198
|
+
const RULE$44 = "worker-bundle";
|
|
14218
14199
|
const BUNDLE_CONCURRENCY = 4;
|
|
14219
14200
|
const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
|
|
14220
14201
|
const CONDITIONS = [
|
|
@@ -14225,7 +14206,7 @@ const CONDITIONS = [
|
|
|
14225
14206
|
"module",
|
|
14226
14207
|
"default"
|
|
14227
14208
|
];
|
|
14228
|
-
const problemFor$2 = problemInFile(RULE$
|
|
14209
|
+
const problemFor$2 = problemInFile(RULE$44);
|
|
14229
14210
|
const problemOf$7 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
|
|
14230
14211
|
const bundleProblem = (file) => Effect.gen(function* bundle() {
|
|
14231
14212
|
const built = yield* Effect.tryPromise({
|
|
@@ -14347,7 +14328,7 @@ const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Ar
|
|
|
14347
14328
|
imports: importedFilesOf(checker)(sourceFile)
|
|
14348
14329
|
})), Array$1.filter((facts) => Array$1.isReadonlyArrayNonEmpty(facts.values) || Array$1.isReadonlyArrayNonEmpty(facts.imports)));
|
|
14349
14330
|
// src/features/check-value-owners/model/name-lists.ts
|
|
14350
|
-
const RULE$
|
|
14331
|
+
const RULE$43 = "hand-written-names";
|
|
14351
14332
|
const TEST_FILE$1 = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
|
|
14352
14333
|
const nameListOf = (site) => {
|
|
14353
14334
|
if (TEST_FILE$1.test(site.file) || site.values.length < 2) return Option.none();
|
|
@@ -14362,7 +14343,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
|
|
|
14362
14343
|
file,
|
|
14363
14344
|
line,
|
|
14364
14345
|
column,
|
|
14365
|
-
rule: RULE$
|
|
14346
|
+
rule: RULE$43,
|
|
14366
14347
|
message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
|
|
14367
14348
|
});
|
|
14368
14349
|
const problemOf$6 = ({ list, reason }) => listedProblem({
|
|
@@ -14968,7 +14949,7 @@ const declaredNameProblem = ({ literals, relative }) => {
|
|
|
14968
14949
|
const PATH_PREFIX = /^(?:!|\.\/)+/u;
|
|
14969
14950
|
const GLOB = /[*?{[]/u;
|
|
14970
14951
|
const EXTENSION$1 = /\.[^./]+$/u;
|
|
14971
|
-
const SEPARATOR$
|
|
14952
|
+
const SEPARATOR$8 = "/";
|
|
14972
14953
|
const ROOT$1 = ".";
|
|
14973
14954
|
const namedPath = (repository, file) => (name) => {
|
|
14974
14955
|
const bare = pipe(name, String$1.replace(PATH_PREFIX, ""));
|
|
@@ -14977,12 +14958,12 @@ const namedPath = (repository, file) => (name) => {
|
|
|
14977
14958
|
return pipe([fromFile, bare], Array$1.findFirst((path) => HashSet.has(repository.paths, path)));
|
|
14978
14959
|
};
|
|
14979
14960
|
const kindOf = (repository) => (path) => {
|
|
14980
|
-
if (HashSet.has(repository.directories, path)) return SEPARATOR$
|
|
14961
|
+
if (HashSet.has(repository.directories, path)) return SEPARATOR$8;
|
|
14981
14962
|
return pipe(path, String$1.match(EXTENSION$1), Option.flatMap(Array$1.head), Option.getOrElse(() => path));
|
|
14982
14963
|
};
|
|
14983
14964
|
const siblingsOf = (repository) => (path) => pipe(Record.get(repository.entries, repository.dirname(path)), Option.getOrElse(() => []), Array$1.filter((entry) => kindOf(repository)(entry) === kindOf(repository)(path)));
|
|
14984
14965
|
const coversDirectory = (repository) => (group) => pipe(Array$1.head(group), Option.exists((first) => group.length >= Math.max(2, siblingsOf(repository)(first).length - 1)));
|
|
14985
|
-
const enumeratedDirectory = (repository) => (paths) => pipe(paths, Array$1.groupBy((path) => `${repository.dirname(path)}${SEPARATOR$
|
|
14966
|
+
const enumeratedDirectory = (repository) => (paths) => pipe(paths, Array$1.groupBy((path) => `${repository.dirname(path)}${SEPARATOR$8}${kindOf(repository)(path)}`), Record.values, Array$1.findFirst(coversDirectory(repository)), Option.flatMap(Array$1.head), Option.map(repository.dirname));
|
|
14986
14967
|
const directoryLabel = (directory) => {
|
|
14987
14968
|
if (directory === ROOT$1) return "the repository root";
|
|
14988
14969
|
return directory;
|
|
@@ -15034,11 +15015,11 @@ const handWrittenNameProblems = ({ repository, literals }) => (sites) => {
|
|
|
15034
15015
|
return pipe(lists, Array$1.map((list) => Array$1.findFirst(checks, (check) => check(list))), Array$1.getSomes);
|
|
15035
15016
|
};
|
|
15036
15017
|
// src/features/check-value-owners/model/repository-names.ts
|
|
15037
|
-
const SEPARATOR$
|
|
15018
|
+
const SEPARATOR$7 = "/";
|
|
15038
15019
|
const FIRST_SEGMENT = 1;
|
|
15039
15020
|
const prefixesOf = (file) => {
|
|
15040
|
-
const segments = pipe(file, String$1.split(SEPARATOR$
|
|
15041
|
-
return pipe(Array$1.range(FIRST_SEGMENT, segments.length), Array$1.map((count) => pipe(Array$1.take(segments, count), Array$1.join(SEPARATOR$
|
|
15021
|
+
const segments = pipe(file, String$1.split(SEPARATOR$7));
|
|
15022
|
+
return pipe(Array$1.range(FIRST_SEGMENT, segments.length), Array$1.map((count) => pipe(Array$1.take(segments, count), Array$1.join(SEPARATOR$7))));
|
|
15042
15023
|
};
|
|
15043
15024
|
const directoriesOf$1 = (file) => pipe(prefixesOf(file), Array$1.dropRight(FIRST_SEGMENT));
|
|
15044
15025
|
const nameOf = (text) => pipe(text, Option.flatMap(decodePackageJson), Option.flatMap((parsed) => Option.fromUndefinedOr(parsed.name)));
|
|
@@ -15153,7 +15134,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
|
|
|
15153
15134
|
return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
|
|
15154
15135
|
}, Effect.scoped);
|
|
15155
15136
|
// src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
|
|
15156
|
-
const RULE$
|
|
15137
|
+
const RULE$42 = "namespace-destructuring";
|
|
15157
15138
|
const LOCAL = /^[.#/]/u;
|
|
15158
15139
|
const messageOf$1 = (name) => `Destructuring ${name}, which comes from a package, makes the bundler keep everything ${name} exports. Write ${name}.<member> where it is used.`;
|
|
15159
15140
|
const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
|
|
@@ -15169,7 +15150,7 @@ const destructuredName = (declaration) => {
|
|
|
15169
15150
|
return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
|
|
15170
15151
|
};
|
|
15171
15152
|
const problemOf$5 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$7({
|
|
15172
|
-
rule: RULE$
|
|
15153
|
+
rule: RULE$42,
|
|
15173
15154
|
message: messageOf$1(name)
|
|
15174
15155
|
})), Option.map((report) => report(declaration)));
|
|
15175
15156
|
const namespaceDestructuringIn = () => (sourceFile) => {
|
|
@@ -15177,7 +15158,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
|
|
|
15177
15158
|
return pipe(descendantsOf(sourceFile), Array$1.filter(isVariableDeclaration), Array$1.map(problemOf$5(names)), Array$1.getSomes);
|
|
15178
15159
|
};
|
|
15179
15160
|
// src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
|
|
15180
|
-
const RULE$
|
|
15161
|
+
const RULE$41 = "pass-through-wrapper";
|
|
15181
15162
|
const SINGLE_STATEMENT = 1;
|
|
15182
15163
|
const SINGLE_DECLARATION = 1;
|
|
15183
15164
|
const THIS_PARAMETER = "this";
|
|
@@ -15274,7 +15255,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
|
|
|
15274
15255
|
const problemOf$4 = (checker) => (candidate) => {
|
|
15275
15256
|
if (changesTheCall(candidate.wrapper)) return Option.none();
|
|
15276
15257
|
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$7({
|
|
15277
|
-
rule: RULE$
|
|
15258
|
+
rule: RULE$41,
|
|
15278
15259
|
message: messageOf(forward.callee.getText())
|
|
15279
15260
|
})(candidate.name)));
|
|
15280
15261
|
};
|
|
@@ -15282,9 +15263,24 @@ const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(so
|
|
|
15282
15263
|
// src/app/source-checks.ts
|
|
15283
15264
|
/** @internal */
|
|
15284
15265
|
const checkSources = (root) => checkRepository(root, [passThroughWrappersIn, namespaceDestructuringIn]);
|
|
15266
|
+
// src/shared/lib/repository-origin.ts
|
|
15267
|
+
const ORIGIN = /[:/](?<owner>[^/:]+)\/(?<name>[^/]+?)(?:\.git)?\/?$/u;
|
|
15268
|
+
/** @internal */
|
|
15269
|
+
const originOf = (url) => pipe(Option.fromNullishOr(ORIGIN.exec(url)), Option.flatMap(({ groups }) => Option.fromNullishOr(groups)), Option.flatMap(({ owner, name }) => Option.all({
|
|
15270
|
+
owner: Option.fromNullishOr(owner),
|
|
15271
|
+
name: Option.fromNullishOr(name)
|
|
15272
|
+
})));
|
|
15273
|
+
/** @internal */
|
|
15274
|
+
const repositoryOrigin = Effect.fn("repositoryOrigin")(function* repositoryOrigin(root) {
|
|
15275
|
+
const url = yield* (yield* RepositoryFiles).originUrl(root);
|
|
15276
|
+
return pipe(url, Option.flatMap(originOf));
|
|
15277
|
+
});
|
|
15278
|
+
/** @internal */
|
|
15279
|
+
const slugOf = ({ owner, name }) => `${owner}/${name}`;
|
|
15285
15280
|
// src/features/check-agent-settings/model/known-plugins.ts
|
|
15286
|
-
const RULE$
|
|
15281
|
+
const RULE$40 = "known-plugins";
|
|
15287
15282
|
const SETTINGS_FILE$2 = ".claude/settings.json";
|
|
15283
|
+
const MARKETPLACE_FILE$2 = ".claude-plugin/marketplace.json";
|
|
15288
15284
|
const GITHUB$2 = "github";
|
|
15289
15285
|
const Source$1 = Schema.Struct({
|
|
15290
15286
|
source: Schema.String,
|
|
@@ -15298,39 +15294,47 @@ const SettingsSchema$1 = Schema.Struct({
|
|
|
15298
15294
|
enabledPlugins: Schema.optionalKey(Plugins$1)
|
|
15299
15295
|
});
|
|
15300
15296
|
const decodeSettings$1 = Schema.decodeUnknownOption(Schema.fromJsonString(SettingsSchema$1));
|
|
15301
|
-
const
|
|
15302
|
-
|
|
15303
|
-
|
|
15297
|
+
const MarketplaceSchema = Schema.Struct({
|
|
15298
|
+
name: Schema.String,
|
|
15299
|
+
plugins: Schema.Array(Schema.Struct({ name: Schema.String }))
|
|
15300
|
+
});
|
|
15301
|
+
const decodeMarketplace = Schema.decodeUnknownOption(Schema.fromJsonString(MarketplaceSchema));
|
|
15302
|
+
const problem$5 = problemInFile(RULE$40);
|
|
15303
|
+
const knownFrom = (repository, marketplace, settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(marketplace.name)), Option.exists(({ source }) => source.source === GITHUB$2 && source.repo === repository));
|
|
15304
15304
|
const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
|
|
15305
|
-
const marketplaceProblems = (marketplace, file, settings) => {
|
|
15306
|
-
if (marketplaceKnown(marketplace, settings)) return [];
|
|
15307
|
-
return [problem$5(file, `Agents miss the owner's own tools when the ${marketplace.name} marketplace is not known. Add "extraKnownMarketplaces": { "${marketplace.name}": { "source": { "source": "${GITHUB$2}", "repo": "${marketplace.repository}" } } }.`)];
|
|
15308
|
-
};
|
|
15309
15305
|
const pluginProblems = (marketplace, file, settings) => {
|
|
15310
15306
|
const enabled = pluginEnabled(settings);
|
|
15311
|
-
return pipe(marketplace.plugins, Array$1.map((name) => `${name}@${marketplace.name}`), Array$1.filter((plugin) => !enabled(plugin)), Array$1.map((plugin) => problem$5(file, `
|
|
15307
|
+
return pipe(marketplace.plugins, Array$1.map(({ name }) => `${name}@${marketplace.name}`), Array$1.filter((plugin) => !enabled(plugin)), Array$1.map((plugin) => problem$5(file, `The settings know this repository's own ${marketplace.name} marketplace but leave "${plugin}" off. Enable it in "enabledPlugins" so every session here gets it.`)));
|
|
15312
15308
|
};
|
|
15313
15309
|
/** @internal */
|
|
15314
15310
|
const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlugins(root) {
|
|
15315
15311
|
const files = yield* RepositoryFiles;
|
|
15316
|
-
const
|
|
15312
|
+
const origin = yield* repositoryOrigin(root);
|
|
15313
|
+
const manifest = yield* files.readFile(files.join(root, MARKETPLACE_FILE$2));
|
|
15317
15314
|
const file = files.join(root, SETTINGS_FILE$2);
|
|
15318
15315
|
const text = yield* files.readFile(file);
|
|
15319
15316
|
const settings = pipe(text, Option.flatMap(decodeSettings$1), Option.getOrElse(() => ({})));
|
|
15320
|
-
|
|
15317
|
+
const marketplace = pipe(manifest, Option.flatMap(decodeMarketplace));
|
|
15318
|
+
return pipe(Option.all({
|
|
15319
|
+
origin,
|
|
15320
|
+
marketplace
|
|
15321
|
+
}), Option.filter(({ origin: found, marketplace: listed }) => knownFrom(slugOf(found), listed, settings)), Option.match({
|
|
15322
|
+
onNone: () => [],
|
|
15323
|
+
onSome: ({ marketplace: listed }) => pluginProblems(listed, file, settings)
|
|
15324
|
+
}));
|
|
15321
15325
|
});
|
|
15322
15326
|
// src/features/check-agent-settings/model/missing-hooks.ts
|
|
15323
|
-
const RULE$
|
|
15327
|
+
const RULE$39 = "missing-hook";
|
|
15324
15328
|
const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
|
|
15325
15329
|
const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
15326
15330
|
const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
15327
15331
|
const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
15328
15332
|
const PLUGIN_ROOT = "..";
|
|
15329
15333
|
const READ_CONCURRENCY$10 = 16;
|
|
15330
|
-
const START$
|
|
15334
|
+
const START$21 = 0;
|
|
15331
15335
|
const referenceOf$1 = (found) => pipe(groupOf("path")(found), Option.filter(() => Option.isNone(groupOf("optional")(found))), Option.map((path) => ({
|
|
15332
15336
|
path,
|
|
15333
|
-
index: found.index ?? START$
|
|
15337
|
+
index: found.index ?? START$21
|
|
15334
15338
|
})), Option.toArray);
|
|
15335
15339
|
const referencesIn = (pattern, source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.flatMap(referenceOf$1));
|
|
15336
15340
|
const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
|
|
@@ -15345,7 +15349,7 @@ const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
|
|
|
15345
15349
|
return pipe(missing, Array$1.map(({ path, index }) => ({
|
|
15346
15350
|
file,
|
|
15347
15351
|
...positionOf(source)(index),
|
|
15348
|
-
rule: RULE$
|
|
15352
|
+
rule: RULE$39,
|
|
15349
15353
|
message: `runs ${path}, which does not exist. The hook fails every time it fires. Point it at a file that exists or remove the hook.`
|
|
15350
15354
|
})));
|
|
15351
15355
|
});
|
|
@@ -15398,7 +15402,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
|
|
|
15398
15402
|
}, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
|
|
15399
15403
|
const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
|
|
15400
15404
|
// src/features/check-documented-commands/model/commands.ts
|
|
15401
|
-
const RULE$
|
|
15405
|
+
const RULE$38 = "documented-commands";
|
|
15402
15406
|
const DOCUMENTS = ["*AGENTS.md", "*CLAUDE.md"];
|
|
15403
15407
|
const DOCUMENT_NAMES = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
|
|
15404
15408
|
const COMMAND = /`vp run (?<args>[^`]+)`/gu;
|
|
@@ -15407,7 +15411,7 @@ const ARGS = "args";
|
|
|
15407
15411
|
const PLACEHOLDER = /[<>*{}$]/u;
|
|
15408
15412
|
const WHITESPACE = /\s+/u;
|
|
15409
15413
|
const ROOT = ".";
|
|
15410
|
-
const SEPARATOR$
|
|
15414
|
+
const SEPARATOR$6 = "/";
|
|
15411
15415
|
const END_OF_OPTIONS = "--";
|
|
15412
15416
|
const FLAG = "-";
|
|
15413
15417
|
const TASK_SEPARATOR$1 = "#";
|
|
@@ -15417,7 +15421,7 @@ const FILTER_ASSIGNMENT = "--filter=";
|
|
|
15417
15421
|
const RECURSIVE_FLAGS = /* @__PURE__ */ new Set(["-r", "--recursive"]);
|
|
15418
15422
|
const ROOT_FLAGS = /* @__PURE__ */ new Set(["-w", "--workspace-root"]);
|
|
15419
15423
|
const ONE$1 = 1;
|
|
15420
|
-
const START$
|
|
15424
|
+
const START$20 = 0;
|
|
15421
15425
|
const optionsOf = (args) => pipe(String$1.split(String$1.trim(args), WHITESPACE), Array$1.takeWhile((token) => token !== END_OF_OPTIONS));
|
|
15422
15426
|
const filterOf = (tokens) => pipe(tokens, Array$1.findFirstIndex((token) => FILTER_FLAGS.has(token)), Option.flatMap((index) => Array$1.get(tokens, index + ONE$1)), Option.orElse(() => pipe(tokens, Array$1.findFirst(String$1.startsWith(FILTER_ASSIGNMENT)), Option.map(String$1.slice(9)))));
|
|
15423
15427
|
const follows = (tokens) => (index) => pipe(Array$1.get(tokens, index - ONE$1), Option.exists((previous) => FILTER_FLAGS.has(previous)));
|
|
@@ -15454,8 +15458,8 @@ const parsed = (args) => {
|
|
|
15454
15458
|
return pipe(specifierOf(tokens), Option.filter(() => !pipe(tokens, Array$1.some((token) => PLACEHOLDER.test(token)))), Option.map(invocationOf(tokens)));
|
|
15455
15459
|
};
|
|
15456
15460
|
const ancestorsOf$1 = (file) => {
|
|
15457
|
-
const parts = pipe(String$1.split(file, SEPARATOR$
|
|
15458
|
-
return [...Array$1.makeBy(parts.length, (index) => pipe(parts, Array$1.take(parts.length - index), Array$1.join(SEPARATOR$
|
|
15461
|
+
const parts = pipe(String$1.split(file, SEPARATOR$6), Array$1.dropRight(ONE$1));
|
|
15462
|
+
return [...Array$1.makeBy(parts.length, (index) => pipe(parts, Array$1.take(parts.length - index), Array$1.join(SEPARATOR$6))), ROOT];
|
|
15459
15463
|
};
|
|
15460
15464
|
const named = (graph, name) => (directory) => directory === String$1.replace(LOCAL_PREFIX$1, "")(name) || pipe(Record.get(graph.packages, directory), Option.exists((found) => found.name === name));
|
|
15461
15465
|
const packagesOf = (graph, file) => (scope) => {
|
|
@@ -15475,11 +15479,11 @@ const whereOf = (scope, file) => {
|
|
|
15475
15479
|
const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph, file)(scope), Array$1.some(hasTask(graph, task)));
|
|
15476
15480
|
const problemsIn$13 = (graph, absolute, { file, text }) => pipe(Array$1.fromIterable(String$1.matchAll(COMMAND)(text)), Array$1.flatMap((match) => pipe(Option.fromNullishOr(match.groups), Option.flatMap(Record.get(ARGS)), Option.flatMap(parsed), Option.filter(isMissing(graph, file)), Option.map(({ task, scope }) => ({
|
|
15477
15481
|
file: absolute(file),
|
|
15478
|
-
...positionOf(text)(match.index ?? START$
|
|
15479
|
-
rule: RULE$
|
|
15480
|
-
message: `${match[START$
|
|
15482
|
+
...positionOf(text)(match.index ?? START$20),
|
|
15483
|
+
rule: RULE$38,
|
|
15484
|
+
message: `${match[START$20]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
|
|
15481
15485
|
})), Option.toArray)));
|
|
15482
|
-
const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$
|
|
15486
|
+
const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$6), Array$1.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
|
|
15483
15487
|
/** @internal */
|
|
15484
15488
|
const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* checkDocumentedCommands(root) {
|
|
15485
15489
|
const files = yield* RepositoryFiles;
|
|
@@ -15501,14 +15505,14 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
|
|
|
15501
15505
|
file: absolute(Array$1.headNonEmpty(commanded).file),
|
|
15502
15506
|
line: ONE$1,
|
|
15503
15507
|
column: ONE$1,
|
|
15504
|
-
rule: RULE$
|
|
15508
|
+
rule: RULE$38,
|
|
15505
15509
|
message: "msch could not list the tasks with `vp run --json`"
|
|
15506
15510
|
}],
|
|
15507
15511
|
onSome: (found) => pipe(commanded, Array$1.flatMap((document) => problemsIn$13(found, absolute, document)))
|
|
15508
15512
|
});
|
|
15509
15513
|
});
|
|
15510
15514
|
// src/features/check-legacy-web/model/legacy-web.ts
|
|
15511
|
-
const RULE$
|
|
15515
|
+
const RULE$37 = "legacy-web";
|
|
15512
15516
|
const FIRST_COLUMN$3 = 1;
|
|
15513
15517
|
const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
|
|
15514
15518
|
const Finding = Schema.Struct({
|
|
@@ -15547,7 +15551,7 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
|
|
|
15547
15551
|
file: files.join(root, file),
|
|
15548
15552
|
line,
|
|
15549
15553
|
column: FIRST_COLUMN$3,
|
|
15550
|
-
rule: RULE$
|
|
15554
|
+
rule: RULE$37,
|
|
15551
15555
|
message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
|
|
15552
15556
|
});
|
|
15553
15557
|
return pipe(scan.guides, Array$1.flatMap(({ guideId, rules }) => pipe(rules, Array$1.flatMap(({ ruleId, findings }) => pipe(findings, Array$1.map(problemOf(guideId, ruleId)))))));
|
|
@@ -15555,7 +15559,7 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
|
|
|
15555
15559
|
// src/shared/lib/section-check.ts
|
|
15556
15560
|
const taggedError$4 = Schema.TaggedError;
|
|
15557
15561
|
var SectionConfigUnreadable = class extends taggedError$4()("SectionConfigUnreadable", { file: Schema.String }) {};
|
|
15558
|
-
const CONFIG_FILE$
|
|
15562
|
+
const CONFIG_FILE$4 = "vite.config.ts";
|
|
15559
15563
|
const FIRST$8 = 1;
|
|
15560
15564
|
const ONE = 1;
|
|
15561
15565
|
const diagnostics = Metric.counter("lint.diagnostics", { description: "Diagnostics that each lint rule reported, before msch keeps only the errors" });
|
|
@@ -15577,7 +15581,7 @@ const sectionAt = (file, pick) => Effect.gen(function* readSection() {
|
|
|
15577
15581
|
});
|
|
15578
15582
|
const checkSection = (check) => (root) => Effect.gen(function* runSection() {
|
|
15579
15583
|
const files = yield* RepositoryFiles;
|
|
15580
|
-
const configFile = files.join(root, CONFIG_FILE$
|
|
15584
|
+
const configFile = files.join(root, CONFIG_FILE$4);
|
|
15581
15585
|
const section = yield* sectionAt(configFile, check.pick);
|
|
15582
15586
|
if (Option.isNone(section)) return [];
|
|
15583
15587
|
const config = section.value;
|
|
@@ -15618,7 +15622,7 @@ const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|
|
|
|
15618
15622
|
const EXTENSION = /\.[^./]+$/u;
|
|
15619
15623
|
const SETTINGS_FILE = ".claude/settings.json";
|
|
15620
15624
|
const READ_CONCURRENCY$9 = 64;
|
|
15621
|
-
const RULE$
|
|
15625
|
+
const RULE$36 = "shell-script";
|
|
15622
15626
|
const MESSAGE$13 = "is a shell script. Do the work in TypeScript as a Vite+ task in vite.config.ts, a test, or the tool's own hook, and delete this file. Only the SessionStart hook in .claude/settings.json, which installs the toolchain before TypeScript can run, stays a shell script.";
|
|
15623
15627
|
const HookSchema = Schema.Struct({
|
|
15624
15628
|
command: Schema.optional(Schema.String),
|
|
@@ -15651,7 +15655,7 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
|
|
|
15651
15655
|
};
|
|
15652
15656
|
const candidates = pipe(names, Array$1.filter((name) => !isSessionStartHook(name)));
|
|
15653
15657
|
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$9 });
|
|
15654
|
-
return pipe(shell, Array$1.map((name) => problemInFile(RULE$
|
|
15658
|
+
return pipe(shell, Array$1.map((name) => problemInFile(RULE$36)(files.join(root, name), MESSAGE$13)));
|
|
15655
15659
|
});
|
|
15656
15660
|
// src/shared/lib/workflow-files.ts
|
|
15657
15661
|
const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
|
|
@@ -15670,8 +15674,8 @@ const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
|
|
|
15670
15674
|
});
|
|
15671
15675
|
// src/shared/lib/workflow-run.ts
|
|
15672
15676
|
const RUN_KEY = "run";
|
|
15673
|
-
const START$
|
|
15674
|
-
const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$
|
|
15677
|
+
const START$19 = 0;
|
|
15678
|
+
const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$19));
|
|
15675
15679
|
const runScriptsOf = (source) => {
|
|
15676
15680
|
const found = [];
|
|
15677
15681
|
visit(parseDocument(source), { Pair: (_key, pair) => {
|
|
@@ -15686,7 +15690,7 @@ const runScriptsOf = (source) => {
|
|
|
15686
15690
|
const COMMAND_CHAIN = /&&|\|\||;|\|/u;
|
|
15687
15691
|
const QUOTED$1 = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
|
|
15688
15692
|
const COMMENT = "#";
|
|
15689
|
-
const RULE$
|
|
15693
|
+
const RULE$35 = "workflow-script";
|
|
15690
15694
|
const ONE_COMMAND = 1;
|
|
15691
15695
|
const MESSAGE$12 = "runs more than one command. Keep a step to one command, `vp run <task>` or `vp exec <bin>`, and put the logic in a Vite+ task in TypeScript.";
|
|
15692
15696
|
const isCommand = (line) => String$1.isNonEmpty(line) && !String$1.startsWith(COMMENT)(line);
|
|
@@ -15697,7 +15701,7 @@ const runsMoreThanOneCommand = ({ text }) => {
|
|
|
15697
15701
|
};
|
|
15698
15702
|
const problemsIn$12 = (file) => (source) => {
|
|
15699
15703
|
const at = positionOf(source);
|
|
15700
|
-
return pipe(runScriptsOf(source), Array$1.filter(runsMoreThanOneCommand), Array$1.map(({ start }) => problemAtPosition(RULE$
|
|
15704
|
+
return pipe(runScriptsOf(source), Array$1.filter(runsMoreThanOneCommand), Array$1.map(({ start }) => problemAtPosition(RULE$35)(file, at(start), MESSAGE$12)));
|
|
15701
15705
|
};
|
|
15702
15706
|
/** @internal */
|
|
15703
15707
|
const checkWorkflows = Effect.fn("checkWorkflows")(function* checkWorkflows(root) {
|
|
@@ -15722,12 +15726,12 @@ const checkStructure = checkSection({
|
|
|
15722
15726
|
// src/features/check-vite-plus/model/command-words.ts
|
|
15723
15727
|
const CONTINUATION = /\\\n/gu;
|
|
15724
15728
|
const QUOTED = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
|
|
15725
|
-
const SEPARATOR$
|
|
15729
|
+
const SEPARATOR$5 = /&&|\|\||[;|\n`]|\$\(/u;
|
|
15726
15730
|
const BLANK$1 = /\s+/u;
|
|
15727
15731
|
const ASSIGNMENT = /^[A-Za-z_][A-Za-z0-9_]*=/u;
|
|
15728
15732
|
const QUOTE = "\"\"";
|
|
15729
15733
|
const wordsOf = (segment) => pipe(String$1.split(String$1.trim(segment), BLANK$1), Array$1.filter(String$1.isNonEmpty), Array$1.dropWhile((word) => ASSIGNMENT.test(word)));
|
|
15730
|
-
const simpleCommands = (text) => pipe(text, String$1.replaceAll(CONTINUATION, " "), String$1.replaceAll(QUOTED, QUOTE), String$1.split(SEPARATOR$
|
|
15734
|
+
const simpleCommands = (text) => pipe(text, String$1.replaceAll(CONTINUATION, " "), String$1.replaceAll(QUOTED, QUOTE), String$1.split(SEPARATOR$5), Array$1.map(wordsOf), Array$1.filter(Array$1.isReadonlyArrayNonEmpty));
|
|
15731
15735
|
// src/features/check-vite-plus/model/command-problems.ts
|
|
15732
15736
|
const PACKAGE_MANAGERS = [
|
|
15733
15737
|
"pnpm",
|
|
@@ -15828,7 +15832,7 @@ const AGENT_DOCS = [
|
|
|
15828
15832
|
...EXCLUDED$4
|
|
15829
15833
|
];
|
|
15830
15834
|
const READ_CONCURRENCY$7 = 16;
|
|
15831
|
-
const START$
|
|
15835
|
+
const START$18 = 0;
|
|
15832
15836
|
const FIRST$7 = 1;
|
|
15833
15837
|
const LINE = "\n";
|
|
15834
15838
|
const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
|
|
@@ -15836,7 +15840,7 @@ const decodeCommandText = Schema.decodeUnknownOption(CommandText);
|
|
|
15836
15840
|
const decodeJson$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
|
|
15837
15841
|
const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
|
|
15838
15842
|
const NO_SOURCES = [];
|
|
15839
|
-
const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$
|
|
15843
|
+
const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$18));
|
|
15840
15844
|
const scriptSources = (file) => (source) => pipe(decodePackageJson(source), Option.flatMap(({ scripts }) => Option.fromUndefinedOr(scripts)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array$1.map(([name, text]) => {
|
|
15841
15845
|
const offset = offsetOf$2(source, `"${name}"`);
|
|
15842
15846
|
return {
|
|
@@ -15932,7 +15936,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
|
|
|
15932
15936
|
return Array$1.flatten(found);
|
|
15933
15937
|
});
|
|
15934
15938
|
// src/features/check-vite-plus/model/package-scripts.ts
|
|
15935
|
-
const RULE$
|
|
15939
|
+
const RULE$34 = "package-script";
|
|
15936
15940
|
const LIFECYCLE = [
|
|
15937
15941
|
"preinstall",
|
|
15938
15942
|
"install",
|
|
@@ -15955,12 +15959,12 @@ const LIFECYCLE = [
|
|
|
15955
15959
|
const problemOf$3 = ({ file, position, name }) => ({
|
|
15956
15960
|
file,
|
|
15957
15961
|
...position,
|
|
15958
|
-
rule: RULE$
|
|
15962
|
+
rule: RULE$34,
|
|
15959
15963
|
message: `The script ${name} is not a lifecycle script. package.json scripts hold only the scripts the package manager runs by itself, such as prepare and prepack. Write ${name} as a task in run.tasks of this package's vite.config.ts, where its shape is type-checked.`
|
|
15960
15964
|
});
|
|
15961
15965
|
const packageScriptProblems = (sources) => pipe(sources, Array$1.filter(({ kind, name }) => kind === "script" && !Array$1.contains(LIFECYCLE, name)), Array$1.map(problemOf$3));
|
|
15962
15966
|
// src/features/check-vite-plus/model/vite-plus-block.ts
|
|
15963
|
-
const RULE$
|
|
15967
|
+
const RULE$33 = "vite-plus-block";
|
|
15964
15968
|
const MARKER = Array$1.join([
|
|
15965
15969
|
"<!--",
|
|
15966
15970
|
"VITE PLUS START",
|
|
@@ -15973,7 +15977,7 @@ const problemIn = (file) => (source) => {
|
|
|
15973
15977
|
return Option.some({
|
|
15974
15978
|
file,
|
|
15975
15979
|
...positionOf(source)(index.value),
|
|
15976
|
-
rule: RULE$
|
|
15980
|
+
rule: RULE$33,
|
|
15977
15981
|
message: MESSAGE$11
|
|
15978
15982
|
});
|
|
15979
15983
|
};
|
|
@@ -16051,7 +16055,7 @@ const checkCiDrift = Effect.fn("checkCiDrift")(function* checkCiDrift(root) {
|
|
|
16051
16055
|
return pipe(drifts, Array$1.map(problemOf$2));
|
|
16052
16056
|
});
|
|
16053
16057
|
// src/features/check-workflows/model/publish-trigger.ts
|
|
16054
|
-
const RULE$
|
|
16058
|
+
const RULE$31 = "publish-trigger";
|
|
16055
16059
|
const PUBLISH = /\bmsch-publish\s+(?:plan|npm|release)\b/u;
|
|
16056
16060
|
const MANUAL = "workflow_dispatch";
|
|
16057
16061
|
const TRIGGER_KEY$1 = "on";
|
|
@@ -16065,18 +16069,18 @@ const publishTriggerOffsetsOf = (source) => {
|
|
|
16065
16069
|
};
|
|
16066
16070
|
/** @internal */
|
|
16067
16071
|
const checkPublishTrigger = workflowCheck({
|
|
16068
|
-
rule: RULE$
|
|
16072
|
+
rule: RULE$31,
|
|
16069
16073
|
message: MESSAGE$9,
|
|
16070
16074
|
offsetsOf: publishTriggerOffsetsOf
|
|
16071
16075
|
});
|
|
16072
16076
|
// src/features/check-workflows/model/release-please.ts
|
|
16073
|
-
const RULE$
|
|
16077
|
+
const RULE$30 = "release-please";
|
|
16074
16078
|
const RELEASE_PLEASE = /^googleapis\/release-please-action(?:@|$)/u;
|
|
16075
16079
|
const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
|
|
16076
16080
|
const FIRST$6 = 1;
|
|
16077
16081
|
const MESSAGE$8 = "releases with release-please. Releases are manual: bump the version in a PR, then run the publish workflow, which runs `msch-publish` for the workspace.";
|
|
16078
16082
|
const checkReleasePleaseSteps = workflowCheck({
|
|
16079
|
-
rule: RULE$
|
|
16083
|
+
rule: RULE$30,
|
|
16080
16084
|
message: MESSAGE$8,
|
|
16081
16085
|
offsetsOf: scalarKeyOffsets({
|
|
16082
16086
|
name: "uses",
|
|
@@ -16090,7 +16094,7 @@ const checkReleasePleaseFiles = Effect.fn("checkReleasePleaseFiles")(function* c
|
|
|
16090
16094
|
file: files.join(root, name),
|
|
16091
16095
|
line: FIRST$6,
|
|
16092
16096
|
column: FIRST$6,
|
|
16093
|
-
rule: RULE$
|
|
16097
|
+
rule: RULE$30,
|
|
16094
16098
|
message: MESSAGE$8
|
|
16095
16099
|
})));
|
|
16096
16100
|
});
|
|
@@ -16100,7 +16104,7 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
|
|
|
16100
16104
|
return Array$1.flatten(found);
|
|
16101
16105
|
});
|
|
16102
16106
|
// src/features/check-workflows/model/workflow-cancel.ts
|
|
16103
|
-
const RULE$
|
|
16107
|
+
const RULE$29 = "workflow-cancel";
|
|
16104
16108
|
const PUSH = "push";
|
|
16105
16109
|
const TRIGGER_KEY = "on";
|
|
16106
16110
|
const CONCURRENCY_KEY$1 = "concurrency";
|
|
@@ -16115,24 +16119,24 @@ const cancelOffsetsOf = (source) => {
|
|
|
16115
16119
|
};
|
|
16116
16120
|
/** @internal */
|
|
16117
16121
|
const checkWorkflowCancel = workflowCheck({
|
|
16118
|
-
rule: RULE$
|
|
16122
|
+
rule: RULE$29,
|
|
16119
16123
|
message: MESSAGE$7,
|
|
16120
16124
|
offsetsOf: cancelOffsetsOf
|
|
16121
16125
|
});
|
|
16122
16126
|
// src/features/check-workflows/model/workflow-queue.ts
|
|
16123
16127
|
const CONCURRENCY_KEY = "concurrency";
|
|
16124
16128
|
const QUEUE_KEY = "queue";
|
|
16125
|
-
const RULE$
|
|
16129
|
+
const RULE$28 = "workflow-queue";
|
|
16126
16130
|
const MESSAGE$6 = "queues runs with `queue`. A queued group runs every old push one by one, so a long run holds back the newest commit for hours. Drop `queue`: a job that later pushes redo gets `cancel-in-progress: true`, and a deploy or release job keeps the default, which lets the running one finish and replaces the waiting one with the newest run.";
|
|
16127
16131
|
const queueOffsetsOf = (source) => pipe(pairsNamed(CONCURRENCY_KEY)(source), Array$1.flatMap((pair) => Option.toArray(keyOffsetIn(QUEUE_KEY)(pair.value))));
|
|
16128
16132
|
/** @internal */
|
|
16129
16133
|
const checkWorkflowQueues = workflowCheck({
|
|
16130
|
-
rule: RULE$
|
|
16134
|
+
rule: RULE$28,
|
|
16131
16135
|
message: MESSAGE$6,
|
|
16132
16136
|
offsetsOf: queueOffsetsOf
|
|
16133
16137
|
});
|
|
16134
16138
|
// src/features/check-workflows/model/workflow-commits.ts
|
|
16135
|
-
const RULE$
|
|
16139
|
+
const RULE$27 = "workflow-commit";
|
|
16136
16140
|
const GIT_WRITE = /\bgit\s+(?:-{1,2}\S+\s+(?:\S+\s+)?)*(?:commit|push)\b/u;
|
|
16137
16141
|
const COMMIT_ACTION = /^[^@/]+\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;
|
|
16138
16142
|
const MESSAGE$5 = "commits or pushes from a workflow. A bot commit leaves generated files out of review and races the next push. Regenerate the files in a commit hook (for example `.vite-hooks/pre-commit`) so they land in the author's commit, and let CI only check that they are current.";
|
|
@@ -16140,7 +16144,7 @@ const offsetsWhere = (name, pattern) => (source) => pipe(pairsNamed(name)(source
|
|
|
16140
16144
|
const commitOffsetsOf = (source) => [...offsetsWhere("run", GIT_WRITE)(source), ...offsetsWhere("uses", COMMIT_ACTION)(source)];
|
|
16141
16145
|
/** @internal */
|
|
16142
16146
|
const checkWorkflowCommits = workflowCheck({
|
|
16143
|
-
rule: RULE$
|
|
16147
|
+
rule: RULE$27,
|
|
16144
16148
|
message: MESSAGE$5,
|
|
16145
16149
|
offsetsOf: commitOffsetsOf
|
|
16146
16150
|
});
|
|
@@ -16253,7 +16257,7 @@ const COMMENT_NODES = [
|
|
|
16253
16257
|
"block_comment",
|
|
16254
16258
|
"multiline_comment"
|
|
16255
16259
|
];
|
|
16256
|
-
const START$
|
|
16260
|
+
const START$17 = 0;
|
|
16257
16261
|
const NEXT = 1;
|
|
16258
16262
|
const NONE$1 = [];
|
|
16259
16263
|
const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
|
|
@@ -16303,7 +16307,7 @@ const markupComment = (source) => (node) => {
|
|
|
16303
16307
|
}];
|
|
16304
16308
|
};
|
|
16305
16309
|
const textComments = (grammars, grammar) => (text) => {
|
|
16306
|
-
const shift = shifted(text.startIndex ?? START$
|
|
16310
|
+
const shift = shifted(text.startIndex ?? START$17);
|
|
16307
16311
|
return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array$1.map(shift)));
|
|
16308
16312
|
};
|
|
16309
16313
|
const embeddedComments = (grammars) => (node) => {
|
|
@@ -16369,12 +16373,12 @@ const shebangReader = (source) => {
|
|
|
16369
16373
|
};
|
|
16370
16374
|
const readerOf = (name) => (source) => pipe(READERS$1, Array$1.findFirst(([pattern]) => pattern.test(name)), Option.orElse(() => shebangReader(source)), Option.map(([, reader]) => reader));
|
|
16371
16375
|
// src/features/ban-comments/model/comments.ts
|
|
16372
|
-
const RULE$
|
|
16376
|
+
const RULE$26 = "comment";
|
|
16373
16377
|
const UNUSED_RULE = "unused-comment-allowance";
|
|
16374
|
-
const CONFIG_FILE$
|
|
16378
|
+
const CONFIG_FILE$3 = "vite.config.ts";
|
|
16375
16379
|
const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
|
|
16376
16380
|
const READ_CONCURRENCY$6 = 64;
|
|
16377
|
-
const START$
|
|
16381
|
+
const START$16 = 0;
|
|
16378
16382
|
const SHEBANG = "#!";
|
|
16379
16383
|
const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
|
|
16380
16384
|
const VERSION = /^\s?v?\d[\w.+-]*$/u;
|
|
@@ -16396,11 +16400,11 @@ const taggedError$2 = Schema.TaggedError;
|
|
|
16396
16400
|
var CommentConfigUnreadable = class extends taggedError$2()("CommentConfigUnreadable", { file: Schema.String }) {};
|
|
16397
16401
|
const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
|
|
16398
16402
|
const lineBefore = (source, index) => {
|
|
16399
|
-
const lines = pipe(source, String$1.slice(START$
|
|
16403
|
+
const lines = pipe(source, String$1.slice(START$16, index), String$1.split("\n"));
|
|
16400
16404
|
return Option.getOrElse(Array$1.last(lines), () => "");
|
|
16401
16405
|
};
|
|
16402
16406
|
const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
|
|
16403
|
-
const isShebang = ({ index, text }) => index === START$
|
|
16407
|
+
const isShebang = ({ index, text }) => index === START$16 && String$1.startsWith(SHEBANG)(text);
|
|
16404
16408
|
const isAllowed = (source, directives) => (comment) => isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment);
|
|
16405
16409
|
const NOTHING = {
|
|
16406
16410
|
problems: [],
|
|
@@ -16410,7 +16414,7 @@ const unusedMessage = (entry) => `allows the comment pattern \`${entry}\`, but n
|
|
|
16410
16414
|
const problemOf$1 = (file, source) => ({ index }) => ({
|
|
16411
16415
|
file,
|
|
16412
16416
|
...positionOf(source)(index),
|
|
16413
|
-
rule: RULE$
|
|
16417
|
+
rule: RULE$26,
|
|
16414
16418
|
message: MESSAGE$4
|
|
16415
16419
|
});
|
|
16416
16420
|
const settingsOf = ({ msch, lint }) => ({
|
|
@@ -16422,7 +16426,7 @@ const settingsOf = ({ msch, lint }) => ({
|
|
|
16422
16426
|
});
|
|
16423
16427
|
const rootSettings = Effect.fn("rootSettings")(function* rootSettings(root) {
|
|
16424
16428
|
const files = yield* RepositoryFiles;
|
|
16425
|
-
const file = files.join(root, CONFIG_FILE$
|
|
16429
|
+
const file = files.join(root, CONFIG_FILE$3);
|
|
16426
16430
|
if (!(yield* files.exists(file))) return NO_SETTINGS;
|
|
16427
16431
|
const config = yield* Effect.tryPromise({
|
|
16428
16432
|
try: () => resolveConfigFromFile(file),
|
|
@@ -16447,10 +16451,10 @@ const scannedFiles = Effect.fn("scannedFiles")(function* scannedFiles(root, sett
|
|
|
16447
16451
|
})), Array$1.filter(({ file }) => !HashSet.has(skipped, file)));
|
|
16448
16452
|
});
|
|
16449
16453
|
const usedAllowances = (allowances, found) => pipe(allowances, Array$1.map((pattern, index) => [pattern, index]), Array$1.filter(([pattern]) => pipe(found, Array$1.some((comment) => pattern.test(valueOf(comment.text))))), Array$1.map(([, index]) => index));
|
|
16450
|
-
const entryOffset = (source, entry) => pipe(String$1.indexOf(entry)(source), Option.getOrElse(() => START$
|
|
16454
|
+
const entryOffset = (source, entry) => pipe(String$1.indexOf(entry)(source), Option.getOrElse(() => START$16));
|
|
16451
16455
|
const unusedAllowances = Effect.fn("unusedAllowances")(function* unusedAllowances(root, settings, used) {
|
|
16452
16456
|
const files = yield* RepositoryFiles;
|
|
16453
|
-
const file = files.join(root, CONFIG_FILE$
|
|
16457
|
+
const file = files.join(root, CONFIG_FILE$3);
|
|
16454
16458
|
const text = yield* files.readFile(file);
|
|
16455
16459
|
const source = Option.getOrElse(text, () => "");
|
|
16456
16460
|
return pipe(settings.allow, Array$1.filter((_entry, index) => !HashSet.has(used, index)), Array$1.map((entry) => ({
|
|
@@ -16469,7 +16473,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
|
|
|
16469
16473
|
problems: pipe(found, Array$1.filter(kept), Array$1.map(toProblem)),
|
|
16470
16474
|
used: usedAllowances(allowances, found)
|
|
16471
16475
|
})), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
|
|
16472
|
-
problems: [problemInFile(RULE$
|
|
16476
|
+
problems: [problemInFile(RULE$26)(file, `msch could not read the comments in this file: ${message}`)],
|
|
16473
16477
|
used: []
|
|
16474
16478
|
})))
|
|
16475
16479
|
});
|
|
@@ -16582,7 +16586,7 @@ const PYTHON = {
|
|
|
16582
16586
|
/** @internal */
|
|
16583
16587
|
const checkPython = (root) => checkBannedTool(root, PYTHON);
|
|
16584
16588
|
// src/features/check-catalog-entries/model/uncataloged-dependencies.ts
|
|
16585
|
-
const RULE$
|
|
16589
|
+
const RULE$25 = "uncataloged-dependency";
|
|
16586
16590
|
const OWNED_ELSEWHERE = [
|
|
16587
16591
|
"catalog:",
|
|
16588
16592
|
"workspace:",
|
|
@@ -16596,7 +16600,7 @@ const isOwnedElsewhere = ({ specifier }) => pipe(OWNED_ELSEWHERE, Array$1.some((
|
|
|
16596
16600
|
const problemsIn$11 = (entry, source) => pipe(manifestSpecifiers(source), Array$1.filter((found) => !isOwnedElsewhere(found)), Array$1.map((found) => ({
|
|
16597
16601
|
file: entry.file,
|
|
16598
16602
|
...positionOf(source)(offsetIn$1(source)(manifestPattern(found))),
|
|
16599
|
-
rule: RULE$
|
|
16603
|
+
rule: RULE$25,
|
|
16600
16604
|
message: `\`${found.name}\` \`${found.specifier}\` ${MESSAGE$3}`
|
|
16601
16605
|
})));
|
|
16602
16606
|
/** @internal */
|
|
@@ -16617,7 +16621,7 @@ const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* u
|
|
|
16617
16621
|
const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
|
|
16618
16622
|
const FIRST_LINE$2 = 1;
|
|
16619
16623
|
const FIRST_COLUMN$1 = 1;
|
|
16620
|
-
const RULE$
|
|
16624
|
+
const RULE$24 = "prune-setting-off";
|
|
16621
16625
|
const PRUNE_SETTINGS = [["catalogPrune", "removes catalog entries no package refers to, so the catalog holds only versions in use."], ["minimumReleaseAgeExcludePrune", "removes `minimumReleaseAgeExclude` entries the lockfile no longer resolves, which only exempted that one version while it was new."]];
|
|
16622
16626
|
const decodeTrue = Schema.decodeUnknownOption(Schema.Literal(true));
|
|
16623
16627
|
const lineOf$1 = (source) => (setting) => pipe(String$1.split(source, "\n"), Array$1.findFirstIndex(String$1.startsWith(`${setting}:`)), Option.match({
|
|
@@ -16631,7 +16635,7 @@ const pruneProblems = Effect.fn("pruneProblems")(function* pruneProblems(file, s
|
|
|
16631
16635
|
file,
|
|
16632
16636
|
line: at(setting),
|
|
16633
16637
|
column: FIRST_COLUMN$1,
|
|
16634
|
-
rule: RULE$
|
|
16638
|
+
rule: RULE$24,
|
|
16635
16639
|
message: `Set \`${setting}: true\`. It ${effect}`
|
|
16636
16640
|
})));
|
|
16637
16641
|
});
|
|
@@ -16652,12 +16656,13 @@ const checkCatalogEntries = Effect.fn("checkCatalogEntries")(function* checkCata
|
|
|
16652
16656
|
// src/features/check-skills/model/skill-entry.ts
|
|
16653
16657
|
const ENTRY_RULE = "unlocked-skill";
|
|
16654
16658
|
const VISIBLE_RULE = "skill-source-visible";
|
|
16655
|
-
const CONFIG_FILE$
|
|
16659
|
+
const CONFIG_FILE$2 = "vite.config.ts";
|
|
16656
16660
|
const RENOVATE_FILE$1 = "renovate.json";
|
|
16657
|
-
const
|
|
16658
|
-
const
|
|
16661
|
+
const ADOPTER = "@r_masseater/vite-plus-adopt";
|
|
16662
|
+
const SOURCE_SEPARATOR = "/";
|
|
16663
|
+
const START$15 = 0;
|
|
16659
16664
|
const LOCAL_PREFIX = "./";
|
|
16660
|
-
const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
|
|
16665
|
+
const REGEX_SPECIAL$1 = /[.*+?^${}()|[\]\\/]/gu;
|
|
16661
16666
|
const Source = Schema.Struct({
|
|
16662
16667
|
commit: Schema.optional(Schema.String),
|
|
16663
16668
|
skills: Schema.Union([Schema.Literal("all"), Schema.Array(Schema.String)])
|
|
@@ -16668,13 +16673,13 @@ const taggedError$1 = Schema.TaggedError;
|
|
|
16668
16673
|
var SkillsConfigUnreadable = class extends taggedError$1()("SkillsConfigUnreadable", { file: Schema.String }) {};
|
|
16669
16674
|
const problemAt$3 = (rule, file, text) => (anchor, message) => ({
|
|
16670
16675
|
file,
|
|
16671
|
-
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$
|
|
16676
|
+
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$15))),
|
|
16672
16677
|
rule,
|
|
16673
16678
|
message
|
|
16674
16679
|
});
|
|
16675
16680
|
const declaredSkills = Effect.fn("declaredSkills")(function* declaredSkills(root) {
|
|
16676
16681
|
const files = yield* RepositoryFiles;
|
|
16677
|
-
const file = files.join(root, CONFIG_FILE$
|
|
16682
|
+
const file = files.join(root, CONFIG_FILE$2);
|
|
16678
16683
|
const text = yield* files.readFile(file);
|
|
16679
16684
|
if (Option.isNone(text)) return Option.none();
|
|
16680
16685
|
const config = yield* Effect.tryPromise({
|
|
@@ -16687,44 +16692,50 @@ const declaredSkills = Effect.fn("declaredSkills")(function* declaredSkills(root
|
|
|
16687
16692
|
sources: skills
|
|
16688
16693
|
})));
|
|
16689
16694
|
});
|
|
16690
|
-
const
|
|
16691
|
-
|
|
16695
|
+
const ownerOfSource = (source) => pipe(String$1.split(SOURCE_SEPARATOR)(source), Array$1.headNonEmpty);
|
|
16696
|
+
const entryProblems = (owner, { file, text, sources }) => {
|
|
16692
16697
|
const at = problemAt$3(ENTRY_RULE, file, text);
|
|
16693
|
-
|
|
16694
|
-
return pipe(Record.get(sources, source), Option.match({
|
|
16695
|
-
onNone: () => [at("skills", `does not install ${source}. Add "${source}": { commit, root: "${root}", skills: "all" } to skills.`)],
|
|
16696
|
-
onSome: (found) => pipe(Option.liftPredicate(found, ({ skills }) => skills !== "all"), Option.map(() => at(`"${source}"`, `picks skills from ${source} by name. Write skills: "all", so every repository gets each new skill with the next digest update.`)), Option.toArray)
|
|
16697
|
-
}));
|
|
16698
|
+
return pipe(Record.toEntries(sources), Array$1.filter(([source, { skills }]) => ownerOfSource(source) === owner && skills !== "all"), Array$1.map(([source]) => at(`"${source}"`, `picks skills from ${source} by name. ${owner} owns both repositories, so write skills: "all" and every repository gets each new skill with the next digest update.`)));
|
|
16698
16699
|
};
|
|
16699
|
-
const literalPattern = (repository, commit) => new RegExp(`"${String$1.replaceAll(REGEX_SPECIAL, String.raw`\$&`)(repository)}": \\{\\s*commit: "${commit}"`, "u");
|
|
16700
|
+
const literalPattern = (repository, commit) => new RegExp(`"${String$1.replaceAll(REGEX_SPECIAL$1, String.raw`\$&`)(repository)}": \\{\\s*commit: "${commit}"`, "u");
|
|
16700
16701
|
const visibleProblems = ({ file, text, sources }) => pipe(Record.toEntries(sources), Array$1.filter(([repository]) => !String$1.startsWith(LOCAL_PREFIX)(repository)), Array$1.filter(([repository, { commit }]) => !literalPattern(repository, commit ?? "").test(text)), Array$1.map(([repository]) => problemAt$3(VISIBLE_RULE, file, text)(repository, `declares ${repository} in a form the Renovate preset cannot read. Write "${repository}": { commit: "<sha>", ... } with commit first and as a string literal.`)));
|
|
16701
|
-
const
|
|
16702
|
+
const RepositoryField = Schema.Struct({
|
|
16703
|
+
url: Schema.String,
|
|
16704
|
+
directory: Schema.String
|
|
16705
|
+
});
|
|
16706
|
+
const decodeRepository$1 = Schema.decodeUnknownOption(RepositoryField);
|
|
16707
|
+
const adopterPreset = Effect.fn("adopterPreset")(function* adopterPreset() {
|
|
16708
|
+
const manifest = yield* installedManifest(ADOPTER, import.meta.url);
|
|
16709
|
+
return pipe(manifest, Option.flatMap(({ repository }) => decodeRepository$1(repository)), Option.flatMap(({ url, directory }) => pipe(originOf(url), Option.map((origin) => `github>${slugOf(origin)}//${directory}/renovate`))));
|
|
16710
|
+
});
|
|
16711
|
+
const presetProblems = Effect.fn("presetProblems")(function* presetProblems(root, preset) {
|
|
16702
16712
|
const files = yield* RepositoryFiles;
|
|
16703
16713
|
const file = files.join(root, RENOVATE_FILE$1);
|
|
16704
16714
|
const text = yield* files.readFile(file);
|
|
16705
|
-
if (pipe(text, Option.exists(String$1.includes(`"${
|
|
16706
|
-
return [problemAt$3(VISIBLE_RULE, file, Option.getOrElse(text, () => ""))("extends", `does not extend ${
|
|
16715
|
+
if (pipe(text, Option.exists(String$1.includes(`"${preset}"`)))) return [];
|
|
16716
|
+
return [problemAt$3(VISIBLE_RULE, file, Option.getOrElse(text, () => ""))("extends", `does not extend ${preset}, so Renovate never updates the commits in the skills section of ${CONFIG_FILE$2}.`)];
|
|
16707
16717
|
});
|
|
16708
16718
|
/** @internal */
|
|
16709
16719
|
const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(root) {
|
|
16710
16720
|
const declared = yield* declaredSkills(root);
|
|
16711
16721
|
if (Option.isNone(declared)) return [];
|
|
16712
|
-
const preset = yield*
|
|
16713
|
-
const
|
|
16722
|
+
const preset = yield* adopterPreset();
|
|
16723
|
+
const unextended = yield* Effect.forEach(Option.toArray(preset), (found) => presetProblems(root, found), { concurrency: 1 });
|
|
16724
|
+
const origin = yield* repositoryOrigin(root);
|
|
16714
16725
|
return [
|
|
16715
|
-
...entryProblems(
|
|
16726
|
+
...pipe(origin, Option.map(({ owner }) => entryProblems(owner, declared.value)), Option.getOrElse(() => [])),
|
|
16716
16727
|
...visibleProblems(declared.value),
|
|
16717
|
-
...
|
|
16728
|
+
...Array$1.flatten(unextended)
|
|
16718
16729
|
];
|
|
16719
16730
|
});
|
|
16720
16731
|
// src/features/check-skills/model/published-skills.ts
|
|
16721
|
-
const RULE$
|
|
16732
|
+
const RULE$23 = "published-skills";
|
|
16722
16733
|
const KEYWORD = "tanstack-intent";
|
|
16723
16734
|
const SKILLS = "skills";
|
|
16724
16735
|
const SKILL_FILE$2 = "SKILL.md";
|
|
16725
16736
|
const SUCCEEDED = 0;
|
|
16726
16737
|
const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
|
|
16727
|
-
const problemAt$2 = problemInFile(RULE$
|
|
16738
|
+
const problemAt$2 = problemInFile(RULE$23);
|
|
16728
16739
|
const skillDirectoriesIn = (files, directory) => pipe(findSkillFiles(files.join(directory, SKILLS)), Array$1.filter((file) => files.basename(file) === SKILL_FILE$2), Array$1.map((file) => files.relative(directory, files.dirname(file))));
|
|
16729
16740
|
const isShipped = (listed) => (skill) => Array$1.contains(listed, SKILLS) || Array$1.contains(listed, skill);
|
|
16730
16741
|
const packagingMessages = ({ keywords, files }, skills) => {
|
|
@@ -16761,7 +16772,7 @@ const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPu
|
|
|
16761
16772
|
return Array$1.flatten(problems);
|
|
16762
16773
|
});
|
|
16763
16774
|
// src/features/check-skills/model/skill-files.ts
|
|
16764
|
-
const RULE$
|
|
16775
|
+
const RULE$22 = "skill-file";
|
|
16765
16776
|
const SKILL_FILE$1 = /(?:^|\/)SKILL\.md$/u;
|
|
16766
16777
|
const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
|
|
16767
16778
|
const FIXTURE = /(?:^|\/)fixtures\//u;
|
|
@@ -16777,8 +16788,8 @@ const FRAGMENT = /#.*$/u;
|
|
|
16777
16788
|
const GITHUB = "https://github.com/";
|
|
16778
16789
|
const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
|
|
16779
16790
|
const BLANK = /\s+/u;
|
|
16780
|
-
const SEPARATOR$
|
|
16781
|
-
const START$
|
|
16791
|
+
const SEPARATOR$4 = "/";
|
|
16792
|
+
const START$14 = 0;
|
|
16782
16793
|
const FIRST$5 = 1;
|
|
16783
16794
|
const READ_CONCURRENCY$5 = 16;
|
|
16784
16795
|
const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
|
|
@@ -16788,9 +16799,9 @@ const Frontmatter = Schema.Struct({
|
|
|
16788
16799
|
metadata: Schema.optional(Metadata)
|
|
16789
16800
|
});
|
|
16790
16801
|
const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
|
|
16791
|
-
const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$
|
|
16802
|
+
const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$14));
|
|
16792
16803
|
const frontmatterOf = (source) => pipe(splitFrontmatter(source), Option.flatMap(({ fields }) => decodeFrontmatter(fields)));
|
|
16793
|
-
const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$
|
|
16804
|
+
const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$14].length), Option.getOrElse(() => START$14));
|
|
16794
16805
|
const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
|
|
16795
16806
|
const nameProblems = ({ source, directory }, name, folder) => {
|
|
16796
16807
|
const bodyStart = bodyStartOf(source);
|
|
@@ -16818,16 +16829,16 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
|
|
|
16818
16829
|
]), Option.getOrElse(() => []), Array$1.map(({ index, message }) => ({
|
|
16819
16830
|
file: skill.file,
|
|
16820
16831
|
...positionOf(skill.source)(index),
|
|
16821
|
-
rule: RULE$
|
|
16832
|
+
rule: RULE$22,
|
|
16822
16833
|
message
|
|
16823
16834
|
})));
|
|
16824
16835
|
const linkOf = (found) => pipe(groupOf("target")(found), Option.filter((target) => !EXTERNAL.test(target)), Option.map((target) => String$1.replace(FRAGMENT, "")(target)), Option.filter(String$1.isNonEmpty), Option.map((target) => ({
|
|
16825
16836
|
target,
|
|
16826
|
-
index: found.index ?? START$
|
|
16837
|
+
index: found.index ?? START$14
|
|
16827
16838
|
})), Option.toArray);
|
|
16828
16839
|
const rangeOf$1 = (found) => {
|
|
16829
|
-
const start = found.index ?? START$
|
|
16830
|
-
return [start, start + found[START$
|
|
16840
|
+
const start = found.index ?? START$14;
|
|
16841
|
+
return [start, start + found[START$14].length];
|
|
16831
16842
|
};
|
|
16832
16843
|
const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array$1.some(([start, end]) => index >= start && index < end));
|
|
16833
16844
|
const linksIn$1 = (source) => {
|
|
@@ -16845,7 +16856,7 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
|
|
|
16845
16856
|
return pipe(missing, Array$1.map(({ target, index }) => ({
|
|
16846
16857
|
file,
|
|
16847
16858
|
...positionOf(source)(index),
|
|
16848
|
-
rule: RULE$
|
|
16859
|
+
rule: RULE$22,
|
|
16849
16860
|
message: `links to ${target}, which does not exist. Fix the path or remove the link.`
|
|
16850
16861
|
})));
|
|
16851
16862
|
});
|
|
@@ -16853,7 +16864,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
16853
16864
|
const files = yield* RepositoryFiles;
|
|
16854
16865
|
const file = files.join(root, name);
|
|
16855
16866
|
const directory = files.dirname(name);
|
|
16856
|
-
const inside = pipe(listed, Array$1.filter(String$1.startsWith(`${directory}${SEPARATOR$
|
|
16867
|
+
const inside = pipe(listed, Array$1.filter(String$1.startsWith(`${directory}${SEPARATOR$4}`)));
|
|
16857
16868
|
const text = yield* files.readFile(file);
|
|
16858
16869
|
const documents = pipe(inside, Array$1.filter(String$1.endsWith(MARKDOWN$4)), Array$1.map((entry) => files.join(root, entry)));
|
|
16859
16870
|
const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$5 });
|
|
@@ -16861,7 +16872,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
16861
16872
|
file: files.join(root, entry),
|
|
16862
16873
|
line: FIRST$5,
|
|
16863
16874
|
column: FIRST$5,
|
|
16864
|
-
rule: RULE$
|
|
16875
|
+
rule: RULE$22,
|
|
16865
16876
|
message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
|
|
16866
16877
|
})));
|
|
16867
16878
|
return [
|
|
@@ -16939,7 +16950,7 @@ const cargoEntries = (text) => {
|
|
|
16939
16950
|
};
|
|
16940
16951
|
const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
|
|
16941
16952
|
// src/features/check-version-downgrades/model/version-downgrade.ts
|
|
16942
|
-
const RULE$
|
|
16953
|
+
const RULE$21 = "version-downgrade";
|
|
16943
16954
|
const READ_CONCURRENCY$4 = 16;
|
|
16944
16955
|
const READERS = [
|
|
16945
16956
|
[/(?:^|\/)package\.json$/u, manifestEntries],
|
|
@@ -16964,7 +16975,7 @@ const downgradesIn = ({ file, text, before, after }) => {
|
|
|
16964
16975
|
file,
|
|
16965
16976
|
line: lineOf(text, entry),
|
|
16966
16977
|
column: FIRST_LINE$1,
|
|
16967
|
-
rule: RULE$
|
|
16978
|
+
rule: RULE$21,
|
|
16968
16979
|
message: message(old, entry)
|
|
16969
16980
|
})), Option.toArray)));
|
|
16970
16981
|
};
|
|
@@ -16994,12 +17005,11 @@ const VERSION_CAP = /["']?allowedVersions["']?\s*:\s*["'](?<range>[^"']*<[^"']*)
|
|
|
16994
17005
|
const AUTOMERGE_RULE = "renovate-platform-automerge";
|
|
16995
17006
|
const CAP_RULE = "renovate-version-cap";
|
|
16996
17007
|
const PRESET_RULE = "renovate-msch-preset";
|
|
16997
|
-
const
|
|
16998
|
-
const START$12 = 0;
|
|
17008
|
+
const START$13 = 0;
|
|
16999
17009
|
const READ_CONCURRENCY$3 = 16;
|
|
17000
17010
|
const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
|
|
17001
17011
|
const CAP_MESSAGE = "caps a dependency below a version with `allowedVersions`. A cap holds the dependency on an old version, which is a downgrade that never ends: fix what breaks on the new version instead.";
|
|
17002
|
-
const PRESET_MESSAGE = `does not extend \`${
|
|
17012
|
+
const PRESET_MESSAGE = `does not extend \`${RENOVATE_PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
|
|
17003
17013
|
const offsetsOf = (pattern, source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.flatMap((match) => Option.toArray(Option.fromUndefinedOr(match.index))));
|
|
17004
17014
|
const problemsIn$8 = (file, source) => {
|
|
17005
17015
|
const at = positionOf(source);
|
|
@@ -17014,10 +17024,10 @@ const problemsIn$8 = (file, source) => {
|
|
|
17014
17024
|
...found(VERSION_CAP, CAP_RULE, CAP_MESSAGE),
|
|
17015
17025
|
...pipe([{
|
|
17016
17026
|
file,
|
|
17017
|
-
...at(START$
|
|
17027
|
+
...at(START$13),
|
|
17018
17028
|
rule: PRESET_RULE,
|
|
17019
17029
|
message: PRESET_MESSAGE
|
|
17020
|
-
}], Array$1.filter(() => !String$1.includes(`"${
|
|
17030
|
+
}], Array$1.filter(() => !String$1.includes(`"${RENOVATE_PRESET}"`)(source)))
|
|
17021
17031
|
];
|
|
17022
17032
|
};
|
|
17023
17033
|
/** @internal */
|
|
@@ -17034,17 +17044,16 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
|
|
|
17034
17044
|
return Array$1.flatten(found);
|
|
17035
17045
|
});
|
|
17036
17046
|
// src/features/find-unneeded-files/model/applied-packages.ts
|
|
17037
|
-
const
|
|
17038
|
-
const SCOPE = Option.getOrElse(scopeOfName(MSCH), () => MSCH);
|
|
17047
|
+
const SCOPE = Option.getOrElse(scopeOfName(SELF_NAME), () => SELF_NAME);
|
|
17039
17048
|
const PLUGIN_KEYWORDS = ["oxlint-plugin", "textlint-rule"];
|
|
17040
|
-
const RULE$
|
|
17049
|
+
const RULE$20 = "applied-package";
|
|
17041
17050
|
const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
|
|
17042
17051
|
const NOT_FOUND = -1;
|
|
17043
|
-
const SEPARATOR$
|
|
17052
|
+
const SEPARATOR$3 = "/";
|
|
17044
17053
|
/** @internal */
|
|
17045
17054
|
const isApplied = ({ bins, keywords }) => Array$1.isReadonlyArrayNonEmpty(bins) || pipe(keywords, Array$1.some((keyword) => Array$1.contains(PLUGIN_KEYWORDS, keyword)));
|
|
17046
17055
|
const BY_LENGTH = Order.mapInput(Order.Number, (text) => text.length);
|
|
17047
|
-
const escaped = (text) => String$1.replaceAll(/[.*+?^${}()|[\]\\]/gu, String.raw`\$&`)(text);
|
|
17056
|
+
const escaped$1 = (text) => String$1.replaceAll(/[.*+?^${}()|[\]\\]/gu, String.raw`\$&`)(text);
|
|
17048
17057
|
const declaredNames = (manifest) => namesIn(manifest, [
|
|
17049
17058
|
"dependencies",
|
|
17050
17059
|
"devDependencies",
|
|
@@ -17065,7 +17074,7 @@ const installedPackage = Effect.fn("installedPackage")(function* installedPackag
|
|
|
17065
17074
|
})));
|
|
17066
17075
|
});
|
|
17067
17076
|
const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
|
|
17068
|
-
const manifest = yield* installedManifest(
|
|
17077
|
+
const manifest = yield* installedManifest(SELF_NAME, import.meta.url);
|
|
17069
17078
|
const names = pipe(manifest, Option.map(({ dependencies, peerDependencies }) => [...Record.keys(dependencies ?? {}), ...Record.keys(peerDependencies ?? {})]), Option.getOrElse(() => []), Array$1.filter(String$1.startsWith(SCOPE)));
|
|
17070
17079
|
const found = yield* Effect.forEach(names, installedPackage, { concurrency: 1 });
|
|
17071
17080
|
return Array$1.getSomes(found);
|
|
@@ -17073,20 +17082,20 @@ const appliedByMsch = Effect.fn("appliedByMsch")(function* appliedByMsch() {
|
|
|
17073
17082
|
const problemAt$1 = (file, source) => (index, name) => ({
|
|
17074
17083
|
file,
|
|
17075
17084
|
...positionOf(source)(index),
|
|
17076
|
-
rule: RULE$
|
|
17085
|
+
rule: RULE$20,
|
|
17077
17086
|
message: `msch applies ${name}. Remove this use and let msch apply it.`
|
|
17078
17087
|
});
|
|
17079
|
-
const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped(name)}(?=["'\`/])`, "gu");
|
|
17080
|
-
const binPattern = (bin) => new RegExp(`(?<![\\w./@:-])${escaped(bin)}(?=[ \\t"'\`]|$)`, "gmu");
|
|
17088
|
+
const specifierPattern = ({ name }) => new RegExp(`["'\`]${escaped$1(name)}(?=["'\`/])`, "gu");
|
|
17089
|
+
const binPattern = (bin) => new RegExp(`(?<![\\w./@:-])${escaped$1(bin)}(?=[ \\t"'\`]|$)`, "gmu");
|
|
17081
17090
|
const usesIn = (applied) => ({ file }, source) => pipe(applied, Array$1.flatMap((entry) => pipe([specifierPattern(entry), ...pipe(entry.bins, Array$1.map(binPattern))], Array$1.flatMap((pattern) => Array$1.fromIterable(String$1.matchAll(pattern)(source))), Array$1.map((found) => problemAt$1(file, source)(found.index ?? NOT_FOUND, entry.name)))));
|
|
17082
|
-
const ownerOf$1 = (directories) => (name) => pipe(directories, Array$1.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$
|
|
17091
|
+
const ownerOf$1 = (directories) => (name) => pipe(directories, Array$1.filter((directory) => directory === "" || String$1.startsWith(`${directory}${SEPARATOR$3}`)(name)), Array$1.match({
|
|
17083
17092
|
onEmpty: () => "",
|
|
17084
17093
|
onNonEmpty: Array$1.max(BY_LENGTH)
|
|
17085
17094
|
}));
|
|
17086
17095
|
const isScannedSource = (entry) => isScannedText(entry) && !String$1.endsWith(PACKAGE_JSON_FILE)(entry.name) && entry.name !== WORKSPACE_FILE$2;
|
|
17087
17096
|
const consumersIn = Effect.fn("consumersIn")(function* consumersIn(root, directories) {
|
|
17088
17097
|
const files = yield* RepositoryFiles;
|
|
17089
|
-
return yield* pipe(directories, Effect.filter((directory) => readManifest(files.join(root, directory)).pipe(Effect.map(Option.exists((manifest) => manifest.name !==
|
|
17098
|
+
return yield* pipe(directories, Effect.filter((directory) => readManifest(files.join(root, directory)).pipe(Effect.map(Option.exists((manifest) => manifest.name !== SELF_NAME && Array$1.contains(declaredNames(manifest), SELF_NAME))))));
|
|
17090
17099
|
});
|
|
17091
17100
|
const manifestUses = Effect.fn("manifestUses")(function* manifestUses(root, appliedNames, directory) {
|
|
17092
17101
|
const files = yield* RepositoryFiles;
|
|
@@ -17128,7 +17137,7 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
|
|
|
17128
17137
|
return yield* appliedPackageProblems(root, applied);
|
|
17129
17138
|
});
|
|
17130
17139
|
// src/features/find-unneeded-files/model/replaced-tools.ts
|
|
17131
|
-
const RULE$
|
|
17140
|
+
const RULE$19 = "replaced-tool";
|
|
17132
17141
|
const FIRST$4 = 1;
|
|
17133
17142
|
const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
|
|
17134
17143
|
const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
|
|
@@ -17209,7 +17218,7 @@ const problemFor$1 = ({ name, file }) => pipe(REPLACED, Array$1.findFirst(({ pat
|
|
|
17209
17218
|
file,
|
|
17210
17219
|
line: FIRST$4,
|
|
17211
17220
|
column: FIRST$4,
|
|
17212
|
-
rule: RULE$
|
|
17221
|
+
rule: RULE$19,
|
|
17213
17222
|
message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
|
|
17214
17223
|
})));
|
|
17215
17224
|
/** @internal */
|
|
@@ -17227,7 +17236,7 @@ const unneededLockfile = (present) => (entry) => FOREIGN_LOCKFILE.test(entry.nam
|
|
|
17227
17236
|
// src/features/find-unneeded-files/model/unneeded-files.ts
|
|
17228
17237
|
const WORKSPACE_FILE$1 = "pnpm-workspace.yaml";
|
|
17229
17238
|
const PNPM_DIRECTORY = ".pnpm/";
|
|
17230
|
-
const SEPARATOR$
|
|
17239
|
+
const SEPARATOR$2 = "/";
|
|
17231
17240
|
const CARGO_MANIFEST_FILE = /(?:^|\/)Cargo\.toml$/u;
|
|
17232
17241
|
const CARGO_LOCK_FILE = /(?:^|\/)Cargo\.lock$/u;
|
|
17233
17242
|
const PNPM_OUTPUT = /(?:^|\/)\.pnpm\//u;
|
|
@@ -17243,7 +17252,7 @@ const SETUP_PATTERNS = [
|
|
|
17243
17252
|
];
|
|
17244
17253
|
const INSTALL_PATTERNS = [/(?<![\w./@-])cargo[ \t]+b?install\b/gu];
|
|
17245
17254
|
const TOOL_PATTERNS = [/^[ \t]*["']?(?:rust|rustup)["']?[ \t]*(?:=|[ \t]+\S)/gmu];
|
|
17246
|
-
const START$
|
|
17255
|
+
const START$12 = 0;
|
|
17247
17256
|
const LAST_SEGMENT = 1;
|
|
17248
17257
|
const FIRST_LINE = 1;
|
|
17249
17258
|
const FIRST_COLUMN = 1;
|
|
@@ -17295,10 +17304,10 @@ const matches = (pattern) => ({ name }) => pattern.test(name);
|
|
|
17295
17304
|
const isCargoManifest = matches(CARGO_MANIFEST_FILE);
|
|
17296
17305
|
const isLegacyCargoConfig = matches(LEGACY_CARGO_CONFIG);
|
|
17297
17306
|
const isPnpmOutput = matches(PNPM_OUTPUT);
|
|
17298
|
-
const directoryOf = (name) => pipe(String$1.split(name, SEPARATOR$
|
|
17307
|
+
const directoryOf = (name) => pipe(String$1.split(name, SEPARATOR$2), Array$1.dropRight(LAST_SEGMENT), Array$1.join(SEPARATOR$2));
|
|
17299
17308
|
const ancestorsOf = (directory) => {
|
|
17300
|
-
const parts = String$1.split(directory, SEPARATOR$
|
|
17301
|
-
return pipe(Array$1.makeBy(parts.length, (depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$
|
|
17309
|
+
const parts = String$1.split(directory, SEPARATOR$2);
|
|
17310
|
+
return pipe(Array$1.makeBy(parts.length, (depth) => Array$1.join(Array$1.take(parts, depth), SEPARATOR$2)), Array$1.filter((ancestor) => ancestor !== directory));
|
|
17302
17311
|
};
|
|
17303
17312
|
const readsCargoLock = (manifests, workspaces) => ({ name }) => {
|
|
17304
17313
|
const directory = directoryOf(name);
|
|
@@ -17312,7 +17321,7 @@ const cargoWorkspaces = Effect.fn("cargoWorkspaces")(function* cargoWorkspaces(m
|
|
|
17312
17321
|
const roots = yield* pipe(manifests, Effect.filter(({ file }) => files.readFile(file).pipe(Effect.map(isWorkspaceManifest))));
|
|
17313
17322
|
return directoriesOf(roots);
|
|
17314
17323
|
});
|
|
17315
|
-
const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$
|
|
17324
|
+
const pnpmDirectoryOf = ({ name }) => pipe(name, String$1.indexOf(PNPM_DIRECTORY), Option.getOrElse(() => START$12), (end) => String$1.slice(START$12, end)(name));
|
|
17316
17325
|
const pnpmOutputs = (present) => pipe(present, Array$1.filter(isPnpmOutput), Array$1.dedupeWith((left, right) => pnpmDirectoryOf(left) === pnpmDirectoryOf(right)), Array$1.map(pnpmOutput));
|
|
17317
17326
|
const byDepth = Order.mapInput(Order.Number, ({ name }) => String$1.split(name, "/").length);
|
|
17318
17327
|
const cargoProblems = (present, enabled) => {
|
|
@@ -17348,8 +17357,8 @@ const checkUnneededFiles = Effect.fn("checkUnneededFiles")(function* checkUnneed
|
|
|
17348
17357
|
return yield* unneededIn(root, cargoEnabled(workspace.value));
|
|
17349
17358
|
});
|
|
17350
17359
|
// src/features/check-markdown-directives/model/directives.ts
|
|
17351
|
-
const RULE$
|
|
17352
|
-
const START$
|
|
17360
|
+
const RULE$18 = "markdown-directive";
|
|
17361
|
+
const START$11 = 0;
|
|
17353
17362
|
const SECOND = 1;
|
|
17354
17363
|
const ODD = 1;
|
|
17355
17364
|
const PAIR = 2;
|
|
@@ -17375,9 +17384,9 @@ const problemsIn$7 = (file, source) => {
|
|
|
17375
17384
|
const fenced = Array$1.mapAccum(lines, false, fenceStep)[SECOND];
|
|
17376
17385
|
const isCode = (index) => {
|
|
17377
17386
|
const { line, column } = positionOf(source)(index);
|
|
17378
|
-
return pipe(Array$1.get(fenced, line - SECOND), Option.getOrElse(() => false)) || pipe(Array$1.get(lines, line - SECOND), Option.map(String$1.slice(START$
|
|
17387
|
+
return pipe(Array$1.get(fenced, line - SECOND), Option.getOrElse(() => false)) || pipe(Array$1.get(lines, line - SECOND), Option.map(String$1.slice(START$11, column - SECOND)), Option.exists(insideCodeSpan));
|
|
17379
17388
|
};
|
|
17380
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => Array$1.isReadonlyArrayEmpty(namedRules(restOf(match)))), Array$1.filter((match) => !isCode(match.index ?? START$
|
|
17389
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => Array$1.isReadonlyArrayEmpty(namedRules(restOf(match)))), Array$1.filter((match) => !isCode(match.index ?? START$11)), Array$1.map((match) => problemAtIndex(RULE$18)(file, source)(match.index ?? START$11, MESSAGE$2)));
|
|
17381
17390
|
};
|
|
17382
17391
|
const isChecked = (name) => String$1.endsWith(MARKDOWN$3)(name) && !pipe(SKIPPED_DIRECTORIES, Array$1.some((directory) => String$1.includes(directory)(`/${name}`))) && !pipe(SKIPPED_FILES, Array$1.some((skipped) => name === skipped || String$1.endsWith(`/${skipped}`)(name)));
|
|
17383
17392
|
/** @internal */
|
|
@@ -17389,6 +17398,96 @@ const checkMarkdownDirectives = Effect.fn("checkMarkdownDirectives")(function* c
|
|
|
17389
17398
|
file: files.join(root, name)
|
|
17390
17399
|
}))), ({ file }, source) => problemsIn$7(file, source));
|
|
17391
17400
|
});
|
|
17401
|
+
// src/features/check-owner-names/model/owner-names.ts
|
|
17402
|
+
const RULE$17 = "owner-name";
|
|
17403
|
+
const TEXT_FILE = /\.(?:[cm]?[jt]sx?|jsonc?|md|ya?ml|toml)$/u;
|
|
17404
|
+
const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
|
|
17405
|
+
const SEPARATOR$1 = "/";
|
|
17406
|
+
const START$10 = 0;
|
|
17407
|
+
const DECLARED = [
|
|
17408
|
+
"dependencies",
|
|
17409
|
+
"devDependencies",
|
|
17410
|
+
"peerDependencies"
|
|
17411
|
+
];
|
|
17412
|
+
const CONFIG_FILE$1 = "vite.config.ts";
|
|
17413
|
+
const ANY_OWNER = /\banyOwner:\s*true\b/u;
|
|
17414
|
+
const escaped = (text) => String$1.replaceAll(REGEX_SPECIAL, String.raw`\$&`)(text);
|
|
17415
|
+
const messageFor$2 = (owner) => `names ${owner}, the owner of this repository, but msch.publish.anyOwner says this package works for any owner. Derive the value from the repository it runs in: its package.json, its git remote or its files. A package of an allowed scope is named in full, as @scope/name.`;
|
|
17416
|
+
const spansOf = (pattern, source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.flatMap((match) => {
|
|
17417
|
+
const [token] = match;
|
|
17418
|
+
return pipe(Option.fromUndefinedOr(match.index), Option.map((start) => ({
|
|
17419
|
+
start,
|
|
17420
|
+
end: start + token.length
|
|
17421
|
+
})), Option.toArray);
|
|
17422
|
+
}));
|
|
17423
|
+
const scopedSpans = (scopes, source) => {
|
|
17424
|
+
if (!Array$1.isReadonlyArrayNonEmpty(scopes)) return [];
|
|
17425
|
+
const names = pipe(scopes, Array$1.map(escaped), Array$1.join("|"));
|
|
17426
|
+
return spansOf(new RegExp(`(?:${names})[\\w.*/-]*`, "gu"), source);
|
|
17427
|
+
};
|
|
17428
|
+
/** @internal */
|
|
17429
|
+
const ownerOffsets = ({ owner, scopes, source }) => {
|
|
17430
|
+
const allowed = scopedSpans(scopes, source);
|
|
17431
|
+
const named = new RegExp(escaped(owner), "giu");
|
|
17432
|
+
const isAllowed = (start) => pipe(allowed, Array$1.some((span) => span.start <= start && start < span.end));
|
|
17433
|
+
return pipe(spansOf(named, source), Array$1.filter(({ start }) => !isAllowed(start)), Array$1.map(({ start }) => start));
|
|
17434
|
+
};
|
|
17435
|
+
const scopesOf = (manifest) => pipe([...Option.toArray(Option.fromUndefinedOr(manifest.name)), ...namesIn(manifest, DECLARED)], Array$1.flatMap((name) => Option.toArray(scopeOfName(name))), Array$1.dedupe);
|
|
17436
|
+
const describedText = (manifest) => pipe([manifest.description ?? "", ...manifest.keywords ?? []], Array$1.join("\n"));
|
|
17437
|
+
const manifestProblems$3 = ({ owner, file, manifest }) => pipe(ownerOffsets({
|
|
17438
|
+
owner,
|
|
17439
|
+
scopes: scopesOf(manifest),
|
|
17440
|
+
source: describedText(manifest)
|
|
17441
|
+
}), Array$1.head, Option.toArray, Array$1.map(() => ({
|
|
17442
|
+
file,
|
|
17443
|
+
...positionOf("")(START$10),
|
|
17444
|
+
rule: RULE$17,
|
|
17445
|
+
message: `Its description or keywords ${messageFor$2(owner)}`
|
|
17446
|
+
})));
|
|
17447
|
+
const workspaceProblems = Effect.fn("workspaceProblems")(function* workspaceProblems(root, owner, directory) {
|
|
17448
|
+
const files = yield* RepositoryFiles;
|
|
17449
|
+
const manifest = yield* readManifest(directory);
|
|
17450
|
+
if (Option.isNone(manifest)) return [];
|
|
17451
|
+
const prefix = `${files.relative(root, directory)}${SEPARATOR$1}`;
|
|
17452
|
+
const names = yield* files.listedFiles(root);
|
|
17453
|
+
const listed = pipe(names, Array$1.filter((name) => String$1.startsWith(prefix)(name) && TEXT_FILE.test(name) && files.basename(name) !== PACKAGE_JSON_FILE && files.basename(name) !== CONFIG_FILE$1), Array$1.map((name) => ({
|
|
17454
|
+
name,
|
|
17455
|
+
file: files.join(root, name)
|
|
17456
|
+
})));
|
|
17457
|
+
const scopes = scopesOf(manifest.value);
|
|
17458
|
+
const inText = yield* scanText(listed, ({ file }, source) => pipe(ownerOffsets({
|
|
17459
|
+
owner,
|
|
17460
|
+
scopes,
|
|
17461
|
+
source
|
|
17462
|
+
}), Array$1.map((offset) => ({
|
|
17463
|
+
file,
|
|
17464
|
+
...positionOf(source)(offset),
|
|
17465
|
+
rule: RULE$17,
|
|
17466
|
+
message: messageFor$2(owner)
|
|
17467
|
+
}))));
|
|
17468
|
+
return [...manifestProblems$3({
|
|
17469
|
+
owner,
|
|
17470
|
+
file: files.join(directory, PACKAGE_JSON_FILE),
|
|
17471
|
+
manifest: manifest.value
|
|
17472
|
+
}), ...inText];
|
|
17473
|
+
});
|
|
17474
|
+
const anyOwnerDirectories = Effect.fn("anyOwnerDirectories")(function* anyOwnerDirectories(root) {
|
|
17475
|
+
const files = yield* RepositoryFiles;
|
|
17476
|
+
const names = yield* workspaceConfigs(root);
|
|
17477
|
+
const configs = pipe(names, Array$1.map((name) => ({
|
|
17478
|
+
name,
|
|
17479
|
+
file: files.join(root, name)
|
|
17480
|
+
})));
|
|
17481
|
+
return yield* scanText(configs, ({ file }, source) => pipe(Option.liftPredicate(files.dirname(file), () => ANY_OWNER.test(source)), Option.toArray));
|
|
17482
|
+
});
|
|
17483
|
+
/** @internal */
|
|
17484
|
+
const checkOwnerNames = Effect.fn("checkOwnerNames")(function* checkOwnerNames(root) {
|
|
17485
|
+
const origin = yield* repositoryOrigin(root);
|
|
17486
|
+
if (Option.isNone(origin)) return [];
|
|
17487
|
+
const directories = yield* anyOwnerDirectories(root);
|
|
17488
|
+
const found = yield* Effect.forEach(directories, (directory) => workspaceProblems(root, origin.value.owner, directory), { concurrency: 1 });
|
|
17489
|
+
return Array$1.flatten(found);
|
|
17490
|
+
});
|
|
17392
17491
|
// src/features/find-invisible-characters/model/hidden-unicode.ts
|
|
17393
17492
|
const HIDDEN = /[\u00AD\u180E\u200B\u200C\u200E\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]|(?<![\p{Extended_Pictographic}\p{Emoji_Modifier}\uFE0F])\u200D|\u200D(?!\p{Extended_Pictographic})|[\u{E0000}-\u{E007F}]/gu;
|
|
17394
17493
|
const NUL = "\0";
|
|
@@ -17427,7 +17526,11 @@ const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHidden
|
|
|
17427
17526
|
// src/app/document-checks.ts
|
|
17428
17527
|
/** @internal */
|
|
17429
17528
|
const checkDocuments = Effect.fn("checkDocuments")(function* checkDocuments(root) {
|
|
17430
|
-
const found = yield* Effect.all([
|
|
17529
|
+
const found = yield* Effect.all([
|
|
17530
|
+
checkHiddenUnicode(root),
|
|
17531
|
+
checkMarkdownDirectives(root),
|
|
17532
|
+
checkOwnerNames(root)
|
|
17533
|
+
], { concurrency: "unbounded" });
|
|
17431
17534
|
return Array$1.flatten(found);
|
|
17432
17535
|
});
|
|
17433
17536
|
// src/features/check-effect-diagnostics/model/effect-diagnostics.ts
|
|
@@ -17591,7 +17694,13 @@ const NAME_KEY = "\"name\"";
|
|
|
17591
17694
|
const START$5 = 0;
|
|
17592
17695
|
const unscopedName = (scope) => ({ manifest }) => pipe(Option.fromUndefinedOr(manifest.name), Option.filter((name) => !String$1.startsWith(scope)(name)));
|
|
17593
17696
|
const nameIndex = (source) => pipe(String$1.indexOf(NAME_KEY)(source), Option.getOrElse(() => START$5));
|
|
17594
|
-
const
|
|
17697
|
+
const BY_COUNT = Order.mapInput(Order.Number, ([, names]) => names.length);
|
|
17698
|
+
/** @internal */
|
|
17699
|
+
const sharedScope = (names) => pipe(names, Array$1.flatMap((name) => Option.toArray(scopeOfName(name))), Array$1.groupBy((scope) => scope), Record.toEntries, Array$1.sortBy(Order.mapInput(Order.String, ([scope]) => scope)), Array$1.match({
|
|
17700
|
+
onEmpty: () => Option.none(),
|
|
17701
|
+
onNonEmpty: (groups) => Option.some(Array$1.max(BY_COUNT)(groups)[START$5])
|
|
17702
|
+
}));
|
|
17703
|
+
const messageFor$1 = (scope, name) => `Most packages of this repository are published under the ${scope} scope, and one scope tells whose packages they are. Rename "${name}" to "${scope}${String$1.replace(/^@[^/]+\//u, "")(name)}".`;
|
|
17595
17704
|
/** @internal */
|
|
17596
17705
|
const scopeProblems = (scope) => (found) => pipe(unscopedName(scope)(found), Option.map((name) => problemAtIndex(RULE$11)(found.entry.file, found.source)(nameIndex(found.source), messageFor$1(scope, name))), Option.toArray);
|
|
17597
17706
|
// src/features/check-published-manifest/model/private-dependency.ts
|
|
@@ -17615,10 +17724,15 @@ const checkPublishedManifests = Effect.fn("checkPublishedManifests")(function* c
|
|
|
17615
17724
|
const files = yield* RepositoryFiles;
|
|
17616
17725
|
const homepage = homepageProblems(files.dirname);
|
|
17617
17726
|
const privateNames = yield* privateNamesIn(root);
|
|
17618
|
-
const { scope } = yield* ownerSettings(root);
|
|
17619
17727
|
const privateDependencies = privateDependencyProblems(privateNames);
|
|
17728
|
+
const names = [];
|
|
17729
|
+
yield* scanPublishedManifests(root, ({ manifest }) => {
|
|
17730
|
+
names.push(...Option.toArray(Option.fromUndefinedOr(manifest.name)));
|
|
17731
|
+
return [];
|
|
17732
|
+
});
|
|
17733
|
+
const scoped = pipe(sharedScope(names), Option.map(scopeProblems), Option.getOrElse(() => () => []));
|
|
17620
17734
|
return yield* scanPublishedManifests(root, (found) => [
|
|
17621
|
-
...
|
|
17735
|
+
...scoped(found),
|
|
17622
17736
|
...homepage(found),
|
|
17623
17737
|
...privateDependencies(found)
|
|
17624
17738
|
]);
|
|
@@ -18108,12 +18222,10 @@ const syncReadme = Effect.fn("syncReadme")(function* syncReadme({ directory, ski
|
|
|
18108
18222
|
yield* files.writeFile(file, expected);
|
|
18109
18223
|
return [problem$2(file, `The skills table between ${SKILLS_START} and ${SKILLS_END} is generated from the SKILL.md frontmatter of the plugin. msch rewrote it; commit the result.`)];
|
|
18110
18224
|
});
|
|
18225
|
+
const labelsOf = ({ published }) => pipe(Option.liftPredicate(ENGLISH_LABELS, () => published), Option.getOrElse(() => JAPANESE_LABELS));
|
|
18111
18226
|
/** @internal */
|
|
18112
18227
|
const checkReadmeSkills = Effect.fn("checkReadmeSkills")(function* checkReadmeSkills(root) {
|
|
18113
18228
|
const plugins = yield* pluginsIn$1(root);
|
|
18114
|
-
const { publishRegistry } = yield* ownerSettings(root);
|
|
18115
|
-
const english = isPublicRegistry(publishRegistry);
|
|
18116
|
-
const labelsOf = ({ published }) => pipe(Option.liftPredicate(ENGLISH_LABELS, () => published && english), Option.getOrElse(() => JAPANESE_LABELS));
|
|
18117
18229
|
const withSkills = pipe(plugins, Array$1.filter(({ skills }) => Array$1.isReadonlyArrayNonEmpty(skills)));
|
|
18118
18230
|
const found = yield* Effect.forEach(withSkills, (plugin) => syncReadme(plugin, labelsOf(plugin)), { concurrency: "unbounded" });
|
|
18119
18231
|
return Array$1.flatten(found);
|
|
@@ -18218,7 +18330,6 @@ const checkSkillEnumerations = Effect.fn("checkSkillEnumerations")(function* che
|
|
|
18218
18330
|
});
|
|
18219
18331
|
// src/features/check-skill-references/model/skill-references.ts
|
|
18220
18332
|
const RULE$2 = "skill-reference";
|
|
18221
|
-
const HUB = "masseater-style";
|
|
18222
18333
|
const OWNER_PREFIX = "do-";
|
|
18223
18334
|
const MARKDOWN$1 = ".md";
|
|
18224
18335
|
const CONCURRENCY$1 = 16;
|
|
@@ -18252,19 +18363,22 @@ const ownerOnlyMessages = (skill, qualified) => pipe(Option.liftPredicate(skill,
|
|
|
18252
18363
|
]));
|
|
18253
18364
|
const ownerProblems = (skill, qualified) => pipe([prefixMessage(skill), ...ownerOnlyMessages(skill, qualified)], Array$1.getSomes, Array$1.map((message) => problem$1(skill.file, message)));
|
|
18254
18365
|
const hubProblems = (hub, names) => pipe(groupsOf(NAMED_IN_BACKTICKS, hub.source), Array$1.filter((name) => !names.has(name)), Array$1.map((name) => problem$1(hub.file, `names ${name}, which is not a skill.`)));
|
|
18255
|
-
const documentProblems = Effect.fn("documentProblems")(function* documentProblems(file, skill, others) {
|
|
18366
|
+
const documentProblems = Effect.fn("documentProblems")(function* documentProblems({ file, hub }, skill, others) {
|
|
18256
18367
|
const text = yield* (yield* RepositoryFiles).readFile(file);
|
|
18257
18368
|
const body = String$1.replace(FRONTMATTER, "")(Option.getOrElse(text, () => ""));
|
|
18258
|
-
return pipe(others, Array$1.filter((other) => other.name !== skill.name && namesSkill(other.name)(body)), Array$1.map((other) => problem$1(file, `names ${other.name}. Only ${
|
|
18369
|
+
return pipe(others, Array$1.filter((other) => other.name !== skill.name && namesSkill(other.name)(body)), Array$1.map((other) => problem$1(file, `names ${other.name}. Only ${hub.name} names other skills; point to it from the hub instead.`)));
|
|
18259
18370
|
});
|
|
18260
|
-
const spokeProblems = Effect.fn("spokeProblems")(function* spokeProblems(skill, others) {
|
|
18371
|
+
const spokeProblems = Effect.fn("spokeProblems")(function* spokeProblems(hub, skill, others) {
|
|
18261
18372
|
const documents = pipe(skill.files, Array$1.filter(String$1.endsWith(MARKDOWN$1)));
|
|
18262
|
-
const found = yield* Effect.forEach(documents, (file) => documentProblems(
|
|
18373
|
+
const found = yield* Effect.forEach(documents, (file) => documentProblems({
|
|
18374
|
+
file,
|
|
18375
|
+
hub
|
|
18376
|
+
}, skill, others), { concurrency: CONCURRENCY$1 });
|
|
18263
18377
|
return Array$1.flatten(found);
|
|
18264
18378
|
});
|
|
18265
18379
|
const referencesFrom = Effect.fn("referencesFrom")(function* referencesFrom(hub, skills) {
|
|
18266
|
-
const others = pipe(skills, Array$1.filter((skill) => skill.name !==
|
|
18267
|
-
const spokes = yield* Effect.forEach(others, (skill) => spokeProblems(skill, others), { concurrency: CONCURRENCY$1 });
|
|
18380
|
+
const others = pipe(skills, Array$1.filter((skill) => skill.name !== hub.name && !isOwnerEntry(skill)));
|
|
18381
|
+
const spokes = yield* Effect.forEach(others, (skill) => spokeProblems(hub, skill, others), { concurrency: CONCURRENCY$1 });
|
|
18268
18382
|
const names = new Set(pipe(skills, Array$1.map(({ name }) => name)));
|
|
18269
18383
|
return [...hubProblems(hub, names), ...Array$1.flatten(spokes)];
|
|
18270
18384
|
});
|
|
@@ -18274,7 +18388,7 @@ const checkSkillReferences = Effect.fn("checkSkillReferences")(function* checkSk
|
|
|
18274
18388
|
const skills = pipe(plugins, Array$1.flatMap(({ skills: own }) => own));
|
|
18275
18389
|
const qualified = new Set(pipe(skills, Array$1.map(({ plugin, name }) => `${plugin}${QUALIFIER}${name}`)));
|
|
18276
18390
|
const owners = pipe(skills, Array$1.flatMap((skill) => ownerProblems(skill, qualified)));
|
|
18277
|
-
const hub = Array$1.findFirst(skills, ({
|
|
18391
|
+
const hub = Array$1.findFirst(skills, ({ frontmatter }) => isIndexSkill(frontmatter));
|
|
18278
18392
|
const hubbed = yield* Option.match(hub, {
|
|
18279
18393
|
onNone: () => Effect.succeed([]),
|
|
18280
18394
|
onSome: (found) => referencesFrom(found, skills)
|