@r_masseater/msch 0.134.0 → 0.141.1

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.
Files changed (55) hide show
  1. package/dist/addon-tasks.mjs +1 -1
  2. package/dist/build-workspace-settings-C2EOC9GX.mjs +627 -0
  3. package/dist/build-workspace-settings-C2EOC9GX.mjs.map +1 -0
  4. package/dist/cargo-inputs.mjs +1 -1
  5. package/dist/cli.mjs +711 -752
  6. package/dist/cli.mjs.map +1 -1
  7. package/dist/config.d.mts +13 -37
  8. package/dist/config.mjs +335 -23
  9. package/dist/config.mjs.map +1 -1
  10. package/dist/decision-rules-CqgOVodl.mjs +43 -0
  11. package/dist/decision-rules-CqgOVodl.mjs.map +1 -0
  12. package/dist/decision-rules.d.mts +2 -1
  13. package/dist/decision-rules.mjs +1 -1
  14. package/dist/{dependencies-Bjn3xWkq.mjs → dependencies-DgltkhvK.mjs} +2 -2
  15. package/dist/{dependencies-Bjn3xWkq.mjs.map → dependencies-DgltkhvK.mjs.map} +1 -1
  16. package/dist/{derive-cargo-inputs-BLMqkRS3.mjs → derive-cargo-inputs-DbMOBcGP.mjs} +3 -3
  17. package/dist/{derive-cargo-inputs-BLMqkRS3.mjs.map → derive-cargo-inputs-DbMOBcGP.mjs.map} +1 -1
  18. package/dist/{ignored-directories-CaTFIbjo.mjs → ignored-directories-BGiOSvNx.mjs} +2 -2
  19. package/dist/{ignored-directories-CaTFIbjo.mjs.map → ignored-directories-BGiOSvNx.mjs.map} +1 -1
  20. package/dist/index-DOkaGaUe.d.mts +25 -0
  21. package/dist/library.mjs +2 -2
  22. package/dist/lint.d.mts +38 -2
  23. package/dist/lint.mjs +20 -1
  24. package/dist/lint.mjs.map +1 -0
  25. package/dist/oxlint.mjs +2 -2
  26. package/dist/{problem-Dk1svgmC.mjs → problem-CkDaLJxX.mjs} +2 -2
  27. package/dist/{problem-Dk1svgmC.mjs.map → problem-CkDaLJxX.mjs.map} +1 -1
  28. package/dist/{published-Cgl1qeYH.mjs → published-BrX24558.mjs} +269 -8
  29. package/dist/published-BrX24558.mjs.map +1 -0
  30. package/dist/{repository-files-C_GzAnYp.mjs → repository-files-CX48nfE5.mjs} +4 -5
  31. package/dist/repository-files-CX48nfE5.mjs.map +1 -0
  32. package/dist/{define-lint-preset-_bDnJMcY.mjs → repository-text-CpD8Z1kp.mjs} +355 -380
  33. package/dist/repository-text-CpD8Z1kp.mjs.map +1 -0
  34. package/dist/traced-rules.config-CnYNZrOa.mjs +8 -0
  35. package/dist/traced-rules.config-CnYNZrOa.mjs.map +1 -0
  36. package/dist/workspace-settings.mjs +2 -434
  37. package/dist/zenn-markdown.config-uksui7Go.mjs +77 -0
  38. package/dist/zenn-markdown.config-uksui7Go.mjs.map +1 -0
  39. package/package.json +13 -13
  40. package/skills/msch-checks/SKILL.md +5 -5
  41. package/skills/msch-publishing/SKILL.md +1 -1
  42. package/skills/msch-repository-config/SKILL.md +19 -18
  43. package/skills/msch-workspace-settings/SKILL.md +15 -9
  44. package/src/app/vite.d.ts +5 -8
  45. package/dist/define-lint-preset-_bDnJMcY.mjs.map +0 -1
  46. package/dist/index-_y7Igwy0.d.mts +0 -321
  47. package/dist/published-Cgl1qeYH.mjs.map +0 -1
  48. package/dist/repository-files-C_GzAnYp.mjs.map +0 -1
  49. package/dist/repository-text-BPhi-pct.mjs +0 -331
  50. package/dist/repository-text-BPhi-pct.mjs.map +0 -1
  51. package/dist/required-stack-BLSiAmpx.mjs +0 -188
  52. package/dist/required-stack-BLSiAmpx.mjs.map +0 -1
  53. package/dist/workspace-projects-Zg078aA1.mjs +0 -269
  54. package/dist/workspace-projects-Zg078aA1.mjs.map +0 -1
  55. package/dist/workspace-settings.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository-text-CpD8Z1kp.mjs","names":["Arr","Str","Arr","Str","Arr","Arr","Rec","shadcn","Arr","Str","Rec","Arr"],"sources":["../src/entities/workspace/model/workspace-names.ts","../src/shared/config/exempt.ts","../src/shared/lib/path-existence.ts","../src/app/built-config.ts","../src/shared/lib/tool-bins.ts","../src/app/repository-tasks.ts","../src/features/define-lint-preset/config/lint-overrides.config.ts","../src/features/define-lint-preset/config/web-guidance.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/kuromojin.config.ts","../src/features/define-lint-preset/config/textlint-presets.config.ts","../src/features/define-lint-preset/config/textlint-filters.config.ts","../src/app/repository-text.ts"],"sourcesContent":["import { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { workspaceProjects } from \"./workspace-projects.ts\";\nimport type { WorkspaceProject } from \"./workspace-projects.ts\";\n\nconst ALTERNATIVE = \"|\";\nconst SCOPE = /^@[^/]+\\//u;\nconst SPECIAL = /[$()*+.?[\\\\\\]^{|}]/gu;\n\nexport interface NamedWorkspace {\n readonly directory: string;\n readonly names: readonly string[];\n readonly packageName: Option.Option<string>;\n}\n\n/** @internal */\nexport const patternOf = (names: readonly string[]): RegExp => {\n const alternatives = pipe(names, Arr.map(Str.replaceAll(SPECIAL, String.raw`\\$&`)));\n return new RegExp(\n `(?<![\\\\p{L}\\\\p{N}_-])(?:${Arr.join(alternatives, ALTERNATIVE)})(?![\\\\p{L}\\\\p{N}_-])`,\n \"gu\",\n );\n};\n\nconst namedIn =\n (basename: (directory: string) => string) =>\n ({ directory, packageName }: WorkspaceProject): NamedWorkspace => {\n const unscoped = pipe(packageName, Option.map(Str.replace(SCOPE, \"\")));\n const names = pipe(\n [Option.some(directory), Option.some(basename(directory)), packageName, unscoped],\n Arr.getSomes,\n Arr.dedupe,\n );\n return { directory, names, packageName };\n };\n\n/** @internal */\nexport const namedWorkspaces = Effect.fn(\"namedWorkspaces\")(function* namedWorkspaces(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const projects = yield* workspaceProjects(root);\n return pipe(projects, Arr.map(namedIn((directory) => files.basename(directory))));\n});\n","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","import { Array as Arr, Effect, Option, String as Str } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst WILDCARD = /[*?[]/u;\nconst SEPARATOR = \"/\";\nconst FIRST = 0;\n\n/** @internal */\nexport const existsAt = Effect.fn(\"existsAt\")(function* existsAt(root: string, path: string) {\n const files = yield* RepositoryFiles;\n return yield* files.exists(files.join(root, path));\n});\n\n/** @internal */\nexport const isDirectoryAt = Effect.fn(\"isDirectoryAt\")(function* isDirectoryAt(\n root: string,\n path: string,\n) {\n const files = yield* RepositoryFiles;\n const directory = yield* files.isDirectory(files.join(root, path));\n return Option.getOrElse(directory, () => false);\n});\n\n/** @internal */\nexport const staticPrefix = (path: string): string => {\n const prefix = Arr.headNonEmpty(Str.split(path, WILDCARD));\n if (Str.endsWith(SEPARATOR)(prefix)) {\n return Str.slice(FIRST, -SEPARATOR.length)(prefix);\n }\n return prefix;\n};\n\n/** @internal */\nexport const isIgnored = Effect.fn(\"isIgnored\")(function* isIgnored(root: string, path: string) {\n const prefix = staticPrefix(path);\n if (Str.isEmpty(prefix)) {\n return false;\n }\n const files = yield* RepositoryFiles;\n const ignored = yield* files.ignoredPaths(root, [prefix, `${prefix}${SEPARATOR}`]);\n return Arr.isReadonlyArrayNonEmpty(ignored);\n});\n","import { Array as Arr, Option, pipe } from \"effect\";\n\nimport type { FinalConfig } from \"./config-sections.ts\";\n\ndeclare global {\n var mschBuiltConfig: readonly FinalConfig[] | undefined;\n}\n\n/** @internal */\nexport const recordBuilt = <Config extends FinalConfig>(config: Config): Config => {\n globalThis.mschBuiltConfig = [config];\n return config;\n};\n\n/** @internal */\nexport const forgetBuilt = (): void => {\n globalThis.mschBuiltConfig = [];\n};\n\n/** @internal */\nexport const lastBuilt = (): Option.Option<FinalConfig> =>\n pipe(Option.fromUndefinedOr(globalThis.mschBuiltConfig), Option.flatMap(Arr.head));\n","import { fileURLToPath } from \"node:url\";\n\nimport fu4 from \"@r_masseater/fu4/package.json\" with { type: \"json\" };\nimport wism from \"@r_masseater/wism/package.json\" with { type: \"json\" };\nimport y8 from \"@r_masseater/y8/package.json\" with { type: \"json\" };\n\nconst binOf = (bin: string, manifest: string): string =>\n fileURLToPath(new URL(bin, import.meta.resolve(manifest)));\n\n/** @internal */\nexport const TOOL_BINS = {\n y8: binOf(y8.bin.y8, \"@r_masseater/y8/package.json\"),\n wism: binOf(wism.bin.wism, \"@r_masseater/wism/package.json\"),\n fu4: binOf(fu4.bin.fu4, \"@r_masseater/fu4/package.json\"),\n} as const;\n","import type { ToolSections, GitHooksSection } from \"@r_masseater/vite-plus-adopt\";\nimport { Array as Arr, Option, Record as Rec } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport { TASK_NAMES } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSettings } from \"#/features/build-workspace-settings/index.ts\";\nimport type { CargoInput } from \"#/features/derive-cargo-inputs/index.ts\";\nimport { USAGE_SPOOL } from \"#/shared/config/index.ts\";\nimport { TOOL_BINS } from \"#/shared/lib/tool-bins.ts\";\n\nexport type { GitHooksSection } from \"@r_masseater/vite-plus-adopt\";\n\ntype Tasks = NonNullable<NonNullable<UserConfig[\"run\"]>[\"tasks\"]>;\n\nexport interface UsageOptions {\n readonly endpoint: string;\n}\n\nexport interface TaskOptions {\n readonly workspace: WorkspaceSettings;\n readonly commands: Readonly<Record<string, string>>;\n readonly usage: Option.Option<UsageOptions>;\n readonly cargo: Option.Option<CargoInputs>;\n}\n\nexport type CargoInputs = readonly CargoInput[];\n\nconst NOT_INPUTS = [\n \"!node_modules/.pnpm-store\",\n \"!node_modules/.pnpm-store/**\",\n \"!node_modules/.tmp\",\n \"!node_modules/.tmp/**\",\n \"!target/**\",\n \"!node_modules/.vitest-cache/**\",\n \"!node_modules/.cache/**\",\n];\n\nconst UNTRACKED_ENV = [\n \"CLOUDFLARE_ACCOUNT_ID\",\n \"CLOUDFLARE_AI_GATEWAY_ID\",\n \"CLOUDFLARE_API_TOKEN\",\n \"CLAUDECODE\",\n \"CLAUDE_CODE_REMOTE\",\n \"GITHUB_ACTIONS\",\n \"HTTPS_PROXY\",\n \"https_proxy\",\n \"NO_PROXY\",\n \"no_proxy\",\n \"SSL_CERT_FILE\",\n \"NODE_EXTRA_CA_CERTS\",\n];\n\nconst MSCH = \"FALLOW_TYPE_AWARE_BACKEND=tsrs msch\";\n\nconst CHECK_BATCH_SOURCES = 1000;\n\nconst CHECK = `TSRS_LINT_RUN_EXTERNAL_CODE=1 msch changed --batch-sources ${String(CHECK_BATCH_SOURCES)} -- vp check --deny-warnings --continue-on-error --no-error-on-unmatched-pattern`;\n\nconst COMPAT = \"msch changed -- msch publish compat-changed\";\n\nconst Y8 = `node ${TOOL_BINS.y8}`;\nconst WISM = `node ${TOOL_BINS.wism}`;\nconst FU4 = `node ${TOOL_BINS.fu4}`;\n\nconst AUDIT_FILES = [\"package.json\", \"pnpm-workspace.yaml\", \"pnpm-lock.yaml\", \".npmrc\"];\n\nconst AUDIT = Arr.join(\n [\n 'copy=\"$(mktemp -d)\"',\n `trap 'rm -rf \"$copy\"' EXIT`,\n `for file in ${Arr.join(AUDIT_FILES, \" \")}; do if [ -f \"$file\" ]; then cp \"$file\" \"$copy/\"; fi; done`,\n '(cd \"$copy\" && vp pm audit --fix >/dev/null) || exit',\n `added=\"$(diff pnpm-workspace.yaml \"$copy/pnpm-workspace.yaml\" | sed -n 's/^> \\\\(.*\\\\)$/\\\\1 # exit: unused/p')\"`,\n 'if [ -z \"$added\" ]; then exit 0; fi',\n `printf '%s\\\\n' \"vp pm audit --fix found vulnerable versions. First update them within their ranges with vp update -r --no-save <package>... -- --depth Infinity. For each one still reported by vp pm audit, add its line to overrides in pnpm-workspace.yaml and run vp install:\" \"$added\" >&2`,\n \"exit 1\",\n ],\n \"; \",\n);\n\nconst BROKER_TOKEN = `GH_TOKEN=\"\\${GITHUB_APP_TOKEN:-$GH_TOKEN}\"`;\nconst AGENT_STATE = `\"\\${RUNNER_TEMP:-\\${TMPDIR:-/tmp}}/msch-agents\"`;\n\nconst DAILY = `msch exits; ${BROKER_TOKEN} msch upstream; ${BROKER_TOKEN} msch refs; refs=$?; msch agents ${AGENT_STATE} && exit \"$refs\"`;\n\nconst TEST = \"msch changed -- vp test run --passWithNoTests\";\n\nconst CARGO =\n \"cargo fmt --all --check && cargo clippy --workspace --all-targets --locked -- -D warnings\";\n\nconst cargoTasks = (cargo: Option.Option<CargoInputs>): Tasks =>\n Option.match(cargo, {\n onNone: (): Tasks => ({}),\n onSome: (inputs): Tasks => ({\n cargo: {\n command: CARGO,\n cache: { input: [...inputs], output: [], untrackedEnv: UNTRACKED_ENV },\n },\n }),\n });\n\nexport const MSCH_VERIFY_COMMANDS = {\n check: CHECK,\n msch: MSCH,\n audit: AUDIT,\n published: \"msch published\",\n compat: COMPAT,\n y8: Y8,\n wism: WISM,\n fu4: FU4,\n} as const;\n\nexport const MSCH_TASK_COMMANDS = { ...MSCH_VERIFY_COMMANDS, test: TEST } as const;\n\nexport const CI_TASKS = [TASK_NAMES.verify, TASK_NAMES.test] as const;\n\nconst USAGE_TASK = \"usage\";\n\nconst METERED_TASKS = [\"check\", \"msch\", \"y8\", \"wism\", \"fu4\"] as const;\n\nexport const meteredCommand = (command: string): string =>\n `USAGE_METER_SPOOL=\"$PWD/${USAGE_SPOOL}\" ${command}`;\n\nconst usageCommandOf = ({ endpoint }: UsageOptions): string => `msch usage --endpoint ${endpoint}`;\n\nconst commandOf =\n (usage: Option.Option<UsageOptions>) =>\n (command: string): string =>\n Option.match(usage, { onNone: () => command, onSome: () => meteredCommand(command) });\n\nconst usageTasks = (usage: Option.Option<UsageOptions>): Tasks =>\n Option.match(usage, {\n onNone: (): Tasks => ({}),\n onSome: (options): Tasks => ({\n [USAGE_TASK]: {\n command: usageCommandOf(options),\n dependsOn: [...METERED_TASKS],\n cache: false,\n },\n }),\n });\n\nexport const tasksOf = ({\n workspace,\n commands,\n usage,\n cargo,\n}: TaskOptions): NonNullable<NonNullable<UserConfig[\"run\"]>[\"tasks\"]> => {\n const inputs = [{ auto: true }, ...workspace.ignoredDirectories, ...NOT_INPUTS];\n const run = commandOf(usage);\n const checks: Tasks = {\n ...commands,\n check: {\n command: run(CHECK),\n cache: { input: inputs, untrackedEnv: UNTRACKED_ENV },\n },\n msch: {\n command: run(MSCH_VERIFY_COMMANDS.msch),\n dependsOn: [\"check\", ...workspace.tasks.native],\n cache: false,\n },\n audit: { command: AUDIT, cache: false },\n y8: { command: run(Y8), dependsOn: [...workspace.tasks.native], cache: false },\n wism: { command: run(WISM), dependsOn: [...workspace.tasks.native], cache: false },\n fu4: { command: run(FU4), dependsOn: [...workspace.tasks.native], cache: false },\n published: { command: MSCH_TASK_COMMANDS.published, cache: false },\n compat: { command: COMPAT, dependsOn: [\"msch\"], cache: false },\n ...cargoTasks(cargo),\n ...usageTasks(usage),\n };\n return {\n ...checks,\n test: {\n command: TEST,\n dependsOn: [\"check\", ...workspace.tasks.native],\n cache: { input: [...inputs, \"!**/.cache/**\"] },\n },\n daily: { command: DAILY, dependsOn: [...workspace.tasks.native], cache: false },\n verify: { command: [], dependsOn: [...workspace.tasks.verify, ...Rec.keys(checks)] },\n ci: { command: [], dependsOn: [...CI_TASKS, ...workspace.tasks.test] },\n };\n};\n\nconst REINSTALL = \"vp install\";\n\nexport const GIT_HOOKS = {\n \"pre-commit\": [\"vp staged\", \"vp exec msch --staged\"],\n \"commit-msg\": ['vp exec msch --commit-msg \"$1\"'],\n \"pre-push\": [\"vp exec msch --pre-push\", \"vp run verify\"],\n \"post-checkout\": [`[ \"$3\" = 0 ] || ${REINSTALL}`],\n \"post-merge\": [REINSTALL],\n \"post-rewrite\": [REINSTALL],\n} as const satisfies GitHooksSection;\n\nexport const gitHooksOf = (hooks: GitHooksSection = {}): GitHooksSection => ({\n ...GIT_HOOKS,\n ...hooks,\n});\n\nexport type ToolsSection = NonNullable<ToolSections[\"tools\"]>;\n\nexport const toolsOf = (tools: ToolsSection = {}): ToolsSection => ({\n \"open-telemetry/opentelemetry-collector-releases\": { version: \"0.166.0\", bin: [\"otelcol\"] },\n \"open-telemetry/weaver\": { version: \"0.28.0\" },\n ...tools,\n});\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 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 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 decisionRules,\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 TESTS = [\"**/*.test.ts\", \"**/*.test.tsx\", \"**/*.test.support.ts\"];\n\nconst overrides = [\n { files: [\"**/*.{ts,tsx}\"], excludeFiles: TESTS, rules: decisionRules },\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","import { createRequire, registerHooks } from \"node:module\";\n\nexport const KUROMOJIN = \"kuromojin\";\nconst ON_LINDERA = \"@r_masseater/textlint-rule-preset-ja/kuromojin\";\n\nexport const requireWithLinderaKuromojin = (parentUrl: string): NodeJS.Require => {\n registerHooks({\n resolve: (specifier, context, nextResolve) => {\n if (specifier === KUROMOJIN) {\n return nextResolve(ON_LINDERA, { ...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 { requireWithLinderaKuromojin } 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 = requireWithLinderaKuromojin(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 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, pipe } from \"effect\";\n\nimport {\n textlintFilters,\n textlintPresets,\n zennMarkdown,\n} from \"#/features/define-lint-preset/index.ts\";\nimport { exempt } from \"#/shared/config/index.ts\";\n\ntype Source = NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"sources\"]>[number];\n\nexport interface TextSource {\n readonly files: readonly string[];\n readonly plugins: Readonly<Record<string, boolean | object>>;\n}\n\nexport interface TextOptions {\n readonly properNouns?: readonly string[];\n readonly rules?: Readonly<Record<string, object>>;\n readonly sources?: readonly TextSource[];\n}\n\nexport interface BuiltTextOptions extends TextOptions {\n readonly articles: readonly string[];\n}\n\nexport const TEXT_IGNORES = [\n \"AGENTS.md\",\n \"CLAUDE.md\",\n \".agents/skills/**\",\n \"CHANGELOG.md\",\n ...exempt,\n];\nconst ZENN_MARKDOWN = \"zenn-markdown\";\nconst QUOTATION = String.raw`/「(?:[^「」]|「[^「」]*」)*」|『(?:[^『』]|『[^『』]*』)*』/`;\nconst SPEAKER = String.raw`/^:::[\\w-]+\\n[\\s\\S]*?\\n:::$/m`;\nconst ELLIPSIS = \"…\";\n\n/** @internal */\nexport const BUILT_ALLOWANCES: readonly string[] = [QUOTATION, SPEAKER];\nconst filtersOf = (properNouns: readonly string[]): Readonly<Record<string, object | boolean>> => ({\n comments: true,\n \"node-types\": { nodeTypes: [\"BlockQuote\"] },\n allowlist: { allow: [...BUILT_ALLOWANCES, ...properNouns] },\n});\nconst SENTENCE_LENGTH = 120;\nconst KANJI_RUN = 6;\nconst PUBLIC_LINES = [\n String.raw`\\bCF_BEACON_TOKEN = \"[0-9a-f]{32}\"`,\n String.raw`\\b\\w*DISCORD_\\w*ID = \"[0-9]{17,20}\"`,\n String.raw`untrusted comment: minisign public key: [0-9A-F]{16}`,\n];\nconst EXEMPT_PATHS = [String.raw`(?:^|/)(?:fixtures|upstream|hooks/vendor)/`];\n\ntype Style = \"である\" | \"ですます\";\n\nconst builtRules = (style: Style): Readonly<Record<string, boolean | object>> => ({\n \"@textlint-ja/preset-ai-writing\": true,\n \"@r_masseater/preset-ja\": true,\n \"preset-ja-technical-writing\": {\n \"sentence-length\": { max: SENTENCE_LENGTH },\n \"ja-no-mixed-period\": { allowPeriodMarks: [\":\"] },\n \"no-mix-dearu-desumasu\": { preferInBody: style, preferInList: style },\n \"max-kanji-continuous-len\": { max: KANJI_RUN },\n \"ja-no-successive-word\": { allow: [ELLIPSIS] },\n },\n});\n\nexport const textlintOf = ({\n properNouns = [],\n rules = {},\n sources = [],\n articles,\n}: BuiltTextOptions): NonNullable<ToolSections[\"textlint\"]> => {\n const textRules = { ...rules, ...builtRules(\"である\") };\n const filters = filtersOf(properNouns);\n const articleSources = Arr.filter(\n [\n {\n files: [...articles],\n plugins: { [ZENN_MARKDOWN]: true },\n rules: { ...rules, ...builtRules(\"ですます\") },\n filters,\n } satisfies Source,\n ],\n () => Arr.isReadonlyArrayNonEmpty(articles),\n );\n return {\n ignores: [...TEXT_IGNORES, ...articles],\n presets: textlintPresets,\n filterModules: textlintFilters,\n pluginModules: { [ZENN_MARKDOWN]: zennMarkdown },\n reportUnusedDirectives: true,\n sources: pipe(\n sources,\n Arr.map(({ files, plugins }): Source => ({\n files: [...files],\n plugins: { ...plugins },\n rules: textRules,\n filters,\n })),\n Arr.appendAll(articleSources),\n ),\n filters,\n rules: textRules,\n };\n};\n\nconst anyOf =\n (subject: string) =>\n (patterns: readonly string[]): readonly string[] => {\n if (Arr.isReadonlyArrayEmpty(patterns)) {\n return [];\n }\n const listed = pipe(\n patterns,\n Arr.map((pattern) => `\\`${pattern}\\``),\n Arr.join(\", \"),\n );\n return [`matchesAny(${subject}, [${listed}])`];\n };\n\nexport const secretsOf = (): H56mConfig => ({\n extend: { path: betterleaks },\n filter: pipe(\n [...anyOf(\"finding.line\")(PUBLIC_LINES), ...anyOf(`attributes[\"path\"]`)(EXEMPT_PATHS)],\n Arr.join(\" || \"),\n ),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AAOA,MAAM,cAAc;AACpB,MAAM,Q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Q,CAC5C;CACA,OAAO;EACL,SAAS,CAAC,GAAG,cAAc,GAAG,QAAQ;EACtC,SAAS;EACT,eAAe;EACf,eAAe,GAAG,gBAAgB,aAAa;EAC/C,wBAAwB;EACxB,SAAS,KACP,SACAA,MAAI,KAAK,EAAE,OAAO,eAAuB;GACvC,OAAO,CAAC,GAAG,KAAK;GAChB,SAAS,EAAE,GAAG,QAAQ;GACtB,OAAO;GACP;EACF,EAAE,GACFA,MAAI,UAAU,cAAc,CAC9B;EACA;EACA,OAAO;CACT;AACF;AAEA,MAAM,SACH,aACA,aAAmD;CAClD,IAAIA,MAAI,qBAAqB,QAAQ,GACnC,OAAO,CAAC;CAOV,OAAO,CAAC,cAAc,QAAQ,KALf,KACb,UACAA,MAAI,KAAK,YAAY,KAAK,QAAQ,GAAG,GACrCA,MAAI,KAAK,IAAI,CAEyB,EAAE,GAAG;AAC/C;AAEF,MAAa,mBAA+B;CAC1C,QAAQ,EAAE,MAAM,YAAY;CAC5B,QAAQ,KACN,CAAC,GAAG,MAAM,cAAc,CAAC,CAAC,YAAY,GAAG,GAAG,MAAM,oBAAoB,CAAC,CAAC,YAAY,CAAC,GACrFA,MAAI,KAAK,MAAM,CACjB;AACF"}
