@r_masseater/msch 0.32.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cli-contract-CmaJS4ne.mjs → cli-contract-mzluqQvf.mjs} +2 -2
- package/dist/{cli-contract-CmaJS4ne.mjs.map → cli-contract-mzluqQvf.mjs.map} +1 -1
- package/dist/cli.mjs +11483 -2601
- package/dist/cli.mjs.map +1 -1
- package/dist/config.mjs +1 -1
- package/dist/config.mjs.map +1 -1
- package/dist/decision-rules.mjs +1 -1
- package/dist/{lint-preset-CtRoIi4F.mjs → define-lint-preset-X-_KpO1E.mjs} +29 -16
- package/dist/define-lint-preset-X-_KpO1E.mjs.map +1 -0
- package/dist/lint-rules.mjs +9 -9
- package/dist/lint-rules.mjs.map +1 -1
- package/dist/lint.mjs +1 -1
- package/dist/oxlint.mjs +2 -2
- package/dist/oxlint.mjs.map +1 -1
- package/dist/{workspace-BNAwy85Z.mjs → package-DU5r3bvx.mjs} +542 -526
- package/dist/package-DU5r3bvx.mjs.map +1 -0
- package/dist/{repository-files-D_lFq7Bj.mjs → repository-files-R0NW0NE9.mjs} +23 -2
- package/dist/repository-files-R0NW0NE9.mjs.map +1 -0
- package/dist/workspace-settings.mjs +7 -7
- package/dist/workspace-settings.mjs.map +1 -1
- package/package.json +6 -3
- package/skills/msch-checks/SKILL.md +1 -1
- package/skills/repository-config/SKILL.md +2 -2
- package/skills/workspace-settings/SKILL.md +1 -1
- package/dist/lint-preset-CtRoIi4F.mjs.map +0 -1
- package/dist/repository-files-D_lFq7Bj.mjs.map +0 -1
- package/dist/workspace-BNAwy85Z.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-DU5r3bvx.mjs","names":["Arr","Rec","CONFIG_FILE","taggedError","Arr","Rec","Arr","Arr","taggedError","Str","Arr","SEPARATOR","Str","Arr","Str","READ_CONCURRENCY","Arr","taggedError","Rec","ROOT_SUBPATH","Rec","Arr","Str","SEPARATOR","Rec","Arr","Str","Arr","Str","Rec"],"sources":["../src/entities/workspace/model/config-literal.ts","../src/entities/workspace/model/workspace-config-source.ts","../src/entities/workspace/model/workspace-tasks.ts","../src/entities/workspace/model/run-tasks.ts","../src/entities/workspace/model/workspace-unreadable.ts","../src/entities/workspace/model/workspace-manifest.ts","../src/entities/workspace/model/workspace-projects.ts","../src/entities/workspace/model/workspace-patterns.ts","../src/entities/workspace/model/workspace-names.ts","../src/entities/workspace/model/deploy-entries.ts","../src/entities/workspace/model/lockfile-unreadable.ts","../src/entities/workspace/model/locked-packages.ts","../src/entities/package/model/dependencies.ts","../src/entities/package/model/public-entries.ts","../src/entities/package/model/published.ts"],"sourcesContent":["import { Array as Arr, Match, Option, Predicate, Record as Rec, Schema, pipe } from \"effect\";\nimport type { ESTree } from \"vite-plus/lint/plugins\";\n\nexport type Literal = string | number | boolean | null | readonly Literal[] | LiteralObject;\n\nexport interface LiteralObject {\n readonly [key: string]: Literal;\n}\n\nconst WRAPPERS = [\"TSAsExpression\", \"TSSatisfiesExpression\", \"ParenthesizedExpression\"] as const;\n\nexport const KeySchema = Schema.Union([\n Schema.Struct({ type: Schema.Literal(\"Identifier\"), name: Schema.String }),\n Schema.Struct({ type: Schema.Literal(\"Literal\"), value: Schema.String }),\n]);\nconst Quasi = Schema.Struct({ value: Schema.Struct({ cooked: Schema.String }) });\nconst PropertyNode = Schema.Struct({\n type: Schema.Literal(\"Property\"),\n computed: Schema.Literal(false),\n key: KeySchema,\n value: Schema.Unknown,\n});\nconst WrappedNode = Schema.Struct({ type: Schema.Literals(WRAPPERS), expression: Schema.Unknown });\nconst ValueNode = Schema.Union([\n Schema.Struct({\n type: Schema.Literal(\"Literal\"),\n value: Schema.Union([Schema.String, Schema.Finite, Schema.Boolean, Schema.Null]),\n }),\n Schema.Struct({\n type: Schema.Literal(\"TemplateLiteral\"),\n expressions: Schema.Tuple([]),\n quasis: Schema.Array(Quasi),\n }),\n Schema.Struct({\n type: Schema.Literal(\"ArrayExpression\"),\n elements: Schema.Array(Schema.Unknown),\n }),\n Schema.Struct({\n type: Schema.Literal(\"ObjectExpression\"),\n properties: Schema.Array(PropertyNode),\n }),\n]);\n\nconst decodeWrapped = Schema.decodeUnknownOption(WrappedNode);\nconst decodeValue = Schema.decodeUnknownOption(ValueNode);\nconst decodeProperty = Schema.decodeUnknownOption(\n Schema.Struct({ type: Schema.Literal(\"Property\"), key: KeySchema, value: Schema.Unknown }),\n);\nconst decodeObject = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"ObjectExpression\"),\n properties: Schema.Array(Schema.Unknown),\n }),\n);\n\nexport const keyName = (key: typeof KeySchema.Type): string =>\n Match.value(key).pipe(\n Match.discriminatorsExhaustive(\"type\")({\n Identifier: (identifier) => identifier.name,\n Literal: (literal) => literal.value,\n }),\n );\n\nexport const literalOf = (node: unknown): Option.Option<Literal> => {\n const wrapped = decodeWrapped(node);\n if (Option.isSome(wrapped)) {\n return literalOf(wrapped.value.expression);\n }\n return pipe(\n decodeValue(node),\n Option.flatMap((value) =>\n Match.value(value).pipe(\n Match.discriminatorsExhaustive(\"type\")({\n Literal: (scalar): Option.Option<Literal> => Option.some(scalar.value),\n TemplateLiteral: (template): Option.Option<Literal> =>\n Option.some(\n pipe(\n template.quasis,\n Arr.map((quasi) => quasi.value.cooked),\n Arr.join(\"\"),\n ),\n ),\n ArrayExpression: (array): Option.Option<Literal> =>\n pipe(array.elements, Arr.map(literalOf), Option.all),\n ObjectExpression: (object): Option.Option<Literal> =>\n pipe(\n object.properties,\n Arr.map((property) =>\n pipe(\n literalOf(property.value),\n Option.map((literal) => [keyName(property.key), literal] as const),\n ),\n ),\n Option.all,\n Option.map(Rec.fromEntries),\n ),\n }),\n ),\n ),\n );\n};\n\nexport const propertyValue =\n (name: string) =>\n (object: unknown): Option.Option<unknown> =>\n pipe(\n decodeObject(object),\n Option.flatMap(({ properties }) =>\n pipe(\n properties,\n Arr.findFirst((property) =>\n pipe(\n decodeProperty(property),\n Option.filter(({ key }) => keyName(key) === name),\n Option.map(({ value }) => value),\n ),\n ),\n ),\n ),\n );\n\nexport const childrenOf = (node: unknown): readonly unknown[] => {\n if (Arr.isArray(node)) {\n return node;\n }\n if (Predicate.isReadonlyObject(node)) {\n return Rec.values(node);\n }\n return [];\n};\n\nexport const nestedValues =\n (path: readonly [string, string]) =>\n (node: unknown): readonly unknown[] => {\n const [outer, inner] = path;\n const own = pipe(\n Option.some(node),\n Option.flatMap(propertyValue(outer)),\n Option.flatMap(propertyValue(inner)),\n Option.toArray,\n );\n return [...own, ...pipe(childrenOf(node), Arr.flatMap(nestedValues(path)))];\n };\n\nconst StringNode = Schema.Union([\n Schema.Struct({\n type: Schema.Literal<ESTree.StringLiteral[\"type\"]>(\"Literal\"),\n value: Schema.String,\n start: Schema.Finite,\n }),\n Schema.Struct({\n type: Schema.Literal<ESTree.TemplateElement[\"type\"]>(\"TemplateElement\"),\n value: Schema.Struct({ cooked: Schema.String }),\n start: Schema.Finite,\n }),\n]);\nconst decodeStringNode = Schema.decodeUnknownOption(StringNode);\n\nexport interface FoundString {\n readonly text: string;\n readonly start: number;\n}\n\nconst textOf = (node: typeof StringNode.Type): string => {\n if (node.type === \"Literal\") {\n return node.value;\n }\n return node.value.cooked;\n};\n\nexport const stringsIn = (node: unknown): readonly FoundString[] => {\n const own = pipe(\n decodeStringNode(node),\n Option.map((found) => ({ text: textOf(found), start: found.start })),\n Option.toArray,\n );\n return [...own, ...pipe(childrenOf(node), Arr.flatMap(stringsIn))];\n};\n","import { Array as Arr, Effect, Option, Record as Rec, Schema, pipe } from \"effect\";\nimport { parse } from \"vite-plus\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { literalOf, nestedValues } from \"./config-literal.ts\";\n\nconst SINGLE = 1;\nconst CONFIG_FILE = \"vite.config.ts\";\n\nconst taggedError = Schema.TaggedError;\n\nclass WorkspaceSettingsInvalid extends taggedError<\n WorkspaceSettingsInvalid,\n { readonly brand: unique symbol }\n>()(\"WorkspaceSettingsInvalid\", { file: Schema.String, message: Schema.String }) {}\n\nexport const settingsInvalid =\n (file: string) =>\n (reason: string): WorkspaceSettingsInvalid =>\n WorkspaceSettingsInvalid.make({ file, message: `${file}: ${reason}` });\n\nexport interface WorkspaceSource {\n readonly file: string;\n readonly directory: string;\n readonly program: unknown;\n}\n\nexport type SettingsPath = readonly [string, string];\n\nconst notLiteral = ([outer, inner]: SettingsPath): string =>\n `${outer}.${inner} must be written with literal values, because the root vite.config.ts reads it without running this file. Name a set the root config defines in use instead of importing values.`;\n\nexport const merged = <Value>(\n records: readonly Readonly<Record<string, Value>>[],\n): Record<string, Value> => pipe(records, Arr.flatMap(Rec.toEntries), Rec.fromEntries);\n\nexport const usedFrom = Effect.fn(\"usedFrom\")(function* usedFrom<Value>(\n file: string,\n sets: Readonly<Record<string, Value>>,\n used: readonly string[],\n) {\n const unknownSets = pipe(\n used,\n Arr.filter((name) => !Rec.has(sets, name)),\n );\n if (Arr.isReadonlyArrayNonEmpty(unknownSets)) {\n return yield* settingsInvalid(file)(\n `msch uses sets the root does not define: ${Arr.join(unknownSets, \", \")}. Defined: ${Arr.join(Rec.keys(sets), \", \")}.`,\n );\n }\n return pipe(\n used,\n Arr.flatMap((name) => Option.toArray(Rec.get(sets, name))),\n );\n});\n\nconst singleValue = Effect.fn(\"singleValue\")(function* singleValue(\n source: WorkspaceSource,\n path: SettingsPath,\n) {\n const found = nestedValues(path)(source.program);\n if (found.length > SINGLE) {\n return yield* settingsInvalid(source.file)(`${Arr.join(path, \".\")} appears more than once.`);\n }\n return Arr.head(found);\n});\n\nexport interface LiteralSettingsRequest<Settings> {\n readonly source: WorkspaceSource;\n readonly path: SettingsPath;\n readonly decode: (input: unknown) => Effect.Effect<Settings, Schema.SchemaError>;\n}\n\nexport const literalSettings = <Settings>({\n source,\n path,\n decode,\n}: LiteralSettingsRequest<Settings>): Effect.Effect<\n Option.Option<Settings>,\n WorkspaceSettingsInvalid\n> =>\n Effect.gen(function* literalSettingsIn() {\n const node = yield* singleValue(source, path);\n if (Option.isNone(node)) {\n return Option.none();\n }\n const literal = literalOf(node.value);\n if (Option.isNone(literal)) {\n return yield* settingsInvalid(source.file)(notLiteral(path));\n }\n const settings = yield* decode(literal.value).pipe(\n Effect.mapError((error) => settingsInvalid(source.file)(error.message)),\n );\n return Option.some(settings);\n });\n\nexport const programOf = Effect.fn(\"programOf\")(function* programOf(file: string, text: string) {\n const parsed = yield* Effect.promise(() => parse(file, text, { lang: \"ts\" }));\n if (Arr.isReadonlyArrayNonEmpty(parsed.errors)) {\n return yield* settingsInvalid(file)(\"vite.config.ts does not parse.\");\n }\n const program: unknown = parsed.program;\n return program;\n});\n\ninterface WorkspaceConfig {\n readonly file: string;\n readonly source: string;\n readonly program: unknown;\n}\n\nexport const workspaceConfigOf = Effect.fn(\"workspaceConfigOf\")(function* workspaceConfigOf(\n root: string,\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const file = files.join(root, directory, CONFIG_FILE);\n const text = yield* files.readFile(file);\n if (Option.isNone(text)) {\n return Option.none<WorkspaceConfig>();\n }\n const program = yield* programOf(file, text.value);\n return Option.some<WorkspaceConfig>({ file, source: text.value, program });\n});\n\nexport type { WorkspaceSettingsInvalid };\n","import { Array as Arr, Effect, Option, Schema, pipe } from \"effect\";\nimport { resolveConfigFromFile } from \"vite-plus\";\n\nimport type { Manifest } from \"#/entities/package/@x/workspace.ts\";\n\nimport { nestedValues } from \"./config-literal.ts\";\nimport { settingsInvalid } from \"./workspace-config-source.ts\";\n\nexport const VERIFY_TASK = [\"tasks\", \"verify\"] as const;\n\nexport const RUN_TASKS = [\"run\", \"tasks\"] as const;\n\nexport interface WorkspaceTasks {\n readonly verify: readonly string[];\n}\n\nexport const NO_TASKS: WorkspaceTasks = { verify: [] };\n\nconst Tasks = Schema.Struct({ verify: Schema.Unknown });\nconst isVerified = Schema.is(Schema.Struct({ run: Schema.Struct({ tasks: Tasks }) }));\n\nexport const definesTask =\n (path: readonly [string, string]) =>\n (program: unknown): boolean =>\n Arr.isReadonlyArrayNonEmpty(nestedValues(path)(program));\n\nexport const hasVerifyTask = Effect.fn(\"hasVerifyTask\")(function* hasVerifyTask(file: string) {\n const config = yield* Effect.tryPromise({\n try: () => resolveConfigFromFile(file),\n catch: () => settingsInvalid(file)(\"vite.config.ts does not load.\"),\n }).pipe(Effect.option);\n return Option.exists(config, isVerified);\n});\n\nexport const tasksOf =\n (manifest: Option.Option<Manifest>) =>\n (program: unknown): WorkspaceTasks =>\n pipe(\n manifest,\n Option.flatMap((found) => Option.fromUndefinedOr(found.name)),\n Option.match({\n onNone: () => NO_TASKS,\n onSome: (name) => ({\n verify: Arr.filter([`${name}#verify`], () => definesTask(VERIFY_TASK)(program)),\n }),\n }),\n );\n","import { Array as Arr, Effect, Option, Schema, pipe } from \"effect\";\n\nimport { KeySchema, nestedValues } from \"./config-literal.ts\";\nimport { workspaceConfigOf } from \"./workspace-config-source.ts\";\nimport { RUN_TASKS } from \"./workspace-tasks.ts\";\n\nconst TaskProperty = Schema.Struct({\n type: Schema.Literal(\"Property\"),\n computed: Schema.Literal(false),\n key: KeySchema,\n value: Schema.Unknown,\n start: Schema.Finite,\n});\nconst TaskObject = Schema.Struct({\n type: Schema.Literal(\"ObjectExpression\"),\n properties: Schema.Array(Schema.Unknown),\n});\n\nconst decodeTaskProperty = Schema.decodeUnknownOption(TaskProperty);\nconst decodeTaskObject = Schema.decodeUnknownOption(TaskObject);\n\nexport type RunTask = typeof TaskProperty.Type;\n\ninterface RunTasks {\n readonly file: string;\n readonly source: string;\n readonly tasks: readonly RunTask[];\n}\n\nconst tasksIn = (program: unknown): readonly RunTask[] =>\n pipe(\n nestedValues(RUN_TASKS)(program),\n Arr.flatMap((tasks) =>\n pipe(\n decodeTaskObject(tasks),\n Option.map(({ properties }) => properties),\n Option.getOrElse((): readonly unknown[] => []),\n ),\n ),\n Arr.flatMap((property) => Option.toArray(decodeTaskProperty(property))),\n );\n\nexport const runTasksOf = Effect.fn(\"runTasksOf\")(function* runTasksOf(\n root: string,\n directory: string,\n) {\n const config = yield* workspaceConfigOf(root, directory);\n return pipe(\n config,\n Option.map(({ file, source, program }): RunTasks => ({\n file,\n source,\n tasks: tasksIn(program),\n })),\n );\n});\n","import { Schema } from \"effect\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class WorkspaceUnreadable extends taggedError<\n WorkspaceUnreadable,\n { readonly brand: unique symbol }\n>()(\"WorkspaceUnreadable\", { root: Schema.String, reason: Schema.String }) {}\n","import { readWorkspaceManifest } from \"@pnpm/workspace.workspace-manifest-reader\";\nimport type { WorkspaceManifest } from \"@pnpm/workspace.workspace-manifest-reader\";\nimport { Effect, Option } from \"effect\";\n\nimport { WorkspaceUnreadable } from \"./workspace-unreadable.ts\";\n\n/** @internal */\nexport const workspaceManifest = (root: string): Effect.Effect<Option.Option<WorkspaceManifest>> =>\n Effect.tryPromise({\n try: () => readWorkspaceManifest(root),\n catch: (cause) => WorkspaceUnreadable.make({ root, reason: String(cause) }),\n }).pipe(\n Effect.map(Option.fromUndefinedOr),\n Effect.orElseSucceed(() => Option.none()),\n );\n","import { findWorkspaceProjectsNoCheck } from \"@pnpm/workspace.projects-reader\";\nimport type { Project } from \"@pnpm/workspace.projects-reader\";\nimport { Array as Arr, Effect, Option, Order, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { workspaceManifest } from \"./workspace-manifest.ts\";\nimport { WorkspaceUnreadable } from \"./workspace-unreadable.ts\";\n\nexport interface WorkspaceProject {\n readonly directory: string;\n readonly packageName: Option.Option<string>;\n readonly published: boolean;\n readonly keywords: readonly string[];\n readonly files: Option.Option<readonly string[]>;\n}\n\nconst byDirectory = Order.mapInput(Str.Order, ({ directory }: WorkspaceProject) => directory);\n\nconst projectsMatching = (\n root: string,\n patterns: readonly string[],\n): Effect.Effect<readonly Project[]> =>\n Effect.tryPromise({\n try: () => findWorkspaceProjectsNoCheck(root, { patterns: [...patterns] }),\n catch: (cause) => WorkspaceUnreadable.make({ root, reason: String(cause) }),\n }).pipe(Effect.orElseSucceed((): readonly Project[] => []));\n\n/** @internal */\nexport const workspaceProjects = Effect.fn(\"workspaceProjects\")(function* workspaceProjects(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const manifest = yield* workspaceManifest(root);\n const patterns = pipe(\n manifest,\n Option.flatMap(({ packages }) => Option.fromNullishOr(packages)),\n Option.getOrElse((): readonly string[] => []),\n );\n if (!Arr.isReadonlyArrayNonEmpty(patterns)) {\n return [];\n }\n const projects = yield* projectsMatching(root, patterns);\n const found = pipe(\n projects,\n Arr.map(({ rootDir, manifest: own }): WorkspaceProject => ({\n directory: files.relative(root, rootDir),\n packageName: Option.fromUndefinedOr(own.name),\n published: own.private !== true,\n keywords: Option.getOrElse(Option.fromUndefinedOr(own.keywords), () => []),\n files: Option.fromUndefinedOr(own.files),\n })),\n Arr.filter(({ directory }) => Str.isNonEmpty(directory)),\n );\n return Arr.sort(found, byDirectory);\n});\n\n/** @internal */\nexport const workspaceDirectories = Effect.fn(\"workspaceDirectories\")(\n function* workspaceDirectories(root: string) {\n const projects = yield* workspaceProjects(root);\n return pipe(\n projects,\n Arr.map(({ directory }) => directory),\n );\n },\n);\n","import { String as Str } from \"effect\";\n\nconst SEPARATOR = \"/\";\nconst NEGATION = \"!\";\nconst RELATIVE = \"./\";\n\nexport const withoutRelative = (target: string): string => {\n if (Str.startsWith(RELATIVE)(target)) {\n return Str.slice(RELATIVE.length)(target);\n }\n return target;\n};\n\nexport const prefixed =\n (directory: string) =>\n (pattern: string): string => {\n if (Str.startsWith(NEGATION)(pattern)) {\n return `${NEGATION}${directory}${SEPARATOR}${Str.slice(NEGATION.length)(pattern)}`;\n }\n return `${directory}${SEPARATOR}${withoutRelative(pattern)}`;\n };\n","import { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { workspaceProjects } from \"./workspace-projects.ts\";\nimport type { WorkspaceProject } from \"./workspace-projects.ts\";\n\nconst ALTERNATIVE = \"|\";\nconst SCOPE = /^@[^/]+\\//u;\nconst SPECIAL = /[$()*+.?[\\\\\\]^{|}]/gu;\n\nexport interface NamedWorkspace {\n readonly directory: string;\n readonly names: readonly string[];\n readonly packageName: Option.Option<string>;\n}\n\n/** @internal */\nexport const patternOf = (names: readonly string[]): RegExp => {\n const alternatives = pipe(names, Arr.map(Str.replaceAll(SPECIAL, String.raw`\\$&`)));\n return new RegExp(\n `(?<![\\\\p{L}\\\\p{N}_-])(?:${Arr.join(alternatives, ALTERNATIVE)})(?![\\\\p{L}\\\\p{N}_-])`,\n \"gu\",\n );\n};\n\nconst namedIn =\n (basename: (directory: string) => string) =>\n ({ directory, packageName }: WorkspaceProject): NamedWorkspace => {\n const unscoped = pipe(packageName, Option.map(Str.replace(SCOPE, \"\")));\n const names = pipe(\n [Option.some(directory), Option.some(basename(directory)), packageName, unscoped],\n Arr.getSomes,\n Arr.dedupe,\n );\n return { directory, names, packageName };\n };\n\n/** @internal */\nexport const namedWorkspaces = Effect.fn(\"namedWorkspaces\")(function* namedWorkspaces(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const projects = yield* workspaceProjects(root);\n return pipe(projects, Arr.map(namedIn((directory) => files.basename(directory))));\n});\n","import { Array as Arr, Effect, Option, Predicate, Schema, pipe } from \"effect\";\nimport { parse } from \"vite-plus\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { KeySchema, childrenOf, keyName, stringsIn } from \"./config-literal.ts\";\n\nconst MAIN_KEY = \"main\";\nconst READ_CONCURRENCY = 16;\nconst SCRIPT = /\\.[cm]?tsx?$/u;\nconst SKIPPED = /\\.test\\.|\\.d\\.[cm]?ts$/u;\nconst ALCHEMY_IMPORT = /from\\s+[\"'](?:alchemy|@alchemy\\.run)(?:\\/[^\"']*)?[\"']/u;\nconst MAIN_PROPERTY = /\\bmain\\s*:/u;\nconst decodeKey = Schema.decodeUnknownOption(KeySchema);\n\nconst isMainProperty = (node: Readonly<Record<string, unknown>>): boolean =>\n node[\"type\"] === \"Property\" &&\n pipe(\n decodeKey(node[\"key\"]),\n Option.exists((key) => keyName(key) === MAIN_KEY),\n );\n\nconst mainTargetsIn = (node: unknown): readonly string[] => {\n if (Predicate.isReadonlyObject(node) && isMainProperty(node)) {\n return pipe(\n stringsIn(node[\"value\"]),\n Arr.head,\n Option.map(({ text }) => text),\n Option.toArray,\n );\n }\n return pipe(childrenOf(node), Arr.flatMap(mainTargetsIn));\n};\n\nconst declaredIn = Effect.fn(\"declaredIn\")(function* declaredIn(root: string, file: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, file));\n if (Option.isNone(text) || !ALCHEMY_IMPORT.test(text.value) || !MAIN_PROPERTY.test(text.value)) {\n return [];\n }\n const parsed = yield* Effect.promise(() => parse(file, text.value, { lang: \"ts\" }));\n return pipe(\n mainTargetsIn(parsed.program),\n Arr.map((target) => files.join(files.dirname(file), target)),\n );\n});\n\nexport const deployEntries = Effect.fn(\"deployEntries\")(function* deployEntries(root: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.listedFiles(root);\n const declaring = pipe(\n listed,\n Arr.filter((file) => SCRIPT.test(file) && !SKIPPED.test(file)),\n );\n const found = yield* Effect.forEach(declaring, (file) => declaredIn(root, file), {\n concurrency: READ_CONCURRENCY,\n });\n return pipe(\n Arr.flatten(found),\n Arr.filter((file) => Arr.contains(listed, file)),\n Arr.dedupe,\n );\n});\n","import { Schema } from \"effect\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class LockfileUnreadable extends taggedError<\n LockfileUnreadable,\n { readonly brand: unique symbol }\n>()(\"LockfileUnreadable\", { root: Schema.String, reason: Schema.String }) {}\n","import { readWantedLockfile } from \"@pnpm/lockfile.fs\";\nimport { Effect, Option, Record as Rec, pipe } from \"effect\";\n\nimport { LockfileUnreadable } from \"./lockfile-unreadable.ts\";\n\n/** @internal */\nexport const lockedPackages = (\n root: string,\n): Effect.Effect<Option.Option<readonly string[]>, LockfileUnreadable> =>\n Effect.tryPromise({\n try: () => readWantedLockfile(root, { ignoreIncompatible: false }),\n catch: (cause) => LockfileUnreadable.make({ root, reason: String(cause) }),\n }).pipe(\n Effect.map((lockfile) =>\n pipe(\n Option.fromNullishOr(lockfile),\n Option.flatMap(({ packages }) => Option.fromUndefinedOr(packages)),\n Option.map(Rec.keys),\n ),\n ),\n );\n","import {\n Array as Arr,\n Effect,\n Option,\n Order,\n Predicate,\n Schema,\n String as Str,\n Record as Rec,\n pipe,\n} from \"effect\";\n\nimport { RepositoryFiles, NODE_MODULES } from \"#/shared/lib/repository-files.ts\";\n\nexport interface DependencyEntry {\n readonly packageName: string;\n readonly specifier: string;\n readonly declarationsPath: string;\n}\n\nconst DependencyMap = Schema.optional(Schema.Record(Schema.String, Schema.String));\n\nconst PackageManifest = Schema.Struct({\n name: Schema.optional(Schema.String),\n dependencies: DependencyMap,\n devDependencies: DependencyMap,\n peerDependencies: DependencyMap,\n exports: Schema.optional(Schema.Unknown),\n types: Schema.optional(Schema.String),\n typings: Schema.optional(Schema.String),\n main: Schema.optional(Schema.String),\n});\n\nexport type Manifest = typeof PackageManifest.Type;\n\nexport const MANIFEST_FILE = \"package.json\";\nconst WORKSPACE_PROTOCOL = \"workspace:\";\nconst ROOT_SUBPATH = \".\";\nconst SUBPATH_PREFIX = \"./\";\nconst WILDCARD = \"*\";\nconst TYPES_CONDITION = \"types\";\nconst TYPES_SCOPE = \"@types/\";\nconst TYPES_SCOPE_SEPARATOR = \"__\";\nconst CONDITION_DEPTH_LIMIT = 8;\nconst ROOT_DEPTH = 0;\nconst DEPTH_STEP = 1;\nconst DECLARATIONS_SUFFIX = /\\.d\\.[cm]?ts$|\\.[cm]?tsx?$/u;\nconst SCRIPT_SUFFIX = /\\.(?<module>[cm]?)js$/u;\n\nexport const readManifest = Effect.fn(\"readManifest\")(function* readManifest(directory: string) {\n const files = yield* RepositoryFiles;\n const manifestText = yield* files.readFile(files.join(directory, MANIFEST_FILE));\n const text = yield* Effect.fromOption(manifestText);\n return yield* Schema.decodeEffect(Schema.fromJsonString(PackageManifest))(text);\n}, Effect.option);\n\nconst conditionsOf = (held: unknown): readonly (readonly [string, unknown])[] => {\n if (!Predicate.isObject(held)) {\n return [];\n }\n return Rec.toEntries(held);\n};\n\nconst typesConditionIn = (held: unknown, depth: number): Option.Option<string> => {\n if (depth > CONDITION_DEPTH_LIMIT) {\n return Option.none();\n }\n const entries = conditionsOf(held);\n const declared = Arr.findFirst(entries, ([condition, target]) =>\n Option.liftPredicate(\n target,\n (candidate) => condition === TYPES_CONDITION && Predicate.isString(candidate),\n ),\n ).pipe(Option.filter(Predicate.isString));\n return Option.orElse(declared, () =>\n Arr.findFirst(entries, ([, nested]) => typesConditionIn(nested, depth + DEPTH_STEP)),\n );\n};\n\nconst anyConditionIn = (held: unknown, depth: number): Option.Option<string> => {\n if (Predicate.isString(held)) {\n return Option.some(held);\n }\n if (depth > CONDITION_DEPTH_LIMIT) {\n return Option.none();\n }\n return Arr.findFirst(conditionsOf(held), ([, nested]) =>\n anyConditionIn(nested, depth + DEPTH_STEP),\n );\n};\n\nconst targetPathsOf = (target: unknown): readonly string[] =>\n Arr.getSomes([typesConditionIn(target, ROOT_DEPTH), anyConditionIn(target, ROOT_DEPTH)]);\n\ninterface SubpathTarget {\n readonly subpath: string;\n readonly target: unknown;\n}\n\nconst subpathTargetsOf = (exportsField: unknown): readonly SubpathTarget[] => {\n if (Predicate.isString(exportsField)) {\n return [{ subpath: ROOT_SUBPATH, target: exportsField }];\n }\n const entries = conditionsOf(exportsField);\n if (\n !pipe(\n entries,\n Arr.some(([subpath]) => Str.startsWith(ROOT_SUBPATH)(subpath)),\n )\n ) {\n return Arr.match(entries, {\n onEmpty: () => [],\n onNonEmpty: () => [{ subpath: ROOT_SUBPATH, target: exportsField }],\n });\n }\n return pipe(\n entries,\n Arr.filter(([subpath]) => subpath === ROOT_SUBPATH || Str.startsWith(SUBPATH_PREFIX)(subpath)),\n Arr.filter(([subpath]) => !Str.includes(WILDCARD)(subpath)),\n Arr.map(([subpath, target]) => ({ subpath, target })),\n );\n};\n\nconst declarationsCandidateFor = (entryPath: string): Option.Option<string> => {\n if (DECLARATIONS_SUFFIX.test(entryPath)) {\n return Option.some(entryPath);\n }\n if (!SCRIPT_SUFFIX.test(entryPath)) {\n return Option.none();\n }\n return Option.some(Str.replace(SCRIPT_SUFFIX, \".d.$<module>ts\")(entryPath));\n};\n\nconst firstDeclarationsAmong = Effect.fn(\"firstDeclarationsAmong\")(function* firstDeclarations(\n directory: string,\n entryPaths: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const candidates = Arr.getSomes(\n pipe(\n entryPaths,\n Arr.map((entryPath) => declarationsCandidateFor(entryPath)),\n ),\n );\n const existing = yield* Effect.filter(\n pipe(\n candidates,\n Arr.map((candidate) => files.join(directory, candidate)),\n ),\n (candidate) => files.exists(candidate),\n );\n return yield* Option.match(Arr.head(existing), {\n onNone: (): Effect.Effect<Option.Option<string>> => Effect.succeedNone,\n onSome: (candidate) => files.realPath(candidate).pipe(Effect.asSome),\n });\n});\n\nconst importNameOf = (packageName: string): string => {\n if (!Str.startsWith(TYPES_SCOPE)(packageName)) {\n return packageName;\n }\n const unscoped = Str.slice(TYPES_SCOPE.length)(packageName);\n if (!Str.includes(TYPES_SCOPE_SEPARATOR)(unscoped)) {\n return unscoped;\n }\n return `@${Str.replace(TYPES_SCOPE_SEPARATOR, \"/\")(unscoped)}`;\n};\n\nconst specifierFor = (packageName: string, subpath: string): string => {\n const importName = importNameOf(packageName);\n if (subpath === ROOT_SUBPATH) {\n return importName;\n }\n return `${importName}/${Str.slice(SUBPATH_PREFIX.length)(subpath)}`;\n};\n\nconst rootEntryPaths = (manifest: Manifest): readonly string[] =>\n Arr.getSomes([\n Option.fromUndefinedOr(manifest.types),\n Option.fromUndefinedOr(manifest.typings),\n Option.fromUndefinedOr(manifest.main),\n ]);\n\nconst subpathEntriesOf = Effect.fn(\"subpathEntriesOf\")(function* subpathEntriesOf(\n packageName: string,\n directory: string,\n manifest: Manifest,\n) {\n const found = yield* Effect.forEach(\n subpathTargetsOf(manifest.exports),\n ({ subpath, target }) =>\n firstDeclarationsAmong(directory, targetPathsOf(target)).pipe(\n Effect.map(\n Option.map((declarationsPath) => ({\n packageName,\n specifier: specifierFor(packageName, subpath),\n declarationsPath,\n })),\n ),\n ),\n { concurrency: 1 },\n );\n return Arr.getSomes(found);\n});\n\nconst entriesOfDependency = Effect.fn(\"entriesOfDependency\")(function* entriesOfDependency(\n packageName: string,\n directory: string,\n) {\n const manifest = yield* readManifest(directory);\n if (Option.isNone(manifest)) {\n return [];\n }\n const subpathEntries = yield* subpathEntriesOf(packageName, directory, manifest.value);\n const rootSpecifier = specifierFor(packageName, ROOT_SUBPATH);\n if (\n pipe(\n subpathEntries,\n Arr.some((entry) => entry.specifier === rootSpecifier),\n )\n ) {\n return subpathEntries;\n }\n const rootDeclarations = yield* firstDeclarationsAmong(directory, rootEntryPaths(manifest.value));\n const rootEntries = rootDeclarations.pipe(\n Option.map((declarationsPath) => ({ packageName, specifier: rootSpecifier, declarationsPath })),\n Option.toArray,\n );\n return [...rootEntries, ...subpathEntries];\n});\n\nconst declaredDependencies = (manifest: Manifest): readonly string[] =>\n pipe(\n Rec.toEntries({\n ...manifest.dependencies,\n ...manifest.devDependencies,\n ...manifest.peerDependencies,\n }),\n Arr.filter(([, range]) => !Str.startsWith(WORKSPACE_PROTOCOL)(range)),\n Arr.map(([packageName]) => packageName),\n );\n\nexport const workspaceDependencies = (manifest: Manifest): readonly string[] =>\n pipe(\n Rec.toEntries({ ...manifest.dependencies, ...manifest.devDependencies }),\n Arr.filter(([, range]) => Str.startsWith(WORKSPACE_PROTOCOL)(range)),\n Arr.map(([packageName]) => packageName),\n );\n\nconst entryOrder = Order.mapInput(Order.String, (entry: DependencyEntry) => entry.specifier);\n\nexport const dependencyEntries = Effect.fn(\"dependencyEntries\")(function* dependencyEntries(\n packageDirectory: string,\n) {\n const files = yield* RepositoryFiles;\n const manifest = yield* readManifest(packageDirectory);\n if (Option.isNone(manifest)) {\n return [];\n }\n const entries = yield* Effect.forEach(\n declaredDependencies(manifest.value),\n (packageName) =>\n entriesOfDependency(packageName, files.join(packageDirectory, NODE_MODULES, packageName)),\n { concurrency: 1 },\n );\n return Arr.sort(\n Arr.dedupeWith(entries.flat(), (left, right) => left.specifier === right.specifier),\n entryOrder,\n );\n});\n","import {\n Array as Arr,\n Option,\n Predicate,\n Record as Rec,\n Schema,\n String as Str,\n pipe,\n} from \"effect\";\n\nimport type { PackEntrySource } from \"./published.ts\";\n\nconst SOURCE = /\\.[cm]?tsx?$/u;\nconst BUILT = /\\.(?:d\\.)?[cm]?[jt]s$/u;\nconst DECLARATION = \".d.\";\nconst SEPARATOR = \"/\";\nconst ROOT_SUBPATH = \".\";\nconst BIN_LABEL = \"bin\";\n\nexport interface PublicEntry {\n readonly label: string;\n readonly source: string;\n}\n\nexport interface EntryManifest {\n readonly name?: string | undefined;\n readonly exports?: unknown;\n readonly bin?: unknown;\n}\n\nexport interface EntryLookup {\n readonly manifest: EntryManifest;\n readonly join: (target: string) => string;\n readonly packEntries: readonly PackEntrySource[];\n}\n\nconst targetsIn = (held: unknown): readonly string[] => {\n if (Predicate.isString(held)) {\n return [held];\n }\n if (!Predicate.isObject(held)) {\n return [];\n }\n return pipe(Rec.values(held), Arr.flatMap(targetsIn));\n};\n\nconst subpathsOf = (exportsField: unknown): readonly (readonly [string, unknown])[] => {\n if (!Predicate.isObject(exportsField)) {\n return [[ROOT_SUBPATH, exportsField]];\n }\n const entries = Rec.toEntries(exportsField);\n if (\n pipe(\n entries,\n Arr.some(([key]) => Str.startsWith(ROOT_SUBPATH)(key)),\n )\n ) {\n return entries;\n }\n return [[ROOT_SUBPATH, exportsField]];\n};\n\nconst binsOf = (manifest: EntryManifest): readonly (readonly [string, unknown])[] => {\n if (Predicate.isString(manifest.bin)) {\n const name = Option.getOrElse(Option.fromUndefinedOr(manifest.name), () => \"\");\n return [[`${BIN_LABEL} ${name}`, manifest.bin]];\n }\n if (!Predicate.isObject(manifest.bin)) {\n return [];\n }\n return pipe(\n Rec.toEntries(manifest.bin),\n Arr.map(([name, target]) => [`${BIN_LABEL} ${name}`, target] as const),\n );\n};\n\nconst baseNameOf = (target: string): string =>\n pipe(\n Str.split(target, SEPARATOR),\n Arr.last,\n Option.getOrElse(() => target),\n Str.replace(BUILT, \"\"),\n );\n\nconst sourceOf =\n ({ join, packEntries }: EntryLookup) =>\n (target: string): Option.Option<string> => {\n if (SOURCE.test(target) && !Str.includes(DECLARATION)(target)) {\n return Option.some(join(target));\n }\n const name = baseNameOf(target);\n return pipe(\n packEntries,\n Arr.findFirst((entry) => entry.name === name),\n Option.map((entry) => entry.source),\n );\n };\n\nexport const publicEntriesOf = (lookup: EntryLookup): readonly PublicEntry[] =>\n pipe(\n [...subpathsOf(lookup.manifest.exports), ...binsOf(lookup.manifest)],\n Arr.flatMap(([label, held]) =>\n pipe(\n targetsIn(held),\n Arr.map(sourceOf(lookup)),\n Arr.getSomes,\n Arr.map((source) => ({ label, source })),\n ),\n ),\n Arr.dedupeWith((left, right) => left.label === right.label && left.source === right.source),\n );\n\nconst EntryManifestFields = Schema.Struct({\n name: Schema.optional(Schema.String),\n exports: Schema.optional(Schema.Unknown),\n bin: Schema.optional(Schema.Unknown),\n});\n\nexport const EntryManifestJson = Schema.fromJsonString(EntryManifestFields);\n","import {\n Array as Arr,\n Effect,\n Option,\n Predicate,\n Record as Rec,\n Schema,\n String as Str,\n pipe,\n} from \"effect\";\nimport { resolveConfigFromFile } from \"vite-plus\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { MANIFEST_FILE } from \"./dependencies.ts\";\n\nconst CONFIG_FILE = \"vite.config.ts\";\nconst SEPARATOR = \"/\";\nconst READ_CONCURRENCY = 16;\nconst SOURCE_EXTENSION = /\\.[cm]?tsx?$/u;\nconst BYTE = 1;\nconst KILOBYTE = 1000;\nconst MEGABYTE = 1_000_000;\nconst UNIT_BYTES = [\n [\"B\", BYTE],\n [\"kB\", KILOBYTE],\n [\"MB\", MEGABYTE],\n] as const;\n\nconst SizeText = Schema.TemplateLiteralParser([\n Schema.Finite,\n \" \",\n Schema.Literals([\"B\", \"kB\", \"MB\"]),\n]);\nexport const PackEntry = Schema.Union([\n Schema.String,\n Schema.Array(Schema.String),\n Schema.Record(Schema.String, Schema.String),\n]);\nconst PackSettings = Schema.Struct({ entry: Schema.optional(PackEntry) });\nconst PackList = Schema.Union([PackSettings, Schema.Array(PackSettings)]);\nconst isEntryList = Schema.is(Schema.Array(Schema.String));\nconst WorkspaceConfig = Schema.Struct({\n msch: Schema.Struct({ publish: Schema.Struct({ installSize: SizeText }) }),\n pack: Schema.optional(PackList),\n});\nconst PublicManifest = Schema.Struct({ private: Schema.optional(Schema.Literal(false)) });\n\nconst taggedError = Schema.TaggedError;\n\nclass WorkspaceConfigUnreadable extends taggedError<\n WorkspaceConfigUnreadable,\n { readonly brand: unique symbol }\n>()(\"WorkspaceConfigUnreadable\", { file: Schema.String }) {}\n\nexport interface PackEntrySource {\n readonly name: string;\n readonly source: string;\n}\n\nexport interface PublishedWorkspace {\n readonly directory: string;\n readonly configFile: string;\n readonly installSize: string;\n readonly installBudget: number;\n readonly packEntries: readonly PackEntrySource[];\n}\n\nconst bytesPer = (unit: string): number =>\n pipe(\n UNIT_BYTES,\n Arr.findFirst(([name]) => name === unit),\n Option.map(([, bytes]) => bytes),\n Option.getOrElse(() => Number.NaN),\n );\n\nconst nameOf = (source: string): string =>\n pipe(\n Str.split(source, SEPARATOR),\n Arr.last,\n Option.getOrElse(() => source),\n Str.replace(SOURCE_EXTENSION, \"\"),\n );\n\nexport const entriesOf = (entry: typeof PackEntry.Type): readonly PackEntrySource[] => {\n if (Predicate.isString(entry)) {\n return [{ name: nameOf(entry), source: entry }];\n }\n if (isEntryList(entry)) {\n return pipe(\n entry,\n Arr.map((source) => ({ name: nameOf(source), source })),\n );\n }\n return pipe(\n Rec.toEntries(entry),\n Arr.map(([name, source]) => ({ name, source })),\n );\n};\n\nconst packEntriesOf = (pack: typeof WorkspaceConfig.Type.pack): readonly PackEntrySource[] =>\n pipe(\n Option.fromUndefinedOr(pack),\n Option.map(Arr.ensure),\n Option.getOrElse((): readonly (typeof PackSettings.Type)[] => []),\n Arr.flatMap((setting) =>\n pipe(\n Option.fromUndefinedOr(setting.entry),\n Option.match({ onNone: () => [], onSome: entriesOf }),\n ),\n ),\n );\n\nconst settingsIn = Effect.fn(\"settingsIn\")(function* settingsIn(file: string) {\n const config = yield* Effect.tryPromise({\n try: () => resolveConfigFromFile(file),\n catch: () => WorkspaceConfigUnreadable.make({ file }),\n }).pipe(Effect.option);\n return pipe(config, Option.flatMap(Schema.decodeUnknownOption(WorkspaceConfig)));\n});\n\nconst isPublicPackage = Effect.fn(\"isPublicPackage\")(function* isPublicPackage(directory: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(directory, MANIFEST_FILE));\n return Option.exists(text, (found) =>\n Option.isSome(Schema.decodeOption(Schema.fromJsonString(PublicManifest))(found)),\n );\n});\n\nconst workspaceOf =\n (directory: string, configFile: string, join: (source: string) => string) =>\n ({ msch, pack }: typeof WorkspaceConfig.Type): PublishedWorkspace => {\n const [amount, , unit] = msch.publish.installSize;\n return {\n directory,\n configFile,\n installSize: `${amount} ${unit}`,\n installBudget: amount * bytesPer(unit),\n packEntries: pipe(\n packEntriesOf(pack),\n Arr.map((entry) => ({ name: entry.name, source: join(entry.source) })),\n ),\n };\n };\n\nconst publishedIn = Effect.fn(\"publishedIn\")(function* publishedIn(\n root: string,\n configName: string,\n) {\n const files = yield* RepositoryFiles;\n const configFile = files.join(root, configName);\n const directory = files.dirname(configFile);\n const isPublic = yield* isPublicPackage(directory);\n if (!isPublic) {\n return Option.none<PublishedWorkspace>();\n }\n const settings = yield* settingsIn(configFile);\n return pipe(\n settings,\n Option.map(workspaceOf(directory, configFile, (source) => files.join(directory, source))),\n );\n});\n\n/** @internal */\nexport const publishedWorkspaces = Effect.fn(\"publishedWorkspaces\")(function* publishedWorkspaces(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const names = yield* files.listedFiles(root);\n const configs = pipe(\n names,\n Arr.filter((name) => files.basename(name) === CONFIG_FILE && Str.includes(SEPARATOR)(name)),\n );\n const found = yield* Effect.forEach(configs, (name) => publishedIn(root, name), {\n concurrency: READ_CONCURRENCY,\n });\n return Arr.getSomes(found);\n});\n"],"mappings":";;;;;;;AASA,MAAM,WAAW;CAAC;CAAkB;CAAyB;AAAyB;AAEtF,MAAa,YAAY,OAAO,MAAM,CACpC,OAAO,OAAO;CAAE,MAAM,OAAO,QAAQ,YAAY;CAAG,MAAM,OAAO;AAAO,CAAC,GACzE,OAAO,OAAO;CAAE,MAAM,OAAO,QAAQ,SAAS;CAAG,OAAO,OAAO;AAAO,CAAC,CACzE,CAAC;AACD,MAAM,QAAQ,OAAO,OAAO,EAAE,OAAO,OAAO,OAAO,EAAE,QAAQ,OAAO,OAAO,CAAC,EAAE,CAAC;AAC/E,MAAM,eAAe,OAAO,OAAO;CACjC,MAAM,OAAO,QAAQ,UAAU;CAC/B,UAAU,OAAO,QAAQ,KAAK;CAC9B,KAAK;CACL,OAAO,OAAO;AAChB,CAAC;AACD,MAAM,cAAc,OAAO,OAAO;CAAE,MAAM,OAAO,SAAS,QAAQ;CAAG,YAAY,OAAO;AAAQ,CAAC;AACjG,MAAM,YAAY,OAAO,MAAM;CAC7B,OAAO,OAAO;EACZ,MAAM,OAAO,QAAQ,SAAS;EAC9B,OAAO,OAAO,MAAM;GAAC,OAAO;GAAQ,OAAO;GAAQ,OAAO;GAAS,OAAO;EAAI,CAAC;CACjF,CAAC;CACD,OAAO,OAAO;EACZ,MAAM,OAAO,QAAQ,iBAAiB;EACtC,aAAa,OAAO,MAAM,CAAC,CAAC;EA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AAM,QAAQ,OAAO;CACrB,MAAM,aAAa,MAAM,KAAK,MAAM,UAAU;CAC9C,MAAM,YAAY,MAAM,QAAQ,UAAU;CAE1C,IAAI,EAAC,OADmB,gBAAgB,SAAS,IAE/C,OAAO,OAAO,KAAyB;CAEzC,MAAM,WAAW,OAAO,WAAW,UAAU;CAC7C,OAAO,KACL,UACA,OAAO,IAAI,YAAY,WAAW,aAAa,WAAW,MAAM,KAAK,WAAW,MAAM,CAAC,CAAC,CAC1F;AACF,CAAC;;AAGD,MAAa,sBAAsB,OAAO,GAAG,qBAAqB,CAAC,CAAC,UAAU,oBAC5E,MACA;CACA,MAAM,QAAQ,OAAO;CACrB,MAAM,QAAQ,OAAO,MAAM,YAAY,IAAI;CAC3C,MAAM,UAAU,KACd,OACAA,MAAI,QAAQ,SAAS,MAAM,SAAS,IAAI,MAAM,eAAeC,SAAI,SAAS,SAAS,CAAC,CAAC,IAAI,CAAC,CAC5F;CACA,MAAM,QAAQ,OAAO,OAAO,QAAQ,UAAU,SAAS,YAAY,MAAM,IAAI,GAAG,EAC9E,aAAa,iBACf,CAAC;CACD,OAAOD,MAAI,SAAS,KAAK;AAC3B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Array, Context, Effect, FileSystem, Layer, Option, Path, Stream, String, pipe } from "effect";
|
|
2
|
-
import { Digest } from "effect/crypto";
|
|
3
2
|
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
3
|
+
import { Digest } from "effect/crypto";
|
|
4
4
|
import { NodeChildProcessSpawner, NodeFileSystem, NodePath, NodeStdio } from "@effect/platform-node-shared";
|
|
5
5
|
// src/shared/lib/match-groups.ts
|
|
6
6
|
const groupOf = (name) => (found) => pipe(Option.fromNullishOr(found), Option.flatMap((match) => Option.fromNullishOr(match.groups)), Option.flatMap((groups) => Option.fromNullishOr(groups[name])));
|
|
@@ -24,6 +24,20 @@ const STAGED_ARGS = ["--stage"];
|
|
|
24
24
|
const LINK_ENTRY = /^120000 \S+ \d+\t(?<name>.+)$/u;
|
|
25
25
|
const NODE_MODULES = "node_modules";
|
|
26
26
|
var RepositoryFiles = class extends Context.Service()("@r_masseater/msch/shared/lib/repository-files/RepositoryFiles") {};
|
|
27
|
+
const SUCCESS = 0;
|
|
28
|
+
const gitTextService = Effect.gen(function* gitTextService() {
|
|
29
|
+
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
30
|
+
const gitText = (root, args) => Effect.gen(function* readText() {
|
|
31
|
+
const handle = yield* ChildProcess.make("git", args, {
|
|
32
|
+
cwd: root,
|
|
33
|
+
stdin: "ignore"
|
|
34
|
+
});
|
|
35
|
+
const text = yield* handle.stdout.pipe(Stream.decodeText(), Stream.mkString);
|
|
36
|
+
const code = yield* handle.exitCode;
|
|
37
|
+
return Option.liftPredicate(text, () => code === SUCCESS);
|
|
38
|
+
}).pipe(Effect.scoped, Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner), Effect.orElseSucceed(() => Option.none()));
|
|
39
|
+
return gitText;
|
|
40
|
+
});
|
|
27
41
|
const gitPathsService = Effect.gen(function* gitPathsService() {
|
|
28
42
|
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
29
43
|
const gitPaths = (root, args, separator) => Effect.gen(function* listPaths() {
|
|
@@ -48,6 +62,7 @@ const nodeRepositoryFiles = Layer.effect(RepositoryFiles, Effect.gen(function* n
|
|
|
48
62
|
const path = yield* Path.Path;
|
|
49
63
|
const digest = yield* Digest.Digest;
|
|
50
64
|
const gitPaths = yield* gitPathsService;
|
|
65
|
+
const gitText = yield* gitTextService;
|
|
51
66
|
const gitFiles = (root, args) => gitPaths(root, [
|
|
52
67
|
"ls-files",
|
|
53
68
|
"-z",
|
|
@@ -58,6 +73,12 @@ const nodeRepositoryFiles = Layer.effect(RepositoryFiles, Effect.gen(function* n
|
|
|
58
73
|
listedFiles: (root) => gitFiles(root, LISTED_ARGS),
|
|
59
74
|
linkedFiles: (root) => gitFiles(root, STAGED_ARGS).pipe(Effect.map(Array.flatMap(linkName))),
|
|
60
75
|
readLink: (file) => fs.readLink(file).pipe(Effect.option),
|
|
76
|
+
mergeBase: (root, revision) => gitText(root, [
|
|
77
|
+
"merge-base",
|
|
78
|
+
"HEAD",
|
|
79
|
+
revision
|
|
80
|
+
]).pipe(Effect.map(Option.map(String.trim)), Effect.map(Option.filter(String.isNonEmpty))),
|
|
81
|
+
readAtRevision: (root, revision, name) => gitText(root, ["show", `${revision}:${name}`]),
|
|
61
82
|
matchingFiles: (root, pathspecs) => gitFiles(root, [
|
|
62
83
|
...LISTED_ARGS,
|
|
63
84
|
"--",
|
|
@@ -89,4 +110,4 @@ const nodeRepositoryFiles = Layer.effect(RepositoryFiles, Effect.gen(function* n
|
|
|
89
110
|
})).pipe(Layer.provide(nodeServicesLayer), Layer.provide(Digest.layerWebCrypto));
|
|
90
111
|
export { groupOf as a, nodeServicesLayer as i, RepositoryFiles as n, nodeRepositoryFiles as r, NODE_MODULES as t };
|
|
91
112
|
|
|
92
|
-
//# sourceMappingURL=repository-files-
|
|
113
|
+
//# sourceMappingURL=repository-files-R0NW0NE9.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-files-R0NW0NE9.mjs","names":["Str","Arr"],"sources":["../src/shared/lib/match-groups.ts","../src/shared/lib/node-services.ts","../src/shared/lib/repository-files.ts"],"sourcesContent":["import { Option, pipe } from \"effect\";\n\nexport const groupOf =\n (name: string) =>\n (found: RegExpMatchArray | null): Option.Option<string> =>\n pipe(\n Option.fromNullishOr(found),\n Option.flatMap((match) => Option.fromNullishOr(match.groups)),\n Option.flatMap((groups) => Option.fromNullishOr(groups[name])),\n );\n","import {\n NodeChildProcessSpawner,\n NodeFileSystem,\n NodePath,\n NodeStdio,\n} from \"@effect/platform-node-shared\";\nimport { Layer } from \"effect\";\n\n/** @internal */\nexport const nodeServicesLayer = Layer.provideMerge(\n NodeChildProcessSpawner.layer,\n Layer.mergeAll(NodeFileSystem.layer, NodePath.layer, NodeStdio.layer),\n);\n","import {\n Array as Arr,\n Context,\n Effect,\n FileSystem,\n Layer,\n Option,\n Path,\n Stream,\n String as Str,\n pipe,\n} from \"effect\";\nimport { Digest } from \"effect/crypto\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nimport { groupOf } from \"./match-groups.ts\";\nimport { nodeServicesLayer } from \"./node-services.ts\";\n\nconst MISSING_SIZE = 0;\nconst GENERATED_PATHSPEC = \":(attr:linguist-generated)\";\nconst LISTED_ARGS = [\"--cached\", \"--others\", \"--exclude-standard\"];\nconst IGNORED_ARGS = [\"--others\", \"--ignored\", \"--exclude-standard\"];\nconst STAGED_ARGS = [\"--stage\"];\nconst LINK_ENTRY = /^120000 \\S+ \\d+\\t(?<name>.+)$/u;\n\nexport const NODE_MODULES = \"node_modules\";\n\nexport class RepositoryFiles extends Context.Service<\n RepositoryFiles,\n {\n readonly readFile: (file: string) => Effect.Effect<Option.Option<string>>;\n readonly exists: (file: string) => Effect.Effect<boolean>;\n readonly realPath: (file: string) => Effect.Effect<string>;\n readonly readDirectory: (directory: string) => Effect.Effect<readonly string[]>;\n readonly walkDirectory: (directory: string) => Effect.Effect<readonly string[]>;\n readonly writeFile: (file: string, text: string) => Effect.Effect<void>;\n readonly removeFile: (file: string) => Effect.Effect<void>;\n readonly hash: (text: string) => Effect.Effect<string>;\n readonly generatedFiles: (root: string) => Effect.Effect<readonly string[]>;\n readonly listedFiles: (root: string) => Effect.Effect<readonly string[]>;\n readonly linkedFiles: (root: string) => Effect.Effect<readonly string[]>;\n readonly readLink: (file: string) => Effect.Effect<Option.Option<string>>;\n readonly mergeBase: (root: string, revision: string) => Effect.Effect<Option.Option<string>>;\n readonly readAtRevision: (\n root: string,\n revision: string,\n name: string,\n ) => Effect.Effect<Option.Option<string>>;\n readonly matchingFiles: (\n root: string,\n pathspecs: readonly string[],\n ) => Effect.Effect<readonly string[]>;\n readonly ignoredPaths: (\n root: string,\n paths: readonly string[],\n ) => Effect.Effect<readonly string[]>;\n readonly ignoredFiles: (\n root: string,\n pathspecs: readonly string[],\n ) => Effect.Effect<readonly string[]>;\n readonly isDirectory: (file: string) => Effect.Effect<Option.Option<boolean>>;\n readonly fileSize: (file: string) => Effect.Effect<number>;\n readonly join: (...segments: readonly string[]) => string;\n readonly resolve: (...segments: readonly string[]) => string;\n readonly relative: (from: string, to: string) => string;\n readonly dirname: (file: string) => string;\n readonly basename: (file: string) => string;\n }\n>()(\"@r_masseater/msch/shared/lib/repository-files/RepositoryFiles\") {}\n\nconst SUCCESS = 0;\n\ntype GitText = (root: string, args: readonly string[]) => Effect.Effect<Option.Option<string>>;\n\nconst gitTextService = Effect.gen(function* gitTextService() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const gitText: GitText = (root, args) =>\n Effect.gen(function* readText() {\n const handle = yield* ChildProcess.make(\"git\", args, { cwd: root, stdin: \"ignore\" });\n const text = yield* handle.stdout.pipe(Stream.decodeText(), Stream.mkString);\n const code = yield* handle.exitCode;\n return Option.liftPredicate(text, () => code === SUCCESS);\n }).pipe(\n Effect.scoped,\n Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),\n Effect.orElseSucceed(() => Option.none<string>()),\n );\n return gitText;\n});\n\ntype GitPaths = (\n root: string,\n args: readonly string[],\n separator: string,\n) => Effect.Effect<readonly string[]>;\n\nconst gitPathsService = Effect.gen(function* gitPathsService() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const gitPaths: GitPaths = (root, args, separator) =>\n Effect.gen(function* listPaths() {\n const handle = yield* ChildProcess.make(\"git\", args, {\n cwd: root,\n stdin: \"ignore\",\n });\n const listed = yield* handle.stdout.pipe(Stream.decodeText(), Stream.mkString);\n return pipe(Str.split(listed, separator), Arr.filter(Str.isNonEmpty));\n }).pipe(\n Effect.scoped,\n Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),\n Effect.orElseSucceed((): readonly string[] => []),\n );\n return gitPaths;\n});\n\nconst linkName = (entry: string): readonly string[] =>\n Option.toArray(groupOf(\"name\")(LINK_ENTRY.exec(entry)));\n\ntype CacheOperations = Pick<\n typeof RepositoryFiles.Service,\n \"walkDirectory\" | \"writeFile\" | \"removeFile\" | \"hash\"\n>;\n\nconst encoder = new TextEncoder();\n\nconst cacheOperations = (\n fs: FileSystem.FileSystem,\n path: Path.Path,\n digest: Digest.Digest[\"Service\"],\n): CacheOperations => ({\n walkDirectory: (directory) =>\n fs\n .readDirectory(directory, { recursive: true })\n .pipe(Effect.orElseSucceed((): readonly string[] => [])),\n writeFile: (file, text) =>\n fs\n .makeDirectory(path.dirname(file), { recursive: true })\n .pipe(Effect.andThen(fs.writeFileString(file, text)), Effect.ignore),\n removeFile: (file) => fs.remove(file, { force: true }).pipe(Effect.ignore),\n hash: (text) => digest.digestHex(Digest.sha256, encoder.encode(text)),\n});\n\nexport const nodeRepositoryFiles = Layer.effect(\n RepositoryFiles,\n Effect.gen(function* nodeRepositoryFiles() {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const digest = yield* Digest.Digest;\n const gitPaths = yield* gitPathsService;\n const gitText = yield* gitTextService;\n const gitFiles = (root: string, args: readonly string[]): Effect.Effect<readonly string[]> =>\n gitPaths(root, [\"ls-files\", \"-z\", ...args], \"\\0\");\n return RepositoryFiles.of({\n generatedFiles: (root) =>\n gitFiles(root, [\"--\", GENERATED_PATHSPEC]).pipe(\n Effect.map(Arr.map((file) => path.join(root, file))),\n ),\n listedFiles: (root) => gitFiles(root, LISTED_ARGS),\n linkedFiles: (root) => gitFiles(root, STAGED_ARGS).pipe(Effect.map(Arr.flatMap(linkName))),\n readLink: (file) => fs.readLink(file).pipe(Effect.option),\n mergeBase: (root, revision) =>\n gitText(root, [\"merge-base\", \"HEAD\", revision]).pipe(\n Effect.map(Option.map(Str.trim)),\n Effect.map(Option.filter(Str.isNonEmpty)),\n ),\n readAtRevision: (root, revision, name) => gitText(root, [\"show\", `${revision}:${name}`]),\n matchingFiles: (root, pathspecs) => gitFiles(root, [...LISTED_ARGS, \"--\", ...pathspecs]),\n ignoredFiles: (root, pathspecs) => gitFiles(root, [...IGNORED_ARGS, \"--\", ...pathspecs]),\n ignoredPaths: (root, paths) => gitPaths(root, [\"check-ignore\", \"--\", ...paths], \"\\n\"),\n readFile: (file) => fs.readFileString(file).pipe(Effect.option),\n exists: (file) => fs.exists(file).pipe(Effect.orElseSucceed(() => false)),\n realPath: (file) => fs.realPath(file).pipe(Effect.orElseSucceed(() => file)),\n readDirectory: (directory) =>\n fs.readDirectory(directory).pipe(Effect.orElseSucceed((): readonly string[] => [])),\n ...cacheOperations(fs, path, digest),\n isDirectory: (file) =>\n fs.stat(file).pipe(\n Effect.map((info) => info.type === \"Directory\"),\n Effect.option,\n ),\n fileSize: (file) =>\n fs.stat(file).pipe(\n Effect.map((info) => Number(info.size)),\n Effect.orElseSucceed(() => MISSING_SIZE),\n ),\n join: (...segments) => path.join(...segments),\n resolve: (...segments) => path.resolve(...segments),\n relative: (from, to) => path.relative(from, to),\n dirname: (file) => path.dirname(file),\n basename: (file) => path.basename(file),\n });\n }),\n).pipe(Layer.provide(nodeServicesLayer), Layer.provide(Digest.layerWebCrypto));\n"],"mappings":";;;;;AAEA,MAAa,WACV,UACA,UACC,KACE,OAAO,cAAc,KAAK,GAC1B,OAAO,SAAS,UAAU,OAAO,cAAc,MAAM,MAAM,CAAC,GAC5D,OAAO,SAAS,WAAW,OAAO,cAAc,OAAO,KAAK,CAAC,CAC/D;;;ACAJ,MAAa,oBAAoB,MAAM,aACrC,wBAAwB,OACxB,MAAM,SAAS,eAAe,OAAO,SAAS,OAAO,UAAU,KAAK,CACtE;;ACMA,MAAM,eAAe;AACrB,MAAM,qBAAqB;AAC3B,MAAM,cAAc;CAAC;CAAY;CAAY;AAAoB;AACjE,MAAM,eAAe;CAAC;CAAY;CAAa;AAAoB;AACnE,MAAM,cAAc,CAAC,SAAS;AAC9B,MAAM,aAAa;AAEnB,MAAa,eAAe;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W,SAAS,KAAK,SAAS,IAAI;CACxC,CAAC;AACH,CAAC,CACH,CAAC,CAAC,KAAK,MAAM,QAAQ,iBAAiB,GAAG,MAAM,QAAQ,OAAO,cAAc,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { n as RepositoryFiles, r as nodeRepositoryFiles } from "./repository-files-
|
|
1
|
+
import { A as usedFrom, C as definesTask, D as merged, E as literalSettings, F as literalOf, I as nestedValues, O as programOf, T as tasksOf, a as publicEntriesOf, b as NO_TASKS, c as readManifest, d as deployEntries, g as workspaceDirectories, h as withoutRelative, i as EntryManifestJson, k as settingsInvalid, m as prefixed, n as entriesOf, o as MANIFEST_FILE$1, t as PackEntry } from "./package-DU5r3bvx.mjs";
|
|
2
|
+
import { n as RepositoryFiles, r as nodeRepositoryFiles } from "./repository-files-R0NW0NE9.mjs";
|
|
3
3
|
import { Array, Effect, Option, Record, Schema, String, pipe } from "effect";
|
|
4
|
-
// src/features/workspace-settings/model/shadcn-ui.ts
|
|
4
|
+
// src/features/build-workspace-settings/model/shadcn-ui.ts
|
|
5
5
|
const MANIFEST_FILE = "package.json";
|
|
6
6
|
const WILDCARD = "*";
|
|
7
7
|
const EVERYTHING = "/**";
|
|
@@ -25,7 +25,7 @@ const shadcnUiIn = Effect.fn("shadcnUiIn")(function* shadcnUiIn(root, name) {
|
|
|
25
25
|
const imports = pipe(manifestText, Option.flatMap(decodeManifestImports), Option.flatMap((manifest) => Option.fromUndefinedOr(manifest.imports)));
|
|
26
26
|
return pipe(configText, Option.flatMap(decodeShadcnConfig), Option.map(({ aliases }) => pipe(imports, Option.flatMap((map) => resolvedAlias(map, aliases.ui)), Option.getOrElse(() => aliases.ui))), Option.map((target) => `${prefixed(directory)(target)}${EVERYTHING}`));
|
|
27
27
|
});
|
|
28
|
-
// src/features/workspace-settings/model/ignored-directories.ts
|
|
28
|
+
// src/features/build-workspace-settings/model/ignored-directories.ts
|
|
29
29
|
const IGNORE_FILES = ":(glob)**/.gitignore";
|
|
30
30
|
const SEPARATOR = "/";
|
|
31
31
|
const NEGATION = "!";
|
|
@@ -70,7 +70,7 @@ const collectIgnoredDirectories = Effect.fn("collectIgnoredDirectories")(functio
|
|
|
70
70
|
}]));
|
|
71
71
|
});
|
|
72
72
|
const ignoredDirectories = (root) => Effect.runPromise(collectIgnoredDirectories(root).pipe(Effect.provide(nodeRepositoryFiles)));
|
|
73
|
-
// src/features/workspace-settings/model/source-directories.ts
|
|
73
|
+
// src/features/build-workspace-settings/model/source-directories.ts
|
|
74
74
|
const SOURCE_DIRECTORY = "src";
|
|
75
75
|
const READ_CONCURRENCY$1 = 16;
|
|
76
76
|
const directoryLayoutIn = Effect.fn("directoryLayoutIn")(function* directoryLayoutIn(root, directories) {
|
|
@@ -84,7 +84,7 @@ const directoryLayoutIn = Effect.fn("directoryLayoutIn")(function* directoryLayo
|
|
|
84
84
|
ignoredDirectories: yield* collectIgnoredDirectories(root)
|
|
85
85
|
};
|
|
86
86
|
});
|
|
87
|
-
// src/features/workspace-settings/model/workspace-public-entries.ts
|
|
87
|
+
// src/features/build-workspace-settings/model/workspace-public-entries.ts
|
|
88
88
|
const PACK_ENTRY = ["pack", "entry"];
|
|
89
89
|
const decodeEntryManifest = Schema.decodeUnknownOption(EntryManifestJson);
|
|
90
90
|
const decodePackEntry = Schema.decodeUnknownOption(PackEntry);
|
|
@@ -110,7 +110,7 @@ const publicEntryFiles = Effect.fn("publicEntryFiles")(function* publicEntryFile
|
|
|
110
110
|
packEntries
|
|
111
111
|
})), Option.getOrElse(() => []));
|
|
112
112
|
});
|
|
113
|
-
// src/features/workspace-settings/model/workspace-settings.ts
|
|
113
|
+
// src/features/build-workspace-settings/model/workspace-settings.ts
|
|
114
114
|
const CONFIG_FILE = "vite.config.ts";
|
|
115
115
|
const SHADCN_FILE = "components.json";
|
|
116
116
|
const READ_CONCURRENCY = 16;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-settings.mjs","names":["Str","Rec","Arr","READ_CONCURRENCY","Str","Arr","READ_CONCURRENCY","Arr","Arr","MANIFEST_FILE","Rec","Arr"],"sources":["../src/features/workspace-settings/model/shadcn-ui.ts","../src/features/workspace-settings/model/ignored-directories.ts","../src/features/workspace-settings/model/source-directories.ts","../src/features/workspace-settings/model/workspace-public-entries.ts","../src/features/workspace-settings/model/workspace-settings.ts"],"sourcesContent":["import { Array as Arr, Effect, Option, Record as Rec, Schema, String as Str, pipe } from \"effect\";\n\nimport { prefixed, withoutRelative } from \"#/entities/workspace/index.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst MANIFEST_FILE = \"package.json\";\nconst WILDCARD = \"*\";\nconst EVERYTHING = \"/**\";\n\nconst ShadcnConfig = Schema.Struct({ aliases: Schema.Struct({ ui: Schema.String }) });\nconst ManifestImports = Schema.Struct({\n imports: Schema.optional(Schema.Record(Schema.String, Schema.String)),\n});\nconst decodeShadcnConfig = Schema.decodeUnknownOption(Schema.fromJsonString(ShadcnConfig));\nconst decodeManifestImports = Schema.decodeUnknownOption(Schema.fromJsonString(ManifestImports));\n\nconst withoutWildcard = Str.replace(WILDCARD, \"\");\n\nconst importTarget =\n (alias: string) =>\n ([key, target]: readonly [string, string]): Option.Option<string> => {\n if (!Str.endsWith(WILDCARD)(key)) {\n return Option.some(target).pipe(Option.filter(() => key === alias));\n }\n const prefix = withoutWildcard(key);\n if (!Str.startsWith(prefix)(alias)) {\n return Option.none();\n }\n return Option.some(`${withoutWildcard(target)}${Str.slice(prefix.length)(alias)}`);\n };\n\nconst resolvedAlias = (\n imports: Readonly<Record<string, string>>,\n alias: string,\n): Option.Option<string> =>\n pipe(Rec.toEntries(imports), Arr.findFirst(importTarget(alias)), Option.map(withoutRelative));\n\nexport const shadcnUiIn = Effect.fn(\"shadcnUiIn\")(function* shadcnUiIn(root: string, name: string) {\n const files = yield* RepositoryFiles;\n const directory = files.dirname(name);\n const configText = yield* files.readFile(files.join(root, name));\n const manifestText = yield* files.readFile(files.join(root, directory, MANIFEST_FILE));\n const imports = pipe(\n manifestText,\n Option.flatMap(decodeManifestImports),\n Option.flatMap((manifest) => Option.fromUndefinedOr(manifest.imports)),\n );\n return pipe(\n configText,\n Option.flatMap(decodeShadcnConfig),\n Option.map(({ aliases }) =>\n pipe(\n imports,\n Option.flatMap((map) => resolvedAlias(map, aliases.ui)),\n Option.getOrElse(() => aliases.ui),\n ),\n ),\n Option.map((target) => `${prefixed(directory)(target)}${EVERYTHING}`),\n );\n});\n","import { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles, nodeRepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst IGNORE_FILES = \":(glob)**/.gitignore\";\nconst SEPARATOR = \"/\";\nconst NEGATION = \"!\";\nconst CONTENTS = \"/**\";\nconst ROOT = \".\";\nconst ANYWHERE = \"**/\";\nconst READ_CONCURRENCY = 16;\nconst DIRECTORY_ENTRY = /^(?<anchor>\\/?)(?<name>[^!#/].*)\\/$/u;\n\nexport interface IgnoredDirectory {\n readonly pattern: string;\n readonly base: \"workspace\";\n}\n\nconst scopedName = (anchor: string, name: string): string => {\n if (anchor === SEPARATOR || Str.includes(SEPARATOR)(name)) {\n return name;\n }\n return `${ANYWHERE}${name}`;\n};\n\nconst inDirectory =\n (directory: string) =>\n (glob: string): string => {\n if (directory === ROOT) {\n return glob;\n }\n return `${directory}${SEPARATOR}${glob}`;\n };\n\nconst globOf =\n (directory: string) =>\n (line: string): Option.Option<string> => {\n const found = DIRECTORY_ENTRY.exec(Str.trim(line));\n return pipe(\n Option.fromNullishOr(found),\n Option.flatMap(({ groups }) => Option.fromNullishOr(groups)),\n Option.flatMap(({ anchor, name }) =>\n Option.map(Option.fromNullishOr(name), (entry) => scopedName(anchor ?? \"\", entry)),\n ),\n Option.map(inDirectory(directory)),\n );\n };\n\nconst keptGlob = Effect.fn(\"keptGlob\")(function* keptGlob(root: string, glob: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.matchingFiles(root, [`:(glob)${glob}/**`]);\n return Option.some(glob).pipe(Option.filter(() => Arr.isReadonlyArrayEmpty(listed)));\n});\n\nconst globsIn = Effect.fn(\"globsIn\")(function* globsIn(root: string, file: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, file));\n const toGlob = globOf(files.dirname(file));\n return pipe(\n Option.getOrElse(text, () => \"\"),\n Str.split(\"\\n\"),\n Arr.map(toGlob),\n Arr.getSomes,\n );\n});\n\nexport const collectIgnoredDirectories = Effect.fn(\"collectIgnoredDirectories\")(\n function* collectIgnoredDirectories(root: string) {\n const files = yield* RepositoryFiles;\n const ignoreFiles = yield* files.matchingFiles(root, [IGNORE_FILES]);\n const globs = yield* Effect.forEach(ignoreFiles, (file) => globsIn(root, file), {\n concurrency: 1,\n });\n const candidates = Arr.dedupe(Arr.flatten(globs));\n const kept = yield* Effect.forEach(candidates, (glob) => keptGlob(root, glob), {\n concurrency: READ_CONCURRENCY,\n });\n return pipe(\n Arr.getSomes(kept),\n Arr.flatMap((glob): readonly IgnoredDirectory[] => [\n { pattern: `${NEGATION}${glob}`, base: \"workspace\" },\n { pattern: `${NEGATION}${glob}${CONTENTS}`, base: \"workspace\" },\n ]),\n );\n },\n);\n\nexport const ignoredDirectories = (root: string): Promise<readonly IgnoredDirectory[]> =>\n Effect.runPromise(collectIgnoredDirectories(root).pipe(Effect.provide(nodeRepositoryFiles)));\n","import { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { collectIgnoredDirectories } from \"./ignored-directories.ts\";\n\nconst SOURCE_DIRECTORY = \"src\";\nconst READ_CONCURRENCY = 16;\n\nexport const directoryLayoutIn = Effect.fn(\"directoryLayoutIn\")(function* directoryLayoutIn(\n root: string,\n directories: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const listed = yield* Effect.forEach(\n directories,\n (directory) => {\n const source = files.join(directory, SOURCE_DIRECTORY);\n return files\n .isDirectory(files.join(root, source))\n .pipe(\n Effect.map((isDirectory) => pipe(isDirectory, Option.filter(Boolean), Option.as(source))),\n );\n },\n { concurrency: READ_CONCURRENCY },\n );\n return {\n sourceDirectories: Arr.getSomes(listed),\n ignoredDirectories: yield* collectIgnoredDirectories(root),\n };\n});\n","import { Array as Arr, Effect, Option, Schema, pipe } from \"effect\";\n\nimport {\n MANIFEST_FILE,\n EntryManifestJson,\n entriesOf,\n PackEntry,\n publicEntriesOf,\n} 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 decodeEntryManifest = Schema.decodeUnknownOption(EntryManifestJson);\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, MANIFEST_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(decodeEntryManifest),\n Option.map(entryFilesOf({ join, packEntries })),\n Option.getOrElse((): readonly string[] => []),\n );\n});\n","import { Array as Arr, Effect, Option, Record as Rec, Schema, pipe } from \"effect\";\nimport type { AllowWarnDeny, OxlintOverride } from \"vite-plus/lint\";\n\nimport { readManifest } from \"#/entities/package/index.ts\";\nimport {\n deployEntries,\n literalSettings,\n merged,\n programOf,\n settingsInvalid,\n usedFrom,\n workspaceDirectories,\n prefixed,\n NO_TASKS,\n definesTask,\n tasksOf,\n} from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource, WorkspaceTasks } from \"#/entities/workspace/index.ts\";\nimport { RepositoryFiles, nodeRepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport type { IgnoredDirectory } from \"./ignored-directories.ts\";\nimport { shadcnUiIn } from \"./shadcn-ui.ts\";\nimport { directoryLayoutIn } from \"./source-directories.ts\";\nimport { publicEntryFiles } from \"./workspace-public-entries.ts\";\n\nexport type RuleSet = Readonly<Record<string, unknown>>;\nexport type RuleSets = Readonly<Record<string, RuleSet>>;\nexport type DependencySets = Readonly<Record<string, readonly string[]>>;\n\nconst CONFIG_FILE = \"vite.config.ts\";\nconst SHADCN_FILE = \"components.json\";\nconst READ_CONCURRENCY = 16;\nconst MSCH_LINT = [\"msch\", \"lint\"] as const;\nconst MSCH_DEV_DEPENDENCIES = [\"msch\", \"devDependencies\"] as const;\nconst TEST_TASK = [\"tasks\", \"test\"] as const;\n\ntype SeverityName = Extract<AllowWarnDeny, string>;\n\nconst SEVERITY_NAMES: Readonly<Record<SeverityName, true>> = {\n off: true,\n allow: true,\n warn: true,\n error: true,\n deny: true,\n};\nconst Severity = Schema.Literals<readonly SeverityName[]>(Rec.keys(SEVERITY_NAMES));\nconst SeverityWithOptions = Schema.mutable(\n Schema.TupleWithRest(Schema.Tuple([Severity]), [Schema.Unknown]),\n);\nconst RuleSetting = Schema.Union([Severity, SeverityWithOptions]);\nconst Rules = Schema.Record(Schema.String, RuleSetting);\nconst decodeRules = Schema.decodeUnknownEffect(Rules);\nconst Names = Schema.optional(Schema.Array(Schema.String));\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 ignorePatterns: Names,\n overrides: Schema.optional(Schema.Array(WorkspaceOverride)),\n});\nconst DevDependencySettings = Schema.Struct({ use: Names, dependencies: Names });\nconst WorkspaceDevDependencies = Schema.Record(Schema.String, DevDependencySettings);\n\nexport interface DevDependencyAllowance {\n readonly workspaces: readonly string[];\n readonly dependencies: readonly string[];\n}\n\nexport interface WorkspaceLint {\n readonly ignorePatterns: readonly string[];\n readonly overrides: readonly OxlintOverride[];\n readonly shadcnUi: readonly string[];\n readonly publicEntries: readonly string[];\n readonly deployEntries: readonly string[];\n}\n\nexport interface WorkspaceSettings {\n readonly lint: WorkspaceLint;\n readonly sourceDirectories: readonly string[];\n readonly ignoredDirectories: readonly IgnoredDirectory[];\n readonly testProjects: readonly string[];\n readonly tasks: WorkspaceTasks;\n readonly devDependencies: Readonly<Record<string, DevDependencyAllowance>>;\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 ignorePatterns: readonly string[];\n readonly overrides: readonly OxlintOverride[];\n readonly devDependencies: Readonly<Record<string, DevDependencyAllowance>>;\n readonly ownTests: boolean;\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),\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 const ignorePatterns = pipe(lint.ignorePatterns ?? [], Arr.map(prefixed(source.directory)));\n return { ignorePatterns, overrides };\n});\n\nconst allowanceOf = Effect.fn(\"allowanceOf\")(function* allowanceOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n [reason, allowance]: readonly [string, typeof DevDependencySettings.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\nconst devDependenciesOf = Effect.fn(\"devDependenciesOf\")(function* devDependenciesOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n) {\n const settings = yield* literalSettings({\n source,\n path: MSCH_DEV_DEPENDENCIES,\n decode: Schema.decodeUnknownEffect(WorkspaceDevDependencies),\n });\n const allowed = Rec.toEntries(Option.getOrElse(settings, () => ({})));\n const entries = yield* Effect.forEach(\n allowed,\n (entry) => allowanceOf(source, dependencySets, entry),\n {\n concurrency: 1,\n },\n );\n return Rec.fromEntries(entries);\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* devDependenciesOf(source, options.dependencySets);\n const ownTests = definesTask(TEST_TASK)(source.program);\n const files = yield* RepositoryFiles;\n const manifest = yield* readManifest(files.dirname(source.file));\n const tasks = tasksOf(manifest)(source.program);\n return { directory: source.directory, ...lint, devDependencies, ownTests, tasks };\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 const publicEntries = yield* publicEntryFiles(options.root, directory, Option.none());\n return {\n directory,\n ignorePatterns: [],\n overrides: [],\n devDependencies: {},\n ownTests: false,\n tasks: NO_TASKS,\n publicEntries,\n };\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 collectWorkspaceSettings = Effect.fn(\"collectWorkspaceSettings\")(\n function* collectWorkspaceSettings(options: SettingsOptions) {\n const files = yield* RepositoryFiles;\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, files.join(directory, SHADCN_FILE)),\n { concurrency: READ_CONCURRENCY },\n );\n return {\n ...(yield* directoryLayoutIn(options.root, directories)),\n lint: {\n ignorePatterns: pipe(\n found,\n Arr.flatMap(({ ignorePatterns }) => ignorePatterns),\n ),\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 },\n testProjects: pipe(\n found,\n Arr.filter(({ ownTests }) => !ownTests),\n Arr.map(({ directory }) => directory),\n ),\n tasks: {\n verify: pipe(\n found,\n Arr.flatMap(({ tasks }) => tasks.verify),\n ),\n },\n devDependencies: merged(\n pipe(\n found,\n Arr.map(({ devDependencies }) => devDependencies),\n ),\n ),\n };\n },\n);\n\nexport const workspaceSettings = (options: SettingsOptions): Promise<WorkspaceSettings> =>\n Effect.runPromise(collectWorkspaceSettings(options).pipe(Effect.provide(nodeRepositoryFiles)));\n\nexport type { WorkspaceTasks } from \"#/entities/workspace/index.ts\";\n"],"mappings":";;;;AAKA,MAAM,gBAAgB;AACtB,MAAM,WAAW;AACjB,MAAM,aAAa;AAEnB,MAAM,eAAe,OAAO,OAAO,EAAE,SAAS,OAAO,OAAO,EAAE,IAAI,OAAO,OAAO,CAAC,EAAE,CAAC;AACpF,MAAM,kBAAkB,OAAO,OAAO,EACpC,SAAS,OAAO,SAAS,OAAO,OAAO,OAAO,QAAQ,OAAO,MAAM,CAAC,EACtE,CAAC;AACD,MAAM,qBAAqB,OAAO,oBAAoB,OAAO,eAAe,YAAY,CAAC;AACzF,MAAM,wBAAwB,OAAO,oBAAoB,OAAO,eAAe,eAAe,CAAC;AAE/F,MAAM,kBAAkBA,OAAI,QAAQ,UAAU,EAAE;AAEhD,MAAM,gBACH,WACA,CAAC,KAAK,YAA8D;CACnE,IAAI,CAACA,OAAI,SAAS,QAAQ,CAAC,CAAC,GAAG,GAC7B,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC,KAAK,OAAO,aAAa,QAAQ,KAAK,CAAC;CAEpE,MAAM,SAAS,gBAAgB,GAAG;CAClC,IAAI,CAACA,OAAI,WAAW,MAAM,CAAC,CAAC,KAAK,GAC/B,OAAO,OAAO,KAAK;CAErB,OAAO,OAAO,KAAK,GAAG,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,cAAc,YAAY,SAAS,SAAS,GAC7C,EAAE,aAAa,iBAAiB,CAClC;CACA,MAAM,WAAW,OAAO,OAAO,QAC7B,cACC,cAAc,WAAW,QAAQ,MAAM,MAAM,KAAK,WAAW,WAAW,CAAC,GAC1E,EAAE,aAAa,iBAAiB,CAClC;CACA,OAAO;EACL,GAAI,OAAO,kBAAkB,QAAQ,MAAM,WAAW;EACtD,MAAM;GACJ,gBAAgB,KACd,OACAC,MAAI,SAAS,EAAE,qBAAqB,cAAc,CACpD;GACA,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;EAClD;EACA,cAAc,KACZ,OACAA,MAAI,QAAQ,EAAE,eAAe,CAAC,QAAQ,GACtCA,MAAI,KAAK,EAAE,gBAAgB,SAAS,CACtC;EACA,OAAO,EACL,QAAQ,KACN,OACAA,MAAI,SAAS,EAAE,YAAY,MAAM,MAAM,CACzC,EACF;EACA,iBAAiB,OACf,KACE,OACAA,MAAI,KAAK,EAAE,sBAAsB,eAAe,CAClD,CACF;CACF;AACF,CACF;AAEA,MAAa,qBAAqB,YAChC,OAAO,WAAW,yBAAyB,OAAO,CAAC,CAAC,KAAK,OAAO,QAAQ,mBAAmB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"workspace-settings.mjs","names":["Str","Rec","Arr","READ_CONCURRENCY","Str","Arr","READ_CONCURRENCY","Arr","Arr","MANIFEST_FILE","Rec","Arr"],"sources":["../src/features/build-workspace-settings/model/shadcn-ui.ts","../src/features/build-workspace-settings/model/ignored-directories.ts","../src/features/build-workspace-settings/model/source-directories.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, Record as Rec, Schema, String as Str, pipe } from \"effect\";\n\nimport { prefixed, withoutRelative } from \"#/entities/workspace/index.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst MANIFEST_FILE = \"package.json\";\nconst WILDCARD = \"*\";\nconst EVERYTHING = \"/**\";\n\nconst ShadcnConfig = Schema.Struct({ aliases: Schema.Struct({ ui: Schema.String }) });\nconst ManifestImports = Schema.Struct({\n imports: Schema.optional(Schema.Record(Schema.String, Schema.String)),\n});\nconst decodeShadcnConfig = Schema.decodeUnknownOption(Schema.fromJsonString(ShadcnConfig));\nconst decodeManifestImports = Schema.decodeUnknownOption(Schema.fromJsonString(ManifestImports));\n\nconst withoutWildcard = Str.replace(WILDCARD, \"\");\n\nconst importTarget =\n (alias: string) =>\n ([key, target]: readonly [string, string]): Option.Option<string> => {\n if (!Str.endsWith(WILDCARD)(key)) {\n return Option.some(target).pipe(Option.filter(() => key === alias));\n }\n const prefix = withoutWildcard(key);\n if (!Str.startsWith(prefix)(alias)) {\n return Option.none();\n }\n return Option.some(`${withoutWildcard(target)}${Str.slice(prefix.length)(alias)}`);\n };\n\nconst resolvedAlias = (\n imports: Readonly<Record<string, string>>,\n alias: string,\n): Option.Option<string> =>\n pipe(Rec.toEntries(imports), Arr.findFirst(importTarget(alias)), Option.map(withoutRelative));\n\nexport const shadcnUiIn = Effect.fn(\"shadcnUiIn\")(function* shadcnUiIn(root: string, name: string) {\n const files = yield* RepositoryFiles;\n const directory = files.dirname(name);\n const configText = yield* files.readFile(files.join(root, name));\n const manifestText = yield* files.readFile(files.join(root, directory, MANIFEST_FILE));\n const imports = pipe(\n manifestText,\n Option.flatMap(decodeManifestImports),\n Option.flatMap((manifest) => Option.fromUndefinedOr(manifest.imports)),\n );\n return pipe(\n configText,\n Option.flatMap(decodeShadcnConfig),\n Option.map(({ aliases }) =>\n pipe(\n imports,\n Option.flatMap((map) => resolvedAlias(map, aliases.ui)),\n Option.getOrElse(() => aliases.ui),\n ),\n ),\n Option.map((target) => `${prefixed(directory)(target)}${EVERYTHING}`),\n );\n});\n","import { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles, nodeRepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst IGNORE_FILES = \":(glob)**/.gitignore\";\nconst SEPARATOR = \"/\";\nconst NEGATION = \"!\";\nconst CONTENTS = \"/**\";\nconst ROOT = \".\";\nconst ANYWHERE = \"**/\";\nconst READ_CONCURRENCY = 16;\nconst DIRECTORY_ENTRY = /^(?<anchor>\\/?)(?<name>[^!#/].*)\\/$/u;\n\nexport interface IgnoredDirectory {\n readonly pattern: string;\n readonly base: \"workspace\";\n}\n\nconst scopedName = (anchor: string, name: string): string => {\n if (anchor === SEPARATOR || Str.includes(SEPARATOR)(name)) {\n return name;\n }\n return `${ANYWHERE}${name}`;\n};\n\nconst inDirectory =\n (directory: string) =>\n (glob: string): string => {\n if (directory === ROOT) {\n return glob;\n }\n return `${directory}${SEPARATOR}${glob}`;\n };\n\nconst globOf =\n (directory: string) =>\n (line: string): Option.Option<string> => {\n const found = DIRECTORY_ENTRY.exec(Str.trim(line));\n return pipe(\n Option.fromNullishOr(found),\n Option.flatMap(({ groups }) => Option.fromNullishOr(groups)),\n Option.flatMap(({ anchor, name }) =>\n Option.map(Option.fromNullishOr(name), (entry) => scopedName(anchor ?? \"\", entry)),\n ),\n Option.map(inDirectory(directory)),\n );\n };\n\nconst keptGlob = Effect.fn(\"keptGlob\")(function* keptGlob(root: string, glob: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.matchingFiles(root, [`:(glob)${glob}/**`]);\n return Option.some(glob).pipe(Option.filter(() => Arr.isReadonlyArrayEmpty(listed)));\n});\n\nconst globsIn = Effect.fn(\"globsIn\")(function* globsIn(root: string, file: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, file));\n const toGlob = globOf(files.dirname(file));\n return pipe(\n Option.getOrElse(text, () => \"\"),\n Str.split(\"\\n\"),\n Arr.map(toGlob),\n Arr.getSomes,\n );\n});\n\nexport const collectIgnoredDirectories = Effect.fn(\"collectIgnoredDirectories\")(\n function* collectIgnoredDirectories(root: string) {\n const files = yield* RepositoryFiles;\n const ignoreFiles = yield* files.matchingFiles(root, [IGNORE_FILES]);\n const globs = yield* Effect.forEach(ignoreFiles, (file) => globsIn(root, file), {\n concurrency: 1,\n });\n const candidates = Arr.dedupe(Arr.flatten(globs));\n const kept = yield* Effect.forEach(candidates, (glob) => keptGlob(root, glob), {\n concurrency: READ_CONCURRENCY,\n });\n return pipe(\n Arr.getSomes(kept),\n Arr.flatMap((glob): readonly IgnoredDirectory[] => [\n { pattern: `${NEGATION}${glob}`, base: \"workspace\" },\n { pattern: `${NEGATION}${glob}${CONTENTS}`, base: \"workspace\" },\n ]),\n );\n },\n);\n\nexport const ignoredDirectories = (root: string): Promise<readonly IgnoredDirectory[]> =>\n Effect.runPromise(collectIgnoredDirectories(root).pipe(Effect.provide(nodeRepositoryFiles)));\n","import { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { collectIgnoredDirectories } from \"./ignored-directories.ts\";\n\nconst SOURCE_DIRECTORY = \"src\";\nconst READ_CONCURRENCY = 16;\n\nexport const directoryLayoutIn = Effect.fn(\"directoryLayoutIn\")(function* directoryLayoutIn(\n root: string,\n directories: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const listed = yield* Effect.forEach(\n directories,\n (directory) => {\n const source = files.join(directory, SOURCE_DIRECTORY);\n return files\n .isDirectory(files.join(root, source))\n .pipe(\n Effect.map((isDirectory) => pipe(isDirectory, Option.filter(Boolean), Option.as(source))),\n );\n },\n { concurrency: READ_CONCURRENCY },\n );\n return {\n sourceDirectories: Arr.getSomes(listed),\n ignoredDirectories: yield* collectIgnoredDirectories(root),\n };\n});\n","import { Array as Arr, Effect, Option, Schema, pipe } from \"effect\";\n\nimport {\n MANIFEST_FILE,\n EntryManifestJson,\n entriesOf,\n PackEntry,\n publicEntriesOf,\n} 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 decodeEntryManifest = Schema.decodeUnknownOption(EntryManifestJson);\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, MANIFEST_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(decodeEntryManifest),\n Option.map(entryFilesOf({ join, packEntries })),\n Option.getOrElse((): readonly string[] => []),\n );\n});\n","import { Array as Arr, Effect, Option, Record as Rec, Schema, pipe } from \"effect\";\nimport type { AllowWarnDeny, OxlintOverride } from \"vite-plus/lint\";\n\nimport { readManifest } from \"#/entities/package/index.ts\";\nimport {\n deployEntries,\n literalSettings,\n merged,\n programOf,\n settingsInvalid,\n usedFrom,\n workspaceDirectories,\n prefixed,\n NO_TASKS,\n definesTask,\n tasksOf,\n} from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource, WorkspaceTasks } from \"#/entities/workspace/index.ts\";\nimport { RepositoryFiles, nodeRepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport type { IgnoredDirectory } from \"./ignored-directories.ts\";\nimport { shadcnUiIn } from \"./shadcn-ui.ts\";\nimport { directoryLayoutIn } from \"./source-directories.ts\";\nimport { publicEntryFiles } from \"./workspace-public-entries.ts\";\n\nexport type RuleSet = Readonly<Record<string, unknown>>;\nexport type RuleSets = Readonly<Record<string, RuleSet>>;\nexport type DependencySets = Readonly<Record<string, readonly string[]>>;\n\nconst CONFIG_FILE = \"vite.config.ts\";\nconst SHADCN_FILE = \"components.json\";\nconst READ_CONCURRENCY = 16;\nconst MSCH_LINT = [\"msch\", \"lint\"] as const;\nconst MSCH_DEV_DEPENDENCIES = [\"msch\", \"devDependencies\"] as const;\nconst TEST_TASK = [\"tasks\", \"test\"] as const;\n\ntype SeverityName = Extract<AllowWarnDeny, string>;\n\nconst SEVERITY_NAMES: Readonly<Record<SeverityName, true>> = {\n off: true,\n allow: true,\n warn: true,\n error: true,\n deny: true,\n};\nconst Severity = Schema.Literals<readonly SeverityName[]>(Rec.keys(SEVERITY_NAMES));\nconst SeverityWithOptions = Schema.mutable(\n Schema.TupleWithRest(Schema.Tuple([Severity]), [Schema.Unknown]),\n);\nconst RuleSetting = Schema.Union([Severity, SeverityWithOptions]);\nconst Rules = Schema.Record(Schema.String, RuleSetting);\nconst decodeRules = Schema.decodeUnknownEffect(Rules);\nconst Names = Schema.optional(Schema.Array(Schema.String));\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 ignorePatterns: Names,\n overrides: Schema.optional(Schema.Array(WorkspaceOverride)),\n});\nconst DevDependencySettings = Schema.Struct({ use: Names, dependencies: Names });\nconst WorkspaceDevDependencies = Schema.Record(Schema.String, DevDependencySettings);\n\nexport interface DevDependencyAllowance {\n readonly workspaces: readonly string[];\n readonly dependencies: readonly string[];\n}\n\nexport interface WorkspaceLint {\n readonly ignorePatterns: readonly string[];\n readonly overrides: readonly OxlintOverride[];\n readonly shadcnUi: readonly string[];\n readonly publicEntries: readonly string[];\n readonly deployEntries: readonly string[];\n}\n\nexport interface WorkspaceSettings {\n readonly lint: WorkspaceLint;\n readonly sourceDirectories: readonly string[];\n readonly ignoredDirectories: readonly IgnoredDirectory[];\n readonly testProjects: readonly string[];\n readonly tasks: WorkspaceTasks;\n readonly devDependencies: Readonly<Record<string, DevDependencyAllowance>>;\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 ignorePatterns: readonly string[];\n readonly overrides: readonly OxlintOverride[];\n readonly devDependencies: Readonly<Record<string, DevDependencyAllowance>>;\n readonly ownTests: boolean;\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),\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 const ignorePatterns = pipe(lint.ignorePatterns ?? [], Arr.map(prefixed(source.directory)));\n return { ignorePatterns, overrides };\n});\n\nconst allowanceOf = Effect.fn(\"allowanceOf\")(function* allowanceOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n [reason, allowance]: readonly [string, typeof DevDependencySettings.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\nconst devDependenciesOf = Effect.fn(\"devDependenciesOf\")(function* devDependenciesOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n) {\n const settings = yield* literalSettings({\n source,\n path: MSCH_DEV_DEPENDENCIES,\n decode: Schema.decodeUnknownEffect(WorkspaceDevDependencies),\n });\n const allowed = Rec.toEntries(Option.getOrElse(settings, () => ({})));\n const entries = yield* Effect.forEach(\n allowed,\n (entry) => allowanceOf(source, dependencySets, entry),\n {\n concurrency: 1,\n },\n );\n return Rec.fromEntries(entries);\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* devDependenciesOf(source, options.dependencySets);\n const ownTests = definesTask(TEST_TASK)(source.program);\n const files = yield* RepositoryFiles;\n const manifest = yield* readManifest(files.dirname(source.file));\n const tasks = tasksOf(manifest)(source.program);\n return { directory: source.directory, ...lint, devDependencies, ownTests, tasks };\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 const publicEntries = yield* publicEntryFiles(options.root, directory, Option.none());\n return {\n directory,\n ignorePatterns: [],\n overrides: [],\n devDependencies: {},\n ownTests: false,\n tasks: NO_TASKS,\n publicEntries,\n };\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 collectWorkspaceSettings = Effect.fn(\"collectWorkspaceSettings\")(\n function* collectWorkspaceSettings(options: SettingsOptions) {\n const files = yield* RepositoryFiles;\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, files.join(directory, SHADCN_FILE)),\n { concurrency: READ_CONCURRENCY },\n );\n return {\n ...(yield* directoryLayoutIn(options.root, directories)),\n lint: {\n ignorePatterns: pipe(\n found,\n Arr.flatMap(({ ignorePatterns }) => ignorePatterns),\n ),\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 },\n testProjects: pipe(\n found,\n Arr.filter(({ ownTests }) => !ownTests),\n Arr.map(({ directory }) => directory),\n ),\n tasks: {\n verify: pipe(\n found,\n Arr.flatMap(({ tasks }) => tasks.verify),\n ),\n },\n devDependencies: merged(\n pipe(\n found,\n Arr.map(({ devDependencies }) => devDependencies),\n ),\n ),\n };\n },\n);\n\nexport const workspaceSettings = (options: SettingsOptions): Promise<WorkspaceSettings> =>\n Effect.runPromise(collectWorkspaceSettings(options).pipe(Effect.provide(nodeRepositoryFiles)));\n\nexport type { WorkspaceTasks } from \"#/entities/workspace/index.ts\";\n"],"mappings":";;;;AAKA,MAAM,gBAAgB;AACtB,MAAM,WAAW;AACjB,MAAM,aAAa;AAEnB,MAAM,eAAe,OAAO,OAAO,EAAE,SAAS,OAAO,OAAO,EAAE,IAAI,OAAO,OAAO,CAAC,EAAE,CAAC;AACpF,MAAM,kBAAkB,OAAO,OAAO,EACpC,SAAS,OAAO,SAAS,OAAO,OAAO,OAAO,QAAQ,OAAO,MAAM,CAAC,EACtE,CAAC;AACD,MAAM,qBAAqB,OAAO,oBAAoB,OAAO,eAAe,YAAY,CAAC;AACzF,MAAM,wBAAwB,OAAO,oBAAoB,OAAO,eAAe,eAAe,CAAC;AAE/F,MAAM,kBAAkBA,OAAI,QAAQ,UAAU,EAAE;AAEhD,MAAM,gBACH,WACA,CAAC,KAAK,YAA8D;CACnE,IAAI,CAACA,OAAI,SAAS,QAAQ,CAAC,CAAC,GAAG,GAC7B,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC,KAAK,OAAO,aAAa,QAAQ,KAAK,CAAC;CAEpE,MAAM,SAAS,gBAAgB,GAAG;CAClC,IAAI,CAACA,OAAI,WAAW,MAAM,CAAC,CAAC,KAAK,GAC/B,OAAO,OAAO,KAAK;CAErB,OAAO,OAAO,KAAK,GAAG,gBAAgB,MAAM,IAAIA,OAAI,MAAM,OAAO,MAAM,CAAC,CAAC,KAAK,GAAG;AACnF;AAEF,MAAM,iBACJ,SACA,UAEA,KAAKC,OAAI,UAAU,OAAO,GAAGC,MAAI,UAAU,aAAa,KAAK,CAAC,GAAG,OAAO,IAAI,eAAe,CAAC;AAE9F,MAAa,aAAa,OAAO,GAAG,YAAY,CAAC,CAAC,UAAU,WAAW,MAAc,MAAc;CACjG,MAAM,QAAQ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AAS,EAAE,qBAAqB,cAAc,CACpD;GACA,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;EAClD;EACA,cAAc,KACZ,OACAA,MAAI,QAAQ,EAAE,eAAe,CAAC,QAAQ,GACtCA,MAAI,KAAK,EAAE,gBAAgB,SAAS,CACtC;EACA,OAAO,EACL,QAAQ,KACN,OACAA,MAAI,SAAS,EAAE,YAAY,MAAM,MAAM,CACzC,EACF;EACA,iBAAiB,OACf,KACE,OACAA,MAAI,KAAK,EAAE,sBAAsB,eAAe,CAClD,CACF;CACF;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.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "masseater's check policy: 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",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@r_masseater/oxlint-plugin-decision": "0.8.0",
|
|
80
80
|
"@r_masseater/oxlint-typed-rules": "0.4.1",
|
|
81
81
|
"@r_masseater/textlint-rule-preset-ja": "0.1.1",
|
|
82
|
-
"@r_masseater/vite-plus-adopt": "0.
|
|
82
|
+
"@r_masseater/vite-plus-adopt": "0.9.0",
|
|
83
83
|
"@shadcn/lint": "0.2.5",
|
|
84
84
|
"@tanstack/intent": "0.5.6",
|
|
85
85
|
"@textlint-ja/textlint-rule-preset-ai-writing": "1.7.0",
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
"eslint-plugin-react-hooks": "7.1.1",
|
|
92
92
|
"htmlparser2": "^12.0.0",
|
|
93
93
|
"oxlint-plugin-eslint": "1.93.0",
|
|
94
|
+
"semver": "7.8.6",
|
|
94
95
|
"sql-parser-cst": "0.44.1",
|
|
95
96
|
"textlint-rule-preset-ja-technical-writing": "12.0.2",
|
|
96
97
|
"toml-eslint-parser": "1.0.3",
|
|
@@ -102,10 +103,12 @@
|
|
|
102
103
|
"@effect/vitest": "4.1.4",
|
|
103
104
|
"@r_masseater/vitest-otlp": "0.2.0",
|
|
104
105
|
"@types/node": "26.6.6",
|
|
106
|
+
"@types/semver": "7.8.0",
|
|
105
107
|
"effect": "4.1.4",
|
|
106
108
|
"typescript": "7.1.0-beta",
|
|
107
109
|
"vite": "npm:@voidzero-dev/vite-plus-core@1.6.0",
|
|
108
|
-
"vite-plus": "1.6.0"
|
|
110
|
+
"vite-plus": "1.6.0",
|
|
111
|
+
"wordnet-db": "3.1.14"
|
|
109
112
|
},
|
|
110
113
|
"peerDependencies": {
|
|
111
114
|
"@effect/tsgo": ">=0.67.5",
|
|
@@ -12,8 +12,8 @@ sources:
|
|
|
12
12
|
- src/app/repository-config.ts
|
|
13
13
|
- src/app/repository-tasks.ts
|
|
14
14
|
- src/app/repository-text.ts
|
|
15
|
-
- src/features/lint-preset/index.ts
|
|
16
|
-
- src/features/workspace-settings/index.ts
|
|
15
|
+
- src/features/define-lint-preset/index.ts
|
|
16
|
+
- src/features/build-workspace-settings/index.ts
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
# repository-config
|