@r_masseater/msch 0.120.2 → 0.120.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as WorkspaceSettings } from "./index-B0ahB5vD.mjs";
1
+ import { a as WorkspaceSettings } from "./index-DIMbx_hx.mjs";
2
2
  import { r as MarkdownOptions } from "./index-D6X9EgDG.mjs";
3
3
  import { r as CargoInput } from "./index-tcHDX7ae.mjs";
4
4
  import { Option, Schema } from "effect";
@@ -22,6 +22,7 @@ interface TextOptions {
22
22
  readonly sources?: readonly TextSource[];
23
23
  }
24
24
  export declare const secretsOf: () => H56mConfig;
25
+ export declare const PLUGIN_DEPENDENCIES = "Claude Code installs a plugin's dependencies from its own package.json and lockfile, where only exact registry versions install";
25
26
  export interface AddedOverride {
26
27
  readonly files: readonly string[];
27
28
  readonly excludeFiles?: readonly string[];
package/dist/config.mjs CHANGED
@@ -1,7 +1,8 @@
1
1
  import { f as requiredStack, g as decisionTestRules, p as lint$1, r as markdownOf, s as structureOf, x as exempt } from "./define-lint-preset-CYgaGe8E.mjs";
2
2
  import { a as nodeServicesLayer, i as nodeRepositoryFiles, r as RepositoryFiles, s as groupOf } from "./repository-files-C8B7lrka.mjs";
3
- import { d as isDirectoryAt, f as isIgnored, h as patternOf, i as textlintOf, l as tasksOf, m as namedWorkspaces, p as staticPrefix, r as secretsOf, u as existsAt } from "./repository-text-BMqkLDDC.mjs";
3
+ import { d as isDirectoryAt, f as isIgnored, h as patternOf, i as textlintOf, l as tasksOf, m as namedWorkspaces, p as staticPrefix, r as secretsOf, u as existsAt } from "./repository-text-Dtv6Oz3P.mjs";
4
4
  import { Array, Effect, Layer, ManagedRuntime, Option, Record, String, pipe } from "effect";
5
+ import { RUNTIME_SECTIONS } from "@r_masseater/masseater-utils/kestrion";
5
6
  import { fileURLToPath } from "node:url";
6
7
  import { definePlugin, defineRule } from "@r_masseater/fu4";
7
8
  import { recommended } from "@r_masseater/fu4/presets";
@@ -231,7 +232,7 @@ const findingFor = (what, found, directory) => pipe(directory, Option.map((works
231
232
  column: found.column,
232
233
  message: packageMessage(what, workspace)
233
234
  })), Option.toArray);
234
- const namesIn = (stem, root) => [
235
+ const namesIn$1 = (stem, root) => [
235
236
  {
236
237
  ...FIRST_LINE,
237
238
  text: stem
@@ -244,7 +245,7 @@ const namesIn = (stem, root) => [
244
245
  })))), Option.getOrElse(() => []))
245
246
  ];
