@r_masseater/msch 0.127.1 → 0.128.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +59 -41
- package/dist/cli.mjs.map +1 -1
- package/dist/config.mjs +1 -1
- package/dist/{published-DkH6B-Gr.mjs → published-BbAu-6IS.mjs} +3 -4
- package/dist/published-BbAu-6IS.mjs.map +1 -0
- package/dist/{repository-config-8JN86BZA.mjs → repository-config-DGEG2Ew6.mjs} +16 -3
- package/dist/repository-config-DGEG2Ew6.mjs.map +1 -0
- package/dist/workspace-settings.mjs +2 -2
- package/dist/workspace-settings.mjs.map +1 -1
- package/package.json +8 -7
- package/skills/msch-checks/SKILL.md +8 -4
- package/skills/msch-publishing/SKILL.md +8 -4
- package/skills/msch-repository-config/SKILL.md +16 -12
- package/skills/msch-workspace-settings/SKILL.md +11 -7
- package/dist/published-DkH6B-Gr.mjs.map +0 -1
- package/dist/repository-config-8JN86BZA.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@r_masseater/msch",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.128.0",
|
|
4
4
|
"description": "A check policy for repositories: points every finite value set and object shape at its one owner, and ships the oxlint preset of plugins and rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lint",
|
|
@@ -71,13 +71,14 @@
|
|
|
71
71
|
"@pnpm/workspace.workspace-manifest-reader": "^1100.3.4",
|
|
72
72
|
"@pnpm/workspace.workspace-manifest-writer": "^1100.2.13",
|
|
73
73
|
"@r_masseater/cc-effect-hooks": ">=0.1.0",
|
|
74
|
-
"@r_masseater/fu4": "^0.5.
|
|
74
|
+
"@r_masseater/fu4": "^0.5.9",
|
|
75
75
|
"@r_masseater/masseater-utils": ">=0.10.0",
|
|
76
|
-
"@r_masseater/
|
|
76
|
+
"@r_masseater/mdlct": ">=0.3.0",
|
|
77
|
+
"@r_masseater/oxlint-plugin-decision": "^0.10.6",
|
|
77
78
|
"@r_masseater/oxlint-typed-rules": "^0.7.3",
|
|
78
|
-
"@r_masseater/textlint-rule-preset-ja": "^0.4.
|
|
79
|
-
"@r_masseater/wism": "^0.5.
|
|
80
|
-
"@r_masseater/y8": "^0.9.
|
|
79
|
+
"@r_masseater/textlint-rule-preset-ja": "^0.4.8",
|
|
80
|
+
"@r_masseater/wism": "^0.5.9",
|
|
81
|
+
"@r_masseater/y8": "^0.9.10",
|
|
81
82
|
"@shadcn/lint": "^0.2.5",
|
|
82
83
|
"@tanstack/intent": "^0.5.6",
|
|
83
84
|
"@textlint-ja/textlint-rule-preset-ai-writing": "^1.7.2",
|
|
@@ -109,7 +110,7 @@
|
|
|
109
110
|
"@effect/vitest": "4.2.0",
|
|
110
111
|
"@masseater.dev/lint-host": "0.0.0",
|
|
111
112
|
"@masseater.dev/path-kit": "0.0.0",
|
|
112
|
-
"@r_masseater/h56m": "0.4.
|
|
113
|
+
"@r_masseater/h56m": "0.4.10",
|
|
113
114
|
"@r_masseater/vite-plus-adopt": "0.28.3",
|
|
114
115
|
"@textlint/kernel": "16.1.4",
|
|
115
116
|
"@types/node": "26.6.11",
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: msch-checks
|
|
3
3
|
description: >
|
|
4
|
-
Use in a repository that depends on @r_masseater/msch: before changing code,
|
|
5
|
-
skills or docs there, and whenever msch, its lint preset or
|
|
6
|
-
|
|
4
|
+
Use in a repository that depends on @r_masseater/msch: before changing code,
|
|
5
|
+
config, workflows, skills or docs there, and whenever msch, its lint preset or
|
|
6
|
+
a git hook reports a finding. msch holds the repository conventions as checks,
|
|
7
|
+
so its findings stand in for a written rule list.
|
|
7
8
|
metadata:
|
|
8
9
|
type: core
|
|
9
10
|
library: "@r_masseater/msch"
|
|
11
|
+
library_version: 0.128.0
|
|
10
12
|
sources:
|
|
11
13
|
- bin/msch.ts
|
|
12
|
-
- src/app
|
|
14
|
+
- src/app
|
|
13
15
|
- src/app/exits-command.ts
|
|
14
16
|
- src/app/judge-command.ts
|
|
15
17
|
- src/app/unbumped-command.ts
|
|
@@ -102,3 +104,5 @@ A skill whose directory starts with `principle-` and the `PRINCIPLE.md` of a lib
|
|
|
102
104
|
Each finding names the file, the rule and the fix. Apply the fix the message gives.
|
|
103
105
|
|
|
104
106
|
Never silence a finding with an ignore list, a disable directive or an override. When a finding is wrong, fix the check in msch.
|
|
107
|
+
|
|
108
|
+
This skill describes [`bin/msch.ts`](../../bin/msch.ts), [`src/app`](../../src/app), [`src/app/exits-command.ts`](../../src/app/exits-command.ts), [`src/app/judge-command.ts`](../../src/app/judge-command.ts), [`src/app/unbumped-command.ts`](../../src/app/unbumped-command.ts) and [`src/app/upstream-command.ts`](../../src/app/upstream-command.ts).
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: msch-publishing
|
|
3
3
|
description: >
|
|
4
|
-
Use in a repository that depends on @r_masseater/msch when releasing a
|
|
5
|
-
npm package, shipping an app's installers as a GitHub
|
|
6
|
-
|
|
4
|
+
Use in a repository that depends on @r_masseater/msch when releasing a
|
|
5
|
+
workspace: publishing an npm package, shipping an app's installers as a GitHub
|
|
6
|
+
Release, bumping a version, or adding a release build to a workspace. msch
|
|
7
|
+
publish is the one release path for both.
|
|
7
8
|
metadata:
|
|
8
9
|
type: core
|
|
9
10
|
library: "@r_masseater/msch"
|
|
11
|
+
library_version: 0.128.0
|
|
10
12
|
sources:
|
|
11
13
|
- src/app/publish-command.ts
|
|
12
|
-
- src/features/publish-workspace
|
|
14
|
+
- src/features/publish-workspace
|
|
13
15
|
---
|
|
14
16
|
|
|
15
17
|
# msch-publishing
|
|
@@ -66,3 +68,5 @@ The consumers of a package are checked against its new build before it publishes
|
|
|
66
68
|
## The workflow
|
|
67
69
|
|
|
68
70
|
The `publish` workflow runs `msch publish plan`, the builds and checks the plan lists, `msch publish npm` in the `npm` environment, and `msch publish release`, which tags the commit and uploads `release-assets/`. Runs for the same workspace are serialized and never cancelled; different workspaces publish independently.
|
|
71
|
+
|
|
72
|
+
This skill describes [`src/app/publish-command.ts`](../../src/app/publish-command.ts) and [`src/features/publish-workspace`](../../src/features/publish-workspace).
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: msch-repository-config
|
|
3
3
|
description: >
|
|
4
|
-
Use when creating or changing the root vite.config.ts of a repository that
|
|
5
|
-
repositoryConfig, workspaceSettings, the lint preset
|
|
6
|
-
|
|
4
|
+
Use when creating or changing the root vite.config.ts of a repository that
|
|
5
|
+
uses @r_masseater/msch: repositoryConfig, workspaceSettings, the lint preset
|
|
6
|
+
and its rule sets, extra root tasks, h56m allowances and textlint words. Not
|
|
7
|
+
for settings that apply to one workspace only.
|
|
7
8
|
metadata:
|
|
8
9
|
type: core
|
|
9
10
|
library: "@r_masseater/msch"
|
|
11
|
+
library_version: 0.128.0
|
|
10
12
|
sources:
|
|
11
13
|
- src/app/repository-config.ts
|
|
12
14
|
- src/app/repository-tasks.ts
|
|
@@ -15,7 +17,7 @@ sources:
|
|
|
15
17
|
- src/features/build-workspace-settings/index.ts
|
|
16
18
|
- src/shared/lib/repository-origin.ts
|
|
17
19
|
- src/shared/lib/index-skill.ts
|
|
18
|
-
- src/features/check-owner-names
|
|
20
|
+
- src/features/check-owner-names
|
|
19
21
|
---
|
|
20
22
|
|
|
21
23
|
# msch-repository-config
|
|
@@ -113,14 +115,14 @@ With `usage`, the `check` and `msch` tasks run with `USAGE_METER_SPOOL` set. The
|
|
|
113
115
|
|
|
114
116
|
msch names no owner and has no setting for one. It reads these from the repository it runs in.
|
|
115
117
|
|
|
116
|
-
| Fact | Read from
|
|
117
|
-
| ------------------------------------- |
|
|
118
|
-
| The owner | `git remote get-url origin`. A source of the `skills` section that the same owner holds must install with `skills: "all"`
|
|
119
|
-
| The scope of published packages | The scope most published packages of the repository use. A published package outside it is reported
|
|
120
|
-
| The repository's own plugins | `.claude-plugin/marketplace.json`. When `.claude/settings.json` knows that marketplace from this repository, it enables every plugin
|
|
121
|
-
| A plugin's plugin.json and hooks file | The `plugin` export of the plugin's `plugin.ts`, made with `definePlugin` of `@r_masseater/cc-effect-hooks`, and the name and description of its `package.json`. msch writes both files
|
|
122
|
-
| The index skill | The installed skill whose
|
|
123
|
-
| The Renovate presets | The `repository` field of the installed msch and vite-plus-adopt
|
|
118
|
+
| Fact | Read from |
|
|
119
|
+
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
120
|
+
| The owner | `git remote get-url origin`. A source of the `skills` section that the same owner holds must install with `skills: "all"` |
|
|
121
|
+
| The scope of published packages | The scope most published packages of the repository use. A published package outside it is reported |
|
|
122
|
+
| The repository's own plugins | `.claude-plugin/marketplace.json`. When `.claude/settings.json` knows that marketplace from this repository, it enables every plugin |
|
|
123
|
+
| A plugin's plugin.json and hooks file | The `plugin` export of the plugin's `plugin.ts`, made with `definePlugin` of `@r_masseater/cc-effect-hooks`, and the name and description of its `package.json`. msch writes both files |
|
|
124
|
+
| The index skill | The installed skill whose directory has its plugin's name, `plugins/<plugin>/skills/<plugin>/SKILL.md`. Only that skill may name other skills in prose; others link them as `<skill:package#name>` |
|
|
125
|
+
| The Renovate presets | The `repository` field of the installed msch and vite-plus-adopt |
|
|
124
126
|
|
|
125
127
|
Packages publish to the public npm registry, and installs go through Takumi Guard (`https://npm.flatt.tech/`).
|
|
126
128
|
`msch publish` talks to no credential service. It publishes with the `NODE_AUTH_TOKEN` of the job, and tags with `GITHUB_APP_TOKEN` when the job has one.
|
|
@@ -165,3 +167,5 @@ Run `vp lint --fix` to apply the fixes.
|
|
|
165
167
|
| Writing a workspace path in the root config | The `root-workspace-path` check rejects it. Use the workspace's `msch` block |
|
|
166
168
|
| Adding commitlint, textlint presets or `@ast-grep/cli` to the root `package.json` | msch already depends on them |
|
|
167
169
|
| Running effecttsgo rules on a plain oxlint | Run `effect-tsgo patch --typescript --oxlint --tsrs` in `prepare`, so `vp check` lints on the Effect-patched tsrs |
|
|
170
|
+
|
|
171
|
+
This skill describes [`src/app/repository-config.ts`](../../src/app/repository-config.ts), [`src/app/repository-tasks.ts`](../../src/app/repository-tasks.ts), [`src/app/repository-text.ts`](../../src/app/repository-text.ts), [`src/features/define-lint-preset/index.ts`](../../src/features/define-lint-preset/index.ts), [`src/features/build-workspace-settings/index.ts`](../../src/features/build-workspace-settings/index.ts), [`src/shared/lib/repository-origin.ts`](../../src/shared/lib/repository-origin.ts), [`src/shared/lib/index-skill.ts`](../../src/shared/lib/index-skill.ts) and [`src/features/check-owner-names`](../../src/features/check-owner-names).
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: msch-workspace-settings
|
|
3
3
|
description: >
|
|
4
|
-
Use when one workspace of a repository that uses @r_masseater/msch needs its
|
|
5
|
-
ignore pattern, test-only dependency, install size limit,
|
|
6
|
-
task: the msch block and run.tasks of
|
|
7
|
-
that
|
|
4
|
+
Use when one workspace of a repository that uses @r_masseater/msch needs its
|
|
5
|
+
own lint override, ignore pattern, test-only dependency, install size limit,
|
|
6
|
+
extra verify step, or a test or build task: the msch block and run.tasks of
|
|
7
|
+
that workspace's vite.config.ts. Also use when msch reports that such a
|
|
8
|
+
setting is not literal, names an unknown set, or reports unlocked-task.
|
|
8
9
|
metadata:
|
|
9
10
|
type: core
|
|
10
11
|
library: "@r_masseater/msch"
|
|
12
|
+
library_version: 0.128.0
|
|
11
13
|
sources:
|
|
12
14
|
- src/app/vite.d.ts
|
|
13
|
-
- src/features/build-workspace-settings
|
|
15
|
+
- src/features/build-workspace-settings
|
|
14
16
|
- src/shared/lib/locked-inputs.ts
|
|
15
|
-
- src/features/define-library
|
|
16
|
-
- src/entities/workspace
|
|
17
|
+
- src/features/define-library
|
|
18
|
+
- src/entities/workspace
|
|
17
19
|
---
|
|
18
20
|
|
|
19
21
|
# msch-workspace-settings
|
|
@@ -108,3 +110,5 @@ Put Rust tests in a `cargo-test` task written in the workspace's `vite.config.ts
|
|
|
108
110
|
The root `ci` task runs the workspace's `test` and `cargo-test` in CI, while `verify` runs in the pre-push hook.
|
|
109
111
|
|
|
110
112
|
Keep repository-wide settings such as `comments.allow` and `workspaceAgentsMd` in the root `msch` block.
|
|
113
|
+
|
|
114
|
+
This skill describes [`src/app/vite.d.ts`](../../src/app/vite.d.ts), [`src/features/build-workspace-settings`](../../src/features/build-workspace-settings), [`src/shared/lib/locked-inputs.ts`](../../src/shared/lib/locked-inputs.ts), [`src/features/define-library`](../../src/features/define-library) and [`src/entities/workspace`](../../src/entities/workspace).
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"published-DkH6B-Gr.mjs","names":["SEPARATOR","Str","Str","Rec","Arr","READ_CONCURRENCY","Arr","Arr","Rec","Str","parse","Str","Str","Arr","Str","Arr","Arr","Str","Rec"],"sources":["../src/entities/workspace/model/workspace-patterns.ts","../src/entities/workspace/model/shadcn-ui.ts","../src/entities/workspace/model/deploy-entries.ts","../src/entities/workspace/model/locked-links.ts","../src/shared/lib/frontmatter.ts","../src/shared/lib/index-skill.ts","../src/entities/workspace/model/mod-directories.ts","../src/entities/package/model/public-entries.ts","../src/entities/package/model/published.ts"],"sourcesContent":["import { String as Str } from \"effect\";\n\nconst SEPARATOR = \"/\";\nconst NEGATION = \"!\";\nconst RELATIVE = \"./\";\n\nexport const withoutRelative = (target: string): string => {\n if (Str.startsWith(RELATIVE)(target)) {\n return Str.slice(RELATIVE.length)(target);\n }\n return target;\n};\n\nexport const prefixed =\n (directory: string) =>\n (pattern: string): string => {\n if (Str.startsWith(NEGATION)(pattern)) {\n return `${NEGATION}${directory}${SEPARATOR}${Str.slice(NEGATION.length)(pattern)}`;\n }\n return `${directory}${SEPARATOR}${withoutRelative(pattern)}`;\n };\n","import { PACKAGE_JSON_FILE } from \"@r_masseater/masseater-utils/kestrion\";\nimport { decodePackageJson } from \"@r_masseater/masseater-utils/kestrion/npm\";\nimport { Array as Arr, Effect, Option, Record as Rec, Schema, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { prefixed, withoutRelative } from \"./workspace-patterns.ts\";\n\nconst SHADCN_FILE = \"components.json\";\nconst WILDCARD = \"*\";\nconst EVERYTHING = \"/**\";\n\nconst ShadcnConfig = Schema.Struct({ aliases: Schema.Struct({ ui: Schema.String }) });\nconst decodeImports = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.String));\nconst decodeShadcnConfig = Schema.decodeUnknownOption(Schema.fromJsonString(ShadcnConfig));\n\nconst withoutWildcard = Str.replace(WILDCARD, \"\");\n\nconst importTarget =\n (alias: string) =>\n ([key, target]: readonly [string, string]): Option.Option<string> => {\n if (!Str.endsWith(WILDCARD)(key)) {\n return Option.some(target).pipe(Option.filter(() => key === alias));\n }\n const prefix = withoutWildcard(key);\n if (!Str.startsWith(prefix)(alias)) {\n return Option.none();\n }\n return Option.some(`${withoutWildcard(target)}${Str.slice(prefix.length)(alias)}`);\n };\n\nconst resolvedAlias = (\n imports: Readonly<Record<string, string>>,\n alias: string,\n): Option.Option<string> =>\n pipe(Rec.toEntries(imports), Arr.findFirst(importTarget(alias)), Option.map(withoutRelative));\n\nexport type ShadcnUi = Readonly<{\n file: string;\n alias: string;\n target: Option.Option<string>;\n}>;\n\nexport const shadcnUiOf = Effect.fn(\"shadcnUiOf\")(function* shadcnUiOf(\n root: string,\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const file = files.join(root, directory, SHADCN_FILE);\n const configText = yield* files.readFile(file);\n const manifestText = yield* files.readFile(files.join(root, directory, PACKAGE_JSON_FILE));\n const imports = pipe(\n manifestText,\n Option.flatMap(decodePackageJson),\n Option.flatMap((manifest) => decodeImports(manifest.imports)),\n );\n return pipe(\n configText,\n Option.flatMap(decodeShadcnConfig),\n Option.map(({ aliases }): ShadcnUi => ({\n file,\n alias: aliases.ui,\n target: pipe(\n imports,\n Option.flatMap((map) => resolvedAlias(map, aliases.ui)),\n ),\n })),\n );\n});\n\nexport const shadcnUiIn = Effect.fn(\"shadcnUiIn\")(function* shadcnUiIn(\n root: string,\n directory: string,\n) {\n const found = yield* shadcnUiOf(root, directory);\n return pipe(\n found,\n Option.map(\n ({ alias, target }) =>\n `${prefixed(directory)(Option.getOrElse(target, () => alias))}${EVERYTHING}`,\n ),\n );\n});\n","import { Array as Arr, Effect, Option, Predicate, Schema, pipe } from \"effect\";\nimport { parse } from \"vite-plus\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { KeySchema, childrenOf, keyName, stringsIn } from \"./config-literal.ts\";\n\nconst MAIN_KEY = \"main\";\nconst FRAMEWORK_SITES = \"Website\";\nconst READ_CONCURRENCY = 16;\nconst SCRIPT = /\\.[cm]?tsx?$/u;\nconst SKIPPED = /\\.test\\.|\\.d\\.[cm]?ts$/u;\nconst ALCHEMY_IMPORT = /from\\s+[\"'](?:alchemy|@alchemy\\.run)(?:\\/[^\"']*)?[\"']/u;\nconst MAIN_PROPERTY = /\\bmain\\s*:/u;\nconst decodeKey = Schema.decodeUnknownOption(KeySchema);\nconst SiteNamespace = Schema.Struct({\n type: Schema.Literal(\"Identifier\"),\n name: Schema.Literal(FRAMEWORK_SITES),\n});\nconst SiteResource = Schema.Struct({\n type: Schema.Literal(\"MemberExpression\"),\n object: SiteNamespace,\n});\nconst FrameworkSite = Schema.Struct({\n type: Schema.Literal(\"CallExpression\"),\n callee: SiteResource,\n});\nconst decodeFrameworkSite = Schema.decodeUnknownOption(FrameworkSite);\n\nconst isMainProperty = (node: Readonly<Record<string, unknown>>): boolean =>\n node[\"type\"] === \"Property\" &&\n pipe(\n decodeKey(node[\"key\"]),\n Option.exists((key) => keyName(key) === MAIN_KEY),\n );\n\ntype Skip = (node: unknown) => boolean;\n\nconst skipNothing: Skip = () => false;\n\nconst isFrameworkSite: Skip = (node) => Option.isSome(decodeFrameworkSite(node));\n\nconst mainTargetsIn = (skip: Skip): ((node: unknown) => readonly string[]) => {\n const visit = (node: unknown): readonly string[] => {\n if (skip(node)) {\n return [];\n }\n if (Predicate.isReadonlyObject(node) && isMainProperty(node)) {\n return pipe(\n stringsIn(node[\"value\"]),\n Arr.head,\n Option.map(({ text }) => text),\n Option.toArray,\n );\n }\n return pipe(childrenOf(node), Arr.flatMap(visit));\n };\n return visit;\n};\n\ninterface Declaring {\n readonly root: string;\n readonly file: string;\n readonly skip: Skip;\n}\n\nconst declaredIn = Effect.fn(\"declaredIn\")(function* declaredIn({ root, file, skip }: Declaring) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, file));\n if (Option.isNone(text) || !ALCHEMY_IMPORT.test(text.value) || !MAIN_PROPERTY.test(text.value)) {\n return [];\n }\n const parsed = yield* Effect.promise(() => parse(file, text.value, { lang: \"ts\" }));\n return pipe(\n mainTargetsIn(skip)(parsed.program),\n Arr.map((target) => files.join(files.dirname(file), target)),\n );\n});\n\nconst entriesOutside = Effect.fn(\"entriesOutside\")(function* entriesOutside(\n root: string,\n skip: Skip,\n) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.listedFiles(root);\n const declaring = pipe(\n listed,\n Arr.filter((file) => SCRIPT.test(file) && !SKIPPED.test(file)),\n );\n const found = yield* Effect.forEach(declaring, (file) => declaredIn({ root, file, skip }), {\n concurrency: READ_CONCURRENCY,\n });\n return pipe(\n Arr.flatten(found),\n Arr.filter((file) => Arr.contains(listed, file)),\n Arr.dedupe,\n );\n});\n\nexport const deployEntries = Effect.fn(\"deployEntries\")(function* deployEntries(root: string) {\n return yield* entriesOutside(root, skipNothing);\n});\n\nexport const bundledEntries = Effect.fn(\"bundledEntries\")(function* bundledEntries(root: string) {\n return yield* entriesOutside(root, isFrameworkSite);\n});\n","import { readWantedLockfile } from \"@r_masseater/masseater-utils/kestrion/pnpm\";\nimport type { ResolvedDependencies } from \"@r_masseater/masseater-utils/kestrion/pnpm\";\nimport { Array as Arr, Effect, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst LINK = \"link:\";\n\nexport interface WorkspaceLink {\n readonly from: string;\n readonly to: string;\n}\n\nexport const linkedPaths = (\n sections: readonly (ResolvedDependencies | undefined)[],\n): readonly string[] =>\n pipe(\n sections,\n Arr.flatMap((resolved) => Rec.values(resolved ?? {})),\n Arr.filter(Str.startsWith(LINK)),\n Arr.map((reference) => Str.slice(LINK.length)(reference)),\n );\n\n/** @internal */\nexport const workspaceLinks = Effect.fn(\"workspaceLinks\")(function* workspaceLinks(root: string) {\n const files = yield* RepositoryFiles;\n const lockfile = yield* readWantedLockfile(root);\n const linksOf = (id: string, paths: readonly string[]): readonly WorkspaceLink[] => {\n const from = files.relative(root, files.join(root, id));\n return pipe(\n paths,\n Arr.map((path): WorkspaceLink => ({\n from,\n to: files.relative(root, files.join(root, id, path)),\n })),\n );\n };\n return pipe(\n lockfile,\n Option.map(({ importers }) =>\n pipe(\n Rec.toEntries(importers),\n Arr.flatMap(([id, project]) =>\n linksOf(\n id,\n linkedPaths([\n project.dependencies,\n project.devDependencies,\n project.optionalDependencies,\n ]),\n ),\n ),\n ),\n ),\n Option.getOrElse((): readonly WorkspaceLink[] => []),\n );\n});\n","import { groupOf } from \"@masseater.dev/lint-host/collections\";\nimport { Option, Schema, String as Str, pipe } from \"effect\";\nimport { parse } from \"yaml\";\n\nexport const FRONTMATTER = /^---\\n(?<yaml>[\\s\\S]*?)\\n---\\n/u;\n\nconst START = 0;\nconst Fields = Schema.Record(Schema.String, Schema.Unknown);\nconst decodeFields = Schema.decodeUnknownOption(Fields);\n\nexport interface Frontmatter {\n readonly fields: typeof Fields.Type;\n readonly body: string;\n}\n\nexport const splitFrontmatter = (source: string): Option.Option<Frontmatter> =>\n pipe(\n Option.fromNullishOr(FRONTMATTER.exec(source)),\n Option.flatMap((found) =>\n pipe(\n groupOf(\"yaml\")(found),\n Option.flatMap(Option.liftThrowable((yaml: string): unknown => parse(yaml))),\n Option.flatMap(decodeFields),\n Option.map((fields): Frontmatter => ({\n fields,\n body: Str.slice(found[START].length)(source),\n })),\n ),\n ),\n );\n","import { Predicate } from \"effect\";\n\nimport type { Frontmatter } from \"./frontmatter.ts\";\n\nconst INDEX_ROLE = \"index\";\n\n/** @internal */\nexport const isIndexSkill = ({ fields }: Frontmatter): boolean =>\n Predicate.isObject(fields[\"metadata\"]) &&\n Predicate.hasProperty(fields[\"metadata\"], \"role\") &&\n fields[\"metadata\"].role === INDEX_ROLE;\n","import { Array as Arr, Effect, Option, Schema, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst HOOKS_FILE = \"hooks/hooks.json\";\nconst Modules = Schema.String.pipe(Schema.Array, Schema.optional);\nconst HooksFile = Schema.fromJsonString(Schema.Struct({ modules: Modules }));\nconst decodeHooks = Schema.decodeUnknownOption(HooksFile);\nconst PARENT = 1;\n\nconst directoryOf = (module: string): string => {\n const parts = pipe(\n Str.split(`hooks/${module}`, \"/\"),\n Arr.filter((part) => part !== \"\" && part !== \".\"),\n );\n return `${Arr.join(Arr.dropRight(parts, PARENT), \"/\")}/`;\n};\n\n/** @internal */\nexport const modDirectoriesOf = (hooks: string): readonly string[] =>\n pipe(\n decodeHooks(hooks),\n Option.flatMap(({ modules }) => Option.fromNullishOr(modules)),\n Option.getOrElse((): readonly string[] => []),\n Arr.map(directoryOf),\n Arr.dedupe,\n );\n\n/** @internal */\nexport const modDirectories = Effect.fn(\"modDirectories\")(function* modDirectories(\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const hooks = yield* files.readFile(files.join(directory, HOOKS_FILE));\n return Option.match(hooks, { onNone: (): readonly string[] => [], onSome: modDirectoriesOf });\n});\n","import { binEntriesOf, exportEntriesOf, targetsIn } from \"@r_masseater/masseater-utils/kestrion\";\nimport type { PackageJson } from \"@r_masseater/masseater-utils/kestrion\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nimport type { PackEntrySource } from \"./published.ts\";\n\nconst SOURCE = /\\.[cm]?tsx?$/u;\nconst BUILT = /\\.(?:d\\.)?[cm]?[jt]s$/u;\nconst OUT_DIRECTORY = /^(?:\\.\\/)?[^/]+\\//u;\nconst DECLARATION = \".d.\";\nconst BIN_LABEL = \"bin\";\n\nexport interface PublicEntry {\n readonly label: string;\n readonly source: string;\n}\n\nexport type EntryManifest = Pick<PackageJson, \"name\" | \"exports\" | \"bin\">;\n\nexport interface EntryLookup {\n readonly manifest: EntryManifest;\n readonly join: (target: string) => string;\n readonly packEntries: readonly PackEntrySource[];\n}\n\nexport const isBinEntry = ({ label }: PublicEntry): boolean =>\n Str.startsWith(`${BIN_LABEL} `)(label);\n\nconst binsOf = (manifest: EntryManifest): readonly (readonly [string, unknown])[] =>\n pipe(\n binEntriesOf(manifest),\n Arr.map(([name, target]) => [`${BIN_LABEL} ${name}`, target] as const),\n );\n\nexport const entryNameOf = (target: string): string =>\n pipe(target, Str.replace(OUT_DIRECTORY, \"\"), Str.replace(BUILT, \"\"));\n\nconst sourceOf =\n ({ join, packEntries }: EntryLookup) =>\n (target: string): Option.Option<string> => {\n if (SOURCE.test(target) && !Str.includes(DECLARATION)(target)) {\n return Option.some(join(target));\n }\n const name = entryNameOf(target);\n return pipe(\n packEntries,\n Arr.findFirst((entry) => entry.name === name),\n Option.map((entry) => entry.source),\n );\n };\n\nexport const publicEntriesOf = (lookup: EntryLookup): readonly PublicEntry[] =>\n pipe(\n [...exportEntriesOf(lookup.manifest.exports), ...binsOf(lookup.manifest)],\n Arr.flatMap(([label, held]) =>\n pipe(\n targetsIn(held),\n Arr.map(sourceOf(lookup)),\n Arr.getSomes,\n Arr.map((source) => ({ label, source })),\n ),\n ),\n Arr.dedupeWith((left, right) => left.label === right.label && left.source === right.source),\n );\n","import { PACKAGE_JSON_FILE } from \"@r_masseater/masseater-utils/kestrion\";\nimport { decodePackageJson } from \"@r_masseater/masseater-utils/kestrion/npm\";\nimport {\n Array as Arr,\n Effect,\n Option,\n Predicate,\n Record as Rec,\n Schema,\n String as Str,\n pipe,\n} from \"effect\";\nimport { resolveConfigFromFile } from \"vite-plus\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst CONFIG_FILE = \"vite.config.ts\";\nconst SEPARATOR = \"/\";\nconst READ_CONCURRENCY = 16;\nconst SOURCE_EXTENSION = /\\.[cm]?tsx?$/u;\nconst BYTE = 1;\nconst KILOBYTE = 1000;\nconst MEGABYTE = 1_000_000;\nconst UNIT_BYTES = [\n [\"B\", BYTE],\n [\"kB\", KILOBYTE],\n [\"MB\", MEGABYTE],\n] as const;\n\nconst SizeText = Schema.TemplateLiteralParser([\n Schema.Finite,\n \" \",\n Schema.Literals([\"B\", \"kB\", \"MB\"]),\n]);\nexport const PackEntry = Schema.Union([\n Schema.String,\n Schema.Array(Schema.String),\n Schema.Record(Schema.String, Schema.String),\n]);\nconst BundledPattern = Schema.Union([Schema.String, Schema.instanceOf(RegExp)]);\nconst AlwaysBundle = Schema.Union([BundledPattern, Schema.Array(BundledPattern)]);\nconst PackDeps = Schema.Struct({ alwaysBundle: Schema.optional(AlwaysBundle) });\nconst PackSettings = Schema.Struct({\n entry: Schema.optional(PackEntry),\n deps: Schema.optional(PackDeps),\n});\nconst PackList = Schema.Union([PackSettings, Schema.Array(PackSettings)]);\nconst isEntryList = Schema.is(Schema.Array(Schema.String));\nconst PackConfig = Schema.Struct({ pack: Schema.optional(PackList) });\nconst BudgetConfig = Schema.Struct({\n msch: Schema.Struct({ publish: Schema.Struct({ installSize: SizeText }) }),\n});\n\nconst taggedError = Schema.TaggedError;\n\nclass WorkspaceConfigUnreadable extends taggedError<\n WorkspaceConfigUnreadable,\n { readonly brand: unique symbol }\n>()(\"WorkspaceConfigUnreadable\", { file: Schema.String }) {}\n\nexport interface PackEntrySource {\n readonly name: string;\n readonly source: string;\n}\n\nexport interface PackedWorkspace {\n readonly directory: string;\n readonly configFile: string;\n readonly packEntries: readonly PackEntrySource[];\n readonly alwaysBundle: readonly (string | RegExp)[];\n}\n\nexport interface PublishedWorkspace extends PackedWorkspace {\n readonly installSize: string;\n readonly installBudget: number;\n}\n\nconst bytesPer = (unit: string): number =>\n pipe(\n UNIT_BYTES,\n Arr.findFirst(([name]) => name === unit),\n Option.map(([, bytes]) => bytes),\n Option.getOrElse(() => Number.NaN),\n );\n\nconst nameOf = (source: string): string =>\n pipe(\n Str.split(source, SEPARATOR),\n Arr.last,\n Option.getOrElse(() => source),\n Str.replace(SOURCE_EXTENSION, \"\"),\n );\n\nexport const entriesOf = (entry: typeof PackEntry.Type): readonly PackEntrySource[] => {\n if (Predicate.isString(entry)) {\n return [{ name: nameOf(entry), source: entry }];\n }\n if (isEntryList(entry)) {\n return pipe(\n entry,\n Arr.map((source) => ({ name: nameOf(source), source })),\n );\n }\n return pipe(\n Rec.toEntries(entry),\n Arr.map(([name, source]) => ({ name, source })),\n );\n};\n\nconst packSettingsOf = (pack: typeof PackConfig.Type.pack): readonly (typeof PackSettings.Type)[] =>\n pipe(\n Option.fromUndefinedOr(pack),\n Option.map(Arr.ensure),\n Option.getOrElse((): readonly (typeof PackSettings.Type)[] => []),\n );\n\nconst packEntriesOf = (pack: typeof PackConfig.Type.pack): readonly PackEntrySource[] =>\n pipe(\n packSettingsOf(pack),\n Arr.flatMap((setting) =>\n pipe(\n Option.fromUndefinedOr(setting.entry),\n Option.match({ onNone: () => [], onSome: entriesOf }),\n ),\n ),\n );\n\nconst alwaysBundleOf = (pack: typeof PackConfig.Type.pack): readonly (string | RegExp)[] =>\n pipe(\n packSettingsOf(pack),\n Arr.flatMap((setting) =>\n pipe(\n Option.fromUndefinedOr(setting.deps),\n Option.flatMap((deps) => Option.fromUndefinedOr(deps.alwaysBundle)),\n Option.map(Arr.ensure),\n Option.getOrElse((): readonly (string | RegExp)[] => []),\n ),\n ),\n Arr.dedupe,\n );\n\nconst settingsIn = Effect.fn(\"settingsIn\")(function* settingsIn(file: string) {\n const config = yield* Effect.tryPromise({\n try: () => resolveConfigFromFile(file),\n catch: () => WorkspaceConfigUnreadable.make({ file }),\n }).pipe(Effect.option);\n return config;\n});\n\nconst isPublicPackage = Effect.fn(\"isPublicPackage\")(function* isPublicPackage(directory: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));\n return pipe(\n text,\n Option.flatMap(decodePackageJson),\n Option.exists((manifest) => manifest.private !== true),\n );\n});\n\nconst packedWorkspaceOf =\n (directory: string, configFile: string, join: (source: string) => string) =>\n ({ pack }: typeof PackConfig.Type): PackedWorkspace => ({\n directory,\n configFile,\n packEntries: pipe(\n packEntriesOf(pack),\n Arr.map((entry) => ({ name: entry.name, source: join(entry.source) })),\n ),\n alwaysBundle: alwaysBundleOf(pack),\n });\n\nconst budgetOf = ({\n msch,\n}: typeof BudgetConfig.Type): Pick<PublishedWorkspace, \"installSize\" | \"installBudget\"> => {\n const [amount, , unit] = msch.publish.installSize;\n return { installSize: `${amount} ${unit}`, installBudget: amount * bytesPer(unit) };\n};\n\nconst packedIn = Effect.fn(\"packedIn\")(function* packedIn(root: string, configName: string) {\n const files = yield* RepositoryFiles;\n const configFile = files.join(root, configName);\n const directory = files.dirname(configFile);\n const isPublic = yield* isPublicPackage(directory);\n if (!isPublic) {\n return Option.none<readonly [PackedWorkspace, unknown]>();\n }\n const config = yield* settingsIn(configFile);\n return pipe(\n config,\n Option.flatMap((found) =>\n pipe(\n Schema.decodeUnknownOption(PackConfig)(found),\n Option.map(\n packedWorkspaceOf(directory, configFile, (source) => files.join(directory, source)),\n ),\n Option.map((workspace) => [workspace, found] as const),\n ),\n ),\n );\n});\n\n/** @internal */\nexport const workspaceConfigs = Effect.fn(\"workspaceConfigs\")(function* workspaceConfigs(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const names = yield* files.listedFiles(root);\n return pipe(\n names,\n Arr.filter((name) => files.basename(name) === CONFIG_FILE && Str.includes(SEPARATOR)(name)),\n );\n});\n\nconst packedPairs = Effect.fn(\"packedPairs\")(function* packedPairs(root: string) {\n const configs = yield* workspaceConfigs(root);\n const found = yield* Effect.forEach(configs, (name) => packedIn(root, name), {\n concurrency: READ_CONCURRENCY,\n });\n return Arr.getSomes(found);\n});\n\n/** @internal */\nexport const packedWorkspaces = Effect.fn(\"packedWorkspaces\")(function* packedWorkspaces(\n root: string,\n) {\n const pairs = yield* packedPairs(root);\n return pipe(\n pairs,\n Arr.map(([workspace]) => workspace),\n );\n});\n\n/** @internal */\nexport const publishedWorkspaces = Effect.fn(\"publishedWorkspaces\")(function* publishedWorkspaces(\n root: string,\n) {\n const pairs = yield* packedPairs(root);\n return pipe(\n pairs,\n Arr.flatMap(([workspace, config]) =>\n pipe(\n Schema.decodeUnknownOption(BudgetConfig)(config),\n Option.map((budget): PublishedWorkspace => ({ ...workspace, ...budgetOf(budget) })),\n Option.toArray,\n ),\n ),\n );\n});\n"],"mappings":";;;;;;;;;AAEA,MAAMA,cAAY;AAClB,MAAM,WAAW;AACjB,MAAM,WAAW;AAEjB,MAAa,mBAAmB,WAA2B;CACzD,IAAIC,OAAI,WAAW,QAAQ,CAAC,CAAC,MAAM,GACjC,OAAOA,OAAI,MAAM,CAAe,CAAC,CAAC,MAAM;CAE1C,OAAO;AACT;AAEA,MAAa,YACV,eACA,YAA4B;CAC3B,IAAIA,OAAI,WAAW,QAAQ,CAAC,CAAC,OAAO,GAClC,OAAO,GAAG,WAAW,YAAYD,cAAYC,OAAI,MAAM,CAAe,CAAC,CAAC,OAAO;CAEjF,OAAO,GAAG,YAAYD,cAAY,gBAAgB,OAAO;AAC3D;;ACZF,MAAM,cAAc;AACpB,MAAM,WAAW;AACjB,MAAM,aAAa;AAEnB,MAAM,eAAe,OAAO,OAAO,EAAE,SAAS,OAAO,OAAO,EAAE,IAAI,OAAO,OAAO,CAAC,EAAE,CAAC;AACpF,MAAM,gBAAgB,OAAO,oBAAoB,OAAO,OAAO,OAAO,QAAQ,OAAO,MAAM,CAAC;AAC5F,MAAM,qBAAqB,OA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M,eAAeC,OAAI,SAAS,SAAS,CAAC,CAAC,IAAI,CAAC,CAC5F;AACF,CAAC;AAED,MAAM,cAAc,OAAO,GAAG,aAAa,CAAC,CAAC,UAAU,YAAY,MAAc;CAC/E,MAAM,UAAU,OAAO,iBAAiB,IAAI;CAC5C,MAAM,QAAQ,OAAO,OAAO,QAAQ,UAAU,SAAS,SAAS,MAAM,IAAI,GAAG,EAC3E,aAAa,iBACf,CAAC;CACD,OAAOD,MAAI,SAAS,KAAK;AAC3B,CAAC;;AAGD,MAAa,mBAAmB,OAAO,GAAG,kBAAkB,CAAC,CAAC,UAAU,iBACtE,MACA;CACA,MAAM,QAAQ,OAAO,YAAY,IAAI;CACrC,OAAO,KACL,OACAA,MAAI,KAAK,CAAC,eAAe,SAAS,CACpC;AACF,CAAC;;AAGD,MAAa,sBAAsB,OAAO,GAAG,qBAAqB,CAAC,CAAC,UAAU,oBAC5E,MACA;CACA,MAAM,QAAQ,OAAO,YAAY,IAAI;CACrC,OAAO,KACL,OACAA,MAAI,SAAS,CAAC,WAAW,YACvB,KACE,OAAO,oBAAoB,YAAY,CAAC,CAAC,MAAM,GAC/C,OAAO,KAAK,YAAgC;EAAE,GAAG;EAAW,GAAG,SAAS,MAAM;CAAE,EAAE,GAClF,OAAO,OACT,CACF,CACF;AACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repository-config-8JN86BZA.mjs","names":["Arr","Str","SEPARATOR","Arr","Str","Arr","MESSAGE","Arr","MESSAGE","MESSAGE","SEPARATOR","FILTER_KEYS","QUOTED","Arr","Str","filtersOf","SEPARATOR","Arr","Str","MESSAGE","Arr","Arr","Str","MESSAGE","Arr","Str","Arr","Rec","Arr","Rec","Arr","Rec","Rec","Arr","preset","Arr"],"sources":["../src/entities/workspace/model/workspace-names.ts","../src/shared/lib/path-existence.ts","../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-tasks.ts","../src/app/repository-text.ts","../src/app/repository-config.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 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 type { GitHooksSection } from \"@r_masseater/vite-plus-adopt\";\nimport { 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\nexport type { GitHooksSection } from \"@r_masseater/vite-plus-adopt\";\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 --no-error-on-unmatched-pattern`;\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\nconst REINSTALL = \"vp install\";\n\nexport const GIT_HOOKS = {\n \"pre-commit\": [\"vp staged\", \"vp exec msch --staged\"],\n \"commit-msg\": ['vp exec msch --commit-msg \"$1\"'],\n \"pre-push\": [\"vp exec msch --pre-push\", \"vp run verify\"],\n \"post-checkout\": [`[ \"$3\" = 0 ] || ${REINSTALL}`],\n \"post-merge\": [REINSTALL],\n \"post-rewrite\": [REINSTALL],\n} as const satisfies GitHooksSection;\n\nexport const gitHooksOf = (hooks: GitHooksSection = {}): GitHooksSection => ({\n ...GIT_HOOKS,\n ...hooks,\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 filtersOf = (properNouns: readonly string[]): Readonly<Record<string, object | boolean>> => ({\n comments: true,\n \"node-types\": { nodeTypes: [\"BlockQuote\"] },\n allowlist: { allow: [QUOTATION, ...properNouns] },\n});\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 = (style: Style): 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 },\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(\"である\") };\n const filters = filtersOf(properNouns);\n const articleSources = Arr.filter(\n [\n {\n files: [...articles],\n plugins: { [ZENN_MARKDOWN]: true },\n rules: { ...rules, ...builtRules(\"ですます\") },\n 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,\n })),\n Arr.appendAll(articleSources),\n ),\n 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","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 { gitHooksOf, tasksOf } from \"./repository-tasks.ts\";\nimport type { CargoInputs, GitHooksSection, 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\";\nexport { GIT_HOOKS } from \"./repository-tasks.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 readonly gitHooks?: GitHooksSection;\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\nexport const COMMIT_LINT = { extends: [COMMIT_CONVENTION] };\n\nexport const STAGED = { \"*\": \"vp fmt --no-error-on-unmatched-pattern\" };\n\nexport const FORMAT = {\n ignorePatterns: exempt,\n sortImports: true,\n sortTailwindcss: true,\n sortPackageJson: true,\n};\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, gitHooks } = options;\n return {\n commitlint: COMMIT_LINT,\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: STAGED,\n gitHooks: gitHooksOf(gitHooks),\n fmt: FORMAT,\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":";;;;;;;;;;;;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,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