@r_masseater/msch 0.129.0 → 0.129.2

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.
@@ -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 { 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 \"#/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,MAAM,UAAU,OAAO,iBAAiB,MAAM,WAAW;CACzD,MAAM,WAAW,OAAO,kBAAkB,IAAI;CAC9C,MAAM,YAAY,KAChB,UACAC,MAAI,QAAQ,YAAY,QAAQ,SAAS,GACzCA,MAAI,KAAK,EAAE,gBAAgB,SAAS,CACtC;CACA,OAAO,KACL,SACAA,MAAI,QAAQ,cAAc,CAACA,MAAI,SAAS,WAAW,SAAS,CAAC,CAC/D;AACF,CAAC;AAED,MAAa,mBAAmB,OAAO,GAAG,kBAAkB,CAAC,CAAC,UAAU,iBACtE,MACA,aACA;CACA,MAAM,UAAU,OAAO,iBAAiB,MAAM,WAAW;CACzD,OAAO,KACL,aACAA,MAAI,QAAQ,cAAc,cAAc,kBAAkB,CAACA,MAAI,SAAS,SAAS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B,OAAO,0BAA0B,QAAQ,IAAI;EACjE,MAAM;GACJ,WAAW,KACT,OACAA,MAAI,SAAS,EAAE,gBAAgB,SAAS,CAC1C;GACA,UAAUA,MAAI,SAAS,QAAQ;GAC/B,eAAe,KACb,OACAA,MAAI,SAAS,EAAE,oBAAoB,aAAa,CAClD;GACA,eAAe,OAAO,cAAc,QAAQ,IAAI;GAChD,aAAa,OAAO,YAAY,QAAQ,IAAI;EAC9C;EACA,cAAc,KACZ,OACAA,MAAI,QAAQ,EAAE,eAAe,CAAC,QAAQ,GACtCA,MAAI,KAAK,EAAE,kBAAkB,gBAAgB,WAAW,CAAC,CAC3D;EACA,OAAO,YAAY,KAAK;EACxB,GAAG,iBAAiB,KAAK;EACzB,YAAY,OAAO,aAAa,QAAQ,IAAI;EAC5C,UAAU,KACR,OACAA,MAAI,SAAS,EAAE,eAAe,QAAQ,CACxC;CACF;AACF,CACF;AAEA,MAAa,qBAAqB,YAChC,OAAO,WAAW,yBAAyB,OAAO,CAAC,CAAC,KAAK,OAAO,QAAQ,mBAAmB,CAAC,CAAC"}
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] = recorded.pipe(\n Option.getOrElse(() => \"\"),\n Str.split(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 = closures.pipe(\n Option.getOrElse(() => ({})),\n Rec.toEntries,\n );\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 = settings.pipe(\n Option.getOrElse(() => ({})),\n Rec.toEntries,\n );\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,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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r_masseater/msch",
3
- "version": "0.129.0",
3
+ "version": "0.129.2",
4
4
  "description": "A check policy for repositories: points every finite value set and object shape at its one owner, and ships the oxlint preset of plugins and rules.",
5
5
  "keywords": [
6
6
  "lint",
@@ -72,14 +72,14 @@
72
72
  "@pnpm/workspace.workspace-manifest-reader": "^1100.3.4",
73
73
  "@pnpm/workspace.workspace-manifest-writer": "^1100.2.13",
74
74
  "@r_masseater/cc-effect-hooks": ">=0.1.0",
75
- "@r_masseater/fu4": "^0.5.9",
75
+ "@r_masseater/fu4": "^0.5.10",
76
76
  "@r_masseater/masseater-utils": ">=0.10.0",
77
77
  "@r_masseater/mdlct": ">=0.3.0",
78
- "@r_masseater/oxlint-plugin-decision": "^0.10.6",
78
+ "@r_masseater/oxlint-plugin-decision": "^0.10.7",
79
79
  "@r_masseater/oxlint-typed-rules": "^0.7.3",
80
- "@r_masseater/textlint-rule-preset-ja": "^0.4.8",
81
- "@r_masseater/wism": "^0.5.9",
82
- "@r_masseater/y8": "^0.9.10",
80
+ "@r_masseater/textlint-rule-preset-ja": "^0.4.10",
81
+ "@r_masseater/wism": "^0.5.10",
82
+ "@r_masseater/y8": "^0.9.11",
83
83
  "@shadcn/lint": "^0.2.5",
84
84
  "@tanstack/intent": "^0.5.6",
85
85
  "@textlint-ja/textlint-rule-preset-ai-writing": "^1.7.2",
@@ -107,12 +107,12 @@
107
107
  "@anthropic-ai/claude-agent-sdk": "0.3.332",
108
108
  "@effect/platform-node": "4.2.0",
109
109
  "@effect/platform-node-shared": "4.2.0",
110
- "@effect/tsgo": "0.74.3",
110
+ "@effect/tsgo": "0.75.0",
111
111
  "@effect/vitest": "4.2.0",
112
112
  "@masseater.dev/lint-host": "0.0.0",
113
113
  "@masseater.dev/path-kit": "0.0.0",
114
- "@r_masseater/h56m": "0.4.10",
115
- "@r_masseater/vite-plus-adopt": "0.28.3",
114
+ "@r_masseater/h56m": "0.4.11",
115
+ "@r_masseater/vite-plus-adopt": "0.29.0",
116
116
  "@textlint/kernel": "16.1.4",
117
117
  "@types/node": "26.6.11",
118
118
  "@types/semver": "7.8.0",
@@ -130,7 +130,7 @@
130
130
  "@effect/platform-node-shared": "^4.1.0",
131
131
  "@effect/tsgo": ">=0.74.3",
132
132
  "@r_masseater/h56m": ">=0.3.0",
133
- "@r_masseater/vite-plus-adopt": ">=0.28.0",
133
+ "@r_masseater/vite-plus-adopt": ">=0.29.0",
134
134
  "effect": "^4.1.0",
135
135
  "tsrs": ">=7.1.0-beta.tsrs7",
136
136
  "vite": "*",
@@ -8,7 +8,7 @@ description: >
8
8
  metadata:
9
9
  type: core
10
10
  library: "@r_masseater/msch"
11
- library_version: 0.129.0
11
+ library_version: 0.129.2
12
12
  sources:
13
13
  - bin/msch.ts
14
14
  - src/app
@@ -8,7 +8,7 @@ description: >
8
8
  metadata:
9
9
  type: core
10
10
  library: "@r_masseater/msch"
11
- library_version: 0.129.0
11
+ library_version: 0.129.2
12
12
  sources:
13
13
  - src/app/publish-command.ts
14
14
  - src/features/publish-workspace
@@ -8,7 +8,7 @@ description: >
8
8
  metadata:
9
9
  type: core
10
10
  library: "@r_masseater/msch"
11
- library_version: 0.129.0
11
+ library_version: 0.129.2
12
12
  sources:
13
13
  - src/app/repository-config.ts
14
14
  - src/app/repository-tasks.ts
@@ -9,7 +9,7 @@ description: >
9
9
  metadata:
10
10
  type: core
11
11
  library: "@r_masseater/msch"
12
- library_version: 0.129.0
12
+ library_version: 0.129.2
13
13
  sources:
14
14
  - src/app/vite.d.ts
15
15
  - src/features/build-workspace-settings
@@ -1 +0,0 @@
1
- {"version":3,"file":"define-lint-preset-D3jb88wH.mjs","names":["Rec","Arr","Str","effectPresets","decisionPlugin","shadcn","Str","Arr","Arr","Str","Rec","Str","Arr"],"sources":["../src/shared/config/exempt.ts","../src/features/define-lint-preset/config/lint-overrides.config.ts","../src/features/define-lint-preset/config/decision-rules.ts","../src/features/define-lint-preset/config/web-guidance.config.ts","../src/features/define-lint-preset/config/lint.config.ts","../src/features/define-lint-preset/config/test-rules.config.ts","../src/features/define-lint-preset/config/preset.ts","../src/features/define-lint-preset/config/required-stack.config.ts","../src/features/define-lint-preset/config/traced-rules.config.ts","../src/features/define-lint-preset/config/remotion-rules.config.ts","../src/features/define-lint-preset/config/video-rules.config.ts","../src/features/define-lint-preset/config/structure.config.ts","../src/features/define-lint-preset/config/kuromojin.config.ts","../src/features/define-lint-preset/config/textlint-presets.config.ts","../src/features/define-lint-preset/config/textlint-filters.config.ts","../src/features/define-lint-preset/config/zenn-markdown.config.ts","../src/features/define-lint-preset/config/markdown.config.ts"],"sourcesContent":["export const generated = [\n \"**/routeTree.gen.ts\",\n \"**/generated/**\",\n \"**/drizzle/**/snapshot.json\",\n \".claude/skills/**\",\n \".intent/**\",\n \"AGENTS.md\",\n \"CLAUDE.md\",\n \"**/CHANGELOG.md\",\n \".github/release-please/*manifest.json\",\n \"**/.release-please-manifest.json\",\n \"**/*.d.*.ts\",\n \"**/src-tauri/gen/**\",\n \"**/.claude-plugin/types/**\",\n];\n\nconst checkerInputs = [\"**/fixtures/**\"];\n\nconst vendored = [\"**/upstream/**\", \"**/hooks/vendor/**\"];\n\nexport const exempt = [...generated, ...checkerInputs, ...vendored];\n","export const resourceRules = {\n \"msch-lint/worker-logpush\": \"error\",\n \"msch-lint/worker-cpu-limit\": \"error\",\n \"msch-lint/attributed-model-call\": \"error\",\n \"msch-lint/gated-model-call\": \"error\",\n \"msch-lint/gated-model-request\": \"error\",\n \"msch-lint/workers-ai-through-runner\": \"error\",\n \"msch-lint/ai-gateway-logs\": \"error\",\n \"msch-lint/ai-gateway-spend-limit\": \"error\",\n \"msch-lint/ai-gateway-cache\": \"error\",\n} as const;\n\nexport const removalPolicyOverride: {\n files: string[];\n excludeFiles: string[];\n rules: Readonly<Record<string, \"error\">>;\n} = {\n files: [\"**/*.ts\"],\n excludeFiles: [\"**/*.test.ts\"],\n rules: { \"msch-lint/protected-storage\": \"error\" },\n};\n\nexport const alchemyOverride: {\n files: string[];\n rules: Readonly<Record<string, \"error\">>;\n} = {\n files: [\"**/alchemy.run.ts\"],\n rules: {\n \"msch-lint/stack-named-by-app\": \"error\",\n \"msch-lint/stack-checks-app-prefix\": \"error\",\n },\n};\n\nexport const commandsOverride: {\n files: string[];\n rules: Readonly<Record<string, \"error\">>;\n} = {\n files: [\"**/bin/**\"],\n rules: {\n \"msch-lint/wiring-only-commands\": \"error\",\n },\n};\n","import { createDecisionPlugin, defineDecisionRule } from \"@r_masseater/oxlint-plugin-decision\";\n\nexport default createDecisionPlugin({\n name: \"stack\",\n rules: [\n defineDecisionRule({\n id: \"exclusive-status\",\n target: \"file\",\n question:\n \"Does this code represent one piece of state with several boolean flags or optional fields whose combinations can contradict each other, instead of one exclusive status expressed as a discriminated union? Answer no when every state is a single exclusive status, or when the file holds no such state. A violation needs two or more booleans or optional fields that describe the same piece of state; a single boolean value, parameter, return value or field is not a violation, and a union of objects told apart by a status or kind field is already an exclusive status. A constant configuration object whose shape a library fixes, such as an OpenFeature flag definition, holds no state and is not a violation.\",\n message: \"状態は排他的なstatusを持つ判別共用体で表し、booleanフラグの組を使わない。\",\n cutoff: 0.8,\n }),\n defineDecisionRule({\n id: \"server-state-tanstack-query\",\n target: \"file\",\n question:\n \"Does this code fetch, cache or synchronize server data on the client with something other than TanStack Query, such as fetch inside useEffect, SWR or a hand-written cache? Answer no when server data on the client goes only through TanStack Query, or when the file handles none. Creating an API client such as a better-auth or Eden client, which fetches nothing until a query calls it, is not a violation.\",\n message: \"サーバー状態はTanStack Queryだけで扱う。\",\n cutoff: 0.8,\n }),\n defineDecisionRule({\n id: \"ui-state-effect-atom\",\n target: \"file\",\n question:\n \"Does this code hold client-side UI state with something other than effect-atom, such as useState, useReducer, React context used as a store, zustand, jotai or redux? Answer no when client-side UI state is held only by effect-atom, or when the file holds none. effect-atom is Atom from effect/reactivity, read and written through @effect/atom-react hooks such as useAtomValue and useAtomSet. Creating a TanStack Query QueryClient or configuring the router, which hold no UI state, is not a violation.\",\n message: \"UI状態はeffect-atomだけで扱う。\",\n cutoff: 0.8,\n }),\n ],\n});\n","import type { UserConfig } from \"vite-plus\";\n\ntype LintRules = NonNullable<NonNullable<UserConfig[\"lint\"]>[\"rules\"]>;\n\nexport const webGuidanceRules = {\n \"jsx-a11y/no-redundant-roles\": [\"error\", { ul: [\"list\"], ol: [\"list\"] }],\n \"jsx-a11y/no-noninteractive-tabindex\": [\"error\", { tags: [\"section\"], roles: [\"tabpanel\"] }],\n} satisfies LintRules;\n","import { presets as effectPresets } from \"@effect/tsgo/oxlint-presets\";\nimport htmlReact from \"@html-eslint/eslint-plugin-react\";\nimport eslintReact from \"@r_masseater/oxlint-typed-rules/react\";\nimport { Array as Arr, Record as Rec, String as Str, Struct, pipe } from \"effect\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\n\nimport decisionPlugin from \"./decision-rules.ts\";\n\nconst asErrors = (names: readonly string[]): Readonly<Record<string, \"error\">> =>\n Rec.fromEntries(\n pipe(\n names,\n Arr.map((name) => [name, \"error\"] as const),\n ),\n );\n\nexport const allRulesOf = ({\n prefix,\n rules,\n}: Readonly<{ prefix: string; rules: Readonly<Record<string, unknown>> }>): Readonly<\n Record<string, \"error\">\n> =>\n asErrors(\n pipe(\n Rec.keys(rules),\n Arr.map((rule) => `${prefix}/${rule}`),\n ),\n );\n\nconst reactHooksRuleNames = pipe(\n Struct.keys(reactHooks.configs[\"recommended-latest\"].rules),\n Arr.map(Str.replace(\"react-hooks/\", \"react-hooks-js/\")),\n);\n\nconst reactHooksRules = asErrors(reactHooksRuleNames);\n\nconst eslintReactRuleNames = pipe(\n Rec.keys(eslintReact.configs[\"strict-typescript\"].rules ?? {}),\n Arr.filter(\n (name) => !(Str.replace(\"@eslint-react/\", \"react-hooks-js/\")(name) in reactHooksRules),\n ),\n);\n\nconst effectRuleNames = pipe(\n Rec.values(effectPresets),\n Arr.flatMap((preset) => Struct.keys(preset.rules ?? {})),\n);\n\nexport const pluginRules: Readonly<Record<string, \"error\">> = {\n ...asErrors(Rec.keys(htmlReact.configs.all.rules ?? {})),\n ...reactHooksRules,\n ...asErrors(eslintReactRuleNames),\n ...asErrors(effectRuleNames),\n};\n\nexport const decisionPluginName = decisionPlugin.meta.name;\n\nexport const decisionRules = allRulesOf({\n prefix: decisionPluginName,\n rules: decisionPlugin.rules,\n});\n\nexport const decisionTestRules = pipe(\n decisionRules,\n Rec.map(() => \"off\" as const),\n);\n\nexport const shadcnRestyleContracts = [\n { pattern: \"^Table(Head|Cell)$\", allow: [\"text-alignment\", \"fvn-spacing\"] },\n { pattern: \"^TableCaption$\", allow: [\"caption\", \"text-alignment\", \"mt-*\", \"mb-*\"] },\n];\n\nexport { webGuidanceRules } from \"./web-guidance.config.ts\";\n","import type { UserConfig } from \"vite-plus\";\n\ntype LintRules = NonNullable<NonNullable<UserConfig[\"lint\"]>[\"rules\"]>;\n\nexport const testRules = {\n \"vitest/expect-expect\": [\n \"error\",\n { assertFunctionNames: [\"expect\", \"expect*\", \"assert*\", \"waitFor*\", \"run\", \"*.run\"] },\n ],\n \"vitest/valid-expect\": [\"error\", { maxArgs: 2 }],\n \"vitest/valid-title\": [\"error\", { allowArguments: true }],\n \"vitest/prefer-called-times\": \"off\",\n \"vitest/prefer-import-in-mock\": \"off\",\n \"vitest/no-standalone-expect\": \"off\",\n \"vitest/no-conditional-in-test\": \"off\",\n \"vitest/require-test-timeout\": \"off\",\n \"vitest/prefer-expect-assertions\": \"off\",\n \"vitest/require-top-level-describe\": \"off\",\n \"vitest/no-importing-vitest-globals\": \"off\",\n \"vitest/require-hook\": \"off\",\n \"vitest/no-hooks\": \"off\",\n \"vitest/consistent-test-it\": \"off\",\n \"vitest/prefer-describe-function-title\": \"off\",\n \"vitest/prefer-lowercase-title\": \"off\",\n \"vitest/prefer-to-be-truthy\": \"off\",\n \"vitest/prefer-to-be-falsy\": \"off\",\n \"vitest/padding-around-after-all-blocks\": \"off\",\n \"vitest/padding-around-test-blocks\": \"off\",\n \"vitest/max-expects\": \"off\",\n} satisfies LintRules;\n\nexport const testHonestyRules = {\n \"msch-lint/no-test-doubles\": \"error\",\n \"msch-lint/no-flake-masking\": \"error\",\n} satisfies LintRules;\n","import { fileURLToPath } from \"node:url\";\n\nimport tanstackQuery from \"@r_masseater/oxlint-typed-rules/tanstack-query\";\nimport tanstackRouter from \"@r_masseater/oxlint-typed-rules/tanstack-router\";\nimport { plugin as shadcn } from \"@shadcn/lint\";\nimport baselineJs from \"eslint-plugin-baseline-js\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport { DECISION_MODEL, DECISION_TIMEOUT_MS, generated } from \"#/shared/config/index.ts\";\n\nimport {\n alchemyOverride,\n commandsOverride,\n removalPolicyOverride,\n resourceRules,\n} from \"./lint-overrides.config.ts\";\nimport {\n allRulesOf,\n decisionPluginName,\n pluginRules,\n shadcnRestyleContracts,\n webGuidanceRules,\n} from \"./lint.config.ts\";\nimport { testHonestyRules, testRules } from \"./test-rules.config.ts\";\n\ntype LintConfig = NonNullable<UserConfig[\"lint\"]>;\n\nconst PACKAGE_STYLESHEETS_BUT_TAILWIND = \"^(?!tailwindcss(?:/|$))\";\n\nconst resolved = (specifier: string): string => fileURLToPath(import.meta.resolve(specifier));\n\nconst typedRules = \"@r_masseater/oxlint-typed-rules\";\n\nconst jsPlugins = [\n { name: \"vite-plus\", specifier: resolved(\"vite-plus/oxlint-plugin\") },\n { name: \"tanstack-query\", specifier: resolved(`${typedRules}/tanstack-query`) },\n { name: \"tanstack-router\", specifier: resolved(`${typedRules}/tanstack-router`) },\n { name: \"tanstack-start\", specifier: resolved(`${typedRules}/tanstack-start`) },\n { name: \"drizzle\", specifier: resolved(`${typedRules}/drizzle`) },\n { name: \"react-hooks-js\", specifier: resolved(\"eslint-plugin-react-hooks\") },\n { name: \"@eslint-react\", specifier: resolved(`${typedRules}/react`) },\n { name: \"@remotion\", specifier: resolved(`${typedRules}/remotion`) },\n { name: \"shadcn\", specifier: resolved(\"@shadcn/lint\") },\n { name: \"baseline-js\", specifier: resolved(\"@r_masseater/msch/baseline-rules\") },\n { name: \"@html-eslint/react\", specifier: resolved(\"@html-eslint/eslint-plugin-react\") },\n { name: \"eslint-js\", specifier: resolved(\"oxlint-plugin-eslint\") },\n { name: decisionPluginName, specifier: resolved(\"@r_masseater/msch/decision-rules\") },\n { name: \"msch-lint\", specifier: resolved(\"@r_masseater/msch/lint-rules\") },\n];\n\nconst rules = {\n \"vite-plus/prefer-vite-plus-imports\": \"error\",\n \"tanstack-start/no-async-client-component\": \"error\",\n \"tanstack-start/no-client-code-in-server-component\": \"error\",\n ...allRulesOf({ prefix: \"tanstack-query\", rules: tanstackQuery.rules }),\n ...allRulesOf({ prefix: \"tanstack-router\", rules: tanstackRouter.rules }),\n \"drizzle/enforce-delete-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n \"drizzle/enforce-update-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n ...allRulesOf({ prefix: \"shadcn\", rules: shadcn.rules }),\n \"shadcn/no-restyle\": [\"error\", { contracts: shadcnRestyleContracts }],\n ...allRulesOf({ prefix: \"baseline-js\", rules: baselineJs.rules }),\n ...baselineJs.configs.recommended().rules,\n \"baseline-js/use-baseline\": [\n \"error\",\n {\n available: \"widely\",\n ignoreFeatures: [\"top-level-await\"],\n includeWebApis: { preset: \"auto\" },\n includeJsBuiltins: { preset: \"auto\" },\n },\n ],\n ...pluginRules,\n \"eslint/capitalized-comments\": \"off\",\n \"eslint/sort-imports\": \"off\",\n \"eslint/sort-keys\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/exports-last\": \"off\",\n \"import/no-namespace\": \"off\",\n ...testRules,\n ...webGuidanceRules,\n \"msch-lint/array-from-async\": \"error\",\n \"msch-lint/declared-arguments\": \"error\",\n \"msch-lint/ecosystem-readers\": \"error\",\n \"msch-lint/explicit-import-path\": \"error\",\n \"msch-lint/get-or-insert\": \"error\",\n \"msch-lint/mcp-tool-layer\": \"error\",\n \"msch-lint/namespace-as-value\": \"error\",\n \"msch-lint/main-through-node-main\": \"error\",\n \"msch-lint/inline-exports\": \"error\",\n \"msch-lint/ui-state-in-atoms\": \"error\",\n \"msch-lint/no-hand-written-sql\": \"error\",\n \"msch-lint/platform-node-by-module\": \"error\",\n \"msch-lint/readonly-parameters\": \"error\",\n \"msch-lint/separate-min-max\": \"error\",\n \"msch-lint/typed-calls-not-reflect\": \"error\",\n \"react/react-in-jsx-scope\": \"off\",\n \"eslint/no-undef\": \"off\",\n \"typescript/promise-function-async\": \"off\",\n \"react/forbid-component-props\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n \"node/no-top-level-await\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"import/no-unassigned-import\": [\"error\", { allow: [\"**/*.css\", \"reflect-metadata\"] }],\n \"eslint/new-cap\": [\"error\", { capIsNew: false }],\n \"eslint/one-var\": [\"error\", \"never\"],\n \"unicorn/relative-url-style\": [\"error\", \"always\"],\n \"eslint/id-length\": [\"error\", { exceptions: [\"x\", \"y\"] }],\n \"jsdoc/check-tag-names\": [\"error\", { definedTags: [\"msch\", \"stability\"] }],\n \"jsdoc/require-param\": [\"error\", { exemptedBy: [\"inheritdoc\", \"internal\", \"msch\", \"stability\"] }],\n \"jsdoc/require-returns\": [\n \"error\",\n { exemptedBy: [\"inheritdoc\", \"internal\", \"msch\", \"stability\"] },\n ],\n ...resourceRules,\n \"effecttsgo/missing-pipeable-signature\": \"off\",\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"eslint/no-duplicate-imports\": [\"error\", { allowSeparateTypeImports: true }],\n \"react/function-component-definition\": [\n \"error\",\n { namedComponents: \"arrow-function\", unnamedComponents: \"arrow-function\" },\n ],\n \"typescript/no-empty-interface\": [\"error\", { allowSingleExtends: true }],\n \"typescript/no-empty-object-type\": [\"error\", { allowInterfaces: \"with-single-extends\" }],\n \"react/jsx-filename-extension\": [\"error\", { extensions: [\".tsx\"] }],\n \"react/only-export-components\": [\"error\", { allowExportNames: [\"Route\"] }],\n} satisfies LintConfig[\"rules\"];\n\nconst actionScriptsOverride = {\n files: [\".github/**/*.ts\"],\n rules: {\n \"baseline-js/use-baseline\": \"off\",\n \"effecttsgo/async-function\": \"off\",\n \"effecttsgo/global-console\": \"off\",\n \"effecttsgo/global-fetch\": \"off\",\n \"effecttsgo/global-json\": \"off\",\n \"effecttsgo/node-builtin-import\": \"off\",\n \"effecttsgo/prefer-effect-array\": \"off\",\n \"effecttsgo/prefer-effect-record\": \"off\",\n \"effecttsgo/prefer-effect-string\": \"off\",\n \"effecttsgo/process-env\": \"off\",\n \"eslint/no-console\": \"off\",\n \"eslint/no-undefined\": \"off\",\n \"import/no-relative-parent-imports\": \"off\",\n \"node/no-process-env\": \"off\",\n \"node/no-sync\": \"off\",\n \"oxc/no-async-await\": \"off\",\n \"unicorn/no-process-exit\": \"off\",\n },\n} satisfies NonNullable<LintConfig[\"overrides\"]>[number];\n\nconst overrides = [\n removalPolicyOverride,\n actionScriptsOverride,\n alchemyOverride,\n {\n files: [\"**/*.config.ts\", \"**/alchemy.*.ts\", \"**/decision-rules.ts\"],\n rules: { \"import/no-default-export\": \"off\" },\n },\n commandsOverride,\n {\n files: [\"**/*.test.ts\", \"**/*.test.tsx\", \"**/*.test.support.ts\", \"**/vite.config.ts\"],\n rules: { \"msch-lint/declared-arguments\": \"off\", ...testHonestyRules },\n },\n {\n files: [\"**/vite.config.ts\"],\n rules: {\n \"eslint/max-lines\": \"off\",\n \"eslint/max-lines-per-function\": \"off\",\n \"baseline-js/use-baseline\": \"off\",\n },\n },\n] satisfies LintConfig[\"overrides\"];\n\nexport const lint = {\n ignorePatterns: generated,\n plugins: [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"react\",\n \"react-perf\",\n \"jsx-a11y\",\n \"jsdoc\",\n \"vitest\",\n \"promise\",\n \"node\",\n \"effecttsgo\",\n ],\n categories: {\n correctness: \"error\",\n suspicious: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n style: \"error\",\n restriction: \"error\",\n nursery: \"error\",\n },\n jsPlugins,\n rules,\n overrides,\n settings: {\n shadcn: { themeImports: [PACKAGE_STYLESHEETS_BUT_TAILWIND] },\n [decisionPluginName]: {\n model: DECISION_MODEL,\n timeoutMs: DECISION_TIMEOUT_MS,\n ci: \"skip\",\n },\n },\n options: {\n typeAware: true,\n typeCheck: true,\n denyWarnings: true,\n reportUnusedDisableDirectives: \"error\",\n },\n} satisfies LintConfig;\n","const UI_STATE = \"UI 状態は effect-atom だけで扱う\";\n\nexport const INSTRUMENTATION = \"計装は Effect のトレーシングだけで扱う\";\nconst INFRASTRUCTURE = \"インフラは Alchemy の IaC と Cloudflare だけで扱い、wrangler は使わない\";\n\nexport const requiredStack: Readonly<Record<string, readonly string[]>> = {\n [UI_STATE]: [\n \"zustand\",\n \"jotai\",\n \"valtio\",\n \"recoil\",\n \"mobx\",\n \"mobx-*\",\n \"redux\",\n \"@reduxjs/*\",\n \"react-redux\",\n \"xstate\",\n \"@xstate/*\",\n \"nanostores\",\n \"@nanostores/*\",\n \"@preact/signals*\",\n ],\n \"サーバー状態は TanStack Query と Eden だけで扱う\": [\n \"swr\",\n \"react-query\",\n \"@apollo/*\",\n \"urql\",\n \"@urql/*\",\n \"axios\",\n \"ky\",\n \"ofetch\",\n \"got\",\n \"node-fetch\",\n \"graphql-request\",\n \"@trpc/*\",\n ],\n \"ルーティングとサーバーは TanStack Start と Elysia だけで扱う\": [\n \"react-router\",\n \"react-router-dom\",\n \"next\",\n \"@remix-run/*\",\n \"wouter\",\n \"express\",\n \"hono\",\n \"fastify\",\n \"koa\",\n \"@nestjs/*\",\n ],\n \"データベースは Drizzle だけで扱い、スキーマはマイグレーションで生成する\": [\n \"prisma\",\n \"@prisma/*\",\n \"typeorm\",\n \"sequelize\",\n \"kysely\",\n \"knex\",\n \"@mikro-orm/*\",\n \"better-sqlite3\",\n \"pg\",\n \"mysql2\",\n ],\n \"認証は better-auth だけで扱う\": [\n \"next-auth\",\n \"@auth/*\",\n \"lucia\",\n \"passport\",\n \"passport-*\",\n \"@clerk/*\",\n \"firebase/auth\",\n \"@supabase/*\",\n ],\n \"UI は shadcn/ui と Tailwind CSS だけで組む\": [\n \"@mui/*\",\n \"antd\",\n \"@chakra-ui/*\",\n \"@mantine/*\",\n \"styled-components\",\n \"@emotion/*\",\n \"bootstrap\",\n \"react-bootstrap\",\n ],\n \"検証、日時、ログ、関数型ユーティリティは Effect だけで扱う\": [\n \"zod\",\n \"yup\",\n \"joi\",\n \"valibot\",\n \"arktype\",\n \"io-ts\",\n \"superstruct\",\n \"moment\",\n \"dayjs\",\n \"date-fns\",\n \"luxon\",\n \"winston\",\n \"pino\",\n \"bunyan\",\n \"loglevel\",\n \"lodash\",\n \"lodash-es\",\n \"ramda\",\n \"rxjs\",\n \"fp-ts\",\n \"neverthrow\",\n \"ts-results\",\n \"purify-ts\",\n ],\n \"CSV は effect/encoding の Csv だけで読み書きする\": [\n \"papaparse\",\n \"csv-parse\",\n \"csv-parser\",\n \"csv-stringify\",\n \"fast-csv\",\n \"@fast-csv/*\",\n \"d3-dsv\",\n ],\n \"tar は effect/encoding の Tar だけで読み書きする\": [\n \"modern-tar\",\n \"nanotar\",\n \"tar\",\n \"tar-stream\",\n \"tar-fs\",\n \"tar-js\",\n \"tarts\",\n \"it-tar\",\n ],\n \"エージェントスキルは vite.config.ts の skills に書き、msch --prepare で入れる\": [\"skills\"],\n \"フィーチャーフラグは OpenFeature だけで扱う\": [\n \"launchdarkly-*\",\n \"@launchdarkly/*\",\n \"@growthbook/*\",\n \"unleash-client\",\n \"flagsmith\",\n \"@vercel/flags\",\n ],\n \"テストは Vitest と Playwright だけで扱う\": [\n \"jest\",\n \"jest-*\",\n \"@jest/*\",\n \"ts-jest\",\n \"mocha\",\n \"jasmine\",\n \"jasmine-core\",\n \"ava\",\n \"cypress\",\n \"tap\",\n \"uvu\",\n ],\n \"決済は Stripe だけで扱う\": [\n \"@paypal/*\",\n \"paypal-rest-sdk\",\n \"braintree\",\n \"@paddle/*\",\n \"@lemonsqueezy/*\",\n \"square\",\n ],\n \"整形は Vite+ の vp fmt だけで扱う\": [\n \"prettier\",\n \"prettier-plugin-*\",\n \"@prettier/*\",\n \"@biomejs/*\",\n \"dprint\",\n ],\n \"lint は Vite+ の vp lint だけで扱い、ESLint のプラグインは oxlint の JS プラグインとして読む\": [\n \"eslint\",\n \"@eslint/*\",\n \"eslint-config-*\",\n \"tslint\",\n \"standard\",\n \"xo\",\n ],\n [INSTRUMENTATION]: [\"@opentelemetry/*\", \"dd-trace\", \"newrelic\"],\n [INFRASTRUCTURE]: [\n \"wrangler\",\n \"miniflare\",\n \"@cloudflare/vite-plugin\",\n \"@vercel/*\",\n \"@netlify/*\",\n \"aws-cdk\",\n \"aws-cdk-lib\",\n \"@pulumi/*\",\n \"cdktf\",\n ],\n};\n","export const tracedRules = {\n \"msch-lint/traced-elysia\": \"error\",\n \"msch-lint/traced-effect-run\": \"error\",\n} as const;\n","import remotion from \"@r_masseater/oxlint-typed-rules/remotion\";\n\nimport { allRulesOf } from \"./lint.config.ts\";\n\nexport const remotionRules = allRulesOf({ prefix: \"@remotion\", rules: remotion.rules });\n","import type { VideoIntro } from \"#/shared/config/index.ts\";\n\nexport interface VideoSayOptions {\n readonly terms?: Readonly<Record<string, string>>;\n readonly banned?: Readonly<Record<string, string>>;\n readonly maxEmphasis?: number;\n}\n\nexport interface VideoSeriesOptions {\n readonly values?: Readonly<Record<string, string>>;\n readonly voices?: readonly string[];\n readonly opener?: string;\n readonly closer?: string;\n readonly intro?: VideoIntro;\n readonly introValues?: Readonly<Record<string, string>>;\n readonly afterIntro?: Readonly<Record<string, string>>;\n}\n\nexport interface VideoRulesOptions {\n readonly say: VideoSayOptions;\n readonly series: Readonly<Record<string, VideoSeriesOptions>>;\n readonly banned?: Readonly<Record<string, string>>;\n}\n\nexport const videoRules = ({ say, series, banned = {} }: VideoRulesOptions) =>\n ({\n \"msch-lint/video-say\": [\"error\", say],\n \"msch-lint/video-readings\": \"error\",\n \"msch-lint/video-series\": [\"error\", { series, banned }],\n }) as const;\n","import type { WismConfig } from \"@r_masseater/wism\";\nimport { rustCrate, skill, structure, workspace } from \"@r_masseater/wism/presets\";\nimport { Array as Arr, Predicate, String as Str, pipe } from \"effect\";\n\nconst NEGATION = \"!\";\nconst isIgnore = Predicate.not(Str.startsWith(NEGATION));\n\nexport interface StructureOptions {\n readonly members: readonly string[];\n readonly ignorePatterns: readonly string[];\n}\n\nexport const structureOf = ({ members, ignorePatterns }: StructureOptions): WismConfig =>\n structure({\n kinds: [workspace({ paths: members }), rustCrate(), skill()],\n ignores: pipe(ignorePatterns, Arr.filter(isIgnore)),\n });\n","import { createRequire, registerHooks } from \"node:module\";\n\nexport const KUROMOJIN = \"kuromojin\";\nconst ON_Y8 = \"@r_masseater/y8/kuromojin\";\n\nexport const requireWithY8Kuromojin = (parentUrl: string): NodeJS.Require => {\n registerHooks({\n resolve: (specifier, context, nextResolve) => {\n if (specifier === KUROMOJIN) {\n return nextResolve(ON_Y8, { ...context, parentURL: import.meta.url });\n }\n return nextResolve(specifier, context);\n },\n });\n return createRequire(parentUrl);\n};\n","import presetJa from \"@r_masseater/textlint-rule-preset-ja\";\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Array as Arr, Option, Predicate, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { requireWithY8Kuromojin } from \"./kuromojin.config.ts\";\n\ntype Preset = NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"presets\"]>[string];\ntype Rule = Preset[\"rules\"][string];\ntype Reporter = Extract<Rule, (...args: never) => unknown>;\ntype Fixable = Exclude<Rule, Reporter>;\n\nconst NO_HANDLERS = {};\nconst CONTEXT = 0;\nconst JAPANESE_LETTERS = /[\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Han}]/gv;\nconst LATIN_WORDS = /\\p{Script=Latin}+/gv;\nconst NONE = 0;\n\nconst countOf = (text: string, pattern: RegExp): number =>\n Arr.length(Str.match(text, pattern).pipe(Option.getOrElse(() => [])));\n\nconst writtenInJapanese = (text: string): boolean => {\n const letters = countOf(text, JAPANESE_LETTERS);\n return letters > NONE && letters >= countOf(text, LATIN_WORDS);\n};\n\nconst isPreset = (value: unknown): value is Preset =>\n Predicate.hasProperty(value, \"rules\") &&\n Predicate.isObject(value.rules) &&\n Predicate.hasProperty(value, \"rulesConfig\") &&\n Predicate.isObject(value.rulesConfig);\n\nconst presetIn = (value: unknown): Option.Option<Preset> => {\n if (isPreset(value)) {\n return Option.some(value);\n }\n if (Predicate.hasProperty(value, \"default\")) {\n return presetIn(value.default);\n }\n return Option.none();\n};\n\nconst required = requireWithY8Kuromojin(import.meta.url);\n\nconst presetOf = (specifier: string, loaded: unknown): Preset =>\n Option.getOrThrowWith(\n presetIn(loaded),\n () => new TypeError(`${specifier} does not export a textlint preset`),\n );\n\ntype Context = Parameters<Reporter>[typeof CONTEXT];\n\nconst reportingJapanese = (context: Context): Context => ({\n get id(): Context[\"id\"] {\n return context.id;\n },\n get Syntax(): Context[\"Syntax\"] {\n return context.Syntax;\n },\n get severity(): Context[\"severity\"] {\n return context.severity;\n },\n get RuleError(): Context[\"RuleError\"] {\n return context.RuleError;\n },\n get fixer(): Context[\"fixer\"] {\n return context.fixer;\n },\n get locator(): Context[\"locator\"] {\n return context.locator;\n },\n getFilePath: () => context.getFilePath(),\n getSource: (node, beforeCount, afterCount) => context.getSource(node, beforeCount, afterCount),\n getConfigBaseDir: () => context.getConfigBaseDir(),\n report: (node, error): void => {\n if (writtenInJapanese(context.getSource(node))) {\n context.report(node, error);\n }\n },\n});\n\nconst japaneseOnly =\n (reporter: Reporter): Reporter =>\n (context, options) => {\n if (writtenInJapanese(context.getSource())) {\n return reporter(reportingJapanese(context), options);\n }\n return NO_HANDLERS;\n };\n\nconst forJapanese = (rule: Reporter | Readonly<Fixable>): Rule => {\n if (Predicate.isFunction(rule)) {\n return japaneseOnly(rule);\n }\n return { linter: japaneseOnly(rule.linter), fixer: japaneseOnly(rule.fixer) };\n};\n\nconst japanesePreset = (specifier: string, loaded: unknown): Preset => {\n const { rules, rulesConfig } = presetOf(specifier, loaded);\n return { rules: pipe(rules, Rec.map(forJapanese)), rulesConfig };\n};\n\nexport const textlintPresets: NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"presets\"]> = {\n \"@r_masseater/preset-ja\": japanesePreset(\"@r_masseater/textlint-rule-preset-ja\", presetJa),\n \"@textlint-ja/preset-ai-writing\": japanesePreset(\n \"@textlint-ja/textlint-rule-preset-ai-writing\",\n required(\"@textlint-ja/textlint-rule-preset-ai-writing\"),\n ),\n \"preset-ja-technical-writing\": japanesePreset(\n \"textlint-rule-preset-ja-technical-writing\",\n required(\"textlint-rule-preset-ja-technical-writing\"),\n ),\n};\n","import { createRequire } from \"node:module\";\n\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Option, Predicate, pipe } from \"effect\";\n\ntype Filter = NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"filterModules\"]>[string];\n\nconst isFilter = (value: unknown): value is Filter => Predicate.isFunction(value);\n\nconst filterIn = (specifier: string, loaded: unknown): Filter =>\n pipe(\n Option.liftPredicate(loaded, isFilter),\n Option.getOrThrowWith(() => new TypeError(`${specifier} does not export a textlint filter`)),\n );\n\nconst defaultOf = (loaded: unknown): unknown =>\n pipe(\n Option.liftPredicate(loaded, Predicate.hasProperty(\"default\")),\n Option.map((module) => module.default),\n Option.getOrElse(() => loaded),\n );\n\nexport const textlintFilters: NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"filterModules\"]> =\n {\n comments: filterIn(\n \"textlint-filter-rule-comments\",\n createRequire(import.meta.url)(\"textlint-filter-rule-comments\"),\n ),\n \"node-types\": filterIn(\n \"textlint-filter-rule-node-types\",\n createRequire(import.meta.url)(\"textlint-filter-rule-node-types\"),\n ),\n allowlist: filterIn(\n \"textlint-filter-rule-allowlist\",\n defaultOf(createRequire(import.meta.url)(\"textlint-filter-rule-allowlist\")),\n ),\n };\n","import markdown from \"@textlint/textlint-plugin-markdown\";\nimport type { TextlintPluginOptions } from \"@textlint/types\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nconst CONTAINER_FENCE = \":::\";\nconst LINE_BREAK = \"\\n\";\nconst BLANK = \" \";\nconst IMAGE_SIZE = /(?<=!\\[[^\\]]*\\]\\(\\S+) =\\d*x\\d*(?=\\))/gu;\nconst NEXT = 1;\n\ntype MarkdownProcessor = InstanceType<typeof markdown.Processor>;\ntype Processing = ReturnType<MarkdownProcessor[\"processor\"]>;\n\nconst spaces = (text: string): string => Str.repeat(text.length)(BLANK);\n\nconst sizeIndices = (line: string): readonly number[] =>\n pipe(\n Arr.fromIterable(Str.matchAll(IMAGE_SIZE)(line)),\n Arr.flatMap((found) =>\n pipe(\n Option.fromUndefinedOr(found.index),\n Option.map((start) =>\n pipe(\n Arr.head(found),\n Option.map((size) => Arr.range(start, start + size.length - NEXT)),\n Option.getOrElse((): readonly number[] => []),\n ),\n ),\n Option.getOrElse((): readonly number[] => []),\n ),\n ),\n );\n\nconst withoutImageSizes = (line: string): string => {\n const blankAt = sizeIndices(line);\n return pipe(\n Str.split(\"\")(line),\n Arr.map((character, index) => {\n if (Arr.contains(blankAt, index)) {\n return BLANK;\n }\n return character;\n }),\n Arr.join(\"\"),\n );\n};\n\nconst blankedLine = (line: string): string => {\n if (Str.startsWith(CONTAINER_FENCE)(line)) {\n return spaces(line);\n }\n return withoutImageSizes(line);\n};\n\nconst blanked = (text: string): string =>\n pipe(text, Str.split(LINE_BREAK), Arr.map(blankedLine), Arr.join(LINE_BREAK));\n\nclass ZennMarkdownProcessor {\n private readonly markdown: MarkdownProcessor;\n\n public constructor(options?: TextlintPluginOptions) {\n this.markdown = new markdown.Processor(options);\n }\n\n public availableExtensions(): string[] {\n return this.markdown.availableExtensions();\n }\n\n public processor(extension: string): Processing {\n const { preProcess, postProcess } = this.markdown.processor(extension);\n return {\n preProcess: (text, filePath) => preProcess(blanked(text), filePath),\n postProcess,\n };\n }\n}\n\nexport const zennMarkdown = { Processor: ZennMarkdownProcessor };\n","import type { Y8Config } from \"@r_masseater/y8\";\nimport { recommended } from \"@r_masseater/y8/presets\";\nimport type { RecommendedOptions } from \"@r_masseater/y8/presets\";\nimport { Option } from \"effect\";\n\nimport { exempt } from \"#/shared/config/index.ts\";\n\ntype SkillNames = NonNullable<NonNullable<RecommendedOptions[\"skills\"]>[\"skillNames\"]>;\n\nconst skillNamesOf = (indexSkill: Option.Option<string>): SkillNames =>\n Option.match(indexSkill, {\n onNone: (): SkillNames => ({}),\n onSome: (index): SkillNames => ({ index }),\n });\n\nconst docsOf = (indexSkill: Option.Option<string>): RecommendedOptions => {\n const skillNames = skillNamesOf(indexSkill);\n return {\n agents: {\n sections: [[\"Tech stack\"], [\"Commands\"], [\"Rules\"]],\n commands: [\"Commands\"],\n stack: [\"Tech stack\"],\n skillNames,\n },\n skills: { skillNames },\n };\n};\n\nexport const MARKDOWN_IGNORES = [\".agents/skills/**\", \"CHANGELOG.md\", \"**/CLAUDE.md\", ...exempt];\n\nexport const MARKDOWN_RULES = { \"agnix/XP-001\": \"off\" } as const;\n\nexport interface MarkdownOptions {\n readonly indexSkill: Option.Option<string>;\n readonly docs?: RecommendedOptions;\n}\n\nexport const markdownOf = ({ indexSkill, docs = {} }: MarkdownOptions): Y8Config => {\n const base = docsOf(indexSkill);\n return {\n extends: [\n recommended({\n ...base,\n ...docs,\n agents: { ...base.agents, ...docs.agents },\n skills: { ...base.skills, ...docs.skills },\n }),\n ],\n rules: MARKDOWN_RULES,\n reportUnusedDirectives: true,\n ignores: MARKDOWN_IGNORES,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,MAAa,YAAY;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAC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mC;IACnC,0BAA0B;IAC1B,qBAAqB;IACrB,uBAAuB;IACvB,qCAAqC;IACrC,uBAAuB;IACvB,gBAAgB;IAChB,sBAAsB;IACtB,2BAA2B;GAC7B;EAKoB;EACpB;EACA;GACE,OAAO;IAAC;IAAkB;IAAmB;GAAsB;GACnE,OAAO,EAAE,4BAA4B,MAAM;EAC7C;EACA;EACA;GACE,OAAO;IAAC;IAAgB;IAAiB;IAAwB;GAAmB;GACpF,OAAO;IAAE,gCAAgC;IAAO,GAAG;GAAiB;EACtE;EACA;GACE,OAAO,CAAC,mBAAmB;GAC3B,OAAO;IACL,oBAAoB;IACpB,iCAAiC;IACjC,4BAA4B;GAC9B;EACF;CA+BA;CACA,UAAU;EACR,QAAQ,EAAE,cAAc,CAAC,gCAAgC,EAAE;GAC1D,qBAAqB;GACpB,OAAO;GACP,WAAW;GACX,IAAI;EACN;CACF;CACA,SAAS;EACP,WAAW;EACX,WAAW;EACX,cAAc;EACd,+BAA+B;CACjC;AACF;;AC1NA,MAAM,WAAW;AAEjB,MAAa,kBAAkB;AAC/B,MAAM,iBAAiB;AAEvB,MAAa,gBAA6D;EACvE,WAAW;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uCAAuC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,8CAA8C;EAC5C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,4CAA4C;EAC1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yBAAyB;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uCAAuC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,qCAAqC;EACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;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D;CAEO,sBAAgC;EACrC,OAAO,KAAK,SAAS,oBAAoB;CAC3C;CAEO,UAAU,WAA+B;EAC9C,MAAM,EAAE,YAAY,gBAAgB,KAAK,SAAS,UAAU,SAAS;EACrE,OAAO;GACL,aAAa,MAAM,aAAa,WAAW,QAAQ,IAAI,GAAG,QAAQ;GAClE;EACF;CACF;AACF;AAEA,MAAa,eAAe,EAAE,WAAW,sBAAsB;;ACpE/D,MAAM,gBAAgB,eACpB,OAAO,MAAM,YAAY;CACvB,eAA2B,CAAC;CAC5B,SAAS,WAAuB,EAAE,MAAM;AAC1C,CAAC;AAEH,MAAM,UAAU,eAA0D;CACxE,MAAM,aAAa,aAAa,UAAU;CAC1C,OAAO;EACL,QAAQ;GACN,UAAU;IAAC,CAAC,YAAY;IAAG,CAAC,UAAU;IAAG,CAAC,OAAO;GAAC;GAClD,UAAU,CAAC,UAAU;GACrB,OAAO,CAAC,YAAY;GACpB;EACF;EACA,QAAQ,EAAE,WAAW;CACvB;AACF;AAEA,MAAa,mBAAmB;CAAC;CAAqB;CAAgB;CAAgB,GAAG;AAAM;AAE/F,MAAa,iBAAiB,EAAE,gBAAgB,MAAM;AAOtD,MAAa,cAAc,EAAE,YAAY,OAAO,CAAC,QAAmC;CAClF,MAAM,OAAO,OAAO,UAAU;CAC9B,OAAO;EACL,SAAS,CACP,YAAY;GACV,GAAG;GACH,GAAG;GACH,QAAQ;IAAE,GAAG,KAAK;IAAQ,GAAG,KAAK;GAAO;GACzC,QAAQ;IAAE,GAAG,KAAK;IAAQ,GAAG,KAAK;GAAO;EAC3C,CAAC,CACH;EACA,OAAO;EACP,wBAAwB;EACxB,SAAS;CACX;AACF"}
@@ -1 +0,0 @@
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,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