@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/dist/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as COMMIT_LINT, n as FORMAT, l as GIT_HOOKS,
|
|
1
|
+
export { t as COMMIT_LINT, n as FORMAT, l as GIT_HOOKS, m as PLUGIN_DEPENDENCIES, r as STAGED, i as repositoryConfig, s as secretsOf } from "./repository-config-DGEG2Ew6.mjs";
|
|
@@ -135,9 +135,8 @@ const splitFrontmatter = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(
|
|
|
135
135
|
body: String.slice(found[START].length)(source)
|
|
136
136
|
})))));
|
|
137
137
|
// src/shared/lib/index-skill.ts
|
|
138
|
-
const INDEX_ROLE = "index";
|
|
139
138
|
/** @internal */
|
|
140
|
-
const
|
|
139
|
+
const INDEX_SKILL = /(?:^|\/)plugins\/(?<plugin>[^/]+)\/skills\/\k<plugin>\/SKILL\.md$/u;
|
|
141
140
|
// src/entities/workspace/model/mod-directories.ts
|
|
142
141
|
const HOOKS_FILE = "hooks/hooks.json";
|
|
143
142
|
const Modules = Schema.String.pipe(Schema.Array, Schema.optional);
|
|
@@ -295,6 +294,6 @@ const publishedWorkspaces = Effect.fn("publishedWorkspaces")(function* published
|
|
|
295
294
|
...budgetOf(budget)
|
|
296
295
|
})), Option.toArray)));
|
|
297
296
|
});
|
|
298
|
-
export { shadcnUiIn as _, workspaceConfigs as a, publicEntriesOf as c, FRONTMATTER as d, splitFrontmatter as f, deployEntries as g, bundledEntries as h, publishedWorkspaces as i, modDirectories as l, workspaceLinks as m, entriesOf as n, entryNameOf as o, linkedPaths as p, packedWorkspaces as r, isBinEntry as s, PackEntry as t,
|
|
297
|
+
export { shadcnUiIn as _, workspaceConfigs as a, publicEntriesOf as c, FRONTMATTER as d, splitFrontmatter as f, deployEntries as g, bundledEntries as h, publishedWorkspaces as i, modDirectories as l, workspaceLinks as m, entriesOf as n, entryNameOf as o, linkedPaths as p, packedWorkspaces as r, isBinEntry as s, PackEntry as t, INDEX_SKILL as u, shadcnUiOf as v, prefixed as y };
|
|
299
298
|
|
|
300
|
-
//# sourceMappingURL=published-
|
|
299
|
+
//# sourceMappingURL=published-BbAu-6IS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"published-BbAu-6IS.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","/** @internal */\nexport const INDEX_SKILL = /(?:^|\\/)plugins\\/(?<plugin>[^/]+)\\/skills\\/\\k<plugin>\\/SKILL\\.md$/u;\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,WAA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AAQ,OAAO,MAAM,YAAY,IAAI;CAC3C,OAAO,KACL,OACAA,MAAI,QAAQ,SAAS,MAAM,SAAS,IAAI,MAAM,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"}
|
|
@@ -8,6 +8,7 @@ import { a as nodeServicesLayer, i as nodeRepositoryFiles, r as RepositoryFiles,
|
|
|
8
8
|
import { c as TASK_NAMES, i as workspaceProjects } from "./workspace-projects-eapoa0az.mjs";
|
|
9
9
|
import { RUNTIME_SECTIONS } from "@r_masseater/masseater-utils/kestrion";
|
|
10
10
|
import { i as USAGE_SPOOL } from "./config-B3SYjao5.mjs";
|
|
11
|
+
import manifest from "@r_masseater/mdlct/package.json" with { type: "json" };
|
|
11
12
|
import { betterleaks } from "@r_masseater/h56m/presets";
|
|
12
13
|
// src/entities/workspace/model/workspace-names.ts
|
|
13
14
|
const ALTERNATIVE = "|";
|
|
@@ -481,6 +482,9 @@ const dependencyRulesOf = (workspace) => ({
|
|
|
481
482
|
exactDependencies: { [PLUGIN_DEPENDENCIES]: workspace.plugins },
|
|
482
483
|
peerRanges: "intersect"
|
|
483
484
|
});
|
|
485
|
+
// src/shared/lib/mdlct.ts
|
|
486
|
+
/** @internal */
|
|
487
|
+
const MDLCT_BIN = fileURLToPath(new URL(manifest.bin.mdlct, import.meta.resolve("@r_masseater/mdlct/package.json")));
|
|
484
488
|
// src/app/repository-tasks.ts
|
|
485
489
|
const NOT_INPUTS = [
|
|
486
490
|
"!node_modules/.pnpm-store",
|
|
@@ -514,6 +518,7 @@ const FALLOW = pipe([
|
|
|
514
518
|
], Array.map((args) => `FALLOW_TYPE_AWARE_BACKEND=tsrs fallow ${args}`));
|
|
515
519
|
const CHECK = `TSRS_LINT_RUN_EXTERNAL_CODE=1 msch changed --batch-sources ${String(1e3)} -- vp check --deny-warnings --continue-on-error --no-error-on-unmatched-pattern`;
|
|
516
520
|
const COMPAT = "msch changed -- msch publish compat-changed";
|
|
521
|
+
const SKILLS = `node ${MDLCT_BIN} check`;
|
|
517
522
|
const AUDIT = Array.join([
|
|
518
523
|
"copy=\"$(mktemp -d)\"",
|
|
519
524
|
`trap 'rm -rf "$copy"' EXIT`,
|
|
@@ -550,7 +555,8 @@ const MSCH_VERIFY_COMMANDS = {
|
|
|
550
555
|
msch: "msch",
|
|
551
556
|
audit: AUDIT,
|
|
552
557
|
published: "msch published",
|
|
553
|
-
compat: COMPAT
|
|
558
|
+
compat: COMPAT,
|
|
559
|
+
skills: SKILLS
|
|
554
560
|
};
|
|
555
561
|
const MSCH_TASK_COMMANDS = {
|
|
556
562
|
...MSCH_VERIFY_COMMANDS,
|
|
@@ -613,6 +619,13 @@ const tasksOf = ({ workspace, commands, usage, cargo }) => {
|
|
|
613
619
|
command: AUDIT,
|
|
614
620
|
cache: false
|
|
615
621
|
},
|
|
622
|
+
skills: {
|
|
623
|
+
command: SKILLS,
|
|
624
|
+
cache: {
|
|
625
|
+
input: inputs,
|
|
626
|
+
output: []
|
|
627
|
+
}
|
|
628
|
+
},
|
|
616
629
|
published: {
|
|
617
630
|
command: MSCH_TASK_COMMANDS.published,
|
|
618
631
|
cache: false
|
|
@@ -829,6 +842,6 @@ const repositoryConfig = (options) => {
|
|
|
829
842
|
}
|
|
830
843
|
};
|
|
831
844
|
};
|
|
832
|
-
export {
|
|
845
|
+
export { isIgnored as _, TEXT_IGNORES as a, CI_TASKS as c, MSCH_VERIFY_COMMANDS as d, meteredCommand as f, existsAt as g, fu4Of as h, repositoryConfig as i, GIT_HOOKS as l, PLUGIN_DEPENDENCIES as m, FORMAT as n, builtTextRuleNames as o, MDLCT_BIN as p, STAGED as r, secretsOf as s, COMMIT_LINT as t, MSCH_TASK_COMMANDS as u, namedWorkspaces as v, patternOf as y };
|
|
833
846
|
|
|
834
|
-
//# sourceMappingURL=repository-config-
|
|
847
|
+
//# sourceMappingURL=repository-config-DGEG2Ew6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-config-DGEG2Ew6.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/shared/lib/mdlct.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 { fileURLToPath } from \"node:url\";\n\nimport manifest from \"@r_masseater/mdlct/package.json\" with { type: \"json\" };\n\n/** @internal */\nexport const MDLCT_BIN = fileURLToPath(\n new URL(manifest.bin.mdlct, import.meta.resolve(\"@r_masseater/mdlct/package.json\")),\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\";\nimport { MDLCT_BIN } from \"#/shared/lib/mdlct.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 SKILLS = `node ${MDLCT_BIN} check`;\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 skills: SKILLS,\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 skills: { command: SKILLS, cache: { input: inputs, output: [] } },\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;C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,WAAW,CAAC,GAAG,MAAM,CAAC,GAAG,OAAO,OAAO,aAAa;CACtF,OAAO;EACL,YAAY;EACZ,iBAAiB,kBAAkB,SAAS;EAC5C,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;EACR,UAAU,WAAW,QAAQ;EAC7B,KAAK;EACL,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,6 +1,6 @@
|
|
|
1
1
|
import { Array, Effect, Option, Order, Predicate, Record, Schema, String, pipe } from "effect";
|
|
2
2
|
import { r as readManifest } from "./dependencies-Bjn3xWkq.mjs";
|
|
3
|
-
import { _ as shadcnUiIn, c as publicEntriesOf, f as splitFrontmatter, g as deployEntries, l as modDirectories, n as entriesOf, p as linkedPaths, t as PackEntry, u as
|
|
3
|
+
import { _ as shadcnUiIn, c as publicEntriesOf, f as splitFrontmatter, g as deployEntries, l as modDirectories, n as entriesOf, p as linkedPaths, t as PackEntry, u as INDEX_SKILL, y as prefixed } from "./published-BbAu-6IS.mjs";
|
|
4
4
|
import { i as nodeRepositoryFiles, r as RepositoryFiles } from "./repository-files-C_GzAnYp.mjs";
|
|
5
5
|
import { E as nestedValues, T as literalOf, _ as merged, b as usedFrom, g as literalSettings, h as testsItself, i as workspaceProjects, m as tasksOf, o as NO_TASKS, r as workspaceDirectories, v as programOf, y as settingsInvalid } from "./workspace-projects-eapoa0az.mjs";
|
|
6
6
|
import { n as FINGERPRINT_FILE, r as LOCK_FILE, t as CLOSURE_FILE } from "./locked-closure-paths-_N_97Dbp.mjs";
|
|
@@ -127,7 +127,7 @@ const skillFiles = Effect.fn("skillFiles")(function* skillFiles(root) {
|
|
|
127
127
|
const indexNameAt = Effect.fn("indexNameAt")(function* indexNameAt(root, file) {
|
|
128
128
|
const files = yield* RepositoryFiles;
|
|
129
129
|
const source = yield* files.readFile(files.join(root, file));
|
|
130
|
-
return pipe(source, Option.
|
|
130
|
+
return pipe(source, Option.filter(() => INDEX_SKILL.test(file)), Option.flatMap(splitFrontmatter), Option.flatMap(nameOf));
|
|
131
131
|
});
|
|
132
132
|
const indexSkillIn = Effect.fn("indexSkillIn")(function* indexSkillIn(root) {
|
|
133
133
|
const found = yield* skillFiles(root);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-settings.mjs","names":["READ_CONCURRENCY","Arr","READ_CONCURRENCY","Arr","Rec","Arr","Str","Str","Arr","Rec","READ_CONCURRENCY","Arr","Names","Arr","Rec","Arr","Arr","Arr"],"sources":["../src/entities/workspace/model/structure-members.ts","../src/entities/workspace/model/site-entries.ts","../src/entities/workspace/model/locked-closures.ts","../src/entities/workspace/model/locked-closure-files.ts","../src/entities/workspace/model/index-skill.ts","../src/shared/lib/added-rules.ts","../src/features/build-workspace-settings/model/dependency-allowances.ts","../src/features/build-workspace-settings/model/test-project.ts","../src/features/build-workspace-settings/model/workspace-public-entries.ts","../src/features/build-workspace-settings/model/workspace-settings.ts"],"sourcesContent":["import { Array as Arr, Effect, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { workspaceProjects } from \"./workspace-projects.ts\";\n\nconst ROOT_WORKSPACE = \".\";\nconst PLUGIN_MANIFEST = \".claude-plugin/plugin.json\";\nconst READ_CONCURRENCY = 16;\n\nconst isPlugin = Effect.fn(\"isPlugin\")(function* isPlugin(root: string, directory: string) {\n const files = yield* RepositoryFiles;\n return yield* files.exists(files.join(root, directory, PLUGIN_MANIFEST));\n});\n\nexport const pluginWorkspaces = Effect.fn(\"pluginWorkspaces\")(function* pluginWorkspaces(\n root: string,\n directories: readonly string[],\n) {\n return yield* Effect.filter(directories, (directory) => isPlugin(root, directory), {\n concurrency: READ_CONCURRENCY,\n });\n});\n\nexport const sourcePlugins = Effect.fn(\"sourcePlugins\")(function* sourcePlugins(\n root: string,\n directories: readonly string[],\n) {\n const plugins = yield* pluginWorkspaces(root, directories);\n const projects = yield* workspaceProjects(root);\n const published = pipe(\n projects,\n Arr.filter((project) => project.published),\n Arr.map(({ directory }) => directory),\n );\n return pipe(\n plugins,\n Arr.filter((directory) => !Arr.contains(published, directory)),\n );\n});\n\nexport const structureMembers = Effect.fn(\"structureMembers\")(function* structureMembers(\n root: string,\n directories: readonly string[],\n) {\n const plugins = yield* pluginWorkspaces(root, directories);\n return pipe(\n directories,\n Arr.filter((directory) => directory !== ROOT_WORKSPACE && !Arr.contains(plugins, directory)),\n );\n});\n","import { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst READ_CONCURRENCY = 16;\nconst SCRIPT = /\\.[cm]?tsx?$/u;\nconst SKIPPED = /\\.test\\.|\\.d\\.[cm]?ts$/u;\nconst SERVER_ENTRY_IMPORT = /from\\s+[\"']@effect\\/ui\\/html\\/HtmlServerHttp[\"']/u;\n\nexport const siteEntries = Effect.fn(\"siteEntries\")(function* siteEntries(root: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.listedFiles(root);\n const candidates = pipe(\n listed,\n Arr.filter((file) => SCRIPT.test(file) && !SKIPPED.test(file)),\n );\n const texts = yield* Effect.forEach(\n candidates,\n (file) => files.readFile(files.join(root, file)),\n { concurrency: READ_CONCURRENCY },\n );\n return pipe(\n Arr.zip(candidates, texts),\n Arr.filter(([, text]) => Option.exists(text, (value) => SERVER_ENTRY_IMPORT.test(value))),\n Arr.map(([file]) => file),\n );\n});\n","import { depPathsOf, 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 { reachable } from \"#/shared/lib/reachable.ts\";\nimport type { Edges } from \"#/shared/lib/reachable.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { linkedPaths } from \"./locked-links.ts\";\n\ntype LockedClosures = Readonly<Record<string, readonly string[]>>;\n\nconst IMPORTER = \"importer:\";\nconst ROOT_IMPORTER = \".\";\n\ntype Sections = readonly (ResolvedDependencies | undefined)[];\ntype Edge = readonly [string, readonly string[]];\n\ninterface Used {\n readonly dependencies?: ResolvedDependencies | undefined;\n readonly optionalDependencies?: ResolvedDependencies | undefined;\n}\n\ninterface Importer {\n readonly id: string;\n readonly own: readonly string[];\n readonly used: readonly string[];\n}\n\nconst usedSections = ({ dependencies, optionalDependencies }: Used): Sections => [\n dependencies,\n optionalDependencies,\n];\n\nconst packageEdges = <Package extends string>(\n packages: Readonly<Record<Package, Used>>,\n): readonly Edge[] =>\n pipe(\n Rec.toEntries(packages),\n Arr.map(([id, snapshot]): Edge => [id, pipe(usedSections(snapshot), Arr.flatMap(depPathsOf))]),\n );\n\nconst closureOf =\n (edges: Edges) =>\n ({ own }: Importer): readonly string[] => {\n const packages = pipe(\n reachable(edges, own),\n Arr.filter((id) => !Str.startsWith(IMPORTER)(id)),\n );\n return Arr.sort(packages, Str.Order);\n };\n\n/** @internal */\nexport const lockedClosures = Effect.fn(\"lockedClosures\")(function* lockedClosures(root: string) {\n const files = yield* RepositoryFiles;\n const lockfile = yield* readWantedLockfile(root);\n const nodesOf = (id: string, sections: Sections): readonly string[] => [\n ...pipe(sections, Arr.flatMap(depPathsOf)),\n ...pipe(\n linkedPaths(sections),\n Arr.map((path) => files.relative(root, files.join(root, id, path))),\n Arr.map(\n (linked) =>\n `${IMPORTER}${Option.getOrElse(Option.liftPredicate(linked, Str.isNonEmpty), () => ROOT_IMPORTER)}`,\n ),\n ),\n ];\n return pipe(\n lockfile,\n Option.map(({ importers, packages }): LockedClosures => {\n const found = pipe(\n Rec.toEntries(importers),\n Arr.map(([id, project]): Importer => {\n const used = usedSections(project);\n return {\n id,\n own: nodesOf(id, [...used, project.devDependencies]),\n used: nodesOf(id, used),\n };\n }),\n );\n const edges = Rec.fromEntries([\n ...pipe(\n found,\n Arr.map(({ id, used }): Edge => [`${IMPORTER}${id}`, used]),\n ),\n ...packageEdges(packages ?? {}),\n ]);\n return Rec.fromEntries(\n pipe(\n found,\n Arr.map((importer) => [importer.id, closureOf(edges)(importer)] as const),\n ),\n );\n }),\n );\n});\n","import { Array as Arr, Effect, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { CLOSURE_FILE, FINGERPRINT_FILE, LOCK_FILE } from \"#/shared/lib/locked-closure-paths.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { lockedClosures } from \"./locked-closures.ts\";\n\nconst LINE = \"\\n\";\nconst FILE_CONCURRENCY = 16;\n\nconst writeChanged = Effect.fn(\"writeChanged\")(function* writeChanged(file: string, text: string) {\n const files = yield* RepositoryFiles;\n const written = yield* files.readFile(file);\n if (!Option.exists(written, (found) => found === text)) {\n yield* files.writeFile(file, text);\n }\n});\n\nconst isWritten = Effect.fn(\"isWritten\")(function* isWritten(root: string, fingerprint: string) {\n const files = yield* RepositoryFiles;\n const recorded = yield* files.readFile(files.join(root, FINGERPRINT_FILE));\n const [hash, ...importers] = Str.split(\n Option.getOrElse(recorded, () => \"\"),\n LINE,\n );\n if (hash !== fingerprint) {\n return false;\n }\n const present = yield* Effect.forEach(\n importers,\n (importer) => files.exists(files.join(root, importer, CLOSURE_FILE)),\n { concurrency: FILE_CONCURRENCY },\n );\n return pipe(present, Arr.every(Boolean));\n});\n\nconst writeAll = Effect.fn(\"writeAll\")(function* writeAll(root: string, fingerprint: string) {\n const files = yield* RepositoryFiles;\n const closures = yield* lockedClosures(root);\n const entries = Rec.toEntries(Option.getOrElse(closures, () => ({})));\n yield* Effect.forEach(\n entries,\n ([importer, closure]) =>\n writeChanged(files.join(root, importer, CLOSURE_FILE), Arr.join(closure, LINE)),\n { concurrency: FILE_CONCURRENCY, discard: true },\n );\n const importers = pipe(\n entries,\n Arr.map(([importer]) => importer),\n );\n yield* files.writeFile(\n files.join(root, FINGERPRINT_FILE),\n Arr.join([fingerprint, ...importers], LINE),\n );\n});\n\n/** @internal */\nexport const writeLockedClosures = Effect.fn(\"writeLockedClosures\")(function* writeLockedClosures(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const fingerprint = yield* files.hashFile(files.join(root, LOCK_FILE));\n if (Option.isNone(fingerprint)) {\n return;\n }\n const written = yield* isWritten(root, fingerprint.value);\n if (!written) {\n yield* writeAll(root, fingerprint.value);\n }\n});\n","import { Array as Arr, Effect, Option, Order, Predicate, pipe } from \"effect\";\n\nimport { splitFrontmatter } from \"#/shared/lib/frontmatter.ts\";\nimport type { Frontmatter } from \"#/shared/lib/frontmatter.ts\";\nimport { isIndexSkill } from \"#/shared/lib/index-skill.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst SKILL_DIRECTORIES = [\".agents/skills\", \".claude/skills\", \"skills\"];\nconst PLUGINS = \"plugins\";\nconst SKILLS = \"skills\";\nconst SKILL_FILE = \"SKILL.md\";\nconst READ_CONCURRENCY = 16;\n\nconst nameOf = ({ fields }: Frontmatter): Option.Option<string> =>\n Option.filter(Option.fromNullishOr(fields[\"name\"]), Predicate.isString);\n\nconst skillDirectories = Effect.fn(\"skillDirectories\")(function* skillDirectories(root: string) {\n const files = yield* RepositoryFiles;\n const plugins = yield* files.readDirectory(files.join(root, PLUGINS));\n return [\n ...SKILL_DIRECTORIES,\n ...pipe(\n plugins,\n Arr.map((plugin) => files.join(PLUGINS, plugin, SKILLS)),\n ),\n ];\n});\n\nconst skillFiles = Effect.fn(\"skillFiles\")(function* skillFiles(root: string) {\n const files = yield* RepositoryFiles;\n const directories = yield* skillDirectories(root);\n const found = yield* Effect.forEach(\n directories,\n (directory) =>\n files\n .readDirectory(files.join(root, directory))\n .pipe(Effect.map(Arr.map((name) => files.join(directory, name, SKILL_FILE)))),\n { concurrency: READ_CONCURRENCY },\n );\n return pipe(Arr.flatten(found), Arr.sortBy(Order.String));\n});\n\nconst indexNameAt = Effect.fn(\"indexNameAt\")(function* indexNameAt(root: string, file: string) {\n const files = yield* RepositoryFiles;\n const source = yield* files.readFile(files.join(root, file));\n return pipe(\n source,\n Option.flatMap(splitFrontmatter),\n Option.filter(isIndexSkill),\n Option.flatMap(nameOf),\n );\n});\n\nexport const indexSkillIn = Effect.fn(\"indexSkillIn\")(function* indexSkillIn(root: string) {\n const found = yield* skillFiles(root);\n const names = yield* Effect.forEach(found, (file) => indexNameAt(root, file), {\n concurrency: READ_CONCURRENCY,\n });\n return Arr.head(Arr.getSomes(names));\n});\n","import { Schema } from \"effect\";\n\nconst Enabled = Schema.Literals([\"error\", \"deny\"]);\n\nconst EnabledWithOptions = Schema.mutable(\n Schema.TupleWithRest(Schema.Tuple([Enabled]), [Schema.Unknown]),\n);\n\nconst AddedRule = Schema.Union([Enabled, EnabledWithOptions]);\n\nexport const AddedRules = Schema.Record(Schema.String, AddedRule);\n\nexport type AddedRulesValue = typeof AddedRules.Type;\n","import { Array as Arr, Effect, Option, Record as Rec, Schema } from \"effect\";\n\nimport { literalSettings, usedFrom } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource } from \"#/entities/workspace/index.ts\";\n\nexport type DependencySets = Readonly<Record<string, readonly string[]>>;\n\nexport interface DependencyAllowance {\n readonly workspaces: readonly string[];\n readonly dependencies: readonly string[];\n}\n\nexport type DependencyAllowances = Readonly<Record<string, DependencyAllowance>>;\n\nexport const MSCH_DEV_DEPENDENCIES = [\"msch\", \"devDependencies\"] as const;\nexport const MSCH_DEPENDENCIES = [\"msch\", \"dependencies\"] as const;\n\nconst Names = Schema.String.pipe(Schema.Array, Schema.optional);\nconst DependencySettings = Schema.Struct({ use: Names, dependencies: Names });\nconst WorkspaceDependencyAllowances = Schema.Record(Schema.String, DependencySettings);\n\nconst allowanceOf = Effect.fn(\"allowanceOf\")(function* allowanceOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n [reason, allowance]: readonly [string, typeof DependencySettings.Type],\n) {\n const sets = yield* usedFrom(source.file, dependencySets, allowance.use ?? []);\n const dependencies = [...Arr.flatten(sets), ...(allowance.dependencies ?? [])];\n return [\n `${source.directory}: ${reason}`,\n { workspaces: [source.directory], dependencies },\n ] as const;\n});\n\nexport const allowancesOf = Effect.fn(\"allowancesOf\")(function* allowancesOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n path: typeof MSCH_DEV_DEPENDENCIES | typeof MSCH_DEPENDENCIES,\n) {\n const settings = yield* literalSettings({\n source,\n path,\n decode: Schema.decodeUnknownEffect(WorkspaceDependencyAllowances),\n });\n const allowed = Rec.toEntries(Option.getOrElse(settings, () => ({})));\n const entries = yield* Effect.forEach(\n allowed,\n (entry) => allowanceOf(source, dependencySets, entry),\n { concurrency: 1 },\n );\n return Rec.fromEntries(entries);\n});\n","import type { PackageJson } from \"@r_masseater/masseater-utils/kestrion\";\nimport { Array as Arr, Effect, Option, Predicate, Schema, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport { literalSettings, modDirectories } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource } from \"#/entities/workspace/index.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst TEST_ISOLATION = [\"test\", \"isolate\"] as const;\n\nexport interface SharedTestProject {\n readonly extends: string | false;\n readonly root: string;\n readonly test: {\n readonly name: string;\n readonly isolate: false;\n readonly exclude?: readonly string[];\n };\n}\n\nexport type TestProject = string | SharedTestProject;\n\nexport interface ProjectPlace {\n readonly directory: string;\n readonly config: string | false;\n readonly mods: readonly string[];\n}\n\nconst DEFAULT_EXCLUDE = [\"**/node_modules/**\", \"**/.git/**\"];\n\nconst excludeOf = (mods: readonly string[]): { readonly exclude?: readonly string[] } =>\n pipe(\n mods,\n Option.liftPredicate(Arr.isReadonlyArrayNonEmpty),\n Option.match({\n onNone: () => ({}),\n onSome: (directories) => ({\n exclude: [\n ...DEFAULT_EXCLUDE,\n ...pipe(\n directories,\n Arr.map((directory) => `${directory}**/*.test.{ts,tsx}`),\n ),\n ],\n }),\n }),\n );\n\nexport const sharedTestProject =\n (manifest: Option.Option<PackageJson>) =>\n ({ directory, config, mods }: ProjectPlace): TestProject => ({\n extends: config,\n root: directory,\n test: {\n name: pipe(\n manifest,\n Option.flatMap(({ name }) => Option.fromUndefinedOr(name)),\n Option.getOrElse(() => directory),\n ),\n isolate: false,\n ...excludeOf(mods),\n },\n });\n\nexport const testProjectOf = Effect.fn(\"testProjectOf\")(function* testProjectOf(\n source: WorkspaceSource,\n config: string,\n manifest: Option.Option<PackageJson>,\n) {\n const isolated = yield* literalSettings({\n source,\n path: TEST_ISOLATION,\n decode: Schema.decodeUnknownEffect(Schema.Boolean),\n });\n if (Option.getOrElse(isolated, () => false)) {\n return source.directory;\n }\n const files = yield* RepositoryFiles;\n const mods = yield* modDirectories(files.dirname(source.file));\n return sharedTestProject(manifest)({ directory: source.directory, config, mods });\n});\n\nexport type VitestProject = NonNullable<NonNullable<UserConfig[\"test\"]>[\"projects\"]>[number];\n\nconst excludeCopy = (exclude: readonly string[] | undefined): { exclude?: string[] } =>\n pipe(\n Option.fromUndefinedOr(exclude),\n Option.match({ onNone: () => ({}), onSome: (patterns) => ({ exclude: [...patterns] }) }),\n );\n\n/** @internal */\nexport const vitestProjectOf = (project: TestProject): VitestProject => {\n if (Predicate.isString(project)) {\n return project;\n }\n const { name, isolate, exclude } = project.test;\n return {\n extends: project.extends,\n root: project.root,\n test: { name, isolate, ...excludeCopy(exclude) },\n };\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, Schema, pipe } from \"effect\";\n\nimport { entriesOf, PackEntry, publicEntriesOf } from \"#/entities/package/index.ts\";\nimport type { EntryManifest, PackEntrySource } from \"#/entities/package/index.ts\";\nimport { literalOf, nestedValues } from \"#/entities/workspace/index.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst PACK_ENTRY = [\"pack\", \"entry\"] as const;\n\nconst decodePackEntry = Schema.decodeUnknownOption(PackEntry);\n\nconst packEntriesIn = (program: unknown): readonly PackEntrySource[] =>\n pipe(\n nestedValues(PACK_ENTRY)(program),\n Arr.flatMap((node) =>\n pipe(\n literalOf(node),\n Option.flatMap(decodePackEntry),\n Option.toArray,\n Arr.flatMap(entriesOf),\n ),\n ),\n );\n\ninterface EntryFilesRequest {\n readonly join: (target: string) => string;\n readonly packEntries: readonly PackEntrySource[];\n}\n\nconst entryFilesOf =\n ({ join, packEntries }: EntryFilesRequest) =>\n (manifest: EntryManifest): readonly string[] => {\n const joined = pipe(\n packEntries,\n Arr.map((entry) => ({ name: entry.name, source: join(entry.source) })),\n );\n return pipe(\n publicEntriesOf({ manifest, join, packEntries: joined }),\n Arr.map(({ source }) => source),\n Arr.dedupe,\n );\n };\n\nexport const publicEntryFiles = Effect.fn(\"publicEntryFiles\")(function* publicEntryFiles(\n root: string,\n directory: string,\n config: Option.Option<unknown>,\n) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, directory, PACKAGE_JSON_FILE));\n const packEntries = pipe(\n config,\n Option.map(packEntriesIn),\n Option.getOrElse(() => []),\n );\n const join = (target: string): string => files.join(directory, target);\n return pipe(\n text,\n Option.flatMap(decodePackageJson),\n Option.map(entryFilesOf({ join, packEntries })),\n Option.getOrElse((): readonly string[] => []),\n );\n});\n","import { Array as Arr, Effect, Option, Schema, pipe } from \"effect\";\nimport type { OxlintOverride } from \"vite-plus/lint\";\n\nimport { readManifest } from \"#/entities/package/index.ts\";\nimport {\n deployEntries,\n indexSkillIn,\n literalSettings,\n modDirectories,\n merged,\n sourcePlugins,\n programOf,\n settingsInvalid,\n siteEntries,\n structureMembers,\n usedFrom,\n workspaceDirectories,\n writeLockedClosures,\n prefixed,\n shadcnUiIn,\n NO_TASKS,\n tasksOf,\n testsItself,\n} from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource, WorkspaceTasks } from \"#/entities/workspace/index.ts\";\nimport { AddedRules } from \"#/shared/lib/added-rules.ts\";\nimport { collectIgnoredDirectories } from \"#/shared/lib/ignored-directories.ts\";\nimport type { IgnoredDirectory } from \"#/shared/lib/ignored-directories.ts\";\nimport { RepositoryFiles, nodeRepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { MSCH_DEPENDENCIES, MSCH_DEV_DEPENDENCIES, allowancesOf } from \"./dependency-allowances.ts\";\nimport type { DependencyAllowances, DependencySets } from \"./dependency-allowances.ts\";\nimport { sharedTestProject, testProjectOf, vitestProjectOf } from \"./test-project.ts\";\nimport type { TestProject, VitestProject } from \"./test-project.ts\";\nimport { publicEntryFiles } from \"./workspace-public-entries.ts\";\n\nexport type RuleSet = Readonly<Record<string, unknown>>;\nexport type RuleSets = Readonly<Record<string, RuleSet>>;\n\nconst CONFIG_FILE = \"vite.config.ts\";\nconst READ_CONCURRENCY = 16;\nconst MSCH_LINT = [\"msch\", \"lint\"] as const;\nconst MSCH_TEXT = [\"msch\", \"text\"] as const;\nconst ZENN_FILES = [\"articles/**/*.md\", \"books/**/*.md\"];\n\nconst decodeRules = Schema.decodeUnknownEffect(AddedRules);\nconst Names = Schema.String.pipe(Schema.Array, Schema.optional);\nconst WorkspaceOverride = Schema.Struct({\n files: Schema.Array(Schema.String),\n excludeFiles: Names,\n rules: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),\n use: Names,\n});\nconst WorkspaceLintSettings = Schema.Struct({\n overrides: WorkspaceOverride.pipe(Schema.Array, Schema.optional),\n});\n\nconst WorkspaceTextSettings = Schema.Struct({ use: Schema.Array(Schema.Literal(\"zenn\")) });\n\nexport interface WorkspaceLint {\n readonly overrides: readonly OxlintOverride[];\n readonly shadcnUi: readonly string[];\n readonly publicEntries: readonly string[];\n readonly deployEntries: readonly string[];\n readonly siteEntries: readonly string[];\n}\n\nexport interface WorkspaceSettings {\n readonly lint: WorkspaceLint;\n readonly members: readonly string[];\n readonly plugins: readonly string[];\n readonly ignoredDirectories: readonly IgnoredDirectory[];\n readonly testProjects: readonly VitestProject[];\n readonly tasks: WorkspaceTasks;\n readonly devDependencies: DependencyAllowances;\n readonly dependencies: DependencyAllowances;\n readonly indexSkill: Option.Option<string>;\n readonly articles: readonly string[];\n}\n\nexport interface SettingsOptions {\n readonly root: string;\n readonly ruleSets: RuleSets;\n readonly dependencySets: DependencySets;\n}\n\ninterface Workspace {\n readonly directory: string;\n readonly overrides: readonly OxlintOverride[];\n readonly devDependencies: DependencyAllowances;\n readonly dependencies: DependencyAllowances;\n readonly ownTests: boolean;\n readonly testProject: TestProject;\n readonly tasks: WorkspaceTasks;\n readonly publicEntries: readonly string[];\n readonly articles: readonly string[];\n}\n\nconst overrideOf = Effect.fn(\"overrideOf\")(function* overrideOf(\n source: WorkspaceSource,\n ruleSets: RuleSets,\n override: typeof WorkspaceOverride.Type,\n) {\n const { file, directory } = source;\n const fromSets = yield* usedFrom(file, ruleSets, override.use ?? []);\n const rules = yield* decodeRules(merged([...fromSets, override.rules ?? {}])).pipe(\n Effect.mapError((error) => settingsInvalid(file)(error.message)),\n );\n const files = pipe(override.files, Arr.map(prefixed(directory)));\n return pipe(\n Option.fromUndefinedOr(override.excludeFiles),\n Option.match({\n onNone: (): OxlintOverride => ({ files, rules }),\n onSome: (excluded): OxlintOverride => ({\n files,\n excludeFiles: pipe(excluded, Arr.map(prefixed(directory))),\n rules,\n }),\n }),\n );\n});\n\nconst lintOf = Effect.fn(\"lintOf\")(function* lintOf(source: WorkspaceSource, ruleSets: RuleSets) {\n const settings = yield* literalSettings({\n source,\n path: MSCH_LINT,\n decode: Schema.decodeUnknownEffect(WorkspaceLintSettings, { onExcessProperty: \"error\" }),\n });\n const lint = Option.getOrElse(settings, (): typeof WorkspaceLintSettings.Type => ({}));\n const overrides = yield* Effect.forEach(\n lint.overrides ?? [],\n (override) => overrideOf(source, ruleSets, override),\n { concurrency: 1 },\n );\n return { overrides };\n});\n\nconst articlesOf = Effect.fn(\"articlesOf\")(function* articlesOf(source: WorkspaceSource) {\n const settings = yield* literalSettings({\n source,\n path: MSCH_TEXT,\n decode: Schema.decodeUnknownEffect(WorkspaceTextSettings, { onExcessProperty: \"error\" }),\n });\n return pipe(\n settings,\n Option.filter(({ use }) => Arr.contains(use, \"zenn\")),\n Option.map(() => pipe(ZENN_FILES, Arr.map(prefixed(source.directory)))),\n Option.getOrElse((): readonly string[] => []),\n );\n});\n\nconst settingsOf = Effect.fn(\"settingsOf\")(function* settingsOf(\n source: WorkspaceSource,\n options: SettingsOptions,\n) {\n const lint = yield* lintOf(source, options.ruleSets);\n const articles = yield* articlesOf(source);\n const devDependencies = yield* allowancesOf(\n source,\n options.dependencySets,\n MSCH_DEV_DEPENDENCIES,\n );\n const dependencies = yield* allowancesOf(source, options.dependencySets, MSCH_DEPENDENCIES);\n const ownTests = testsItself(source.program);\n const files = yield* RepositoryFiles;\n const manifest = yield* readManifest(files.dirname(source.file));\n const tasks = tasksOf(manifest)(source.program);\n const testProject = yield* testProjectOf(source, `${source.directory}/${CONFIG_FILE}`, manifest);\n return {\n directory: source.directory,\n ...lint,\n articles,\n devDependencies,\n dependencies,\n ownTests,\n testProject,\n tasks,\n };\n});\n\nconst unconfiguredWorkspace = Effect.fn(\"unconfiguredWorkspace\")(function* unconfiguredWorkspace(\n root: string,\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const publicEntries = yield* publicEntryFiles(root, directory, Option.none());\n const manifest = yield* readManifest(files.join(root, directory));\n const mods = yield* modDirectories(files.join(root, directory));\n return {\n directory,\n overrides: [],\n articles: [],\n devDependencies: {},\n dependencies: {},\n ownTests: false,\n testProject: sharedTestProject(manifest)({ directory, config: false, mods }),\n tasks: NO_TASKS,\n publicEntries,\n };\n});\n\nconst workspaceIn = Effect.fn(\"workspaceIn\")(function* workspaceIn(\n options: SettingsOptions,\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const file = files.join(options.root, directory, CONFIG_FILE);\n const text = yield* files.readFile(file);\n if (Option.isNone(text)) {\n return yield* unconfiguredWorkspace(options.root, directory);\n }\n const program = yield* programOf(file, text.value);\n const settings = yield* settingsOf({ file, directory, program }, options);\n const publicEntries = yield* publicEntryFiles(options.root, directory, Option.some(program));\n return { ...settings, publicEntries };\n});\n\nconst mergedTasks = (found: readonly { readonly tasks: WorkspaceTasks }[]): WorkspaceTasks => ({\n verify: pipe(\n found,\n Arr.flatMap(({ tasks }) => tasks.verify),\n ),\n test: pipe(\n found,\n Arr.flatMap(({ tasks }) => tasks.test),\n ),\n native: pipe(\n found,\n Arr.flatMap(({ tasks }) => tasks.native),\n ),\n});\n\nconst mergedAllowances = (\n found: readonly Workspace[],\n): Pick<Workspace, \"devDependencies\" | \"dependencies\"> => ({\n devDependencies: merged(\n pipe(\n found,\n Arr.map(({ devDependencies }) => devDependencies),\n ),\n ),\n dependencies: merged(\n pipe(\n found,\n Arr.map(({ dependencies }) => dependencies),\n ),\n ),\n});\n\nconst collectWorkspaceSettings = Effect.fn(\"collectWorkspaceSettings\")(\n function* collectWorkspaceSettings(options: SettingsOptions) {\n yield* Effect.ignore(writeLockedClosures(options.root));\n const directories = yield* workspaceDirectories(options.root);\n const found: readonly Workspace[] = yield* Effect.forEach(\n directories,\n (directory) => workspaceIn(options, directory),\n { concurrency: READ_CONCURRENCY },\n );\n const shadcnUi = yield* Effect.forEach(\n directories,\n (directory) => shadcnUiIn(options.root, directory),\n { concurrency: READ_CONCURRENCY },\n );\n return {\n members: yield* structureMembers(options.root, directories),\n plugins: yield* sourcePlugins(options.root, directories),\n ignoredDirectories: yield* collectIgnoredDirectories(options.root),\n lint: {\n overrides: pipe(\n found,\n Arr.flatMap(({ overrides }) => overrides),\n ),\n shadcnUi: Arr.getSomes(shadcnUi),\n publicEntries: pipe(\n found,\n Arr.flatMap(({ publicEntries }) => publicEntries),\n ),\n deployEntries: yield* deployEntries(options.root),\n siteEntries: yield* siteEntries(options.root),\n },\n testProjects: pipe(\n found,\n Arr.filter(({ ownTests }) => !ownTests),\n Arr.map(({ testProject }) => vitestProjectOf(testProject)),\n ),\n tasks: mergedTasks(found),\n ...mergedAllowances(found),\n indexSkill: yield* indexSkillIn(options.root),\n articles: pipe(\n found,\n Arr.flatMap(({ articles }) => articles),\n ),\n };\n },\n);\n\nexport const workspaceSettings = (options: SettingsOptions): Promise<WorkspaceSettings> =>\n Effect.runPromise(collectWorkspaceSettings(options).pipe(Effect.provide(nodeRepositoryFiles)));\n\nexport type { WorkspaceTasks } from \"#/entities/workspace/index.ts\";\n"],"mappings":";;;;;;;;;;;AAMA,MAAM,iBAAiB;AACvB,MAAM,kBAAkB;AACxB,MAAMA,qBAAmB;AAEzB,MAAM,WAAW,OAAO,GAAG,UAAU,CAAC,CAAC,UAAU,SAAS,MAAc,WAAmB;CACzF,MAAM,QAAQ,OAAO;CACrB,OAAO,OAAO,MAAM,OAAO,MAAM,KAAK,MAAM,WAAW,eAAe,CAAC;AACzE,CAAC;AAED,MAAa,mBAAmB,OAAO,GAAG,kBAAkB,CAAC,CAAC,UAAU,iBACtE,MACA,aACA;CACA,OAAO,OAAO,OAAO,OAAO,cAAc,cAAc,SAAS,MAAM,SAAS,GAAG,EACjF,aAAaA,mBACf,CAAC;AACH,CAAC;AAED,MAAa,gBAAgB,OAAO,GAAG,eAAe,CAAC,CAAC,UAAU,cAChE,MACA,aACA;CACA,MA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rec","READ_CONCURRENCY","Arr","Names","Arr","Rec","Arr","Arr","Arr"],"sources":["../src/entities/workspace/model/structure-members.ts","../src/entities/workspace/model/site-entries.ts","../src/entities/workspace/model/locked-closures.ts","../src/entities/workspace/model/locked-closure-files.ts","../src/entities/workspace/model/index-skill.ts","../src/shared/lib/added-rules.ts","../src/features/build-workspace-settings/model/dependency-allowances.ts","../src/features/build-workspace-settings/model/test-project.ts","../src/features/build-workspace-settings/model/workspace-public-entries.ts","../src/features/build-workspace-settings/model/workspace-settings.ts"],"sourcesContent":["import { Array as Arr, Effect, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { workspaceProjects } from \"./workspace-projects.ts\";\n\nconst ROOT_WORKSPACE = \".\";\nconst PLUGIN_MANIFEST = \".claude-plugin/plugin.json\";\nconst READ_CONCURRENCY = 16;\n\nconst isPlugin = Effect.fn(\"isPlugin\")(function* isPlugin(root: string, directory: string) {\n const files = yield* RepositoryFiles;\n return yield* files.exists(files.join(root, directory, PLUGIN_MANIFEST));\n});\n\nexport const pluginWorkspaces = Effect.fn(\"pluginWorkspaces\")(function* pluginWorkspaces(\n root: string,\n directories: readonly string[],\n) {\n return yield* Effect.filter(directories, (directory) => isPlugin(root, directory), {\n concurrency: READ_CONCURRENCY,\n });\n});\n\nexport const sourcePlugins = Effect.fn(\"sourcePlugins\")(function* sourcePlugins(\n root: string,\n directories: readonly string[],\n) {\n const plugins = yield* pluginWorkspaces(root, directories);\n const projects = yield* workspaceProjects(root);\n const published = pipe(\n projects,\n Arr.filter((project) => project.published),\n Arr.map(({ directory }) => directory),\n );\n return pipe(\n plugins,\n Arr.filter((directory) => !Arr.contains(published, directory)),\n );\n});\n\nexport const structureMembers = Effect.fn(\"structureMembers\")(function* structureMembers(\n root: string,\n directories: readonly string[],\n) {\n const plugins = yield* pluginWorkspaces(root, directories);\n return pipe(\n directories,\n Arr.filter((directory) => directory !== ROOT_WORKSPACE && !Arr.contains(plugins, directory)),\n );\n});\n","import { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst READ_CONCURRENCY = 16;\nconst SCRIPT = /\\.[cm]?tsx?$/u;\nconst SKIPPED = /\\.test\\.|\\.d\\.[cm]?ts$/u;\nconst SERVER_ENTRY_IMPORT = /from\\s+[\"']@effect\\/ui\\/html\\/HtmlServerHttp[\"']/u;\n\nexport const siteEntries = Effect.fn(\"siteEntries\")(function* siteEntries(root: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.listedFiles(root);\n const candidates = pipe(\n listed,\n Arr.filter((file) => SCRIPT.test(file) && !SKIPPED.test(file)),\n );\n const texts = yield* Effect.forEach(\n candidates,\n (file) => files.readFile(files.join(root, file)),\n { concurrency: READ_CONCURRENCY },\n );\n return pipe(\n Arr.zip(candidates, texts),\n Arr.filter(([, text]) => Option.exists(text, (value) => SERVER_ENTRY_IMPORT.test(value))),\n Arr.map(([file]) => file),\n );\n});\n","import { depPathsOf, 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 { reachable } from \"#/shared/lib/reachable.ts\";\nimport type { Edges } from \"#/shared/lib/reachable.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { linkedPaths } from \"./locked-links.ts\";\n\ntype LockedClosures = Readonly<Record<string, readonly string[]>>;\n\nconst IMPORTER = \"importer:\";\nconst ROOT_IMPORTER = \".\";\n\ntype Sections = readonly (ResolvedDependencies | undefined)[];\ntype Edge = readonly [string, readonly string[]];\n\ninterface Used {\n readonly dependencies?: ResolvedDependencies | undefined;\n readonly optionalDependencies?: ResolvedDependencies | undefined;\n}\n\ninterface Importer {\n readonly id: string;\n readonly own: readonly string[];\n readonly used: readonly string[];\n}\n\nconst usedSections = ({ dependencies, optionalDependencies }: Used): Sections => [\n dependencies,\n optionalDependencies,\n];\n\nconst packageEdges = <Package extends string>(\n packages: Readonly<Record<Package, Used>>,\n): readonly Edge[] =>\n pipe(\n Rec.toEntries(packages),\n Arr.map(([id, snapshot]): Edge => [id, pipe(usedSections(snapshot), Arr.flatMap(depPathsOf))]),\n );\n\nconst closureOf =\n (edges: Edges) =>\n ({ own }: Importer): readonly string[] => {\n const packages = pipe(\n reachable(edges, own),\n Arr.filter((id) => !Str.startsWith(IMPORTER)(id)),\n );\n return Arr.sort(packages, Str.Order);\n };\n\n/** @internal */\nexport const lockedClosures = Effect.fn(\"lockedClosures\")(function* lockedClosures(root: string) {\n const files = yield* RepositoryFiles;\n const lockfile = yield* readWantedLockfile(root);\n const nodesOf = (id: string, sections: Sections): readonly string[] => [\n ...pipe(sections, Arr.flatMap(depPathsOf)),\n ...pipe(\n linkedPaths(sections),\n Arr.map((path) => files.relative(root, files.join(root, id, path))),\n Arr.map(\n (linked) =>\n `${IMPORTER}${Option.getOrElse(Option.liftPredicate(linked, Str.isNonEmpty), () => ROOT_IMPORTER)}`,\n ),\n ),\n ];\n return pipe(\n lockfile,\n Option.map(({ importers, packages }): LockedClosures => {\n const found = pipe(\n Rec.toEntries(importers),\n Arr.map(([id, project]): Importer => {\n const used = usedSections(project);\n return {\n id,\n own: nodesOf(id, [...used, project.devDependencies]),\n used: nodesOf(id, used),\n };\n }),\n );\n const edges = Rec.fromEntries([\n ...pipe(\n found,\n Arr.map(({ id, used }): Edge => [`${IMPORTER}${id}`, used]),\n ),\n ...packageEdges(packages ?? {}),\n ]);\n return Rec.fromEntries(\n pipe(\n found,\n Arr.map((importer) => [importer.id, closureOf(edges)(importer)] as const),\n ),\n );\n }),\n );\n});\n","import { Array as Arr, Effect, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { CLOSURE_FILE, FINGERPRINT_FILE, LOCK_FILE } from \"#/shared/lib/locked-closure-paths.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { lockedClosures } from \"./locked-closures.ts\";\n\nconst LINE = \"\\n\";\nconst FILE_CONCURRENCY = 16;\n\nconst writeChanged = Effect.fn(\"writeChanged\")(function* writeChanged(file: string, text: string) {\n const files = yield* RepositoryFiles;\n const written = yield* files.readFile(file);\n if (!Option.exists(written, (found) => found === text)) {\n yield* files.writeFile(file, text);\n }\n});\n\nconst isWritten = Effect.fn(\"isWritten\")(function* isWritten(root: string, fingerprint: string) {\n const files = yield* RepositoryFiles;\n const recorded = yield* files.readFile(files.join(root, FINGERPRINT_FILE));\n const [hash, ...importers] = Str.split(\n Option.getOrElse(recorded, () => \"\"),\n LINE,\n );\n if (hash !== fingerprint) {\n return false;\n }\n const present = yield* Effect.forEach(\n importers,\n (importer) => files.exists(files.join(root, importer, CLOSURE_FILE)),\n { concurrency: FILE_CONCURRENCY },\n );\n return pipe(present, Arr.every(Boolean));\n});\n\nconst writeAll = Effect.fn(\"writeAll\")(function* writeAll(root: string, fingerprint: string) {\n const files = yield* RepositoryFiles;\n const closures = yield* lockedClosures(root);\n const entries = Rec.toEntries(Option.getOrElse(closures, () => ({})));\n yield* Effect.forEach(\n entries,\n ([importer, closure]) =>\n writeChanged(files.join(root, importer, CLOSURE_FILE), Arr.join(closure, LINE)),\n { concurrency: FILE_CONCURRENCY, discard: true },\n );\n const importers = pipe(\n entries,\n Arr.map(([importer]) => importer),\n );\n yield* files.writeFile(\n files.join(root, FINGERPRINT_FILE),\n Arr.join([fingerprint, ...importers], LINE),\n );\n});\n\n/** @internal */\nexport const writeLockedClosures = Effect.fn(\"writeLockedClosures\")(function* writeLockedClosures(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const fingerprint = yield* files.hashFile(files.join(root, LOCK_FILE));\n if (Option.isNone(fingerprint)) {\n return;\n }\n const written = yield* isWritten(root, fingerprint.value);\n if (!written) {\n yield* writeAll(root, fingerprint.value);\n }\n});\n","import { Array as Arr, Effect, Option, Order, Predicate, pipe } from \"effect\";\n\nimport { splitFrontmatter } from \"#/shared/lib/frontmatter.ts\";\nimport type { Frontmatter } from \"#/shared/lib/frontmatter.ts\";\nimport { INDEX_SKILL } from \"#/shared/lib/index-skill.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst SKILL_DIRECTORIES = [\".agents/skills\", \".claude/skills\", \"skills\"];\nconst PLUGINS = \"plugins\";\nconst SKILLS = \"skills\";\nconst SKILL_FILE = \"SKILL.md\";\nconst READ_CONCURRENCY = 16;\n\nconst nameOf = ({ fields }: Frontmatter): Option.Option<string> =>\n Option.filter(Option.fromNullishOr(fields[\"name\"]), Predicate.isString);\n\nconst skillDirectories = Effect.fn(\"skillDirectories\")(function* skillDirectories(root: string) {\n const files = yield* RepositoryFiles;\n const plugins = yield* files.readDirectory(files.join(root, PLUGINS));\n return [\n ...SKILL_DIRECTORIES,\n ...pipe(\n plugins,\n Arr.map((plugin) => files.join(PLUGINS, plugin, SKILLS)),\n ),\n ];\n});\n\nconst skillFiles = Effect.fn(\"skillFiles\")(function* skillFiles(root: string) {\n const files = yield* RepositoryFiles;\n const directories = yield* skillDirectories(root);\n const found = yield* Effect.forEach(\n directories,\n (directory) =>\n files\n .readDirectory(files.join(root, directory))\n .pipe(Effect.map(Arr.map((name) => files.join(directory, name, SKILL_FILE)))),\n { concurrency: READ_CONCURRENCY },\n );\n return pipe(Arr.flatten(found), Arr.sortBy(Order.String));\n});\n\nconst indexNameAt = Effect.fn(\"indexNameAt\")(function* indexNameAt(root: string, file: string) {\n const files = yield* RepositoryFiles;\n const source = yield* files.readFile(files.join(root, file));\n return pipe(\n source,\n Option.filter(() => INDEX_SKILL.test(file)),\n Option.flatMap(splitFrontmatter),\n Option.flatMap(nameOf),\n );\n});\n\nexport const indexSkillIn = Effect.fn(\"indexSkillIn\")(function* indexSkillIn(root: string) {\n const found = yield* skillFiles(root);\n const names = yield* Effect.forEach(found, (file) => indexNameAt(root, file), {\n concurrency: READ_CONCURRENCY,\n });\n return Arr.head(Arr.getSomes(names));\n});\n","import { Schema } from \"effect\";\n\nconst Enabled = Schema.Literals([\"error\", \"deny\"]);\n\nconst EnabledWithOptions = Schema.mutable(\n Schema.TupleWithRest(Schema.Tuple([Enabled]), [Schema.Unknown]),\n);\n\nconst AddedRule = Schema.Union([Enabled, EnabledWithOptions]);\n\nexport const AddedRules = Schema.Record(Schema.String, AddedRule);\n\nexport type AddedRulesValue = typeof AddedRules.Type;\n","import { Array as Arr, Effect, Option, Record as Rec, Schema } from \"effect\";\n\nimport { literalSettings, usedFrom } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource } from \"#/entities/workspace/index.ts\";\n\nexport type DependencySets = Readonly<Record<string, readonly string[]>>;\n\nexport interface DependencyAllowance {\n readonly workspaces: readonly string[];\n readonly dependencies: readonly string[];\n}\n\nexport type DependencyAllowances = Readonly<Record<string, DependencyAllowance>>;\n\nexport const MSCH_DEV_DEPENDENCIES = [\"msch\", \"devDependencies\"] as const;\nexport const MSCH_DEPENDENCIES = [\"msch\", \"dependencies\"] as const;\n\nconst Names = Schema.String.pipe(Schema.Array, Schema.optional);\nconst DependencySettings = Schema.Struct({ use: Names, dependencies: Names });\nconst WorkspaceDependencyAllowances = Schema.Record(Schema.String, DependencySettings);\n\nconst allowanceOf = Effect.fn(\"allowanceOf\")(function* allowanceOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n [reason, allowance]: readonly [string, typeof DependencySettings.Type],\n) {\n const sets = yield* usedFrom(source.file, dependencySets, allowance.use ?? []);\n const dependencies = [...Arr.flatten(sets), ...(allowance.dependencies ?? [])];\n return [\n `${source.directory}: ${reason}`,\n { workspaces: [source.directory], dependencies },\n ] as const;\n});\n\nexport const allowancesOf = Effect.fn(\"allowancesOf\")(function* allowancesOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n path: typeof MSCH_DEV_DEPENDENCIES | typeof MSCH_DEPENDENCIES,\n) {\n const settings = yield* literalSettings({\n source,\n path,\n decode: Schema.decodeUnknownEffect(WorkspaceDependencyAllowances),\n });\n const allowed = Rec.toEntries(Option.getOrElse(settings, () => ({})));\n const entries = yield* Effect.forEach(\n allowed,\n (entry) => allowanceOf(source, dependencySets, entry),\n { concurrency: 1 },\n );\n return Rec.fromEntries(entries);\n});\n","import type { PackageJson } from \"@r_masseater/masseater-utils/kestrion\";\nimport { Array as Arr, Effect, Option, Predicate, Schema, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport { literalSettings, modDirectories } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource } from \"#/entities/workspace/index.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst TEST_ISOLATION = [\"test\", \"isolate\"] as const;\n\nexport interface SharedTestProject {\n readonly extends: string | false;\n readonly root: string;\n readonly test: {\n readonly name: string;\n readonly isolate: false;\n readonly exclude?: readonly string[];\n };\n}\n\nexport type TestProject = string | SharedTestProject;\n\nexport interface ProjectPlace {\n readonly directory: string;\n readonly config: string | false;\n readonly mods: readonly string[];\n}\n\nconst DEFAULT_EXCLUDE = [\"**/node_modules/**\", \"**/.git/**\"];\n\nconst excludeOf = (mods: readonly string[]): { readonly exclude?: readonly string[] } =>\n pipe(\n mods,\n Option.liftPredicate(Arr.isReadonlyArrayNonEmpty),\n Option.match({\n onNone: () => ({}),\n onSome: (directories) => ({\n exclude: [\n ...DEFAULT_EXCLUDE,\n ...pipe(\n directories,\n Arr.map((directory) => `${directory}**/*.test.{ts,tsx}`),\n ),\n ],\n }),\n }),\n );\n\nexport const sharedTestProject =\n (manifest: Option.Option<PackageJson>) =>\n ({ directory, config, mods }: ProjectPlace): TestProject => ({\n extends: config,\n root: directory,\n test: {\n name: pipe(\n manifest,\n Option.flatMap(({ name }) => Option.fromUndefinedOr(name)),\n Option.getOrElse(() => directory),\n ),\n isolate: false,\n ...excludeOf(mods),\n },\n });\n\nexport const testProjectOf = Effect.fn(\"testProjectOf\")(function* testProjectOf(\n source: WorkspaceSource,\n config: string,\n manifest: Option.Option<PackageJson>,\n) {\n const isolated = yield* literalSettings({\n source,\n path: TEST_ISOLATION,\n decode: Schema.decodeUnknownEffect(Schema.Boolean),\n });\n if (Option.getOrElse(isolated, () => false)) {\n return source.directory;\n }\n const files = yield* RepositoryFiles;\n const mods = yield* modDirectories(files.dirname(source.file));\n return sharedTestProject(manifest)({ directory: source.directory, config, mods });\n});\n\nexport type VitestProject = NonNullable<NonNullable<UserConfig[\"test\"]>[\"projects\"]>[number];\n\nconst excludeCopy = (exclude: readonly string[] | undefined): { exclude?: string[] } =>\n pipe(\n Option.fromUndefinedOr(exclude),\n Option.match({ onNone: () => ({}), onSome: (patterns) => ({ exclude: [...patterns] }) }),\n );\n\n/** @internal */\nexport const vitestProjectOf = (project: TestProject): VitestProject => {\n if (Predicate.isString(project)) {\n return project;\n }\n const { name, isolate, exclude } = project.test;\n return {\n extends: project.extends,\n root: project.root,\n test: { name, isolate, ...excludeCopy(exclude) },\n };\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, Schema, pipe } from \"effect\";\n\nimport { entriesOf, PackEntry, publicEntriesOf } from \"#/entities/package/index.ts\";\nimport type { EntryManifest, PackEntrySource } from \"#/entities/package/index.ts\";\nimport { literalOf, nestedValues } from \"#/entities/workspace/index.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst PACK_ENTRY = [\"pack\", \"entry\"] as const;\n\nconst decodePackEntry = Schema.decodeUnknownOption(PackEntry);\n\nconst packEntriesIn = (program: unknown): readonly PackEntrySource[] =>\n pipe(\n nestedValues(PACK_ENTRY)(program),\n Arr.flatMap((node) =>\n pipe(\n literalOf(node),\n Option.flatMap(decodePackEntry),\n Option.toArray,\n Arr.flatMap(entriesOf),\n ),\n ),\n );\n\ninterface EntryFilesRequest {\n readonly join: (target: string) => string;\n readonly packEntries: readonly PackEntrySource[];\n}\n\nconst entryFilesOf =\n ({ join, packEntries }: EntryFilesRequest) =>\n (manifest: EntryManifest): readonly string[] => {\n const joined = pipe(\n packEntries,\n Arr.map((entry) => ({ name: entry.name, source: join(entry.source) })),\n );\n return pipe(\n publicEntriesOf({ manifest, join, packEntries: joined }),\n Arr.map(({ source }) => source),\n Arr.dedupe,\n );\n };\n\nexport const publicEntryFiles = Effect.fn(\"publicEntryFiles\")(function* publicEntryFiles(\n root: string,\n directory: string,\n config: Option.Option<unknown>,\n) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, directory, PACKAGE_JSON_FILE));\n const packEntries = pipe(\n config,\n Option.map(packEntriesIn),\n Option.getOrElse(() => []),\n );\n const join = (target: string): string => files.join(directory, target);\n return pipe(\n text,\n Option.flatMap(decodePackageJson),\n Option.map(entryFilesOf({ join, packEntries })),\n Option.getOrElse((): readonly string[] => []),\n );\n});\n","import { Array as Arr, Effect, Option, Schema, pipe } from \"effect\";\nimport type { OxlintOverride } from \"vite-plus/lint\";\n\nimport { readManifest } from \"#/entities/package/index.ts\";\nimport {\n deployEntries,\n indexSkillIn,\n literalSettings,\n modDirectories,\n merged,\n sourcePlugins,\n programOf,\n settingsInvalid,\n siteEntries,\n structureMembers,\n usedFrom,\n workspaceDirectories,\n writeLockedClosures,\n prefixed,\n shadcnUiIn,\n NO_TASKS,\n tasksOf,\n testsItself,\n} from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource, WorkspaceTasks } from \"#/entities/workspace/index.ts\";\nimport { AddedRules } from \"#/shared/lib/added-rules.ts\";\nimport { collectIgnoredDirectories } from \"#/shared/lib/ignored-directories.ts\";\nimport type { IgnoredDirectory } from \"#/shared/lib/ignored-directories.ts\";\nimport { RepositoryFiles, nodeRepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { MSCH_DEPENDENCIES, MSCH_DEV_DEPENDENCIES, allowancesOf } from \"./dependency-allowances.ts\";\nimport type { DependencyAllowances, DependencySets } from \"./dependency-allowances.ts\";\nimport { sharedTestProject, testProjectOf, vitestProjectOf } from \"./test-project.ts\";\nimport type { TestProject, VitestProject } from \"./test-project.ts\";\nimport { publicEntryFiles } from \"./workspace-public-entries.ts\";\n\nexport type RuleSet = Readonly<Record<string, unknown>>;\nexport type RuleSets = Readonly<Record<string, RuleSet>>;\n\nconst CONFIG_FILE = \"vite.config.ts\";\nconst READ_CONCURRENCY = 16;\nconst MSCH_LINT = [\"msch\", \"lint\"] as const;\nconst MSCH_TEXT = [\"msch\", \"text\"] as const;\nconst ZENN_FILES = [\"articles/**/*.md\", \"books/**/*.md\"];\n\nconst decodeRules = Schema.decodeUnknownEffect(AddedRules);\nconst Names = Schema.String.pipe(Schema.Array, Schema.optional);\nconst WorkspaceOverride = Schema.Struct({\n files: Schema.Array(Schema.String),\n excludeFiles: Names,\n rules: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),\n use: Names,\n});\nconst WorkspaceLintSettings = Schema.Struct({\n overrides: WorkspaceOverride.pipe(Schema.Array, Schema.optional),\n});\n\nconst WorkspaceTextSettings = Schema.Struct({ use: Schema.Array(Schema.Literal(\"zenn\")) });\n\nexport interface WorkspaceLint {\n readonly overrides: readonly OxlintOverride[];\n readonly shadcnUi: readonly string[];\n readonly publicEntries: readonly string[];\n readonly deployEntries: readonly string[];\n readonly siteEntries: readonly string[];\n}\n\nexport interface WorkspaceSettings {\n readonly lint: WorkspaceLint;\n readonly members: readonly string[];\n readonly plugins: readonly string[];\n readonly ignoredDirectories: readonly IgnoredDirectory[];\n readonly testProjects: readonly VitestProject[];\n readonly tasks: WorkspaceTasks;\n readonly devDependencies: DependencyAllowances;\n readonly dependencies: DependencyAllowances;\n readonly indexSkill: Option.Option<string>;\n readonly articles: readonly string[];\n}\n\nexport interface SettingsOptions {\n readonly root: string;\n readonly ruleSets: RuleSets;\n readonly dependencySets: DependencySets;\n}\n\ninterface Workspace {\n readonly directory: string;\n readonly overrides: readonly OxlintOverride[];\n readonly devDependencies: DependencyAllowances;\n readonly dependencies: DependencyAllowances;\n readonly ownTests: boolean;\n readonly testProject: TestProject;\n readonly tasks: WorkspaceTasks;\n readonly publicEntries: readonly string[];\n readonly articles: readonly string[];\n}\n\nconst overrideOf = Effect.fn(\"overrideOf\")(function* overrideOf(\n source: WorkspaceSource,\n ruleSets: RuleSets,\n override: typeof WorkspaceOverride.Type,\n) {\n const { file, directory } = source;\n const fromSets = yield* usedFrom(file, ruleSets, override.use ?? []);\n const rules = yield* decodeRules(merged([...fromSets, override.rules ?? {}])).pipe(\n Effect.mapError((error) => settingsInvalid(file)(error.message)),\n );\n const files = pipe(override.files, Arr.map(prefixed(directory)));\n return pipe(\n Option.fromUndefinedOr(override.excludeFiles),\n Option.match({\n onNone: (): OxlintOverride => ({ files, rules }),\n onSome: (excluded): OxlintOverride => ({\n files,\n excludeFiles: pipe(excluded, Arr.map(prefixed(directory))),\n rules,\n }),\n }),\n );\n});\n\nconst lintOf = Effect.fn(\"lintOf\")(function* lintOf(source: WorkspaceSource, ruleSets: RuleSets) {\n const settings = yield* literalSettings({\n source,\n path: MSCH_LINT,\n decode: Schema.decodeUnknownEffect(WorkspaceLintSettings, { onExcessProperty: \"error\" }),\n });\n const lint = Option.getOrElse(settings, (): typeof WorkspaceLintSettings.Type => ({}));\n const overrides = yield* Effect.forEach(\n lint.overrides ?? [],\n (override) => overrideOf(source, ruleSets, override),\n { concurrency: 1 },\n );\n return { overrides };\n});\n\nconst articlesOf = Effect.fn(\"articlesOf\")(function* articlesOf(source: WorkspaceSource) {\n const settings = yield* literalSettings({\n source,\n path: MSCH_TEXT,\n decode: Schema.decodeUnknownEffect(WorkspaceTextSettings, { onExcessProperty: \"error\" }),\n });\n return pipe(\n settings,\n Option.filter(({ use }) => Arr.contains(use, \"zenn\")),\n Option.map(() => pipe(ZENN_FILES, Arr.map(prefixed(source.directory)))),\n Option.getOrElse((): readonly string[] => []),\n );\n});\n\nconst settingsOf = Effect.fn(\"settingsOf\")(function* settingsOf(\n source: WorkspaceSource,\n options: SettingsOptions,\n) {\n const lint = yield* lintOf(source, options.ruleSets);\n const articles = yield* articlesOf(source);\n const devDependencies = yield* allowancesOf(\n source,\n options.dependencySets,\n MSCH_DEV_DEPENDENCIES,\n );\n const dependencies = yield* allowancesOf(source, options.dependencySets, MSCH_DEPENDENCIES);\n const ownTests = testsItself(source.program);\n const files = yield* RepositoryFiles;\n const manifest = yield* readManifest(files.dirname(source.file));\n const tasks = tasksOf(manifest)(source.program);\n const testProject = yield* testProjectOf(source, `${source.directory}/${CONFIG_FILE}`, manifest);\n return {\n directory: source.directory,\n ...lint,\n articles,\n devDependencies,\n dependencies,\n ownTests,\n testProject,\n tasks,\n };\n});\n\nconst unconfiguredWorkspace = Effect.fn(\"unconfiguredWorkspace\")(function* unconfiguredWorkspace(\n root: string,\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const publicEntries = yield* publicEntryFiles(root, directory, Option.none());\n const manifest = yield* readManifest(files.join(root, directory));\n const mods = yield* modDirectories(files.join(root, directory));\n return {\n directory,\n overrides: [],\n articles: [],\n devDependencies: {},\n dependencies: {},\n ownTests: false,\n testProject: sharedTestProject(manifest)({ directory, config: false, mods }),\n tasks: NO_TASKS,\n publicEntries,\n };\n});\n\nconst workspaceIn = Effect.fn(\"workspaceIn\")(function* workspaceIn(\n options: SettingsOptions,\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const file = files.join(options.root, directory, CONFIG_FILE);\n const text = yield* files.readFile(file);\n if (Option.isNone(text)) {\n return yield* unconfiguredWorkspace(options.root, directory);\n }\n const program = yield* programOf(file, text.value);\n const settings = yield* settingsOf({ file, directory, program }, options);\n const publicEntries = yield* publicEntryFiles(options.root, directory, Option.some(program));\n return { ...settings, publicEntries };\n});\n\nconst mergedTasks = (found: readonly { readonly tasks: WorkspaceTasks }[]): WorkspaceTasks => ({\n verify: pipe(\n found,\n Arr.flatMap(({ tasks }) => tasks.verify),\n ),\n test: pipe(\n found,\n Arr.flatMap(({ tasks }) => tasks.test),\n ),\n native: pipe(\n found,\n Arr.flatMap(({ tasks }) => tasks.native),\n ),\n});\n\nconst mergedAllowances = (\n found: readonly Workspace[],\n): Pick<Workspace, \"devDependencies\" | \"dependencies\"> => ({\n devDependencies: merged(\n pipe(\n found,\n Arr.map(({ devDependencies }) => devDependencies),\n ),\n ),\n dependencies: merged(\n pipe(\n found,\n Arr.map(({ dependencies }) => dependencies),\n ),\n ),\n});\n\nconst collectWorkspaceSettings = Effect.fn(\"collectWorkspaceSettings\")(\n function* collectWorkspaceSettings(options: SettingsOptions) {\n yield* Effect.ignore(writeLockedClosures(options.root));\n const directories = yield* workspaceDirectories(options.root);\n const found: readonly Workspace[] = yield* Effect.forEach(\n directories,\n (directory) => workspaceIn(options, directory),\n { concurrency: READ_CONCURRENCY },\n );\n const shadcnUi = yield* Effect.forEach(\n directories,\n (directory) => shadcnUiIn(options.root, directory),\n { concurrency: READ_CONCURRENCY },\n );\n return {\n members: yield* structureMembers(options.root, directories),\n plugins: yield* sourcePlugins(options.root, directories),\n ignoredDirectories: yield* collectIgnoredDirectories(options.root),\n lint: {\n overrides: pipe(\n found,\n Arr.flatMap(({ overrides }) => overrides),\n ),\n shadcnUi: Arr.getSomes(shadcnUi),\n publicEntries: pipe(\n found,\n Arr.flatMap(({ publicEntries }) => publicEntries),\n ),\n deployEntries: yield* deployEntries(options.root),\n siteEntries: yield* siteEntries(options.root),\n },\n testProjects: pipe(\n found,\n Arr.filter(({ ownTests }) => !ownTests),\n Arr.map(({ testProject }) => vitestProjectOf(testProject)),\n ),\n tasks: mergedTasks(found),\n ...mergedAllowances(found),\n indexSkill: yield* indexSkillIn(options.root),\n articles: pipe(\n found,\n Arr.flatMap(({ articles }) => articles),\n ),\n };\n },\n);\n\nexport const workspaceSettings = (options: SettingsOptions): Promise<WorkspaceSettings> =>\n Effect.runPromise(collectWorkspaceSettings(options).pipe(Effect.provide(nodeRepositoryFiles)));\n\nexport type { WorkspaceTasks } from \"#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