246
247
  const workflowFindings = (workspaces, stem, root) => {
247
- const fromNames = pipe(namesIn(stem, Option.some(root)), Array.flatMap((found) => findingFor(`"${found.text}"`, found, named(workspaces, found.text))));
248
+ const fromNames = pipe(namesIn$1(stem, Option.some(root)), Array.flatMap((found) => findingFor(`"${found.text}"`, found, named(workspaces, found.text))));
248
249
  const referenced = pipe(workflowReferences(root), Array.filter(({ field }) => !String.startsWith("on.")(field)), Array.flatMap((found) => findingFor(found.field, found, containing(workspaces, found.path))));
249
250
  const filtered = pipe(filtersIn(scalarsIn(root)), Array.flatMap((found) => findingFor(`--filter ${found.text}`, found, matching(workspaces, found.text))));
250
251
  return [
@@ -407,6 +408,22 @@ const workflowPolicy = () => ({
407
408
  // src/features/guard-workflows/model/fu4-config.ts
408
409
  /** @internal */
409
410
  const fu4Of = () => ({ extends: [recommended(), workflowPolicy()] });
411
+ // src/app/repository-dependencies.ts
412
+ const allowedIn = (allowances, fields) => pipe(allowances, Record.map(({ workspaces, dependencies }) => ({
413
+ workspaces,
414
+ dependencies,
415
+ fields: [...fields]
416
+ })));
417
+ const PLUGIN_DEPENDENCIES = "Claude Code installs a plugin's dependencies from its own package.json and lockfile, where only exact registry versions install";
418
+ const dependencyRulesOf = (workspace) => ({
419
+ allowed: {
420
+ ...allowedIn(workspace.devDependencies, ["devDependencies"]),
421
+ ...allowedIn(workspace.dependencies, RUNTIME_SECTIONS)
422
+ },
423
+ banned: requiredStack,
424
+ exactDependencies: { [PLUGIN_DEPENDENCIES]: workspace.plugins },
425
+ peerRanges: "intersect"
426
+ });
410
427
  // src/app/repository-config.ts
411
428
  const cacheOf = (remoteCache) => pipe(Option.fromNullishOr(remoteCache), Option.match({
412
429
  onNone: () => true,
@@ -416,11 +433,6 @@ const cacheOf = (remoteCache) => pipe(Option.fromNullishOr(remoteCache), Option.
416
433
  remote: { url }
417
434
  })
418
435
  }));
419
- const allowedIn = (allowances, field) => pipe(allowances, Record.map(({ workspaces, dependencies }) => ({
420
- workspaces,
421
- dependencies,
422
- fields: [field]
423
- })));
424
436
  const COMMIT_CONVENTION = fileURLToPath(import.meta.resolve("@commitlint/config-conventional"));
425
437
  const added = ({ files, excludeFiles, rules }) => pipe(Option.fromUndefinedOr(excludeFiles), Option.match({
426
438
  onNone: () => ({
@@ -462,14 +474,7 @@ const repositoryConfig = (options) => {
462
474
  const { workspace, textlint = {}, markdown = {}, run = {}, usage, cargo } = options;
463
475
  return {
464
476
  commitlint: { extends: [COMMIT_CONVENTION] },
465
- dependencyRules: {
466
- allowed: {
467
- ...allowedIn(workspace.devDependencies, "devDependencies"),
468
- ...allowedIn(workspace.dependencies, "dependencies")
469
- },
470
- banned: requiredStack,
471
- peerRanges: "intersect"
472
- },
477
+ dependencyRules: dependencyRulesOf(workspace),
473
478
  h56m: secretsOf(),
474
479
  wism: structureOf({
475
480
  members: workspace.members,
@@ -507,6 +512,6 @@ const repositoryConfig = (options) => {
507
512
  }
508
513
  };
509
514
  };
510
- export { repositoryConfig, secretsOf };
515
+ export { PLUGIN_DEPENDENCIES, repositoryConfig, secretsOf };
511
516
 
512
517
  //# sourceMappingURL=config.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.mjs","names":["Arr","MESSAGE","Arr","MESSAGE","MESSAGE","SEPARATOR","FILTER_KEYS","QUOTED","Arr","Str","SEPARATOR","Arr","Str","MESSAGE","Arr","Arr","Str","MESSAGE","Arr","Str","Arr","Rec","Arr","Rec","preset","Arr"],"sources":["../src/features/guard-workflows/model/yaml.ts","../src/features/guard-workflows/model/publish-trigger.ts","../src/features/guard-workflows/model/release-please.ts","../src/features/guard-workflows/model/workflow-commit.ts","../src/features/guard-workflows/model/repository-services.ts","../src/features/guard-workflows/model/workflow-references.ts","../src/features/guard-workflows/model/workflow-package.ts","../src/features/guard-workflows/model/workflow-path-filter.ts","../src/features/guard-workflows/model/workflow-path.ts","../src/features/guard-workflows/model/workflow-queue.ts","../src/features/guard-workflows/model/workflow-script.ts","../src/features/guard-workflows/model/policy.ts","../src/features/guard-workflows/model/fu4-config.ts","../src/app/repository-config.ts"],"sourcesContent":["import type { RuleContext, YamlNode } from \"@r_masseater/fu4\";\nimport { pairsOf, valueAt } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nexport interface Located {\n readonly text: string;\n readonly line: number;\n readonly column: number;\n}\n\nexport const rootOf = ({ source }: RuleContext): Option.Option<YamlNode> =>\n Option.fromNullishOr(source.yaml);\n\nexport const stringOf = (node: Option.Option<YamlNode>): Option.Option<Located> =>\n pipe(\n node,\n Option.filter(({ kind }) => kind === \"scalar\"),\n Option.map(({ value, line, column }) => ({ text: value, line, column })),\n );\n\nexport const childOf =\n (key: string) =>\n (node: Option.Option<YamlNode>): Option.Option<YamlNode> =>\n pipe(node, Option.flatMap(valueAt(key)));\n\nexport const keyNodeOf =\n (key: string) =>\n (node: Option.Option<YamlNode>): Option.Option<YamlNode> =>\n pipe(\n node,\n Option.flatMap((mapping) =>\n pipe(\n pairsOf(mapping),\n Arr.findFirst((pair) => pair.key.value === key),\n Option.map((pair) => pair.key),\n ),\n ),\n );\n\nexport const itemsOf = (node: Option.Option<YamlNode>): readonly YamlNode[] =>\n pipe(\n node,\n Option.filter(({ kind }) => kind === \"sequence\"),\n Option.map(({ children }) => children),\n Option.getOrElse((): readonly YamlNode[] => []),\n );\n\nexport const entriesOf = (\n node: Option.Option<YamlNode>,\n): readonly (readonly [string, YamlNode])[] =>\n pipe(\n node,\n Option.map(pairsOf),\n Option.getOrElse(() => []),\n Arr.map((pair) => [pair.key.value, pair.value] as const),\n );\n\nexport const scalarsIn = (node: YamlNode): readonly Located[] => {\n if (node.kind === \"scalar\") {\n return [{ text: node.value, line: node.line, column: node.column }];\n }\n return pipe(\n node.children,\n Arr.flatMap((child) => scalarsIn(child)),\n );\n};\n\nconst ownValuesNamed = (name: string, node: YamlNode): readonly YamlNode[] => {\n if (node.kind !== \"mapping\") {\n return [];\n }\n return pipe(\n pairsOf(node),\n Arr.filter((pair) => pair.key.value === name),\n Arr.map((pair) => pair.value),\n );\n};\n\nexport const valuesNamed =\n (name: string) =>\n (node: YamlNode): readonly YamlNode[] => [\n ...ownValuesNamed(name, node),\n ...pipe(node.children, Arr.flatMap(valuesNamed(name))),\n ];\n\nexport const descend =\n (...keys: readonly string[]) =>\n (node: Option.Option<YamlNode>): Option.Option<YamlNode> => {\n let found = node;\n for (const key of keys) {\n found = pipe(found, childOf(key));\n }\n return found;\n };\n","import type { YamlNode } from \"@r_masseater/fu4\";\nimport { NOOP, keysOf, runOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nimport { childOf, keyNodeOf, rootOf } from \"./yaml.ts\";\n\nconst PUBLISH = /\\bmsch\\s+publish\\s+(?:plan|npm|release)\\b/u;\nconst MANUAL = \"workflow_dispatch\";\nconst TRIGGER_KEY = \"on\";\nconst MESSAGE =\n \"publishes with `msch publish plan`, `npm` or `release` from a trigger other than `workflow_dispatch`. Keep those steps in a workflow that only `workflow_dispatch` starts, and start it on a push to main with `msch publish dispatch`.\";\n\nconst triggersOf = (node: YamlNode): readonly string[] => {\n if (node.kind === \"scalar\") {\n return [node.value];\n }\n if (node.kind === \"sequence\") {\n return pipe(\n node.children,\n Arr.map(({ value }) => value),\n );\n }\n return keysOf(node);\n};\n\n/** @internal */\nexport const publishTrigger = workflowRule({\n description:\n \"Reports msch publish steps in a workflow that something other than workflow_dispatch starts\",\n visitor: (fail, context): Visitor => {\n const publishing: string[] = [];\n return {\n ...NOOP,\n step: (step): void => {\n const publishes = pipe(\n runOf(step),\n Option.flatMap(({ run }) => Option.fromNullishOr(run)),\n Option.exists(({ value }) => PUBLISH.test(value)),\n );\n if (publishes) {\n publishing.push(MANUAL);\n }\n },\n workflowPost: (): void => {\n const root = rootOf(context);\n const triggers = pipe(\n childOf(TRIGGER_KEY)(root),\n Option.map(triggersOf),\n Option.getOrElse((): readonly string[] => []),\n );\n const manualOnly = pipe(\n triggers,\n Arr.every((trigger) => trigger === MANUAL),\n );\n if (Arr.isReadonlyArrayNonEmpty(publishing) && !manualOnly) {\n for (const key of pipe(root, keyNodeOf(TRIGGER_KEY), Option.toArray)) {\n fail(key, MESSAGE);\n }\n }\n },\n };\n },\n});\n","import { NOOP, actionOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Option, pipe } from \"effect\";\n\nconst RELEASE_PLEASE = /^googleapis\\/release-please-action(?:@|$)/u;\nconst MESSAGE =\n \"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.\";\n\n/** @internal */\nexport const releasePlease = workflowRule({\n description: \"Reports the release-please action, because releases here are manual\",\n visitor: (fail): Visitor => ({\n ...NOOP,\n step: (step): void => {\n const uses = pipe(\n actionOf(step),\n Option.flatMap(({ uses: text }) => Option.fromNullishOr(text)),\n Option.filter(({ value }) => RELEASE_PLEASE.test(value)),\n Option.toArray,\n );\n for (const found of uses) {\n fail(found, MESSAGE);\n }\n },\n }),\n});\n","import { NOOP, actionOf, runOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Option, pipe } from \"effect\";\n\nconst GIT_WRITE = /\\bgit\\s+(?:-{1,2}\\S+\\s+(?:\\S+\\s+)?)*(?:commit|push)\\b/u;\nconst COMMIT_ACTION = /^[^@/]+\\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;\nconst MESSAGE =\n \"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.\";\n\n/** @internal */\nexport const workflowCommit = workflowRule({\n description: \"Reports git commit, git push and commit actions in a workflow\",\n visitor: (fail): Visitor => ({\n ...NOOP,\n step: (step): void => {\n const writes = pipe(\n runOf(step),\n Option.flatMap((exec) =>\n Option.zipRight(\n Option.filter(Option.fromNullishOr(exec.run), ({ value }) => GIT_WRITE.test(value)),\n Option.orElse(Option.fromNullishOr(exec.runPosition), () =>\n Option.fromNullishOr(exec.run),\n ),\n ),\n ),\n );\n const commits = pipe(\n actionOf(step),\n Option.flatMap(({ uses }) => Option.fromNullishOr(uses)),\n Option.filter(({ value }) => COMMIT_ACTION.test(value)),\n );\n for (const found of Option.toArray(Option.orElse(writes, () => commits))) {\n fail(found, MESSAGE);\n }\n },\n }),\n});\n","import { Effect, Layer, ManagedRuntime } from \"effect\";\n\nimport type { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\nimport { nodeRepositoryFiles, nodeServicesLayer } from \"#/shared/lib/repository-files.ts\";\n\nconst runtime = ManagedRuntime.make(Layer.provide(nodeRepositoryFiles, nodeServicesLayer));\n\n/** @internal */\nexport const inRepository = <Found>(\n effect: Effect.Effect<Found, never, RepositoryFiles>,\n): Effect.Effect<Found> => Effect.promise(() => runtime.runPromise(effect));\n","import type { YamlNode } from \"@r_masseater/fu4\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nimport { childOf, descend, entriesOf, itemsOf, scalarsIn, stringOf } from \"./yaml.ts\";\nimport type { Located } from \"./yaml.ts\";\n\nconst ROOT = \".\";\nconst LOCAL = \"./\";\nconst NEGATION = \"!\";\nconst SEPARATOR = \"/\";\nconst LINE = \"\\n\";\nconst UNRESOLVED_MARKERS = [\"${{\", \"$\", \"{\"];\nconst ABSOLUTE_MARKERS = [\"/\", \"~\"];\nconst FILE_INPUT_SUFFIX = \"-file\";\nconst DEPENDENCY_PATH_INPUT = \"cache-dependency-path\";\nconst FILTER_KEYS = [\"paths\", \"paths-ignore\"];\nconst HASH_FILES = /hashFiles\\((?<arguments>[^)]*)\\)/gu;\nconst QUOTED = /'(?<path>[^']*)'/gu;\nconst SCRIPT = /^[\\w.@/-]+\\.(?:ts|mts|cts|sh)$/u;\nconst TOKEN_SEPARATOR = /[\\s;&|()<>\"'`=]+/u;\n\nexport const ACTION_DEFINITIONS: readonly string[] = [\"action.yml\", \"action.yaml\"];\n\nexport type ReferenceKind = \"glob\" | \"file\" | \"script\" | \"directory\" | \"action\";\n\nexport interface WorkflowReference extends Located {\n readonly kind: ReferenceKind;\n readonly field: string;\n readonly path: string;\n}\n\ntype Entry = readonly [string, YamlNode];\n\nconst containsAny =\n (markers: readonly string[]) =>\n (path: string): boolean =>\n pipe(\n markers,\n Arr.some((marker) => Str.includes(marker)(path)),\n );\n\nconst startsWithAny =\n (markers: readonly string[]) =>\n (path: string): boolean =>\n pipe(\n markers,\n Arr.some((marker) => Str.startsWith(marker)(path)),\n );\n\nconst isLiteralPath = (path: string): boolean =>\n Str.isNonEmpty(path) &&\n !containsAny(UNRESOLVED_MARKERS)(path) &&\n !startsWithAny(ABSOLUTE_MARKERS)(path);\n\nconst withoutLocal = (path: string): string => {\n if (Str.startsWith(LOCAL)(path)) {\n return Str.slice(LOCAL.length)(path);\n }\n return path;\n};\n\nconst joinPath = (base: string, path: string): string => {\n const relative = withoutLocal(Str.trim(path));\n if (base === ROOT) {\n return relative;\n }\n return `${base}${SEPARATOR}${relative}`;\n};\n\nconst reference =\n (kind: ReferenceKind, field: string, base = ROOT) =>\n ({ text, line, column }: Located): readonly WorkflowReference[] => {\n const path = Str.trim(text);\n if (!isLiteralPath(path) || !isLiteralPath(base)) {\n return [];\n }\n return [{ kind, field, path: joinPath(base, path), text, line, column }];\n };\n\nconst isPositive = ({ text }: Located): boolean => !Str.startsWith(NEGATION)(Str.trim(text));\n\nconst globsIn = (field: string, node: Option.Option<YamlNode>): readonly WorkflowReference[] =>\n pipe(\n itemsOf(node),\n Arr.flatMap((item) => pipe(item, Option.some, stringOf, Option.toArray)),\n Arr.filter(isPositive),\n Arr.flatMap(reference(\"glob\", field)),\n );\n\nconst filtersOf = ([event, filters]: Entry): readonly WorkflowReference[] =>\n pipe(\n FILTER_KEYS,\n Arr.flatMap((key) => globsIn(`on.${event}.${key}`, pipe(filters, Option.some, childOf(key)))),\n );\n\nconst workingDirectoryOf = (owner: Option.Option<YamlNode>): Option.Option<Located> =>\n pipe(owner, descend(\"defaults\", \"run\", \"working-directory\"), stringOf);\n\nconst directoryOf = (found: Option.Option<Located>, base: string): string =>\n pipe(\n found,\n Option.map(({ text }) => joinPath(ROOT, text)),\n Option.getOrElse(() => base),\n );\n\nconst located =\n (kind: ReferenceKind, field: string, base = ROOT) =>\n (found: Option.Option<Located>): readonly WorkflowReference[] =>\n pipe(found, Option.toArray, Arr.flatMap(reference(kind, field, base)));\n\nconst localUses = (node: Option.Option<YamlNode>): Option.Option<Located> =>\n pipe(\n node,\n childOf(\"uses\"),\n stringOf,\n Option.filter(({ text }) => Str.startsWith(LOCAL)(text)),\n );\n\nconst scriptsIn =\n (field: string, base: string) =>\n ({ text, line, column }: Located): readonly WorkflowReference[] =>\n pipe(\n Str.split(text, TOKEN_SEPARATOR),\n Arr.filter((token) => SCRIPT.test(token)),\n Arr.dedupe,\n Arr.flatMap((token) => pipe({ text: token, line, column }, reference(\"script\", field, base))),\n );\n\nconst isFileInput = ([key]: Entry): boolean =>\n Str.endsWith(FILE_INPUT_SUFFIX)(key) || key === DEPENDENCY_PATH_INPUT;\n\nconst linesOf = ({ text, line, column }: Located): readonly Located[] =>\n pipe(\n Str.split(text, LINE),\n Arr.map((each) => ({ text: each, line, column })),\n );\n\nconst fileInputOf =\n (field: string) =>\n ([key, value]: Entry): readonly WorkflowReference[] =>\n pipe(\n value,\n Option.some,\n stringOf,\n Option.toArray,\n Arr.flatMap(linesOf),\n Arr.flatMap(reference(\"glob\", `${field}.with.${key}`)),\n );\n\nconst fileInputsIn = (field: string, step: YamlNode): readonly WorkflowReference[] =>\n pipe(\n step,\n Option.some,\n childOf(\"with\"),\n entriesOf,\n Arr.filter(isFileInput),\n Arr.flatMap(fileInputOf(field)),\n );\n\nconst scriptReferencesOf = (\n field: string,\n directory: string,\n step: YamlNode,\n): readonly WorkflowReference[] =>\n pipe(\n step,\n Option.some,\n childOf(\"run\"),\n stringOf,\n Option.toArray,\n Arr.flatMap(scriptsIn(`${field}.run`, directory)),\n );\n\nconst stepReferences =\n (job: string, base: string) =>\n (step: YamlNode, index: number): readonly WorkflowReference[] => {\n const field = `jobs.${job}.steps[${index}]`;\n const own = pipe(step, Option.some, childOf(\"working-directory\"), stringOf);\n const directory = directoryOf(own, base);\n return [\n ...pipe(step, Option.some, localUses, located(\"action\", `${field}.uses`)),\n ...pipe(own, located(\"directory\", `${field}.working-directory`)),\n ...scriptReferencesOf(field, directory, step),\n ...fileInputsIn(field, step),\n ];\n };\n\nconst jobReferences =\n (base: string) =>\n ([job, node]: Entry): readonly WorkflowReference[] => {\n const own = pipe(node, Option.some, workingDirectoryOf);\n const steps = pipe(node, Option.some, childOf(\"steps\"), itemsOf);\n const directory = directoryOf(own, base);\n return [\n ...pipe(node, Option.some, localUses, located(\"file\", `jobs.${job}.uses`)),\n ...pipe(own, located(\"directory\", `jobs.${job}.defaults.run.working-directory`)),\n ...pipe(steps, Arr.flatMap(stepReferences(job, directory))),\n ];\n };\n\nconst groupsOf =\n (pattern: RegExp, group: string) =>\n ({ text, line, column }: Located): readonly Located[] =>\n pipe(\n Arr.fromIterable(Str.matchAll(pattern)(text)),\n Arr.flatMap((match) =>\n pipe(\n Option.fromNullishOr(match.groups),\n Option.flatMap((groups) => Option.fromNullishOr(groups[group])),\n Option.toArray,\n ),\n ),\n Arr.map((value) => ({ text: value, line, column })),\n );\n\nconst hashFilesIn = (root: YamlNode): readonly WorkflowReference[] =>\n pipe(\n scalarsIn(root),\n Arr.flatMap(groupsOf(HASH_FILES, \"arguments\")),\n Arr.flatMap(groupsOf(QUOTED, \"path\")),\n Arr.filter(isPositive),\n Arr.flatMap(reference(\"glob\", \"hashFiles\")),\n );\n\nconst jobsOf = (root: YamlNode): readonly Entry[] =>\n pipe(root, Option.some, childOf(\"jobs\"), entriesOf);\n\n/** @internal */\nexport const workflowReferences = (root: YamlNode): readonly WorkflowReference[] => {\n const workflowDefault = pipe(root, Option.some, workingDirectoryOf);\n const base = directoryOf(workflowDefault, ROOT);\n return [\n ...pipe(root, Option.some, childOf(\"on\"), entriesOf, Arr.flatMap(filtersOf)),\n ...pipe(workflowDefault, located(\"directory\", \"defaults.run.working-directory\")),\n ...pipe(jobsOf(root), Arr.flatMap(jobReferences(base))),\n ...hashFilesIn(root),\n ];\n};\n\nconst outputPathsOf = (step: YamlNode): readonly string[] =>\n pipe(\n step,\n Option.some,\n descend(\"with\", \"path\"),\n stringOf,\n Option.toArray,\n Arr.flatMap(linesOf),\n Arr.map(({ text }) => joinPath(ROOT, text)),\n Arr.filter(isLiteralPath),\n );\n\n/** @internal */\nexport const producedPaths = (root: YamlNode): readonly string[] =>\n pipe(\n jobsOf(root),\n Arr.flatMap(([, job]) => pipe(job, Option.some, childOf(\"steps\"), itemsOf)),\n Arr.flatMap(outputPathsOf),\n );\n","import { groupOf } from \"@masseater.dev/lint-host/collections\";\nimport { defineRule } from \"@r_masseater/fu4\";\nimport type { Report, YamlNode } from \"@r_masseater/fu4\";\nimport { pairsOf } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { namedWorkspaces, patternOf } from \"#/entities/workspace/index.ts\";\nimport type { NamedWorkspace } from \"#/entities/workspace/index.ts\";\n\nimport { inRepository } from \"./repository-services.ts\";\nimport { workflowReferences } from \"./workflow-references.ts\";\nimport { childOf, scalarsIn, stringOf } from \"./yaml.ts\";\nimport type { Located } from \"./yaml.ts\";\n\nconst WORKFLOW = /(?:^|\\/)\\.github\\/workflows\\/(?<name>[^/]+)\\.ya?ml$/u;\nconst ACTION = /(?:^|\\/)\\.github\\/actions\\/(?<name>[^/]+)\\/action\\.ya?ml$/u;\nconst PACKAGE_FILTER =\n /(?:^|\\s)(?:--filter|-F)(?:\\s+|=)(?<quote>[\"']?)(?<value>[^\\s\"'$][^\\s\"']*)\\k<quote>/gu;\nconst SEPARATOR = \"/\";\nconst WORD_SEPARATORS = /[-_]/gu;\nconst SPACE = \" \";\nconst FIRST_LINE: Located = { text: \"\", line: 1, column: 1 };\n\nconst packageMessage = (what: string, directory: string): string =>\n `${what} names the workspace ${directory}. A workflow or job made for one package does not scale: give the package a vp task and let the generic pipeline (verify, deploy, release, daily, task) find it.`;\n\nconst matching = (workspaces: readonly NamedWorkspace[], text: string): Option.Option<string> =>\n pipe(\n workspaces,\n Arr.findFirst(\n ({ names }) =>\n Arr.isReadonlyArrayNonEmpty(names) && Option.isSome(Str.match(patternOf(names))(text)),\n ),\n Option.map(({ directory }) => directory),\n );\n\nconst named = (workspaces: readonly NamedWorkspace[], text: string): Option.Option<string> =>\n Option.orElse(matching(workspaces, text), () =>\n matching(workspaces, Str.replaceAll(WORD_SEPARATORS, SPACE)(text)),\n );\n\nconst containing = (workspaces: readonly NamedWorkspace[], path: string): Option.Option<string> =>\n pipe(\n workspaces,\n Arr.findFirst(\n ({ directory }) => path === directory || Str.startsWith(`${directory}${SEPARATOR}`)(path),\n ),\n Option.map(({ directory }) => directory),\n );\n\nconst filtersIn = (scalars: readonly Located[]): readonly Located[] =>\n pipe(\n scalars,\n Arr.flatMap(({ text, line, column }) =>\n pipe(\n Arr.fromIterable(Str.matchAll(PACKAGE_FILTER)(text)),\n Arr.flatMap((match) =>\n pipe(\n Option.fromNullishOr(match.groups),\n Option.flatMap((groups) => Option.fromNullishOr(groups[\"value\"])),\n Option.toArray,\n ),\n ),\n Arr.map((value) => ({ text: value, line, column })),\n ),\n ),\n );\n\nconst findingFor = (\n what: string,\n found: Located,\n directory: Option.Option<string>,\n): readonly Finding[] =>\n pipe(\n directory,\n Option.map((workspace): Finding => ({\n line: found.line,\n column: found.column,\n message: packageMessage(what, workspace),\n })),\n Option.toArray,\n );\n\ntype Finding = Pick<Report, \"line\" | \"column\" | \"message\">;\n\nconst namesIn = (stem: string, root: Option.Option<YamlNode>): readonly Located[] => [\n { ...FIRST_LINE, text: stem },\n ...pipe(root, childOf(\"name\"), stringOf, Option.toArray),\n ...pipe(\n root,\n childOf(\"jobs\"),\n Option.map((jobs) =>\n pipe(\n pairsOf(jobs),\n Arr.map(({ key }): Located => ({ text: key.value, line: key.line, column: key.column })),\n ),\n ),\n Option.getOrElse((): readonly Located[] => []),\n ),\n];\n\nconst workflowFindings = (\n workspaces: readonly NamedWorkspace[],\n stem: string,\n root: YamlNode,\n): readonly Finding[] => {\n const fromNames = pipe(\n namesIn(stem, Option.some(root)),\n Arr.flatMap((found) => findingFor(`\"${found.text}\"`, found, named(workspaces, found.text))),\n );\n const referenced = pipe(\n workflowReferences(root),\n Arr.filter(({ field }) => !Str.startsWith(\"on.\")(field)),\n Arr.flatMap((found) => findingFor(found.field, found, containing(workspaces, found.path))),\n );\n const filtered = pipe(\n filtersIn(scalarsIn(root)),\n Arr.flatMap((found) =>\n findingFor(`--filter ${found.text}`, found, matching(workspaces, found.text)),\n ),\n );\n return [...fromNames, ...referenced, ...filtered];\n};\n\nexport const workflowPackage = defineRule({\n meta: {\n description: \"Reports workflows, jobs, actions and paths that are made for one workspace\",\n kinds: [\"workflow\", \"action\"],\n },\n check: ({ filename, project, source, report }) =>\n Effect.gen(function* checkPackages() {\n const workspaces = yield* namedWorkspaces(project.root);\n const asWorkflow = groupOf(\"name\")(WORKFLOW.exec(filename));\n const asAction = groupOf(\"name\")(ACTION.exec(filename));\n const found: readonly Finding[] = [\n ...pipe(\n asAction,\n Option.flatMap((name) => named(workspaces, name)),\n Option.map((directory): Finding => ({\n ...FIRST_LINE,\n message: packageMessage(\n `The action ${Option.getOrElse(asAction, () => \"\")}`,\n directory,\n ),\n })),\n Option.toArray,\n ),\n ...pipe(\n Option.all([asWorkflow, Option.fromNullishOr(source.yaml)]),\n Option.map(([stem, root]) => workflowFindings(workspaces, stem, root)),\n Option.getOrElse((): readonly Finding[] => []),\n ),\n ];\n for (const each of found) {\n report(each);\n }\n }).pipe(inRepository),\n});\n","import { defineRule } from \"@r_masseater/fu4\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nimport { childOf, entriesOf, keyNodeOf, rootOf, scalarsIn } from \"./yaml.ts\";\n\nconst FILTER_KEYS: readonly string[] = [\"paths\", \"paths-ignore\"];\nconst PATHS_FILTER_ACTION = /(?:^|\\/)paths-filter@/u;\nconst MESSAGE =\n \"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.\";\n\n/** @internal */\nexport const workflowPathFilter = defineRule({\n meta: {\n description: \"Reports paths and paths-ignore triggers and the paths-filter action\",\n kinds: [\"workflow\"],\n },\n check: (context): void => {\n const root = rootOf(context);\n const triggers = pipe(\n root,\n childOf(\"on\"),\n entriesOf,\n Arr.flatMap(([, trigger]) =>\n pipe(\n FILTER_KEYS,\n Arr.flatMap((key) => pipe(Option.some(trigger), keyNodeOf(key), Option.toArray)),\n ),\n ),\n );\n const actions = pipe(\n Option.toArray(root),\n Arr.flatMap((node) => scalarsIn(node)),\n Arr.filter(({ text }) => PATHS_FILTER_ACTION.test(text)),\n );\n for (const found of [...triggers, ...actions]) {\n context.report({ line: found.line, column: found.column, message: MESSAGE });\n }\n },\n});\n","import { defineRule } from \"@r_masseater/fu4\";\nimport { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { existsAt, isDirectoryAt, isIgnored, staticPrefix } from \"#/shared/lib/path-existence.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { inRepository } from \"./repository-services.ts\";\nimport { ACTION_DEFINITIONS, producedPaths, workflowReferences } from \"./workflow-references.ts\";\nimport type { ReferenceKind, WorkflowReference } from \"./workflow-references.ts\";\n\nconst SEPARATOR = \"/\";\n\nconst EXPECTED: Readonly<Record<ReferenceKind, string>> = {\n action: \"a directory with action.yml\",\n directory: \"a directory\",\n file: \"a file\",\n glob: \"a pattern that matches a tracked file\",\n script: \"a file\",\n};\n\ntype Resolver = (root: string, path: string) => Effect.Effect<boolean, never, RepositoryFiles>;\n\nconst matchesAny = Effect.fn(\"matchesAny\")(function* matchesAny(\n root: string,\n pathspecs: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const matched = yield* files.matchingFiles(root, pathspecs);\n return Arr.isReadonlyArrayNonEmpty(matched);\n});\n\nconst matchesGlob: Resolver = (root, path) => matchesAny(root, [`:(glob)${path}`]);\n\nconst hasAction: Resolver = Effect.fn(\"hasAction\")(function* hasAction(root: string, path: string) {\n const found = yield* Effect.forEach(\n ACTION_DEFINITIONS,\n (name) => existsAt(root, `${path}${SEPARATOR}${name}`),\n { concurrency: 1 },\n );\n return pipe(found, Arr.some(Boolean));\n});\n\nconst suffixAt =\n (segments: readonly string[]) =>\n (index: number): string =>\n `:(glob)**/${pipe(segments, Arr.drop(index), Arr.join(SEPARATOR))}`;\n\nconst findsScript: Resolver = Effect.fn(\"findsScript\")(function* findsScript(\n root: string,\n path: string,\n) {\n if (yield* existsAt(root, path)) {\n return true;\n }\n const segments = Str.split(path, SEPARATOR);\n return yield* matchesAny(root, Arr.makeBy(segments.length, suffixAt(segments)));\n});\n\nconst RESOLVERS: Readonly<Record<ReferenceKind, Resolver>> = {\n action: hasAction,\n directory: isDirectoryAt,\n file: existsAt,\n glob: matchesGlob,\n script: findsScript,\n};\n\nconst overlaps =\n (path: string) =>\n (produced: string): boolean =>\n produced === path ||\n Str.startsWith(`${path}${SEPARATOR}`)(produced) ||\n Str.startsWith(`${produced}${SEPARATOR}`)(path);\n\nconst isMissing = Effect.fn(\"isMissing\")(function* isMissing(\n root: string,\n produced: readonly string[],\n found: WorkflowReference,\n) {\n const prefix = staticPrefix(found.path);\n if (pipe(produced, Arr.some(overlaps(prefix)))) {\n return false;\n }\n if (yield* RESOLVERS[found.kind](root, found.path)) {\n return false;\n }\n return !(yield* isIgnored(root, found.path));\n});\n\nexport const workflowPath = defineRule({\n meta: {\n description: \"Reports a path that a workflow names and the repository does not have\",\n kinds: [\"workflow\"],\n },\n check: ({ project, source, report }) =>\n Effect.gen(function* checkPaths() {\n for (const yaml of Option.toArray(Option.fromNullishOr(source.yaml))) {\n const produced = producedPaths(yaml);\n const missing = yield* Effect.filter(workflowReferences(yaml), (found) =>\n isMissing(project.root, produced, found),\n );\n for (const found of missing) {\n report({\n line: found.line,\n column: found.column,\n 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.`,\n });\n }\n }\n }).pipe(inRepository),\n});\n","import { defineRule } from \"@r_masseater/fu4\";\nimport { keysOf } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nimport { keyNodeOf, rootOf, valuesNamed } from \"./yaml.ts\";\n\nconst CONCURRENCY_KEY = \"concurrency\";\nconst QUEUE_KEY = \"queue\";\nconst MESSAGE =\n \"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.\";\n\n/** @internal */\nexport const workflowQueue = defineRule({\n meta: {\n description:\n \"Reports queue on a concurrency group, because a queued group holds back the newest commit\",\n kinds: [\"workflow\"],\n },\n check: (context): void => {\n const keys = pipe(\n rootOf(context),\n Option.toArray,\n Arr.flatMap((root) => valuesNamed(CONCURRENCY_KEY)(root)),\n Arr.filter((group) => Arr.contains(keysOf(group), QUEUE_KEY)),\n Arr.flatMap((group) => pipe(Option.some(group), keyNodeOf(QUEUE_KEY), Option.toArray)),\n );\n for (const key of keys) {\n context.report({ line: key.line, column: key.column, message: MESSAGE });\n }\n },\n});\n","import { NOOP, runOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nconst COMMAND_CHAIN = /&&|\\|\\||;|\\|/u;\nconst QUOTED = /\\$\\{\\{.*?\\}\\}|\"(?:[^\"\\\\]|\\\\.)*\"|'[^']*'/gu;\nconst COMMENT = \"#\";\nconst ONE_COMMAND = 1;\nconst MESSAGE =\n \"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.\";\n\nconst isCommand = (line: string): boolean => Str.isNonEmpty(line) && !Str.startsWith(COMMENT)(line);\n\nconst chainsCommands = (line: string): boolean =>\n COMMAND_CHAIN.test(Str.replaceAll(QUOTED, \"\")(line));\n\nconst runsMoreThanOneCommand = (text: string): boolean => {\n const lines = pipe(Str.split(\"\\n\")(text), Arr.map(Str.trim), Arr.filter(isCommand));\n return lines.length > ONE_COMMAND || pipe(lines, Arr.some(chainsCommands));\n};\n\n/** @internal */\nexport const workflowScript = workflowRule({\n description: \"Reports a run step with more than one command, because the logic belongs in a task\",\n visitor: (fail): Visitor => ({\n ...NOOP,\n step: (step): void => {\n const runs = pipe(\n runOf(step),\n Option.flatMap(({ run }) => Option.fromNullishOr(run)),\n Option.filter(({ value }) => runsMoreThanOneCommand(value)),\n Option.toArray,\n );\n for (const found of runs) {\n fail(found, MESSAGE);\n }\n },\n }),\n});\n","import { definePlugin } from \"@r_masseater/fu4\";\nimport type { Fu4Config } from \"@r_masseater/fu4\";\nimport { Array as Arr, Record as Rec, pipe } from \"effect\";\n\nimport { publishTrigger } from \"./publish-trigger.ts\";\nimport { releasePlease } from \"./release-please.ts\";\nimport { workflowCommit } from \"./workflow-commit.ts\";\nimport { workflowPackage } from \"./workflow-package.ts\";\nimport { workflowPathFilter } from \"./workflow-path-filter.ts\";\nimport { workflowPath } from \"./workflow-path.ts\";\nimport { workflowQueue } from \"./workflow-queue.ts\";\nimport { workflowScript } from \"./workflow-script.ts\";\n\nconst NAME = \"msch\";\n\nconst plugin = definePlugin({\n rules: {\n \"publish-trigger\": publishTrigger,\n \"release-please\": releasePlease,\n \"workflow-commit\": workflowCommit,\n \"workflow-package\": workflowPackage,\n \"workflow-path\": workflowPath,\n \"workflow-path-filter\": workflowPathFilter,\n \"workflow-queue\": workflowQueue,\n \"workflow-script\": workflowScript,\n },\n});\n\n/** @internal */\nexport const workflowPolicy = (): Fu4Config => ({\n plugins: Rec.singleton(NAME, plugin),\n rules: pipe(\n Rec.keys(plugin.rules),\n Arr.map((rule): readonly [string, \"error\"] => [`${NAME}/${rule}`, \"error\"]),\n Rec.fromEntries,\n ),\n});\n","import type { Fu4Config } from \"@r_masseater/fu4\";\nimport { recommended } from \"@r_masseater/fu4/presets\";\n\nimport { workflowPolicy } from \"./policy.ts\";\n\n/** @internal */\nexport const fu4Of = (): Fu4Config => ({ extends: [recommended(), workflowPolicy()] });\n","import { fileURLToPath } from \"node:url\";\n\nimport { Array as Arr, Option, Record as Rec, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\nimport type { OxlintOverride } from \"vite-plus/lint\";\n\nimport type { WorkspaceSettings } from \"#/features/build-workspace-settings/index.ts\";\nimport type { MarkdownOptions } from \"#/features/define-lint-preset/index.ts\";\nimport {\n decisionTestRules,\n exempt,\n lint as preset,\n markdownOf,\n requiredStack,\n structureOf,\n} from \"#/features/define-lint-preset/index.ts\";\nimport { fu4Of } from \"#/features/guard-workflows/index.ts\";\nimport type { AddedRulesValue } from \"#/shared/lib/added-rules.ts\";\n\nimport { tasksOf } from \"./repository-tasks.ts\";\nimport type { CargoInputs, UsageOptions } from \"./repository-tasks.ts\";\nimport { secretsOf, textlintOf } from \"./repository-text.ts\";\nimport type { TextOptions } from \"./repository-text.ts\";\n\nexport { secretsOf } from \"./repository-text.ts\";\n\nexport interface AddedOverride {\n readonly files: readonly string[];\n readonly excludeFiles?: readonly string[];\n readonly rules: AddedRulesValue;\n}\n\nexport interface RepositoryOptions {\n readonly workspace: WorkspaceSettings;\n readonly overrides?: readonly AddedOverride[];\n readonly textlint?: TextOptions;\n readonly markdown?: Omit<MarkdownOptions, \"indexSkill\">;\n readonly run?: {\n readonly tasks?: Readonly<Record<string, string>>;\n readonly remoteCache?: string;\n };\n readonly usage?: UsageOptions;\n readonly cargo?: { readonly inputs: CargoInputs };\n}\n\ninterface SharedCache {\n readonly scripts: true;\n readonly tasks: true;\n readonly remote: { readonly url: string };\n}\n\nconst cacheOf = (remoteCache: string | undefined): SharedCache | true =>\n pipe(\n Option.fromNullishOr(remoteCache),\n Option.match({\n onNone: (): SharedCache | true => true,\n onSome: (url) => ({ scripts: true, tasks: true, remote: { url } }),\n }),\n );\n\ntype Allowed = NonNullable<NonNullable<UserConfig[\"dependencyRules\"]>[\"allowed\"]>;\n\nconst allowedIn = (\n allowances: WorkspaceSettings[\"devDependencies\"],\n field: \"dependencies\" | \"devDependencies\",\n): Allowed =>\n pipe(\n allowances,\n Rec.map(({ workspaces, dependencies }) => ({ workspaces, dependencies, fields: [field] })),\n );\n\nconst COMMIT_CONVENTION = fileURLToPath(import.meta.resolve(\"@commitlint/config-conventional\"));\n\nconst added = ({ files, excludeFiles, rules }: AddedOverride): OxlintOverride =>\n pipe(\n Option.fromUndefinedOr(excludeFiles),\n Option.match({\n onNone: (): OxlintOverride => ({ files: [...files], rules: { ...rules } }),\n onSome: (excluded): OxlintOverride => ({\n files: [...files],\n excludeFiles: [...excluded],\n rules: { ...rules },\n }),\n }),\n );\n\nconst lintOf = ({\n workspace,\n overrides = [],\n}: RepositoryOptions): NonNullable<UserConfig[\"lint\"]> => ({\n ...preset,\n ignorePatterns: exempt,\n overrides: [\n ...preset.overrides,\n {\n files: [...workspace.lint.shadcnUi],\n rules: { \"react/jsx-props-no-spreading\": \"off\" },\n },\n {\n files: [\n ...workspace.lint.publicEntries,\n ...workspace.lint.deployEntries,\n ...workspace.lint.siteEntries,\n ],\n rules: { \"import/no-default-export\": \"off\" },\n },\n ...pipe(overrides, Arr.map(added)),\n ...workspace.lint.overrides,\n { files: [\"**/*.test.ts\"], rules: decisionTestRules },\n ],\n});\n\nexport const repositoryConfig = (options: RepositoryOptions): UserConfig => {\n const { workspace, textlint = {}, markdown = {}, run = {}, usage, cargo } = options;\n return {\n commitlint: { extends: [COMMIT_CONVENTION] },\n dependencyRules: {\n allowed: {\n ...allowedIn(workspace.devDependencies, \"devDependencies\"),\n ...allowedIn(workspace.dependencies, \"dependencies\"),\n },\n banned: requiredStack,\n peerRanges: \"intersect\",\n },\n h56m: secretsOf(),\n wism: structureOf({\n members: workspace.members,\n ignorePatterns: exempt,\n }),\n textlint: textlintOf({ ...textlint, articles: workspace.articles }),\n y8: markdownOf({ ...markdown, indexSkill: workspace.indexSkill }),\n fu4: fu4Of(),\n test: { projects: [...workspace.testProjects], passWithNoTests: true },\n staged: { \"*\": \"vp fmt --no-error-on-unmatched-pattern\" },\n fmt: {\n ignorePatterns: exempt,\n sortImports: true,\n sortTailwindcss: true,\n sortPackageJson: true,\n },\n lint: lintOf(options),\n run: {\n cache: cacheOf(run.remoteCache),\n tasks: tasksOf({\n workspace,\n commands: run.tasks ?? {},\n usage: Option.fromUndefinedOr(usage),\n cargo: Option.map(Option.fromUndefinedOr(cargo), ({ inputs }) => inputs),\n }),\n },\n };\n};\n"],"mappings":";;;;;;;;;AAUA,MAAa,UAAU,EAAE,aACvB,OAAO,cAAc,OAAO,IAAI;AAElC,MAAa,YAAY,SACvB,KACE,MACA,OAAO,QAAQ,EAAE,WAAW,SAAS,QAAQ,GAC7C,OAAO,KAAK,EAAE,OAAO,MAAM,cAAc;CAAE,MAAM;CAAO;CAAM;AAAO,EAAE,CACzE;AAEF,MAAa,WACV,SACA,SACC,KAAK,MAAM,OAAO,QAAQ,QAAQ,GAAG,CAAC,CAAC;AAE3C,MAAa,aACV,SACA,SACC,KACE,MACA,OAAO,S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AI,IAAI,KAAK,CAAC;EACjC,GAAG,UAAU,KAAK;EAClB;GAAE,OAAO,CAAC,cAAc;GAAG,OAAO;EAAkB;CACtD;AACF;AAEA,MAAa,oBAAoB,YAA2C;CAC1E,MAAM,EAAE,WAAW,WAAW,CAAC,GAAG,WAAW,CAAC,GAAG,MAAM,CAAC,GAAG,OAAO,UAAU;CAC5E,OAAO;EACL,YAAY,EAAE,SAAS,CAAC,iBAAiB,EAAE;EAC3C,iBAAiB;GACf,SAAS;IACP,GAAG,UAAU,UAAU,iBAAiB,iBAAiB;IACzD,GAAG,UAAU,UAAU,cAAc,cAAc;GACrD;GACA,QAAQ;GACR,YAAY;EACd;EACA,MAAM,UAAU;EAChB,MAAM,YAAY;GAChB,SAAS,UAAU;GACnB,gBAAgB;EAClB,CAAC;EACD,UAAU,WAAW;GAAE,GAAG;GAAU,UAAU,UAAU;EAAS,CAAC;EAClE,IAAI,WAAW;GAAE,GAAG;GAAU,YAAY,UAAU;EAAW,CAAC;EAChE,KAAK,MAAM;EACX,MAAM;GAAE,UAAU,CAAC,GAAG,UAAU,YAAY;GAAG,iBAAiB;EAAK;EACrE,QAAQ,EAAE,KAAK,yCAAyC;EACxD,KAAK;GACH,gBAAgB;GAChB,aAAa;GACb,iBAAiB;GACjB,iBAAiB;EACnB;EACA,MAAM,OAAO,OAAO;EACpB,KAAK;GACH,OAAO,QAAQ,IAAI,WAAW;GAC9B,OAAO,QAAQ;IACb;IACA,UAAU,IAAI,SAAS,CAAC;IACxB,OAAO,OAAO,gBAAgB,KAAK;IACnC,OAAO,OAAO,IAAI,OAAO,gBAAgB,KAAK,IAAI,EAAE,aAAa,MAAM;GACzE,CAAC;EACH;CACF;AACF"}
1
+ {"version":3,"file":"config.mjs","names":["Arr","MESSAGE","Arr","MESSAGE","MESSAGE","SEPARATOR","FILTER_KEYS","QUOTED","Arr","Str","SEPARATOR","Arr","Str","namesIn","MESSAGE","Arr","Arr","Str","MESSAGE","Arr","Str","Arr","Rec","Arr","Rec","preset","Arr"],"sources":["../src/features/guard-workflows/model/yaml.ts","../src/features/guard-workflows/model/publish-trigger.ts","../src/features/guard-workflows/model/release-please.ts","../src/features/guard-workflows/model/workflow-commit.ts","../src/features/guard-workflows/model/repository-services.ts","../src/features/guard-workflows/model/workflow-references.ts","../src/features/guard-workflows/model/workflow-package.ts","../src/features/guard-workflows/model/workflow-path-filter.ts","../src/features/guard-workflows/model/workflow-path.ts","../src/features/guard-workflows/model/workflow-queue.ts","../src/features/guard-workflows/model/workflow-script.ts","../src/features/guard-workflows/model/policy.ts","../src/features/guard-workflows/model/fu4-config.ts","../src/app/repository-dependencies.ts","../src/app/repository-config.ts"],"sourcesContent":["import type { RuleContext, YamlNode } from \"@r_masseater/fu4\";\nimport { pairsOf, valueAt } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nexport interface Located {\n readonly text: string;\n readonly line: number;\n readonly column: number;\n}\n\nexport const rootOf = ({ source }: RuleContext): Option.Option<YamlNode> =>\n Option.fromNullishOr(source.yaml);\n\nexport const stringOf = (node: Option.Option<YamlNode>): Option.Option<Located> =>\n pipe(\n node,\n Option.filter(({ kind }) => kind === \"scalar\"),\n Option.map(({ value, line, column }) => ({ text: value, line, column })),\n );\n\nexport const childOf =\n (key: string) =>\n (node: Option.Option<YamlNode>): Option.Option<YamlNode> =>\n pipe(node, Option.flatMap(valueAt(key)));\n\nexport const keyNodeOf =\n (key: string) =>\n (node: Option.Option<YamlNode>): Option.Option<YamlNode> =>\n pipe(\n node,\n Option.flatMap((mapping) =>\n pipe(\n pairsOf(mapping),\n Arr.findFirst((pair) => pair.key.value === key),\n Option.map((pair) => pair.key),\n ),\n ),\n );\n\nexport const itemsOf = (node: Option.Option<YamlNode>): readonly YamlNode[] =>\n pipe(\n node,\n Option.filter(({ kind }) => kind === \"sequence\"),\n Option.map(({ children }) => children),\n Option.getOrElse((): readonly YamlNode[] => []),\n );\n\nexport const entriesOf = (\n node: Option.Option<YamlNode>,\n): readonly (readonly [string, YamlNode])[] =>\n pipe(\n node,\n Option.map(pairsOf),\n Option.getOrElse(() => []),\n Arr.map((pair) => [pair.key.value, pair.value] as const),\n );\n\nexport const scalarsIn = (node: YamlNode): readonly Located[] => {\n if (node.kind === \"scalar\") {\n return [{ text: node.value, line: node.line, column: node.column }];\n }\n return pipe(\n node.children,\n Arr.flatMap((child) => scalarsIn(child)),\n );\n};\n\nconst ownValuesNamed = (name: string, node: YamlNode): readonly YamlNode[] => {\n if (node.kind !== \"mapping\") {\n return [];\n }\n return pipe(\n pairsOf(node),\n Arr.filter((pair) => pair.key.value === name),\n Arr.map((pair) => pair.value),\n );\n};\n\nexport const valuesNamed =\n (name: string) =>\n (node: YamlNode): readonly YamlNode[] => [\n ...ownValuesNamed(name, node),\n ...pipe(node.children, Arr.flatMap(valuesNamed(name))),\n ];\n\nexport const descend =\n (...keys: readonly string[]) =>\n (node: Option.Option<YamlNode>): Option.Option<YamlNode> => {\n let found = node;\n for (const key of keys) {\n found = pipe(found, childOf(key));\n }\n return found;\n };\n","import type { YamlNode } from \"@r_masseater/fu4\";\nimport { NOOP, keysOf, runOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nimport { childOf, keyNodeOf, rootOf } from \"./yaml.ts\";\n\nconst PUBLISH = /\\bmsch\\s+publish\\s+(?:plan|npm|release)\\b/u;\nconst MANUAL = \"workflow_dispatch\";\nconst TRIGGER_KEY = \"on\";\nconst MESSAGE =\n \"publishes with `msch publish plan`, `npm` or `release` from a trigger other than `workflow_dispatch`. Keep those steps in a workflow that only `workflow_dispatch` starts, and start it on a push to main with `msch publish dispatch`.\";\n\nconst triggersOf = (node: YamlNode): readonly string[] => {\n if (node.kind === \"scalar\") {\n return [node.value];\n }\n if (node.kind === \"sequence\") {\n return pipe(\n node.children,\n Arr.map(({ value }) => value),\n );\n }\n return keysOf(node);\n};\n\n/** @internal */\nexport const publishTrigger = workflowRule({\n description:\n \"Reports msch publish steps in a workflow that something other than workflow_dispatch starts\",\n visitor: (fail, context): Visitor => {\n const publishing: string[] = [];\n return {\n ...NOOP,\n step: (step): void => {\n const publishes = pipe(\n runOf(step),\n Option.flatMap(({ run }) => Option.fromNullishOr(run)),\n Option.exists(({ value }) => PUBLISH.test(value)),\n );\n if (publishes) {\n publishing.push(MANUAL);\n }\n },\n workflowPost: (): void => {\n const root = rootOf(context);\n const triggers = pipe(\n childOf(TRIGGER_KEY)(root),\n Option.map(triggersOf),\n Option.getOrElse((): readonly string[] => []),\n );\n const manualOnly = pipe(\n triggers,\n Arr.every((trigger) => trigger === MANUAL),\n );\n if (Arr.isReadonlyArrayNonEmpty(publishing) && !manualOnly) {\n for (const key of pipe(root, keyNodeOf(TRIGGER_KEY), Option.toArray)) {\n fail(key, MESSAGE);\n }\n }\n },\n };\n },\n});\n","import { NOOP, actionOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Option, pipe } from \"effect\";\n\nconst RELEASE_PLEASE = /^googleapis\\/release-please-action(?:@|$)/u;\nconst MESSAGE =\n \"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.\";\n\n/** @internal */\nexport const releasePlease = workflowRule({\n description: \"Reports the release-please action, because releases here are manual\",\n visitor: (fail): Visitor => ({\n ...NOOP,\n step: (step): void => {\n const uses = pipe(\n actionOf(step),\n Option.flatMap(({ uses: text }) => Option.fromNullishOr(text)),\n Option.filter(({ value }) => RELEASE_PLEASE.test(value)),\n Option.toArray,\n );\n for (const found of uses) {\n fail(found, MESSAGE);\n }\n },\n }),\n});\n","import { NOOP, actionOf, runOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Option, pipe } from \"effect\";\n\nconst GIT_WRITE = /\\bgit\\s+(?:-{1,2}\\S+\\s+(?:\\S+\\s+)?)*(?:commit|push)\\b/u;\nconst COMMIT_ACTION = /^[^@/]+\\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;\nconst MESSAGE =\n \"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.\";\n\n/** @internal */\nexport const workflowCommit = workflowRule({\n description: \"Reports git commit, git push and commit actions in a workflow\",\n visitor: (fail): Visitor => ({\n ...NOOP,\n step: (step): void => {\n const writes = pipe(\n runOf(step),\n Option.flatMap((exec) =>\n Option.zipRight(\n Option.filter(Option.fromNullishOr(exec.run), ({ value }) => GIT_WRITE.test(value)),\n Option.orElse(Option.fromNullishOr(exec.runPosition), () =>\n Option.fromNullishOr(exec.run),\n ),\n ),\n ),\n );\n const commits = pipe(\n actionOf(step),\n Option.flatMap(({ uses }) => Option.fromNullishOr(uses)),\n Option.filter(({ value }) => COMMIT_ACTION.test(value)),\n );\n for (const found of Option.toArray(Option.orElse(writes, () => commits))) {\n fail(found, MESSAGE);\n }\n },\n }),\n});\n","import { Effect, Layer, ManagedRuntime } from \"effect\";\n\nimport type { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\nimport { nodeRepositoryFiles, nodeServicesLayer } from \"#/shared/lib/repository-files.ts\";\n\nconst runtime = ManagedRuntime.make(Layer.provide(nodeRepositoryFiles, nodeServicesLayer));\n\n/** @internal */\nexport const inRepository = <Found>(\n effect: Effect.Effect<Found, never, RepositoryFiles>,\n): Effect.Effect<Found> => Effect.promise(() => runtime.runPromise(effect));\n","import type { YamlNode } from \"@r_masseater/fu4\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nimport { childOf, descend, entriesOf, itemsOf, scalarsIn, stringOf } from \"./yaml.ts\";\nimport type { Located } from \"./yaml.ts\";\n\nconst ROOT = \".\";\nconst LOCAL = \"./\";\nconst NEGATION = \"!\";\nconst SEPARATOR = \"/\";\nconst LINE = \"\\n\";\nconst UNRESOLVED_MARKERS = [\"${{\", \"$\", \"{\"];\nconst ABSOLUTE_MARKERS = [\"/\", \"~\"];\nconst FILE_INPUT_SUFFIX = \"-file\";\nconst DEPENDENCY_PATH_INPUT = \"cache-dependency-path\";\nconst FILTER_KEYS = [\"paths\", \"paths-ignore\"];\nconst HASH_FILES = /hashFiles\\((?<arguments>[^)]*)\\)/gu;\nconst QUOTED = /'(?<path>[^']*)'/gu;\nconst SCRIPT = /^[\\w.@/-]+\\.(?:ts|mts|cts|sh)$/u;\nconst TOKEN_SEPARATOR = /[\\s;&|()<>\"'`=]+/u;\n\nexport const ACTION_DEFINITIONS: readonly string[] = [\"action.yml\", \"action.yaml\"];\n\nexport type ReferenceKind = \"glob\" | \"file\" | \"script\" | \"directory\" | \"action\";\n\nexport interface WorkflowReference extends Located {\n readonly kind: ReferenceKind;\n readonly field: string;\n readonly path: string;\n}\n\ntype Entry = readonly [string, YamlNode];\n\nconst containsAny =\n (markers: readonly string[]) =>\n (path: string): boolean =>\n pipe(\n markers,\n Arr.some((marker) => Str.includes(marker)(path)),\n );\n\nconst startsWithAny =\n (markers: readonly string[]) =>\n (path: string): boolean =>\n pipe(\n markers,\n Arr.some((marker) => Str.startsWith(marker)(path)),\n );\n\nconst isLiteralPath = (path: string): boolean =>\n Str.isNonEmpty(path) &&\n !containsAny(UNRESOLVED_MARKERS)(path) &&\n !startsWithAny(ABSOLUTE_MARKERS)(path);\n\nconst withoutLocal = (path: string): string => {\n if (Str.startsWith(LOCAL)(path)) {\n return Str.slice(LOCAL.length)(path);\n }\n return path;\n};\n\nconst joinPath = (base: string, path: string): string => {\n const relative = withoutLocal(Str.trim(path));\n if (base === ROOT) {\n return relative;\n }\n return `${base}${SEPARATOR}${relative}`;\n};\n\nconst reference =\n (kind: ReferenceKind, field: string, base = ROOT) =>\n ({ text, line, column }: Located): readonly WorkflowReference[] => {\n const path = Str.trim(text);\n if (!isLiteralPath(path) || !isLiteralPath(base)) {\n return [];\n }\n return [{ kind, field, path: joinPath(base, path), text, line, column }];\n };\n\nconst isPositive = ({ text }: Located): boolean => !Str.startsWith(NEGATION)(Str.trim(text));\n\nconst globsIn = (field: string, node: Option.Option<YamlNode>): readonly WorkflowReference[] =>\n pipe(\n itemsOf(node),\n Arr.flatMap((item) => pipe(item, Option.some, stringOf, Option.toArray)),\n Arr.filter(isPositive),\n Arr.flatMap(reference(\"glob\", field)),\n );\n\nconst filtersOf = ([event, filters]: Entry): readonly WorkflowReference[] =>\n pipe(\n FILTER_KEYS,\n Arr.flatMap((key) => globsIn(`on.${event}.${key}`, pipe(filters, Option.some, childOf(key)))),\n );\n\nconst workingDirectoryOf = (owner: Option.Option<YamlNode>): Option.Option<Located> =>\n pipe(owner, descend(\"defaults\", \"run\", \"working-directory\"), stringOf);\n\nconst directoryOf = (found: Option.Option<Located>, base: string): string =>\n pipe(\n found,\n Option.map(({ text }) => joinPath(ROOT, text)),\n Option.getOrElse(() => base),\n );\n\nconst located =\n (kind: ReferenceKind, field: string, base = ROOT) =>\n (found: Option.Option<Located>): readonly WorkflowReference[] =>\n pipe(found, Option.toArray, Arr.flatMap(reference(kind, field, base)));\n\nconst localUses = (node: Option.Option<YamlNode>): Option.Option<Located> =>\n pipe(\n node,\n childOf(\"uses\"),\n stringOf,\n Option.filter(({ text }) => Str.startsWith(LOCAL)(text)),\n );\n\nconst scriptsIn =\n (field: string, base: string) =>\n ({ text, line, column }: Located): readonly WorkflowReference[] =>\n pipe(\n Str.split(text, TOKEN_SEPARATOR),\n Arr.filter((token) => SCRIPT.test(token)),\n Arr.dedupe,\n Arr.flatMap((token) => pipe({ text: token, line, column }, reference(\"script\", field, base))),\n );\n\nconst isFileInput = ([key]: Entry): boolean =>\n Str.endsWith(FILE_INPUT_SUFFIX)(key) || key === DEPENDENCY_PATH_INPUT;\n\nconst linesOf = ({ text, line, column }: Located): readonly Located[] =>\n pipe(\n Str.split(text, LINE),\n Arr.map((each) => ({ text: each, line, column })),\n );\n\nconst fileInputOf =\n (field: string) =>\n ([key, value]: Entry): readonly WorkflowReference[] =>\n pipe(\n value,\n Option.some,\n stringOf,\n Option.toArray,\n Arr.flatMap(linesOf),\n Arr.flatMap(reference(\"glob\", `${field}.with.${key}`)),\n );\n\nconst fileInputsIn = (field: string, step: YamlNode): readonly WorkflowReference[] =>\n pipe(\n step,\n Option.some,\n childOf(\"with\"),\n entriesOf,\n Arr.filter(isFileInput),\n Arr.flatMap(fileInputOf(field)),\n );\n\nconst scriptReferencesOf = (\n field: string,\n directory: string,\n step: YamlNode,\n): readonly WorkflowReference[] =>\n pipe(\n step,\n Option.some,\n childOf(\"run\"),\n stringOf,\n Option.toArray,\n Arr.flatMap(scriptsIn(`${field}.run`, directory)),\n );\n\nconst stepReferences =\n (job: string, base: string) =>\n (step: YamlNode, index: number): readonly WorkflowReference[] => {\n const field = `jobs.${job}.steps[${index}]`;\n const own = pipe(step, Option.some, childOf(\"working-directory\"), stringOf);\n const directory = directoryOf(own, base);\n return [\n ...pipe(step, Option.some, localUses, located(\"action\", `${field}.uses`)),\n ...pipe(own, located(\"directory\", `${field}.working-directory`)),\n ...scriptReferencesOf(field, directory, step),\n ...fileInputsIn(field, step),\n ];\n };\n\nconst jobReferences =\n (base: string) =>\n ([job, node]: Entry): readonly WorkflowReference[] => {\n const own = pipe(node, Option.some, workingDirectoryOf);\n const steps = pipe(node, Option.some, childOf(\"steps\"), itemsOf);\n const directory = directoryOf(own, base);\n return [\n ...pipe(node, Option.some, localUses, located(\"file\", `jobs.${job}.uses`)),\n ...pipe(own, located(\"directory\", `jobs.${job}.defaults.run.working-directory`)),\n ...pipe(steps, Arr.flatMap(stepReferences(job, directory))),\n ];\n };\n\nconst groupsOf =\n (pattern: RegExp, group: string) =>\n ({ text, line, column }: Located): readonly Located[] =>\n pipe(\n Arr.fromIterable(Str.matchAll(pattern)(text)),\n Arr.flatMap((match) =>\n pipe(\n Option.fromNullishOr(match.groups),\n Option.flatMap((groups) => Option.fromNullishOr(groups[group])),\n Option.toArray,\n ),\n ),\n Arr.map((value) => ({ text: value, line, column })),\n );\n\nconst hashFilesIn = (root: YamlNode): readonly WorkflowReference[] =>\n pipe(\n scalarsIn(root),\n Arr.flatMap(groupsOf(HASH_FILES, \"arguments\")),\n Arr.flatMap(groupsOf(QUOTED, \"path\")),\n Arr.filter(isPositive),\n Arr.flatMap(reference(\"glob\", \"hashFiles\")),\n );\n\nconst jobsOf = (root: YamlNode): readonly Entry[] =>\n pipe(root, Option.some, childOf(\"jobs\"), entriesOf);\n\n/** @internal */\nexport const workflowReferences = (root: YamlNode): readonly WorkflowReference[] => {\n const workflowDefault = pipe(root, Option.some, workingDirectoryOf);\n const base = directoryOf(workflowDefault, ROOT);\n return [\n ...pipe(root, Option.some, childOf(\"on\"), entriesOf, Arr.flatMap(filtersOf)),\n ...pipe(workflowDefault, located(\"directory\", \"defaults.run.working-directory\")),\n ...pipe(jobsOf(root), Arr.flatMap(jobReferences(base))),\n ...hashFilesIn(root),\n ];\n};\n\nconst outputPathsOf = (step: YamlNode): readonly string[] =>\n pipe(\n step,\n Option.some,\n descend(\"with\", \"path\"),\n stringOf,\n Option.toArray,\n Arr.flatMap(linesOf),\n Arr.map(({ text }) => joinPath(ROOT, text)),\n Arr.filter(isLiteralPath),\n );\n\n/** @internal */\nexport const producedPaths = (root: YamlNode): readonly string[] =>\n pipe(\n jobsOf(root),\n Arr.flatMap(([, job]) => pipe(job, Option.some, childOf(\"steps\"), itemsOf)),\n Arr.flatMap(outputPathsOf),\n );\n","import { groupOf } from \"@masseater.dev/lint-host/collections\";\nimport { defineRule } from \"@r_masseater/fu4\";\nimport type { Report, YamlNode } from \"@r_masseater/fu4\";\nimport { pairsOf } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { namedWorkspaces, patternOf } from \"#/entities/workspace/index.ts\";\nimport type { NamedWorkspace } from \"#/entities/workspace/index.ts\";\n\nimport { inRepository } from \"./repository-services.ts\";\nimport { workflowReferences } from \"./workflow-references.ts\";\nimport { childOf, scalarsIn, stringOf } from \"./yaml.ts\";\nimport type { Located } from \"./yaml.ts\";\n\nconst WORKFLOW = /(?:^|\\/)\\.github\\/workflows\\/(?<name>[^/]+)\\.ya?ml$/u;\nconst ACTION = /(?:^|\\/)\\.github\\/actions\\/(?<name>[^/]+)\\/action\\.ya?ml$/u;\nconst PACKAGE_FILTER =\n /(?:^|\\s)(?:--filter|-F)(?:\\s+|=)(?<quote>[\"']?)(?<value>[^\\s\"'$][^\\s\"']*)\\k<quote>/gu;\nconst SEPARATOR = \"/\";\nconst WORD_SEPARATORS = /[-_]/gu;\nconst SPACE = \" \";\nconst FIRST_LINE: Located = { text: \"\", line: 1, column: 1 };\n\nconst packageMessage = (what: string, directory: string): string =>\n `${what} names the workspace ${directory}. A workflow or job made for one package does not scale: give the package a vp task and let the generic pipeline (verify, deploy, release, daily, task) find it.`;\n\nconst matching = (workspaces: readonly NamedWorkspace[], text: string): Option.Option<string> =>\n pipe(\n workspaces,\n Arr.findFirst(\n ({ names }) =>\n Arr.isReadonlyArrayNonEmpty(names) && Option.isSome(Str.match(patternOf(names))(text)),\n ),\n Option.map(({ directory }) => directory),\n );\n\nconst named = (workspaces: readonly NamedWorkspace[], text: string): Option.Option<string> =>\n Option.orElse(matching(workspaces, text), () =>\n matching(workspaces, Str.replaceAll(WORD_SEPARATORS, SPACE)(text)),\n );\n\nconst containing = (workspaces: readonly NamedWorkspace[], path: string): Option.Option<string> =>\n pipe(\n workspaces,\n Arr.findFirst(\n ({ directory }) => path === directory || Str.startsWith(`${directory}${SEPARATOR}`)(path),\n ),\n Option.map(({ directory }) => directory),\n );\n\nconst filtersIn = (scalars: readonly Located[]): readonly Located[] =>\n pipe(\n scalars,\n Arr.flatMap(({ text, line, column }) =>\n pipe(\n Arr.fromIterable(Str.matchAll(PACKAGE_FILTER)(text)),\n Arr.flatMap((match) =>\n pipe(\n Option.fromNullishOr(match.groups),\n Option.flatMap((groups) => Option.fromNullishOr(groups[\"value\"])),\n Option.toArray,\n ),\n ),\n Arr.map((value) => ({ text: value, line, column })),\n ),\n ),\n );\n\nconst findingFor = (\n what: string,\n found: Located,\n directory: Option.Option<string>,\n): readonly Finding[] =>\n pipe(\n directory,\n Option.map((workspace): Finding => ({\n line: found.line,\n column: found.column,\n message: packageMessage(what, workspace),\n })),\n Option.toArray,\n );\n\ntype Finding = Pick<Report, \"line\" | \"column\" | \"message\">;\n\nconst namesIn = (stem: string, root: Option.Option<YamlNode>): readonly Located[] => [\n { ...FIRST_LINE, text: stem },\n ...pipe(root, childOf(\"name\"), stringOf, Option.toArray),\n ...pipe(\n root,\n childOf(\"jobs\"),\n Option.map((jobs) =>\n pipe(\n pairsOf(jobs),\n Arr.map(({ key }): Located => ({ text: key.value, line: key.line, column: key.column })),\n ),\n ),\n Option.getOrElse((): readonly Located[] => []),\n ),\n];\n\nconst workflowFindings = (\n workspaces: readonly NamedWorkspace[],\n stem: string,\n root: YamlNode,\n): readonly Finding[] => {\n const fromNames = pipe(\n namesIn(stem, Option.some(root)),\n Arr.flatMap((found) => findingFor(`\"${found.text}\"`, found, named(workspaces, found.text))),\n );\n const referenced = pipe(\n workflowReferences(root),\n Arr.filter(({ field }) => !Str.startsWith(\"on.\")(field)),\n Arr.flatMap((found) => findingFor(found.field, found, containing(workspaces, found.path))),\n );\n const filtered = pipe(\n filtersIn(scalarsIn(root)),\n Arr.flatMap((found) =>\n findingFor(`--filter ${found.text}`, found, matching(workspaces, found.text)),\n ),\n );\n return [...fromNames, ...referenced, ...filtered];\n};\n\nexport const workflowPackage = defineRule({\n meta: {\n description: \"Reports workflows, jobs, actions and paths that are made for one workspace\",\n kinds: [\"workflow\", \"action\"],\n },\n check: ({ filename, project, source, report }) =>\n Effect.gen(function* checkPackages() {\n const workspaces = yield* namedWorkspaces(project.root);\n const asWorkflow = groupOf(\"name\")(WORKFLOW.exec(filename));\n const asAction = groupOf(\"name\")(ACTION.exec(filename));\n const found: readonly Finding[] = [\n ...pipe(\n asAction,\n Option.flatMap((name) => named(workspaces, name)),\n Option.map((directory): Finding => ({\n ...FIRST_LINE,\n message: packageMessage(\n `The action ${Option.getOrElse(asAction, () => \"\")}`,\n directory,\n ),\n })),\n Option.toArray,\n ),\n ...pipe(\n Option.all([asWorkflow, Option.fromNullishOr(source.yaml)]),\n Option.map(([stem, root]) => workflowFindings(workspaces, stem, root)),\n Option.getOrElse((): readonly Finding[] => []),\n ),\n ];\n for (const each of found) {\n report(each);\n }\n }).pipe(inRepository),\n});\n","import { defineRule } from \"@r_masseater/fu4\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nimport { childOf, entriesOf, keyNodeOf, rootOf, scalarsIn } from \"./yaml.ts\";\n\nconst FILTER_KEYS: readonly string[] = [\"paths\", \"paths-ignore\"];\nconst PATHS_FILTER_ACTION = /(?:^|\\/)paths-filter@/u;\nconst MESSAGE =\n \"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.\";\n\n/** @internal */\nexport const workflowPathFilter = defineRule({\n meta: {\n description: \"Reports paths and paths-ignore triggers and the paths-filter action\",\n kinds: [\"workflow\"],\n },\n check: (context): void => {\n const root = rootOf(context);\n const triggers = pipe(\n root,\n childOf(\"on\"),\n entriesOf,\n Arr.flatMap(([, trigger]) =>\n pipe(\n FILTER_KEYS,\n Arr.flatMap((key) => pipe(Option.some(trigger), keyNodeOf(key), Option.toArray)),\n ),\n ),\n );\n const actions = pipe(\n Option.toArray(root),\n Arr.flatMap((node) => scalarsIn(node)),\n Arr.filter(({ text }) => PATHS_FILTER_ACTION.test(text)),\n );\n for (const found of [...triggers, ...actions]) {\n context.report({ line: found.line, column: found.column, message: MESSAGE });\n }\n },\n});\n","import { defineRule } from \"@r_masseater/fu4\";\nimport { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { existsAt, isDirectoryAt, isIgnored, staticPrefix } from \"#/shared/lib/path-existence.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { inRepository } from \"./repository-services.ts\";\nimport { ACTION_DEFINITIONS, producedPaths, workflowReferences } from \"./workflow-references.ts\";\nimport type { ReferenceKind, WorkflowReference } from \"./workflow-references.ts\";\n\nconst SEPARATOR = \"/\";\n\nconst EXPECTED: Readonly<Record<ReferenceKind, string>> = {\n action: \"a directory with action.yml\",\n directory: \"a directory\",\n file: \"a file\",\n glob: \"a pattern that matches a tracked file\",\n script: \"a file\",\n};\n\ntype Resolver = (root: string, path: string) => Effect.Effect<boolean, never, RepositoryFiles>;\n\nconst matchesAny = Effect.fn(\"matchesAny\")(function* matchesAny(\n root: string,\n pathspecs: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const matched = yield* files.matchingFiles(root, pathspecs);\n return Arr.isReadonlyArrayNonEmpty(matched);\n});\n\nconst matchesGlob: Resolver = (root, path) => matchesAny(root, [`:(glob)${path}`]);\n\nconst hasAction: Resolver = Effect.fn(\"hasAction\")(function* hasAction(root: string, path: string) {\n const found = yield* Effect.forEach(\n ACTION_DEFINITIONS,\n (name) => existsAt(root, `${path}${SEPARATOR}${name}`),\n { concurrency: 1 },\n );\n return pipe(found, Arr.some(Boolean));\n});\n\nconst suffixAt =\n (segments: readonly string[]) =>\n (index: number): string =>\n `:(glob)**/${pipe(segments, Arr.drop(index), Arr.join(SEPARATOR))}`;\n\nconst findsScript: Resolver = Effect.fn(\"findsScript\")(function* findsScript(\n root: string,\n path: string,\n) {\n if (yield* existsAt(root, path)) {\n return true;\n }\n const segments = Str.split(path, SEPARATOR);\n return yield* matchesAny(root, Arr.makeBy(segments.length, suffixAt(segments)));\n});\n\nconst RESOLVERS: Readonly<Record<ReferenceKind, Resolver>> = {\n action: hasAction,\n directory: isDirectoryAt,\n file: existsAt,\n glob: matchesGlob,\n script: findsScript,\n};\n\nconst overlaps =\n (path: string) =>\n (produced: string): boolean =>\n produced === path ||\n Str.startsWith(`${path}${SEPARATOR}`)(produced) ||\n Str.startsWith(`${produced}${SEPARATOR}`)(path);\n\nconst isMissing = Effect.fn(\"isMissing\")(function* isMissing(\n root: string,\n produced: readonly string[],\n found: WorkflowReference,\n) {\n const prefix = staticPrefix(found.path);\n if (pipe(produced, Arr.some(overlaps(prefix)))) {\n return false;\n }\n if (yield* RESOLVERS[found.kind](root, found.path)) {\n return false;\n }\n return !(yield* isIgnored(root, found.path));\n});\n\nexport const workflowPath = defineRule({\n meta: {\n description: \"Reports a path that a workflow names and the repository does not have\",\n kinds: [\"workflow\"],\n },\n check: ({ project, source, report }) =>\n Effect.gen(function* checkPaths() {\n for (const yaml of Option.toArray(Option.fromNullishOr(source.yaml))) {\n const produced = producedPaths(yaml);\n const missing = yield* Effect.filter(workflowReferences(yaml), (found) =>\n isMissing(project.root, produced, found),\n );\n for (const found of missing) {\n report({\n line: found.line,\n column: found.column,\n 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.`,\n });\n }\n }\n }).pipe(inRepository),\n});\n","import { defineRule } from \"@r_masseater/fu4\";\nimport { keysOf } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nimport { keyNodeOf, rootOf, valuesNamed } from \"./yaml.ts\";\n\nconst CONCURRENCY_KEY = \"concurrency\";\nconst QUEUE_KEY = \"queue\";\nconst MESSAGE =\n \"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.\";\n\n/** @internal */\nexport const workflowQueue = defineRule({\n meta: {\n description:\n \"Reports queue on a concurrency group, because a queued group holds back the newest commit\",\n kinds: [\"workflow\"],\n },\n check: (context): void => {\n const keys = pipe(\n rootOf(context),\n Option.toArray,\n Arr.flatMap((root) => valuesNamed(CONCURRENCY_KEY)(root)),\n Arr.filter((group) => Arr.contains(keysOf(group), QUEUE_KEY)),\n Arr.flatMap((group) => pipe(Option.some(group), keyNodeOf(QUEUE_KEY), Option.toArray)),\n );\n for (const key of keys) {\n context.report({ line: key.line, column: key.column, message: MESSAGE });\n }\n },\n});\n","import { NOOP, runOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nconst COMMAND_CHAIN = /&&|\\|\\||;|\\|/u;\nconst QUOTED = /\\$\\{\\{.*?\\}\\}|\"(?:[^\"\\\\]|\\\\.)*\"|'[^']*'/gu;\nconst COMMENT = \"#\";\nconst ONE_COMMAND = 1;\nconst MESSAGE =\n \"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.\";\n\nconst isCommand = (line: string): boolean => Str.isNonEmpty(line) && !Str.startsWith(COMMENT)(line);\n\nconst chainsCommands = (line: string): boolean =>\n COMMAND_CHAIN.test(Str.replaceAll(QUOTED, \"\")(line));\n\nconst runsMoreThanOneCommand = (text: string): boolean => {\n const lines = pipe(Str.split(\"\\n\")(text), Arr.map(Str.trim), Arr.filter(isCommand));\n return lines.length > ONE_COMMAND || pipe(lines, Arr.some(chainsCommands));\n};\n\n/** @internal */\nexport const workflowScript = workflowRule({\n description: \"Reports a run step with more than one command, because the logic belongs in a task\",\n visitor: (fail): Visitor => ({\n ...NOOP,\n step: (step): void => {\n const runs = pipe(\n runOf(step),\n Option.flatMap(({ run }) => Option.fromNullishOr(run)),\n Option.filter(({ value }) => runsMoreThanOneCommand(value)),\n Option.toArray,\n );\n for (const found of runs) {\n fail(found, MESSAGE);\n }\n },\n }),\n});\n","import { definePlugin } from \"@r_masseater/fu4\";\nimport type { Fu4Config } from \"@r_masseater/fu4\";\nimport { Array as Arr, Record as Rec, pipe } from \"effect\";\n\nimport { publishTrigger } from \"./publish-trigger.ts\";\nimport { releasePlease } from \"./release-please.ts\";\nimport { workflowCommit } from \"./workflow-commit.ts\";\nimport { workflowPackage } from \"./workflow-package.ts\";\nimport { workflowPathFilter } from \"./workflow-path-filter.ts\";\nimport { workflowPath } from \"./workflow-path.ts\";\nimport { workflowQueue } from \"./workflow-queue.ts\";\nimport { workflowScript } from \"./workflow-script.ts\";\n\nconst NAME = \"msch\";\n\nconst plugin = definePlugin({\n rules: {\n \"publish-trigger\": publishTrigger,\n \"release-please\": releasePlease,\n \"workflow-commit\": workflowCommit,\n \"workflow-package\": workflowPackage,\n \"workflow-path\": workflowPath,\n \"workflow-path-filter\": workflowPathFilter,\n \"workflow-queue\": workflowQueue,\n \"workflow-script\": workflowScript,\n },\n});\n\n/** @internal */\nexport const workflowPolicy = (): Fu4Config => ({\n plugins: Rec.singleton(NAME, plugin),\n rules: pipe(\n Rec.keys(plugin.rules),\n Arr.map((rule): readonly [string, \"error\"] => [`${NAME}/${rule}`, \"error\"]),\n Rec.fromEntries,\n ),\n});\n","import type { Fu4Config } from \"@r_masseater/fu4\";\nimport { recommended } from \"@r_masseater/fu4/presets\";\n\nimport { workflowPolicy } from \"./policy.ts\";\n\n/** @internal */\nexport const fu4Of = (): Fu4Config => ({ extends: [recommended(), workflowPolicy()] });\n","import { RUNTIME_SECTIONS } from \"@r_masseater/masseater-utils/kestrion\";\nimport type { DependencySection } from \"@r_masseater/masseater-utils/kestrion\";\nimport { Record as Rec, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport type { WorkspaceSettings } from \"#/features/build-workspace-settings/index.ts\";\nimport { requiredStack } from \"#/features/define-lint-preset/index.ts\";\n\nexport type DependencyRules = NonNullable<UserConfig[\"dependencyRules\"]>;\ntype Allowed = NonNullable<DependencyRules[\"allowed\"]>;\n\nconst allowedIn = (\n allowances: WorkspaceSettings[\"devDependencies\"],\n fields: readonly DependencySection[],\n): Allowed =>\n pipe(\n allowances,\n Rec.map(({ workspaces, dependencies }) => ({ workspaces, dependencies, fields: [...fields] })),\n );\n\nexport const PLUGIN_DEPENDENCIES =\n \"Claude Code installs a plugin's dependencies from its own package.json and lockfile, where only exact registry versions install\";\n\nexport const dependencyRulesOf = (workspace: WorkspaceSettings): DependencyRules => ({\n allowed: {\n ...allowedIn(workspace.devDependencies, [\"devDependencies\"]),\n ...allowedIn(workspace.dependencies, RUNTIME_SECTIONS),\n },\n banned: requiredStack,\n exactDependencies: { [PLUGIN_DEPENDENCIES]: workspace.plugins },\n peerRanges: \"intersect\",\n});\n","import { fileURLToPath } from \"node:url\";\n\nimport { Array as Arr, Option, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport type { WorkspaceSettings } from \"#/features/build-workspace-settings/index.ts\";\nimport type { MarkdownOptions } from \"#/features/define-lint-preset/index.ts\";\nimport {\n decisionTestRules,\n exempt,\n lint as preset,\n markdownOf,\n structureOf,\n} from \"#/features/define-lint-preset/index.ts\";\nimport { fu4Of } from \"#/features/guard-workflows/index.ts\";\nimport type { AddedRulesValue } from \"#/shared/lib/added-rules.ts\";\n\nimport { dependencyRulesOf } from \"./repository-dependencies.ts\";\nimport { tasksOf } from \"./repository-tasks.ts\";\nimport type { CargoInputs, UsageOptions } from \"./repository-tasks.ts\";\nimport { secretsOf, textlintOf } from \"./repository-text.ts\";\nimport type { TextOptions } from \"./repository-text.ts\";\n\nexport { PLUGIN_DEPENDENCIES } from \"./repository-dependencies.ts\";\nexport { secretsOf } from \"./repository-text.ts\";\n\nexport interface AddedOverride {\n readonly files: readonly string[];\n readonly excludeFiles?: readonly string[];\n readonly rules: AddedRulesValue;\n}\n\nexport interface RepositoryOptions {\n readonly workspace: WorkspaceSettings;\n readonly overrides?: readonly AddedOverride[];\n readonly textlint?: TextOptions;\n readonly markdown?: Omit<MarkdownOptions, \"indexSkill\">;\n readonly run?: {\n readonly tasks?: Readonly<Record<string, string>>;\n readonly remoteCache?: string;\n };\n readonly usage?: UsageOptions;\n readonly cargo?: { readonly inputs: CargoInputs };\n}\n\ntype OxlintOverride = NonNullable<NonNullable<UserConfig[\"lint\"]>[\"overrides\"]>[number];\n\ninterface SharedCache {\n readonly scripts: true;\n readonly tasks: true;\n readonly remote: { readonly url: string };\n}\n\nconst cacheOf = (remoteCache: string | undefined): SharedCache | true =>\n pipe(\n Option.fromNullishOr(remoteCache),\n Option.match({\n onNone: (): SharedCache | true => true,\n onSome: (url) => ({ scripts: true, tasks: true, remote: { url } }),\n }),\n );\n\nconst COMMIT_CONVENTION = fileURLToPath(import.meta.resolve(\"@commitlint/config-conventional\"));\n\nconst added = ({ files, excludeFiles, rules }: AddedOverride): OxlintOverride =>\n pipe(\n Option.fromUndefinedOr(excludeFiles),\n Option.match({\n onNone: (): OxlintOverride => ({ files: [...files], rules: { ...rules } }),\n onSome: (excluded): OxlintOverride => ({\n files: [...files],\n excludeFiles: [...excluded],\n rules: { ...rules },\n }),\n }),\n );\n\nconst lintOf = ({\n workspace,\n overrides = [],\n}: RepositoryOptions): NonNullable<UserConfig[\"lint\"]> => ({\n ...preset,\n ignorePatterns: exempt,\n overrides: [\n ...preset.overrides,\n {\n files: [...workspace.lint.shadcnUi],\n rules: { \"react/jsx-props-no-spreading\": \"off\" },\n },\n {\n files: [\n ...workspace.lint.publicEntries,\n ...workspace.lint.deployEntries,\n ...workspace.lint.siteEntries,\n ],\n rules: { \"import/no-default-export\": \"off\" },\n },\n ...pipe(overrides, Arr.map(added)),\n ...workspace.lint.overrides,\n { files: [\"**/*.test.ts\"], rules: decisionTestRules },\n ],\n});\n\nexport const repositoryConfig = (options: RepositoryOptions): UserConfig => {\n const { workspace, textlint = {}, markdown = {}, run = {}, usage, cargo } = options;\n return {\n commitlint: { extends: [COMMIT_CONVENTION] },\n dependencyRules: dependencyRulesOf(workspace),\n h56m: secretsOf(),\n wism: structureOf({\n members: workspace.members,\n ignorePatterns: exempt,\n }),\n textlint: textlintOf({ ...textlint, articles: workspace.articles }),\n y8: markdownOf({ ...markdown, indexSkill: workspace.indexSkill }),\n fu4: fu4Of(),\n test: { projects: [...workspace.testProjects], passWithNoTests: true },\n staged: { \"*\": \"vp fmt --no-error-on-unmatched-pattern\" },\n fmt: {\n ignorePatterns: exempt,\n sortImports: true,\n sortTailwindcss: true,\n sortPackageJson: true,\n },\n lint: lintOf(options),\n run: {\n cache: cacheOf(run.remoteCache),\n tasks: tasksOf({\n workspace,\n commands: run.tasks ?? {},\n usage: Option.fromUndefinedOr(usage),\n cargo: Option.map(Option.fromUndefinedOr(cargo), ({ inputs }) => inputs),\n }),\n },\n };\n};\n"],"mappings":";;;;;;;;;;AAUA,MAAa,UAAU,EAAE,aACvB,OAAO,cAAc,OAAO,IAAI;AAElC,MAAa,YAAY,SACvB,KACE,MACA,OAAO,QAAQ,EAAE,WAAW,SAAS,QAAQ,GAC7C,OAAO,KAAK,EAAE,OAAO,MAAM,cAAc;CAAE,MAAM;CAAO;CAAM;AAAO,EAAE,CACzE;AAEF,MAAa,WACV,SACA,SACC,KAAK,MAAM,OAAO,QAAQ,QAAQ,GAAG,CAAC,CAAC;AAE3C,MAAa,aACV,SACA,SACC,KACE,MACA,OAAO,SAAS,YACd,KACE,QAAQ,OAAO,GACfA,MAAI,WAAW,SAAS,KAAK,IAAI,UAAU,GAAG,GAC9C,OAAO,KAAK,SAAS,KAAK,GAAG,CAC/B,CACF,CACF;AAEJ,MAAa,WAAW,SACtB,KACE,MACA,OAAO,QAAQ,EAAE,WAAW,SAAS,UAAU,GAC/C,OAAO,KAAK,EAAE,eAAe,QAAQ,GACrC,OAAO,gBAAqC,CAAC,CAAC,CAChD;AAEF,MAAa,aACX,SAEA,KACE,MACA,OAAO,IAAI,OAAO,GAClB,OAAO,gBAAgB,CAAC,CAAC,GACzBA,MAAI,KAAK,SAAS,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,CAAU,CACzD;AAEF,MAAa,aAAa,SAAuC;CAC/D,IAAI,KAAK,SAAS,UAChB,OAAO,CAAC;EAAE,MAAM,KAAK;EAAO,MAAM,KAAK;EAAM,QAAQ,KAAK;CAAO,CAAC;CAEpE,OAAO,KACL,KAAK,UACLA,MAAI,SAAS,UAAU,U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B,CAAC;EACD,UAAU,WAAW;GAAE,GAAG;GAAU,UAAU,UAAU;EAAS,CAAC;EAClE,IAAI,WAAW;GAAE,GAAG;GAAU,YAAY,UAAU;EAAW,CAAC;EAChE,KAAK,MAAM;EACX,MAAM;GAAE,UAAU,CAAC,GAAG,UAAU,YAAY;GAAG,iBAAiB;EAAK;EACrE,QAAQ,EAAE,KAAK,yCAAyC;EACxD,KAAK;GACH,gBAAgB;GAChB,aAAa;GACb,iBAAiB;GACjB,iBAAiB;EACnB;EACA,MAAM,OAAO,OAAO;EACpB,KAAK;GACH,OAAO,QAAQ,IAAI,WAAW;GAC9B,OAAO,QAAQ;IACb;IACA,UAAU,IAAI,SAAS,CAAC;IACxB,OAAO,OAAO,gBAAgB,KAAK;IACnC,OAAO,OAAO,IAAI,OAAO,gBAAgB,KAAK,IAAI,EAAE,aAAa,MAAM;GACzE,CAAC;EACH;CACF;AACF"}
@@ -33,6 +33,7 @@ interface WorkspaceLint {
33
33
  interface WorkspaceSettings {
34
34
  readonly lint: WorkspaceLint;
35
35
  readonly members: readonly string[];
36
+ readonly plugins: readonly string[];
36
37
  readonly ignoredDirectories: readonly IgnoredDirectory[];
37
38
  readonly testProjects: readonly VitestProject[];
38
39
  readonly tasks: WorkspaceTasks;
@@ -48,4 +49,4 @@ interface SettingsOptions {
48
49
  }
49
50
  declare const workspaceSettings: (options: SettingsOptions) => Promise<WorkspaceSettings>;
50
51
  export { WorkspaceSettings as a, DependencySets as c, WorkspaceTasks as d, WorkspaceLint as i, IgnoredDirectory as l, RuleSets as n, workspaceSettings as o, SettingsOptions as r, DependencyAllowance as s, RuleSet as t, ignoredDirectories as u };
51
- //# sourceMappingURL=index-B0ahB5vD.d.mts.map
52
+ //# sourceMappingURL=index-DIMbx_hx.d.mts.map
@@ -248,7 +248,7 @@ const PUBLIC_LINES = [
248
248
  String.raw`\b\w*DISCORD_\w*ID = "[0-9]{17,20}"`,
249
249
  String.raw`untrusted comment: minisign public key: [0-9A-F]{16}`
250
250
  ];
251
- const EXEMPT_PATHS = [String.raw`(?:^|/)(?:fixtures|upstream)/`];
251
+ const EXEMPT_PATHS = [String.raw`(?:^|/)(?:fixtures|upstream|hooks/vendor)/`];
252
252
  const builtRules = (properNouns, style) => ({
253
253
  "@textlint-ja/preset-ai-writing": true,
254
254
  "@r_masseater/preset-ja": true,
@@ -308,4 +308,4 @@ const secretsOf = () => ({
308
308
  });
309
309
  export { CI_TASKS as a, meteredCommand as c, isDirectoryAt as d, isIgnored as f, patternOf as h, textlintOf as i, tasksOf as l, namedWorkspaces as m, builtTextRuleNames as n, MSCH_TASK_COMMANDS as o, staticPrefix as p, secretsOf as r, MSCH_VERIFY_COMMANDS as s, TEXT_IGNORES as t, existsAt as u };
310
310
 
311
- //# sourceMappingURL=repository-text-BMqkLDDC.mjs.map
311
+ //# sourceMappingURL=repository-text-Dtv6Oz3P.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"repository-text-BMqkLDDC.mjs","names":["Arr","Str","Arr","Str","Arr","Rec","Rec","Arr"],"sources":["../src/entities/workspace/model/workspace-names.ts","../src/shared/lib/path-existence.ts","../src/app/repository-tasks.ts","../src/app/repository-text.ts"],"sourcesContent":["import { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { workspaceProjects } from \"./workspace-projects.ts\";\nimport type { WorkspaceProject } from \"./workspace-projects.ts\";\n\nconst ALTERNATIVE = \"|\";\nconst SCOPE = /^@[^/]+\\//u;\nconst SPECIAL = /[$()*+.?[\\\\\\]^{|}]/gu;\n\nexport interface NamedWorkspace {\n readonly directory: string;\n readonly names: readonly string[];\n readonly packageName: Option.Option<string>;\n}\n\n/** @internal */\nexport const patternOf = (names: readonly string[]): RegExp => {\n const alternatives = pipe(names, Arr.map(Str.replaceAll(SPECIAL, String.raw`\\$&`)));\n return new RegExp(\n `(?<![\\\\p{L}\\\\p{N}_-])(?:${Arr.join(alternatives, ALTERNATIVE)})(?![\\\\p{L}\\\\p{N}_-])`,\n \"gu\",\n );\n};\n\nconst namedIn =\n (basename: (directory: string) => string) =>\n ({ directory, packageName }: WorkspaceProject): NamedWorkspace => {\n const unscoped = pipe(packageName, Option.map(Str.replace(SCOPE, \"\")));\n const names = pipe(\n [Option.some(directory), Option.some(basename(directory)), packageName, unscoped],\n Arr.getSomes,\n Arr.dedupe,\n );\n return { directory, names, packageName };\n };\n\n/** @internal */\nexport const namedWorkspaces = Effect.fn(\"namedWorkspaces\")(function* namedWorkspaces(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const projects = yield* workspaceProjects(root);\n return pipe(projects, Arr.map(namedIn((directory) => files.basename(directory))));\n});\n","import { Array as Arr, Effect, Option, String as Str } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst WILDCARD = /[*?[]/u;\nconst SEPARATOR = \"/\";\nconst FIRST = 0;\n\n/** @internal */\nexport const existsAt = Effect.fn(\"existsAt\")(function* existsAt(root: string, path: string) {\n const files = yield* RepositoryFiles;\n return yield* files.exists(files.join(root, path));\n});\n\n/** @internal */\nexport const isDirectoryAt = Effect.fn(\"isDirectoryAt\")(function* isDirectoryAt(\n root: string,\n path: string,\n) {\n const files = yield* RepositoryFiles;\n const directory = yield* files.isDirectory(files.join(root, path));\n return Option.getOrElse(directory, () => false);\n});\n\n/** @internal */\nexport const staticPrefix = (path: string): string => {\n const prefix = Arr.headNonEmpty(Str.split(path, WILDCARD));\n if (Str.endsWith(SEPARATOR)(prefix)) {\n return Str.slice(FIRST, -SEPARATOR.length)(prefix);\n }\n return prefix;\n};\n\n/** @internal */\nexport const isIgnored = Effect.fn(\"isIgnored\")(function* isIgnored(root: string, path: string) {\n const prefix = staticPrefix(path);\n if (Str.isEmpty(prefix)) {\n return false;\n }\n const files = yield* RepositoryFiles;\n const ignored = yield* files.ignoredPaths(root, [prefix, `${prefix}${SEPARATOR}`]);\n return Arr.isReadonlyArrayNonEmpty(ignored);\n});\n","import { Array as Arr, Option, Record as Rec, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport { TASK_NAMES } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSettings } from \"#/features/build-workspace-settings/index.ts\";\nimport type { CargoInput } from \"#/features/derive-cargo-inputs/index.ts\";\nimport { USAGE_SPOOL } from \"#/shared/config/index.ts\";\n\ntype Tasks = NonNullable<NonNullable<UserConfig[\"run\"]>[\"tasks\"]>;\n\nexport interface UsageOptions {\n readonly endpoint: string;\n readonly apiKeyEnv?: string;\n}\n\nexport interface TaskOptions {\n readonly workspace: WorkspaceSettings;\n readonly commands: Readonly<Record<string, string>>;\n readonly usage: Option.Option<UsageOptions>;\n readonly cargo: Option.Option<CargoInputs>;\n}\n\nexport type CargoInputs = readonly CargoInput[];\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_FILES = [\"package.json\", \"pnpm-workspace.yaml\", \"pnpm-lock.yaml\", \".npmrc\"];\n\nconst AUDIT = Arr.join(\n [\n 'copy=\"$(mktemp -d)\"',\n `trap 'rm -rf \"$copy\"' EXIT`,\n `for file in ${Arr.join(AUDIT_FILES, \" \")}; do if [ -f \"$file\" ]; then cp \"$file\" \"$copy/\"; fi; done`,\n '(cd \"$copy\" && vp pm audit --fix >/dev/null) || exit',\n `added=\"$(diff pnpm-workspace.yaml \"$copy/pnpm-workspace.yaml\" | sed -n 's/^> \\\\(.*\\\\)$/\\\\1 # exit: unused/p')\"`,\n 'if [ -z \"$added\" ]; then exit 0; fi',\n `printf '%s\\\\n' \"vp pm audit --fix found vulnerable versions. First update them within their ranges with vp update -r --no-save <package>... -- --depth Infinity. For each one still reported by vp pm audit, add its line to overrides in pnpm-workspace.yaml and run vp install:\" \"$added\" >&2`,\n \"exit 1\",\n ],\n \"; \",\n);\n\nconst BROKER_TOKEN = `GH_TOKEN=\"\\${GITHUB_APP_TOKEN:-$GH_TOKEN}\"`;\nconst AGENT_STATE = `\"\\${RUNNER_TEMP:-\\${TMPDIR:-/tmp}}/msch-agents\"`;\n\nconst DAILY = `msch exits; ${BROKER_TOKEN} msch upstream; ${BROKER_TOKEN} msch callers; ${BROKER_TOKEN} msch refs; refs=$?; msch agents ${AGENT_STATE} && exit \"$refs\"`;\n\nconst TEST = \"msch changed -- vp test run --passWithNoTests\";\n\nconst CARGO =\n \"cargo fmt --all --check && cargo clippy --workspace --all-targets --locked -- -D warnings\";\n\nconst cargoTasks = (cargo: Option.Option<CargoInputs>): Tasks =>\n Option.match(cargo, {\n onNone: (): Tasks => ({}),\n onSome: (inputs): Tasks => ({\n cargo: {\n command: CARGO,\n cache: { input: [...inputs], output: [], untrackedEnv: UNTRACKED_ENV },\n },\n }),\n });\n\nexport const MSCH_VERIFY_COMMANDS = {\n fallow: FALLOW,\n check: CHECK,\n msch: \"msch\",\n audit: AUDIT,\n published: \"msch published\",\n compat: COMPAT,\n} as const;\n\nexport const MSCH_TASK_COMMANDS = { ...MSCH_VERIFY_COMMANDS, test: TEST } as const;\n\nexport const CI_TASKS = [TASK_NAMES.verify, TASK_NAMES.test] as const;\n\nconst USAGE_TASK = \"usage\";\n\nconst METERED_TASKS = [\"check\", \"msch\"] as const;\n\nexport const meteredCommand = (command: string): string =>\n `USAGE_METER_SPOOL=\"$PWD/${USAGE_SPOOL}\" ${command}`;\n\nconst usageCommandOf = ({ endpoint, apiKeyEnv }: UsageOptions): string =>\n pipe(\n Option.fromUndefinedOr(apiKeyEnv),\n Option.match({\n onNone: () => `msch usage --endpoint ${endpoint}`,\n onSome: (name) => `msch usage --endpoint ${endpoint} --api-key-env ${name}`,\n }),\n );\n\nconst commandOf =\n (usage: Option.Option<UsageOptions>) =>\n (command: string): string =>\n Option.match(usage, { onNone: () => command, onSome: () => meteredCommand(command) });\n\nconst usageTasks = (usage: Option.Option<UsageOptions>): Tasks =>\n Option.match(usage, {\n onNone: (): Tasks => ({}),\n onSome: (options): Tasks => ({\n [USAGE_TASK]: {\n command: usageCommandOf(options),\n dependsOn: [...METERED_TASKS],\n cache: false,\n },\n }),\n });\n\nexport const tasksOf = ({\n workspace,\n commands,\n usage,\n cargo,\n}: TaskOptions): NonNullable<NonNullable<UserConfig[\"run\"]>[\"tasks\"]> => {\n const inputs = [{ auto: true }, ...workspace.ignoredDirectories, ...NOT_INPUTS];\n const run = commandOf(usage);\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: run(CHECK),\n cache: { input: inputs, untrackedEnv: UNTRACKED_ENV },\n },\n msch: {\n command: run(MSCH_VERIFY_COMMANDS.msch),\n dependsOn: [\"check\", ...workspace.tasks.native],\n cache: false,\n },\n audit: { command: AUDIT, cache: false },\n published: { command: MSCH_TASK_COMMANDS.published, cache: false },\n compat: { command: COMPAT, dependsOn: [\"msch\", \"fallow\"], cache: false },\n ...cargoTasks(cargo),\n ...usageTasks(usage),\n };\n return {\n ...checks,\n test: {\n command: TEST,\n dependsOn: [\"check\", ...workspace.tasks.native],\n cache: { input: [...inputs, \"!**/.cache/**\"] },\n },\n daily: { command: DAILY, dependsOn: [...workspace.tasks.native], cache: false },\n verify: { command: [], dependsOn: [...workspace.tasks.verify, ...Rec.keys(checks)] },\n ci: { command: [], dependsOn: [...CI_TASKS, ...workspace.tasks.test] },\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 {\n textlintFilters,\n textlintPresets,\n zennMarkdown,\n} 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 interface BuiltTextOptions extends TextOptions {\n readonly articles: readonly string[];\n}\n\nexport const TEXT_IGNORES = [\n \"AGENTS.md\",\n \"CLAUDE.md\",\n \".agents/skills/**\",\n \"CHANGELOG.md\",\n ...exempt,\n];\nconst ZENN_MARKDOWN = \"zenn-markdown\";\nconst QUOTATION = String.raw`/「[^」]*」/`;\nconst ELLIPSIS = \"…\";\nconst TEXT_FILTERS = { comments: true, \"node-types\": { nodeTypes: [\"BlockQuote\"] } };\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\ntype Style = \"である\" | \"ですます\";\n\nconst builtRules = (\n properNouns: readonly string[],\n style: Style,\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: style, preferInList: style },\n \"max-kanji-continuous-len\": { max: KANJI_RUN, allow: [...properNouns] },\n \"no-exclamation-question-mark\": { allow: [QUOTATION, ...properNouns] },\n \"ja-no-successive-word\": { allow: [ELLIPSIS] },\n },\n});\n\nexport const builtTextRuleNames: readonly string[] = Rec.keys(builtRules([], \"である\"));\n\nexport const textlintOf = ({\n properNouns = [],\n rules = {},\n sources = [],\n articles,\n}: BuiltTextOptions): NonNullable<ToolSections[\"textlint\"]> => {\n const textRules = { ...rules, ...builtRules(properNouns, \"である\") };\n const articleSources = Arr.filter(\n [\n {\n files: [...articles],\n plugins: { [ZENN_MARKDOWN]: true },\n rules: { ...rules, ...builtRules(properNouns, \"ですます\") },\n filters: TEXT_FILTERS,\n } satisfies Source,\n ],\n () => Arr.isReadonlyArrayNonEmpty(articles),\n );\n return {\n ignores: [...TEXT_IGNORES, ...articles],\n presets: textlintPresets,\n filterModules: textlintFilters,\n pluginModules: { [ZENN_MARKDOWN]: zennMarkdown },\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: TEXT_FILTERS,\n })),\n Arr.appendAll(articleSources),\n ),\n filters: TEXT_FILTERS,\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":";;;;;;;AAOA,MAAM,cAAc;AACpB,MAAM,QAAQ;AACd,MAAM,UAAU;;AAShB,MAAa,aAAa,UAAqC;CAC7D,MAAM,eAAe,KAAK,OAAOA,MAAI,IAAIC,SAAI,WAAW,SAAS,OAAO,GAAG,KAAK,CAAC,CAAC;CAClF,OAAO,IAAI,OACT,2BAA2BD,MAAI,KAAK,cAAc,WAAW,EAAE,wBAC/D,IACF;AACF;AAEA,MAAM,WACH,cACA,EAAE,WAAW,kBAAoD;CAChE,MAAM,WAAW,KAAK,aAAa,OAAO,IAAIC,SAAI,QAAQ,OAAO,EAAE,CAAC,CAAC;CAMrE,OAAO;EAAE;EAAW,OALN,KACZ;GAAC,OAAO,KAAK,SAAS;GAAG,OAAO,KAAK,SAAS,SAAS,CAAC;GAAG;GAAa;EAAQ,GAChFD,MAAI,UACJA,MAAI,MAEkB;EAAG;CAAY;AACzC;;AAGF,MAAa,kBAAkB,OAAO,GAAG,iBAAiB,CAAC,CAAC,UAAU,gBACpE,MACA;CACA,MAAM,QAAQ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,MAAI,wBAAwB,QAAQ,CAC5C;CACA,OAAO;EACL,SAAS,CAAC,GAAG,cAAc,GAAG,QAAQ;EACtC,SAAS;EACT,eAAe;EACf,eAAe,GAAG,gBAAgB,aAAa;EAC/C,wBAAwB;EACxB,SAAS,KACP,SACAA,MAAI,KAAK,EAAE,OAAO,eAAuB;GACvC,OAAO,CAAC,GAAG,KAAK;GAChB,SAAS,EAAE,GAAG,QAAQ;GACtB,OAAO;GACP,SAAS;EACX,EAAE,GACFA,MAAI,UAAU,cAAc,CAC9B;EACA,SAAS;EACT,OAAO;CACT;AACF;AAEA,MAAM,SACH,aACA,aAAmD;CAClD,IAAIA,MAAI,qBAAqB,QAAQ,GACnC,OAAO,CAAC;CAOV,OAAO,CAAC,cAAc,QAAQ,KALf,KACb,UACAA,MAAI,KAAK,YAAY,KAAK,QAAQ,GAAG,GACrCA,MAAI,KAAK,IAAI,CAEyB,EAAE,GAAG;AAC/C;AAEF,MAAa,mBAA+B;CAC1C,QAAQ,EAAE,MAAM,YAAY;CAC5B,QAAQ,KACN,CAAC,GAAG,MAAM,cAAc,CAAC,CAAC,YAAY,GAAG,GAAG,MAAM,oBAAoB,CAAC,CAAC,YAAY,CAAC,GACrFA,MAAI,KAAK,MAAM,CACjB;AACF"}
1
+ {"version":3,"file":"repository-text-Dtv6Oz3P.mjs","names":["Arr","Str","Arr","Str","Arr","Rec","Rec","Arr"],"sources":["../src/entities/workspace/model/workspace-names.ts","../src/shared/lib/path-existence.ts","../src/app/repository-tasks.ts","../src/app/repository-text.ts"],"sourcesContent":["import { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { workspaceProjects } from \"./workspace-projects.ts\";\nimport type { WorkspaceProject } from \"./workspace-projects.ts\";\n\nconst ALTERNATIVE = \"|\";\nconst SCOPE = /^@[^/]+\\//u;\nconst SPECIAL = /[$()*+.?[\\\\\\]^{|}]/gu;\n\nexport interface NamedWorkspace {\n readonly directory: string;\n readonly names: readonly string[];\n readonly packageName: Option.Option<string>;\n}\n\n/** @internal */\nexport const patternOf = (names: readonly string[]): RegExp => {\n const alternatives = pipe(names, Arr.map(Str.replaceAll(SPECIAL, String.raw`\\$&`)));\n return new RegExp(\n `(?<![\\\\p{L}\\\\p{N}_-])(?:${Arr.join(alternatives, ALTERNATIVE)})(?![\\\\p{L}\\\\p{N}_-])`,\n \"gu\",\n );\n};\n\nconst namedIn =\n (basename: (directory: string) => string) =>\n ({ directory, packageName }: WorkspaceProject): NamedWorkspace => {\n const unscoped = pipe(packageName, Option.map(Str.replace(SCOPE, \"\")));\n const names = pipe(\n [Option.some(directory), Option.some(basename(directory)), packageName, unscoped],\n Arr.getSomes,\n Arr.dedupe,\n );\n return { directory, names, packageName };\n };\n\n/** @internal */\nexport const namedWorkspaces = Effect.fn(\"namedWorkspaces\")(function* namedWorkspaces(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const projects = yield* workspaceProjects(root);\n return pipe(projects, Arr.map(namedIn((directory) => files.basename(directory))));\n});\n","import { Array as Arr, Effect, Option, String as Str } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst WILDCARD = /[*?[]/u;\nconst SEPARATOR = \"/\";\nconst FIRST = 0;\n\n/** @internal */\nexport const existsAt = Effect.fn(\"existsAt\")(function* existsAt(root: string, path: string) {\n const files = yield* RepositoryFiles;\n return yield* files.exists(files.join(root, path));\n});\n\n/** @internal */\nexport const isDirectoryAt = Effect.fn(\"isDirectoryAt\")(function* isDirectoryAt(\n root: string,\n path: string,\n) {\n const files = yield* RepositoryFiles;\n const directory = yield* files.isDirectory(files.join(root, path));\n return Option.getOrElse(directory, () => false);\n});\n\n/** @internal */\nexport const staticPrefix = (path: string): string => {\n const prefix = Arr.headNonEmpty(Str.split(path, WILDCARD));\n if (Str.endsWith(SEPARATOR)(prefix)) {\n return Str.slice(FIRST, -SEPARATOR.length)(prefix);\n }\n return prefix;\n};\n\n/** @internal */\nexport const isIgnored = Effect.fn(\"isIgnored\")(function* isIgnored(root: string, path: string) {\n const prefix = staticPrefix(path);\n if (Str.isEmpty(prefix)) {\n return false;\n }\n const files = yield* RepositoryFiles;\n const ignored = yield* files.ignoredPaths(root, [prefix, `${prefix}${SEPARATOR}`]);\n return Arr.isReadonlyArrayNonEmpty(ignored);\n});\n","import { Array as Arr, Option, Record as Rec, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport { TASK_NAMES } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSettings } from \"#/features/build-workspace-settings/index.ts\";\nimport type { CargoInput } from \"#/features/derive-cargo-inputs/index.ts\";\nimport { USAGE_SPOOL } from \"#/shared/config/index.ts\";\n\ntype Tasks = NonNullable<NonNullable<UserConfig[\"run\"]>[\"tasks\"]>;\n\nexport interface UsageOptions {\n readonly endpoint: string;\n readonly apiKeyEnv?: string;\n}\n\nexport interface TaskOptions {\n readonly workspace: WorkspaceSettings;\n readonly commands: Readonly<Record<string, string>>;\n readonly usage: Option.Option<UsageOptions>;\n readonly cargo: Option.Option<CargoInputs>;\n}\n\nexport type CargoInputs = readonly CargoInput[];\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_FILES = [\"package.json\", \"pnpm-workspace.yaml\", \"pnpm-lock.yaml\", \".npmrc\"];\n\nconst AUDIT = Arr.join(\n [\n 'copy=\"$(mktemp -d)\"',\n `trap 'rm -rf \"$copy\"' EXIT`,\n `for file in ${Arr.join(AUDIT_FILES, \" \")}; do if [ -f \"$file\" ]; then cp \"$file\" \"$copy/\"; fi; done`,\n '(cd \"$copy\" && vp pm audit --fix >/dev/null) || exit',\n `added=\"$(diff pnpm-workspace.yaml \"$copy/pnpm-workspace.yaml\" | sed -n 's/^> \\\\(.*\\\\)$/\\\\1 # exit: unused/p')\"`,\n 'if [ -z \"$added\" ]; then exit 0; fi',\n `printf '%s\\\\n' \"vp pm audit --fix found vulnerable versions. First update them within their ranges with vp update -r --no-save <package>... -- --depth Infinity. For each one still reported by vp pm audit, add its line to overrides in pnpm-workspace.yaml and run vp install:\" \"$added\" >&2`,\n \"exit 1\",\n ],\n \"; \",\n);\n\nconst BROKER_TOKEN = `GH_TOKEN=\"\\${GITHUB_APP_TOKEN:-$GH_TOKEN}\"`;\nconst AGENT_STATE = `\"\\${RUNNER_TEMP:-\\${TMPDIR:-/tmp}}/msch-agents\"`;\n\nconst DAILY = `msch exits; ${BROKER_TOKEN} msch upstream; ${BROKER_TOKEN} msch callers; ${BROKER_TOKEN} msch refs; refs=$?; msch agents ${AGENT_STATE} && exit \"$refs\"`;\n\nconst TEST = \"msch changed -- vp test run --passWithNoTests\";\n\nconst CARGO =\n \"cargo fmt --all --check && cargo clippy --workspace --all-targets --locked -- -D warnings\";\n\nconst cargoTasks = (cargo: Option.Option<CargoInputs>): Tasks =>\n Option.match(cargo, {\n onNone: (): Tasks => ({}),\n onSome: (inputs): Tasks => ({\n cargo: {\n command: CARGO,\n cache: { input: [...inputs], output: [], untrackedEnv: UNTRACKED_ENV },\n },\n }),\n });\n\nexport const MSCH_VERIFY_COMMANDS = {\n fallow: FALLOW,\n check: CHECK,\n msch: \"msch\",\n audit: AUDIT,\n published: \"msch published\",\n compat: COMPAT,\n} as const;\n\nexport const MSCH_TASK_COMMANDS = { ...MSCH_VERIFY_COMMANDS, test: TEST } as const;\n\nexport const CI_TASKS = [TASK_NAMES.verify, TASK_NAMES.test] as const;\n\nconst USAGE_TASK = \"usage\";\n\nconst METERED_TASKS = [\"check\", \"msch\"] as const;\n\nexport const meteredCommand = (command: string): string =>\n `USAGE_METER_SPOOL=\"$PWD/${USAGE_SPOOL}\" ${command}`;\n\nconst usageCommandOf = ({ endpoint, apiKeyEnv }: UsageOptions): string =>\n pipe(\n Option.fromUndefinedOr(apiKeyEnv),\n Option.match({\n onNone: () => `msch usage --endpoint ${endpoint}`,\n onSome: (name) => `msch usage --endpoint ${endpoint} --api-key-env ${name}`,\n }),\n );\n\nconst commandOf =\n (usage: Option.Option<UsageOptions>) =>\n (command: string): string =>\n Option.match(usage, { onNone: () => command, onSome: () => meteredCommand(command) });\n\nconst usageTasks = (usage: Option.Option<UsageOptions>): Tasks =>\n Option.match(usage, {\n onNone: (): Tasks => ({}),\n onSome: (options): Tasks => ({\n [USAGE_TASK]: {\n command: usageCommandOf(options),\n dependsOn: [...METERED_TASKS],\n cache: false,\n },\n }),\n });\n\nexport const tasksOf = ({\n workspace,\n commands,\n usage,\n cargo,\n}: TaskOptions): NonNullable<NonNullable<UserConfig[\"run\"]>[\"tasks\"]> => {\n const inputs = [{ auto: true }, ...workspace.ignoredDirectories, ...NOT_INPUTS];\n const run = commandOf(usage);\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: run(CHECK),\n cache: { input: inputs, untrackedEnv: UNTRACKED_ENV },\n },\n msch: {\n command: run(MSCH_VERIFY_COMMANDS.msch),\n dependsOn: [\"check\", ...workspace.tasks.native],\n cache: false,\n },\n audit: { command: AUDIT, cache: false },\n published: { command: MSCH_TASK_COMMANDS.published, cache: false },\n compat: { command: COMPAT, dependsOn: [\"msch\", \"fallow\"], cache: false },\n ...cargoTasks(cargo),\n ...usageTasks(usage),\n };\n return {\n ...checks,\n test: {\n command: TEST,\n dependsOn: [\"check\", ...workspace.tasks.native],\n cache: { input: [...inputs, \"!**/.cache/**\"] },\n },\n daily: { command: DAILY, dependsOn: [...workspace.tasks.native], cache: false },\n verify: { command: [], dependsOn: [...workspace.tasks.verify, ...Rec.keys(checks)] },\n ci: { command: [], dependsOn: [...CI_TASKS, ...workspace.tasks.test] },\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 {\n textlintFilters,\n textlintPresets,\n zennMarkdown,\n} 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 interface BuiltTextOptions extends TextOptions {\n readonly articles: readonly string[];\n}\n\nexport const TEXT_IGNORES = [\n \"AGENTS.md\",\n \"CLAUDE.md\",\n \".agents/skills/**\",\n \"CHANGELOG.md\",\n ...exempt,\n];\nconst ZENN_MARKDOWN = \"zenn-markdown\";\nconst QUOTATION = String.raw`/「[^」]*」/`;\nconst ELLIPSIS = \"…\";\nconst TEXT_FILTERS = { comments: true, \"node-types\": { nodeTypes: [\"BlockQuote\"] } };\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|hooks/vendor)/`];\n\ntype Style = \"である\" | \"ですます\";\n\nconst builtRules = (\n properNouns: readonly string[],\n style: Style,\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: style, preferInList: style },\n \"max-kanji-continuous-len\": { max: KANJI_RUN, allow: [...properNouns] },\n \"no-exclamation-question-mark\": { allow: [QUOTATION, ...properNouns] },\n \"ja-no-successive-word\": { allow: [ELLIPSIS] },\n },\n});\n\nexport const builtTextRuleNames: readonly string[] = Rec.keys(builtRules([], \"である\"));\n\nexport const textlintOf = ({\n properNouns = [],\n rules = {},\n sources = [],\n articles,\n}: BuiltTextOptions): NonNullable<ToolSections[\"textlint\"]> => {\n const textRules = { ...rules, ...builtRules(properNouns, \"である\") };\n const articleSources = Arr.filter(\n [\n {\n files: [...articles],\n plugins: { [ZENN_MARKDOWN]: true },\n rules: { ...rules, ...builtRules(properNouns, \"ですます\") },\n filters: TEXT_FILTERS,\n } satisfies Source,\n ],\n () => Arr.isReadonlyArrayNonEmpty(articles),\n );\n return {\n ignores: [...TEXT_IGNORES, ...articles],\n presets: textlintPresets,\n filterModules: textlintFilters,\n pluginModules: { [ZENN_MARKDOWN]: zennMarkdown },\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: TEXT_FILTERS,\n })),\n Arr.appendAll(articleSources),\n ),\n filters: TEXT_FILTERS,\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":";;;;;;;AAOA,MAAM,cAAc;AACpB,MAAM,QAAQ;AACd,MAAM,UAAU;;AAShB,MAAa,aAAa,UAAqC;CAC7D,MAAM,eAAe,KAAK,OAAOA,MAAI,IAAIC,SAAI,WAAW,SAAS,OAAO,GAAG,KAAK,CAAC,CAAC;CAClF,OAAO,IAAI,OACT,2BAA2BD,MAAI,KAAK,cAAc,WAAW,EAAE,wBAC/D,IACF;AACF;AAEA,MAAM,WACH,cACA,EAAE,WAAW,kBAAoD;CAChE,MAAM,WAAW,KAAK,aAAa,OAAO,IAAIC,SAAI,QAAQ,OAAO,EAAE,CAAC,CAAC;CAMrE,OAAO;EAAE;E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AAE,GAAG;EAAO,GAAG,WAAW,aAAa,KAAK;CAAE;CAChE,MAAM,iBAAiBC,MAAI,OACzB,CACE;EACE,OAAO,CAAC,GAAG,QAAQ;EACnB,SAAS,GAAG,gBAAgB,KAAK;EACjC,OAAO;GAAE,GAAG;GAAO,GAAG,WAAW,aAAa,MAAM;EAAE;EACtD,SAAS;CACX,CACF,SACMA,MAAI,wBAAwB,QAAQ,CAC5C;CACA,OAAO;EACL,SAAS,CAAC,GAAG,cAAc,GAAG,QAAQ;EACtC,SAAS;EACT,eAAe;EACf,eAAe,GAAG,gBAAgB,aAAa;EAC/C,wBAAwB;EACxB,SAAS,KACP,SACAA,MAAI,KAAK,EAAE,OAAO,eAAuB;GACvC,OAAO,CAAC,GAAG,KAAK;GAChB,SAAS,EAAE,GAAG,QAAQ;GACtB,OAAO;GACP,SAAS;EACX,EAAE,GACFA,MAAI,UAAU,cAAc,CAC9B;EACA,SAAS;EACT,OAAO;CACT;AACF;AAEA,MAAM,SACH,aACA,aAAmD;CAClD,IAAIA,MAAI,qBAAqB,QAAQ,GACnC,OAAO,CAAC;CAOV,OAAO,CAAC,cAAc,QAAQ,KALf,KACb,UACAA,MAAI,KAAK,YAAY,KAAK,QAAQ,GAAG,GACrCA,MAAI,KAAK,IAAI,CAEyB,EAAE,GAAG;AAC/C;AAEF,MAAa,mBAA+B;CAC1C,QAAQ,EAAE,MAAM,YAAY;CAC5B,QAAQ,KACN,CAAC,GAAG,MAAM,cAAc,CAAC,CAAC,YAAY,GAAG,GAAG,MAAM,oBAAoB,CAAC,CAAC,YAAY,CAAC,GACrFA,MAAI,KAAK,MAAM,CACjB;AACF"}
@@ -1,2 +1,2 @@
1
- import { a as WorkspaceSettings, c as DependencySets, d as WorkspaceTasks, i as WorkspaceLint, l as IgnoredDirectory, n as RuleSets, o as workspaceSettings, r as SettingsOptions, s as DependencyAllowance, t as RuleSet, u as ignoredDirectories } from "./index-B0ahB5vD.mjs";
1
+ import { a as WorkspaceSettings, c as DependencySets, d as WorkspaceTasks, i as WorkspaceLint, l as IgnoredDirectory, n as RuleSets, o as workspaceSettings, r as SettingsOptions, s as DependencyAllowance, t as RuleSet, u as ignoredDirectories } from "./index-DIMbx_hx.mjs";
2
2
  export { type DependencyAllowance, type DependencySets, type IgnoredDirectory, type RuleSet, type RuleSets, type SettingsOptions, type WorkspaceLint, type WorkspaceSettings, type WorkspaceTasks, ignoredDirectories, workspaceSettings };
@@ -16,9 +16,12 @@ const isPlugin = Effect.fn("isPlugin")(function* isPlugin(root, directory) {
16
16
  const files = yield* RepositoryFiles;
17
17
  return yield* files.exists(files.join(root, directory, PLUGIN_MANIFEST));
18
18
  });
19
+ const pluginWorkspaces = Effect.fn("pluginWorkspaces")(function* pluginWorkspaces(root, directories) {
20
+ return yield* Effect.filter(directories, (directory) => isPlugin(root, directory), { concurrency: READ_CONCURRENCY$3 });
21
+ });
19
22
  const structureMembers = Effect.fn("structureMembers")(function* structureMembers(root, directories) {
20
- const plugins = yield* Effect.forEach(directories, (directory) => isPlugin(root, directory), { concurrency: READ_CONCURRENCY$3 });
21
- return pipe(Array.zip(directories, plugins), Array.filter(([directory, plugin]) => directory !== ROOT_WORKSPACE && !plugin), Array.map(([directory]) => directory));
23
+ const plugins = yield* pluginWorkspaces(root, directories);
24
+ return pipe(directories, Array.filter((directory) => directory !== ROOT_WORKSPACE && !Array.contains(plugins, directory)));
22
25
  });
23
26
  // src/entities/workspace/model/site-entries.ts
24
27
  const READ_CONCURRENCY$2 = 16;
@@ -356,6 +359,7 @@ const collectWorkspaceSettings = Effect.fn("collectWorkspaceSettings")(function*
356
359
  const shadcnUi = yield* Effect.forEach(directories, (directory) => shadcnUiIn(options.root, directory), { concurrency: READ_CONCURRENCY });
357
360
  return {
358
361
  members: yield* structureMembers(options.root, directories),
362
+ plugins: yield* pluginWorkspaces(options.root, directories),
359
363
  ignoredDirectories: yield* collectIgnoredDirectories(options.root),
360
364
  lint: {
361
365
  overrides: pipe(found, Array.flatMap(({ overrides }) => overrides)),