@r_masseater/msch 0.98.0 → 0.100.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +1 -18
  2. package/dist/cargo-inputs.mjs +2 -2
  3. package/dist/cli.mjs +5215 -1075
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/config.d.mts +2 -2
  6. package/dist/config.mjs +2 -2
  7. package/dist/decision-rules.d.mts +1 -1
  8. package/dist/decision-rules.mjs +1 -1
  9. package/dist/{define-lint-preset-YcRo_ZW9.mjs → define-lint-preset-BnOZuTNT.mjs} +29 -133
  10. package/dist/define-lint-preset-BnOZuTNT.mjs.map +1 -0
  11. package/dist/{ignored-directories-D-7Rm_2X.mjs → ignored-directories-DVyp8bfD.mjs} +2 -2
  12. package/dist/{ignored-directories-D-7Rm_2X.mjs.map → ignored-directories-DVyp8bfD.mjs.map} +1 -1
  13. package/dist/{index-Dm0Gg9wS.d.mts → index-Cdap8t_F.d.mts} +2 -2
  14. package/dist/{index-CUrewm-i.d.mts → index-DbmdHsLx.d.mts} +43 -21
  15. package/dist/lint-rules.mjs +145 -17
  16. package/dist/lint-rules.mjs.map +1 -1
  17. package/dist/lint.d.mts +2 -2
  18. package/dist/lint.mjs +1 -1
  19. package/dist/oxlint.mjs +4 -3
  20. package/dist/oxlint.mjs.map +1 -1
  21. package/dist/{problem-DbuTeNvL.mjs → problem-BTQ96CJ5.mjs} +2 -2
  22. package/dist/{problem-DbuTeNvL.mjs.map → problem-BTQ96CJ5.mjs.map} +1 -1
  23. package/dist/{published-3eokcs_D.mjs → published-O6THHxdC.mjs} +172 -6
  24. package/dist/published-O6THHxdC.mjs.map +1 -0
  25. package/dist/{repository-files-DSwKJnrj.mjs → repository-files-BwjF-kJ8.mjs} +2 -2
  26. package/dist/{repository-files-DSwKJnrj.mjs.map → repository-files-BwjF-kJ8.mjs.map} +1 -1
  27. package/dist/{repository-text-DE4rRWEZ.mjs → repository-text-qZQSVg9L.mjs} +8 -8
  28. package/dist/repository-text-qZQSVg9L.mjs.map +1 -0
  29. package/dist/workspace-settings.d.mts +1 -1
  30. package/dist/workspace-settings.mjs +3 -4
  31. package/dist/workspace-settings.mjs.map +1 -1
  32. package/package.json +5 -13
  33. package/skills/msch-checks/SKILL.md +10 -10
  34. package/skills/msch-publishing/SKILL.md +12 -12
  35. package/skills/msch-repository-config/SKILL.md +2 -2
  36. package/dist/base-revision-Bl-4nxAd.mjs +0 -15
  37. package/dist/base-revision-Bl-4nxAd.mjs.map +0 -1
  38. package/dist/changed.d.mts +0 -1
  39. package/dist/changed.mjs +0 -245
  40. package/dist/changed.mjs.map +0 -1
  41. package/dist/cli-contract-D7btWrEu.mjs +0 -5
  42. package/dist/cli-contract-D7btWrEu.mjs.map +0 -1
  43. package/dist/define-lint-preset-YcRo_ZW9.mjs.map +0 -1
  44. package/dist/exits.d.mts +0 -1
  45. package/dist/exits.mjs +0 -40
  46. package/dist/exits.mjs.map +0 -1
  47. package/dist/judge.d.mts +0 -1
  48. package/dist/judge.mjs +0 -415
  49. package/dist/judge.mjs.map +0 -1
  50. package/dist/lookup-report-L5OLXRMf.mjs +0 -29
  51. package/dist/lookup-report-L5OLXRMf.mjs.map +0 -1
  52. package/dist/manifest-texts-DPgsV8kj.mjs +0 -19
  53. package/dist/manifest-texts-DPgsV8kj.mjs.map +0 -1
  54. package/dist/output-DAvdel9H.mjs +0 -33
  55. package/dist/output-DAvdel9H.mjs.map +0 -1
  56. package/dist/package-routes-BQWX5ttU.mjs +0 -73
  57. package/dist/package-routes-BQWX5ttU.mjs.map +0 -1
  58. package/dist/package-versions-sx15IGwA.mjs +0 -92
  59. package/dist/package-versions-sx15IGwA.mjs.map +0 -1
  60. package/dist/pass-records-BcAAWgiQ.mjs +0 -437
  61. package/dist/pass-records-BcAAWgiQ.mjs.map +0 -1
  62. package/dist/publish.d.mts +0 -1
  63. package/dist/publish.mjs +0 -1596
  64. package/dist/publish.mjs.map +0 -1
  65. package/dist/published-3eokcs_D.mjs.map +0 -1
  66. package/dist/published.d.mts +0 -1
  67. package/dist/published.mjs +0 -134
  68. package/dist/published.mjs.map +0 -1
  69. package/dist/refs.d.mts +0 -1
  70. package/dist/refs.mjs +0 -232
  71. package/dist/refs.mjs.map +0 -1
  72. package/dist/registries-DePiYd3D.mjs +0 -11
  73. package/dist/registries-DePiYd3D.mjs.map +0 -1
  74. package/dist/registry-releases-BBtz4wGE.mjs +0 -62
  75. package/dist/registry-releases-BBtz4wGE.mjs.map +0 -1
  76. package/dist/repository-text-DE4rRWEZ.mjs.map +0 -1
  77. package/dist/runtime-Djm7zMwu.mjs +0 -13
  78. package/dist/runtime-Djm7zMwu.mjs.map +0 -1
  79. package/dist/specifiers-BrCyPubD.mjs +0 -32
  80. package/dist/specifiers-BrCyPubD.mjs.map +0 -1
  81. package/dist/tree-sitter-BfzHNwTR.mjs +0 -41
  82. package/dist/tree-sitter-BfzHNwTR.mjs.map +0 -1
  83. package/dist/unbumped.d.mts +0 -1
  84. package/dist/unbumped.mjs +0 -19
  85. package/dist/unbumped.mjs.map +0 -1
  86. package/dist/upstream-exits-4bn4gblF.mjs +0 -357
  87. package/dist/upstream-exits-4bn4gblF.mjs.map +0 -1
  88. package/dist/upstream-record-DRNGym9S.mjs +0 -136
  89. package/dist/upstream-record-DRNGym9S.mjs.map +0 -1
  90. package/dist/upstream.d.mts +0 -1
  91. package/dist/upstream.mjs +0 -104
  92. package/dist/upstream.mjs.map +0 -1
  93. package/dist/workspace-manifest-BAVyPzbA.mjs +0 -8
  94. package/dist/workspace-manifest-BAVyPzbA.mjs.map +0 -1
  95. package/dist/workspace-projects-MpL8K7Nz.mjs +0 -172
  96. package/dist/workspace-projects-MpL8K7Nz.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"published.mjs","names":["Arr","Rec","Str"],"sources":["../src/features/check-published-versions/model/overdue.ts","../src/features/check-published-versions/model/published-dependencies.ts","../bin/msch-published.ts"],"sourcesContent":["import { decodePackageJson } from \"@r_masseater/masseater-utils/kestrion/npm\";\nimport { Clock, Effect, Option, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst PUBLISH_WINDOW_MS = 7_200_000;\n\n/** @internal */\nexport interface Landed {\n readonly file: string;\n readonly version: string;\n}\n\nconst versionAt = (\n root: string,\n tip: string,\n { file }: Landed,\n): Effect.Effect<Option.Option<string>, never, RepositoryFiles> =>\n RepositoryFiles.pipe(\n Effect.flatMap((files) => files.readAtRevision(root, tip, file)),\n Effect.map((before) =>\n pipe(\n before,\n Option.flatMap(decodePackageJson),\n Option.flatMap(({ version }) => Option.fromUndefinedOr(version)),\n ),\n ),\n );\n\nconst publishWindowPassed = (\n root: string,\n { file }: Landed,\n): Effect.Effect<boolean, never, RepositoryFiles> =>\n Effect.gen(function* passed() {\n const files = yield* RepositoryFiles;\n const committed = yield* files.committedAt(root, file);\n const now = yield* Clock.currentTimeMillis;\n return Option.exists(committed, (at) => now - at >= PUBLISH_WINDOW_MS);\n });\n\n/** @internal */\nexport interface Due {\n readonly root: string;\n readonly tip: string;\n readonly sibling: Option.Option<Landed>;\n}\n\n/** @internal */\nexport const overdue = ({\n root,\n tip,\n sibling,\n}: Due): Effect.Effect<boolean, never, RepositoryFiles> =>\n Option.match(sibling, {\n onNone: () => Effect.succeed(true),\n onSome: (found) =>\n Effect.gen(function* overdueSibling() {\n const before = yield* versionAt(root, tip, found);\n if (!Option.contains(before, found.version)) {\n return false;\n }\n return yield* publishWindowPassed(root, found);\n }),\n });\n","import { decodePackageJson } from \"@r_masseater/masseater-utils/kestrion/npm\";\nimport {\n Array as Arr,\n Effect,\n HashMap,\n Option,\n Record as Rec,\n Schema,\n String as Str,\n pipe,\n} from \"effect\";\nimport { HttpClientResponse } from \"effect/http\";\nimport type { HttpClient } from \"effect/http\";\nimport semver from \"semver\";\n\nimport { fieldsOf, namedCatalogsOf, specifiedIn } from \"#/entities/package/index.ts\";\nimport type { Specified } from \"#/entities/package/index.ts\";\nimport { workspaceManifest } from \"#/entities/workspace/index.ts\";\nimport { baseName } from \"#/shared/lib/base-revision.ts\";\nimport { manifestTexts } from \"#/shared/lib/manifest-texts.ts\";\nimport { abbreviatedPackument, isOwnPackage, packageRoutes } from \"#/shared/lib/package-routes.ts\";\nimport type { PackageRoutes } from \"#/shared/lib/package-routes.ts\";\n\nimport { overdue } from \"./overdue.ts\";\n\nconst WORKSPACE_PROTOCOL = \"workspace:\";\nconst CATALOG_PROTOCOL = \"catalog:\";\nconst UNVERSIONED = \"0.0.0\";\nconst FIRST_LINE = 1;\nconst READ_CONCURRENCY = 16;\nconst LOOKUP_CONCURRENCY = 4;\nconst SECTIONS = [\"dependencies\", \"optionalDependencies\"] as const;\n\n/** @internal */\nexport interface MissingVersion {\n readonly file: string;\n readonly line: number;\n readonly dependency: string;\n readonly reason: string;\n}\n\nconst Packument = Schema.Struct({ versions: Schema.Record(Schema.String, Schema.Unknown) });\n\ninterface Package {\n readonly file: string;\n readonly name: string;\n readonly version: string;\n readonly text: string;\n readonly specified: readonly Specified[];\n}\n\nconst packageAt = (file: string, text: string): Option.Option<Package> =>\n pipe(\n decodePackageJson(text),\n Option.filter((manifest) => manifest.private !== true),\n Option.flatMap((manifest) =>\n Option.all({\n name: Option.fromUndefinedOr(manifest.name),\n version: Option.fromUndefinedOr(manifest.version),\n }).pipe(\n Option.filter(({ version }) => version !== UNVERSIONED),\n Option.map(({ name, version }): Package => ({\n file,\n name,\n version,\n text,\n specified: pipe(\n SECTIONS,\n Arr.flatMap((section) => specifiedIn(manifest[section])),\n ),\n })),\n ),\n ),\n );\n\nconst OK = 200;\nconst NOT_FOUND = 404;\n\ntype Versions = Effect.Effect<Option.Option<readonly string[]>, unknown>;\n\nconst versionsIn = (response: HttpClientResponse.HttpClientResponse): Versions => {\n if (response.status === OK) {\n return HttpClientResponse.schemaBodyJson(Packument)(response).pipe(\n Effect.map(({ versions }) => Option.some(Rec.keys(versions))),\n );\n }\n if (response.status === NOT_FOUND) {\n return Effect.succeedSome<readonly string[]>([]);\n }\n return Effect.succeedNone;\n};\n\nconst publishedVersions = (\n name: string,\n): Effect.Effect<Option.Option<readonly string[]>, never, HttpClient.HttpClient> =>\n abbreviatedPackument(name).pipe(\n Effect.flatMap(versionsIn),\n Effect.orElseSucceed(() => Option.none<readonly string[]>()),\n );\n\nconst catalogRanges = (\n settings: Option.Option<Readonly<Record<string, unknown>>>,\n): HashMap.HashMap<string, string> =>\n pipe(\n settings,\n Option.map((found) => [\n ...pipe(\n specifiedIn(found[\"catalog\"]),\n Arr.map(({ name, specifier }) => [name, specifier] as const),\n ),\n ...pipe(\n namedCatalogsOf(found),\n Arr.flatMap(([, held]) => specifiedIn(held)),\n Arr.map(({ name, specifier }) => [name, specifier] as const),\n ),\n ]),\n Option.getOrElse((): readonly (readonly [string, string])[] => []),\n HashMap.fromIterable,\n );\n\nconst lineOf = (text: string, dependency: string): number =>\n pipe(\n Str.split(text, \"\\n\"),\n Arr.findFirstIndex((line) => Str.includes(`\"${dependency}\"`)(line)),\n Option.match({ onNone: () => FIRST_LINE, onSome: (index) => index + FIRST_LINE }),\n );\n\ninterface Wanted {\n readonly owner: Package;\n readonly name: string;\n readonly range: string;\n readonly sibling: Option.Option<Package>;\n}\n\nconst rangeOf = (\n catalog: HashMap.HashMap<string, string>,\n { name, specifier }: Specified,\n): Option.Option<string> => {\n if (Str.startsWith(CATALOG_PROTOCOL)(specifier)) {\n return HashMap.get(catalog, name);\n }\n return Option.some(specifier);\n};\n\nconst siblingWanted =\n (siblings: HashMap.HashMap<string, Package>, owner: Package) =>\n ({ name }: Specified): readonly Wanted[] =>\n pipe(\n HashMap.get(siblings, name),\n Option.map((sibling): Wanted => ({\n owner,\n name,\n range: sibling.version,\n sibling: Option.some(sibling),\n })),\n Option.toArray,\n );\n\ninterface Sources {\n readonly siblings: HashMap.HashMap<string, Package>;\n readonly catalog: HashMap.HashMap<string, string>;\n readonly routes: PackageRoutes;\n}\n\nconst registryWanted =\n ({ siblings, catalog, routes }: Sources, owner: Package) =>\n (specified: Specified): readonly Wanted[] =>\n pipe(\n Option.liftPredicate(specified, ({ name }) => isOwnPackage(routes)(name)),\n Option.flatMap((own) => rangeOf(catalog, own)),\n Option.map((range): Wanted => ({\n owner,\n name: specified.name,\n range,\n sibling: pipe(\n HashMap.get(siblings, specified.name),\n Option.filter(({ version }) => semver.satisfies(version, range)),\n ),\n })),\n Option.toArray,\n );\n\nconst wantedBy =\n (sources: Sources) =>\n (owner: Package): readonly Wanted[] =>\n pipe(\n owner.specified,\n Arr.flatMap((specified) => {\n if (Str.startsWith(WORKSPACE_PROTOCOL)(specified.specifier)) {\n return siblingWanted(sources.siblings, owner)(specified);\n }\n return registryWanted(sources, owner)(specified);\n }),\n );\n\nconst lookupsOf = (\n wanted: readonly Wanted[],\n): Effect.Effect<\n HashMap.HashMap<string, Option.Option<readonly string[]>>,\n never,\n HttpClient.HttpClient\n> =>\n pipe(\n wanted,\n Arr.map(({ name }) => name),\n Arr.dedupe,\n (names) =>\n Effect.forEach(\n names,\n (name) => Effect.map(publishedVersions(name), (found) => [name, found] as const),\n { concurrency: LOOKUP_CONCURRENCY },\n ),\n Effect.map(HashMap.fromIterable),\n );\n\nconst reasonOf = (sibling: Option.Option<Package>): string =>\n Option.match(sibling, {\n onNone: () => \"is not on npm. Publish it first, or lower the range to a version that is.\",\n onSome: ({ file }) =>\n `is still not on npm two hours after ${file} reached main. Read the failed publish run for it.`,\n });\n\nconst missingIn =\n (known: HashMap.HashMap<string, Option.Option<readonly string[]>>) =>\n ({ owner, name, range, sibling }: Wanted): readonly MissingVersion[] =>\n pipe(\n HashMap.get(known, name),\n Option.flatten,\n Option.filter((published) => semver.maxSatisfying([...published], range) === null),\n Option.map((): MissingVersion => ({\n file: owner.file,\n line: lineOf(owner.text, name),\n dependency: `${name}@${range}`,\n reason: reasonOf(sibling),\n })),\n Option.toArray,\n );\n\nconst wantedIn = Effect.fn(\"wantedIn\")(function* wantedIn(root: string) {\n const manifests = yield* manifestTexts(root);\n const packages = pipe(\n manifests,\n Arr.flatMap(({ file, text }) => Option.toArray(packageAt(file, text))),\n );\n const siblings = HashMap.fromIterable(\n pipe(\n packages,\n Arr.map((found) => [found.name, found] as const),\n ),\n );\n const settings = yield* workspaceManifest(root);\n const catalog = catalogRanges(pipe(settings, Option.map(fieldsOf)));\n const routes = yield* packageRoutes(root);\n return pipe(packages, Arr.flatMap(wantedBy({ siblings, catalog, routes })));\n});\n\n/** @internal */\nexport const missingVersions = Effect.fn(\"missingVersions\")(function* missingVersions(\n root: string,\n) {\n const tip = yield* baseName;\n const wanted = yield* wantedIn(root);\n const due = yield* Effect.filter(wanted, ({ sibling }) => overdue({ root, tip, sibling }), {\n concurrency: READ_CONCURRENCY,\n });\n const known = yield* lookupsOf(due);\n return pipe(due, Arr.flatMap(missingIn(known)));\n});\n","#!/usr/bin/env node\nimport { Schema } from \"effect\";\n\nimport { lookupReport } from \"#/app/lookup-report.ts\";\nimport { runCli } from \"#/app/runtime.ts\";\nimport { missingVersions } from \"#/features/check-published-versions/index.ts\";\n\nconst Row = Schema.Struct({\n file: Schema.String,\n line: Schema.Finite,\n dependency: Schema.String,\n reason: Schema.String,\n});\n\ntype RowType = typeof Row.Type;\n\nconst describeRow = (row: RowType): string =>\n `${row.file}:${String(row.line)} ${row.dependency} ${row.reason}`;\n\nrunCli(\"msch-published\")(lookupReport({ row: Row, rows: missingVersions, describe: describeRow }));\n"],"mappings":";;;;;;;;;;;;;;AAKA,MAAM,oBAAoB;AAQ1B,MAAM,aACJ,MACA,KACA,EAAE,WAEF,gBAAgB,KACd,OAAO,SAAS,UAAU,MAAM,eAAe,MAAM,KAAK,IAAI,CAAC,GAC/D,OAAO,KAAK,WACV,KACE,QACA,OAAO,QAAQ,iBAAiB,GAChC,OAAO,SAAS,EAAE,cAAc,OAAO,gBAAgB,OAAO,CAAC,CACjE,CACF,CACF;AAEF,MAAM,uBACJ,MACA,EAAE,WAEF,O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K,GAAG,OAAO,IAAI,IAAI,EAAE,GAAG,IAAI,WAAW,GAAG,IAAI;AAE3D,OAAO,gBAAgB,CAAC,CAAC,aAAa;CAAE,KAAK;CAAK,MAAM;CAAiB,UAAU;AAAY,CAAC,CAAC"}
