@r_masseater/msch 0.57.0 → 0.57.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/cargo-inputs.mjs +1 -2
  2. package/dist/cargo-inputs.mjs.map +1 -1
  3. package/dist/changed.mjs +2 -2
  4. package/dist/cli.mjs +1015 -445
  5. package/dist/cli.mjs.map +1 -1
  6. package/dist/credential-broker-9FMyTp1H.mjs +44 -0
  7. package/dist/credential-broker-9FMyTp1H.mjs.map +1 -0
  8. package/dist/dependencies-B6p7x90y.mjs +215 -0
  9. package/dist/dependencies-B6p7x90y.mjs.map +1 -0
  10. package/dist/exits.mjs +1 -1
  11. package/dist/{ignored-directories-BTMTNuAx.mjs → ignored-directories-BgUqwuc4.mjs} +12 -3
  12. package/dist/ignored-directories-BgUqwuc4.mjs.map +1 -0
  13. package/dist/oxlint.mjs +1 -2
  14. package/dist/oxlint.mjs.map +1 -1
  15. package/dist/{project-CIY_lNiT.mjs → pass-records-BCT1Ls9c.mjs} +5 -55
  16. package/dist/{project-CIY_lNiT.mjs.map → pass-records-BCT1Ls9c.mjs.map} +1 -1
  17. package/dist/{problem-Q4Zyi4PR.mjs → problem-BoHYLMQT.mjs} +2 -2
  18. package/dist/{problem-Q4Zyi4PR.mjs.map → problem-BoHYLMQT.mjs.map} +1 -1
  19. package/dist/publish.mjs +49 -5
  20. package/dist/publish.mjs.map +1 -1
  21. package/dist/published-BNJdq0h1.mjs +510 -0
  22. package/dist/published-BNJdq0h1.mjs.map +1 -0
  23. package/dist/{syntax-BNRNY74H.mjs → syntax-CTiXR0EJ.mjs} +3 -3
  24. package/dist/{syntax-BNRNY74H.mjs.map → syntax-CTiXR0EJ.mjs.map} +1 -1
  25. package/dist/{check-upstream-exits-DsBS7bui.mjs → upstream-exits-DitN-yYH.mjs} +9 -91
  26. package/dist/upstream-exits-DitN-yYH.mjs.map +1 -0
  27. package/dist/wake.mjs +1 -1
  28. package/dist/workspace-settings.mjs +66 -4
  29. package/dist/workspace-settings.mjs.map +1 -1
  30. package/package.json +3 -1
  31. package/dist/check-upstream-exits-DsBS7bui.mjs.map +0 -1
  32. package/dist/credential-broker-D8sFyowJ.mjs +0 -105
  33. package/dist/credential-broker-D8sFyowJ.mjs.map +0 -1
  34. package/dist/dependencies-CbvZost8.mjs +0 -688
  35. package/dist/dependencies-CbvZost8.mjs.map +0 -1
  36. package/dist/ignored-directories-BTMTNuAx.mjs.map +0 -1
  37. package/dist/package-DZbqpZfs.mjs +0 -144
  38. package/dist/package-DZbqpZfs.mjs.map +0 -1
  39. package/dist/reachable-Cc-255L3.mjs +0 -13
  40. package/dist/reachable-Cc-255L3.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-upstream-exits-DsBS7bui.mjs","names":["START","Str","Arr","Arr","Arr","Rec","YamlParser","Str","Arr","Str","Arr","Arr","Rec","Str","RULE","problemAt","Arr","Str","Arr","Rec"],"sources":["../src/shared/lib/text-position.ts","../src/shared/lib/scanned-files.ts","../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","../src/features/check-upstream-exits/model/scattered-deviations.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","import { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport type { Problem } from \"./problem.ts\";\nimport { RepositoryFiles } from \"./repository-files.ts\";\n\nconst SCANNED_FILE =\n /(?:\\.(?:[cm]?[jt]sx?|jsonc?|toml|ya?ml|sh|bash|zsh|fish|rs|cs|go|mk)|(?:^|\\/)(?:(?:Dockerfile|Containerfile)[^/]*|Makefile|justfile|\\.tool-versions|[^./][^./]*))$/u;\n\nconst LOCKFILE = /(?:^|\\/)(?:[^/]*\\.lock|[^/]*-lock\\.(?:json|ya?ml))$/u;\n\nconst TOOL_VERSIONS = /(?:^|\\/)(?:\\.?mise(?:\\.[^/]+)?\\.toml|\\.tool-versions)$/u;\n\nconst READ_CONCURRENCY = 64;\n\nexport interface Listed {\n readonly name: string;\n readonly file: string;\n}\n\nexport const isScannedText = ({ name }: Listed): boolean =>\n SCANNED_FILE.test(name) && !LOCKFILE.test(name);\n\nexport const isToolVersions = ({ name }: Listed): boolean => TOOL_VERSIONS.test(name);\n\n/** @internal */\nexport const listedFiles = Effect.fn(\"listedFiles\")(function* listedFiles(root: string) {\n const files = yield* RepositoryFiles;\n const names = yield* files.ownedFiles(root);\n return pipe(\n names,\n Arr.map((name): Listed => ({ name, file: files.join(root, name) })),\n );\n});\n\n/** @internal */\nexport const presentFiles = Effect.fn(\"presentFiles\")(function* presentFiles(\n listed: readonly Listed[],\n) {\n const files = yield* RepositoryFiles;\n return yield* pipe(\n listed,\n Effect.filter(({ file }) => files.exists(file)),\n );\n});\n\n/** @internal */\nexport const scanText = Effect.fn(\"scanText\")(function* scanText(\n listed: readonly Listed[],\n problemsIn: (entry: Listed, source: string) => readonly Problem[],\n) {\n const files = yield* RepositoryFiles;\n const found = yield* Effect.forEach(\n listed,\n (entry) =>\n files.readFile(entry.file).pipe(\n Effect.map(\n Option.match({\n onNone: (): readonly Problem[] => [],\n onSome: (source) => problemsIn(entry, source),\n }),\n ),\n ),\n { concurrency: READ_CONCURRENCY },\n );\n return Arr.flatten(found);\n});\n","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","import { Array as Arr, Effect, Option, Record as Rec, Schema, String as Str, pipe } from \"effect\";\n\nimport type { Problem, RuleName } from \"#/shared/lib/problem.ts\";\nimport { listedFiles, scanText } from \"#/shared/lib/scanned-files.ts\";\nimport type { Listed } from \"#/shared/lib/scanned-files.ts\";\nimport { positionOf } from \"#/shared/lib/text-position.ts\";\n\nimport { WORKSPACE_SECTIONS, cargoDeviations, workspaceDeviations } from \"./deviation-entries.ts\";\nimport type { Deviations } from \"./deviation-entries.ts\";\n\nconst RULE: RuleName = \"upstream-deviation-place\";\nconst MANIFEST = \"package.json\";\nconst NESTED_WORKSPACE = \"/pnpm-workspace.yaml\";\nconst NESTED_CARGO = \"/Cargo.toml\";\nconst CARGO_CONFIG = /(?:^|\\/)\\.cargo\\/config(?:\\.toml)?$/u;\nconst MANAGER_FIELDS = [\"overrides\", \"resolutions\"] as const;\nconst START = 0;\nconst PLACE =\n \"Upstream deviations live only in the root pnpm-workspace.yaml (overrides, patchedDependencies, packageExtensions) and the root Cargo.toml ([patch]), each with an exit condition.\";\n\nconst Fields = Schema.Record(Schema.String, Schema.Unknown);\nconst Manifest = Schema.fromJsonString(\n Schema.Struct({\n pnpm: Schema.optional(Fields),\n overrides: Schema.optional(Schema.Unknown),\n resolutions: Schema.optional(Schema.Unknown),\n }),\n);\nconst decodeManifest = Schema.decodeUnknownOption(Manifest);\n\ninterface Field {\n readonly name: string;\n readonly key: string;\n}\n\nconst isManifest = (name: string): boolean =>\n name === MANIFEST || Str.endsWith(`/${MANIFEST}`)(name);\n\nconst problemAt =\n (entry: Listed, source: string) =>\n (index: number, message: string): Problem => ({\n file: entry.file,\n ...positionOf(source)(index),\n rule: RULE,\n message,\n });\n\nconst keyIndex = (source: string, key: string): number =>\n Option.getOrElse(Str.indexOf(`\"${key}\"`)(source), () => START);\n\nconst fieldsIn = (source: string): readonly Field[] =>\n pipe(\n decodeManifest(source),\n Option.match({\n onNone: (): readonly Field[] => [],\n onSome: (manifest) => {\n const pnpm = Option.getOrElse(Option.fromUndefinedOr(manifest.pnpm), () => ({}));\n const pnpmFields = pipe(\n WORKSPACE_SECTIONS,\n Arr.filter((key) => Rec.has(pnpm, key)),\n Arr.map((key) => ({ name: `pnpm.${key}`, key })),\n );\n const managerFields = pipe(\n MANAGER_FIELDS,\n Arr.filter((key) => Option.isSome(Option.fromUndefinedOr(manifest[key]))),\n Arr.map((key) => ({ name: key, key })),\n );\n return [...pnpmFields, ...managerFields];\n },\n }),\n );\n\nconst manifestProblems = (entry: Listed, source: string): readonly Problem[] =>\n pipe(\n fieldsIn(source),\n Arr.map(({ name, key }) =>\n problemAt(entry, source)(\n keyIndex(source, key),\n `${name} in package.json is not allowed. ${PLACE} Move it there.`,\n ),\n ),\n );\n\nconst firstEntryProblem = (\n entry: Listed,\n source: string,\n deviations: Deviations,\n): readonly Problem[] =>\n pipe(\n Arr.head(deviations.entries),\n Option.map(({ index }) =>\n problemAt(entry, source)(index, `This file is not read for upstream deviations. ${PLACE}`),\n ),\n Option.toArray,\n );\n\nconst problemsIn = (entry: Listed, source: string): readonly Problem[] => {\n if (isManifest(entry.name)) {\n return manifestProblems(entry, source);\n }\n if (Str.endsWith(NESTED_WORKSPACE)(entry.name)) {\n return firstEntryProblem(entry, source, workspaceDeviations(source));\n }\n return firstEntryProblem(entry, source, cargoDeviations(source));\n};\n\nconst isScanned = ({ name }: Listed): boolean =>\n isManifest(name) ||\n Str.endsWith(NESTED_WORKSPACE)(name) ||\n Str.endsWith(NESTED_CARGO)(name) ||\n CARGO_CONFIG.test(name);\n\n/** @internal */\nexport const checkScatteredDeviations = Effect.fn(\"checkScatteredDeviations\")(\n function* checkScatteredDeviations(root: string) {\n const listed = yield* listedFiles(root);\n return yield* scanText(pipe(listed, Arr.filter(isScanned)), problemsIn);\n },\n);\n"],"mappings":";;;;;;;AAIA,MAAMA,UAAQ;AACd,MAAM,eAAe;AAErB,MAAa,cACV,YACA,UAAoD;CACnD,MAAM,SAAS,KAAK,QAAQC,SAAI,MAAMD,SAAO,KAAK,GAAGC,SAAI,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;;ACbF,MAAM,eACJ;AAEF,MAAM,WAAW;AAEjB,MAAM,gBAAgB;AAEtB,MAAM,mBAAmB;AAOzB,MAAa,iBAAiB,EAAE,WAC9B,aAAa,KAAK,IAAI,KAAK,CAAC,SAAS,KAAK,IAAI;AAEhD,MAAa,kBAAkB,EAAE,WAA4B,cAAc,KAAK,IAAI;;AAGpF,MA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M,IAAI,GACvB,OAAO,iBAAiB,OAAO,MAAM;CAEvC,IAAID,SAAI,SAAS,gBAAgB,CAAC,CAAC,MAAM,IAAI,GAC3C,OAAO,kBAAkB,OAAO,QAAQ,oBAAoB,MAAM,CAAC;CAErE,OAAO,kBAAkB,OAAO,QAAQ,gBAAgB,MAAM,CAAC;AACjE;AAEA,MAAM,aAAa,EAAE,WACnB,WAAW,IAAI,KACfA,SAAI,SAAS,gBAAgB,CAAC,CAAC,IAAI,KACnCA,SAAI,SAAS,YAAY,CAAC,CAAC,IAAI,KAC/B,aAAa,KAAK,IAAI;;AAGxB,MAAa,2BAA2B,OAAO,GAAG,0BAA0B,CAAC,CAC3E,UAAU,yBAAyB,MAAc;CAC/C,MAAM,SAAS,OAAO,YAAY,IAAI;CACtC,OAAO,OAAO,SAAS,KAAK,QAAQC,MAAI,OAAO,SAAS,CAAC,GAAG,UAAU;AACxE,CACF"}
