@r_masseater/msch 0.60.2 → 0.61.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/{app-DcgzLzb0.mjs → app-BwjhFdKD.mjs} +2 -2
- package/dist/{app-DcgzLzb0.mjs.map → app-BwjhFdKD.mjs.map} +1 -1
- package/dist/cargo-inputs.mjs +1 -1
- package/dist/changed.mjs +1 -1
- package/dist/cli.mjs +429 -591
- package/dist/cli.mjs.map +1 -1
- package/dist/exits.mjs +1 -1
- package/dist/fix.d.mts +1 -0
- package/dist/fix.mjs +96 -0
- package/dist/fix.mjs.map +1 -0
- package/dist/lint-rules.mjs +3 -5
- package/dist/lint-rules.mjs.map +1 -1
- package/dist/oxlint.mjs +1 -1
- package/dist/pack-settings-FN4-vi6J.mjs +225 -0
- package/dist/pack-settings-FN4-vi6J.mjs.map +1 -0
- package/dist/{pass-records-BCT1Ls9c.mjs → pass-records-CFIrQmB5.mjs} +2 -2
- package/dist/{pass-records-BCT1Ls9c.mjs.map → pass-records-CFIrQmB5.mjs.map} +1 -1
- package/dist/{problem-BoHYLMQT.mjs → problem-D2HKNIVq.mjs} +2 -2
- package/dist/{problem-BoHYLMQT.mjs.map → problem-D2HKNIVq.mjs.map} +1 -1
- package/dist/publish.mjs +73 -64
- package/dist/publish.mjs.map +1 -1
- package/dist/{published-D87PrlyG.mjs → published-BIexKvdJ.mjs} +2 -2
- package/dist/{published-D87PrlyG.mjs.map → published-BIexKvdJ.mjs.map} +1 -1
- package/dist/{syntax-CTiXR0EJ.mjs → syntax-C0ddqOHc.mjs} +4 -3
- package/dist/syntax-C0ddqOHc.mjs.map +1 -0
- package/dist/text-position-DrvZ7k2Y.mjs +17 -0
- package/dist/text-position-DrvZ7k2Y.mjs.map +1 -0
- package/dist/{upstream-exits-DitN-yYH.mjs → upstream-exits-DgkAyuu-.mjs} +3 -15
- package/dist/upstream-exits-DgkAyuu-.mjs.map +1 -0
- package/dist/workspace-settings.mjs +1 -1
- package/package.json +3 -2
- package/skills/msch-checks/SKILL.md +10 -0
- package/dist/syntax-CTiXR0EJ.mjs.map +0 -1
- package/dist/upstream-exits-DitN-yYH.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"published-D87PrlyG.mjs","names":["Arr","Rec","CONFIG_FILE","taggedError","Arr","Rec","Arr","SEPARATOR","Str","Str","Rec","Arr","READ_CONCURRENCY","Arr","taggedError","Rec","Rec","Arr","Arr","Rec","Str","Str","Rec","Arr","Arr","Str","Rec","MANIFEST_FILE"],"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/workspace-patterns.ts","../src/entities/workspace/model/shadcn-ui.ts","../src/entities/workspace/model/deploy-entries.ts","../src/entities/workspace/model/lockfile-unreadable.ts","../src/entities/workspace/model/locked-packages.ts","../src/entities/workspace/model/locked-graph.ts","../src/entities/workspace/model/locked-links.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\n/** @internal */\nexport interface 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, Predicate, Schema, pipe } from \"effect\";\nimport { resolveConfigFromFile } from \"vite-plus\";\n\nimport type { Manifest } from \"#/entities/package/@x/workspace.ts\";\n\nimport { nestedValues, propertyValue, stringsIn } from \"./config-literal.ts\";\nimport { settingsInvalid } from \"./workspace-config-source.ts\";\n\nexport const VERIFY_TASK = [\"tasks\", \"verify\"] as const;\n\nexport const TEST_TASK = [\"tasks\", \"test\"] as const;\n\nconst NATIVE_TASK = [\"tasks\", \"native\"] as const;\n\nexport const RUN_TASKS = [\"run\", \"tasks\"] as const;\n\nexport interface WorkspaceTasks {\n readonly verify: readonly string[];\n readonly native: readonly string[];\n}\n\nexport const NO_TASKS: WorkspaceTasks = { verify: [], native: [] };\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\nconst TEST_TASK_NAME = \"test\";\nconst DEPENDS_ON = \"dependsOn\";\n\nexport const testsItself = (program: unknown): boolean =>\n definesTask(TEST_TASK)(program) ||\n pipe(\n nestedValues(VERIFY_TASK)(program),\n Arr.flatMap((verify) => Option.toArray(propertyValue(DEPENDS_ON)(verify))),\n Arr.flatMap(stringsIn),\n Arr.some(({ text }) => text === TEST_TASK_NAME),\n );\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\nconst shipsAddon = (manifest: Option.Option<Manifest>): boolean =>\n Option.exists(manifest, (found) => Predicate.isNotUndefined(found.native));\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.getSomes([\n Option.liftPredicate(`${name}#verify`, () => definesTask(VERIFY_TASK)(program)),\n Option.liftPredicate(`${name}#test`, () => definesTask(TEST_TASK)(program)),\n ]),\n native: Arr.filter(\n [`${name}#native`],\n () => definesTask(NATIVE_TASK)(program) || shipsAddon(manifest),\n ),\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, Record as Rec, Schema, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { prefixed, withoutRelative } from \"./workspace-patterns.ts\";\n\nconst SHADCN_FILE = \"components.json\";\nconst 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 type ShadcnUi = Readonly<{\n file: string;\n alias: string;\n target: Option.Option<string>;\n}>;\n\nexport const shadcnUiOf = Effect.fn(\"shadcnUiOf\")(function* shadcnUiOf(\n root: string,\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const file = files.join(root, directory, SHADCN_FILE);\n const configText = yield* files.readFile(file);\n const manifestText = yield* files.readFile(files.join(root, directory, 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 }): ShadcnUi => ({\n file,\n alias: aliases.ui,\n target: pipe(\n imports,\n Option.flatMap((map) => resolvedAlias(map, aliases.ui)),\n ),\n })),\n );\n});\n\nexport const shadcnUiIn = Effect.fn(\"shadcnUiIn\")(function* shadcnUiIn(\n root: string,\n directory: string,\n) {\n const found = yield* shadcnUiOf(root, directory);\n return pipe(\n found,\n Option.map(\n ({ alias, target }) =>\n `${prefixed(directory)(Option.getOrElse(target, () => alias))}${EVERYTHING}`,\n ),\n );\n});\n","import { Array as Arr, Effect, Option, Predicate, Schema, pipe } from \"effect\";\nimport { parse } from \"vite-plus\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { KeySchema, childrenOf, keyName, stringsIn } from \"./config-literal.ts\";\n\nconst MAIN_KEY = \"main\";\nconst FRAMEWORK_SITES = \"Website\";\nconst READ_CONCURRENCY = 16;\nconst SCRIPT = /\\.[cm]?tsx?$/u;\nconst SKIPPED = /\\.test\\.|\\.d\\.[cm]?ts$/u;\nconst ALCHEMY_IMPORT = /from\\s+[\"'](?:alchemy|@alchemy\\.run)(?:\\/[^\"']*)?[\"']/u;\nconst MAIN_PROPERTY = /\\bmain\\s*:/u;\nconst decodeKey = Schema.decodeUnknownOption(KeySchema);\nconst SiteNamespace = Schema.Struct({\n type: Schema.Literal(\"Identifier\"),\n name: Schema.Literal(FRAMEWORK_SITES),\n});\nconst SiteResource = Schema.Struct({\n type: Schema.Literal(\"MemberExpression\"),\n object: SiteNamespace,\n});\nconst FrameworkSite = Schema.Struct({\n type: Schema.Literal(\"CallExpression\"),\n callee: SiteResource,\n});\nconst decodeFrameworkSite = Schema.decodeUnknownOption(FrameworkSite);\n\nconst isMainProperty = (node: Readonly<Record<string, unknown>>): boolean =>\n node[\"type\"] === \"Property\" &&\n pipe(\n decodeKey(node[\"key\"]),\n Option.exists((key) => keyName(key) === MAIN_KEY),\n );\n\ntype Skip = (node: unknown) => boolean;\n\nconst skipNothing: Skip = () => false;\n\nconst isFrameworkSite: Skip = (node) => Option.isSome(decodeFrameworkSite(node));\n\nconst mainTargetsIn = (skip: Skip): ((node: unknown) => readonly string[]) => {\n const visit = (node: unknown): readonly string[] => {\n if (skip(node)) {\n return [];\n }\n if (Predicate.isReadonlyObject(node) && isMainProperty(node)) {\n return pipe(\n stringsIn(node[\"value\"]),\n Arr.head,\n Option.map(({ text }) => text),\n Option.toArray,\n );\n }\n return pipe(childrenOf(node), Arr.flatMap(visit));\n };\n return visit;\n};\n\ninterface Declaring {\n readonly root: string;\n readonly file: string;\n readonly skip: Skip;\n}\n\nconst declaredIn = Effect.fn(\"declaredIn\")(function* declaredIn({ root, file, skip }: Declaring) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, file));\n if (Option.isNone(text) || !ALCHEMY_IMPORT.test(text.value) || !MAIN_PROPERTY.test(text.value)) {\n return [];\n }\n const parsed = yield* Effect.promise(() => parse(file, text.value, { lang: \"ts\" }));\n return pipe(\n mainTargetsIn(skip)(parsed.program),\n Arr.map((target) => files.join(files.dirname(file), target)),\n );\n});\n\nconst entriesOutside = Effect.fn(\"entriesOutside\")(function* entriesOutside(\n root: string,\n skip: Skip,\n) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.listedFiles(root);\n const declaring = pipe(\n listed,\n Arr.filter((file) => SCRIPT.test(file) && !SKIPPED.test(file)),\n );\n const found = yield* Effect.forEach(declaring, (file) => declaredIn({ root, file, skip }), {\n concurrency: READ_CONCURRENCY,\n });\n return pipe(\n Arr.flatten(found),\n Arr.filter((file) => Arr.contains(listed, file)),\n Arr.dedupe,\n );\n});\n\nexport const deployEntries = Effect.fn(\"deployEntries\")(function* deployEntries(root: string) {\n return yield* entriesOutside(root, skipNothing);\n});\n\nexport const bundledEntries = Effect.fn(\"bundledEntries\")(function* bundledEntries(root: string) {\n return yield* entriesOutside(root, isFrameworkSite);\n});\n","import { 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 } from \"effect\";\n\nimport { LockfileUnreadable } from \"./lockfile-unreadable.ts\";\n\nexport type WantedLockfile = NonNullable<Awaited<ReturnType<typeof readWantedLockfile>>>;\n\n/** @internal */\nexport const wantedLockfile = (\n root: string,\n): Effect.Effect<Option.Option<WantedLockfile>, LockfileUnreadable> =>\n Effect.tryPromise({\n try: () => readWantedLockfile(root, { ignoreIncompatible: false }),\n catch: (cause) => LockfileUnreadable.make({ root, reason: String(cause) }),\n }).pipe(Effect.map(Option.fromNullishOr));\n\n/** @internal */\nexport const lockedPackages = (\n root: string,\n): Effect.Effect<Option.Option<readonly string[]>, LockfileUnreadable> =>\n wantedLockfile(root).pipe(\n Effect.map(Option.flatMap(({ packages }) => Option.fromUndefinedOr(packages))),\n Effect.map(Option.map(Rec.keys)),\n );\n","import { refToRelative } from \"@pnpm/deps.path\";\nimport { Array as Arr, Effect, Option, Record as Rec, pipe } from \"effect\";\n\nimport { wantedLockfile } from \"./locked-packages.ts\";\nimport type { WantedLockfile } from \"./locked-packages.ts\";\nimport type { LockfileUnreadable } from \"./lockfile-unreadable.ts\";\n\nexport interface LockedNode {\n readonly id: string;\n readonly dependencies: readonly string[];\n}\n\nconst MANIFEST = \"package.json\";\nconst ROOT_IMPORTER = \".\";\n\ntype ProjectSnapshot = WantedLockfile[\"importers\"][keyof WantedLockfile[\"importers\"]];\n\ntype ResolvedSections = Readonly<\n Partial<Pick<ProjectSnapshot, \"dependencies\" | \"devDependencies\" | \"optionalDependencies\">>\n>;\n\nexport type ResolvedDependencies = Readonly<\n NonNullable<WantedLockfile[\"importers\"][keyof WantedLockfile[\"importers\"]][\"dependencies\"]>\n>;\n\ninterface LockedSnapshots<Importer extends string, Package extends string> {\n readonly importers: Readonly<Record<Importer, ResolvedSections>>;\n readonly packages?: Readonly<Record<Package, ResolvedSections>> | undefined;\n}\n\nconst importerManifest = (id: string): string =>\n Option.match(\n Option.liftPredicate(id, (found) => found === ROOT_IMPORTER),\n {\n onNone: () => `${id}/${MANIFEST}`,\n onSome: () => MANIFEST,\n },\n );\n\nexport const depPathsOf = (resolved: ResolvedDependencies | undefined): readonly string[] =>\n pipe(\n Rec.toEntries(resolved ?? {}),\n Arr.flatMap(([name, reference]) =>\n Option.toArray(Option.fromNullishOr(refToRelative(reference, name))),\n ),\n );\n\nconst nodesOf = <Importer extends string, Package extends string>(\n lockfile: LockedSnapshots<Importer, Package>,\n): readonly LockedNode[] => [\n ...pipe(\n Rec.toEntries(lockfile.importers),\n Arr.map(([id, project]) => ({\n id: importerManifest(id),\n dependencies: [\n ...depPathsOf(project.dependencies),\n ...depPathsOf(project.devDependencies),\n ...depPathsOf(project.optionalDependencies),\n ],\n })),\n ),\n ...pipe(\n Option.match(Option.fromUndefinedOr(lockfile.packages), {\n onNone: (): readonly (readonly [Package, ResolvedSections])[] => [],\n onSome: Rec.toEntries,\n }),\n Arr.map(([id, snapshot]) => ({\n id,\n dependencies: [\n ...depPathsOf(snapshot.dependencies),\n ...depPathsOf(snapshot.optionalDependencies),\n ],\n })),\n ),\n];\n\n/** @internal */\nexport const lockedGraph = (\n root: string,\n): Effect.Effect<Option.Option<readonly LockedNode[]>, LockfileUnreadable> =>\n wantedLockfile(root).pipe(Effect.map(Option.map(nodesOf)));\n","import { Array as Arr, Effect, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport type { ResolvedDependencies } from \"./locked-graph.ts\";\nimport { wantedLockfile } from \"./locked-packages.ts\";\n\nconst LINK = \"link:\";\n\nexport interface WorkspaceLink {\n readonly from: string;\n readonly to: string;\n}\n\nexport const linkedPaths = (\n sections: readonly (ResolvedDependencies | undefined)[],\n): readonly string[] =>\n pipe(\n sections,\n Arr.flatMap((resolved) => Rec.values(resolved ?? {})),\n Arr.filter(Str.startsWith(LINK)),\n Arr.map((reference) => Str.slice(LINK.length)(reference)),\n );\n\n/** @internal */\nexport const workspaceLinks = Effect.fn(\"workspaceLinks\")(function* workspaceLinks(root: string) {\n const files = yield* RepositoryFiles;\n const lockfile = yield* wantedLockfile(root);\n const linksOf = (id: string, paths: readonly string[]): readonly WorkspaceLink[] => {\n const from = files.relative(root, files.join(root, id));\n return pipe(\n paths,\n Arr.map((path): WorkspaceLink => ({\n from,\n to: files.relative(root, files.join(root, id, path)),\n })),\n );\n };\n return pipe(\n lockfile,\n Option.map(({ importers }) =>\n pipe(\n Rec.toEntries(importers),\n Arr.flatMap(([id, project]) =>\n linksOf(\n id,\n linkedPaths([\n project.dependencies,\n project.devDependencies,\n project.optionalDependencies,\n ]),\n ),\n ),\n ),\n ),\n Option.getOrElse((): readonly WorkspaceLink[] => []),\n );\n});\n","import { baseName } from \"@masseater.dev/path-kit\";\nimport {\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 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\nexport const isBinEntry = ({ label }: PublicEntry): boolean =>\n Str.startsWith(`${BIN_LABEL} `)(label);\n\nexport const 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\nexport const entryNameOf = (target: string): string => Str.replace(BUILT, \"\")(baseName(target));\n\nconst sourceOf =\n ({ join, packEntries }: EntryLookup) =>\n (target: string): Option.Option<string> => {\n if (SOURCE.test(target) && !Str.includes(DECLARATION)(target)) {\n return Option.some(join(target));\n }\n const name = entryNameOf(target);\n return pipe(\n packEntries,\n Arr.findFirst((entry) => entry.name === name),\n Option.map((entry) => entry.source),\n );\n };\n\nexport const publicEntriesOf = (lookup: EntryLookup): readonly PublicEntry[] =>\n pipe(\n [...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 AlwaysBundle = Schema.Array(Schema.String);\nconst PackDeps = Schema.Struct({ alwaysBundle: Schema.optional(AlwaysBundle) });\nconst PackSettings = Schema.Struct({\n entry: Schema.optional(PackEntry),\n deps: Schema.optional(PackDeps),\n});\nconst PackList = Schema.Union([PackSettings, Schema.Array(PackSettings)]);\nconst isEntryList = Schema.is(Schema.Array(Schema.String));\nconst PackConfig = Schema.Struct({ pack: Schema.optional(PackList) });\nconst BudgetConfig = Schema.Struct({\n msch: Schema.Struct({ publish: Schema.Struct({ installSize: SizeText }) }),\n});\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 PackedWorkspace {\n readonly directory: string;\n readonly configFile: string;\n readonly packEntries: readonly PackEntrySource[];\n readonly alwaysBundle: readonly string[];\n}\n\nexport interface PublishedWorkspace extends PackedWorkspace {\n readonly installSize: string;\n readonly installBudget: number;\n}\n\nconst bytesPer = (unit: string): number =>\n pipe(\n UNIT_BYTES,\n Arr.findFirst(([name]) => name === unit),\n Option.map(([, bytes]) => bytes),\n Option.getOrElse(() => Number.NaN),\n );\n\nconst nameOf = (source: string): string =>\n pipe(\n Str.split(source, SEPARATOR),\n Arr.last,\n Option.getOrElse(() => source),\n Str.replace(SOURCE_EXTENSION, \"\"),\n );\n\nexport const entriesOf = (entry: typeof PackEntry.Type): readonly PackEntrySource[] => {\n if (Predicate.isString(entry)) {\n return [{ name: nameOf(entry), source: entry }];\n }\n if (isEntryList(entry)) {\n return pipe(\n entry,\n Arr.map((source) => ({ name: nameOf(source), source })),\n );\n }\n return pipe(\n Rec.toEntries(entry),\n Arr.map(([name, source]) => ({ name, source })),\n );\n};\n\nconst packSettingsOf = (pack: typeof PackConfig.Type.pack): readonly (typeof PackSettings.Type)[] =>\n pipe(\n Option.fromUndefinedOr(pack),\n Option.map(Arr.ensure),\n Option.getOrElse((): readonly (typeof PackSettings.Type)[] => []),\n );\n\nconst packEntriesOf = (pack: typeof PackConfig.Type.pack): readonly PackEntrySource[] =>\n pipe(\n packSettingsOf(pack),\n Arr.flatMap((setting) =>\n pipe(\n Option.fromUndefinedOr(setting.entry),\n Option.match({ onNone: () => [], onSome: entriesOf }),\n ),\n ),\n );\n\nconst alwaysBundleOf = (pack: typeof PackConfig.Type.pack): readonly string[] =>\n pipe(\n packSettingsOf(pack),\n Arr.flatMap((setting) =>\n pipe(\n Option.fromUndefinedOr(setting.deps),\n Option.flatMap((deps) => Option.fromUndefinedOr(deps.alwaysBundle)),\n Option.getOrElse((): readonly string[] => []),\n ),\n ),\n Arr.dedupe,\n );\n\nconst settingsIn = Effect.fn(\"settingsIn\")(function* settingsIn(file: string) {\n const config = yield* Effect.tryPromise({\n try: () => resolveConfigFromFile(file),\n catch: () => WorkspaceConfigUnreadable.make({ file }),\n }).pipe(Effect.option);\n return config;\n});\n\nconst isPublicPackage = Effect.fn(\"isPublicPackage\")(function* isPublicPackage(directory: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(directory, MANIFEST_FILE));\n return Option.exists(text, (found) =>\n Option.isSome(Schema.decodeOption(Schema.fromJsonString(PublicManifest))(found)),\n );\n});\n\nconst packedWorkspaceOf =\n (directory: string, configFile: string, join: (source: string) => string) =>\n ({ pack }: typeof PackConfig.Type): PackedWorkspace => ({\n directory,\n configFile,\n packEntries: pipe(\n packEntriesOf(pack),\n Arr.map((entry) => ({ name: entry.name, source: join(entry.source) })),\n ),\n alwaysBundle: alwaysBundleOf(pack),\n });\n\nconst budgetOf = ({\n msch,\n}: typeof BudgetConfig.Type): Pick<PublishedWorkspace, \"installSize\" | \"installBudget\"> => {\n const [amount, , unit] = msch.publish.installSize;\n return { installSize: `${amount} ${unit}`, installBudget: amount * bytesPer(unit) };\n};\n\nconst packedIn = Effect.fn(\"packedIn\")(function* packedIn(root: string, configName: string) {\n const files = yield* RepositoryFiles;\n const configFile = files.join(root, configName);\n const directory = files.dirname(configFile);\n const isPublic = yield* isPublicPackage(directory);\n if (!isPublic) {\n return Option.none<readonly [PackedWorkspace, unknown]>();\n }\n const config = yield* settingsIn(configFile);\n return pipe(\n config,\n Option.flatMap((found) =>\n pipe(\n Schema.decodeUnknownOption(PackConfig)(found),\n Option.map(\n packedWorkspaceOf(directory, configFile, (source) => files.join(directory, source)),\n ),\n Option.map((workspace) => [workspace, found] as const),\n ),\n ),\n );\n});\n\nconst packedPairs = Effect.fn(\"packedPairs\")(function* packedPairs(root: string) {\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) => packedIn(root, name), {\n concurrency: READ_CONCURRENCY,\n });\n return Arr.getSomes(found);\n});\n\n/** @internal */\nexport const packedWorkspaces = Effect.fn(\"packedWorkspaces\")(function* packedWorkspaces(\n root: string,\n) {\n const pairs = yield* packedPairs(root);\n return pipe(\n pairs,\n Arr.map(([workspace]) => workspace),\n );\n});\n\n/** @internal */\nexport const publishedWorkspaces = Effect.fn(\"publishedWorkspaces\")(function* publishedWorkspaces(\n root: string,\n) {\n const pairs = yield* packedPairs(root);\n return pipe(\n pairs,\n Arr.flatMap(([workspace, config]) =>\n pipe(\n Schema.decodeUnknownOption(BudgetConfig)(config),\n Option.map((budget): PublishedWorkspace => ({ ...workspace, ...budgetOf(budget) })),\n Option.toArray,\n ),\n ),\n );\n});\n"],"mappings":";;;;;;;;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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AkB,WAAW,aAAa,WAAW,MAAM,KAAK,WAAW,MAAM,CAAC,CACpF,GACA,OAAO,KAAK,cAAc,CAAC,WAAW,KAAK,CAAU,CACvD,CACF,CACF;AACF,CAAC;AAED,MAAM,cAAc,OAAO,GAAG,aAAa,CAAC,CAAC,UAAU,YAAY,MAAc;CAC/E,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,SAAS,MAAM,IAAI,GAAG,EAC3E,aAAa,iBACf,CAAC;CACD,OAAOD,MAAI,SAAS,KAAK;AAC3B,CAAC;;AAGD,MAAa,mBAAmB,OAAO,GAAG,kBAAkB,CAAC,CAAC,UAAU,iBACtE,MACA;CACA,MAAM,QAAQ,OAAO,YAAY,IAAI;CACrC,OAAO,KACL,OACAA,MAAI,KAAK,CAAC,eAAe,SAAS,CACpC;AACF,CAAC;;AAGD,MAAa,sBAAsB,OAAO,GAAG,qBAAqB,CAAC,CAAC,UAAU,oBAC5E,MACA;CACA,MAAM,QAAQ,OAAO,YAAY,IAAI;CACrC,OAAO,KACL,OACAA,MAAI,SAAS,CAAC,WAAW,YACvB,KACE,OAAO,oBAAoB,YAAY,CAAC,CAAC,MAAM,GAC/C,OAAO,KAAK,YAAgC;EAAE,GAAG;EAAW,GAAG,SAAS,MAAM;CAAE,EAAE,GAClF,OAAO,OACT,CACF,CACF;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"published-BIexKvdJ.mjs","names":["Arr","Rec","CONFIG_FILE","taggedError","Arr","Rec","Arr","SEPARATOR","Str","Str","Rec","Arr","READ_CONCURRENCY","Arr","taggedError","Rec","Rec","Arr","Arr","Rec","Str","Str","Rec","Arr","Arr","Str","Rec","MANIFEST_FILE"],"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/workspace-patterns.ts","../src/entities/workspace/model/shadcn-ui.ts","../src/entities/workspace/model/deploy-entries.ts","../src/entities/workspace/model/lockfile-unreadable.ts","../src/entities/workspace/model/locked-packages.ts","../src/entities/workspace/model/locked-graph.ts","../src/entities/workspace/model/locked-links.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\n/** @internal */\nexport interface 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, Predicate, Schema, pipe } from \"effect\";\nimport { resolveConfigFromFile } from \"vite-plus\";\n\nimport type { Manifest } from \"#/entities/package/@x/workspace.ts\";\n\nimport { nestedValues, propertyValue, stringsIn } from \"./config-literal.ts\";\nimport { settingsInvalid } from \"./workspace-config-source.ts\";\n\nexport const VERIFY_TASK = [\"tasks\", \"verify\"] as const;\n\nexport const TEST_TASK = [\"tasks\", \"test\"] as const;\n\nconst NATIVE_TASK = [\"tasks\", \"native\"] as const;\n\nexport const RUN_TASKS = [\"run\", \"tasks\"] as const;\n\nexport interface WorkspaceTasks {\n readonly verify: readonly string[];\n readonly native: readonly string[];\n}\n\nexport const NO_TASKS: WorkspaceTasks = { verify: [], native: [] };\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\nconst TEST_TASK_NAME = \"test\";\nconst DEPENDS_ON = \"dependsOn\";\n\nexport const testsItself = (program: unknown): boolean =>\n definesTask(TEST_TASK)(program) ||\n pipe(\n nestedValues(VERIFY_TASK)(program),\n Arr.flatMap((verify) => Option.toArray(propertyValue(DEPENDS_ON)(verify))),\n Arr.flatMap(stringsIn),\n Arr.some(({ text }) => text === TEST_TASK_NAME),\n );\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\nconst shipsAddon = (manifest: Option.Option<Manifest>): boolean =>\n Option.exists(manifest, (found) => Predicate.isNotUndefined(found.native));\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.getSomes([\n Option.liftPredicate(`${name}#verify`, () => definesTask(VERIFY_TASK)(program)),\n Option.liftPredicate(`${name}#test`, () => definesTask(TEST_TASK)(program)),\n ]),\n native: Arr.filter(\n [`${name}#native`],\n () => definesTask(NATIVE_TASK)(program) || shipsAddon(manifest),\n ),\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, Record as Rec, Schema, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { prefixed, withoutRelative } from \"./workspace-patterns.ts\";\n\nconst SHADCN_FILE = \"components.json\";\nconst 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 type ShadcnUi = Readonly<{\n file: string;\n alias: string;\n target: Option.Option<string>;\n}>;\n\nexport const shadcnUiOf = Effect.fn(\"shadcnUiOf\")(function* shadcnUiOf(\n root: string,\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const file = files.join(root, directory, SHADCN_FILE);\n const configText = yield* files.readFile(file);\n const manifestText = yield* files.readFile(files.join(root, directory, 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 }): ShadcnUi => ({\n file,\n alias: aliases.ui,\n target: pipe(\n imports,\n Option.flatMap((map) => resolvedAlias(map, aliases.ui)),\n ),\n })),\n );\n});\n\nexport const shadcnUiIn = Effect.fn(\"shadcnUiIn\")(function* shadcnUiIn(\n root: string,\n directory: string,\n) {\n const found = yield* shadcnUiOf(root, directory);\n return pipe(\n found,\n Option.map(\n ({ alias, target }) =>\n `${prefixed(directory)(Option.getOrElse(target, () => alias))}${EVERYTHING}`,\n ),\n );\n});\n","import { Array as Arr, Effect, Option, Predicate, Schema, pipe } from \"effect\";\nimport { parse } from \"vite-plus\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { KeySchema, childrenOf, keyName, stringsIn } from \"./config-literal.ts\";\n\nconst MAIN_KEY = \"main\";\nconst FRAMEWORK_SITES = \"Website\";\nconst READ_CONCURRENCY = 16;\nconst SCRIPT = /\\.[cm]?tsx?$/u;\nconst SKIPPED = /\\.test\\.|\\.d\\.[cm]?ts$/u;\nconst ALCHEMY_IMPORT = /from\\s+[\"'](?:alchemy|@alchemy\\.run)(?:\\/[^\"']*)?[\"']/u;\nconst MAIN_PROPERTY = /\\bmain\\s*:/u;\nconst decodeKey = Schema.decodeUnknownOption(KeySchema);\nconst SiteNamespace = Schema.Struct({\n type: Schema.Literal(\"Identifier\"),\n name: Schema.Literal(FRAMEWORK_SITES),\n});\nconst SiteResource = Schema.Struct({\n type: Schema.Literal(\"MemberExpression\"),\n object: SiteNamespace,\n});\nconst FrameworkSite = Schema.Struct({\n type: Schema.Literal(\"CallExpression\"),\n callee: SiteResource,\n});\nconst decodeFrameworkSite = Schema.decodeUnknownOption(FrameworkSite);\n\nconst isMainProperty = (node: Readonly<Record<string, unknown>>): boolean =>\n node[\"type\"] === \"Property\" &&\n pipe(\n decodeKey(node[\"key\"]),\n Option.exists((key) => keyName(key) === MAIN_KEY),\n );\n\ntype Skip = (node: unknown) => boolean;\n\nconst skipNothing: Skip = () => false;\n\nconst isFrameworkSite: Skip = (node) => Option.isSome(decodeFrameworkSite(node));\n\nconst mainTargetsIn = (skip: Skip): ((node: unknown) => readonly string[]) => {\n const visit = (node: unknown): readonly string[] => {\n if (skip(node)) {\n return [];\n }\n if (Predicate.isReadonlyObject(node) && isMainProperty(node)) {\n return pipe(\n stringsIn(node[\"value\"]),\n Arr.head,\n Option.map(({ text }) => text),\n Option.toArray,\n );\n }\n return pipe(childrenOf(node), Arr.flatMap(visit));\n };\n return visit;\n};\n\ninterface Declaring {\n readonly root: string;\n readonly file: string;\n readonly skip: Skip;\n}\n\nconst declaredIn = Effect.fn(\"declaredIn\")(function* declaredIn({ root, file, skip }: Declaring) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, file));\n if (Option.isNone(text) || !ALCHEMY_IMPORT.test(text.value) || !MAIN_PROPERTY.test(text.value)) {\n return [];\n }\n const parsed = yield* Effect.promise(() => parse(file, text.value, { lang: \"ts\" }));\n return pipe(\n mainTargetsIn(skip)(parsed.program),\n Arr.map((target) => files.join(files.dirname(file), target)),\n );\n});\n\nconst entriesOutside = Effect.fn(\"entriesOutside\")(function* entriesOutside(\n root: string,\n skip: Skip,\n) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.listedFiles(root);\n const declaring = pipe(\n listed,\n Arr.filter((file) => SCRIPT.test(file) && !SKIPPED.test(file)),\n );\n const found = yield* Effect.forEach(declaring, (file) => declaredIn({ root, file, skip }), {\n concurrency: READ_CONCURRENCY,\n });\n return pipe(\n Arr.flatten(found),\n Arr.filter((file) => Arr.contains(listed, file)),\n Arr.dedupe,\n );\n});\n\nexport const deployEntries = Effect.fn(\"deployEntries\")(function* deployEntries(root: string) {\n return yield* entriesOutside(root, skipNothing);\n});\n\nexport const bundledEntries = Effect.fn(\"bundledEntries\")(function* bundledEntries(root: string) {\n return yield* entriesOutside(root, isFrameworkSite);\n});\n","import { 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 } from \"effect\";\n\nimport { LockfileUnreadable } from \"./lockfile-unreadable.ts\";\n\nexport type WantedLockfile = NonNullable<Awaited<ReturnType<typeof readWantedLockfile>>>;\n\n/** @internal */\nexport const wantedLockfile = (\n root: string,\n): Effect.Effect<Option.Option<WantedLockfile>, LockfileUnreadable> =>\n Effect.tryPromise({\n try: () => readWantedLockfile(root, { ignoreIncompatible: false }),\n catch: (cause) => LockfileUnreadable.make({ root, reason: String(cause) }),\n }).pipe(Effect.map(Option.fromNullishOr));\n\n/** @internal */\nexport const lockedPackages = (\n root: string,\n): Effect.Effect<Option.Option<readonly string[]>, LockfileUnreadable> =>\n wantedLockfile(root).pipe(\n Effect.map(Option.flatMap(({ packages }) => Option.fromUndefinedOr(packages))),\n Effect.map(Option.map(Rec.keys)),\n );\n","import { refToRelative } from \"@pnpm/deps.path\";\nimport { Array as Arr, Effect, Option, Record as Rec, pipe } from \"effect\";\n\nimport { wantedLockfile } from \"./locked-packages.ts\";\nimport type { WantedLockfile } from \"./locked-packages.ts\";\nimport type { LockfileUnreadable } from \"./lockfile-unreadable.ts\";\n\nexport interface LockedNode {\n readonly id: string;\n readonly dependencies: readonly string[];\n}\n\nconst MANIFEST = \"package.json\";\nconst ROOT_IMPORTER = \".\";\n\ntype ProjectSnapshot = WantedLockfile[\"importers\"][keyof WantedLockfile[\"importers\"]];\n\ntype ResolvedSections = Readonly<\n Partial<Pick<ProjectSnapshot, \"dependencies\" | \"devDependencies\" | \"optionalDependencies\">>\n>;\n\nexport type ResolvedDependencies = Readonly<\n NonNullable<WantedLockfile[\"importers\"][keyof WantedLockfile[\"importers\"]][\"dependencies\"]>\n>;\n\ninterface LockedSnapshots<Importer extends string, Package extends string> {\n readonly importers: Readonly<Record<Importer, ResolvedSections>>;\n readonly packages?: Readonly<Record<Package, ResolvedSections>> | undefined;\n}\n\nconst importerManifest = (id: string): string =>\n Option.match(\n Option.liftPredicate(id, (found) => found === ROOT_IMPORTER),\n {\n onNone: () => `${id}/${MANIFEST}`,\n onSome: () => MANIFEST,\n },\n );\n\nexport const depPathsOf = (resolved: ResolvedDependencies | undefined): readonly string[] =>\n pipe(\n Rec.toEntries(resolved ?? {}),\n Arr.flatMap(([name, reference]) =>\n Option.toArray(Option.fromNullishOr(refToRelative(reference, name))),\n ),\n );\n\nconst nodesOf = <Importer extends string, Package extends string>(\n lockfile: LockedSnapshots<Importer, Package>,\n): readonly LockedNode[] => [\n ...pipe(\n Rec.toEntries(lockfile.importers),\n Arr.map(([id, project]) => ({\n id: importerManifest(id),\n dependencies: [\n ...depPathsOf(project.dependencies),\n ...depPathsOf(project.devDependencies),\n ...depPathsOf(project.optionalDependencies),\n ],\n })),\n ),\n ...pipe(\n Option.match(Option.fromUndefinedOr(lockfile.packages), {\n onNone: (): readonly (readonly [Package, ResolvedSections])[] => [],\n onSome: Rec.toEntries,\n }),\n Arr.map(([id, snapshot]) => ({\n id,\n dependencies: [\n ...depPathsOf(snapshot.dependencies),\n ...depPathsOf(snapshot.optionalDependencies),\n ],\n })),\n ),\n];\n\n/** @internal */\nexport const lockedGraph = (\n root: string,\n): Effect.Effect<Option.Option<readonly LockedNode[]>, LockfileUnreadable> =>\n wantedLockfile(root).pipe(Effect.map(Option.map(nodesOf)));\n","import { Array as Arr, Effect, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport type { ResolvedDependencies } from \"./locked-graph.ts\";\nimport { wantedLockfile } from \"./locked-packages.ts\";\n\nconst LINK = \"link:\";\n\nexport interface WorkspaceLink {\n readonly from: string;\n readonly to: string;\n}\n\nexport const linkedPaths = (\n sections: readonly (ResolvedDependencies | undefined)[],\n): readonly string[] =>\n pipe(\n sections,\n Arr.flatMap((resolved) => Rec.values(resolved ?? {})),\n Arr.filter(Str.startsWith(LINK)),\n Arr.map((reference) => Str.slice(LINK.length)(reference)),\n );\n\n/** @internal */\nexport const workspaceLinks = Effect.fn(\"workspaceLinks\")(function* workspaceLinks(root: string) {\n const files = yield* RepositoryFiles;\n const lockfile = yield* wantedLockfile(root);\n const linksOf = (id: string, paths: readonly string[]): readonly WorkspaceLink[] => {\n const from = files.relative(root, files.join(root, id));\n return pipe(\n paths,\n Arr.map((path): WorkspaceLink => ({\n from,\n to: files.relative(root, files.join(root, id, path)),\n })),\n );\n };\n return pipe(\n lockfile,\n Option.map(({ importers }) =>\n pipe(\n Rec.toEntries(importers),\n Arr.flatMap(([id, project]) =>\n linksOf(\n id,\n linkedPaths([\n project.dependencies,\n project.devDependencies,\n project.optionalDependencies,\n ]),\n ),\n ),\n ),\n ),\n Option.getOrElse((): readonly WorkspaceLink[] => []),\n );\n});\n","import { baseName } from \"@masseater.dev/path-kit\";\nimport {\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 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\nexport const isBinEntry = ({ label }: PublicEntry): boolean =>\n Str.startsWith(`${BIN_LABEL} `)(label);\n\nexport const 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\nexport const entryNameOf = (target: string): string => Str.replace(BUILT, \"\")(baseName(target));\n\nconst sourceOf =\n ({ join, packEntries }: EntryLookup) =>\n (target: string): Option.Option<string> => {\n if (SOURCE.test(target) && !Str.includes(DECLARATION)(target)) {\n return Option.some(join(target));\n }\n const name = entryNameOf(target);\n return pipe(\n packEntries,\n Arr.findFirst((entry) => entry.name === name),\n Option.map((entry) => entry.source),\n );\n };\n\nexport const publicEntriesOf = (lookup: EntryLookup): readonly PublicEntry[] =>\n pipe(\n [...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 AlwaysBundle = Schema.Array(Schema.String);\nconst PackDeps = Schema.Struct({ alwaysBundle: Schema.optional(AlwaysBundle) });\nconst PackSettings = Schema.Struct({\n entry: Schema.optional(PackEntry),\n deps: Schema.optional(PackDeps),\n});\nconst PackList = Schema.Union([PackSettings, Schema.Array(PackSettings)]);\nconst isEntryList = Schema.is(Schema.Array(Schema.String));\nconst PackConfig = Schema.Struct({ pack: Schema.optional(PackList) });\nconst BudgetConfig = Schema.Struct({\n msch: Schema.Struct({ publish: Schema.Struct({ installSize: SizeText }) }),\n});\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 PackedWorkspace {\n readonly directory: string;\n readonly configFile: string;\n readonly packEntries: readonly PackEntrySource[];\n readonly alwaysBundle: readonly string[];\n}\n\nexport interface PublishedWorkspace extends PackedWorkspace {\n readonly installSize: string;\n readonly installBudget: number;\n}\n\nconst bytesPer = (unit: string): number =>\n pipe(\n UNIT_BYTES,\n Arr.findFirst(([name]) => name === unit),\n Option.map(([, bytes]) => bytes),\n Option.getOrElse(() => Number.NaN),\n );\n\nconst nameOf = (source: string): string =>\n pipe(\n Str.split(source, SEPARATOR),\n Arr.last,\n Option.getOrElse(() => source),\n Str.replace(SOURCE_EXTENSION, \"\"),\n );\n\nexport const entriesOf = (entry: typeof PackEntry.Type): readonly PackEntrySource[] => {\n if (Predicate.isString(entry)) {\n return [{ name: nameOf(entry), source: entry }];\n }\n if (isEntryList(entry)) {\n return pipe(\n entry,\n Arr.map((source) => ({ name: nameOf(source), source })),\n );\n }\n return pipe(\n Rec.toEntries(entry),\n Arr.map(([name, source]) => ({ name, source })),\n );\n};\n\nconst packSettingsOf = (pack: typeof PackConfig.Type.pack): readonly (typeof PackSettings.Type)[] =>\n pipe(\n Option.fromUndefinedOr(pack),\n Option.map(Arr.ensure),\n Option.getOrElse((): readonly (typeof PackSettings.Type)[] => []),\n );\n\nconst packEntriesOf = (pack: typeof PackConfig.Type.pack): readonly PackEntrySource[] =>\n pipe(\n packSettingsOf(pack),\n Arr.flatMap((setting) =>\n pipe(\n Option.fromUndefinedOr(setting.entry),\n Option.match({ onNone: () => [], onSome: entriesOf }),\n ),\n ),\n );\n\nconst alwaysBundleOf = (pack: typeof PackConfig.Type.pack): readonly string[] =>\n pipe(\n packSettingsOf(pack),\n Arr.flatMap((setting) =>\n pipe(\n Option.fromUndefinedOr(setting.deps),\n Option.flatMap((deps) => Option.fromUndefinedOr(deps.alwaysBundle)),\n Option.getOrElse((): readonly string[] => []),\n ),\n ),\n Arr.dedupe,\n );\n\nconst settingsIn = Effect.fn(\"settingsIn\")(function* settingsIn(file: string) {\n const config = yield* Effect.tryPromise({\n try: () => resolveConfigFromFile(file),\n catch: () => WorkspaceConfigUnreadable.make({ file }),\n }).pipe(Effect.option);\n return config;\n});\n\nconst isPublicPackage = Effect.fn(\"isPublicPackage\")(function* isPublicPackage(directory: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(directory, MANIFEST_FILE));\n return Option.exists(text, (found) =>\n Option.isSome(Schema.decodeOption(Schema.fromJsonString(PublicManifest))(found)),\n );\n});\n\nconst packedWorkspaceOf =\n (directory: string, configFile: string, join: (source: string) => string) =>\n ({ pack }: typeof PackConfig.Type): PackedWorkspace => ({\n directory,\n configFile,\n packEntries: pipe(\n packEntriesOf(pack),\n Arr.map((entry) => ({ name: entry.name, source: join(entry.source) })),\n ),\n alwaysBundle: alwaysBundleOf(pack),\n });\n\nconst budgetOf = ({\n msch,\n}: typeof BudgetConfig.Type): Pick<PublishedWorkspace, \"installSize\" | \"installBudget\"> => {\n const [amount, , unit] = msch.publish.installSize;\n return { installSize: `${amount} ${unit}`, installBudget: amount * bytesPer(unit) };\n};\n\nconst packedIn = Effect.fn(\"packedIn\")(function* packedIn(root: string, configName: string) {\n const files = yield* RepositoryFiles;\n const configFile = files.join(root, configName);\n const directory = files.dirname(configFile);\n const isPublic = yield* isPublicPackage(directory);\n if (!isPublic) {\n return Option.none<readonly [PackedWorkspace, unknown]>();\n }\n const config = yield* settingsIn(configFile);\n return pipe(\n config,\n Option.flatMap((found) =>\n pipe(\n Schema.decodeUnknownOption(PackConfig)(found),\n Option.map(\n packedWorkspaceOf(directory, configFile, (source) => files.join(directory, source)),\n ),\n Option.map((workspace) => [workspace, found] as const),\n ),\n ),\n );\n});\n\nconst packedPairs = Effect.fn(\"packedPairs\")(function* packedPairs(root: string) {\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) => packedIn(root, name), {\n concurrency: READ_CONCURRENCY,\n });\n return Arr.getSomes(found);\n});\n\n/** @internal */\nexport const packedWorkspaces = Effect.fn(\"packedWorkspaces\")(function* packedWorkspaces(\n root: string,\n) {\n const pairs = yield* packedPairs(root);\n return pipe(\n pairs,\n Arr.map(([workspace]) => workspace),\n );\n});\n\n/** @internal */\nexport const publishedWorkspaces = Effect.fn(\"publishedWorkspaces\")(function* publishedWorkspaces(\n root: string,\n) {\n const pairs = yield* packedPairs(root);\n return pipe(\n pairs,\n Arr.flatMap(([workspace, config]) =>\n pipe(\n Schema.decodeUnknownOption(BudgetConfig)(config),\n Option.map((budget): PublishedWorkspace => ({ ...workspace, ...budgetOf(budget) })),\n Option.toArray,\n ),\n ),\n );\n});\n"],"mappings":";;;;;;;;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;EAC9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,SAAS,CAAC,CAAC,IAAI,CAAC,CAC5F;CACA,MAAM,QAAQ,OAAO,OAAO,QAAQ,UAAU,SAAS,SAAS,MAAM,IAAI,GAAG,EAC3E,aAAa,iBACf,CAAC;CACD,OAAOD,MAAI,SAAS,KAAK;AAC3B,CAAC;;AAGD,MAAa,mBAAmB,OAAO,GAAG,kBAAkB,CAAC,CAAC,UAAU,iBACtE,MACA;CACA,MAAM,QAAQ,OAAO,YAAY,IAAI;CACrC,OAAO,KACL,OACAA,MAAI,KAAK,CAAC,eAAe,SAAS,CACpC;AACF,CAAC;;AAGD,MAAa,sBAAsB,OAAO,GAAG,qBAAqB,CAAC,CAAC,UAAU,oBAC5E,MACA;CACA,MAAM,QAAQ,OAAO,YAAY,IAAI;CACrC,OAAO,KACL,OACAA,MAAI,SAAS,CAAC,WAAW,YACvB,KACE,OAAO,oBAAoB,YAAY,CAAC,CAAC,MAAM,GAC/C,OAAO,KAAK,YAAgC;EAAE,GAAG;EAAW,GAAG,SAAS,MAAM;CAAE,EAAE,GAClF,OAAO,OACT,CACF,CACF;AACF,CAAC"}
|
|
@@ -45,7 +45,8 @@ const resolvedSymbol = (checker) => (symbol) => {
|
|
|
45
45
|
if (!pipe(declarationsOf(symbol), Array.some((declaration) => isAliasDeclaration(declaration)))) return symbol;
|
|
46
46
|
return checker.getAliasedSymbol(symbol);
|
|
47
47
|
};
|
|
48
|
-
const
|
|
48
|
+
const symbolAtLocation = (checker) => (node) => Option.fromUndefinedOr(checker.getSymbolAtLocation(node));
|
|
49
|
+
const symbolAt = (checker) => (node) => symbolAtLocation(checker)(node).pipe(Option.map(resolvedSymbol(checker)));
|
|
49
50
|
const referencedSymbols = (checker) => (node) => {
|
|
50
51
|
const identifiers = pipe(Array.prepend(descendantsOf(node), node), Array.filter((candidate) => isIdentifier(candidate)));
|
|
51
52
|
const symbols = pipe(checker.getSymbolAtLocation(identifiers), Array.flatMap((symbol) => Option.toArray(Option.fromUndefinedOr(symbol))), Array.map(resolvedSymbol(checker)));
|
|
@@ -77,6 +78,6 @@ const moduleSpecifierOf = (statement) => {
|
|
|
77
78
|
return Option.fromUndefinedOr(statement.moduleSpecifier).pipe(Option.filter((specifier) => isStringLiteral(specifier)), Option.map((specifier) => specifier.text));
|
|
78
79
|
};
|
|
79
80
|
const importedModulesOf = (sourceFile) => pipe(sourceFile.statements, Array.map((statement) => moduleSpecifierOf(statement)), Array.getSomes);
|
|
80
|
-
export {
|
|
81
|
+
export { isPropertyAccessExpression as $, getNameOfDeclaration as A, isExportDeclaration as B, IndexKind as C, SyntaxKind as D, SymbolFlags$1 as E, isBlock as F, isImportDeclaration as G, isFunctionDeclaration as H, isCallExpression as I, isModuleDeclaration as J, isInterfaceDeclaration as K, isClassDeclaration as L, isArrayLiteralExpression as M, isArrowFunction as N, getJSDocTags as O, isBinaryExpression as P, isParenthesizedExpression as Q, isElementAccessExpression as R, API as S, SignatureKind as T, isFunctionExpression as U, isExpressionStatement as V, isIdentifier as W, isNumericLiteral as X, isNewExpression as Y, isObjectLiteralExpression as Z, referencedSymbols as _, declarationsOf as a, isSpreadElement as at, symbolAtLocation as b, importedModulesOf as c, isTypeLiteralNode as ct, isInsideAny as d, isVariableDeclaration as dt, isPropertyAssignment as et, isOutsideDeclaration as f, isVariableDeclarationList as ft, propertyNamesOf as g, packageOf as h, contains as i, isSourceFile as it, getTextOfJSDocComment as j, getLeadingCommentRanges as k, isExternalDeclaration as l, isTypeReferenceNode as lt, lineOf as m, childrenOf as n, isSatisfiesExpression as nt, declaresAType as o, isStringLiteral as ot, isTypeDeclaration as p, isVariableStatement as pt, isModuleBlock as q, columnOf as r, isSignatureDeclaration as rt, descendantsOf as s, isTypeAliasDeclaration as st, carriesTag as t, isReturnStatement as tt, isGenericDeclaration as u, isUnionTypeNode as ut, resolvedSymbol as v, InternalSymbolName as w, uniqueByReference as x, symbolAt as y, isEnumDeclaration as z };
|
|
81
82
|
|
|
82
|
-
//# sourceMappingURL=syntax-
|
|
83
|
+
//# sourceMappingURL=syntax-C0ddqOHc.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syntax-C0ddqOHc.mjs","names":["Arr","Str"],"sources":["../src/shared/lib/syntax.ts"],"sourcesContent":["import { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nimport {\n isClassDeclaration,\n isEnumDeclaration,\n isExportAssignment,\n isExportDeclaration,\n isIdentifier,\n isImportDeclaration,\n isInterfaceDeclaration,\n isLiteralTypeNode,\n isPropertyAccessExpression,\n isPropertyDeclaration,\n isPropertySignatureDeclaration,\n isStringLiteral,\n isTypeAliasDeclaration,\n isTypeLiteralNode,\n SyntaxKind,\n} from \"./compiler.ts\";\nimport type {\n Checker,\n Declaration,\n EnumDeclaration,\n Expression,\n InterfaceDeclaration,\n Node,\n Program,\n SourceFile,\n TypeSymbol,\n Type,\n TypeAliasDeclaration,\n} from \"./compiler.ts\";\nimport { NODE_MODULES } from \"./repository-files.ts\";\n\nconst NODE_MODULES_SEGMENT = `/${NODE_MODULES}/`;\n\nexport const POSITION_BASE = 1;\n\nexport const uniqueByReference = <Item>(items: readonly Item[]): readonly Item[] =>\n Arr.dedupeWith(items, (left, right) => left === right);\n\nexport const childrenOf = (node: Node): readonly Node[] => {\n const children: Node[] = [];\n node.forEachChild((child) => {\n children.push(child);\n });\n return children;\n};\n\nconst SCOPE_PREFIX = \"@\";\nconst SCOPED_SEGMENTS = 2;\nconst UNSCOPED_SEGMENTS = 1;\n\nexport const packageOf = (fileName: string): string => {\n const afterModules = pipe(\n fileName,\n Str.lastIndexOf(NODE_MODULES_SEGMENT),\n Option.match({\n onNone: () => fileName,\n onSome: (index) => Str.slice(index + NODE_MODULES_SEGMENT.length)(fileName),\n }),\n );\n const segments = Str.split(\"/\")(afterModules);\n if (Str.startsWith(SCOPE_PREFIX)(afterModules)) {\n return pipe(Arr.take(segments, SCOPED_SEGMENTS), Arr.join(\"/\"));\n }\n return pipe(Arr.take(segments, UNSCOPED_SEGMENTS), Arr.join(\"/\"));\n};\n\nexport const descendantsOf = (node: Node): readonly Node[] =>\n pipe(\n childrenOf(node),\n Arr.flatMap((child) => Arr.prepend(descendantsOf(child), child)),\n );\n\nconst isExternalFile =\n (program: Program) =>\n (sourceFile: SourceFile): boolean =>\n !program.isSourceFileDefaultLibrary(sourceFile) &&\n (Str.includes(NODE_MODULES_SEGMENT)(sourceFile.fileName) ||\n program.isSourceFileFromExternalLibrary(sourceFile));\n\nexport const isExternalDeclaration =\n (program: Program) =>\n (declaration: Node): boolean =>\n isExternalFile(program)(declaration.getSourceFile());\n\nexport const isOutsideDeclaration =\n (program: Program) =>\n (declaration: Node): boolean =>\n program.isSourceFileDefaultLibrary(declaration.getSourceFile()) ||\n isExternalDeclaration(program)(declaration);\n\nconst ALIAS_KINDS: ReadonlySet<SyntaxKind> = new Set([\n SyntaxKind.ImportSpecifier,\n SyntaxKind.ImportClause,\n SyntaxKind.NamespaceImport,\n SyntaxKind.ExportSpecifier,\n SyntaxKind.ImportEqualsDeclaration,\n SyntaxKind.ExportAssignment,\n]);\n\nexport const declarationsOf = (symbol: TypeSymbol): readonly Declaration[] =>\n pipe(\n symbol.declarations,\n Arr.flatMap((handle) => Option.toArray(Option.fromUndefinedOr(handle.resolve()))),\n );\n\nconst isEntityName = (expression: Expression): boolean =>\n isIdentifier(expression) ||\n (isPropertyAccessExpression(expression) && isEntityName(expression.expression));\n\nconst aliasesAnEntity = (declaration: Node): boolean =>\n !isExportAssignment(declaration) || isEntityName(declaration.expression);\n\nconst isAliasDeclaration = (declaration: Node): boolean =>\n ALIAS_KINDS.has(declaration.kind) && aliasesAnEntity(declaration);\n\nexport const resolvedSymbol =\n (checker: Checker) =>\n (symbol: TypeSymbol): TypeSymbol => {\n if (\n !pipe(\n declarationsOf(symbol),\n Arr.some((declaration) => isAliasDeclaration(declaration)),\n )\n ) {\n return symbol;\n }\n return checker.getAliasedSymbol(symbol);\n };\n\nexport const symbolAtLocation =\n (checker: Checker) =>\n (node: Node): Option.Option<TypeSymbol> =>\n Option.fromUndefinedOr(checker.getSymbolAtLocation(node));\n\nexport const symbolAt =\n (checker: Checker) =>\n (node: Node): Option.Option<TypeSymbol> =>\n symbolAtLocation(checker)(node).pipe(Option.map(resolvedSymbol(checker)));\n\nexport const referencedSymbols =\n (checker: Checker) =>\n (node: Node): readonly TypeSymbol[] => {\n const identifiers = pipe(\n Arr.prepend(descendantsOf(node), node),\n Arr.filter((candidate) => isIdentifier(candidate)),\n );\n const symbols = pipe(\n checker.getSymbolAtLocation(identifiers),\n Arr.flatMap((symbol) => Option.toArray(Option.fromUndefinedOr(symbol))),\n Arr.map(resolvedSymbol(checker)),\n );\n return uniqueByReference(symbols);\n };\n\nexport const lineOf = (node: Node): number => {\n const sourceFile = node.getSourceFile();\n return sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + POSITION_BASE;\n};\n\nexport const columnOf = (node: Node): number => {\n const sourceFile = node.getSourceFile();\n return (\n sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).character + POSITION_BASE\n );\n};\n\nexport const contains =\n (outer: Node) =>\n (inner: Node): boolean =>\n outer.getSourceFile().fileName === inner.getSourceFile().fileName &&\n outer.getStart() <= inner.getStart() &&\n inner.getEnd() <= outer.getEnd();\n\nexport const isInsideAny =\n (outers: readonly Node[]) =>\n (node: Node): boolean =>\n pipe(\n outers,\n Arr.some((outer) => contains(outer)(node)),\n );\n\nexport const isTypeDeclaration = (\n declaration: Node,\n): declaration is TypeAliasDeclaration | InterfaceDeclaration | EnumDeclaration =>\n isTypeAliasDeclaration(declaration) ||\n isInterfaceDeclaration(declaration) ||\n isEnumDeclaration(declaration);\n\nconst membersOf = (declaration: Node): readonly Node[] => {\n if (isInterfaceDeclaration(declaration) || isClassDeclaration(declaration)) {\n return declaration.members;\n }\n if (isTypeAliasDeclaration(declaration) && isTypeLiteralNode(declaration.type)) {\n return declaration.type.members;\n }\n return [];\n};\n\nconst isTagNamed =\n (name: string) =>\n (member: Node): boolean =>\n (isPropertySignatureDeclaration(member) || isPropertyDeclaration(member)) &&\n pipe(\n Option.fromUndefinedOr(member.type),\n Option.exists(\n (type) =>\n isLiteralTypeNode(type) && isStringLiteral(type.literal) && type.literal.text === name,\n ),\n );\n\nexport const declaresAType = (declarations: readonly Node[]): boolean =>\n pipe(\n declarations,\n Arr.some((declaration) => isTypeDeclaration(declaration) || isClassDeclaration(declaration)),\n );\n\nexport const carriesTag =\n (name: string) =>\n (declarations: readonly Node[]): boolean =>\n pipe(declarations, Arr.flatMap(membersOf), Arr.some(isTagNamed(name)));\n\nexport const isGenericDeclaration = (declaration: Node): boolean =>\n (isTypeAliasDeclaration(declaration) || isInterfaceDeclaration(declaration)) &&\n Arr.isReadonlyArrayNonEmpty(declaration.typeParameters ?? []);\n\nexport const propertyNamesOf =\n (checker: Checker) =>\n (type: Type): readonly string[] =>\n pipe(\n checker.getPropertiesOfType(type),\n Arr.map((property) => property.name),\n );\n\nconst moduleSpecifierOf = (statement: Node): Option.Option<string> => {\n if (!isImportDeclaration(statement) && !isExportDeclaration(statement)) {\n return Option.none();\n }\n return Option.fromUndefinedOr(statement.moduleSpecifier).pipe(\n Option.filter((specifier) => isStringLiteral(specifier)),\n Option.map((specifier) => specifier.text),\n );\n};\n\nexport const importedModulesOf = (sourceFile: SourceFile): readonly string[] =>\n pipe(\n sourceFile.statements,\n Arr.map((statement) => moduleSpecifierOf(statement)),\n Arr.getSomes,\n );\n"],"mappings":";;;;;;AAkCA,MAAM,uBAAuB,IAAI,aAAa;AAI9C,MAAa,qBAA2B,UACtCA,MAAI,WAAW,QAAQ,MAAM,UAAU,SAAS,KAAK;AAEvD,MAAa,cAAc,SAAgC;CACzD,MAAM,WAAmB,CAAC;CAC1B,KAAK,cAAc,UAAU;EAC3B,SAAS,KAAK,KAAK;CACrB,CAAC;CACD,OAAO;AACT;AAEA,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,oBAAoB;AAE1B,MAAa,aAAa,aAA6B;CACrD,M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BAAqB,eAChC,KACE,WAAW,YACXA,MAAI,KAAK,cAAc,kBAAkB,SAAS,CAAC,GACnDA,MAAI,QACN"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Array, Option, String, pipe } from "effect";
|
|
2
|
+
// src/shared/lib/text-position.ts
|
|
3
|
+
const START = 0;
|
|
4
|
+
const FIRST_COLUMN = 1;
|
|
5
|
+
const positionOf = (source) => (index) => {
|
|
6
|
+
const before = pipe(source, String.slice(START, index), String.split("\n"));
|
|
7
|
+
return {
|
|
8
|
+
line: before.length,
|
|
9
|
+
column: pipe(Array.last(before), Option.match({
|
|
10
|
+
onNone: () => FIRST_COLUMN,
|
|
11
|
+
onSome: (last) => last.length + FIRST_COLUMN
|
|
12
|
+
}))
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export { positionOf as t };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=text-position-DrvZ7k2Y.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-position-DrvZ7k2Y.mjs","names":["Str","Arr"],"sources":["../src/shared/lib/text-position.ts"],"sourcesContent":["import { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nimport type { Problem } from \"./problem.ts\";\n\nconst START = 0;\nconst FIRST_COLUMN = 1;\n\nexport const positionOf =\n (source: string) =>\n (index: number): Pick<Problem, \"line\" | \"column\"> => {\n const before = pipe(source, Str.slice(START, index), Str.split(\"\\n\"));\n return {\n line: before.length,\n column: pipe(\n Arr.last(before),\n Option.match({ onNone: () => FIRST_COLUMN, onSome: (last) => last.length + FIRST_COLUMN }),\n ),\n };\n };\n"],"mappings":";;AAIA,MAAM,QAAQ;AACd,MAAM,eAAe;AAErB,MAAa,cACV,YACA,UAAoD;CACnD,MAAM,SAAS,KAAK,QAAQA,OAAI,MAAM,OAAO,KAAK,GAAGA,OAAI,MAAM,IAAI,CAAC;CACpE,OAAO;EACL,MAAM,OAAO;EACb,QAAQ,KACNC,MAAI,KAAK,MAAM,GACf,OAAO,MAAM;GAAE,cAAc;GAAc,SAAS,SAAS,KAAK,SAAS;EAAa,CAAC,CAC3F;CACF;AACF"}
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
import { a as groupOf, n as RepositoryFiles } from "./repository-files-B5sRbxlz.mjs";
|
|
2
|
+
import { t as positionOf } from "./text-position-DrvZ7k2Y.mjs";
|
|
2
3
|
import { Array, Config, Effect, HashMap, HashSet, Match, Option, Record, Schema, String as String$1, pipe } from "effect";
|
|
3
4
|
import { Parser, parseDocument } from "yaml";
|
|
4
5
|
import semver from "semver";
|
|
5
6
|
import { parseTOML } from "toml-eslint-parser";
|
|
6
7
|
import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http";
|
|
7
|
-
// src/shared/lib/text-position.ts
|
|
8
|
-
const START = 0;
|
|
9
|
-
const FIRST_COLUMN = 1;
|
|
10
|
-
const positionOf = (source) => (index) => {
|
|
11
|
-
const before = pipe(source, String$1.slice(START, index), String$1.split("\n"));
|
|
12
|
-
return {
|
|
13
|
-
line: before.length,
|
|
14
|
-
column: pipe(Array.last(before), Option.match({
|
|
15
|
-
onNone: () => FIRST_COLUMN,
|
|
16
|
-
onSome: (last) => last.length + FIRST_COLUMN
|
|
17
|
-
}))
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
8
|
// src/shared/lib/config-comments.ts
|
|
21
9
|
const isRecord = (value) => typeof value === "object" && value !== null;
|
|
22
10
|
const childrenOf = (value) => {
|
|
@@ -412,6 +400,6 @@ const upstreamExitsMet = Effect.fn("upstreamExitsMet")(function* upstreamExitsMe
|
|
|
412
400
|
}, { concurrency: 1 });
|
|
413
401
|
return Array.flatten(perFile);
|
|
414
402
|
});
|
|
415
|
-
export { workspaceDeviations as a, tomlSourceComments as c, cargoDeviations as i, yamlSourceComments as l, upstreamExitsMet as n, collectNodes as o, WORKSPACE_SECTIONS as r, isRecord as s, checkUpstreamExits as t
|
|
403
|
+
export { workspaceDeviations as a, tomlSourceComments as c, cargoDeviations as i, yamlSourceComments as l, upstreamExitsMet as n, collectNodes as o, WORKSPACE_SECTIONS as r, isRecord as s, checkUpstreamExits as t };
|
|
416
404
|
|
|
417
|
-
//# sourceMappingURL=upstream-exits-
|
|
405
|
+
//# sourceMappingURL=upstream-exits-DgkAyuu-.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upstream-exits-DgkAyuu-.mjs","names":["Arr","Rec","YamlParser","Str","Arr","Str","Arr","Arr","Rec","Str","Arr"],"sources":["../src/shared/lib/config-comments.ts","../src/features/check-upstream-exits/model/deviation-entries.ts","../src/features/check-upstream-exits/model/exit-condition.ts","../src/features/check-upstream-exits/model/met-exits.ts","../src/features/check-upstream-exits/model/upstream-exits.ts"],"sourcesContent":["import { Array as Arr, Record as Rec, String as Str, pipe } from \"effect\";\nimport { parseTOML } from \"toml-eslint-parser\";\nimport { Parser as YamlParser } from \"yaml\";\n\nexport interface SourceComment {\n readonly index: number;\n readonly text: string;\n}\n\nexport const isRecord = (value: unknown): value is Readonly<Record<string, unknown>> =>\n typeof value === \"object\" && value !== null;\n\nconst childrenOf = (value: unknown): readonly unknown[] => {\n if (Arr.isArray(value)) {\n return value;\n }\n if (isRecord(value)) {\n return Rec.values(value);\n }\n return [];\n};\n\nexport const collectNodes =\n <Item>(isItem: (value: unknown) => value is Item) =>\n (value: unknown): readonly Item[] => {\n if (isItem(value)) {\n return [value];\n }\n return pipe(childrenOf(value), Arr.flatMap(collectNodes(isItem)));\n };\n\ninterface YamlSourceToken {\n readonly offset: number;\n readonly source: string;\n}\n\nconst isYamlComment = (value: unknown): value is YamlSourceToken =>\n isRecord(value) &&\n value[\"type\"] === \"comment\" &&\n typeof value[\"offset\"] === \"number\" &&\n typeof value[\"source\"] === \"string\";\n\nexport const yamlSourceComments = (source: string): readonly SourceComment[] =>\n pipe(\n Arr.fromIterable(new YamlParser().parse(source)),\n Arr.flatMap(collectNodes(isYamlComment)),\n Arr.map((token) => ({ index: token.offset, text: token.source })),\n );\n\nexport const tomlSourceComments = (source: string): readonly SourceComment[] =>\n pipe(\n parseTOML(source).comments,\n Arr.map(({ range: [start, end] }) => ({\n index: start,\n text: Str.slice(start, end)(source),\n })),\n );\n","import { Array as Arr, HashMap, Option, Schema, pipe } from \"effect\";\nimport { parseTOML } from \"toml-eslint-parser\";\nimport { parseDocument } from \"yaml\";\n\nimport { tomlSourceComments, yamlSourceComments } from \"#/shared/lib/config-comments.ts\";\nimport type { SourceComment } from \"#/shared/lib/config-comments.ts\";\nimport { positionOf } from \"#/shared/lib/text-position.ts\";\n\nexport const WORKSPACE_SECTIONS = [\n \"overrides\",\n \"patchedDependencies\",\n \"packageExtensions\",\n] as const;\nconst CARGO_PATCH = \"patch\";\nconst KEY_SEPARATOR = \".\";\nconst PATCH_SOURCE_DEPTH = 2;\n\nexport type Section = (typeof WORKSPACE_SECTIONS)[number] | typeof CARGO_PATCH;\n\nexport interface DeviationEntry {\n readonly section: Section;\n readonly key: string;\n readonly index: number;\n readonly line: number;\n}\n\nexport interface LineComment extends SourceComment {\n readonly line: number;\n}\n\nexport interface Deviations {\n readonly entries: readonly DeviationEntry[];\n readonly comments: readonly LineComment[];\n}\n\nconst NONE: Deviations = { entries: [], comments: [] };\n\nconst KeyValue = Schema.Union([Schema.String, Schema.Finite]);\nconst Positions = Schema.Array(Schema.Finite);\nconst YamlKey = Schema.Struct({ value: KeyValue, range: Positions });\nconst YamlMap = Schema.Struct({ items: Schema.Array(Schema.Struct({ key: YamlKey })) });\n\nconst KeyPart = Schema.Union([\n Schema.Struct({ type: Schema.Literal(\"TOMLBare\"), name: Schema.String }),\n Schema.Struct({ type: Schema.Literal(\"TOMLQuoted\"), value: Schema.String }),\n]);\nconst Located = {\n range: Schema.Array(Schema.Finite),\n loc: Schema.Struct({ start: Schema.Struct({ line: Schema.Finite }) }),\n};\nconst TomlKeyValue = Schema.Struct({\n ...Located,\n type: Schema.Literal(\"TOMLKeyValue\"),\n key: Schema.Struct({ keys: Schema.Array(KeyPart) }),\n});\nconst TomlTable = Schema.Struct({\n ...Located,\n type: Schema.Literal(\"TOMLTable\"),\n resolvedKey: Schema.Array(Schema.Union([Schema.String, Schema.Finite])),\n body: Schema.Array(TomlKeyValue),\n});\nconst TomlNode = Schema.Union([TomlTable, TomlKeyValue]);\nconst TomlTop = Schema.Array(Schema.Struct({ body: Schema.Array(TomlNode) }));\n\ntype TomlTableType = typeof TomlTable.Type;\ntype KeyPartType = typeof KeyPart.Type;\n\nconst decodeYamlMap = Schema.decodeUnknownOption(YamlMap);\nconst decodeTomlTop = Schema.decodeUnknownOption(TomlTop);\nconst FIRST = 0;\n\nconst lineComments = (source: string, comments: readonly SourceComment[]): readonly LineComment[] =>\n pipe(\n comments,\n Arr.map((comment) => ({ ...comment, line: positionOf(source)(comment.index).line })),\n );\n\nconst startOf = (range: readonly number[]): number =>\n Option.getOrElse(Arr.get(range, FIRST), () => FIRST);\n\nconst sectionEntries =\n (source: string, sectionNode: (section: string) => unknown) =>\n (section: (typeof WORKSPACE_SECTIONS)[number]): readonly DeviationEntry[] =>\n pipe(\n decodeYamlMap(sectionNode(section)),\n Option.match({\n onNone: () => [],\n onSome: ({ items }) =>\n pipe(\n items,\n Arr.map(({ key }) => {\n const index = startOf(key.range);\n return {\n section,\n key: String(key.value),\n index,\n line: positionOf(source)(index).line,\n };\n }),\n ),\n }),\n );\n\nexport const workspaceDeviations = (source: string): Deviations => {\n const document = parseDocument(source);\n if (Arr.isReadonlyArrayNonEmpty(document.errors)) {\n return NONE;\n }\n const sectionNode = (section: string): unknown => document.get(section, true);\n return {\n entries: pipe(WORKSPACE_SECTIONS, Arr.flatMap(sectionEntries(source, sectionNode))),\n comments: lineComments(source, yamlSourceComments(source)),\n };\n};\n\nconst partName = (part: KeyPartType): string => {\n if (part.type === \"TOMLBare\") {\n return part.name;\n }\n return part.value;\n};\n\nconst patchEntries = (table: TomlTableType): readonly DeviationEntry[] => {\n const tableKey = pipe(table.resolvedKey, Arr.map(String));\n if (!Option.exists(Arr.get(tableKey, FIRST), (part) => part === CARGO_PATCH)) {\n return [];\n }\n if (tableKey.length > PATCH_SOURCE_DEPTH) {\n return [\n {\n section: CARGO_PATCH,\n key: Arr.join(tableKey, KEY_SEPARATOR),\n index: startOf(table.range),\n line: table.loc.start.line,\n },\n ];\n }\n return pipe(\n table.body,\n Arr.map((value) => ({\n section: CARGO_PATCH,\n key: Arr.join([...tableKey, ...pipe(value.key.keys, Arr.map(partName))], KEY_SEPARATOR),\n index: startOf(value.range),\n line: value.loc.start.line,\n })),\n );\n};\n\nconst isTable = (node: TomlTableType | typeof TomlKeyValue.Type): node is TomlTableType =>\n node.type === \"TOMLTable\";\n\nexport const cargoDeviations = (source: string): Deviations =>\n pipe(\n Option.liftThrowable(() => parseTOML(source).body)(),\n Option.flatMap(decodeTomlTop),\n Option.match({\n onNone: () => NONE,\n onSome: (tops) => ({\n entries: pipe(\n tops,\n Arr.flatMap(({ body }) => body),\n Arr.filter(isTable),\n Arr.flatMap(patchEntries),\n ),\n comments: lineComments(source, tomlSourceComments(source)),\n }),\n }),\n );\n\nexport const commentsByLine = (\n comments: readonly LineComment[],\n): HashMap.HashMap<number, LineComment> =>\n HashMap.fromIterable(\n pipe(\n comments,\n Arr.map((comment) => [comment.line, comment] as const),\n ),\n );\n","import { Array as Arr, Match, Option, String as Str, pipe } from \"effect\";\nimport semver from \"semver\";\n\nimport { groupOf } from \"#/shared/lib/match-groups.ts\";\n\nexport type Registry = \"npm\" | \"crate\";\nexport type Relation = \"drops\" | \"allows\" | \"requires\";\n\nexport interface Unused {\n readonly kind: \"unused\";\n}\n\nexport interface Published {\n readonly kind: \"published\";\n readonly registry: Registry;\n readonly name: string;\n readonly range: string;\n}\n\nexport interface Declares {\n readonly kind: \"declares\";\n readonly registry: Registry;\n readonly name: string;\n readonly relation: Relation;\n readonly dependency: string;\n readonly range: string;\n}\n\nexport interface Closed {\n readonly kind: \"closed\";\n readonly owner: string;\n readonly repo: string;\n readonly number: number;\n}\n\nexport type ExitCondition = Unused | Published | Declares | Closed;\n\nconst ALTERNATIVE = \" || \";\nconst UNUSED = \"unused\";\nconst ANY_RANGE = \"*\";\nconst EXIT_COMMENT = /^#?\\s*exit:\\s*(?<condition>.*?)\\s*$/u;\nconst PACKAGE = String.raw`(?:@[^\\s/@]+\\/)?[^\\s@]+`;\nconst REGISTRY_CONDITION = new RegExp(\n String.raw`^(?<registry>npm|crate):(?<name>${PACKAGE})(?:@(?<range>.+)| (?<relation>drops|allows|requires) (?<dependency>${PACKAGE})(?:@(?<dependencyRange>.+))?)$`,\n \"u\",\n);\nconst GITHUB_CONDITION = /^github:(?<owner>[\\w.-]+)\\/(?<repo>[\\w.-]+)#(?<number>[1-9]\\d*)$/u;\n\nexport const GRAMMAR =\n \"`unused`, `npm:<package>@<range>`, `npm:<package> drops <dependency>`, `npm:<package> allows <dependency>@<range>`, `npm:<package> requires <dependency>@<range>` (the same forms with `crate:`), or `github:<owner>/<repo>#<number>`, joined with ` || `\";\n\nconst isRegistry = (value: string): value is Registry => value === \"npm\" || value === \"crate\";\n\nconst isRelation = (value: string): value is Relation =>\n value === \"drops\" || value === \"allows\" || value === \"requires\";\n\nconst validRange = (range: string): Option.Option<string> =>\n Option.liftPredicate(range, (candidate) => semver.validRange(candidate) !== null);\n\ninterface Subject {\n readonly registry: Registry;\n readonly name: string;\n}\n\nconst declared = (subject: Subject, found: RegExpExecArray): Option.Option<ExitCondition> => {\n const relation = Option.filter(groupOf(\"relation\")(found), isRelation);\n const dependency = groupOf(\"dependency\")(found);\n const range = groupOf(\"dependencyRange\")(found);\n if (Option.isNone(relation) || Option.isNone(dependency)) {\n return Option.none();\n }\n const base = {\n kind: \"declares\",\n ...subject,\n relation: relation.value,\n dependency: dependency.value,\n } as const;\n if (relation.value === \"drops\") {\n return Option.match(range, {\n onNone: () => Option.some({ ...base, range: ANY_RANGE }),\n onSome: () => Option.none(),\n });\n }\n return pipe(\n range,\n Option.flatMap(validRange),\n Option.map((valid): ExitCondition => ({ ...base, range: valid })),\n );\n};\n\nconst registryCondition = (text: string): Option.Option<ExitCondition> => {\n const found = REGISTRY_CONDITION.exec(text);\n if (found === null) {\n return Option.none();\n }\n const subject = Option.all({\n registry: Option.filter(groupOf(\"registry\")(found), isRegistry),\n name: groupOf(\"name\")(found),\n });\n const range = groupOf(\"range\")(found);\n const conditionOf = (resolved: Subject): Option.Option<ExitCondition> =>\n Option.match(range, {\n onNone: () => declared(resolved, found),\n onSome: (published) =>\n Option.map(validRange(published), (valid): ExitCondition => ({\n kind: \"published\",\n ...resolved,\n range: valid,\n })),\n });\n return pipe(subject, Option.flatMap(conditionOf));\n};\n\nconst githubCondition = (text: string): Option.Option<ExitCondition> => {\n const found = GITHUB_CONDITION.exec(text);\n const issueNumber = pipe(groupOf(\"number\")(found), Option.map(Number));\n return pipe(\n Option.all({\n owner: groupOf(\"owner\")(found),\n repo: groupOf(\"repo\")(found),\n number: issueNumber,\n }),\n Option.map((issue): ExitCondition => ({ kind: \"closed\", ...issue })),\n );\n};\n\nconst alternativeOf = (text: string): Option.Option<ExitCondition> => {\n if (text === UNUSED) {\n return Option.some({ kind: \"unused\" });\n }\n return Option.orElse(registryCondition(text), () => githubCondition(text));\n};\n\nexport const parseCondition = (text: string): Option.Option<readonly ExitCondition[]> =>\n pipe(\n Str.split(text, ALTERNATIVE),\n Arr.map((alternative) => alternativeOf(Str.trim(alternative))),\n Option.all,\n );\n\nexport const exitTextOf = (comment: string): Option.Option<string> =>\n groupOf(\"condition\")(EXIT_COMMENT.exec(Str.trim(comment)));\n\nconst describeDeclares = (condition: Declares): string => {\n const subject = `${condition.registry}:${condition.name} ${condition.relation} ${condition.dependency}`;\n if (condition.relation === \"drops\") {\n return subject;\n }\n return `${subject}@${condition.range}`;\n};\n\nexport const describeCondition = (condition: ExitCondition): string =>\n Match.value(condition).pipe(\n Match.discriminatorsExhaustive(\"kind\")({\n unused: () => UNUSED,\n published: ({ registry, name, range }) => `${registry}:${name}@${range}`,\n declares: describeDeclares,\n closed: ({ owner, repo, number }) => `github:${owner}/${repo}#${String(number)}`,\n }),\n );\n\nexport const isUnused = (condition: ExitCondition): boolean => condition.kind === \"unused\";\n","import {\n Array as Arr,\n Config,\n Effect,\n HashMap,\n Match,\n Option,\n Record as Rec,\n Schema,\n String as Str,\n pipe,\n} from \"effect\";\nimport { HttpClient, HttpClientRequest, HttpClientResponse } from \"effect/http\";\nimport type { HttpClientError } from \"effect/http\";\nimport semver from \"semver\";\n\nimport { commentsByLine } from \"./deviation-entries.ts\";\nimport type { DeviationEntry, Deviations, Section } from \"./deviation-entries.ts\";\nimport { describeCondition, exitTextOf, parseCondition } from \"./exit-condition.ts\";\nimport type { Closed, Declares, ExitCondition, Published } from \"./exit-condition.ts\";\n\nconst NPM = \"https://registry.npmjs.org/\";\nconst CRATES = \"https://crates.io/api/v1/crates/\";\nconst GITHUB = \"https://api.github.com/repos/\";\nconst USER_AGENT = \"msch-exits (https://github.com/masseater/ecosystems/tree/main/libs/msch)\";\nconst LOOKUP_CONCURRENCY = 4;\nconst RANGE_OPTIONS = { includePrerelease: true } as const;\n\nconst DECLARING_SECTIONS = [\"optionalDependencies\", \"peerDependencies\", \"dependencies\"] as const;\nconst Dependencies = Schema.Record(Schema.String, Schema.String);\nconst NpmVersion = Schema.Record(Schema.String, Schema.Unknown);\nconst decodeDependencies = Schema.decodeUnknownOption(Dependencies);\nconst NpmPackument = Schema.Struct({\n \"dist-tags\": Schema.Struct({ latest: Schema.String }),\n versions: Schema.Record(Schema.String, NpmVersion),\n});\nconst Crate = Schema.Struct({\n crate: Schema.Struct({\n max_stable_version: Schema.NullOr(Schema.String),\n newest_version: Schema.String,\n }),\n versions: Schema.Array(Schema.Struct({ num: Schema.String, yanked: Schema.Boolean })),\n});\nconst CrateDependencies = Schema.Struct({\n dependencies: Schema.Array(Schema.Struct({ crate_id: Schema.String, req: Schema.String })),\n});\nconst Issue = Schema.Struct({ state: Schema.String });\n\ntype NpmVersionType = typeof NpmVersion.Type;\ntype LookupError = HttpClientError.HttpClientError | Schema.SchemaError;\n\n/** @internal */\nexport interface Release {\n readonly versions: readonly string[];\n readonly latestDependencies: Readonly<Record<string, string>>;\n}\n\n/** @internal */\nexport interface ExitEntry {\n readonly line: number;\n readonly section: Section;\n readonly key: string;\n readonly conditions: readonly ExitCondition[];\n}\n\n/** @internal */\nexport interface MetExit {\n readonly entry: ExitEntry;\n readonly condition: string;\n readonly outcome: \"met\" | \"unchecked\";\n}\n\ninterface Lookup {\n readonly url: string;\n readonly token: Option.Option<string>;\n}\n\nconst requestOf = ({ url, token }: Lookup): HttpClientRequest.HttpClientRequest => {\n const request = HttpClientRequest.get(url).pipe(\n HttpClientRequest.setHeader(\"user-agent\", USER_AGENT),\n HttpClientRequest.acceptJson,\n );\n return Option.match(token, {\n onNone: () => request,\n onSome: (value) => HttpClientRequest.bearerToken(value)(request),\n });\n};\n\nconst fetched = (\n lookup: Lookup,\n): Effect.Effect<\n HttpClientResponse.HttpClientResponse,\n HttpClientError.HttpClientError,\n HttpClient.HttpClient\n> =>\n HttpClient.HttpClient.pipe(\n Effect.flatMap((client) => HttpClient.filterStatusOk(client).execute(requestOf(lookup))),\n );\n\nconst publicLookup = (url: string): Lookup => ({ url, token: Option.none() });\n\nconst declaredBy = (version: NpmVersionType): Readonly<Record<string, string>> =>\n pipe(\n DECLARING_SECTIONS,\n Arr.flatMap((section) =>\n pipe(\n decodeDependencies(version[section]),\n Option.map(Rec.toEntries),\n Option.getOrElse((): readonly (readonly [string, string])[] => []),\n ),\n ),\n Rec.fromEntries,\n );\n\nconst npmRelease = (name: string): Effect.Effect<Release, LookupError, HttpClient.HttpClient> =>\n fetched(publicLookup(`${NPM}${Str.replace(\"/\", \"%2f\")(name)}`)).pipe(\n Effect.flatMap(HttpClientResponse.schemaBodyJson(NpmPackument)),\n Effect.map(({ \"dist-tags\": tags, versions }) => ({\n versions: Rec.keys(versions),\n latestDependencies: pipe(\n Rec.get(versions, tags.latest),\n Option.map(declaredBy),\n Option.getOrElse(() => ({})),\n ),\n })),\n );\n\nconst crateRelease = Effect.fn(\"crateRelease\")(function* lookupCrate(name: string) {\n const found = yield* fetched(publicLookup(`${CRATES}${name}`)).pipe(\n Effect.flatMap(HttpClientResponse.schemaBodyJson(Crate)),\n );\n const latest = found.crate.max_stable_version ?? found.crate.newest_version;\n const { dependencies } = yield* fetched(\n publicLookup(`${CRATES}${name}/${latest}/dependencies`),\n ).pipe(Effect.flatMap(HttpClientResponse.schemaBodyJson(CrateDependencies)));\n const release: Release = {\n versions: pipe(\n found.versions,\n Arr.filter(({ yanked }) => !yanked),\n Arr.map(({ num }) => num),\n ),\n latestDependencies: Rec.fromEntries(\n pipe(\n dependencies,\n Arr.map(({ crate_id: crateId, req }) => [crateId, req] as const),\n ),\n ),\n };\n return release;\n});\n\nconst releaseOf = (\n condition: Published | Declares,\n): Effect.Effect<Release, LookupError, HttpClient.HttpClient> => {\n if (condition.registry === \"npm\") {\n return npmRelease(condition.name);\n }\n return crateRelease(condition.name);\n};\n\nconst declaresMet =\n (release: Release) =>\n (condition: Declares): boolean => {\n const declared = Rec.get(release.latestDependencies, condition.dependency);\n if (condition.relation === \"drops\") {\n return Option.isNone(declared);\n }\n return Option.exists(declared, (range) => {\n if (semver.validRange(range) === null) {\n return false;\n }\n if (condition.relation === \"allows\") {\n return semver.intersects(range, condition.range, RANGE_OPTIONS);\n }\n return semver.subset(range, condition.range, RANGE_OPTIONS);\n });\n };\n\n/** @internal */\nexport const isMet =\n (release: Release) =>\n (condition: ExitCondition): boolean =>\n Match.value(condition).pipe(\n Match.discriminatorsExhaustive(\"kind\")({\n unused: () => false,\n closed: () => false,\n published: ({ range }) =>\n pipe(\n release.versions,\n Arr.some((version) => semver.satisfies(version, range)),\n ),\n declares: declaresMet(release),\n }),\n );\n\nconst issueClosed = Effect.fn(\"issueClosed\")(function* lookupIssue(condition: Closed) {\n const token = yield* Config.option(\n Config.String(\"GH_TOKEN\").pipe(Config.orElse(() => Config.String(\"GITHUB_TOKEN\"))),\n ).pipe(Effect.orElseSucceed(() => Option.none<string>()));\n const issue = yield* fetched({\n url: `${GITHUB}${condition.owner}/${condition.repo}/issues/${String(condition.number)}`,\n token,\n }).pipe(Effect.flatMap(HttpClientResponse.schemaBodyJson(Issue)));\n return issue.state === \"closed\";\n});\n\nconst conditionMet = (\n condition: ExitCondition,\n): Effect.Effect<boolean, LookupError, HttpClient.HttpClient> =>\n Match.value(condition).pipe(\n Match.discriminatorsExhaustive(\"kind\")({\n unused: () => Effect.succeed(false),\n closed: issueClosed,\n published: (published) =>\n Effect.map(releaseOf(published), (release) => isMet(release)(published)),\n declares: (declares) =>\n Effect.map(releaseOf(declares), (release) => isMet(release)(declares)),\n }),\n );\n\n/** @internal */\nexport const exitEntries = (deviations: Deviations): readonly ExitEntry[] => {\n const comments = commentsByLine(deviations.comments);\n const entryOf = ({ line, section, key }: DeviationEntry): readonly ExitEntry[] =>\n pipe(\n HashMap.get(comments, line),\n Option.flatMap(({ text }) => exitTextOf(text)),\n Option.flatMap(parseCondition),\n Option.map((conditions): ExitEntry => ({ line, section, key, conditions })),\n Option.toArray,\n );\n return pipe(deviations.entries, Arr.flatMap(entryOf));\n};\n\nconst metOf = (\n entry: ExitEntry,\n condition: ExitCondition,\n): Effect.Effect<Option.Option<MetExit>, never, HttpClient.HttpClient> => {\n const described = describeCondition(condition);\n return conditionMet(condition).pipe(\n Effect.match({\n onSuccess: (met) =>\n Option.liftPredicate({ entry, condition: described, outcome: \"met\" } as const, () => met),\n onFailure: (error) =>\n Option.some({\n entry,\n condition: `${described} (${String(error)})`,\n outcome: \"unchecked\",\n } as const),\n }),\n );\n};\n\n/** @internal */\nexport const metExits = Effect.fn(\"metExits\")(function* metExits(entries: readonly ExitEntry[]) {\n const checksOf = (entry: ExitEntry): readonly ReturnType<typeof metOf>[] =>\n pipe(\n entry.conditions,\n Arr.map((condition) => metOf(entry, condition)),\n );\n const checks = pipe(entries, Arr.flatMap(checksOf));\n const results = yield* Effect.all(checks, { concurrency: LOOKUP_CONCURRENCY });\n return Arr.getSomes(results);\n});\n","import { Array as Arr, Effect, HashMap, HashSet, Option, pipe } from \"effect\";\n\nimport type { Problem, RuleName } from \"#/shared/lib/problem.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\nimport { positionOf } from \"#/shared/lib/text-position.ts\";\n\nimport { cargoDeviations, commentsByLine, workspaceDeviations } from \"./deviation-entries.ts\";\nimport type { DeviationEntry, Deviations } from \"./deviation-entries.ts\";\nimport { GRAMMAR, exitTextOf, isUnused, parseCondition } from \"./exit-condition.ts\";\nimport { exitEntries, metExits } from \"./met-exits.ts\";\nimport type { ExitEntry, MetExit } from \"./met-exits.ts\";\n\nconst RULE: RuleName = \"upstream-exit\";\nconst ROOT_FILES = [\n { name: \"pnpm-workspace.yaml\", deviationsOf: workspaceDeviations },\n { name: \"Cargo.toml\", deviationsOf: cargoDeviations },\n] as const;\nconst REASON =\n \"Every deviation from an upstream package is temporary, and the comment says when to go back to the official package so that msch-exits can tell.\";\nconst STRAY =\n \"An exit condition belongs at the end of the line of an overrides, patchedDependencies, packageExtensions or [patch] entry. Move it there or delete it.\";\n\ninterface ReadFile {\n readonly file: string;\n readonly source: string;\n readonly deviations: Deviations;\n}\n\nconst problemAt =\n ({ file, source }: ReadFile) =>\n (index: number, message: string): Problem => ({\n file,\n ...positionOf(source)(index),\n rule: RULE,\n message,\n });\n\nconst messageFor = (\n entry: DeviationEntry,\n exitText: Option.Option<string>,\n): Option.Option<string> => {\n if (Option.isNone(exitText)) {\n return Option.some(\n `${entry.section} entry ${entry.key} has no exit condition. ${REASON} Add \\`# exit: <condition>\\` at the end of the line, where the condition is ${GRAMMAR}.`,\n );\n }\n const conditions = parseCondition(exitText.value);\n if (Option.isNone(conditions)) {\n return Option.some(\n `The exit condition \\`${exitText.value}\\` of ${entry.key} is not one msch-exits can check. Write ${GRAMMAR}.`,\n );\n }\n if (entry.section !== \"overrides\" && pipe(conditions.value, Arr.some(isUnused))) {\n return Option.some(\n `\\`unused\\` is checked only for overrides, by the unused-override and removable-override checks. Give ${entry.key} a condition on a release or an issue.`,\n );\n }\n return Option.none();\n};\n\nconst entryProblems = (read: ReadFile): readonly Problem[] => {\n const comments = commentsByLine(read.deviations.comments);\n return pipe(\n read.deviations.entries,\n Arr.flatMap((entry) => {\n const exitText = pipe(\n HashMap.get(comments, entry.line),\n Option.flatMap(({ text }) => exitTextOf(text)),\n );\n return pipe(\n messageFor(entry, exitText),\n Option.map((message) => problemAt(read)(entry.index, message)),\n Option.toArray,\n );\n }),\n );\n};\n\nconst strayProblems = (read: ReadFile): readonly Problem[] => {\n const entryLines = HashSet.fromIterable(\n pipe(\n read.deviations.entries,\n Arr.map(({ line }) => line),\n ),\n );\n return pipe(\n read.deviations.comments,\n Arr.filter(\n (comment) =>\n Option.isSome(exitTextOf(comment.text)) && !HashSet.has(entryLines, comment.line),\n ),\n Arr.map((comment) => problemAt(read)(comment.index, STRAY)),\n );\n};\n\nconst readRootFiles = Effect.fn(\"readRootFiles\")(function* readRootFiles(root: string) {\n const files = yield* RepositoryFiles;\n const read = yield* Effect.forEach(\n ROOT_FILES,\n ({ name, deviationsOf }) => {\n const file = files.join(root, name);\n return Effect.map(\n files.readFile(file),\n Option.map((source): ReadFile => ({ file, source, deviations: deviationsOf(source) })),\n );\n },\n { concurrency: \"unbounded\" },\n );\n return Arr.getSomes(read);\n});\n\n/** @internal */\nexport const checkUpstreamExits = Effect.fn(\"checkUpstreamExits\")(function* checkUpstreamExits(\n root: string,\n) {\n const read = yield* readRootFiles(root);\n return pipe(\n read,\n Arr.flatMap((file) => [...entryProblems(file), ...strayProblems(file)]),\n );\n});\n\n/** @internal */\nexport interface FileExit {\n readonly file: string;\n readonly met: MetExit;\n}\n\n/** @internal */\nexport const upstreamExitsMet = Effect.fn(\"upstreamExitsMet\")(function* upstreamExitsMet(\n root: string,\n) {\n const read = yield* readRootFiles(root);\n const perFile = yield* Effect.forEach(\n read,\n ({ file, deviations }) => {\n const entries: readonly ExitEntry[] = exitEntries(deviations);\n return Effect.map(\n metExits(entries),\n Arr.map((met): FileExit => ({ file, met })),\n );\n },\n { concurrency: 1 },\n );\n return Arr.flatten(perFile);\n});\n"],"mappings":";;;;;;;;AASA,MAAa,YAAY,UACvB,OAAO,UAAU,YAAY,UAAU;AAEzC,MAAM,cAAc,UAAuC;CACzD,IAAIA,MAAI,QAAQ,KAAK,GACnB,OAAO;CAET,IAAI,SAAS,KAAK,GAChB,OAAOC,OAAI,OAAO,KAAK;CAEzB,OAAO,CAAC;AACV;AAEA,MAAa,gBACJ,YACN,UAAoC;CACnC,IAAI,OAAO,KAAK,GACd,OAAO,CAAC,KAAK;CAEf,OAAO,KAAK,WAAW,KAAK,GAAGD,MAAI,QAAQ,aAAa,MAAM,CAAC,CAAC;AAClE;AAOF,MAAM,iBAAiB,UACrB,SAAS,KAAK,KACd,MAAM,YAAY,aAClB,OAAO,MAAM,cAAc,YAC3B,OAAO,MAAM,cAAc;AAE7B,MAAa,sBAAsB,WACjC,KACEA,MAAI,aAAa,IAAIE,OAAW,CAAC,CAAC,MAAM,MAAM,CAAC,GAC/CF,MAAI,QAAQ,aAAa,aAAa,CAAC,GACvCA,MAAI,KAAK,WAAW;CAAE,OAAO,MAAM;CAAQ,MAAM,MAAM;AAAO,EAAE,CAClE;AAEF,MAAa,sBAAsB,WACjC,KACE,UAAU,MAAM,CAAC,CAAC,UAClBA,MAAI,KAAK,EAAE,OAAO,CAAC,OAAO,YAAY;CACpC,OAAO;CACP,MAAMG,SAAI,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM;AACpC,EAAE,CACJ;;AChDF,MAAa,qBAAqB;CAChC;CACA;CACA;AACF;AACA,MAAM,cAAc;AACpB,MAAM,gBAAgB;AACtB,MAAM,qBAAqB;AAoB3B,MAAM,OAAmB;CAAE,SAAS,CAAC;CAAG,UAAU,CAAC;AAAE;AAErD,MAAM,WAAW,OAAO,MAAM,CAAC,OAAO,QAAQ,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,MAAI,KAAK,SAAmB;GAAE;GAAM;EAAI,EAAE,CAC5C;CACF,GACA,EAAE,aAAa,EAAE,CACnB;CACA,OAAOA,MAAI,QAAQ,OAAO;AAC5B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as workspaceDirectories, r as readManifest, t as MANIFEST_FILE } from "./dependencies-B6p7x90y.mjs";
|
|
2
|
-
import { A as programOf, D as testsItself, E as tasksOf, L as literalOf, M as usedFrom, O as literalSettings, R as nestedValues, _ as deployEntries, a as EntryManifestJson, b as prefixed, c as publicEntriesOf, f as depPathsOf, h as wantedLockfile, j as settingsInvalid, k as merged, n as entriesOf, t as PackEntry, u as linkedPaths, v as shadcnUiIn, x as NO_TASKS } from "./published-
|
|
2
|
+
import { A as programOf, D as testsItself, E as tasksOf, L as literalOf, M as usedFrom, O as literalSettings, R as nestedValues, _ as deployEntries, a as EntryManifestJson, b as prefixed, c as publicEntriesOf, f as depPathsOf, h as wantedLockfile, j as settingsInvalid, k as merged, n as entriesOf, t as PackEntry, u as linkedPaths, v as shadcnUiIn, x as NO_TASKS } from "./published-BIexKvdJ.mjs";
|
|
3
3
|
import { n as FINGERPRINT_FILE, r as LOCK_FILE, t as CLOSURE_FILE } from "./locked-closure-paths-Dtqs8uBU.mjs";
|
|
4
4
|
import { n as RepositoryFiles, r as nodeRepositoryFiles } from "./repository-files-B5sRbxlz.mjs";
|
|
5
5
|
import { i as reachable, r as ignoredDirectories, t as collectIgnoredDirectories } from "./ignored-directories-BgUqwuc4.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@r_masseater/msch",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.1",
|
|
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",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"msch": "./dist/cli.mjs",
|
|
23
23
|
"msch-changed": "./dist/changed.mjs",
|
|
24
24
|
"msch-exits": "./dist/exits.mjs",
|
|
25
|
+
"msch-fix": "./dist/fix.mjs",
|
|
25
26
|
"msch-publish": "./dist/publish.mjs",
|
|
26
27
|
"msch-wake": "./dist/wake.mjs"
|
|
27
28
|
},
|
|
@@ -131,7 +132,7 @@
|
|
|
131
132
|
"@r_masseater/github-workflow": "0.1.0",
|
|
132
133
|
"@r_masseater/node-main": "0.1.0",
|
|
133
134
|
"@r_masseater/vitest-otlp": "0.2.2",
|
|
134
|
-
"@types/node": "26.6.
|
|
135
|
+
"@types/node": "26.6.10",
|
|
135
136
|
"@types/semver": "7.8.0",
|
|
136
137
|
"effect": "4.1.5",
|
|
137
138
|
"oxlint": "1.95.0",
|
|
@@ -12,6 +12,7 @@ sources:
|
|
|
12
12
|
- bin/msch.ts
|
|
13
13
|
- src/app/**
|
|
14
14
|
- bin/msch-exits.ts
|
|
15
|
+
- bin/msch-fix.ts
|
|
15
16
|
---
|
|
16
17
|
|
|
17
18
|
# msch-checks
|
|
@@ -30,6 +31,15 @@ A task that runs msch therefore sets `cache: false`.
|
|
|
30
31
|
|
|
31
32
|
The lint preset `@r_masseater/msch/lint` reports the rest through `vp lint`, including the `msch-lint/*` rules.
|
|
32
33
|
|
|
34
|
+
## Fixing findings in bulk
|
|
35
|
+
|
|
36
|
+
When a new msch version adds checks, run `vp exec msch-fix` at the repository root in the same change that raises msch. It fixes the two findings that need no judgment and prints one line for each change:
|
|
37
|
+
|
|
38
|
+
- `uncataloged-dependency`: adds each version written in a `package.json` to the default catalog in `pnpm-workspace.yaml` and writes `catalog:` there. A dependency whose version differs from the catalog's is left alone and reported, because choosing the version is a decision.
|
|
39
|
+
- `prepublish-script`: rewrites a published package's `prepublishOnly` to the shared command. A package with no such script is reported and left to be added by hand.
|
|
40
|
+
|
|
41
|
+
Run `vp install` afterwards so the lockfile follows, then `vp exec msch` for what is left, such as `inline-script`.
|
|
42
|
+
|
|
33
43
|
## Upstream exits
|
|
34
44
|
|
|
35
45
|
Every overrides, patchedDependencies and packageExtensions entry in the root `pnpm-workspace.yaml` and every `[patch]` entry in the root `Cargo.toml` ends its line with `# exit: <condition>`. msch reports an entry without a condition it can check, and a deviation written anywhere else.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"syntax-CTiXR0EJ.mjs","names":["Arr","Str"],"sources":["../src/shared/lib/syntax.ts"],"sourcesContent":["import { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nimport {\n isClassDeclaration,\n isEnumDeclaration,\n isExportAssignment,\n isExportDeclaration,\n isIdentifier,\n isImportDeclaration,\n isInterfaceDeclaration,\n isLiteralTypeNode,\n isPropertyAccessExpression,\n isPropertyDeclaration,\n isPropertySignatureDeclaration,\n isStringLiteral,\n isTypeAliasDeclaration,\n isTypeLiteralNode,\n SyntaxKind,\n} from \"./compiler.ts\";\nimport type {\n Checker,\n Declaration,\n EnumDeclaration,\n Expression,\n InterfaceDeclaration,\n Node,\n Program,\n SourceFile,\n TypeSymbol,\n Type,\n TypeAliasDeclaration,\n} from \"./compiler.ts\";\nimport { NODE_MODULES } from \"./repository-files.ts\";\n\nconst NODE_MODULES_SEGMENT = `/${NODE_MODULES}/`;\n\nexport const POSITION_BASE = 1;\n\nexport const uniqueByReference = <Item>(items: readonly Item[]): readonly Item[] =>\n Arr.dedupeWith(items, (left, right) => left === right);\n\nexport const childrenOf = (node: Node): readonly Node[] => {\n const children: Node[] = [];\n node.forEachChild((child) => {\n children.push(child);\n });\n return children;\n};\n\nconst SCOPE_PREFIX = \"@\";\nconst SCOPED_SEGMENTS = 2;\nconst UNSCOPED_SEGMENTS = 1;\n\nexport const packageOf = (fileName: string): string => {\n const afterModules = pipe(\n fileName,\n Str.lastIndexOf(NODE_MODULES_SEGMENT),\n Option.match({\n onNone: () => fileName,\n onSome: (index) => Str.slice(index + NODE_MODULES_SEGMENT.length)(fileName),\n }),\n );\n const segments = Str.split(\"/\")(afterModules);\n if (Str.startsWith(SCOPE_PREFIX)(afterModules)) {\n return pipe(Arr.take(segments, SCOPED_SEGMENTS), Arr.join(\"/\"));\n }\n return pipe(Arr.take(segments, UNSCOPED_SEGMENTS), Arr.join(\"/\"));\n};\n\nexport const descendantsOf = (node: Node): readonly Node[] =>\n pipe(\n childrenOf(node),\n Arr.flatMap((child) => Arr.prepend(descendantsOf(child), child)),\n );\n\nconst isExternalFile =\n (program: Program) =>\n (sourceFile: SourceFile): boolean =>\n !program.isSourceFileDefaultLibrary(sourceFile) &&\n (Str.includes(NODE_MODULES_SEGMENT)(sourceFile.fileName) ||\n program.isSourceFileFromExternalLibrary(sourceFile));\n\nexport const isExternalDeclaration =\n (program: Program) =>\n (declaration: Node): boolean =>\n isExternalFile(program)(declaration.getSourceFile());\n\nexport const isOutsideDeclaration =\n (program: Program) =>\n (declaration: Node): boolean =>\n program.isSourceFileDefaultLibrary(declaration.getSourceFile()) ||\n isExternalDeclaration(program)(declaration);\n\nconst ALIAS_KINDS: ReadonlySet<SyntaxKind> = new Set([\n SyntaxKind.ImportSpecifier,\n SyntaxKind.ImportClause,\n SyntaxKind.NamespaceImport,\n SyntaxKind.ExportSpecifier,\n SyntaxKind.ImportEqualsDeclaration,\n SyntaxKind.ExportAssignment,\n]);\n\nexport const declarationsOf = (symbol: TypeSymbol): readonly Declaration[] =>\n pipe(\n symbol.declarations,\n Arr.flatMap((handle) => Option.toArray(Option.fromUndefinedOr(handle.resolve()))),\n );\n\nconst isEntityName = (expression: Expression): boolean =>\n isIdentifier(expression) ||\n (isPropertyAccessExpression(expression) && isEntityName(expression.expression));\n\nconst aliasesAnEntity = (declaration: Node): boolean =>\n !isExportAssignment(declaration) || isEntityName(declaration.expression);\n\nconst isAliasDeclaration = (declaration: Node): boolean =>\n ALIAS_KINDS.has(declaration.kind) && aliasesAnEntity(declaration);\n\nexport const resolvedSymbol =\n (checker: Checker) =>\n (symbol: TypeSymbol): TypeSymbol => {\n if (\n !pipe(\n declarationsOf(symbol),\n Arr.some((declaration) => isAliasDeclaration(declaration)),\n )\n ) {\n return symbol;\n }\n return checker.getAliasedSymbol(symbol);\n };\n\nexport const symbolAt =\n (checker: Checker) =>\n (node: Node): Option.Option<TypeSymbol> =>\n Option.fromUndefinedOr(checker.getSymbolAtLocation(node)).pipe(\n Option.map(resolvedSymbol(checker)),\n );\n\nexport const referencedSymbols =\n (checker: Checker) =>\n (node: Node): readonly TypeSymbol[] => {\n const identifiers = pipe(\n Arr.prepend(descendantsOf(node), node),\n Arr.filter((candidate) => isIdentifier(candidate)),\n );\n const symbols = pipe(\n checker.getSymbolAtLocation(identifiers),\n Arr.flatMap((symbol) => Option.toArray(Option.fromUndefinedOr(symbol))),\n Arr.map(resolvedSymbol(checker)),\n );\n return uniqueByReference(symbols);\n };\n\nexport const lineOf = (node: Node): number => {\n const sourceFile = node.getSourceFile();\n return sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + POSITION_BASE;\n};\n\nexport const columnOf = (node: Node): number => {\n const sourceFile = node.getSourceFile();\n return (\n sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).character + POSITION_BASE\n );\n};\n\nexport const contains =\n (outer: Node) =>\n (inner: Node): boolean =>\n outer.getSourceFile().fileName === inner.getSourceFile().fileName &&\n outer.getStart() <= inner.getStart() &&\n inner.getEnd() <= outer.getEnd();\n\nexport const isInsideAny =\n (outers: readonly Node[]) =>\n (node: Node): boolean =>\n pipe(\n outers,\n Arr.some((outer) => contains(outer)(node)),\n );\n\nexport const isTypeDeclaration = (\n declaration: Node,\n): declaration is TypeAliasDeclaration | InterfaceDeclaration | EnumDeclaration =>\n isTypeAliasDeclaration(declaration) ||\n isInterfaceDeclaration(declaration) ||\n isEnumDeclaration(declaration);\n\nconst membersOf = (declaration: Node): readonly Node[] => {\n if (isInterfaceDeclaration(declaration) || isClassDeclaration(declaration)) {\n return declaration.members;\n }\n if (isTypeAliasDeclaration(declaration) && isTypeLiteralNode(declaration.type)) {\n return declaration.type.members;\n }\n return [];\n};\n\nconst isTagNamed =\n (name: string) =>\n (member: Node): boolean =>\n (isPropertySignatureDeclaration(member) || isPropertyDeclaration(member)) &&\n pipe(\n Option.fromUndefinedOr(member.type),\n Option.exists(\n (type) =>\n isLiteralTypeNode(type) && isStringLiteral(type.literal) && type.literal.text === name,\n ),\n );\n\nexport const declaresAType = (declarations: readonly Node[]): boolean =>\n pipe(\n declarations,\n Arr.some((declaration) => isTypeDeclaration(declaration) || isClassDeclaration(declaration)),\n );\n\nexport const carriesTag =\n (name: string) =>\n (declarations: readonly Node[]): boolean =>\n pipe(declarations, Arr.flatMap(membersOf), Arr.some(isTagNamed(name)));\n\nexport const isGenericDeclaration = (declaration: Node): boolean =>\n (isTypeAliasDeclaration(declaration) || isInterfaceDeclaration(declaration)) &&\n Arr.isReadonlyArrayNonEmpty(declaration.typeParameters ?? []);\n\nexport const propertyNamesOf =\n (checker: Checker) =>\n (type: Type): readonly string[] =>\n pipe(\n checker.getPropertiesOfType(type),\n Arr.map((property) => property.name),\n );\n\nconst moduleSpecifierOf = (statement: Node): Option.Option<string> => {\n if (!isImportDeclaration(statement) && !isExportDeclaration(statement)) {\n return Option.none();\n }\n return Option.fromUndefinedOr(statement.moduleSpecifier).pipe(\n Option.filter((specifier) => isStringLiteral(specifier)),\n Option.map((specifier) => specifier.text),\n );\n};\n\nexport const importedModulesOf = (sourceFile: SourceFile): readonly string[] =>\n pipe(\n sourceFile.statements,\n Arr.map((statement) => moduleSpecifierOf(statement)),\n Arr.getSomes,\n );\n"],"mappings":";;;;;;AAkCA,MAAM,uBAAuB,IAAI,aAAa;AAI9C,MAAa,qBAA2B,UACtCA,MAAI,WAAW,QAAQ,MAAM,UAAU,SAAS,KAAK;AAEvD,MAAa,cAAc,SAAgC;CACzD,MAAM,WAAmB,CAAC;CAC1B,KAAK,cAAc,UAAU;EAC3B,SAAS,KAAK,KAAK;CACrB,CAAC;CACD,OAAO;AACT;AAEA,MAAM,eAAe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