package/dist/refs.d.mts DELETED
@@ -1 +0,0 @@
1
- export {}
package/dist/refs.mjs DELETED
@@ -1,232 +0,0 @@
1
- #!/usr/bin/env node
2
- import { t as lookupReport } from "./lookup-report-L5OLXRMf.mjs";
3
- import { t as runCli } from "./runtime-Djm7zMwu.mjs";
4
- import { r as RepositoryFiles, s as groupOf } from "./repository-files-DSwKJnrj.mjs";
5
- import { c as jsonLookup, s as githubToken, t as abbreviatedLookup, u as sent } from "./package-routes-BQWX5ttU.mjs";
6
- import { n as readTree, t as loadLanguage } from "./tree-sitter-BfzHNwTR.mjs";
7
- import { Array, Effect, HashMap, HashSet, Match, Option, Record, Schema, String as String$1, pipe } from "effect";
8
- import { NO_PATH, describeReference, linksIn, referenceOf } from "@r_masseater/y8";
9
- import { HttpClientResponse } from "effect/http";
10
- // src/features/check-references/model/markdown-texts.ts
11
- const MARKDOWN = ".md";
12
- const FIXTURE = /(?:^|\/)fixtures\//u;
13
- const READ_CONCURRENCY = 16;
14
- /** @internal */
15
- const markdownTexts = Effect.fn("markdownTexts")(function* markdownTexts(root) {
16
- const files = yield* RepositoryFiles;
17
- const listed = yield* files.listedFiles(root);
18
- const documents = pipe(listed, Array.filter((file) => String$1.endsWith(MARKDOWN)(file) && !FIXTURE.test(file)), Array.map((file) => files.join(root, file)));
19
- const read = yield* Effect.forEach(documents, (file) => Effect.map(files.readFile(file), Option.map((source) => ({
20
- file,
21
- source
22
- }))), { concurrency: READ_CONCURRENCY });
23
- return Array.getSomes(read);
24
- });
25
- // src/features/check-references/model/declared-symbols.ts
26
- const GRAMMAR_OF = {
27
- ts: "typescript",
28
- mts: "typescript",
29
- cts: "typescript",
30
- tsx: "tsx",
31
- js: "javascript",
32
- mjs: "javascript",
33
- cjs: "javascript",
34
- jsx: "javascript",
35
- rs: "rust",
36
- py: "python",
37
- go: "go",
38
- java: "java",
39
- rb: "ruby",
40
- php: "php",
41
- cs: "c-sharp",
42
- cpp: "cpp"
43
- };
44
- const IMPLEMENTATION = "impl_item";
45
- const NAME_FIELD = "name";
46
- const TYPE_FIELD = "type";
47
- const SEPARATOR$1 = ".";
48
- const EXTENSION = /\.(?<extension>[^./]+)$/u;
49
- const FIRST = 0;
50
- const ONE = 1;
51
- const supportedExtensions = Record.keys(GRAMMAR_OF);
52
- const grammarOf = (path) => pipe(groupOf("extension")(EXTENSION.exec(path)), Option.flatMap((extension) => Record.get(GRAMMAR_OF, extension)));
53
- const implementedType = (node) => pipe(Option.liftPredicate(node, ({ type }) => type === IMPLEMENTATION), Option.flatMap((implementation) => Option.fromNullishOr(implementation.childForFieldName(TYPE_FIELD))));
54
- const nameNodeOf = (node) => pipe(Option.fromNullishOr(node.childForFieldName(NAME_FIELD)), Option.orElse(() => implementedType(node)));
55
- const suffixesOf = (chain) => pipe(Array.range(FIRST, chain.length - ONE), Array.map((from) => Array.join(Array.drop(chain, from), SEPARATOR$1)));
56
- const childrenOf = (node) => pipe(node.namedChildren, Array.flatMap((child) => Option.toArray(Option.fromNullishOr(child))));
57
- const namesUnder = (node, enclosing) => {
58
- const own = Option.map(nameNodeOf(node), ({ text }) => text);
59
- const chain = Option.match(own, {
60
- onNone: () => enclosing,
61
- onSome: (name) => [...enclosing, name]
62
- });
63
- return [...Option.match(own, {
64
- onNone: () => [],
65
- onSome: () => suffixesOf(chain)
66
- }), ...Array.flatMap(childrenOf(node), (child) => namesUnder(child, chain))];
67
- };
68
- const declaredSymbols = Effect.fn("declaredSymbols")(function* declaredSymbols(grammar, source) {
69
- const language = yield* loadLanguage(grammar);
70
- return pipe(readTree({
71
- language,
72
- source,
73
- read: (root) => HashSet.fromIterable(namesUnder(root, []))
74
- }), Option.getOrElse(() => HashSet.empty()));
75
- });
76
- // src/features/check-references/model/resolve-reference.ts
77
- const GITHUB = "https://api.github.com/repos/";
78
- const RAW = "application/vnd.github.raw+json";
79
- const NOT_FOUND = 404;
80
- const MULTIPLE_CHOICES = 300;
81
- const SEPARATOR = "/";
82
- const LATEST = "latest";
83
- const found = { kind: "found" };
84
- const broken = (reason) => ({
85
- kind: "broken",
86
- reason
87
- });
88
- const unchecked = (reason) => ({
89
- kind: "unchecked",
90
- reason
91
- });
92
- const Repository = Schema.Struct({
93
- full_name: Schema.String,
94
- archived: Schema.Boolean,
95
- default_branch: Schema.String
96
- });
97
- const Version = Schema.Struct({ deprecated: Schema.optional(Schema.String) });
98
- const Packument = Schema.Struct({
99
- "dist-tags": Schema.Record(Schema.String, Schema.String),
100
- versions: Schema.Record(Schema.String, Version)
101
- });
102
- const answered = (lookup, missing, next) => Effect.flatMap(sent(lookup), (response) => {
103
- if (response.status === NOT_FOUND) return Effect.succeed(broken(missing));
104
- if (response.status >= MULTIPLE_CHOICES) return Effect.succeed(unchecked(`the lookup answered HTTP ${String(response.status)}`));
105
- return next(response);
106
- });
107
- const encodedPath = (path) => pipe(String$1.split(path, SEPARATOR), Array.map(encodeURIComponent), Array.join(SEPARATOR));
108
- const repositoryOutcome = ({ owner, repo }, repository) => {
109
- if (String$1.toLowerCase(repository.full_name) !== String$1.toLowerCase(`${owner}/${repo}`)) return broken(`${owner}/${repo} has moved to ${repository.full_name}. Point at the new name.`);
110
- if (repository.archived) return broken(`${owner}/${repo} is archived. Point at the repository that replaced it, or drop the pointer.`);
111
- return found;
112
- };
113
- const symbolOutcome = Effect.fn("symbolOutcome")(function* symbolOutcome({ path }, symbol, source) {
114
- const grammar = grammarOf(path);
115
- if (Option.isNone(grammar)) return broken(`${path} is not a file msch can read symbols from. Drop #${symbol}, or point at a file with one of the extensions ${Array.join(supportedExtensions, ", ")}.`);
116
- const declared = yield* Effect.option(declaredSymbols(grammar.value, source));
117
- return Option.match(declared, {
118
- onNone: () => unchecked(`the ${grammar.value} grammar could not read ${path}`),
119
- onSome: (names) => {
120
- if (HashSet.has(names, symbol)) return found;
121
- return broken(`${path} declares no ${symbol}. Fix the name or point at where it lives now.`);
122
- }
123
- });
124
- });
125
- const repositoryContentsOutcome = (reference, repository, token) => {
126
- const checked = repositoryOutcome(reference, repository);
127
- if (checked.kind !== "found" || reference.path === NO_PATH) return Effect.succeed(checked);
128
- const branch = Option.getOrElse(reference.ref, () => repository.default_branch);
129
- const url = `${GITHUB}${reference.owner}/${reference.repo}/contents/${encodedPath(reference.path)}?ref=${encodeURIComponent(branch)}`;
130
- const missing = `${reference.path} does not exist on ${branch} of ${reference.owner}/${reference.repo}. Point at where it lives now.`;
131
- return Option.match(reference.symbol, {
132
- onNone: () => answered(jsonLookup({
133
- url,
134
- token
135
- }), missing, () => Effect.succeed(found)),
136
- onSome: (symbol) => answered({
137
- url,
138
- token,
139
- accept: RAW
140
- }, missing, (response) => response.text.pipe(Effect.flatMap((source) => symbolOutcome(reference, symbol, source))))
141
- });
142
- };
143
- const githubOutcome = Effect.fn("githubOutcome")(function* githubOutcome(reference) {
144
- const token = yield* githubToken;
145
- const lookup = jsonLookup({
146
- url: `${GITHUB}${reference.owner}/${reference.repo}`,
147
- token
148
- });
149
- const missing = `${reference.owner}/${reference.repo} does not exist, or the token in GH_TOKEN cannot read it.`;
150
- return yield* answered(lookup, missing, (response) => Effect.flatMap(HttpClientResponse.schemaBodyJson(Repository)(response), (repository) => repositoryContentsOutcome(reference, repository, token)));
151
- });
152
- const versionOf = ({ "dist-tags": tags }, requested) => Option.match(requested, {
153
- onNone: () => Option.fromNullishOr(tags[LATEST]),
154
- onSome: (asked) => Option.some(Option.getOrElse(Option.fromNullishOr(tags[asked]), () => asked))
155
- });
156
- const versionOutcome = ({ name, version }, packument) => Option.match(versionOf(packument, version), {
157
- onNone: () => broken(`${name} has no ${LATEST} tag.`),
158
- onSome: (resolved) => Option.match(Option.fromNullishOr(packument.versions[resolved]), {
159
- onNone: () => broken(`${name}@${resolved} is not published on npm.`),
160
- onSome: ({ deprecated }) => Option.match(Option.fromNullishOr(deprecated), {
161
- onNone: () => found,
162
- onSome: (message) => broken(`${name}@${resolved} is deprecated: ${message}`)
163
- })
164
- })
165
- });
166
- const npmOutcome = (reference) => answered(abbreviatedLookup(reference.name), `${reference.name} is not published on npm.`, (response) => Effect.map(HttpClientResponse.schemaBodyJson(Packument)(response), (packument) => versionOutcome(reference, packument)));
167
- /** @internal */
168
- const resolveReference = (reference) => Match.value(reference).pipe(Match.discriminatorsExhaustive("kind")({
169
- github: githubOutcome,
170
- npm: npmOutcome
171
- }), Effect.match({
172
- onFailure: (failure) => unchecked(`the lookup failed: ${String(failure)}`),
173
- onSuccess: (outcome) => outcome
174
- }));
175
- // src/features/check-references/model/unresolved-references.ts
176
- const LOOKUP_CONCURRENCY = 4;
177
- const occurrencesIn = (links) => pipe(links, Array.flatMap(({ path, line, destination }) => pipe(referenceOf(destination), Option.map((reference) => ({
178
- file: path,
179
- line,
180
- reference
181
- })), Option.toArray)));
182
- const unresolvedAt = (place) => (outcome) => {
183
- if (outcome.kind === "found") return Option.none();
184
- return Option.some({
185
- ...place,
186
- outcome: outcome.kind,
187
- reason: outcome.reason
188
- });
189
- };
190
- const unresolvedOf = (outcomes) => ({ file, line, reference }) => {
191
- const described = describeReference(reference);
192
- return pipe(outcomes, HashMap.get(described), Option.flatMap(unresolvedAt({
193
- file,
194
- line,
195
- reference: described
196
- })), Option.toArray);
197
- };
198
- /** @internal */
199
- const unresolvedReferences = Effect.fn("unresolvedReferences")(function* unresolvedReferences(root) {
200
- const files = yield* RepositoryFiles;
201
- const texts = yield* markdownTexts(root);
202
- const links = yield* linksIn(pipe(texts, Array.map(({ file, source }) => ({
203
- path: files.relative(root, file),
204
- text: source
205
- }))));
206
- const occurrences = occurrencesIn(links);
207
- const distinct = pipe(occurrences, Array.dedupeWith((left, right) => describeReference(left.reference) === describeReference(right.reference)), Array.map(({ reference }) => reference));
208
- const resolved = yield* Effect.forEach(distinct, (reference) => Effect.map(resolveReference(reference), (outcome) => [describeReference(reference), outcome]), { concurrency: LOOKUP_CONCURRENCY });
209
- const outcomes = HashMap.fromIterable(resolved);
210
- return pipe(occurrences, Array.flatMap(unresolvedOf(outcomes)));
211
- });
212
- // bin/msch-refs.ts
213
- const Row = Schema.Struct({
214
- file: Schema.String,
215
- line: Schema.Finite,
216
- reference: Schema.String,
217
- outcome: Schema.Literals(["broken", "unchecked"]),
218
- reason: Schema.String
219
- });
220
- const VERDICTS = {
221
- broken: "is stale:",
222
- unchecked: "could not be checked:"
223
- };
224
- const describeRow = (row) => `${row.file}:${String(row.line)} ${row.reference} ${VERDICTS[row.outcome]} ${row.reason}`;
225
- runCli("msch-refs")(lookupReport({
226
- row: Row,
227
- rows: unresolvedReferences,
228
- describe: describeRow
229
- }));
230
- export {};
231
-
232
- //# sourceMappingURL=refs.mjs.map
package/dist/refs.mjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"refs.mjs","names":["Arr","Str","SEPARATOR","Rec","Arr","Str","Arr","Arr"],"sources":["../src/features/check-references/model/markdown-texts.ts","../src/features/check-references/model/declared-symbols.ts","../src/features/check-references/model/resolve-reference.ts","../src/features/check-references/model/unresolved-references.ts","../bin/msch-refs.ts"],"sourcesContent":["import { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst MARKDOWN = \".md\";\nconst FIXTURE = /(?:^|\\/)fixtures\\//u;\nconst READ_CONCURRENCY = 16;\n\n/** @internal */\nexport interface MarkdownText {\n readonly file: string;\n readonly source: string;\n}\n\n/** @internal */\nexport const markdownTexts = Effect.fn(\"markdownTexts\")(function* markdownTexts(root: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.listedFiles(root);\n const documents = pipe(\n listed,\n Arr.filter((file) => Str.endsWith(MARKDOWN)(file) && !FIXTURE.test(file)),\n Arr.map((file) => files.join(root, file)),\n );\n const read = yield* Effect.forEach(\n documents,\n (file) =>\n Effect.map(\n files.readFile(file),\n Option.map((source): MarkdownText => ({ file, source })),\n ),\n { concurrency: READ_CONCURRENCY },\n );\n return Arr.getSomes(read);\n});\n","import { groupOf } from \"@masseater.dev/lint-host/collections\";\nimport { Array as Arr, Effect, HashSet, Option, Record as Rec, pipe } from \"effect\";\n\nimport { loadLanguage, readTree } from \"#/shared/lib/tree-sitter.ts\";\nimport type { SyntaxNode } from \"#/shared/lib/tree-sitter.ts\";\n\nconst GRAMMAR_OF: Readonly<Record<string, string>> = {\n ts: \"typescript\",\n mts: \"typescript\",\n cts: \"typescript\",\n tsx: \"tsx\",\n js: \"javascript\",\n mjs: \"javascript\",\n cjs: \"javascript\",\n jsx: \"javascript\",\n rs: \"rust\",\n py: \"python\",\n go: \"go\",\n java: \"java\",\n rb: \"ruby\",\n php: \"php\",\n cs: \"c-sharp\",\n cpp: \"cpp\",\n};\nconst IMPLEMENTATION = \"impl_item\";\nconst NAME_FIELD = \"name\";\nconst TYPE_FIELD = \"type\";\nconst SEPARATOR = \".\";\nconst EXTENSION = /\\.(?<extension>[^./]+)$/u;\nconst FIRST = 0;\nconst ONE = 1;\n\nexport const supportedExtensions: readonly string[] = Rec.keys(GRAMMAR_OF);\n\nexport const grammarOf = (path: string): Option.Option<string> =>\n pipe(\n groupOf(\"extension\")(EXTENSION.exec(path)),\n Option.flatMap((extension) => Rec.get(GRAMMAR_OF, extension)),\n );\n\nconst implementedType = (node: SyntaxNode): Option.Option<SyntaxNode> =>\n pipe(\n Option.liftPredicate(node, ({ type }) => type === IMPLEMENTATION),\n Option.flatMap((implementation) =>\n Option.fromNullishOr(implementation.childForFieldName(TYPE_FIELD)),\n ),\n );\n\nconst nameNodeOf = (node: SyntaxNode): Option.Option<SyntaxNode> =>\n pipe(\n Option.fromNullishOr(node.childForFieldName(NAME_FIELD)),\n Option.orElse(() => implementedType(node)),\n );\n\nconst suffixesOf = (chain: readonly string[]): readonly string[] =>\n pipe(\n Arr.range(FIRST, chain.length - ONE),\n Arr.map((from) => Arr.join(Arr.drop(chain, from), SEPARATOR)),\n );\n\nconst childrenOf = (node: SyntaxNode): readonly SyntaxNode[] =>\n pipe(\n node.namedChildren,\n Arr.flatMap((child) => Option.toArray(Option.fromNullishOr(child))),\n );\n\nconst namesUnder = (node: SyntaxNode, enclosing: readonly string[]): readonly string[] => {\n const own = Option.map(nameNodeOf(node), ({ text }) => text);\n const chain = Option.match(own, {\n onNone: () => enclosing,\n onSome: (name) => [...enclosing, name],\n });\n const declared = Option.match(own, { onNone: () => [], onSome: () => suffixesOf(chain) });\n return [...declared, ...Arr.flatMap(childrenOf(node), (child) => namesUnder(child, chain))];\n};\n\nexport const declaredSymbols = Effect.fn(\"declaredSymbols\")(function* declaredSymbols(\n grammar: string,\n source: string,\n) {\n const language = yield* loadLanguage(grammar);\n return pipe(\n readTree({ language, source, read: (root) => HashSet.fromIterable(namesUnder(root, [])) }),\n Option.getOrElse(() => HashSet.empty<string>()),\n );\n});\n","import { NO_PATH } from \"@r_masseater/y8\";\nimport type { GithubReference, NpmReference, Reference } from \"@r_masseater/y8\";\nimport { Array as Arr, Effect, HashSet, Match, Option, Schema, String as Str, pipe } from \"effect\";\nimport { HttpClientResponse } from \"effect/http\";\nimport type { HttpClient, HttpClientError } from \"effect/http\";\n\nimport { githubToken, jsonLookup, sent } from \"#/shared/lib/lookup.ts\";\nimport type { Lookup } from \"#/shared/lib/lookup.ts\";\nimport { abbreviatedLookup } from \"#/shared/lib/package-routes.ts\";\n\nimport { declaredSymbols, grammarOf, supportedExtensions } from \"./declared-symbols.ts\";\n\nconst GITHUB = \"https://api.github.com/repos/\";\nconst RAW = \"application/vnd.github.raw+json\";\nconst NOT_FOUND = 404;\nconst MULTIPLE_CHOICES = 300;\nconst SEPARATOR = \"/\";\nconst LATEST = \"latest\";\n\n/** @internal */\nexport type Outcome =\n | { readonly kind: \"found\" }\n | { readonly kind: \"broken\"; readonly reason: string }\n | { readonly kind: \"unchecked\"; readonly reason: string };\n\nconst found: Outcome = { kind: \"found\" };\nconst broken = (reason: string): Outcome => ({ kind: \"broken\", reason });\nconst unchecked = (reason: string): Outcome => ({ kind: \"unchecked\", reason });\n\nconst Repository = Schema.Struct({\n full_name: Schema.String,\n archived: Schema.Boolean,\n default_branch: Schema.String,\n});\nconst Version = Schema.Struct({ deprecated: Schema.optional(Schema.String) });\nconst Packument = Schema.Struct({\n \"dist-tags\": Schema.Record(Schema.String, Schema.String),\n versions: Schema.Record(Schema.String, Version),\n});\n\ntype Failure = HttpClientError.HttpClientError | Schema.SchemaError;\ntype Lookups = Effect.Effect<Outcome, Failure, HttpClient.HttpClient>;\n\nconst answered = (\n lookup: Lookup,\n missing: string,\n next: (response: HttpClientResponse.HttpClientResponse) => Lookups,\n): Lookups =>\n Effect.flatMap(sent(lookup), (response) => {\n if (response.status === NOT_FOUND) {\n return Effect.succeed(broken(missing));\n }\n if (response.status >= MULTIPLE_CHOICES) {\n return Effect.succeed(unchecked(`the lookup answered HTTP ${String(response.status)}`));\n }\n return next(response);\n });\n\nconst encodedPath = (path: string): string =>\n pipe(Str.split(path, SEPARATOR), Arr.map(encodeURIComponent), Arr.join(SEPARATOR));\n\nconst repositoryOutcome = (\n { owner, repo }: GithubReference,\n repository: typeof Repository.Type,\n): Outcome => {\n if (Str.toLowerCase(repository.full_name) !== Str.toLowerCase(`${owner}/${repo}`)) {\n return broken(`${owner}/${repo} has moved to ${repository.full_name}. Point at the new name.`);\n }\n if (repository.archived) {\n return broken(\n `${owner}/${repo} is archived. Point at the repository that replaced it, or drop the pointer.`,\n );\n }\n return found;\n};\n\nconst symbolOutcome = Effect.fn(\"symbolOutcome\")(function* symbolOutcome(\n { path }: GithubReference,\n symbol: string,\n source: string,\n) {\n const grammar = grammarOf(path);\n if (Option.isNone(grammar)) {\n return broken(\n `${path} is not a file msch can read symbols from. Drop #${symbol}, or point at a file with one of the extensions ${Arr.join(supportedExtensions, \", \")}.`,\n );\n }\n const declared = yield* Effect.option(declaredSymbols(grammar.value, source));\n return Option.match(declared, {\n onNone: () => unchecked(`the ${grammar.value} grammar could not read ${path}`),\n onSome: (names) => {\n if (HashSet.has(names, symbol)) {\n return found;\n }\n return broken(`${path} declares no ${symbol}. Fix the name or point at where it lives now.`);\n },\n });\n});\n\nconst repositoryContentsOutcome = (\n reference: GithubReference,\n repository: typeof Repository.Type,\n token: Option.Option<string>,\n): Lookups => {\n const checked = repositoryOutcome(reference, repository);\n if (checked.kind !== \"found\" || reference.path === NO_PATH) {\n return Effect.succeed(checked);\n }\n const branch = Option.getOrElse(reference.ref, () => repository.default_branch);\n const url = `${GITHUB}${reference.owner}/${reference.repo}/contents/${encodedPath(reference.path)}?ref=${encodeURIComponent(branch)}`;\n const missing = `${reference.path} does not exist on ${branch} of ${reference.owner}/${reference.repo}. Point at where it lives now.`;\n return Option.match(reference.symbol, {\n onNone: () => answered(jsonLookup({ url, token }), missing, () => Effect.succeed(found)),\n onSome: (symbol) =>\n answered({ url, token, accept: RAW }, missing, (response) =>\n response.text.pipe(Effect.flatMap((source) => symbolOutcome(reference, symbol, source))),\n ),\n });\n};\n\nconst githubOutcome = Effect.fn(\"githubOutcome\")(function* githubOutcome(\n reference: GithubReference,\n) {\n const token = yield* githubToken;\n const lookup = jsonLookup({ url: `${GITHUB}${reference.owner}/${reference.repo}`, token });\n const missing = `${reference.owner}/${reference.repo} does not exist, or the token in GH_TOKEN cannot read it.`;\n return yield* answered(lookup, missing, (response) =>\n Effect.flatMap(HttpClientResponse.schemaBodyJson(Repository)(response), (repository) =>\n repositoryContentsOutcome(reference, repository, token),\n ),\n );\n});\n\nconst versionOf = (\n { \"dist-tags\": tags }: typeof Packument.Type,\n requested: Option.Option<string>,\n): Option.Option<string> =>\n Option.match(requested, {\n onNone: () => Option.fromNullishOr(tags[LATEST]),\n onSome: (asked) =>\n Option.some(Option.getOrElse(Option.fromNullishOr(tags[asked]), () => asked)),\n });\n\nconst versionOutcome = (\n { name, version }: NpmReference,\n packument: typeof Packument.Type,\n): Outcome =>\n Option.match(versionOf(packument, version), {\n onNone: () => broken(`${name} has no ${LATEST} tag.`),\n onSome: (resolved) =>\n Option.match(Option.fromNullishOr(packument.versions[resolved]), {\n onNone: () => broken(`${name}@${resolved} is not published on npm.`),\n onSome: ({ deprecated }) =>\n Option.match(Option.fromNullishOr(deprecated), {\n onNone: () => found,\n onSome: (message) => broken(`${name}@${resolved} is deprecated: ${message}`),\n }),\n }),\n });\n\nconst npmOutcome = (reference: NpmReference): Lookups =>\n answered(\n abbreviatedLookup(reference.name),\n `${reference.name} is not published on npm.`,\n (response) =>\n Effect.map(HttpClientResponse.schemaBodyJson(Packument)(response), (packument) =>\n versionOutcome(reference, packument),\n ),\n );\n\n/** @internal */\nexport const resolveReference = (\n reference: Reference,\n): Effect.Effect<Outcome, never, HttpClient.HttpClient> =>\n Match.value(reference).pipe(\n Match.discriminatorsExhaustive(\"kind\")({ github: githubOutcome, npm: npmOutcome }),\n Effect.match({\n onFailure: (failure) => unchecked(`the lookup failed: ${String(failure)}`),\n onSuccess: (outcome) => outcome,\n }),\n );\n","import { describeReference, linksIn, referenceOf } from \"@r_masseater/y8\";\nimport type { LinkAt, Reference } from \"@r_masseater/y8\";\nimport { Array as Arr, Effect, HashMap, Option, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { markdownTexts } from \"./markdown-texts.ts\";\nimport { resolveReference } from \"./resolve-reference.ts\";\nimport type { Outcome } from \"./resolve-reference.ts\";\n\nconst LOOKUP_CONCURRENCY = 4;\n\n/** @internal */\nexport interface UnresolvedReference {\n readonly file: string;\n readonly line: number;\n readonly reference: string;\n readonly outcome: \"broken\" | \"unchecked\";\n readonly reason: string;\n}\n\ninterface Occurrence {\n readonly file: string;\n readonly line: number;\n readonly reference: Reference;\n}\n\nconst occurrencesIn = (links: readonly LinkAt[]): readonly Occurrence[] =>\n pipe(\n links,\n Arr.flatMap(({ path, line, destination }) =>\n pipe(\n referenceOf(destination),\n Option.map((reference): Occurrence => ({ file: path, line, reference })),\n Option.toArray,\n ),\n ),\n );\n\ninterface Place {\n readonly file: string;\n readonly line: number;\n readonly reference: string;\n}\n\nconst unresolvedAt =\n (place: Place) =>\n (outcome: Outcome): Option.Option<UnresolvedReference> => {\n if (outcome.kind === \"found\") {\n return Option.none();\n }\n return Option.some({ ...place, outcome: outcome.kind, reason: outcome.reason });\n };\n\nconst unresolvedOf =\n (outcomes: HashMap.HashMap<string, Outcome>) =>\n ({ file, line, reference }: Occurrence): readonly UnresolvedReference[] => {\n const described = describeReference(reference);\n return pipe(\n outcomes,\n HashMap.get(described),\n Option.flatMap(unresolvedAt({ file, line, reference: described })),\n Option.toArray,\n );\n };\n\n/** @internal */\nexport const unresolvedReferences = Effect.fn(\"unresolvedReferences\")(\n function* unresolvedReferences(root: string) {\n const files = yield* RepositoryFiles;\n const texts = yield* markdownTexts(root);\n const links = yield* linksIn(\n pipe(\n texts,\n Arr.map(({ file, source }) => ({ path: files.relative(root, file), text: source })),\n ),\n );\n const occurrences = occurrencesIn(links);\n const distinct = pipe(\n occurrences,\n Arr.dedupeWith(\n (left, right) => describeReference(left.reference) === describeReference(right.reference),\n ),\n Arr.map(({ reference }) => reference),\n );\n const resolved = yield* Effect.forEach(\n distinct,\n (reference) =>\n Effect.map(\n resolveReference(reference),\n (outcome) => [describeReference(reference), outcome] as const,\n ),\n { concurrency: LOOKUP_CONCURRENCY },\n );\n const outcomes = HashMap.fromIterable(resolved);\n return pipe(occurrences, Arr.flatMap(unresolvedOf(outcomes)));\n },\n);\n","#!/usr/bin/env node\nimport { Schema } from \"effect\";\n\nimport { lookupReport } from \"#/app/lookup-report.ts\";\nimport { runCli } from \"#/app/runtime.ts\";\nimport { unresolvedReferences } from \"#/features/check-references/index.ts\";\n\nconst Row = Schema.Struct({\n file: Schema.String,\n line: Schema.Finite,\n reference: Schema.String,\n outcome: Schema.Literals([\"broken\", \"unchecked\"]),\n reason: Schema.String,\n});\n\ntype RowType = typeof Row.Type;\n\nconst VERDICTS: Readonly<Record<RowType[\"outcome\"], string>> = {\n broken: \"is stale:\",\n unchecked: \"could not be checked:\",\n};\n\nconst describeRow = (row: RowType): string =>\n `${row.file}:${String(row.line)} ${row.reference} ${VERDICTS[row.outcome]} ${row.reason}`;\n\nrunCli(\"msch-refs\")(lookupReport({ row: Row, rows: unresolvedReferences, describe: describeRow }));\n"],"mappings":";;;;;;;;;;AAIA,MAAM,WAAW;AACjB,MAAM,UAAU;AAChB,MAAM,mBAAmB;;AASzB,MAAa,gBAAgB,OAAO,GAAG,eAAe,CAAC,CAAC,UAAU,cAAc,MAAc;CAC5F,MAAM,QAAQ,OAAO;CACrB,MAAM,SAAS,OAAO,MAAM,YAAY,IAAI;CAC5C,MAAM,YAAY,KAChB,QACAA,MAAI,QAAQ,SAASC,SAAI,SAAS,QAAQ,CAAC,CAAC,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,GACxED,MAAI,KAAK,SAAS,MAAM,KAAK,MAAM,IAAI,CAAC,CAC1C;CACA,MAAM,OAAO,OAAO,OAAO,QACzB,YACC,SACC,OAAO,IACL,MAAM,SAAS,IAAI,GACnB,OAAO,KAAK,YAA0B;EAAE;EAAM;CAAO,EAAE,CACzD,GACF,EAAE,aAAa,iBAAiB,CAClC;CACA,OAAOA,MAAI,SAAS,IAAI;AAC1B,CAAC;;AC3BD,MAAM,aAA+C;CACnD,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACN,IAAI;CACJ,KAAK;CACL,IAAI;CACJ,KAAK;AACP;AACA,MAAM,iBAAiB;AACvB,MAAM,aAAa;AACnB,MAAM,aAAa;AACnB,MAAME,cAAY;AAClB,MAAM,YAAY;AAClB,MAAM,QAAQ;AACd,MAAM,MAAM;AAEZ,MAAa,sBAAyCC,OAAI,KAAK,UAAU;AAEzE,MAAa,aAAa,SACxB,KACE,QAAQ,WAAW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GACAA,MAAI,KAAK,EAAE,gBAAgB,SAAS,CACtC;CACA,MAAM,WAAW,OAAO,OAAO,QAC7B,WACC,cACC,OAAO,IACL,iBAAiB,SAAS,IACzB,YAAY,CAAC,kBAAkB,SAAS,GAAG,OAAO,CACrD,GACF,EAAE,aAAa,mBAAmB,CACpC;CACA,MAAM,WAAW,QAAQ,aAAa,QAAQ;CAC9C,OAAO,KAAK,aAAaA,MAAI,QAAQ,aAAa,QAAQ,CAAC,CAAC;AAC9D,CACF;;AC1FA,MAAM,MAAM,OAAO,OAAO;CACxB,MAAM,OAAO;CACb,MAAM,OAAO;CACb,WAAW,OAAO;CAClB,SAAS,OAAO,SAAS,CAAC,UAAU,WAAW,CAAC;CAChD,QAAQ,OAAO;AACjB,CAAC;AAID,MAAM,WAAyD;CAC7D,QAAQ;CACR,WAAW;AACb;AAEA,MAAM,eAAe,QACnB,GAAG,IAAI,KAAK,GAAG,OAAO,IAAI,IAAI,EAAE,GAAG,IAAI,UAAU,GAAG,SAAS,IAAI,SAAS,GAAG,IAAI;AAEnF,OAAO,WAAW,CAAC,CAAC,aAAa;CAAE,KAAK;CAAK,MAAM;CAAsB,UAAU;AAAY,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- import { Option, String, pipe } from "effect";
2
- // src/shared/lib/registries.ts
3
- const TRAILING_SLASH = /\/*$/u;
4
- const SCOPE_SEPARATOR = "/";
5
- const PUBLIC_REGISTRY = "https://registry.npmjs.org/";
6
- const INSTALL_REGISTRY = "https://npm.flatt.tech/";
7
- const withTrailingSlash = (url) => `${String.replace(TRAILING_SLASH, "")(url)}/`;
8
- const scopeOfName = (name) => pipe(Option.liftPredicate(name, String.startsWith("@")), Option.flatMap((scoped) => pipe(String.indexOf(SCOPE_SEPARATOR)(scoped), Option.map((end) => String.takeLeft(scoped, end + 1)))));
9
- export { withTrailingSlash as i, PUBLIC_REGISTRY as n, scopeOfName as r, INSTALL_REGISTRY as t };
10
-
11
- //# sourceMappingURL=registries-DePiYd3D.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registries-DePiYd3D.mjs","names":["Str"],"sources":["../src/shared/lib/registries.ts"],"sourcesContent":["import { Option, String as Str, pipe } from \"effect\";\n\nconst TRAILING_SLASH = /\\/*$/u;\nconst SCOPE_SEPARATOR = \"/\";\n\nexport const PUBLIC_REGISTRY = \"https://registry.npmjs.org/\";\n\nexport const INSTALL_REGISTRY = \"https://npm.flatt.tech/\";\n\nexport const withTrailingSlash = (url: string): string =>\n `${Str.replace(TRAILING_SLASH, \"\")(url)}/`;\n\nexport const scopeOfName = (name: string): Option.Option<string> =>\n pipe(\n Option.liftPredicate(name, Str.startsWith(\"@\")),\n Option.flatMap((scoped) =>\n pipe(\n Str.indexOf(SCOPE_SEPARATOR)(scoped),\n Option.map((end) => Str.takeLeft(scoped, end + SCOPE_SEPARATOR.length)),\n ),\n ),\n );\n"],"mappings":";;AAEA,MAAM,iBAAiB;AACvB,MAAM,kBAAkB;AAExB,MAAa,kBAAkB;AAE/B,MAAa,mBAAmB;AAEhC,MAAa,qBAAqB,QAChC,GAAGA,OAAI,QAAQ,gBAAgB,EAAE,CAAC,CAAC,GAAG,EAAE;AAE1C,MAAa,eAAe,SAC1B,KACE,OAAO,cAAc,MAAMA,OAAI,WAAW,GAAG,CAAC,GAC9C,OAAO,SAAS,WACd,KACEA,OAAI,QAAQ,eAAe,CAAC,CAAC,MAAM,GACnC,OAAO,KAAK,QAAQA,OAAI,SAAS,QAAQ,MAAM,CAAsB,CAAC,CACxE,CACF,CACF"}
@@ -1,62 +0,0 @@
1
- import { i as packageLookup, l as publicLookup, o as fetched, u as sent } from "./package-routes-BQWX5ttU.mjs";
2
- import { Array, Effect, Option, Record, Schema, pipe } from "effect";
3
- import { HttpClientResponse } from "effect/http";
4
- // src/shared/lib/registry-releases.ts
5
- const CRATES = "https://crates.io/api/v1/crates/";
6
- const DECLARING_SECTIONS = [
7
- "optionalDependencies",
8
- "peerDependencies",
9
- "dependencies"
10
- ];
11
- const Dependencies = Schema.Record(Schema.String, Schema.String);
12
- const NpmVersion = Schema.Record(Schema.String, Schema.Unknown);
13
- const decodeDependencies = Schema.decodeUnknownOption(Dependencies);
14
- const NOT_FOUND = 404;
15
- const NOT_PUBLISHED = {
16
- versions: [],
17
- latestDependencies: {}
18
- };
19
- const NpmPackument = Schema.Struct({
20
- "dist-tags": Schema.Struct({ latest: Schema.String }),
21
- versions: Schema.Record(Schema.String, NpmVersion)
22
- });
23
- const Crate = Schema.Struct({
24
- crate: Schema.Struct({
25
- max_stable_version: Schema.NullOr(Schema.String),
26
- newest_version: Schema.String
27
- }),
28
- versions: Schema.Array(Schema.Struct({
29
- num: Schema.String,
30
- yanked: Schema.Boolean
31
- }))
32
- });
33
- const CrateDependencies = Schema.Struct({ dependencies: Schema.Array(Schema.Struct({
34
- crate_id: Schema.String,
35
- req: Schema.String
36
- })) });
37
- const declaredBy = (version) => pipe(DECLARING_SECTIONS, Array.flatMap((section) => pipe(decodeDependencies(version[section]), Option.map(Record.toEntries), Option.getOrElse(() => []))), Record.fromEntries);
38
- const releaseOfPackument = ({ "dist-tags": tags, versions }) => ({
39
- versions: Record.keys(versions),
40
- latestDependencies: pipe(Record.get(versions, tags.latest), Option.map(declaredBy), Option.getOrElse(() => ({})))
41
- });
42
- const npmRelease = (name) => sent(packageLookup(name)).pipe(Effect.flatMap((response) => {
43
- if (response.status === NOT_FOUND) return Effect.succeed(NOT_PUBLISHED);
44
- return HttpClientResponse.filterStatusOk(response).pipe(Effect.flatMap(HttpClientResponse.schemaBodyJson(NpmPackument)), Effect.map(releaseOfPackument));
45
- }));
46
- const crateRelease = Effect.fn("crateRelease")(function* lookupCrate(name) {
47
- const found = yield* fetched(publicLookup(`${CRATES}${name}`)).pipe(Effect.flatMap(HttpClientResponse.schemaBodyJson(Crate)));
48
- const latest = found.crate.max_stable_version ?? found.crate.newest_version;
49
- const { dependencies } = yield* fetched(publicLookup(`${CRATES}${name}/${latest}/dependencies`)).pipe(Effect.flatMap(HttpClientResponse.schemaBodyJson(CrateDependencies)));
50
- return {
51
- versions: pipe(found.versions, Array.filter(({ yanked }) => !yanked), Array.map(({ num }) => num)),
52
- latestDependencies: Record.fromEntries(pipe(dependencies, Array.map(({ crate_id: crateId, req }) => [crateId, req])))
53
- };
54
- });
55
- /** @internal */
56
- const registryRelease = Effect.fn("registryRelease")(function* registryRelease(registry, name) {
57
- if (registry === "npm") return yield* npmRelease(name);
58
- return yield* crateRelease(name);
59
- });
60
- export { registryRelease as t };
61
-
62
- //# sourceMappingURL=registry-releases-BBtz4wGE.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry-releases-BBtz4wGE.mjs","names":["Arr","Rec"],"sources":["../src/shared/lib/registry-releases.ts"],"sourcesContent":["import { Array as Arr, Effect, Option, Record as Rec, Schema, pipe } from \"effect\";\nimport { HttpClientResponse } from \"effect/http\";\nimport type { HttpClient, HttpClientError } from \"effect/http\";\n\nimport { fetched, publicLookup, sent } from \"./lookup.ts\";\nimport { packageLookup } from \"./package-routes.ts\";\n\nconst CRATES = \"https://crates.io/api/v1/crates/\";\n\nconst DECLARING_SECTIONS = [\"optionalDependencies\", \"peerDependencies\", \"dependencies\"] as const;\nconst Dependencies = Schema.Record(Schema.String, Schema.String);\nconst NpmVersion = Schema.Record(Schema.String, Schema.Unknown);\nconst decodeDependencies = Schema.decodeUnknownOption(Dependencies);\nconst NOT_FOUND = 404;\nconst NOT_PUBLISHED: Release = { versions: [], latestDependencies: {} };\nconst NpmPackument = Schema.Struct({\n \"dist-tags\": Schema.Struct({ latest: Schema.String }),\n versions: Schema.Record(Schema.String, NpmVersion),\n});\nconst Crate = Schema.Struct({\n crate: Schema.Struct({\n max_stable_version: Schema.NullOr(Schema.String),\n newest_version: Schema.String,\n }),\n versions: Schema.Array(Schema.Struct({ num: Schema.String, yanked: Schema.Boolean })),\n});\nconst CrateDependencies = Schema.Struct({\n dependencies: Schema.Array(Schema.Struct({ crate_id: Schema.String, req: Schema.String })),\n});\n\ntype NpmVersionType = typeof NpmVersion.Type;\n\n/** @internal */\nexport type LookupError = HttpClientError.HttpClientError | Schema.SchemaError;\n\n/** @internal */\nexport type Registry = \"npm\" | \"crate\";\n\n/** @internal */\nexport interface Release {\n readonly versions: readonly string[];\n readonly latestDependencies: Readonly<Record<string, string>>;\n}\n\nconst declaredBy = (version: NpmVersionType): Readonly<Record<string, string>> =>\n pipe(\n DECLARING_SECTIONS,\n Arr.flatMap((section) =>\n pipe(\n decodeDependencies(version[section]),\n Option.map(Rec.toEntries),\n Option.getOrElse((): readonly (readonly [string, string])[] => []),\n ),\n ),\n Rec.fromEntries,\n );\n\nconst releaseOfPackument = ({\n \"dist-tags\": tags,\n versions,\n}: typeof NpmPackument.Type): Release => ({\n versions: Rec.keys(versions),\n latestDependencies: pipe(\n Rec.get(versions, tags.latest),\n Option.map(declaredBy),\n Option.getOrElse(() => ({})),\n ),\n});\n\nconst npmRelease = (name: string): Effect.Effect<Release, LookupError, HttpClient.HttpClient> =>\n sent(packageLookup(name)).pipe(\n Effect.flatMap((response) => {\n if (response.status === NOT_FOUND) {\n return Effect.succeed(NOT_PUBLISHED);\n }\n return HttpClientResponse.filterStatusOk(response).pipe(\n Effect.flatMap(HttpClientResponse.schemaBodyJson(NpmPackument)),\n Effect.map(releaseOfPackument),\n );\n }),\n );\n\nconst crateRelease = Effect.fn(\"crateRelease\")(function* lookupCrate(name: string) {\n const found = yield* fetched(publicLookup(`${CRATES}${name}`)).pipe(\n Effect.flatMap(HttpClientResponse.schemaBodyJson(Crate)),\n );\n const latest = found.crate.max_stable_version ?? found.crate.newest_version;\n const { dependencies } = yield* fetched(\n publicLookup(`${CRATES}${name}/${latest}/dependencies`),\n ).pipe(Effect.flatMap(HttpClientResponse.schemaBodyJson(CrateDependencies)));\n const release: Release = {\n versions: pipe(\n found.versions,\n Arr.filter(({ yanked }) => !yanked),\n Arr.map(({ num }) => num),\n ),\n latestDependencies: Rec.fromEntries(\n pipe(\n dependencies,\n Arr.map(({ crate_id: crateId, req }) => [crateId, req] as const),\n ),\n ),\n };\n return release;\n});\n\n/** @internal */\nexport const registryRelease = Effect.fn(\"registryRelease\")(function* registryRelease(\n registry: Registry,\n name: string,\n) {\n if (registry === \"npm\") {\n return yield* npmRelease(name);\n }\n return yield* crateRelease(name);\n});\n"],"mappings":";;;;AAOA,MAAM,SAAS;AAEf,MAAM,qBAAqB;CAAC;CAAwB;CAAoB;AAAc;AACtF,MAAM,eAAe,OAAO,OAAO,OAAO,QAAQ,OAAO,MAAM;AAC/D,MAAM,aAAa,OAAO,OAAO,OAAO,QAAQ,OAAO,OAAO;AAC9D,MAAM,qBAAqB,OAAO,oBAAoB,YAAY;AAClE,MAAM,YAAY;AAClB,MAAM,gBAAyB;CAAE,UAAU,CAAC;CAAG,oBAAoB,CAAC;AAAE;AACtE,MAAM,eAAe,OAAO,OAAO;CACjC,aAAa,OAAO,OAAO,EAAE,QAAQ,OAAO,OAAO,CAAC;CACpD,UAAU,OAAO,OAAO,OAAO,QAAQ,UAAU;AACnD,CAAC;AACD,MAAM,QAAQ,OAAO,OAAO;CAC1B,OAAO,OAAO,OAAO;EACnB,oBAAoB,OAAO,OAAO,OAAO,MAAM;EAC/C,gBAAgB,OAAO;CACzB,CAAC;CACD,UAAU,OAAO,MAAM,OAAO,OAAO;EAAE,KAAK,OAAO;EAAQ,QAAQ,OAAO;CAAQ,CAAC,CAAC;AACtF,CAAC;AACD,MAAM,oBAAoB,OAAO,OAAO,EACtC,cAAc,OAAO,MAAM,OAAO,OAAO;CAAE,UAAU,OAAO;CAAQ,KAAK,OAAO;AAAO,CAAC,CAAC,EAC3F,CAAC;AAgBD,MAAM,cAAc,YAClB,KACE,oBACAA,MAAI,SAAS,YACX,KACE,mBAAmB,QAAQ,QAAQ,GACnC,OAAO,IAAIC,OAAI,SAAS,GACxB,OAAO,gBAAwD,CAAC,CAAC,CACnE,CACF,GACAA,OAAI,WACN;AAEF,MAAM,sBAAsB,EAC1B,aAAa,MACb,gBAC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Aa,IAAI;AACjC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"repository-text-DE4rRWEZ.mjs","names":["Arr","Rec","Rec","Arr"],"sources":["../src/app/repository-tasks.ts","../src/app/repository-text.ts"],"sourcesContent":["import { Array as Arr, Record as Rec, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport type { WorkspaceSettings } from \"#/features/build-workspace-settings/index.ts\";\n\ntype Tasks = NonNullable<NonNullable<UserConfig[\"run\"]>[\"tasks\"]>;\n\nexport interface TaskOptions {\n readonly workspace: WorkspaceSettings;\n readonly commands: Readonly<Record<string, string>>;\n}\n\nconst NOT_INPUTS = [\n \"!node_modules/.pnpm-store\",\n \"!node_modules/.pnpm-store/**\",\n \"!node_modules/.tmp\",\n \"!node_modules/.tmp/**\",\n \"!target/**\",\n \"!node_modules/.vitest-cache/**\",\n \"!node_modules/.cache/**\",\n];\n\nconst UNTRACKED_ENV = [\n \"CLOUDFLARE_ACCOUNT_ID\",\n \"CLOUDFLARE_AI_GATEWAY_ID\",\n \"CLOUDFLARE_API_TOKEN\",\n \"CLAUDECODE\",\n \"CLAUDE_CODE_REMOTE\",\n \"GITHUB_ACTIONS\",\n \"HTTPS_PROXY\",\n \"https_proxy\",\n \"NO_PROXY\",\n \"no_proxy\",\n \"SSL_CERT_FILE\",\n \"NODE_EXTRA_CA_CERTS\",\n];\n\nconst FALLOW_ARGS = [\n \"--skip dupes --fail-on-issues --quiet --format compact\",\n \"dead-code --no-production --fail-on-issues --quiet --format compact\",\n \"dead-code --no-production --quiet --format json | jq -n 'input | {prop_drilling_chains, thin_wrappers, duplicate_prop_shapes} | with_entries(select(.value | length > 0)) | if length > 0 then halt_error else empty end'\",\n \"dupes --fail-on-issues --quiet --format compact\",\n \"security --fail-on-issues --quiet\",\n];\n\nconst FALLOW = pipe(\n FALLOW_ARGS,\n Arr.map((args) => `FALLOW_TYPE_AWARE_BACKEND=tsrs fallow ${args}`),\n);\n\nconst CHECK_BATCH_SOURCES = 1000;\n\nconst CHECK = `TSRS_LINT_RUN_EXTERNAL_CODE=1 msch-changed --batch-sources ${String(CHECK_BATCH_SOURCES)} vp check --deny-warnings --continue-on-error`;\n\nconst COMPAT = \"msch-changed msch-publish compat-changed\";\n\nconst AUDIT =\n 'before=\"$(cksum pnpm-workspace.yaml)\"; vp pm audit --fix || exit; if [ \"$before\" != \"$(cksum pnpm-workspace.yaml)\" ]; then echo \"vp pm audit --fix rewrote pnpm-workspace.yaml. Run vp install and commit the diff.\" >&2; exit 1; fi';\n\nconst BROKER_TOKEN = `GH_TOKEN=\"\\${GITHUB_APP_TOKEN:-$GH_TOKEN}\"`;\nconst DAILY = `msch-exits; ${BROKER_TOKEN} msch-upstream; ${BROKER_TOKEN} msch-refs`;\n\nconst TEST = \"msch-changed vp test run --passWithNoTests\";\n\nexport const MSCH_TASK_COMMANDS = {\n fallow: FALLOW,\n check: CHECK,\n test: TEST,\n msch: \"msch\",\n audit: AUDIT,\n published: \"msch-published\",\n compat: COMPAT,\n} as const;\n\nexport const tasksOf = ({\n workspace,\n commands,\n}: TaskOptions): NonNullable<NonNullable<UserConfig[\"run\"]>[\"tasks\"]> => {\n const inputs = [{ auto: true }, ...workspace.ignoredDirectories, ...NOT_INPUTS];\n const checks: Tasks = {\n ...commands,\n fallow: {\n command: FALLOW,\n cache: {\n input: [...inputs, \"!.fallow/**\", \"!**/dist/**\", \"!**/.fallow-verified\"],\n output: [],\n },\n },\n check: {\n command: CHECK,\n cache: { input: inputs, untrackedEnv: UNTRACKED_ENV },\n },\n test: {\n command: TEST,\n dependsOn: [\"check\", ...workspace.tasks.native],\n cache: { input: [...inputs, \"!**/.cache/**\"] },\n },\n msch: { command: \"msch\", dependsOn: [\"check\", ...workspace.tasks.native], cache: false },\n audit: { command: AUDIT, cache: false },\n published: { command: \"msch-published\", cache: false },\n compat: { command: COMPAT, cache: false },\n };\n return {\n ...checks,\n daily: { command: DAILY, dependsOn: [...workspace.tasks.native], cache: false },\n verify: { command: [], dependsOn: [...workspace.tasks.verify, ...Rec.keys(checks)] },\n };\n};\n","import type { H56mConfig } from \"@r_masseater/h56m\";\nimport { betterleaks } from \"@r_masseater/h56m/presets\";\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Array as Arr, Record as Rec, pipe } from \"effect\";\n\nimport { textlintFilters, textlintPresets } from \"#/features/define-lint-preset/index.ts\";\nimport { exempt } from \"#/shared/config/index.ts\";\n\ntype Source = NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"sources\"]>[number];\n\nexport interface TextSource {\n readonly files: readonly string[];\n readonly plugins: Readonly<Record<string, boolean | object>>;\n}\n\nexport interface TextOptions {\n readonly properNouns?: readonly string[];\n readonly rules?: Readonly<Record<string, object>>;\n readonly sources?: readonly TextSource[];\n}\n\nexport const TEXT_IGNORES = [\n \"AGENTS.md\",\n \"CLAUDE.md\",\n \".agents/skills/**\",\n \"CHANGELOG.md\",\n ...exempt,\n];\nconst QUOTATION = String.raw`/「[^」]*」/`;\nconst SENTENCE_LENGTH = 120;\nconst KANJI_RUN = 6;\nconst PUBLIC_LINES = [\n String.raw`\\bCF_BEACON_TOKEN = \"[0-9a-f]{32}\"`,\n String.raw`\\b\\w*DISCORD_\\w*ID = \"[0-9]{17,20}\"`,\n String.raw`untrusted comment: minisign public key: [0-9A-F]{16}`,\n];\nconst EXEMPT_PATHS = [String.raw`(?:^|/)(?:fixtures|upstream)/`];\n\nconst builtRules = (\n properNouns: readonly string[],\n): Readonly<Record<string, boolean | object>> => ({\n \"@textlint-ja/preset-ai-writing\": true,\n \"@r_masseater/preset-ja\": true,\n \"preset-ja-technical-writing\": {\n \"sentence-length\": { max: SENTENCE_LENGTH },\n \"ja-no-mixed-period\": { allowPeriodMarks: [\":\"] },\n \"no-mix-dearu-desumasu\": { preferInBody: \"である\", preferInList: \"である\" },\n \"max-kanji-continuous-len\": { max: KANJI_RUN, allow: [...properNouns] },\n \"no-exclamation-question-mark\": { allow: [QUOTATION, ...properNouns] },\n },\n});\n\nexport const builtTextRuleNames: readonly string[] = Rec.keys(builtRules([]));\n\nexport const textlintOf = ({\n properNouns = [],\n rules = {},\n sources = [],\n}: TextOptions): NonNullable<ToolSections[\"textlint\"]> => {\n const textRules = { ...rules, ...builtRules(properNouns) };\n return {\n ignores: TEXT_IGNORES,\n presets: textlintPresets,\n filterModules: textlintFilters,\n reportUnusedDirectives: true,\n sources: pipe(\n sources,\n Arr.map(({ files, plugins }): Source => ({\n files: [...files],\n plugins: { ...plugins },\n rules: textRules,\n filters: { comments: true },\n })),\n ),\n filters: { comments: true },\n rules: textRules,\n };\n};\n\nconst anyOf =\n (subject: string) =>\n (patterns: readonly string[]): readonly string[] => {\n if (Arr.isReadonlyArrayEmpty(patterns)) {\n return [];\n }\n const listed = pipe(\n patterns,\n Arr.map((pattern) => `\\`${pattern}\\``),\n Arr.join(\", \"),\n );\n return [`matchesAny(${subject}, [${listed}])`];\n };\n\nexport const secretsOf = (): H56mConfig => ({\n extend: { path: betterleaks },\n filter: pipe(\n [...anyOf(\"finding.line\")(PUBLIC_LINES), ...anyOf(`attributes[\"path\"]`)(EXEMPT_PATHS)],\n Arr.join(\" || \"),\n ),\n});\n"],"mappings":";;;;AAYA,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAUA,MAAM,SAAS,KACb;CARA;CACA;CACA;CACA;CACA;AAIU,GACVA,MAAI,KAAK,SAAS,yCAAyC,MAAM,CACnE;AAIA,MAAM,QAAQ,8DAA8D,OAAO,GAAmB,EAAE;AAExG,MAAM,SAAS;AAEf,MAAM,QACJ;AAEF,MAAM,eAAe;AACrB,MAAM,QAAQ,eAAe,aAAa,kBAAkB,aAAa;AAEzE,MAAM,OAAO;AAEb,MAAa,qBAAqB;CAChC,QAAQ;CACR,OAAO;CACP,MAAM;CACN,MAAM;CACN,OAAO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iles } from "./repository-files-DSwKJnrj.mjs";
2
- import { runMainWith } from "@r_masseater/masseater-utils/node-main";
3
- // src/app/runtime.ts
4
- /** @internal */
5
- const runCli = (name) => (program) => {
6
- runMainWith({
7
- serviceName: name,
8
- services: nodeRepositoryFiles
9
- })(program);
10
- };
11
- export { runCli as t };
12
-
13
- //# sourceMappingURL=runtime-Djm7zMwu.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-Djm7zMwu.mjs","names":[],"sources":["../src/app/runtime.ts"],"sourcesContent":["import type { NodeServices } from \"@effect/platform-node/NodeServices\";\nimport { runMainWith } from \"@r_masseater/masseater-utils/node-main\";\nimport type { Effect } from \"effect\";\nimport type { HttpClient } from \"effect/http\";\n\nimport { nodeRepositoryFiles } from \"#/shared/lib/repository-files.ts\";\nimport type { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\n/** @internal */\nexport const runCli =\n (name: string) =>\n <Value, Failure>(\n program: Effect.Effect<Value, Failure, RepositoryFiles | NodeServices | HttpClient.HttpClient>,\n ): void => {\n runMainWith({ serviceName: name, services: nodeRepositoryFiles })(program);\n };\n"],"mappings":";;;;AASA,MAAa,UACV,UAEC,YACS;CACT,YAAY;EAAE,aAAa;EAAM,UAAU;CAAoB,CAAC,CAAC,CAAC,OAAO;AAC3E"}
@@ -1,32 +0,0 @@
1
- import { Array, Option, Record, Schema, String as String$1, pipe } from "effect";
2
- import { decodePackageJson } from "@r_masseater/masseater-utils/kestrion/npm";
3
- // src/entities/package/model/specifiers.ts
4
- const START = 0;
5
- const FieldsSchema = Schema.Record(Schema.String, Schema.Unknown);
6
- const decodeFields = Schema.decodeUnknownOption(FieldsSchema);
7
- const decodeString = Schema.decodeUnknownOption(Schema.String);
8
- /** @internal */
9
- const fieldsOf = (value) => Option.getOrElse(decodeFields(value), () => ({}));
10
- /** @internal */
11
- const namedCatalogsOf = (settings) => Record.toEntries(fieldsOf(settings["catalogs"]));
12
- /** @internal */
13
- const specifiedIn = (held) => pipe(fieldsOf(held), Record.toEntries, Array.flatMap(([name, value]) => pipe(decodeString(value), Option.map((specifier) => ({
14
- name,
15
- specifier
16
- })), Option.toArray)));
17
- /** @internal */
18
- const quoted = (text) => String$1.replaceAll(/[$()*+.?[\\\]^{|}]/gu, String.raw`\$&`)(text);
19
- /** @internal */
20
- const manifestPattern = ({ name, specifier }) => new RegExp(`"${quoted(name)}"\\s*:\\s*"${quoted(specifier)}"`, "u");
21
- /** @internal */
22
- const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec(source)), Option.map(({ index }) => index), Option.getOrElse(() => START));
23
- const SECTIONS = [
24
- "dependencies",
25
- "devDependencies",
26
- "optionalDependencies"
27
- ];
28
- /** @internal */
29
- const manifestSpecifiers = (source) => pipe(decodePackageJson(source), Option.map((manifest) => pipe(SECTIONS, Array.flatMap((section) => specifiedIn(manifest[section])))), Option.getOrElse(() => []));
30
- export { offsetIn as a, namedCatalogsOf as i, manifestPattern as n, quoted as o, manifestSpecifiers as r, specifiedIn as s, fieldsOf as t };
31
-
32
- //# sourceMappingURL=specifiers-BrCyPubD.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"specifiers-BrCyPubD.mjs","names":["Rec","Arr","Str"],"sources":["../src/entities/package/model/specifiers.ts"],"sourcesContent":["import { decodePackageJson } from \"@r_masseater/masseater-utils/kestrion/npm\";\nimport { Array as Arr, Option, Record as Rec, Schema, String as Str, pipe } from \"effect\";\n\nconst START = 0;\n\n/** @internal */\nexport type Fields = Readonly<Record<string, unknown>>;\n\nconst FieldsSchema = Schema.Record(Schema.String, Schema.Unknown);\nconst decodeFields = Schema.decodeUnknownOption(FieldsSchema);\nconst decodeString = Schema.decodeUnknownOption(Schema.String);\n\n/** @internal */\nexport const fieldsOf = (value: unknown): Fields =>\n Option.getOrElse(decodeFields(value), () => ({}));\n\n/** @internal */\nexport const namedCatalogsOf = (settings: Fields): readonly (readonly [string, unknown])[] =>\n Rec.toEntries(fieldsOf(settings[\"catalogs\"]));\n\n/** @internal */\nexport interface Specified {\n readonly name: string;\n readonly specifier: string;\n}\n\n/** @internal */\nexport const specifiedIn = (held: unknown): readonly Specified[] =>\n pipe(\n fieldsOf(held),\n Rec.toEntries,\n Arr.flatMap(([name, value]) =>\n pipe(\n decodeString(value),\n Option.map((specifier) => ({ name, specifier })),\n Option.toArray,\n ),\n ),\n );\n\n/** @internal */\nexport const quoted = (text: string): string =>\n Str.replaceAll(/[$()*+.?[\\\\\\]^{|}]/gu, String.raw`\\$&`)(text);\n\n/** @internal */\nexport const manifestPattern = ({ name, specifier }: Specified): RegExp =>\n new RegExp(`\"${quoted(name)}\"\\\\s*:\\\\s*\"${quoted(specifier)}\"`, \"u\");\n\n/** @internal */\nexport const offsetIn =\n (source: string) =>\n (pattern: RegExp): number =>\n pipe(\n Option.fromNullishOr(pattern.exec(source)),\n Option.map(({ index }) => index),\n Option.getOrElse(() => START),\n );\n\nconst SECTIONS = [\"dependencies\", \"devDependencies\", \"optionalDependencies\"] as const;\n\n/** @internal */\nexport const manifestSpecifiers = (source: string): readonly Specified[] =>\n pipe(\n decodePackageJson(source),\n Option.map((manifest) =>\n pipe(\n SECTIONS,\n Arr.flatMap((section) => specifiedIn(manifest[section])),\n ),\n ),\n Option.getOrElse((): readonly Specified[] => []),\n );\n"],"mappings":";;;AAGA,MAAM,QAAQ;AAKd,MAAM,eAAe,OAAO,OAAO,OAAO,QAAQ,OAAO,OAAO;AAChE,MAAM,eAAe,OAAO,oBAAoB,YAAY;AAC5D,MAAM,eAAe,OAAO,oBAAoB,OAAO,MAAM;;AAG7D,MAAa,YAAY,UACvB,OAAO,UAAU,aAAa,KAAK,UAAU,CAAC,EAAE;;AAGlD,MAAa,mBAAmB,aAC9BA,OAAI,UAAU,SAAS,SAAS,WAAW,CAAC;;AAS9C,MAAa,eAAe,SAC1B,KACE,SAAS,IAAI,GACbA,OAAI,WACJC,MAAI,SAAS,CAAC,MAAM,WAClB,KACE,aAAa,KAAK,GAClB,OAAO,KAAK,eAAe;CAAE;CAAM;AAAU,EAAE,GAC/C,OAAO,OACT,CACF,CACF;;AAGF,MAAa,UAAU,SACrBC,SAAI,WAAW,wBAAwB,OAAO,GAAG,KAAK,CAAC,CAAC,IAAI;;AAG9D,MAAa,mBAAmB,EAAE,MAAM,gBACtC,IAAI,OAAO,IAAI,OAAO,IAAI,EAAE,aAAa,OAAO,SAAS,EAAE,IAAI,GAAG;;AAGpE,MAAa,YACV,YACA,YACC,KACE,OAAO,cAAc,QAAQ,KAAK,MAAM,CAAC,GACzC,OAAO,KAAK,EAAE,YAAY,KAAK,GAC/B,OAAO,gBAAgB,KAAK,CAC9B;AAEJ,MAAM,WAAW;CAAC;CAAgB;CAAmB;AAAsB;;AAG3E,MAAa,sBAAsB,WACjC,KACE,kBAAkB,MAAM,GACxB,OAAO,KAAK,aACV,KACE,UACAD,MAAI,SAAS,YAAY,YAAY,SAAS,QAAQ,CAAC,CACzD,CACF,GACA,OAAO,gBAAsC,CAAC,CAAC,CACjD"}
@@ -1,41 +0,0 @@
1
- import { t as startedOnce } from "./started-once-muJbvD_I.mjs";
2
- import { Effect, Option, Schema } from "effect";
3
- import { fileURLToPath } from "node:url";
4
- import treeSitter from "@vscode/tree-sitter-wasm";
5
- // src/shared/lib/tree-sitter.ts
6
- const taggedError = Schema.TaggedError;
7
- var GrammarUnreadable = class extends taggedError()("GrammarUnreadable", {
8
- grammar: Schema.String,
9
- message: Schema.String
10
- }) {};
11
- const PARSER_KEY = "parser";
12
- const initParser = startedOnce();
13
- const loadOnce = startedOnce();
14
- const grammarFile = (grammar) => fileURLToPath(import.meta.resolve(`@vscode/tree-sitter-wasm/wasm/tree-sitter-${grammar}.wasm`));
15
- const loadLanguage = (grammar) => {
16
- const unreadable = (cause) => GrammarUnreadable.make({
17
- grammar,
18
- message: String(cause)
19
- });
20
- return Effect.tryPromise({
21
- try: () => initParser(PARSER_KEY, () => treeSitter.Parser.init()),
22
- catch: unreadable
23
- }).pipe(Effect.andThen(Effect.tryPromise({
24
- try: () => loadOnce(grammar, () => treeSitter.Language.load(grammarFile(grammar))),
25
- catch: unreadable
26
- })));
27
- };
28
- const readTree = ({ language, source, read }) => {
29
- const parser = new treeSitter.Parser();
30
- parser.setLanguage(language);
31
- const tree = parser.parse(source);
32
- parser.delete();
33
- return Option.map(Option.fromNullishOr(tree), (parsed) => {
34
- const result = read(parsed.rootNode);
35
- parsed.delete();
36
- return result;
37
- });
38
- };
39
- export { readTree as n, loadLanguage as t };
40
-
41
- //# sourceMappingURL=tree-sitter-BfzHNwTR.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tree-sitter-BfzHNwTR.mjs","names":[],"sources":["../src/shared/lib/tree-sitter.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\";\n\nimport treeSitter from \"@vscode/tree-sitter-wasm\";\nimport { Effect, Option, Schema } from \"effect\";\n\nimport { startedOnce } from \"./started-once.ts\";\n\nexport type Language = treeSitter.Language;\n\nexport type SyntaxNode = treeSitter.Node;\n\nexport interface TreeReading<Result> {\n readonly language: Language;\n readonly source: string;\n readonly read: (root: SyntaxNode) => Result;\n}\n\nconst taggedError = Schema.TaggedError;\n\nexport class GrammarUnreadable extends taggedError<\n GrammarUnreadable,\n { readonly brand: unique symbol }\n>()(\"GrammarUnreadable\", { grammar: Schema.String, message: Schema.String }) {}\n\nconst PARSER_KEY = \"parser\";\n\nconst initParser = startedOnce<unknown>();\n\nconst loadOnce = startedOnce<Language>();\n\nconst grammarFile = (grammar: string): string =>\n fileURLToPath(import.meta.resolve(`@vscode/tree-sitter-wasm/wasm/tree-sitter-${grammar}.wasm`));\n\nexport const loadLanguage = (grammar: string): Effect.Effect<Language, GrammarUnreadable> => {\n const unreadable = (cause: unknown): GrammarUnreadable =>\n GrammarUnreadable.make({ grammar, message: String(cause) });\n return Effect.tryPromise({\n try: () => initParser(PARSER_KEY, () => treeSitter.Parser.init()),\n catch: unreadable,\n }).pipe(\n Effect.andThen(\n Effect.tryPromise({\n try: () => loadOnce(grammar, () => treeSitter.Language.load(grammarFile(grammar))),\n catch: unreadable,\n }),\n ),\n );\n};\n\nexport const readTree = <Result>({\n language,\n source,\n read,\n}: TreeReading<Result>): Option.Option<Result> => {\n const parser = new treeSitter.Parser();\n parser.setLanguage(language);\n const tree = parser.parse(source);\n parser.delete();\n return Option.map(Option.fromNullishOr(tree), (parsed) => {\n const result = read(parsed.rootNode);\n parsed.delete();\n return result;\n });\n};\n"],"mappings":";;;;;AAiBA,MAAM,cAAc,OAAO;AAE3B,IAAa,oBAAb,cAAuC,YAGrC,CAAC,CAAC,qBAAqB;CAAE,SAAS,OAAO;CAAQ,SAAS,OAAO;AAAO,CAAC,CAAC,CAAC,CAAC;AAE9E,MAAM,aAAa;AAEnB,MAAM,aAAa,YAAqB;AAExC,MAAM,WAAW,YAAsB;AAEvC,MAAM,eAAe,YACnB,cAAc,YAAY,QAAQ,6CAA6C,QAAQ,MAAM,CAAC;AAEhG,MAAa,gBAAgB,YAAgE;CAC3F,MAAM,cAAc,UAClB,kBAAkB,KAAK;EAAE;EAAS,SAAS,OAAO,KAAK;CAAE,CAAC;CAC5D,OAAO,OAAO,WAAW;EACvB,WAAW,WAAW,kBAAkB,WAAW,OAAO,KAAK,CAAC;EAChE,OAAO;CACT,CAAC,CAAC,CAAC,KACD,OAAO,QACL,OAAO,WAAW;EAChB,WAAW,SAAS,eAAe,WAAW,SAAS,KAAK,YAAY,OAAO,CAAC,CAAC;EACjF,OAAO;CACT,CAAC,CACH,CACF;AACF;AAEA,MAAa,YAAoB,EAC/B,UACA,QACA,WACgD;CAChD,MAAM,SAAS,IAAI,WAAW,OAAO;CACrC,OAAO,YAAY,QAAQ;CAC3B,MAAM,OAAO,OAAO,MAAM,MAAM;CAChC,OAAO,OAAO;CACd,OAAO,OAAO,IAAI,OAAO,cAAc,IAAI,IAAI,WAAW;EACxD,MAAM,SAAS,KAAK,OAAO,QAAQ;EACnC,OAAO,OAAO;EACd,OAAO;CACT,CAAC;AACH"}
@@ -1 +0,0 @@
1
- export {}
package/dist/unbumped.mjs DELETED
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env node
2
- import { i as writeProblems, n as failWhenAny } from "./output-DAvdel9H.mjs";
3
- import { t as runCli } from "./runtime-Djm7zMwu.mjs";
4
- import { t as checkPackageVersions } from "./package-versions-sx15IGwA.mjs";
5
- import { s as sortProblems } from "./problem-DbuTeNvL.mjs";
6
- import { r as RepositoryFiles } from "./repository-files-DSwKJnrj.mjs";
7
- import { Effect } from "effect";
8
- // bin/msch-unbumped.ts
9
- const unbumped = Effect.gen(function* unbumped() {
10
- const root = (yield* RepositoryFiles).resolve(".");
11
- const found = yield* checkPackageVersions(root);
12
- const problems = sortProblems(found);
13
- yield* writeProblems(root)(problems);
14
- return yield* failWhenAny(problems.length);
15
- });
16
- runCli("msch-unbumped")(unbumped);
17
- export {};
18
-
19
- //# sourceMappingURL=unbumped.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unbumped.mjs","names":[],"sources":["../bin/msch-unbumped.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Effect } from \"effect\";\n\nimport { failWhenAny, writeProblems } from \"#/app/output.ts\";\nimport { runCli } from \"#/app/runtime.ts\";\nimport { checkPackageVersions } from \"#/features/check-version-downgrades/index.ts\";\nimport { sortProblems } from \"#/shared/lib/problem.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst unbumped = Effect.gen(function* unbumped() {\n const files = yield* RepositoryFiles;\n const root = files.resolve(\".\");\n const found = yield* checkPackageVersions(root);\n const problems = sortProblems(found);\n yield* writeProblems(root)(problems);\n return yield* failWhenAny(problems.length);\n});\n\nrunCli(\"msch-unbumped\")(unbumped);\n"],"mappings":";;;;;;;;AASA,MAAM,WAAW,OAAO,IAAI,UAAU,WAAW;CAE/C,MAAM,QAAO,OADQ,gBAAA,CACF,QAAQ,GAAG;CAC9B,MAAM,QAAQ,OAAO,qBAAqB,IAAI;CAC9C,MAAM,WAAW,aAAa,KAAK;CACnC,OAAO,cAAc,IAAI,CAAC,CAAC,QAAQ;CACnC,OAAO,OAAO,YAAY,SAAS,MAAM;AAC3C,CAAC;AAED,OAAO,eAAe,CAAC,CAAC,QAAQ"}