@@ -1,105 +0,0 @@
1
- import { Array, Config, Console, Effect, FileSystem, Option, Record, Redacted, Schema, Stream, String, pipe } from "effect";
2
- import { ChildProcess, ChildProcessSpawner } from "effect/process";
3
- import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http";
4
- import "effect/encoding";
5
- // ../github-workflow/src/shared/api/github.ts
6
- const API = "https://api.github.com";
7
- const HEADERS = {
8
- accept: "application/vnd.github+json",
9
- "user-agent": "@r_masseater/github-workflow",
10
- "x-github-api-version": "2022-11-28"
11
- };
12
- const requestTo = Effect.fn("requestTo")(function* requestTo(method, path) {
13
- const repository = yield* Config.String("GITHUB_REPOSITORY");
14
- const token = yield* Config.Redacted("GH_TOKEN").pipe(Config.orElse(() => Config.Redacted("GITHUB_TOKEN")));
15
- return HttpClientRequest.make(method)(`${API}/repos/${repository}/${path}`).pipe(HttpClientRequest.bearerToken(Redacted.value(token)), HttpClientRequest.setHeaders(HEADERS));
16
- });
17
- const execute = Effect.fn("execute")(function* execute(request) {
18
- const response = yield* (yield* HttpClient.HttpClient).execute(request);
19
- return yield* HttpClientResponse.filterStatusOk(response);
20
- });
21
- Effect.fn("withBody")(function* withBody(method, path, body) {
22
- const request = yield* requestTo(method, path);
23
- const filled = yield* HttpClientRequest.bodyJson(request, body);
24
- return yield* execute(filled);
25
- });
26
- // ../github-workflow/src/shared/lib/process.ts
27
- const SUCCESS = 0;
28
- const taggedError$1 = Schema.TaggedError;
29
- var CommandFailed = class extends taggedError$1()("CommandFailed", { message: Schema.String }) {};
30
- const failed = ({ command, args }) => CommandFailed.make({ message: `${command} ${Array.join(args, " ")} failed` });
31
- const exitCodeOf = Effect.fn("exitCodeOf")(function* exitCodeOf({ command, args, env, cwd }) {
32
- return yield* (yield* ChildProcessSpawner.ChildProcessSpawner).exitCode(ChildProcess.make(command, args, {
33
- cwd,
34
- env,
35
- extendEnv: true,
36
- stdin: "ignore",
37
- stdout: "inherit",
38
- stderr: "inherit"
39
- }));
40
- });
41
- const succeedsWith = (command) => exitCodeOf(command).pipe(Effect.map((code) => code === SUCCESS));
42
- const mustSucceedWith = (command) => succeedsWith(command).pipe(Effect.filterOrFail((passed) => passed, () => failed(command)), Effect.asVoid);
43
- const collected = Effect.fn("collected")(function* collected({ command, args, env, cwd }) {
44
- const handle = yield* ChildProcess.make(command, args, {
45
- cwd,
46
- env,
47
- extendEnv: true,
48
- stdin: "ignore",
49
- stderr: "inherit"
50
- });
51
- const [output, code] = yield* Effect.all([handle.stdout.pipe(Stream.decodeText(), Stream.mkString), handle.exitCode], { concurrency: "unbounded" });
52
- return {
53
- output,
54
- code
55
- };
56
- });
57
- const outputWith = (command) => collected(command).pipe(Effect.scoped, Effect.filterOrFail(({ code }) => code === SUCCESS, () => failed(command)), Effect.map(({ output }) => String.trim(output)));
58
- /** @internal */
59
- const succeeds = succeedsWith;
60
- /** @internal */
61
- const mustSucceed = mustSucceedWith;
62
- /** @internal */
63
- const outputOf = outputWith;
64
- // ../github-workflow/src/shared/lib/workflow.ts
65
- const taggedError = Schema.TaggedError;
66
- var WorkflowFailed = class extends taggedError()("WorkflowFailed", { message: Schema.String }) {};
67
- const appendTo = (variable, entries) => Effect.gen(function* appended() {
68
- const path = yield* Config.String(variable);
69
- const fs = yield* FileSystem.FileSystem;
70
- const lines = pipe(Record.toEntries(entries), Array.map(([name, value]) => `${name}=${value}\n`), Array.join(""));
71
- yield* fs.writeFileString(path, lines, { flag: "a" });
72
- });
73
- const outputsOf = (outputs) => appendTo("GITHUB_OUTPUT", outputs);
74
- /** @internal */
75
- const writeOutputs = outputsOf;
76
- const mask = (value) => Console.log(`::add-mask::${value}`);
77
- Effect.fn("fail")(function* fail(message) {
78
- yield* Console.log(`::error::${message}`);
79
- return yield* WorkflowFailed.make({ message });
80
- });
81
- // src/shared/lib/credential-broker.ts
82
- /** @internal */
83
- const BROKER = "https://credentials.masseater.dev/";
84
- const AUDIENCE = "masseater-dev-credential-broker";
85
- const IdToken = Schema.Struct({ value: Schema.String });
86
- /** @internal */
87
- const oidcToken = Effect.fn("broker.oidc")(function* oidcToken(requestUrl, requestToken) {
88
- const client = yield* HttpClient.HttpClient;
89
- const request = HttpClientRequest.get(`${requestUrl}&audience=${AUDIENCE}`).pipe(HttpClientRequest.bearerToken(Redacted.value(requestToken)));
90
- const response = yield* HttpClient.filterStatusOk(client).execute(request);
91
- const { value } = yield* HttpClientResponse.schemaBodyJson(IdToken)(response);
92
- yield* mask(value);
93
- return value;
94
- });
95
- /** @internal */
96
- const actionsOidcToken = Effect.gen(function* actionsOidcToken() {
97
- const requestUrl = yield* Config.option(Config.String("ACTIONS_ID_TOKEN_REQUEST_URL"));
98
- const requestToken = yield* Config.option(Config.Redacted("ACTIONS_ID_TOKEN_REQUEST_TOKEN"));
99
- if (Option.isNone(requestUrl) || Option.isNone(requestToken)) return Option.none();
100
- const token = yield* oidcToken(requestUrl.value, requestToken.value);
101
- return Option.some(token);
102
- });
103
- export { mustSucceed as a, writeOutputs as i, actionsOidcToken as n, outputOf as o, mask as r, succeeds as s, BROKER as t };
104
-
105
- //# sourceMappingURL=credential-broker-D8sFyowJ.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"credential-broker-D8sFyowJ.mjs","names":["taggedError","Arr","Str","Rec","Arr"],"sources":["../../github-workflow/src/shared/api/github.ts","../../github-workflow/src/shared/lib/process.ts","../../github-workflow/src/shared/lib/workflow.ts","../src/shared/lib/credential-broker.ts"],"sourcesContent":["import { Config, Effect, Redacted } from \"effect\";\nimport type { Schema } from \"effect\";\nimport { HttpClient, HttpClientRequest, HttpClientResponse } from \"effect/http\";\nimport type { HttpBody, HttpClientError, HttpMethod } from \"effect/http\";\n\nconst API = \"https://api.github.com\";\nconst HEADERS = {\n accept: \"application/vnd.github+json\",\n \"user-agent\": \"@r_masseater/github-workflow\",\n \"x-github-api-version\": \"2022-11-28\",\n};\n\n/** @internal */\nexport type Failure = Config.ConfigError | HttpBody.HttpBodyError | HttpClientError.HttpClientError;\n\n/** @internal */\nexport type Sent<Success> = Effect.Effect<Success, Failure, HttpClient.HttpClient>;\n\nconst requestTo = Effect.fn(\"requestTo\")(function* requestTo(\n method: HttpMethod.HttpMethod,\n path: string,\n) {\n const repository = yield* Config.String(\"GITHUB_REPOSITORY\");\n const token = yield* Config.Redacted(\"GH_TOKEN\").pipe(\n Config.orElse(() => Config.Redacted(\"GITHUB_TOKEN\")),\n );\n return HttpClientRequest.make(method)(`${API}/repos/${repository}/${path}`).pipe(\n HttpClientRequest.bearerToken(Redacted.value(token)),\n HttpClientRequest.setHeaders(HEADERS),\n );\n});\n\nconst execute = Effect.fn(\"execute\")(function* execute(\n request: HttpClientRequest.HttpClientRequest,\n) {\n const client = yield* HttpClient.HttpClient;\n const response = yield* client.execute(request);\n return yield* HttpClientResponse.filterStatusOk(response);\n});\n\nconst withBody = Effect.fn(\"withBody\")(function* withBody(\n method: HttpMethod.HttpMethod.WithBody,\n path: string,\n body: unknown,\n) {\n const request = yield* requestTo(method, path);\n const filled = yield* HttpClientRequest.bodyJson(request, body);\n return yield* execute(filled);\n});\n\nconst getJsonOf =\n <Codec extends Schema.Constraint>(schema: Codec) =>\n (\n path: string,\n ): Effect.Effect<\n Codec[\"Type\"],\n Failure | Schema.SchemaError,\n HttpClient.HttpClient | Codec[\"DecodingServices\"]\n > =>\n requestTo(\"GET\", path).pipe(\n Effect.flatMap(execute),\n Effect.flatMap(HttpClientResponse.schemaBodyJson(schema)),\n );\n\nconst postJsonOf =\n <Codec extends Schema.Constraint>(schema: Codec) =>\n ({\n path,\n body,\n }: Write): Effect.Effect<\n Codec[\"Type\"],\n Failure | Schema.SchemaError,\n HttpClient.HttpClient | Codec[\"DecodingServices\"]\n > =>\n withBody(\"POST\", path, body).pipe(Effect.flatMap(HttpClientResponse.schemaBodyJson(schema)));\n\nconst removeAt = (path: string): Sent<void> =>\n requestTo(\"DELETE\", path).pipe(Effect.flatMap(execute), Effect.asVoid);\n\n/** @internal */\nexport interface Write {\n readonly path: string;\n readonly body: unknown;\n}\n\nconst postTo = ({ path, body }: Write): Sent<void> =>\n withBody(\"POST\", path, body).pipe(Effect.asVoid);\n\nconst patchAt = ({ path, body }: Write): Sent<void> =>\n withBody(\"PATCH\", path, body).pipe(Effect.asVoid);\n\n/** @internal */\nexport const getJson = getJsonOf;\n\n/** @internal */\nexport const remove = removeAt;\n\n/** @internal */\nexport const post = postTo;\n\n/** @internal */\nexport const patch = patchAt;\n\n/** @internal */\nexport const postJson = postJsonOf;\n","import { Array as Arr, Effect, Schema, Stream, String as Str } from \"effect\";\nimport type { PlatformError } from \"effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nconst SUCCESS = 0;\n\nconst taggedError = Schema.TaggedError;\n\nexport class CommandFailed extends taggedError<CommandFailed, { readonly brand: unique symbol }>()(\n \"CommandFailed\",\n { message: Schema.String },\n) {}\n\nexport interface Command {\n readonly command: string;\n readonly args: readonly string[];\n readonly env?: Readonly<Record<string, string>>;\n readonly cwd?: string;\n}\n\n/** @internal */\nexport type Spawned<Success> = Effect.Effect<\n Success,\n CommandFailed | PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n>;\n\nconst failed = ({ command, args }: Command): CommandFailed =>\n CommandFailed.make({ message: `${command} ${Arr.join(args, \" \")} failed` });\n\nconst exitCodeOf = Effect.fn(\"exitCodeOf\")(function* exitCodeOf({\n command,\n args,\n env,\n cwd,\n}: Command) {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n return yield* spawner.exitCode(\n ChildProcess.make(command, args, {\n cwd,\n env,\n extendEnv: true,\n stdin: \"ignore\",\n stdout: \"inherit\",\n stderr: \"inherit\",\n }),\n );\n});\n\nconst succeedsWith = (command: Command): Spawned<boolean> =>\n exitCodeOf(command).pipe(Effect.map((code) => code === SUCCESS));\n\nconst mustSucceedWith = (command: Command): Spawned<void> =>\n succeedsWith(command).pipe(\n Effect.filterOrFail(\n (passed) => passed,\n () => failed(command),\n ),\n Effect.asVoid,\n );\n\nconst collected = Effect.fn(\"collected\")(function* collected({ command, args, env, cwd }: Command) {\n const handle = yield* ChildProcess.make(command, args, {\n cwd,\n env,\n extendEnv: true,\n stdin: \"ignore\",\n stderr: \"inherit\",\n });\n const [output, code] = yield* Effect.all(\n [handle.stdout.pipe(Stream.decodeText(), Stream.mkString), handle.exitCode],\n { concurrency: \"unbounded\" },\n );\n return { output, code };\n});\n\nconst outputWith = (command: Command): Spawned<string> =>\n collected(command).pipe(\n Effect.scoped,\n Effect.filterOrFail(\n ({ code }) => code === SUCCESS,\n () => failed(command),\n ),\n Effect.map(({ output }) => Str.trim(output)),\n );\n\n/** @internal */\nexport const succeeds = succeedsWith;\n\n/** @internal */\nexport const mustSucceed = mustSucceedWith;\n\nconst finishedWith = (command: Command): Spawned<Readonly<{ output: string; code: number }>> =>\n Effect.scoped(collected(command));\n\n/** @internal */\nexport const outputOf = outputWith;\n\n/** @internal */\nexport const finished = finishedWith;\n","import {\n Array as Arr,\n Config,\n Console,\n Effect,\n FileSystem,\n Record as Rec,\n Schema,\n pipe,\n} from \"effect\";\nimport type { PlatformError } from \"effect\";\n\n/** @internal */\nexport type Appended = Effect.Effect<\n void,\n Config.ConfigError | PlatformError.PlatformError,\n FileSystem.FileSystem\n>;\n\nconst taggedError = Schema.TaggedError;\n\nexport class WorkflowFailed extends taggedError<\n WorkflowFailed,\n { readonly brand: unique symbol }\n>()(\"WorkflowFailed\", { message: Schema.String }) {}\n\nconst appendTo = (variable: string, entries: Readonly<Record<string, string>>): Appended =>\n Effect.gen(function* appended() {\n const path = yield* Config.String(variable);\n const fs = yield* FileSystem.FileSystem;\n const lines = pipe(\n Rec.toEntries(entries),\n Arr.map(([name, value]) => `${name}=${value}\\n`),\n Arr.join(\"\"),\n );\n yield* fs.writeFileString(path, lines, { flag: \"a\" });\n });\n\nconst outputsOf = (outputs: Readonly<Record<string, string>>): Appended =>\n appendTo(\"GITHUB_OUTPUT\", outputs);\n\nconst envOf = (variables: Readonly<Record<string, string>>): Appended =>\n appendTo(\"GITHUB_ENV\", variables);\n\n/** @internal */\nexport const writeOutputs = outputsOf;\n\n/** @internal */\nexport const setEnv = envOf;\n\nexport const warn = (message: string): Effect.Effect<void> => Console.log(`::warning::${message}`);\n\nexport const mask = (value: string): Effect.Effect<void> => Console.log(`::add-mask::${value}`);\n\nexport const fail = Effect.fn(\"fail\")(function* fail(message: string) {\n yield* Console.log(`::error::${message}`);\n return yield* WorkflowFailed.make({ message });\n});\n","import { mask } from \"@r_masseater/github-workflow\";\nimport { Config, Effect, Option, Redacted, Schema } from \"effect\";\nimport { HttpClient, HttpClientRequest, HttpClientResponse } from \"effect/http\";\n\n/** @internal */\nexport const BROKER = \"https://credentials.masseater.dev/\";\n\nconst AUDIENCE = \"masseater-dev-credential-broker\";\n\nconst IdToken = Schema.Struct({ value: Schema.String });\n\n/** @internal */\nexport const oidcToken = Effect.fn(\"broker.oidc\")(function* oidcToken(\n requestUrl: string,\n requestToken: Redacted.Redacted,\n) {\n const client = yield* HttpClient.HttpClient;\n const request = HttpClientRequest.get(`${requestUrl}&audience=${AUDIENCE}`).pipe(\n HttpClientRequest.bearerToken(Redacted.value(requestToken)),\n );\n const response = yield* HttpClient.filterStatusOk(client).execute(request);\n const { value } = yield* HttpClientResponse.schemaBodyJson(IdToken)(response);\n yield* mask(value);\n return value;\n});\n\n/** @internal */\nexport const actionsOidcToken = Effect.gen(function* actionsOidcToken() {\n const requestUrl = yield* Config.option(Config.String(\"ACTIONS_ID_TOKEN_REQUEST_URL\"));\n const requestToken = yield* Config.option(Config.Redacted(\"ACTIONS_ID_TOKEN_REQUEST_TOKEN\"));\n if (Option.isNone(requestUrl) || Option.isNone(requestToken)) {\n return Option.none<string>();\n }\n const token = yield* oidcToken(requestUrl.value, requestToken.value);\n return Option.some(token);\n});\n"],"mappings":";;;;;AAKA,MAAM,MAAM;AACZ,MAAM,UAAU;CACd,QAAQ;CACR,cAAc;CACd,wBAAwB;AAC1B;AAQA,MAAM,YAAY,OAAO,GAAG,WAAW,CAAC,CAAC,UAAU,UACjD,QACA,MACA;CACA,MAAM,aAAa,OAAO,OAAO,OAAO,mBAAmB;CAC3D,MAAM,QAAQ,OAAO,OAAO,SAAS,UAAU,CAAC,CAAC,KAC/C,OAAO,aAAa,OAAO,SAAS,cAAc,CAAC,CACrD;CACA,OAAO,kBAAkB,KAAK,MAAM,CAAC,CAAC,GAAG,IAAI,SAAS,WAAW,GAAG,MAAM,CAAC,CAAC,KAC1E,kBAAkB,YAAY,SAAS,MAAM,KAAK,CAAC,GACnD,kBAAkB,WAAW,OAAO,CACtC;AACF,CAAC;AAED,MAAM,UAAU,OAAO,GAAG,SAAS,CAAC,CAAC,UAAU,QAC7C,SACA;CAEA,MAAM,WAAW,QAAO,OADF,WAAW,WAAA,CACF,QAAQ,OAAO;CAC9C,OAAO,OAAO,mBAAmB,eAAe,QAAQ;AAC1D,CAAC;AAEgB,OAAO,GAAG,UAAU,CAAC,CAAC,UAAU,SAC/C,QACA,MACA,MACA;CACA,MAAM,UAAU,OAAO,UAAU,QAAQ,IAAI;CAC7C,MAAM,SAAS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