@@ -0,0 +1,8 @@
1
+ // src/features/define-lint-preset/config/traced-rules.config.ts
2
+ const tracedRules = {
3
+ "msch-lint/traced-elysia": "error",
4
+ "msch-lint/traced-effect-run": "error"
5
+ };
6
+ export { tracedRules as t };
7
+
8
+ //# sourceMappingURL=traced-rules.config-CnYNZrOa.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traced-rules.config-CnYNZrOa.mjs","names":[],"sources":["../src/features/define-lint-preset/config/traced-rules.config.ts"],"sourcesContent":["export const tracedRules = {\n \"msch-lint/traced-elysia\": \"error\",\n \"msch-lint/traced-effect-run\": \"error\",\n} as const;\n"],"mappings":";AAAA,MAAa,cAAc;CACzB,2BAA2B;CAC3B,+BAA+B;AACjC"}
@@ -1,435 +1,3 @@
1
- import { Array, Effect, Option, Order, Predicate, Record, Schema, String, pipe } from "effect";
2
- import { r as readManifest } from "./dependencies-Bjn3xWkq.mjs";
3
- import { _ as shadcnUiIn, c as publicEntriesOf, f as splitFrontmatter, g as deployEntries, l as modDirectories, n as entriesOf, p as linkedPaths, t as PackEntry, u as INDEX_SKILL, y as prefixed } from "./published-Cgl1qeYH.mjs";
4
- import { D as nestedValues, E as literalOf, _ as merged, b as usedFrom, g as literalSettings, h as testsItself, i as workspaceProjects, m as tasksOf, o as NO_TASKS, r as workspaceDirectories, v as programOf, y as settingsInvalid } from "./workspace-projects-Zg078aA1.mjs";
5
- import { i as nodeRepositoryFiles, r as RepositoryFiles } from "./repository-files-C_GzAnYp.mjs";
6
- import { n as FINGERPRINT_FILE, r as LOCK_FILE, t as CLOSURE_FILE } from "./locked-closure-paths-_N_97Dbp.mjs";
7
- import { depPathsOf, readWantedLockfile } from "@r_masseater/masseater-utils/kestrion/pnpm";
8
- import { i as reachable, r as ignoredDirectories, t as collectIgnoredDirectories } from "./ignored-directories-CaTFIbjo.mjs";
9
- import { n as requiredStack } from "./required-stack-BLSiAmpx.mjs";
10
- import { PACKAGE_JSON_FILE } from "@r_masseater/masseater-utils/kestrion";
11
- import { decodePackageJson } from "@r_masseater/masseater-utils/kestrion/npm";
12
- // src/entities/workspace/model/structure-members.ts
13
- const ROOT_WORKSPACE = ".";
14
- const PLUGIN_MANIFEST = ".claude-plugin/plugin.json";
15
- const READ_CONCURRENCY$3 = 16;
16
- const isPlugin = Effect.fn("isPlugin")(function* isPlugin(root, directory) {
17
- const files = yield* RepositoryFiles;
18
- return yield* files.exists(files.join(root, directory, PLUGIN_MANIFEST));
19
- });
20
- const pluginWorkspaces = Effect.fn("pluginWorkspaces")(function* pluginWorkspaces(root, directories) {
21
- return yield* Effect.filter(directories, (directory) => isPlugin(root, directory), { concurrency: READ_CONCURRENCY$3 });
22
- });
23
- const sourcePlugins = Effect.fn("sourcePlugins")(function* sourcePlugins(root, directories) {
24
- const plugins = yield* pluginWorkspaces(root, directories);
25
- const projects = yield* workspaceProjects(root);
26
- const published = pipe(projects, Array.filter((project) => project.published), Array.map(({ directory }) => directory));
27
- return pipe(plugins, Array.filter((directory) => !Array.contains(published, directory)));
28
- });
29
- const structureMembers = Effect.fn("structureMembers")(function* structureMembers(root, directories) {
30
- const plugins = yield* pluginWorkspaces(root, directories);
31
- return pipe(directories, Array.filter((directory) => directory !== ROOT_WORKSPACE && !Array.contains(plugins, directory)));
32
- });
33
- // src/entities/workspace/model/site-entries.ts
34
- const READ_CONCURRENCY$2 = 16;
35
- const SCRIPT = /\.[cm]?tsx?$/u;
36
- const SKIPPED = /\.test\.|\.d\.[cm]?ts$/u;
37
- const SERVER_ENTRY_IMPORT = /from\s+["']@effect\/ui\/html\/HtmlServerHttp["']/u;
38
- const siteEntries = Effect.fn("siteEntries")(function* siteEntries(root) {
39
- const files = yield* RepositoryFiles;
40
- const listed = yield* files.listedFiles(root);
41
- const candidates = pipe(listed, Array.filter((file) => SCRIPT.test(file) && !SKIPPED.test(file)));
42
- const texts = yield* Effect.forEach(candidates, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$2 });
43
- return pipe(Array.zip(candidates, texts), Array.filter(([, text]) => Option.exists(text, (value) => SERVER_ENTRY_IMPORT.test(value))), Array.map(([file]) => file));
44
- });
45
- // src/entities/workspace/model/locked-closures.ts
46
- const IMPORTER = "importer:";
47
- const ROOT_IMPORTER = ".";
48
- const usedSections = ({ dependencies, optionalDependencies }) => [dependencies, optionalDependencies];
49
- const packageEdges = (packages) => pipe(Record.toEntries(packages), Array.map(([id, snapshot]) => [id, pipe(usedSections(snapshot), Array.flatMap(depPathsOf))]));
50
- const closureOf = (edges) => ({ own }) => {
51
- const packages = pipe(reachable(edges, own), Array.filter((id) => !String.startsWith(IMPORTER)(id)));
52
- return Array.sort(packages, String.Order);
53
- };
54
- /** @internal */
55
- const lockedClosures = Effect.fn("lockedClosures")(function* lockedClosures(root) {
56
- const files = yield* RepositoryFiles;
57
- const lockfile = yield* readWantedLockfile(root);
58
- const nodesOf = (id, sections) => [...pipe(sections, Array.flatMap(depPathsOf)), ...pipe(linkedPaths(sections), Array.map((path) => files.relative(root, files.join(root, id, path))), Array.map((linked) => `${IMPORTER}${Option.getOrElse(Option.liftPredicate(linked, String.isNonEmpty), () => ROOT_IMPORTER)}`))];
59
- return pipe(lockfile, Option.map(({ importers, packages }) => {
60
- const found = pipe(Record.toEntries(importers), Array.map(([id, project]) => {
61
- const used = usedSections(project);
62
- return {
63
- id,
64
- own: nodesOf(id, [...used, project.devDependencies]),
65
- used: nodesOf(id, used)
66
- };
67
- }));
68
- const edges = Record.fromEntries([...pipe(found, Array.map(({ id, used }) => [`${IMPORTER}${id}`, used])), ...packageEdges(packages ?? {})]);
69
- return Record.fromEntries(pipe(found, Array.map((importer) => [importer.id, closureOf(edges)(importer)])));
70
- }));
71
- });
72
- // src/entities/workspace/model/locked-closure-files.ts
73
- const LINE = "\n";
74
- const FILE_CONCURRENCY = 16;
75
- const writeChanged = Effect.fn("writeChanged")(function* writeChanged(file, text) {
76
- const files = yield* RepositoryFiles;
77
- const written = yield* files.readFile(file);
78
- if (!Option.exists(written, (found) => found === text)) yield* files.writeFile(file, text);
79
- });
80
- const isWritten = Effect.fn("isWritten")(function* isWritten(root, fingerprint) {
81
- const files = yield* RepositoryFiles;
82
- const [hash, ...importers] = (yield* files.readFile(files.join(root, FINGERPRINT_FILE))).pipe(Option.getOrElse(() => ""), String.split(LINE));
83
- if (hash !== fingerprint) return false;
84
- const present = yield* Effect.forEach(importers, (importer) => files.exists(files.join(root, importer, CLOSURE_FILE)), { concurrency: FILE_CONCURRENCY });
85
- return pipe(present, Array.every(Boolean));
86
- });
87
- const writeAll = Effect.fn("writeAll")(function* writeAll(root, fingerprint) {
88
- const files = yield* RepositoryFiles;
89
- const entries = (yield* lockedClosures(root)).pipe(Option.getOrElse(() => ({})), Record.toEntries);
90
- yield* Effect.forEach(entries, ([importer, closure]) => writeChanged(files.join(root, importer, CLOSURE_FILE), Array.join(closure, LINE)), {
91
- concurrency: FILE_CONCURRENCY,
92
- discard: true
93
- });
94
- const importers = pipe(entries, Array.map(([importer]) => importer));
95
- yield* files.writeFile(files.join(root, FINGERPRINT_FILE), Array.join([fingerprint, ...importers], LINE));
96
- });
97
- /** @internal */
98
- const writeLockedClosures = Effect.fn("writeLockedClosures")(function* writeLockedClosures(root) {
99
- const files = yield* RepositoryFiles;
100
- const fingerprint = yield* files.hashFile(files.join(root, LOCK_FILE));
101
- if (Option.isNone(fingerprint)) return;
102
- if (!(yield* isWritten(root, fingerprint.value))) yield* writeAll(root, fingerprint.value);
103
- });
104
- // src/entities/workspace/model/index-skill.ts
105
- const SKILL_DIRECTORIES = [
106
- ".agents/skills",
107
- ".claude/skills",
108
- "skills"
109
- ];
110
- const PLUGINS = "plugins";
111
- const SKILLS = "skills";
112
- const SKILL_FILE = "SKILL.md";
113
- const READ_CONCURRENCY$1 = 16;
114
- const nameOf = ({ fields }) => Option.filter(Option.fromNullishOr(fields["name"]), Predicate.isString);
115
- const skillDirectories = Effect.fn("skillDirectories")(function* skillDirectories(root) {
116
- const files = yield* RepositoryFiles;
117
- const plugins = yield* files.readDirectory(files.join(root, PLUGINS));
118
- return [...SKILL_DIRECTORIES, ...pipe(plugins, Array.map((plugin) => files.join(PLUGINS, plugin, SKILLS)))];
119
- });
120
- const skillFiles = Effect.fn("skillFiles")(function* skillFiles(root) {
121
- const files = yield* RepositoryFiles;
122
- const directories = yield* skillDirectories(root);
123
- const found = yield* Effect.forEach(directories, (directory) => files.readDirectory(files.join(root, directory)).pipe(Effect.map(Array.map((name) => files.join(directory, name, SKILL_FILE)))), { concurrency: READ_CONCURRENCY$1 });
124
- return pipe(Array.flatten(found), Array.sortBy(Order.String));
125
- });
126
- const indexNameAt = Effect.fn("indexNameAt")(function* indexNameAt(root, file) {
127
- const files = yield* RepositoryFiles;
128
- const source = yield* files.readFile(files.join(root, file));
129
- return pipe(source, Option.filter(() => INDEX_SKILL.test(file)), Option.flatMap(splitFrontmatter), Option.flatMap(nameOf));
130
- });
131
- const indexSkillIn = Effect.fn("indexSkillIn")(function* indexSkillIn(root) {
132
- const found = yield* skillFiles(root);
133
- const names = yield* Effect.forEach(found, (file) => indexNameAt(root, file), { concurrency: READ_CONCURRENCY$1 });
134
- return Array.head(Array.getSomes(names));
135
- });
136
- // src/entities/workspace/model/workspace-fallow.ts
137
- const MSCH_FALLOW = ["msch", "fallow"];
138
- const FALLOW_PATHS = [
139
- "entry",
140
- "dynamicallyLoaded",
141
- "ignorePatterns"
142
- ];
143
- const Names$2 = Schema.String.pipe(Schema.Array, Schema.optional);
144
- const IgnoredExports = Schema.Struct({
145
- file: Schema.String,
146
- exports: Schema.Array(Schema.String)
147
- });
148
- const WorkspaceFallowSettings = Schema.Struct({
149
- entry: Names$2,
150
- dynamicallyLoaded: Names$2,
151
- ignorePatterns: Names$2,
152
- ignoreDependencies: Names$2,
153
- ignoreExports: IgnoredExports.pipe(Schema.Array, Schema.optional)
154
- });
155
- const fallowPathsOf = (directory, settings) => pipe(FALLOW_PATHS, Array.flatMap((key) => pipe(Option.fromUndefinedOr(settings[key]), Option.map((patterns) => [key, pipe(patterns, Array.map(prefixed(directory)))]), Option.toArray)), Record.fromEntries);
156
- const fallowExportsOf = (directory, settings) => pipe(Option.fromUndefinedOr(settings.ignoreExports), Option.match({
157
- onNone: () => ({}),
158
- onSome: (ignored) => ({ ignoreExports: pipe(ignored, Array.map(({ file, exports }) => ({
159
- file: prefixed(directory)(file),
160
- exports
161
- }))) })
162
- }));
163
- const fallowDependenciesOf = (directory, settings) => pipe(Option.fromUndefinedOr(settings.ignoreDependencies), Option.match({
164
- onNone: () => ({}),
165
- onSome: (ignoreDependencies) => ({ workspaces: { settings: { [directory]: { ignoreDependencies } } } })
166
- }));
167
- const fallowOf = Effect.fn("fallowOf")(function* fallowOf(source) {
168
- const settings = yield* literalSettings({
169
- source,
170
- path: MSCH_FALLOW,
171
- decode: Schema.decodeUnknownEffect(WorkspaceFallowSettings, { onExcessProperty: "error" })
172
- });
173
- return pipe(settings, Option.map((found) => ({
174
- ...fallowPathsOf(source.directory, found),
175
- ...fallowExportsOf(source.directory, found),
176
- ...fallowDependenciesOf(source.directory, found)
177
- })), Option.toArray);
178
- });
179
- // src/shared/lib/added-rules.ts
180
- const Enabled = Schema.Literals(["error", "deny"]);
181
- const EnabledWithOptions = Schema.mutable(Schema.TupleWithRest(Schema.Tuple([Enabled]), [Schema.Unknown]));
182
- const AddedRule = Schema.Union([Enabled, EnabledWithOptions]);
183
- const AddedRules = Schema.Record(Schema.String, AddedRule);
184
- // src/features/build-workspace-settings/model/dependency-allowances.ts
185
- const DEPENDENCY_SETS = { instrumentation: requiredStack["計装は Effect のトレーシングだけで扱う"] ?? [] };
186
- const MSCH_DEV_DEPENDENCIES = ["msch", "devDependencies"];
187
- const MSCH_DEPENDENCIES = ["msch", "dependencies"];
188
- const Names$1 = Schema.String.pipe(Schema.Array, Schema.optional);
189
- const DependencySettings = Schema.Struct({
190
- use: Names$1,
191
- dependencies: Names$1
192
- });
193
- const WorkspaceDependencyAllowances = Schema.Record(Schema.String, DependencySettings);
194
- const allowanceOf = Effect.fn("allowanceOf")(function* allowanceOf(source, [reason, allowance]) {
195
- const sets = yield* usedFrom(source.file, DEPENDENCY_SETS, allowance.use ?? []);
196
- const dependencies = [...Array.flatten(sets), ...allowance.dependencies ?? []];
197
- return [`${source.directory}: ${reason}`, {
198
- workspaces: [source.directory],
199
- dependencies
200
- }];
201
- });
202
- const allowancesOf = Effect.fn("allowancesOf")(function* allowancesOf(source, path) {
203
- const allowed = (yield* literalSettings({
204
- source,
205
- path,
206
- decode: Schema.decodeUnknownEffect(WorkspaceDependencyAllowances)
207
- })).pipe(Option.getOrElse(() => ({})), Record.toEntries);
208
- const entries = yield* Effect.forEach(allowed, (entry) => allowanceOf(source, entry), { concurrency: 1 });
209
- return Record.fromEntries(entries);
210
- });
211
- // src/features/build-workspace-settings/model/test-project.ts
212
- const TEST_ISOLATION = ["test", "isolate"];
213
- const DEFAULT_EXCLUDE = ["**/node_modules/**", "**/.git/**"];
214
- const excludeOf = (mods) => pipe(mods, Option.liftPredicate(Array.isReadonlyArrayNonEmpty), Option.match({
215
- onNone: () => ({}),
216
- onSome: (directories) => ({ exclude: [...DEFAULT_EXCLUDE, ...pipe(directories, Array.map((directory) => `${directory}**/*.test.{ts,tsx}`))] })
217
- }));
218
- const sharedTestProject = (manifest) => ({ directory, config, mods }) => ({
219
- extends: config,
220
- root: directory,
221
- test: {
222
- name: pipe(manifest, Option.flatMap(({ name }) => Option.fromUndefinedOr(name)), Option.getOrElse(() => directory)),
223
- isolate: false,
224
- ...excludeOf(mods)
225
- }
226
- });
227
- const testProjectOf = Effect.fn("testProjectOf")(function* testProjectOf(source, config, manifest) {
228
- const isolated = yield* literalSettings({
229
- source,
230
- path: TEST_ISOLATION,
231
- decode: Schema.decodeUnknownEffect(Schema.Boolean)
232
- });
233
- if (Option.getOrElse(isolated, () => false)) return source.directory;
234
- const files = yield* RepositoryFiles;
235
- const mods = yield* modDirectories(files.dirname(source.file));
236
- return sharedTestProject(manifest)({
237
- directory: source.directory,
238
- config,
239
- mods
240
- });
241
- });
242
- const excludeCopy = (exclude) => pipe(Option.fromUndefinedOr(exclude), Option.match({
243
- onNone: () => ({}),
244
- onSome: (patterns) => ({ exclude: [...patterns] })
245
- }));
246
- /** @internal */
247
- const vitestProjectOf = (project) => {
248
- if (Predicate.isString(project)) return project;
249
- const { name, isolate, exclude } = project.test;
250
- return {
251
- extends: project.extends,
252
- root: project.root,
253
- test: {
254
- name,
255
- isolate,
256
- ...excludeCopy(exclude)
257
- }
258
- };
259
- };
260
- // src/features/build-workspace-settings/model/workspace-public-entries.ts
261
- const PACK_ENTRY = ["pack", "entry"];
262
- const decodePackEntry = Schema.decodeUnknownOption(PackEntry);
263
- const packEntriesIn = (program) => pipe(nestedValues(PACK_ENTRY)(program), Array.flatMap((node) => pipe(literalOf(node), Option.flatMap(decodePackEntry), Option.toArray, Array.flatMap(entriesOf))));
264
- const entryFilesOf = ({ join, packEntries }) => (manifest) => {
265
- const joined = pipe(packEntries, Array.map((entry) => ({
266
- name: entry.name,
267
- source: join(entry.source)
268
- })));
269
- return pipe(publicEntriesOf({
270
- manifest,
271
- join,
272
- packEntries: joined
273
- }), Array.map(({ source }) => source), Array.dedupe);
274
- };
275
- const publicEntryFiles = Effect.fn("publicEntryFiles")(function* publicEntryFiles(root, directory, config) {
276
- const files = yield* RepositoryFiles;
277
- const text = yield* files.readFile(files.join(root, directory, PACKAGE_JSON_FILE));
278
- const packEntries = pipe(config, Option.map(packEntriesIn), Option.getOrElse(() => []));
279
- const join = (target) => files.join(directory, target);
280
- return pipe(text, Option.flatMap(decodePackageJson), Option.map(entryFilesOf({
281
- join,
282
- packEntries
283
- })), Option.getOrElse(() => []));
284
- });
285
- // src/features/build-workspace-settings/model/workspace-settings.ts
286
- const CONFIG_FILE = "vite.config.ts";
287
- const READ_CONCURRENCY = 16;
288
- const MSCH_LINT = ["msch", "lint"];
289
- const MSCH_TEXT = ["msch", "text"];
290
- const ZENN_FILES = ["articles/**/*.md", "books/**/*.md"];
291
- const decodeRules = Schema.decodeUnknownEffect(AddedRules);
292
- const Names = Schema.String.pipe(Schema.Array, Schema.optional);
293
- const WorkspaceOverride = Schema.Struct({
294
- files: Schema.Array(Schema.String),
295
- excludeFiles: Names,
296
- rules: Schema.Record(Schema.String, Schema.Unknown)
297
- });
298
- const WorkspaceLintSettings = Schema.Struct({ overrides: WorkspaceOverride.pipe(Schema.Array, Schema.optional) });
299
- const WorkspaceTextSettings = Schema.Struct({ use: Schema.Array(Schema.Literal("zenn")) });
300
- const overrideOf = Effect.fn("overrideOf")(function* overrideOf(source, override) {
301
- const { file, directory } = source;
302
- const rules = yield* decodeRules(override.rules).pipe(Effect.mapError((error) => settingsInvalid(file)(error.message)));
303
- const files = pipe(override.files, Array.map(prefixed(directory)));
304
- return pipe(Option.fromUndefinedOr(override.excludeFiles), Option.match({
305
- onNone: () => ({
306
- files,
307
- rules
308
- }),
309
- onSome: (excluded) => ({
310
- files,
311
- excludeFiles: pipe(excluded, Array.map(prefixed(directory))),
312
- rules
313
- })
314
- }));
315
- });
316
- const lintOf = Effect.fn("lintOf")(function* lintOf(source) {
317
- const settings = yield* literalSettings({
318
- source,
319
- path: MSCH_LINT,
320
- decode: Schema.decodeUnknownEffect(WorkspaceLintSettings, { onExcessProperty: "error" })
321
- });
322
- const lint = Option.getOrElse(settings, () => ({}));
323
- return { overrides: yield* Effect.forEach(lint.overrides ?? [], (override) => overrideOf(source, override), { concurrency: 1 }) };
324
- });
325
- const articlesOf = Effect.fn("articlesOf")(function* articlesOf(source) {
326
- const settings = yield* literalSettings({
327
- source,
328
- path: MSCH_TEXT,
329
- decode: Schema.decodeUnknownEffect(WorkspaceTextSettings, { onExcessProperty: "error" })
330
- });
331
- return pipe(settings, Option.filter(({ use }) => Array.contains(use, "zenn")), Option.map(() => pipe(ZENN_FILES, Array.map(prefixed(source.directory)))), Option.getOrElse(() => []));
332
- });
333
- const settingsOf = Effect.fn("settingsOf")(function* settingsOf(source) {
334
- const lint = yield* lintOf(source);
335
- const articles = yield* articlesOf(source);
336
- const devDependencies = yield* allowancesOf(source, MSCH_DEV_DEPENDENCIES);
337
- const dependencies = yield* allowancesOf(source, MSCH_DEPENDENCIES);
338
- const ownTests = testsItself(source.program);
339
- const files = yield* RepositoryFiles;
340
- const manifest = yield* readManifest(files.dirname(source.file));
341
- const tasks = tasksOf(manifest)(source.program);
342
- const testProject = yield* testProjectOf(source, `${source.directory}/${CONFIG_FILE}`, manifest);
343
- return {
344
- directory: source.directory,
345
- ...lint,
346
- articles,
347
- devDependencies,
348
- dependencies,
349
- ownTests,
350
- testProject,
351
- tasks
352
- };
353
- });
354
- const unconfiguredWorkspace = Effect.fn("unconfiguredWorkspace")(function* unconfiguredWorkspace(root, directory) {
355
- const files = yield* RepositoryFiles;
356
- const publicEntries = yield* publicEntryFiles(root, directory, Option.none());
357
- const manifest = yield* readManifest(files.join(root, directory));
358
- const mods = yield* modDirectories(files.join(root, directory));
359
- return {
360
- directory,
361
- overrides: [],
362
- articles: [],
363
- fallow: [],
364
- devDependencies: {},
365
- dependencies: {},
366
- ownTests: false,
367
- testProject: sharedTestProject(manifest)({
368
- directory,
369
- config: false,
370
- mods
371
- }),
372
- tasks: NO_TASKS,
373
- publicEntries
374
- };
375
- });
376
- const workspaceIn = Effect.fn("workspaceIn")(function* workspaceIn(options, directory) {
377
- const files = yield* RepositoryFiles;
378
- const file = files.join(options.root, directory, CONFIG_FILE);
379
- const text = yield* files.readFile(file);
380
- if (Option.isNone(text)) return yield* unconfiguredWorkspace(options.root, directory);
381
- const program = yield* programOf(file, text.value);
382
- const settings = yield* settingsOf({
383
- file,
384
- directory,
385
- program
386
- });
387
- const publicEntries = yield* publicEntryFiles(options.root, directory, Option.some(program));
388
- const fallow = yield* fallowOf({
389
- file,
390
- directory,
391
- program
392
- });
393
- return {
394
- ...settings,
395
- publicEntries,
396
- fallow
397
- };
398
- });
399
- const mergedTasks = (found) => ({
400
- verify: pipe(found, Array.flatMap(({ tasks }) => tasks.verify)),
401
- test: pipe(found, Array.flatMap(({ tasks }) => tasks.test)),
402
- native: pipe(found, Array.flatMap(({ tasks }) => tasks.native))
403
- });
404
- const mergedAllowances = (found) => ({
405
- devDependencies: merged(pipe(found, Array.map(({ devDependencies }) => devDependencies))),
406
- dependencies: merged(pipe(found, Array.map(({ dependencies }) => dependencies)))
407
- });
408
- const collectWorkspaceSettings = Effect.fn("collectWorkspaceSettings")(function* collectWorkspaceSettings(options) {
409
- yield* Effect.ignore(writeLockedClosures(options.root));
410
- const directories = yield* workspaceDirectories(options.root);
411
- const found = yield* Effect.forEach(directories, (directory) => workspaceIn(options, directory), { concurrency: READ_CONCURRENCY });
412
- const shadcnUi = yield* Effect.forEach(directories, (directory) => shadcnUiIn(options.root, directory), { concurrency: READ_CONCURRENCY });
413
- return {
414
- members: yield* structureMembers(options.root, directories),
415
- plugins: yield* sourcePlugins(options.root, directories),
416
- ignoredDirectories: yield* collectIgnoredDirectories(options.root),
417
- lint: {
418
- overrides: pipe(found, Array.flatMap(({ overrides }) => overrides)),
419
- shadcnUi: Array.getSomes(shadcnUi),
420
- publicEntries: pipe(found, Array.flatMap(({ publicEntries }) => publicEntries)),
421
- deployEntries: yield* deployEntries(options.root),
422
- siteEntries: yield* siteEntries(options.root)
423
- },
424
- testProjects: pipe(found, Array.filter(({ ownTests }) => !ownTests), Array.map(({ testProject }) => vitestProjectOf(testProject))),
425
- tasks: mergedTasks(found),
426
- ...mergedAllowances(found),
427
- indexSkill: yield* indexSkillIn(options.root),
428
- articles: pipe(found, Array.flatMap(({ articles }) => articles)),
429
- fallow: pipe(found, Array.flatMap(({ fallow }) => fallow))
430
- };
431
- });
432
- const workspaceSettings = (options) => Effect.runPromise(collectWorkspaceSettings(options).pipe(Effect.provide(nodeRepositoryFiles)));
1
+ import { t as workspaceSettings } from "./build-workspace-settings-C2EOC9GX.mjs";
2
+ import { r as ignoredDirectories } from "./ignored-directories-BGiOSvNx.mjs";
433
3
  export { ignoredDirectories, workspaceSettings };
434
-
435
- //# sourceMappingURL=workspace-settings.mjs.map