@r_masseater/msch 0.103.0 → 0.104.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-settings.mjs","names":["READ_CONCURRENCY","Arr","Rec","Arr","Str","Str","Arr","Rec","READ_CONCURRENCY","Arr","Names","Arr","Rec","Arr","Arr"],"sources":["../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, Option, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst READ_CONCURRENCY = 16;\nconst SCRIPT = /\\.[cm]?tsx?$/u;\nconst SKIPPED = /\\.test\\.|\\.d\\.[cm]?ts$/u;\nconst SERVER_ENTRY_IMPORT = /from\\s+[\"']@effect\\/ui\\/html\\/HtmlServerHttp[\"']/u;\n\nexport const siteEntries = Effect.fn(\"siteEntries\")(function* siteEntries(root: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.listedFiles(root);\n const candidates = pipe(\n listed,\n Arr.filter((file) => SCRIPT.test(file) && !SKIPPED.test(file)),\n );\n const texts = yield* Effect.forEach(\n candidates,\n (file) => files.readFile(files.join(root, file)),\n { concurrency: READ_CONCURRENCY },\n );\n return pipe(\n Arr.zip(candidates, texts),\n Arr.filter(([, text]) => Option.exists(text, (value) => SERVER_ENTRY_IMPORT.test(value))),\n Arr.map(([file]) => file),\n );\n});\n","import { depPathsOf, readWantedLockfile } from \"@r_masseater/masseater-utils/kestrion/pnpm\";\nimport type { ResolvedDependencies } from \"@r_masseater/masseater-utils/kestrion/pnpm\";\nimport { Array as Arr, Effect, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { reachable } from \"#/shared/lib/reachable.ts\";\nimport type { Edges } from \"#/shared/lib/reachable.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { linkedPaths } from \"./locked-links.ts\";\n\ntype LockedClosures = Readonly<Record<string, readonly string[]>>;\n\nconst IMPORTER = \"importer:\";\nconst ROOT_IMPORTER = \".\";\n\ntype Sections = readonly (ResolvedDependencies | undefined)[];\ntype Edge = readonly [string, readonly string[]];\n\ninterface Used {\n readonly dependencies?: ResolvedDependencies | undefined;\n readonly optionalDependencies?: ResolvedDependencies | undefined;\n}\n\ninterface Importer {\n readonly id: string;\n readonly own: readonly string[];\n readonly used: readonly string[];\n}\n\nconst usedSections = ({ dependencies, optionalDependencies }: Used): Sections => [\n dependencies,\n optionalDependencies,\n];\n\nconst packageEdges = <Package extends string>(\n packages: Readonly<Record<Package, Used>>,\n): readonly Edge[] =>\n pipe(\n Rec.toEntries(packages),\n Arr.map(([id, snapshot]): Edge => [id, pipe(usedSections(snapshot), Arr.flatMap(depPathsOf))]),\n );\n\nconst closureOf =\n (edges: Edges) =>\n ({ own }: Importer): readonly string[] => {\n const packages = pipe(\n reachable(edges, own),\n Arr.filter((id) => !Str.startsWith(IMPORTER)(id)),\n );\n return Arr.sort(packages, Str.Order);\n };\n\n/** @internal */\nexport const lockedClosures = Effect.fn(\"lockedClosures\")(function* lockedClosures(root: string) {\n const files = yield* RepositoryFiles;\n const lockfile = yield* readWantedLockfile(root);\n const nodesOf = (id: string, sections: Sections): readonly string[] => [\n ...pipe(sections, Arr.flatMap(depPathsOf)),\n ...pipe(\n linkedPaths(sections),\n Arr.map((path) => files.relative(root, files.join(root, id, path))),\n Arr.map(\n (linked) =>\n `${IMPORTER}${Option.getOrElse(Option.liftPredicate(linked, Str.isNonEmpty), () => ROOT_IMPORTER)}`,\n ),\n ),\n ];\n return pipe(\n lockfile,\n Option.map(({ importers, packages }): LockedClosures => {\n const found = pipe(\n Rec.toEntries(importers),\n Arr.map(([id, project]): Importer => {\n const used = usedSections(project);\n return {\n id,\n own: nodesOf(id, [...used, project.devDependencies]),\n used: nodesOf(id, used),\n };\n }),\n );\n const edges = Rec.fromEntries([\n ...pipe(\n found,\n Arr.map(({ id, used }): Edge => [`${IMPORTER}${id}`, used]),\n ),\n ...packageEdges(packages ?? {}),\n ]);\n return Rec.fromEntries(\n pipe(\n found,\n Arr.map((importer) => [importer.id, closureOf(edges)(importer)] as const),\n ),\n );\n }),\n );\n});\n","import { Array as Arr, Effect, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { CLOSURE_FILE, FINGERPRINT_FILE, LOCK_FILE } from \"#/shared/lib/locked-closure-paths.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { lockedClosures } from \"./locked-closures.ts\";\n\nconst LINE = \"\\n\";\nconst FILE_CONCURRENCY = 16;\n\nconst writeChanged = Effect.fn(\"writeChanged\")(function* writeChanged(file: string, text: string) {\n const files = yield* RepositoryFiles;\n const written = yield* files.readFile(file);\n if (!Option.exists(written, (found) => found === text)) {\n yield* files.writeFile(file, text);\n }\n});\n\nconst isWritten = Effect.fn(\"isWritten\")(function* isWritten(root: string, fingerprint: string) {\n const files = yield* RepositoryFiles;\n const recorded = yield* files.readFile(files.join(root, FINGERPRINT_FILE));\n const [hash, ...importers] = Str.split(\n Option.getOrElse(recorded, () => \"\"),\n LINE,\n );\n if (hash !== fingerprint) {\n return false;\n }\n const present = yield* Effect.forEach(\n importers,\n (importer) => files.exists(files.join(root, importer, CLOSURE_FILE)),\n { concurrency: FILE_CONCURRENCY },\n );\n return pipe(present, Arr.every(Boolean));\n});\n\nconst writeAll = Effect.fn(\"writeAll\")(function* writeAll(root: string, fingerprint: string) {\n const files = yield* RepositoryFiles;\n const closures = yield* lockedClosures(root);\n const entries = Rec.toEntries(Option.getOrElse(closures, () => ({})));\n yield* Effect.forEach(\n entries,\n ([importer, closure]) =>\n writeChanged(files.join(root, importer, CLOSURE_FILE), Arr.join(closure, LINE)),\n { concurrency: FILE_CONCURRENCY, discard: true },\n );\n const importers = pipe(\n entries,\n Arr.map(([importer]) => importer),\n );\n yield* files.writeFile(\n files.join(root, FINGERPRINT_FILE),\n Arr.join([fingerprint, ...importers], LINE),\n );\n});\n\n/** @internal */\nexport const writeLockedClosures = Effect.fn(\"writeLockedClosures\")(function* writeLockedClosures(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const fingerprint = yield* files.hashFile(files.join(root, LOCK_FILE));\n if (Option.isNone(fingerprint)) {\n return;\n }\n const written = yield* isWritten(root, fingerprint.value);\n if (!written) {\n yield* writeAll(root, fingerprint.value);\n }\n});\n","import { Array as Arr, Effect, Option, Order, Predicate, pipe } from \"effect\";\n\nimport { splitFrontmatter } from \"#/shared/lib/frontmatter.ts\";\nimport type { Frontmatter } from \"#/shared/lib/frontmatter.ts\";\nimport { isIndexSkill } from \"#/shared/lib/index-skill.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst SKILL_DIRECTORIES = [\".agents/skills\", \".claude/skills\", \"skills\"];\nconst PLUGINS = \"plugins\";\nconst SKILLS = \"skills\";\nconst SKILL_FILE = \"SKILL.md\";\nconst READ_CONCURRENCY = 16;\n\nconst nameOf = ({ fields }: Frontmatter): Option.Option<string> =>\n Option.filter(Option.fromNullishOr(fields[\"name\"]), Predicate.isString);\n\nconst skillDirectories = Effect.fn(\"skillDirectories\")(function* skillDirectories(root: string) {\n const files = yield* RepositoryFiles;\n const plugins = yield* files.readDirectory(files.join(root, PLUGINS));\n return [\n ...SKILL_DIRECTORIES,\n ...pipe(\n plugins,\n Arr.map((plugin) => files.join(PLUGINS, plugin, SKILLS)),\n ),\n ];\n});\n\nconst skillFiles = Effect.fn(\"skillFiles\")(function* skillFiles(root: string) {\n const files = yield* RepositoryFiles;\n const directories = yield* skillDirectories(root);\n const found = yield* Effect.forEach(\n directories,\n (directory) =>\n files\n .readDirectory(files.join(root, directory))\n .pipe(Effect.map(Arr.map((name) => files.join(directory, name, SKILL_FILE)))),\n { concurrency: READ_CONCURRENCY },\n );\n return pipe(Arr.flatten(found), Arr.sortBy(Order.String));\n});\n\nconst indexNameAt = Effect.fn(\"indexNameAt\")(function* indexNameAt(root: string, file: string) {\n const files = yield* RepositoryFiles;\n const source = yield* files.readFile(files.join(root, file));\n return pipe(\n source,\n Option.flatMap(splitFrontmatter),\n Option.filter(isIndexSkill),\n Option.flatMap(nameOf),\n );\n});\n\nexport const indexSkillIn = Effect.fn(\"indexSkillIn\")(function* indexSkillIn(root: string) {\n const found = yield* skillFiles(root);\n const names = yield* Effect.forEach(found, (file) => indexNameAt(root, file), {\n concurrency: READ_CONCURRENCY,\n });\n return Arr.head(Arr.getSomes(names));\n});\n","import { Schema } from \"effect\";\n\nconst Enabled = Schema.Literals([\"error\", \"deny\"]);\n\nconst EnabledWithOptions = Schema.mutable(\n Schema.TupleWithRest(Schema.Tuple([Enabled]), [Schema.Unknown]),\n);\n\nconst AddedRule = Schema.Union([Enabled, EnabledWithOptions]);\n\nexport const AddedRules = Schema.Record(Schema.String, AddedRule);\n\nexport type AddedRulesValue = typeof AddedRules.Type;\n","import { Array as Arr, Effect, Option, Record as Rec, Schema } from \"effect\";\n\nimport { literalSettings, usedFrom } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource } from \"#/entities/workspace/index.ts\";\n\nexport type DependencySets = Readonly<Record<string, readonly string[]>>;\n\nexport interface DependencyAllowance {\n readonly workspaces: readonly string[];\n readonly dependencies: readonly string[];\n}\n\nexport type DependencyAllowances = Readonly<Record<string, DependencyAllowance>>;\n\nexport const MSCH_DEV_DEPENDENCIES = [\"msch\", \"devDependencies\"] as const;\nexport const MSCH_DEPENDENCIES = [\"msch\", \"dependencies\"] as const;\n\nconst Names = Schema.String.pipe(Schema.Array, Schema.optional);\nconst DependencySettings = Schema.Struct({ use: Names, dependencies: Names });\nconst WorkspaceDependencyAllowances = Schema.Record(Schema.String, DependencySettings);\n\nconst allowanceOf = Effect.fn(\"allowanceOf\")(function* allowanceOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n [reason, allowance]: readonly [string, typeof DependencySettings.Type],\n) {\n const sets = yield* usedFrom(source.file, dependencySets, allowance.use ?? []);\n const dependencies = [...Arr.flatten(sets), ...(allowance.dependencies ?? [])];\n return [\n `${source.directory}: ${reason}`,\n { workspaces: [source.directory], dependencies },\n ] as const;\n});\n\nexport const allowancesOf = Effect.fn(\"allowancesOf\")(function* allowancesOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n path: typeof MSCH_DEV_DEPENDENCIES | typeof MSCH_DEPENDENCIES,\n) {\n const settings = yield* literalSettings({\n source,\n path,\n decode: Schema.decodeUnknownEffect(WorkspaceDependencyAllowances),\n });\n const allowed = Rec.toEntries(Option.getOrElse(settings, () => ({})));\n const entries = yield* Effect.forEach(\n allowed,\n (entry) => allowanceOf(source, dependencySets, entry),\n { concurrency: 1 },\n );\n return Rec.fromEntries(entries);\n});\n","import type { PackageJson } from \"@r_masseater/masseater-utils/kestrion\";\nimport { Effect, Option, Schema, pipe } from \"effect\";\n\nimport { literalSettings } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource } from \"#/entities/workspace/index.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: { readonly name: string; readonly isolate: false };\n}\n\nexport type TestProject = string | SharedTestProject;\n\nexport interface ProjectPlace {\n readonly directory: string;\n readonly config: string | false;\n}\n\nexport const sharedTestProject =\n (manifest: Option.Option<PackageJson>) =>\n ({ directory, config }: 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 },\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 return sharedTestProject(manifest)({ directory: source.directory, config });\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 publishedArticlesIn,\n literalSettings,\n merged,\n programOf,\n settingsInvalid,\n siteEntries,\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 } from \"./test-project.ts\";\nimport type { TestProject } 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 ROOT_WORKSPACE = \".\";\nconst MSCH_LINT = [\"msch\", \"lint\"] as const;\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\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 ignoredDirectories: readonly IgnoredDirectory[];\n readonly testProjects: readonly TestProject[];\n readonly tasks: WorkspaceTasks;\n readonly devDependencies: DependencyAllowances;\n readonly dependencies: DependencyAllowances;\n readonly indexSkill: Option.Option<string>;\n readonly publishedArticles: 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}\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 settingsOf = Effect.fn(\"settingsOf\")(function* settingsOf(\n source: WorkspaceSource,\n options: SettingsOptions,\n) {\n const lint = yield* lintOf(source, options.ruleSets);\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 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 return {\n directory,\n overrides: [],\n devDependencies: {},\n dependencies: {},\n ownTests: false,\n testProject: sharedTestProject(manifest)({ directory, config: false }),\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 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: pipe(\n directories,\n Arr.filter((directory) => directory !== ROOT_WORKSPACE),\n ),\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 }) => testProject),\n ),\n tasks: mergedTasks(found),\n ...mergedAllowances(found),\n indexSkill: yield* indexSkillIn(options.root),\n publishedArticles: yield* publishedArticlesIn(options.root),\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":";;;;;;;;;AAIA,MAAMA,qBAAmB;AACzB,MAAM,SAAS;AACf,MAAM,UAAU;AAChB,MAAM,sBAAsB;AAE5B,MAAa,cAAc,OAAO,GAAG,aAAa,CAAC,CAAC,UAAU,YAAY,MAAc;CACtF,MAAM,QAAQ,OAAO;CACrB,MAAM,SAAS,OAAO,MAAM,YAAY,IAAI;CAC5C,MAAM,aAAa,KACjB,QACAC,MAAI,QAAQ,SAAS,OAAO,KAAK,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,CAC/D;CACA,MAAM,QAAQ,OAAO,OAAO,QAC1B,aACC,SAAS,MAAM,SAAS,MAAM,KAAK,MAAM,IAAI,CAAC,GAC/C,EAAE,aAAaD,mBAAiB,CAClC;CACA,OAAO,KACLC,MAAI,IAAI,YAAY,KAAK,GACzBA,MAAI,QAAQ,GAAG,UAAU,OAAO,OAAO,OAAO,UAAU,oBAAoB,KAAK,KAAK,CAAC,CAAC,GACxFA,MAAI,KAAK,CAAC,UAAU,IAAI,CAC1B;AACF,CAAC;;ACdD,MAAM,WAAW;AACjB,MAAM,gBAAgB;AAgBtB,MAAM,gBAAgB,EAAE,cAAc,2BAA2C,CAC/E,cACA,oBACF;AAEA,MAAM,gBACJ,aAEA,KACEC,OAAI,UAAU,QAAQ,GACtBC,MAAI,KAAK,CAAC,IAAI,cAAoB,CAAC,IAAI,KAAK,aAAa,QAAQ,GAAGA,MAAI,QAAQ,UAAU,CAAC,CAAC,CAAC,CAC/F;AAEF,MAAM,aACH,WACA,EAAE,UAAuC;CACxC,MAAM,WAAW,KACf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AUA,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,WAAW,CAC1C;EACA,OAAO,YAAY,KAAK;EACxB,GAAG,iBAAiB,KAAK;EACzB,YAAY,OAAO,aAAa,QAAQ,IAAI;EAC5C,mBAAmB,OAAO,oBAAoB,QAAQ,IAAI;CAC5D;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","Rec","Arr","Str","Str","Arr","Rec","READ_CONCURRENCY","Arr","Names","Arr","Rec","Arr","Arr"],"sources":["../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, Option, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst READ_CONCURRENCY = 16;\nconst SCRIPT = /\\.[cm]?tsx?$/u;\nconst SKIPPED = /\\.test\\.|\\.d\\.[cm]?ts$/u;\nconst SERVER_ENTRY_IMPORT = /from\\s+[\"']@effect\\/ui\\/html\\/HtmlServerHttp[\"']/u;\n\nexport const siteEntries = Effect.fn(\"siteEntries\")(function* siteEntries(root: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.listedFiles(root);\n const candidates = pipe(\n listed,\n Arr.filter((file) => SCRIPT.test(file) && !SKIPPED.test(file)),\n );\n const texts = yield* Effect.forEach(\n candidates,\n (file) => files.readFile(files.join(root, file)),\n { concurrency: READ_CONCURRENCY },\n );\n return pipe(\n Arr.zip(candidates, texts),\n Arr.filter(([, text]) => Option.exists(text, (value) => SERVER_ENTRY_IMPORT.test(value))),\n Arr.map(([file]) => file),\n );\n});\n","import { depPathsOf, readWantedLockfile } from \"@r_masseater/masseater-utils/kestrion/pnpm\";\nimport type { ResolvedDependencies } from \"@r_masseater/masseater-utils/kestrion/pnpm\";\nimport { Array as Arr, Effect, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { reachable } from \"#/shared/lib/reachable.ts\";\nimport type { Edges } from \"#/shared/lib/reachable.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { linkedPaths } from \"./locked-links.ts\";\n\ntype LockedClosures = Readonly<Record<string, readonly string[]>>;\n\nconst IMPORTER = \"importer:\";\nconst ROOT_IMPORTER = \".\";\n\ntype Sections = readonly (ResolvedDependencies | undefined)[];\ntype Edge = readonly [string, readonly string[]];\n\ninterface Used {\n readonly dependencies?: ResolvedDependencies | undefined;\n readonly optionalDependencies?: ResolvedDependencies | undefined;\n}\n\ninterface Importer {\n readonly id: string;\n readonly own: readonly string[];\n readonly used: readonly string[];\n}\n\nconst usedSections = ({ dependencies, optionalDependencies }: Used): Sections => [\n dependencies,\n optionalDependencies,\n];\n\nconst packageEdges = <Package extends string>(\n packages: Readonly<Record<Package, Used>>,\n): readonly Edge[] =>\n pipe(\n Rec.toEntries(packages),\n Arr.map(([id, snapshot]): Edge => [id, pipe(usedSections(snapshot), Arr.flatMap(depPathsOf))]),\n );\n\nconst closureOf =\n (edges: Edges) =>\n ({ own }: Importer): readonly string[] => {\n const packages = pipe(\n reachable(edges, own),\n Arr.filter((id) => !Str.startsWith(IMPORTER)(id)),\n );\n return Arr.sort(packages, Str.Order);\n };\n\n/** @internal */\nexport const lockedClosures = Effect.fn(\"lockedClosures\")(function* lockedClosures(root: string) {\n const files = yield* RepositoryFiles;\n const lockfile = yield* readWantedLockfile(root);\n const nodesOf = (id: string, sections: Sections): readonly string[] => [\n ...pipe(sections, Arr.flatMap(depPathsOf)),\n ...pipe(\n linkedPaths(sections),\n Arr.map((path) => files.relative(root, files.join(root, id, path))),\n Arr.map(\n (linked) =>\n `${IMPORTER}${Option.getOrElse(Option.liftPredicate(linked, Str.isNonEmpty), () => ROOT_IMPORTER)}`,\n ),\n ),\n ];\n return pipe(\n lockfile,\n Option.map(({ importers, packages }): LockedClosures => {\n const found = pipe(\n Rec.toEntries(importers),\n Arr.map(([id, project]): Importer => {\n const used = usedSections(project);\n return {\n id,\n own: nodesOf(id, [...used, project.devDependencies]),\n used: nodesOf(id, used),\n };\n }),\n );\n const edges = Rec.fromEntries([\n ...pipe(\n found,\n Arr.map(({ id, used }): Edge => [`${IMPORTER}${id}`, used]),\n ),\n ...packageEdges(packages ?? {}),\n ]);\n return Rec.fromEntries(\n pipe(\n found,\n Arr.map((importer) => [importer.id, closureOf(edges)(importer)] as const),\n ),\n );\n }),\n );\n});\n","import { Array as Arr, Effect, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { CLOSURE_FILE, FINGERPRINT_FILE, LOCK_FILE } from \"#/shared/lib/locked-closure-paths.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { lockedClosures } from \"./locked-closures.ts\";\n\nconst LINE = \"\\n\";\nconst FILE_CONCURRENCY = 16;\n\nconst writeChanged = Effect.fn(\"writeChanged\")(function* writeChanged(file: string, text: string) {\n const files = yield* RepositoryFiles;\n const written = yield* files.readFile(file);\n if (!Option.exists(written, (found) => found === text)) {\n yield* files.writeFile(file, text);\n }\n});\n\nconst isWritten = Effect.fn(\"isWritten\")(function* isWritten(root: string, fingerprint: string) {\n const files = yield* RepositoryFiles;\n const recorded = yield* files.readFile(files.join(root, FINGERPRINT_FILE));\n const [hash, ...importers] = Str.split(\n Option.getOrElse(recorded, () => \"\"),\n LINE,\n );\n if (hash !== fingerprint) {\n return false;\n }\n const present = yield* Effect.forEach(\n importers,\n (importer) => files.exists(files.join(root, importer, CLOSURE_FILE)),\n { concurrency: FILE_CONCURRENCY },\n );\n return pipe(present, Arr.every(Boolean));\n});\n\nconst writeAll = Effect.fn(\"writeAll\")(function* writeAll(root: string, fingerprint: string) {\n const files = yield* RepositoryFiles;\n const closures = yield* lockedClosures(root);\n const entries = Rec.toEntries(Option.getOrElse(closures, () => ({})));\n yield* Effect.forEach(\n entries,\n ([importer, closure]) =>\n writeChanged(files.join(root, importer, CLOSURE_FILE), Arr.join(closure, LINE)),\n { concurrency: FILE_CONCURRENCY, discard: true },\n );\n const importers = pipe(\n entries,\n Arr.map(([importer]) => importer),\n );\n yield* files.writeFile(\n files.join(root, FINGERPRINT_FILE),\n Arr.join([fingerprint, ...importers], LINE),\n );\n});\n\n/** @internal */\nexport const writeLockedClosures = Effect.fn(\"writeLockedClosures\")(function* writeLockedClosures(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const fingerprint = yield* files.hashFile(files.join(root, LOCK_FILE));\n if (Option.isNone(fingerprint)) {\n return;\n }\n const written = yield* isWritten(root, fingerprint.value);\n if (!written) {\n yield* writeAll(root, fingerprint.value);\n }\n});\n","import { Array as Arr, Effect, Option, Order, Predicate, pipe } from \"effect\";\n\nimport { splitFrontmatter } from \"#/shared/lib/frontmatter.ts\";\nimport type { Frontmatter } from \"#/shared/lib/frontmatter.ts\";\nimport { isIndexSkill } from \"#/shared/lib/index-skill.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst SKILL_DIRECTORIES = [\".agents/skills\", \".claude/skills\", \"skills\"];\nconst PLUGINS = \"plugins\";\nconst SKILLS = \"skills\";\nconst SKILL_FILE = \"SKILL.md\";\nconst READ_CONCURRENCY = 16;\n\nconst nameOf = ({ fields }: Frontmatter): Option.Option<string> =>\n Option.filter(Option.fromNullishOr(fields[\"name\"]), Predicate.isString);\n\nconst skillDirectories = Effect.fn(\"skillDirectories\")(function* skillDirectories(root: string) {\n const files = yield* RepositoryFiles;\n const plugins = yield* files.readDirectory(files.join(root, PLUGINS));\n return [\n ...SKILL_DIRECTORIES,\n ...pipe(\n plugins,\n Arr.map((plugin) => files.join(PLUGINS, plugin, SKILLS)),\n ),\n ];\n});\n\nconst skillFiles = Effect.fn(\"skillFiles\")(function* skillFiles(root: string) {\n const files = yield* RepositoryFiles;\n const directories = yield* skillDirectories(root);\n const found = yield* Effect.forEach(\n directories,\n (directory) =>\n files\n .readDirectory(files.join(root, directory))\n .pipe(Effect.map(Arr.map((name) => files.join(directory, name, SKILL_FILE)))),\n { concurrency: READ_CONCURRENCY },\n );\n return pipe(Arr.flatten(found), Arr.sortBy(Order.String));\n});\n\nconst indexNameAt = Effect.fn(\"indexNameAt\")(function* indexNameAt(root: string, file: string) {\n const files = yield* RepositoryFiles;\n const source = yield* files.readFile(files.join(root, file));\n return pipe(\n source,\n Option.flatMap(splitFrontmatter),\n Option.filter(isIndexSkill),\n Option.flatMap(nameOf),\n );\n});\n\nexport const indexSkillIn = Effect.fn(\"indexSkillIn\")(function* indexSkillIn(root: string) {\n const found = yield* skillFiles(root);\n const names = yield* Effect.forEach(found, (file) => indexNameAt(root, file), {\n concurrency: READ_CONCURRENCY,\n });\n return Arr.head(Arr.getSomes(names));\n});\n","import { Schema } from \"effect\";\n\nconst Enabled = Schema.Literals([\"error\", \"deny\"]);\n\nconst EnabledWithOptions = Schema.mutable(\n Schema.TupleWithRest(Schema.Tuple([Enabled]), [Schema.Unknown]),\n);\n\nconst AddedRule = Schema.Union([Enabled, EnabledWithOptions]);\n\nexport const AddedRules = Schema.Record(Schema.String, AddedRule);\n\nexport type AddedRulesValue = typeof AddedRules.Type;\n","import { Array as Arr, Effect, Option, Record as Rec, Schema } from \"effect\";\n\nimport { literalSettings, usedFrom } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource } from \"#/entities/workspace/index.ts\";\n\nexport type DependencySets = Readonly<Record<string, readonly string[]>>;\n\nexport interface DependencyAllowance {\n readonly workspaces: readonly string[];\n readonly dependencies: readonly string[];\n}\n\nexport type DependencyAllowances = Readonly<Record<string, DependencyAllowance>>;\n\nexport const MSCH_DEV_DEPENDENCIES = [\"msch\", \"devDependencies\"] as const;\nexport const MSCH_DEPENDENCIES = [\"msch\", \"dependencies\"] as const;\n\nconst Names = Schema.String.pipe(Schema.Array, Schema.optional);\nconst DependencySettings = Schema.Struct({ use: Names, dependencies: Names });\nconst WorkspaceDependencyAllowances = Schema.Record(Schema.String, DependencySettings);\n\nconst allowanceOf = Effect.fn(\"allowanceOf\")(function* allowanceOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n [reason, allowance]: readonly [string, typeof DependencySettings.Type],\n) {\n const sets = yield* usedFrom(source.file, dependencySets, allowance.use ?? []);\n const dependencies = [...Arr.flatten(sets), ...(allowance.dependencies ?? [])];\n return [\n `${source.directory}: ${reason}`,\n { workspaces: [source.directory], dependencies },\n ] as const;\n});\n\nexport const allowancesOf = Effect.fn(\"allowancesOf\")(function* allowancesOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n path: typeof MSCH_DEV_DEPENDENCIES | typeof MSCH_DEPENDENCIES,\n) {\n const settings = yield* literalSettings({\n source,\n path,\n decode: Schema.decodeUnknownEffect(WorkspaceDependencyAllowances),\n });\n const allowed = Rec.toEntries(Option.getOrElse(settings, () => ({})));\n const entries = yield* Effect.forEach(\n allowed,\n (entry) => allowanceOf(source, dependencySets, entry),\n { concurrency: 1 },\n );\n return Rec.fromEntries(entries);\n});\n","import type { PackageJson } from \"@r_masseater/masseater-utils/kestrion\";\nimport { Effect, Option, Schema, pipe } from \"effect\";\n\nimport { literalSettings } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource } from \"#/entities/workspace/index.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: { readonly name: string; readonly isolate: false };\n}\n\nexport type TestProject = string | SharedTestProject;\n\nexport interface ProjectPlace {\n readonly directory: string;\n readonly config: string | false;\n}\n\nexport const sharedTestProject =\n (manifest: Option.Option<PackageJson>) =>\n ({ directory, config }: 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 },\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 return sharedTestProject(manifest)({ directory: source.directory, config });\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 publishedArticlesIn,\n draftArticlesIn,\n literalSettings,\n merged,\n programOf,\n settingsInvalid,\n siteEntries,\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 } from \"./test-project.ts\";\nimport type { TestProject } 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 ROOT_WORKSPACE = \".\";\nconst MSCH_LINT = [\"msch\", \"lint\"] as const;\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\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 ignoredDirectories: readonly IgnoredDirectory[];\n readonly testProjects: readonly TestProject[];\n readonly tasks: WorkspaceTasks;\n readonly devDependencies: DependencyAllowances;\n readonly dependencies: DependencyAllowances;\n readonly indexSkill: Option.Option<string>;\n readonly publishedArticles: readonly string[];\n readonly draftArticles: 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}\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 settingsOf = Effect.fn(\"settingsOf\")(function* settingsOf(\n source: WorkspaceSource,\n options: SettingsOptions,\n) {\n const lint = yield* lintOf(source, options.ruleSets);\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 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 return {\n directory,\n overrides: [],\n devDependencies: {},\n dependencies: {},\n ownTests: false,\n testProject: sharedTestProject(manifest)({ directory, config: false }),\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 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: pipe(\n directories,\n Arr.filter((directory) => directory !== ROOT_WORKSPACE),\n ),\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 }) => testProject),\n ),\n tasks: mergedTasks(found),\n ...mergedAllowances(found),\n indexSkill: yield* indexSkillIn(options.root),\n publishedArticles: yield* publishedArticlesIn(options.root),\n draftArticles: yield* draftArticlesIn(options.root),\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":";;;;;;;;;AAIA,MAAMA,qBAAmB;AACzB,MAAM,SAAS;AACf,MAAM,UAAU;AAChB,MAAM,sBAAsB;AAE5B,MAAa,cAAc,OAAO,GAAG,aAAa,CAAC,CAAC,UAAU,YAAY,MAAc;CACtF,MAAM,QAAQ,OAAO;CACrB,MAAM,SAAS,OAAO,MAAM,YAAY,IAAI;CAC5C,MAAM,aAAa,KACjB,QACAC,MAAI,QAAQ,SAAS,OAAO,KAAK,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,CAC/D;CACA,MAAM,QAAQ,OAAO,OAAO,QAC1B,aACC,SAAS,MAAM,SAAS,MAAM,KAAK,MAAM,IAAI,CAAC,GAC/C,EAAE,aAAaD,mBAAiB,CAClC;CACA,OAAO,KACLC,MAAI,IAAI,YAAY,KAAK,GACzBA,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oB,QAAQ,IAAI,CAAC;CACtD,MAAM,cAAc,OAAO,qBAAqB,QAAQ,IAAI;CAC5D,MAAM,QAA8B,OAAO,OAAO,QAChD,cACC,cAAc,YAAY,SAAS,SAAS,GAC7C,EAAE,aAAa,iBAAiB,CAClC;CACA,MAAM,WAAW,OAAO,OAAO,QAC7B,cACC,cAAc,WAAW,QAAQ,MAAM,SAAS,GACjD,EAAE,aAAa,iBAAiB,CAClC;CACA,OAAO;EACL,SAAS,KACP,aACAA,MAAI,QAAQ,cAAc,cAAc,cAAc,CACxD;EACA,oBAAoB,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,WAAW,CAC1C;EACA,OAAO,YAAY,KAAK;EACxB,GAAG,iBAAiB,KAAK;EACzB,YAAY,OAAO,aAAa,QAAQ,IAAI;EAC5C,mBAAmB,OAAO,oBAAoB,QAAQ,IAAI;EAC1D,eAAe,OAAO,gBAAgB,QAAQ,IAAI;CACpD;AACF,CACF;AAEA,MAAa,qBAAqB,YAChC,OAAO,WAAW,yBAAyB,OAAO,CAAC,CAAC,KAAK,OAAO,QAAQ,mBAAmB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r_masseater/msch",
3
- "version": "0.103.0",
3
+ "version": "0.104.0",
4
4
  "description": "A check policy for repositories: points every finite value set and object shape at its one owner, and ships the oxlint preset of plugins and rules.",
5
5
  "keywords": [
6
6
  "lint",
@@ -101,7 +101,7 @@
101
101
  "@r_masseater/fu4": "^0.3.9",
102
102
  "@r_masseater/masseater-utils": "^0.1.8",
103
103
  "@r_masseater/oxlint-plugin-decision": "^0.9.3",
104
- "@r_masseater/oxlint-typed-rules": "^0.6.7",
104
+ "@r_masseater/oxlint-typed-rules": "^0.6.8",
105
105
  "@r_masseater/textlint-rule-preset-ja": "^0.3.5",
106
106
  "@r_masseater/wism": "^0.4.7",
107
107
  "@r_masseater/y8": "^0.7.8",
@@ -1 +0,0 @@
1
- {"version":3,"file":"repository-text-B1wK0ETA.mjs","names":["Arr","Rec","Rec","Arr"],"sources":["../src/app/repository-tasks.ts","../src/app/repository-text.ts"],"sourcesContent":["import { Array as Arr, Record as Rec, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport type { WorkspaceSettings } from \"#/features/build-workspace-settings/index.ts\";\n\ntype Tasks = NonNullable<NonNullable<UserConfig[\"run\"]>[\"tasks\"]>;\n\nexport interface TaskOptions {\n readonly workspace: WorkspaceSettings;\n readonly commands: Readonly<Record<string, string>>;\n}\n\nconst NOT_INPUTS = [\n \"!node_modules/.pnpm-store\",\n \"!node_modules/.pnpm-store/**\",\n \"!node_modules/.tmp\",\n \"!node_modules/.tmp/**\",\n \"!target/**\",\n \"!node_modules/.vitest-cache/**\",\n \"!node_modules/.cache/**\",\n];\n\nconst UNTRACKED_ENV = [\n \"CLOUDFLARE_ACCOUNT_ID\",\n \"CLOUDFLARE_AI_GATEWAY_ID\",\n \"CLOUDFLARE_API_TOKEN\",\n \"CLAUDECODE\",\n \"CLAUDE_CODE_REMOTE\",\n \"GITHUB_ACTIONS\",\n \"HTTPS_PROXY\",\n \"https_proxy\",\n \"NO_PROXY\",\n \"no_proxy\",\n \"SSL_CERT_FILE\",\n \"NODE_EXTRA_CA_CERTS\",\n];\n\nconst FALLOW_ARGS = [\n \"--skip dupes --fail-on-issues --quiet --format compact\",\n \"dead-code --no-production --fail-on-issues --quiet --format compact\",\n \"dead-code --no-production --quiet --format json | jq -n 'input | {prop_drilling_chains, thin_wrappers, duplicate_prop_shapes} | with_entries(select(.value | length > 0)) | if length > 0 then halt_error else empty end'\",\n \"dupes --fail-on-issues --quiet --format compact\",\n \"security --fail-on-issues --quiet\",\n];\n\nconst FALLOW = pipe(\n FALLOW_ARGS,\n Arr.map((args) => `FALLOW_TYPE_AWARE_BACKEND=tsrs fallow ${args}`),\n);\n\nconst CHECK_BATCH_SOURCES = 1000;\n\nconst CHECK = `TSRS_LINT_RUN_EXTERNAL_CODE=1 msch changed --batch-sources ${String(CHECK_BATCH_SOURCES)} -- vp check --deny-warnings --continue-on-error`;\n\nconst COMPAT = \"msch changed -- msch publish compat-changed\";\n\nconst AUDIT =\n 'before=\"$(cksum pnpm-workspace.yaml)\"; vp pm audit --fix || exit; if [ \"$before\" != \"$(cksum pnpm-workspace.yaml)\" ]; then echo \"vp pm audit --fix rewrote pnpm-workspace.yaml. Run vp install and commit the diff.\" >&2; exit 1; fi';\n\nconst BROKER_TOKEN = `GH_TOKEN=\"\\${GITHUB_APP_TOKEN:-$GH_TOKEN}\"`;\nconst AGENT_STATE = `\"\\${RUNNER_TEMP:-\\${TMPDIR:-/tmp}}/msch-agents\"`;\n\nconst DAILY = `msch exits; ${BROKER_TOKEN} msch upstream; ${BROKER_TOKEN} msch callers; ${BROKER_TOKEN} msch refs; refs=$?; msch agents ${AGENT_STATE} && exit \"$refs\"`;\n\nconst TEST = \"msch changed -- vp test run --passWithNoTests\";\n\nexport const MSCH_TASK_COMMANDS = {\n fallow: FALLOW,\n check: CHECK,\n test: TEST,\n msch: \"msch\",\n audit: AUDIT,\n published: \"msch published\",\n compat: COMPAT,\n} as const;\n\nexport const tasksOf = ({\n workspace,\n commands,\n}: TaskOptions): NonNullable<NonNullable<UserConfig[\"run\"]>[\"tasks\"]> => {\n const inputs = [{ auto: true }, ...workspace.ignoredDirectories, ...NOT_INPUTS];\n const checks: Tasks = {\n ...commands,\n fallow: {\n command: FALLOW,\n cache: {\n input: [...inputs, \"!.fallow/**\", \"!**/dist/**\", \"!**/.fallow-verified\"],\n output: [],\n },\n },\n check: {\n command: CHECK,\n cache: { input: inputs, untrackedEnv: UNTRACKED_ENV },\n },\n test: {\n command: TEST,\n dependsOn: [\"check\", ...workspace.tasks.native],\n cache: { input: [...inputs, \"!**/.cache/**\"] },\n },\n msch: { command: \"msch\", dependsOn: [\"check\", ...workspace.tasks.native], cache: false },\n audit: { command: AUDIT, cache: false },\n published: { command: MSCH_TASK_COMMANDS.published, cache: false },\n compat: { command: COMPAT, cache: false },\n };\n return {\n ...checks,\n daily: { command: DAILY, dependsOn: [...workspace.tasks.native], cache: false },\n verify: { command: [], dependsOn: [...workspace.tasks.verify, ...Rec.keys(checks)] },\n };\n};\n","import type { H56mConfig } from \"@r_masseater/h56m\";\nimport { betterleaks } from \"@r_masseater/h56m/presets\";\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Array as Arr, Record as Rec, pipe } from \"effect\";\n\nimport { textlintFilters, textlintPresets } from \"#/features/define-lint-preset/index.ts\";\nimport { exempt } from \"#/shared/config/index.ts\";\n\ntype Source = NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"sources\"]>[number];\n\nexport interface TextSource {\n readonly files: readonly string[];\n readonly plugins: Readonly<Record<string, boolean | object>>;\n}\n\nexport interface TextOptions {\n readonly properNouns?: readonly string[];\n readonly rules?: Readonly<Record<string, object>>;\n readonly sources?: readonly TextSource[];\n}\n\nexport interface BuiltTextOptions extends TextOptions {\n readonly published: readonly string[];\n}\n\nexport const TEXT_IGNORES = [\n \"AGENTS.md\",\n \"CLAUDE.md\",\n \".agents/skills/**\",\n \"CHANGELOG.md\",\n ...exempt,\n];\nexport const textIgnoresOf = (published: readonly string[]): readonly string[] => [\n ...TEXT_IGNORES,\n ...published,\n];\nconst QUOTATION = String.raw`/「[^」]*」/`;\nconst SENTENCE_LENGTH = 120;\nconst KANJI_RUN = 6;\nconst PUBLIC_LINES = [\n String.raw`\\bCF_BEACON_TOKEN = \"[0-9a-f]{32}\"`,\n String.raw`\\b\\w*DISCORD_\\w*ID = \"[0-9]{17,20}\"`,\n String.raw`untrusted comment: minisign public key: [0-9A-F]{16}`,\n];\nconst EXEMPT_PATHS = [String.raw`(?:^|/)(?:fixtures|upstream)/`];\n\nconst builtRules = (\n properNouns: readonly string[],\n): Readonly<Record<string, boolean | object>> => ({\n \"@textlint-ja/preset-ai-writing\": true,\n \"@r_masseater/preset-ja\": true,\n \"preset-ja-technical-writing\": {\n \"sentence-length\": { max: SENTENCE_LENGTH },\n \"ja-no-mixed-period\": { allowPeriodMarks: [\":\"] },\n \"no-mix-dearu-desumasu\": { preferInBody: \"である\", preferInList: \"である\" },\n \"max-kanji-continuous-len\": { max: KANJI_RUN, allow: [...properNouns] },\n \"no-exclamation-question-mark\": { allow: [QUOTATION, ...properNouns] },\n },\n});\n\nexport const builtTextRuleNames: readonly string[] = Rec.keys(builtRules([]));\n\nexport const textlintOf = ({\n properNouns = [],\n rules = {},\n sources = [],\n published,\n}: BuiltTextOptions): NonNullable<ToolSections[\"textlint\"]> => {\n const textRules = { ...rules, ...builtRules(properNouns) };\n return {\n ignores: [...textIgnoresOf(published)],\n presets: textlintPresets,\n filterModules: textlintFilters,\n reportUnusedDirectives: true,\n sources: pipe(\n sources,\n Arr.map(({ files, plugins }): Source => ({\n files: [...files],\n plugins: { ...plugins },\n rules: textRules,\n filters: { comments: true },\n })),\n ),\n filters: { comments: true },\n rules: textRules,\n };\n};\n\nconst anyOf =\n (subject: string) =>\n (patterns: readonly string[]): readonly string[] => {\n if (Arr.isReadonlyArrayEmpty(patterns)) {\n return [];\n }\n const listed = pipe(\n patterns,\n Arr.map((pattern) => `\\`${pattern}\\``),\n Arr.join(\", \"),\n );\n return [`matchesAny(${subject}, [${listed}])`];\n };\n\nexport const secretsOf = (): H56mConfig => ({\n extend: { path: betterleaks },\n filter: pipe(\n [...anyOf(\"finding.line\")(PUBLIC_LINES), ...anyOf(`attributes[\"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