@r_masseater/msch 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-contract-ChzTJ0Na.mjs","names":["Arr","Str","Arr"],"sources":["../src/syntax.ts","../src/problem.ts","../src/cli-contract.ts"],"sourcesContent":["import { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nimport {\n isEnumDeclaration,\n isExportDeclaration,\n isIdentifier,\n isImportDeclaration,\n isInterfaceDeclaration,\n isStringLiteral,\n isTypeAliasDeclaration,\n SyntaxKind,\n} from \"./compiler.ts\";\nimport type {\n Checker,\n Declaration,\n EnumDeclaration,\n InterfaceDeclaration,\n Node,\n Program,\n SourceFile,\n TypeSymbol,\n Type,\n TypeAliasDeclaration,\n} from \"./compiler.ts\";\nimport { NODE_MODULES } from \"./dependencies.ts\";\n\nconst NODE_MODULES_SEGMENT = `/${NODE_MODULES}/`;\n\nconst POSITION_BASE = 1;\n\nconst uniqueByReference = <Item>(items: readonly Item[]): readonly Item[] =>\n Arr.dedupeWith(items, (left, right) => left === right);\n\nconst childrenOf = (node: Node): readonly Node[] => {\n const children: Node[] = [];\n node.forEachChild((child) => {\n children.push(child);\n });\n return children;\n};\n\nconst 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 Str.includes(NODE_MODULES_SEGMENT)(sourceFile.fileName) ||\n program.isSourceFileFromExternalLibrary(sourceFile);\n\nconst isExternalDeclaration =\n (program: Program) =>\n (declaration: Node): boolean =>\n isExternalFile(program)(declaration.getSourceFile());\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\nconst declarationsOf = (symbol: TypeSymbol): readonly Declaration[] =>\n pipe(\n symbol.declarations,\n Arr.flatMap((handle) => Option.toArray(Option.fromUndefinedOr(handle.resolve()))),\n );\n\nconst isAliasDeclaration = (declaration: Node): boolean => ALIAS_KINDS.has(declaration.kind);\n\nconst 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\nconst symbolAt =\n (checker: Checker) =>\n (node: Node): Option.Option<TypeSymbol> =>\n Option.fromUndefinedOr(checker.getSymbolAtLocation(node)).pipe(\n Option.map(resolvedSymbol(checker)),\n );\n\nconst 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\nconst lineOf = (node: Node): number => {\n const sourceFile = node.getSourceFile();\n return sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + POSITION_BASE;\n};\n\nconst columnOf = (node: Node): number => {\n const sourceFile = node.getSourceFile();\n return (\n sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).character + POSITION_BASE\n );\n};\n\nconst 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\nconst isTypeDeclaration = (\n declaration: Node,\n): declaration is TypeAliasDeclaration | InterfaceDeclaration | EnumDeclaration =>\n isTypeAliasDeclaration(declaration) ||\n isInterfaceDeclaration(declaration) ||\n isEnumDeclaration(declaration);\n\nconst isGenericDeclaration = (declaration: Node): boolean =>\n (isTypeAliasDeclaration(declaration) || isInterfaceDeclaration(declaration)) &&\n Arr.isReadonlyArrayNonEmpty(declaration.typeParameters ?? []);\n\nconst 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\nconst importedModulesOf = (sourceFile: SourceFile): readonly string[] =>\n pipe(\n sourceFile.statements,\n Arr.map((statement) => moduleSpecifierOf(statement)),\n Arr.getSomes,\n );\n\nexport {\n NODE_MODULES_SEGMENT,\n POSITION_BASE,\n childrenOf,\n columnOf,\n contains,\n declarationsOf,\n descendantsOf,\n importedModulesOf,\n isExternalDeclaration,\n isGenericDeclaration,\n isTypeDeclaration,\n lineOf,\n propertyNamesOf,\n referencedSymbols,\n resolvedSymbol,\n symbolAt,\n uniqueByReference,\n};\n","import { Array as Arr, Order, Schema, pipe } from \"effect\";\n\nimport type { Node } from \"./compiler.ts\";\nimport { columnOf, lineOf } from \"./syntax.ts\";\n\nconst RuleNameSchema = Schema.Literals([\n \"owner-annotation\",\n \"duplicate-value-set\",\n \"owner-value-set\",\n \"owner-extension\",\n \"owned-literal\",\n \"library-value-set\",\n \"library-shape\",\n \"unused-override\",\n \"removable-override\",\n \"hidden-unicode\",\n \"python-file\",\n \"python-command\",\n \"nested-docs\",\n \"root-readme\",\n \"stack-dependency\",\n \"install-size\",\n \"unverified-crate\",\n \"hidden-verify\",\n \"root-workspace-path\",\n \"colocated-test\",\n \"comment\",\n]);\n\ntype RuleName = typeof RuleNameSchema.Type;\n\nconst ProblemSchema = Schema.Struct({\n file: Schema.String,\n line: Schema.Int,\n column: Schema.Int,\n rule: RuleNameSchema,\n message: Schema.String,\n});\n\ntype Problem = typeof ProblemSchema.Type;\n\nconst ProblemList = Schema.Array(ProblemSchema);\n\nconst CANDIDATE_LIMIT = 3;\n\ninterface Finding {\n readonly rule: RuleName;\n readonly message: string;\n}\n\nconst problemAt =\n ({ rule, message }: Finding) =>\n (node: Node): Problem => ({\n file: node.getSourceFile().fileName,\n line: lineOf(node),\n column: columnOf(node),\n rule,\n message,\n });\n\nconst problemOrder: Order.Order<Problem> = Order.combineAll([\n Order.mapInput(Order.String, (problem: Problem) => problem.file),\n Order.mapInput(Order.Number, (problem: Problem) => problem.line),\n Order.mapInput(Order.Number, (problem: Problem) => problem.column),\n Order.mapInput(Order.String, (problem: Problem) => problem.rule),\n Order.mapInput(Order.String, (problem: Problem) => problem.message),\n]);\n\nconst problemKey = (problem: Problem): string =>\n pipe(\n [problem.file, String(problem.line), String(problem.column), problem.rule, problem.message],\n Arr.join(\"\\0\"),\n );\n\nconst sortProblems = (problems: readonly Problem[]): readonly Problem[] =>\n Arr.sort(\n Arr.dedupeWith(problems, (left, right) => problemKey(left) === problemKey(right)),\n problemOrder,\n );\n\nconst describeFinding = (problem: Problem): string => `[${problem.rule}] ${problem.message}`;\n\nconst formatProblem =\n (relative: (file: string) => string) =>\n (problem: Problem): string =>\n `${relative(problem.file)}:${String(problem.line)}:${String(problem.column)} ${describeFinding(problem)}`;\n\nexport { CANDIDATE_LIMIT, ProblemList, describeFinding, formatProblem, problemAt, sortProblems };\nexport type { Finding, Problem, RuleName };\n","const JSON_FLAG = \"--json\";\n\nexport { JSON_FLAG };\n"],"mappings":";;;;;;AA0BA,MAAM,uBAAuB,IAAI,aAAa;AAI9C,MAAM,qBAA2B,UAC/BA,MAAI,WAAW,QAAQ,MAAM,UAAU,SAAS,KAAK;AAEvD,MAAM,cAAc,SAAgC;CAClD,M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Str"],"sources":["../src/node-services.ts","../src/repository-files.ts","../src/dependencies.ts"],"sourcesContent":["import {\n NodeChildProcessSpawner,\n NodeFileSystem,\n NodePath,\n NodeStdio,\n} from \"@effect/platform-node-shared\";\nimport { Layer } from \"effect\";\n\nconst nodeServicesLayer = Layer.provideMerge(\n NodeChildProcessSpawner.layer,\n Layer.mergeAll(NodeFileSystem.layer, NodePath.layer, NodeStdio.layer),\n);\n\n/** @internal */\nexport { nodeServicesLayer };\n","import {\n Array as Arr,\n Context,\n Effect,\n FileSystem,\n Layer,\n Path,\n Stream,\n String as Str,\n pipe,\n} from \"effect\";\nimport type { Option } from \"effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nimport { nodeServicesLayer } from \"./node-services.ts\";\n\nconst MISSING_SIZE = 0;\nconst GENERATED_PATHSPEC = \":(attr:linguist-generated)\";\nconst LISTED_ARGS = [\"--cached\", \"--others\", \"--exclude-standard\"];\n\nclass RepositoryFiles extends Context.Service<\n RepositoryFiles,\n {\n readonly readFile: (file: string) => Effect.Effect<Option.Option<string>>;\n readonly exists: (file: string) => Effect.Effect<boolean>;\n readonly realPath: (file: string) => Effect.Effect<string>;\n readonly readDirectory: (directory: string) => Effect.Effect<readonly string[]>;\n readonly generatedFiles: (root: string) => Effect.Effect<readonly string[]>;\n readonly listedFiles: (root: string) => Effect.Effect<readonly string[]>;\n readonly matchingFiles: (\n root: string,\n pathspecs: readonly string[],\n ) => Effect.Effect<readonly string[]>;\n readonly isDirectory: (file: string) => Effect.Effect<Option.Option<boolean>>;\n readonly fileSize: (file: string) => Effect.Effect<number>;\n readonly join: (...segments: readonly string[]) => string;\n readonly resolve: (...segments: readonly string[]) => string;\n readonly relative: (from: string, to: string) => string;\n readonly dirname: (file: string) => string;\n readonly basename: (file: string) => string;\n }\n>()(\"@r_masseater/msch/repository-files/RepositoryFiles\") {}\n\nconst nodeRepositoryFiles = Layer.effect(\n RepositoryFiles,\n Effect.gen(function* nodeRepositoryFiles() {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const gitFiles = (root: string, args: readonly string[]): Effect.Effect<readonly string[]> =>\n Effect.gen(function* listFiles() {\n const handle = yield* ChildProcess.make(\"git\", [\"ls-files\", \"-z\", ...args], {\n cwd: root,\n stdin: \"ignore\",\n });\n const listed = yield* handle.stdout.pipe(Stream.decodeText(), Stream.mkString);\n return pipe(Str.split(listed, \"\\0\"), Arr.filter(Str.isNonEmpty));\n }).pipe(\n Effect.scoped,\n Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),\n Effect.orElseSucceed((): readonly string[] => []),\n );\n return RepositoryFiles.of({\n generatedFiles: (root) =>\n gitFiles(root, [\"--\", GENERATED_PATHSPEC]).pipe(\n Effect.map(Arr.map((file) => path.join(root, file))),\n ),\n listedFiles: (root) => gitFiles(root, LISTED_ARGS),\n matchingFiles: (root, pathspecs) => gitFiles(root, [...LISTED_ARGS, \"--\", ...pathspecs]),\n readFile: (file) => fs.readFileString(file).pipe(Effect.option),\n exists: (file) => fs.exists(file).pipe(Effect.orElseSucceed(() => false)),\n realPath: (file) => fs.realPath(file).pipe(Effect.orElseSucceed(() => file)),\n readDirectory: (directory) =>\n fs.readDirectory(directory).pipe(Effect.orElseSucceed((): readonly string[] => [])),\n isDirectory: (file) =>\n fs.stat(file).pipe(\n Effect.map((info) => info.type === \"Directory\"),\n Effect.option,\n ),\n fileSize: (file) =>\n fs.stat(file).pipe(\n Effect.map((info) => Number(info.size)),\n Effect.orElseSucceed(() => MISSING_SIZE),\n ),\n join: (...segments) => path.join(...segments),\n resolve: (...segments) => path.resolve(...segments),\n relative: (from, to) => path.relative(from, to),\n dirname: (file) => path.dirname(file),\n basename: (file) => path.basename(file),\n });\n }),\n).pipe(Layer.provide(nodeServicesLayer));\n\nexport { RepositoryFiles, nodeRepositoryFiles };\n","import {\n Array as Arr,\n Effect,\n Option,\n Order,\n Predicate,\n Schema,\n String as Str,\n Record as Rec,\n pipe,\n} from \"effect\";\n\nimport { RepositoryFiles } from \"./repository-files.ts\";\n\ninterface DependencyEntry {\n readonly packageName: string;\n readonly specifier: string;\n readonly declarationsPath: string;\n}\n\nconst DependencyMap = Schema.optional(Schema.Record(Schema.String, Schema.String));\n\nconst PackageManifest = Schema.Struct({\n name: Schema.optional(Schema.String),\n dependencies: DependencyMap,\n devDependencies: DependencyMap,\n peerDependencies: DependencyMap,\n exports: Schema.optional(Schema.Unknown),\n types: Schema.optional(Schema.String),\n typings: Schema.optional(Schema.String),\n main: Schema.optional(Schema.String),\n});\n\ntype Manifest = typeof PackageManifest.Type;\n\nconst MANIFEST_FILE = \"package.json\";\nconst NODE_MODULES = \"node_modules\";\nconst WORKSPACE_PROTOCOL = \"workspace:\";\nconst ROOT_SUBPATH = \".\";\nconst SUBPATH_PREFIX = \"./\";\nconst WILDCARD = \"*\";\nconst TYPES_CONDITION = \"types\";\nconst TYPES_SCOPE = \"@types/\";\nconst TYPES_SCOPE_SEPARATOR = \"__\";\nconst CONDITION_DEPTH_LIMIT = 8;\nconst ROOT_DEPTH = 0;\nconst DEPTH_STEP = 1;\nconst DECLARATIONS_SUFFIX = /\\.d\\.[cm]?ts$|\\.[cm]?tsx?$/u;\nconst SCRIPT_SUFFIX = /\\.(?<module>[cm]?)js$/u;\n\nconst readManifest = Effect.fn(\"readManifest\")(function* readManifest(directory: string) {\n const files = yield* RepositoryFiles;\n const manifestText = yield* files.readFile(files.join(directory, MANIFEST_FILE));\n const text = yield* Effect.fromOption(manifestText);\n return yield* Schema.decodeEffect(Schema.fromJsonString(PackageManifest))(text);\n}, Effect.option);\n\nconst conditionsOf = (held: unknown): readonly (readonly [string, unknown])[] => {\n if (!Predicate.isObject(held)) {\n return [];\n }\n return Rec.toEntries(held);\n};\n\nconst typesConditionIn = (held: unknown, depth: number): Option.Option<string> => {\n if (depth > CONDITION_DEPTH_LIMIT) {\n return Option.none();\n }\n const entries = conditionsOf(held);\n const declared = Arr.findFirst(entries, ([condition, target]) =>\n Option.liftPredicate(\n target,\n (candidate) => condition === TYPES_CONDITION && Predicate.isString(candidate),\n ),\n ).pipe(Option.filter(Predicate.isString));\n return Option.orElse(declared, () =>\n Arr.findFirst(entries, ([, nested]) => typesConditionIn(nested, depth + DEPTH_STEP)),\n );\n};\n\nconst anyConditionIn = (held: unknown, depth: number): Option.Option<string> => {\n if (Predicate.isString(held)) {\n return Option.some(held);\n }\n if (depth > CONDITION_DEPTH_LIMIT) {\n return Option.none();\n }\n return Arr.findFirst(conditionsOf(held), ([, nested]) =>\n anyConditionIn(nested, depth + DEPTH_STEP),\n );\n};\n\nconst targetPathsOf = (target: unknown): readonly string[] =>\n Arr.getSomes([typesConditionIn(target, ROOT_DEPTH), anyConditionIn(target, ROOT_DEPTH)]);\n\ninterface SubpathTarget {\n readonly subpath: string;\n readonly target: unknown;\n}\n\nconst subpathTargetsOf = (exportsField: unknown): readonly SubpathTarget[] => {\n if (Predicate.isString(exportsField)) {\n return [{ subpath: ROOT_SUBPATH, target: exportsField }];\n }\n const entries = conditionsOf(exportsField);\n if (\n !pipe(\n entries,\n Arr.some(([subpath]) => Str.startsWith(ROOT_SUBPATH)(subpath)),\n )\n ) {\n return Arr.match(entries, {\n onEmpty: () => [],\n onNonEmpty: () => [{ subpath: ROOT_SUBPATH, target: exportsField }],\n });\n }\n return pipe(\n entries,\n Arr.filter(([subpath]) => subpath === ROOT_SUBPATH || Str.startsWith(SUBPATH_PREFIX)(subpath)),\n Arr.filter(([subpath]) => !Str.includes(WILDCARD)(subpath)),\n Arr.map(([subpath, target]) => ({ subpath, target })),\n );\n};\n\nconst declarationsCandidateFor = (entryPath: string): Option.Option<string> => {\n if (DECLARATIONS_SUFFIX.test(entryPath)) {\n return Option.some(entryPath);\n }\n if (!SCRIPT_SUFFIX.test(entryPath)) {\n return Option.none();\n }\n return Option.some(Str.replace(SCRIPT_SUFFIX, \".d.$<module>ts\")(entryPath));\n};\n\nconst firstDeclarationsAmong = Effect.fn(\"firstDeclarationsAmong\")(function* firstDeclarations(\n directory: string,\n entryPaths: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const candidates = Arr.getSomes(\n pipe(\n entryPaths,\n Arr.map((entryPath) => declarationsCandidateFor(entryPath)),\n ),\n );\n const existing = yield* Effect.filter(\n pipe(\n candidates,\n Arr.map((candidate) => files.join(directory, candidate)),\n ),\n (candidate) => files.exists(candidate),\n );\n return yield* Option.match(Arr.head(existing), {\n onNone: (): Effect.Effect<Option.Option<string>> => Effect.succeedNone,\n onSome: (candidate) => files.realPath(candidate).pipe(Effect.asSome),\n });\n});\n\nconst importNameOf = (packageName: string): string => {\n if (!Str.startsWith(TYPES_SCOPE)(packageName)) {\n return packageName;\n }\n const unscoped = Str.slice(TYPES_SCOPE.length)(packageName);\n if (!Str.includes(TYPES_SCOPE_SEPARATOR)(unscoped)) {\n return unscoped;\n }\n return `@${Str.replace(TYPES_SCOPE_SEPARATOR, \"/\")(unscoped)}`;\n};\n\nconst specifierFor = (packageName: string, subpath: string): string => {\n const importName = importNameOf(packageName);\n if (subpath === ROOT_SUBPATH) {\n return importName;\n }\n return `${importName}/${Str.slice(SUBPATH_PREFIX.length)(subpath)}`;\n};\n\nconst rootEntryPaths = (manifest: Manifest): readonly string[] =>\n Arr.getSomes([\n Option.fromUndefinedOr(manifest.types),\n Option.fromUndefinedOr(manifest.typings),\n Option.fromUndefinedOr(manifest.main),\n ]);\n\nconst subpathEntriesOf = Effect.fn(\"subpathEntriesOf\")(function* subpathEntriesOf(\n packageName: string,\n directory: string,\n manifest: Manifest,\n) {\n const found = yield* Effect.forEach(subpathTargetsOf(manifest.exports), ({ subpath, target }) =>\n firstDeclarationsAmong(directory, targetPathsOf(target)).pipe(\n Effect.map(\n Option.map((declarationsPath) => ({\n packageName,\n specifier: specifierFor(packageName, subpath),\n declarationsPath,\n })),\n ),\n ),\n );\n return Arr.getSomes(found);\n});\n\nconst entriesOfDependency = Effect.fn(\"entriesOfDependency\")(function* entriesOfDependency(\n packageName: string,\n directory: string,\n) {\n const manifest = yield* readManifest(directory);\n if (Option.isNone(manifest)) {\n return [];\n }\n const subpathEntries = yield* subpathEntriesOf(packageName, directory, manifest.value);\n const rootSpecifier = specifierFor(packageName, ROOT_SUBPATH);\n if (\n pipe(\n subpathEntries,\n Arr.some((entry) => entry.specifier === rootSpecifier),\n )\n ) {\n return subpathEntries;\n }\n const rootDeclarations = yield* firstDeclarationsAmong(directory, rootEntryPaths(manifest.value));\n const rootEntries = rootDeclarations.pipe(\n Option.map((declarationsPath) => ({ packageName, specifier: rootSpecifier, declarationsPath })),\n Option.toArray,\n );\n return [...rootEntries, ...subpathEntries];\n});\n\nconst declaredDependencies = (manifest: Manifest): readonly string[] =>\n pipe(\n Rec.toEntries({\n ...manifest.dependencies,\n ...manifest.devDependencies,\n ...manifest.peerDependencies,\n }),\n Arr.filter(([, range]) => !Str.startsWith(WORKSPACE_PROTOCOL)(range)),\n Arr.map(([packageName]) => packageName),\n );\n\nconst workspaceDependencies = (manifest: Manifest): readonly string[] =>\n pipe(\n Rec.toEntries({ ...manifest.dependencies, ...manifest.devDependencies }),\n Arr.filter(([, range]) => Str.startsWith(WORKSPACE_PROTOCOL)(range)),\n Arr.map(([packageName]) => packageName),\n );\n\nconst entryOrder = Order.mapInput(Order.String, (entry: DependencyEntry) => entry.specifier);\n\nconst dependencyEntries = Effect.fn(\"dependencyEntries\")(function* dependencyEntries(\n packageDirectory: string,\n) {\n const files = yield* RepositoryFiles;\n const manifest = yield* readManifest(packageDirectory);\n if (Option.isNone(manifest)) {\n return [];\n }\n const entries = yield* Effect.forEach(declaredDependencies(manifest.value), (packageName) =>\n entriesOfDependency(packageName, files.join(packageDirectory, NODE_MODULES, packageName)),\n );\n return Arr.sort(\n Arr.dedupeWith(entries.flat(), (left, right) => left.specifier === right.specifier),\n entryOrder,\n );\n});\n\nexport { MANIFEST_FILE, NODE_MODULES, dependencyEntries, readManifest, workspaceDependencies };\nexport type { DependencyEntry,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AqB,SAAS,KAAK,IAAI,gBAC3E,oBAAoB,aAAa,MAAM,KAAK,kBAAkB,cAAc,WAAW,CAAC,CAC1F;CACA,OAAOA,MAAI,KACTA,MAAI,WAAW,QAAQ,KAAK,IAAI,MAAM,UAAU,KAAK,cAAc,MAAM,SAAS,GAClF,UACF;AACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"workspace-tasks-CRL-gm__.mjs","names":["SEPARATOR","Rec","Arr","Str","taggedError","Arr","Str","Rec","MANIFEST_FILE","Str","parse","Arr","Arr","Rec","Arr","Rec","Arr"],"sources":["../src/public-entries.ts","../src/published.ts","../src/workspace-directories.ts","../src/config-literal.ts","../src/workspace-config-source.ts","../src/workspace-tasks.ts"],"sourcesContent":["import { Array as Arr, Option, Predicate, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport type { PackEntrySource } from \"./published.ts\";\n\nconst SOURCE = /\\.[cm]?tsx?$/u;\nconst BUILT = /\\.(?:d\\.)?[cm]?[jt]s$/u;\nconst DECLARATION = \".d.\";\nconst SEPARATOR = \"/\";\nconst ROOT_SUBPATH = \".\";\nconst BIN_LABEL = \"bin\";\n\ninterface PublicEntry {\n readonly label: string;\n readonly source: string;\n}\n\ninterface EntryManifest {\n readonly name?: string | undefined;\n readonly exports?: unknown;\n readonly bin?: unknown;\n}\n\ninterface EntryLookup {\n readonly manifest: EntryManifest;\n readonly join: (target: string) => string;\n readonly packEntries: readonly PackEntrySource[];\n}\n\nconst targetsIn = (held: unknown): readonly string[] => {\n if (Predicate.isString(held)) {\n return [held];\n }\n if (!Predicate.isObject(held)) {\n return [];\n }\n return pipe(Rec.values(held), Arr.flatMap(targetsIn));\n};\n\nconst subpathsOf = (exportsField: unknown): readonly (readonly [string, unknown])[] => {\n if (!Predicate.isObject(exportsField)) {\n return [[ROOT_SUBPATH, exportsField]];\n }\n const entries = Rec.toEntries(exportsField);\n if (\n pipe(\n entries,\n Arr.some(([key]) => Str.startsWith(ROOT_SUBPATH)(key)),\n )\n ) {\n return entries;\n }\n return [[ROOT_SUBPATH, exportsField]];\n};\n\nconst binsOf = (manifest: EntryManifest): readonly (readonly [string, unknown])[] => {\n if (Predicate.isString(manifest.bin)) {\n const name = Option.getOrElse(Option.fromUndefinedOr(manifest.name), () => \"\");\n return [[`${BIN_LABEL} ${name}`, manifest.bin]];\n }\n if (!Predicate.isObject(manifest.bin)) {\n return [];\n }\n return pipe(\n Rec.toEntries(manifest.bin),\n Arr.map(([name, target]) => [`${BIN_LABEL} ${name}`, target] as const),\n );\n};\n\nconst baseNameOf = (target: string): string =>\n pipe(\n Str.split(target, SEPARATOR),\n Arr.last,\n Option.getOrElse(() => target),\n Str.replace(BUILT, \"\"),\n );\n\nconst sourceOf =\n ({ join, packEntries }: EntryLookup) =>\n (target: string): Option.Option<string> => {\n if (SOURCE.test(target) && !Str.includes(DECLARATION)(target)) {\n return Option.some(join(target));\n }\n const name = baseNameOf(target);\n return pipe(\n packEntries,\n Arr.findFirst((entry) => entry.name === name),\n Option.map((entry) => entry.source),\n );\n };\n\nconst 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\nexport { publicEntriesOf };\nexport type { EntryLookup, EntryManifest, PublicEntry };\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 { MANIFEST_FILE } from \"./dependencies.ts\";\nimport { RepositoryFiles } from \"./repository-files.ts\";\n\nconst CONFIG_FILE = \"vite.config.ts\";\nconst SEPARATOR = \"/\";\nconst READ_CONCURRENCY = 16;\nconst SOURCE_EXTENSION = /\\.[cm]?tsx?$/u;\nconst BYTE = 1;\nconst KILOBYTE = 1000;\nconst MEGABYTE = 1_000_000;\nconst UNIT_BYTES = [\n [\"B\", BYTE],\n [\"kB\", KILOBYTE],\n [\"MB\", MEGABYTE],\n] as const;\n\nconst SizeText = Schema.TemplateLiteralParser([\n Schema.Finite,\n \" \",\n Schema.Literals([\"B\", \"kB\", \"MB\"]),\n]);\nconst PackEntry = Schema.Union([\n Schema.String,\n Schema.Array(Schema.String),\n Schema.Record(Schema.String, Schema.String),\n]);\nconst PackSettings = Schema.Struct({ entry: Schema.optional(PackEntry) });\nconst PackList = Schema.Union([PackSettings, Schema.Array(PackSettings)]);\nconst isEntryList = Schema.is(Schema.Array(Schema.String));\nconst WorkspaceConfig = Schema.Struct({\n msch: Schema.Struct({ publish: Schema.Struct({ installSize: SizeText }) }),\n pack: Schema.optional(PackList),\n});\nconst PublicManifest = Schema.Struct({ private: Schema.optional(Schema.Literal(false)) });\n\nconst taggedError = Schema.TaggedError;\n\nclass WorkspaceConfigUnreadable extends taggedError<\n WorkspaceConfigUnreadable,\n { readonly brand: unique symbol }\n>()(\"WorkspaceConfigUnreadable\", { file: Schema.String }) {}\n\ninterface PackEntrySource {\n readonly name: string;\n readonly source: string;\n}\n\ninterface PublishedWorkspace {\n readonly directory: string;\n readonly configFile: string;\n readonly installSize: string;\n readonly installBudget: number;\n readonly packEntries: readonly PackEntrySource[];\n}\n\nconst bytesPer = (unit: string): number =>\n pipe(\n UNIT_BYTES,\n Arr.findFirst(([name]) => name === unit),\n Option.map(([, bytes]) => bytes),\n Option.getOrElse(() => Number.NaN),\n );\n\nconst nameOf = (source: string): string =>\n pipe(\n Str.split(source, SEPARATOR),\n Arr.last,\n Option.getOrElse(() => source),\n Str.replace(SOURCE_EXTENSION, \"\"),\n );\n\nconst entriesOf = (entry: typeof PackEntry.Type): readonly PackEntrySource[] => {\n if (Predicate.isString(entry)) {\n return [{ name: nameOf(entry), source: entry }];\n }\n if (isEntryList(entry)) {\n return pipe(\n entry,\n Arr.map((source) => ({ name: nameOf(source), source })),\n );\n }\n return pipe(\n Rec.toEntries(entry),\n Arr.map(([name, source]) => ({ name, source })),\n );\n};\n\nconst packEntriesOf = (pack: typeof WorkspaceConfig.Type.pack): readonly PackEntrySource[] =>\n pipe(\n Option.fromUndefinedOr(pack),\n Option.map(Arr.ensure),\n Option.getOrElse((): readonly (typeof PackSettings.Type)[] => []),\n Arr.flatMap((setting) =>\n pipe(\n Option.fromUndefinedOr(setting.entry),\n Option.match({ onNone: () => [], onSome: entriesOf }),\n ),\n ),\n );\n\nconst settingsIn = Effect.fn(\"settingsIn\")(function* settingsIn(file: string) {\n const config = yield* Effect.tryPromise({\n try: () => resolveConfigFromFile(file),\n catch: () => WorkspaceConfigUnreadable.make({ file }),\n }).pipe(Effect.option);\n return pipe(config, Option.flatMap(Schema.decodeUnknownOption(WorkspaceConfig)));\n});\n\nconst isPublicPackage = Effect.fn(\"isPublicPackage\")(function* isPublicPackage(directory: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(directory, MANIFEST_FILE));\n return Option.exists(text, (found) =>\n Option.isSome(Schema.decodeOption(Schema.fromJsonString(PublicManifest))(found)),\n );\n});\n\nconst workspaceOf =\n (directory: string, configFile: string, join: (source: string) => string) =>\n ({ msch, pack }: typeof WorkspaceConfig.Type): PublishedWorkspace => {\n const [amount, , unit] = msch.publish.installSize;\n return {\n directory,\n configFile,\n installSize: `${amount} ${unit}`,\n installBudget: amount * bytesPer(unit),\n packEntries: pipe(\n packEntriesOf(pack),\n Arr.map((entry) => ({ name: entry.name, source: join(entry.source) })),\n ),\n };\n };\n\nconst publishedIn = Effect.fn(\"publishedIn\")(function* publishedIn(\n root: string,\n configName: string,\n) {\n const files = yield* RepositoryFiles;\n const configFile = files.join(root, configName);\n const directory = files.dirname(configFile);\n const isPublic = yield* isPublicPackage(directory);\n if (!isPublic) {\n return Option.none<PublishedWorkspace>();\n }\n const settings = yield* settingsIn(configFile);\n return pipe(\n settings,\n Option.map(workspaceOf(directory, configFile, (source) => files.join(directory, source))),\n );\n});\n\n/** @internal */\nconst publishedWorkspaces = Effect.fn(\"publishedWorkspaces\")(function* publishedWorkspaces(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const names = yield* files.listedFiles(root);\n const configs = pipe(\n names,\n Arr.filter((name) => files.basename(name) === CONFIG_FILE && Str.includes(SEPARATOR)(name)),\n );\n const found = yield* Effect.forEach(configs, (name) => publishedIn(root, name), {\n concurrency: READ_CONCURRENCY,\n });\n return Arr.getSomes(found);\n});\n\nexport { PackEntry, entriesOf, publishedWorkspaces };\nexport type { PackEntrySource, PublishedWorkspace };\n","import { Array as Arr, Effect, Option, Schema, String as Str, pipe } from \"effect\";\nimport { parse } from \"yaml\";\n\nimport { RepositoryFiles } from \"./repository-files.ts\";\n\nconst WORKSPACE_FILE = \"pnpm-workspace.yaml\";\nconst MANIFEST_FILE = \"package.json\";\nconst NEGATION = \"!\";\n\nconst WorkspaceFile = Schema.Struct({ packages: Schema.optionalKey(Schema.Array(Schema.String)) });\nconst decodeWorkspaceFile = Schema.decodeUnknownOption(WorkspaceFile);\n\nconst manifestPathspec = (pattern: string): string => {\n if (Str.startsWith(NEGATION)(pattern)) {\n return `:(glob,exclude)${Str.slice(NEGATION.length)(pattern)}/${MANIFEST_FILE}`;\n }\n return `:(glob)${pattern}/${MANIFEST_FILE}`;\n};\n\nconst packagesOf = (text: string): readonly string[] => {\n const raw: unknown = parse(text);\n return pipe(\n decodeWorkspaceFile(raw),\n Option.flatMap(({ packages }) => Option.fromUndefinedOr(packages)),\n Option.getOrElse((): readonly string[] => []),\n );\n};\n\n/** @internal */\nconst workspaceDirectories = Effect.fn(\"workspaceDirectories\")(function* workspaceDirectories(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, WORKSPACE_FILE));\n const patterns = pipe(\n text,\n Option.map(packagesOf),\n Option.getOrElse((): readonly string[] => []),\n );\n if (!Arr.isReadonlyArrayNonEmpty(patterns)) {\n return [];\n }\n const manifests = yield* files.matchingFiles(root, pipe(patterns, Arr.map(manifestPathspec)));\n const directories = pipe(\n manifests,\n Arr.map((manifest) => files.dirname(manifest)),\n );\n return Arr.sort(directories, Str.Order);\n});\n\nexport { workspaceDirectories };\n","import { Array as Arr, Match, Option, Predicate, Record as Rec, Schema, pipe } from \"effect\";\n\ntype Literal = string | number | boolean | null | readonly Literal[] | LiteralObject;\n\ninterface LiteralObject {\n readonly [key: string]: Literal;\n}\n\nconst WRAPPERS = [\"TSAsExpression\", \"TSSatisfiesExpression\", \"ParenthesizedExpression\"] as const;\n\nconst 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\nconst 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\nconst 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\nconst 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\nconst 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\nconst 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\nexport { childrenOf, literalOf, nestedValues };\nexport type { Literal, LiteralObject };\n","import { Array as Arr, Effect, Option, Record as Rec, Schema, pipe } from \"effect\";\nimport { parse } from \"vite-plus\";\n\nimport { literalOf, nestedValues } from \"./config-literal.ts\";\n\nconst SINGLE = 1;\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\nconst settingsInvalid =\n (file: string) =>\n (reason: string): WorkspaceSettingsInvalid =>\n WorkspaceSettingsInvalid.make({ file, message: `${file}: ${reason}` });\n\ninterface WorkspaceSource {\n readonly file: string;\n readonly directory: string;\n readonly program: unknown;\n}\n\ntype 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\nconst merged = <Value>(\n records: readonly Readonly<Record<string, Value>>[],\n): Record<string, Value> => pipe(records, Arr.flatMap(Rec.toEntries), Rec.fromEntries);\n\nconst 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\ninterface LiteralSettingsRequest<Settings> {\n readonly source: WorkspaceSource;\n readonly path: SettingsPath;\n readonly decode: (input: unknown) => Effect.Effect<Settings, Schema.SchemaError>;\n}\n\nconst 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\nconst 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\nexport { literalSettings, settingsInvalid, merged, programOf, usedFrom };\nexport type { LiteralSettingsRequest, SettingsPath, WorkspaceSettingsInvalid, WorkspaceSource };\n","import { Array as Arr, Effect, Option, Schema, pipe } from \"effect\";\nimport { resolveConfigFromFile } from \"vite-plus\";\n\nimport { nestedValues } from \"./config-literal.ts\";\nimport type { Manifest } from \"./dependencies.ts\";\nimport { settingsInvalid } from \"./workspace-config-source.ts\";\n\nconst VERIFY_TASK = [\"tasks\", \"verify\"] as const;\n\ninterface WorkspaceTasks {\n readonly verify: readonly string[];\n}\n\nconst NO_TASKS: WorkspaceTasks = { verify: [] };\n\nconst Tasks = Schema.Struct({ verify: Schema.Unknown });\nconst isVerified = Schema.is(Schema.Struct({ run: Schema.Struct({ tasks: Tasks }) }));\n\nconst definesTask =\n (path: readonly [string, string]) =>\n (program: unknown): boolean =>\n Arr.isReadonlyArrayNonEmpty(nestedValues(path)(program));\n\nconst 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 tasksOf =\n (manifest: Option.Option<Manifest>) =>\n (program: unknown): WorkspaceTasks =>\n pipe(\n manifest,\n Option.flatMap((found) => Option.fromUndefinedOr(found.name)),\n Option.match({\n onNone: () => NO_TASKS,\n onSome: (name) => ({\n verify: Arr.filter([`${name}#verify`], () => definesTask(VERIFY_TASK)(program)),\n }),\n }),\n );\n\nexport { NO_TASKS, VERIFY_TASK, definesTask, hasVerifyTask, tasksOf };\nexport type { WorkspaceTasks };\n"],"mappings":";;;;;AAIA,MAAM,SAAS;AACf,MAAM,QAAQ;AACd,MAAM,cAAc;AACpB,MAAMA,cAAY;AAClB,MAAM,eAAe;AACrB,MAAM,YAAY;AAmBlB,MAAM,aAAa,SAAqC;CACtD,IAAI,UAAU,SAAS,IAAI,GACzB,OAAO,CAAC,IAAI;CAEd,IAAI,CAAC,UAAU,SAAS,IAAI,GAC1B,OAAO,CAAC;CAEV,OAAO,KAAKC,OAAI,OAAO,IAAI,GAAGC,MAAI,QAAQ,SAAS,CAAC;AACtD;AAEA,MAAM,cAAc,iBAAmE;CACrF,IAAI,CAAC,UAAU,SAAS,YAAY,GAClC,OAAO,CAAC,CAAC,cAAc,YAAY,CAAC;CAEtC,MAAM,UAAUD,OAAI,UAAU,YAAY;CAC1C,IACE,KACE,SACAC,MAAI,MAAM,CAAC,SAASC,OAAI,WAAW,YAAY,CAAC,CAAC,GAAG,CAAC,CACvD,GAEA,OAAO;CAET,OAAO,CAAC,CAAC,c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