@r_masseater/msch 0.86.0 → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/changed.mjs +2 -2
- package/dist/cli.mjs +252 -313
- package/dist/cli.mjs.map +1 -1
- package/dist/config.mjs +1 -1
- package/dist/config.mjs.map +1 -1
- package/dist/exits.mjs +2 -2
- package/dist/judge.mjs +2 -2
- package/dist/{lookup-report-VID9QVGU.mjs → lookup-report-jWcGgE_D.mjs} +2 -2
- package/dist/{lookup-report-VID9QVGU.mjs.map → lookup-report-jWcGgE_D.mjs.map} +1 -1
- package/dist/{output-DYnV3b5B.mjs → output-DMksIc-0.mjs} +2 -2
- package/dist/{output-DYnV3b5B.mjs.map → output-DMksIc-0.mjs.map} +1 -1
- package/dist/oxlint.mjs +1 -1
- package/dist/{pass-records-6XLhXZL3.mjs → pass-records-fctupGWy.mjs} +2 -2
- package/dist/{pass-records-6XLhXZL3.mjs.map → pass-records-fctupGWy.mjs.map} +1 -1
- package/dist/{problem-OJg859cN.mjs → problem-DGGF-vjW.mjs} +5 -4
- package/dist/problem-DGGF-vjW.mjs.map +1 -0
- package/dist/published.mjs +1 -1
- package/dist/refs.mjs +1 -1
- package/dist/unbumped.mjs +2 -2
- package/dist/{upstream-exits-2ut4fmJv.mjs → upstream-exits-BVey4j2q.mjs} +2 -2
- package/dist/{upstream-exits-2ut4fmJv.mjs.map → upstream-exits-BVey4j2q.mjs.map} +1 -1
- package/dist/upstream.mjs +1 -1
- package/package.json +3 -3
- package/dist/problem-OJg859cN.mjs.map +0 -1
package/dist/config.mjs
CHANGED
|
@@ -37,7 +37,7 @@ const FALLOW = pipe([
|
|
|
37
37
|
const CHECK = `TSRS_LINT_RUN_EXTERNAL_CODE=1 msch-changed --batch-sources ${String(1e3)} vp check --deny-warnings --continue-on-error`;
|
|
38
38
|
const AUDIT = "before=\"$(cksum pnpm-workspace.yaml)\"; vp pm audit --fix || exit; if [ \"$before\" != \"$(cksum pnpm-workspace.yaml)\" ]; then echo \"vp pm audit --fix rewrote pnpm-workspace.yaml. Run vp install and commit the diff.\" >&2; exit 1; fi";
|
|
39
39
|
const BROKER_TOKEN = `GH_TOKEN="\${GITHUB_APP_TOKEN:-$GH_TOKEN}"`;
|
|
40
|
-
const DAILY = `msch-exits;
|
|
40
|
+
const DAILY = `msch-exits; ${BROKER_TOKEN} msch-refs; refs=$?; ${BROKER_TOKEN} msch-upstream; upstream=$?; exit $((refs | upstream))`;
|
|
41
41
|
const tasksOf = ({ workspace, commands }) => {
|
|
42
42
|
const inputs = [
|
|
43
43
|
{ auto: true },
|
package/dist/config.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.mjs","names":["Arr","Rec","Arr","Rec","preset"],"sources":["../src/app/repository-tasks.ts","../src/app/repository-text.ts","../src/app/repository-config.ts"],"sourcesContent":["import { Array as Arr, Record as Rec, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport type { WorkspaceSettings } from \"#/features/build-workspace-settings/index.ts\";\n\ntype Tasks = NonNullable<NonNullable<UserConfig[\"run\"]>[\"tasks\"]>;\n\nexport interface TaskOptions {\n readonly workspace: WorkspaceSettings;\n readonly commands: Readonly<Record<string, string>>;\n}\n\nconst NOT_INPUTS = [\n \"!node_modules/.pnpm-store\",\n \"!node_modules/.pnpm-store/**\",\n \"!node_modules/.tmp\",\n \"!node_modules/.tmp/**\",\n \"!target/**\",\n \"!node_modules/.vitest-cache/**\",\n \"!node_modules/.cache/**\",\n];\n\nconst UNTRACKED_ENV = [\n \"CLOUDFLARE_ACCOUNT_ID\",\n \"CLOUDFLARE_AI_GATEWAY_ID\",\n \"CLOUDFLARE_API_TOKEN\",\n \"CLAUDECODE\",\n \"CLAUDE_CODE_REMOTE\",\n \"GITHUB_ACTIONS\",\n \"HTTPS_PROXY\",\n \"https_proxy\",\n \"NO_PROXY\",\n \"no_proxy\",\n \"SSL_CERT_FILE\",\n \"NODE_EXTRA_CA_CERTS\",\n];\n\nconst FALLOW_ARGS = [\n \"--skip dupes --fail-on-issues --quiet --format compact\",\n \"dead-code --no-production --fail-on-issues --quiet --format compact\",\n \"dead-code --no-production --quiet --format json | jq -n 'input | {prop_drilling_chains, thin_wrappers, duplicate_prop_shapes} | with_entries(select(.value | length > 0)) | if length > 0 then halt_error else empty end'\",\n \"dupes --fail-on-issues --quiet --format compact\",\n \"security --fail-on-issues --quiet\",\n];\n\nconst FALLOW = pipe(\n FALLOW_ARGS,\n Arr.map((args) => `FALLOW_TYPE_AWARE_BACKEND=tsrs fallow ${args}`),\n);\n\nconst CHECK_BATCH_SOURCES = 1000;\n\nconst CHECK = `TSRS_LINT_RUN_EXTERNAL_CODE=1 msch-changed --batch-sources ${String(CHECK_BATCH_SOURCES)} vp check --deny-warnings --continue-on-error`;\n\nconst AUDIT =\n 'before=\"$(cksum pnpm-workspace.yaml)\"; vp pm audit --fix || exit; if [ \"$before\" != \"$(cksum pnpm-workspace.yaml)\" ]; then echo \"vp pm audit --fix rewrote pnpm-workspace.yaml. Run vp install and commit the diff.\" >&2; exit 1; fi';\n\nconst BROKER_TOKEN = `GH_TOKEN=\"\\${GITHUB_APP_TOKEN:-$GH_TOKEN}\"`;\nconst DAILY = `msch-exits; exits=$?; ${BROKER_TOKEN} msch-refs; refs=$?; ${BROKER_TOKEN} msch-upstream; upstream=$?; exit $((exits | refs | upstream))`;\n\nexport const tasksOf = ({\n workspace,\n commands,\n}: TaskOptions): NonNullable<NonNullable<UserConfig[\"run\"]>[\"tasks\"]> => {\n const inputs = [{ auto: true }, ...workspace.ignoredDirectories, ...NOT_INPUTS];\n const checks: Tasks = {\n fallow: {\n command: FALLOW,\n cache: {\n input: [...inputs, \"!.fallow/**\", \"!**/dist/**\", \"!**/.fallow-verified\"],\n output: [],\n },\n },\n check: {\n command: CHECK,\n cache: { input: inputs, untrackedEnv: UNTRACKED_ENV },\n },\n test: {\n command: \"msch-changed vp test run --passWithNoTests\",\n dependsOn: [\"check\", ...workspace.tasks.native],\n cache: { input: [...inputs, \"!**/.cache/**\"] },\n },\n msch: { command: \"msch\", dependsOn: [\"check\", ...workspace.tasks.native], cache: false },\n audit: { command: AUDIT, cache: false },\n published: { command: \"msch-published\", cache: false },\n ...commands,\n };\n return {\n ...checks,\n daily: { command: DAILY, cache: false },\n verify: { command: [], dependsOn: [...workspace.tasks.verify, ...Rec.keys(checks)] },\n };\n};\n","import type { H56mConfig } from \"@r_masseater/h56m\";\nimport { betterleaks } from \"@r_masseater/h56m/presets\";\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Array as Arr, pipe } from \"effect\";\n\nimport { textlintFilters, textlintPresets } from \"#/features/define-lint-preset/index.ts\";\n\nexport interface TextOptions {\n readonly ignores?: readonly string[];\n readonly kanji?: readonly string[];\n readonly technicalWriting?: Readonly<Record<string, boolean | object>>;\n readonly rules?: Readonly<Record<string, boolean | object>>;\n readonly filters?: Readonly<Record<string, boolean | object>>;\n readonly sources?: NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"sources\"]>;\n}\n\nexport interface SecretOptions {\n readonly lines?: readonly string[];\n readonly paths?: readonly string[];\n}\n\nconst TEXT_IGNORES = [\"AGENTS.md\", \"CLAUDE.md\", \".agents/skills/**\", \"CHANGELOG.md\"];\nconst SENTENCE_LENGTH = 120;\nconst KANJI_RUN = 6;\nconst PUBLIC_LINES = [String.raw`\\bCF_BEACON_TOKEN = \"[0-9a-f]{32}\"`];\n\nexport const textlintOf = ({\n ignores = [],\n kanji = [],\n technicalWriting = {},\n rules = {},\n filters = {},\n sources = [],\n}: TextOptions): NonNullable<ToolSections[\"textlint\"]> => ({\n ignores: [...TEXT_IGNORES, ...ignores],\n presets: textlintPresets,\n filterModules: textlintFilters,\n reportUnusedDirectives: true,\n sources: pipe(\n sources,\n Arr.map((source) => ({ ...source, filters: { comments: true, ...source.filters } })),\n ),\n filters: { comments: true, ...filters },\n rules: {\n \"@textlint-ja/preset-ai-writing\": true,\n \"@r_masseater/preset-ja\": true,\n \"preset-ja-technical-writing\": {\n \"sentence-length\": { max: SENTENCE_LENGTH },\n \"ja-no-mixed-period\": { allowPeriodMarks: [\":\"] },\n \"no-mix-dearu-desumasu\": { preferInBody: \"である\", preferInList: \"である\" },\n \"max-kanji-continuous-len\": { max: KANJI_RUN, allow: [...kanji] },\n ...technicalWriting,\n },\n ...rules,\n },\n});\n\nconst anyOf =\n (subject: string) =>\n (patterns: readonly string[]): readonly string[] => {\n if (Arr.isReadonlyArrayEmpty(patterns)) {\n return [];\n }\n const listed = pipe(\n patterns,\n Arr.map((pattern) => `\\`${pattern}\\``),\n Arr.join(\", \"),\n );\n return [`matchesAny(${subject}, [${listed}])`];\n };\n\nexport const secretsOf = ({ lines = [], paths = [] }: SecretOptions): H56mConfig => ({\n extend: { path: betterleaks },\n filter: pipe(\n [...anyOf(\"finding.line\")([...PUBLIC_LINES, ...lines]), ...anyOf(`attributes[\"path\"]`)(paths)],\n Arr.join(\" || \"),\n ),\n});\n","import { fileURLToPath } from \"node:url\";\n\nimport { recommended } from \"@r_masseater/fu4/presets\";\nimport { Option, Record as Rec, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\nimport type { OxlintOverride } from \"vite-plus/lint\";\n\nimport type { WorkspaceSettings } from \"#/features/build-workspace-settings/index.ts\";\nimport type { MarkdownOptions } from \"#/features/define-lint-preset/index.ts\";\nimport {\n decisionTestRules,\n generated,\n lint as preset,\n markdownOf,\n requiredStack,\n structureOf,\n} from \"#/features/define-lint-preset/index.ts\";\n\nimport { tasksOf } from \"./repository-tasks.ts\";\nimport { secretsOf, textlintOf } from \"./repository-text.ts\";\nimport type { SecretOptions, TextOptions } from \"./repository-text.ts\";\n\nexport interface RepositoryOptions {\n readonly workspace: WorkspaceSettings;\n readonly overrides?: readonly OxlintOverride[];\n readonly secrets?: SecretOptions;\n readonly textlint?: TextOptions;\n readonly markdown?: MarkdownOptions;\n readonly run?: {\n readonly tasks?: Readonly<Record<string, string>>;\n readonly remoteCache?: string;\n };\n}\n\ninterface SharedCache {\n readonly scripts: true;\n readonly tasks: true;\n readonly remote: { readonly url: string };\n}\n\nconst cacheOf = (remoteCache: string | undefined): SharedCache | true =>\n pipe(\n Option.fromNullishOr(remoteCache),\n Option.match({\n onNone: (): SharedCache | true => true,\n onSome: (url) => ({ scripts: true, tasks: true, remote: { url } }),\n }),\n );\n\ntype Allowed = NonNullable<NonNullable<UserConfig[\"dependencyRules\"]>[\"allowed\"]>;\n\nconst allowedIn = (\n allowances: WorkspaceSettings[\"devDependencies\"],\n field: \"dependencies\" | \"devDependencies\",\n): Allowed =>\n pipe(\n allowances,\n Rec.map(({ workspaces, dependencies }) => ({ workspaces, dependencies, fields: [field] })),\n );\n\nconst COMMIT_CONVENTION = fileURLToPath(import.meta.resolve(\"@commitlint/config-conventional\"));\n\nconst lintOf = ({\n workspace,\n overrides = [],\n}: RepositoryOptions): NonNullable<UserConfig[\"lint\"]> => ({\n ...preset,\n ignorePatterns: [...generated, ...workspace.lint.ignorePatterns],\n overrides: [\n ...preset.overrides,\n {\n files: [...workspace.lint.shadcnUi],\n rules: { \"react/jsx-props-no-spreading\": \"off\" },\n },\n {\n files: [\n ...workspace.lint.publicEntries,\n ...workspace.lint.deployEntries,\n ...workspace.lint.siteEntries,\n ],\n rules: { \"import/no-default-export\": \"off\" },\n },\n ...overrides,\n ...workspace.lint.overrides,\n { files: [\"**/*.test.ts\"], rules: decisionTestRules },\n ],\n});\n\nexport const repositoryConfig = (options: RepositoryOptions): UserConfig => {\n const { workspace, secrets = {}, textlint = {}, markdown = {}, run = {} } = options;\n return {\n commitlint: { extends: [COMMIT_CONVENTION] },\n dependencyRules: {\n allowed: {\n ...allowedIn(workspace.devDependencies, \"devDependencies\"),\n ...allowedIn(workspace.dependencies, \"dependencies\"),\n },\n banned: requiredStack,\n peerRanges: \"intersect\",\n },\n h56m: secretsOf(secrets),\n wism: structureOf({\n members: workspace.members,\n ignorePatterns: workspace.lint.ignorePatterns,\n }),\n textlint: textlintOf(textlint),\n y8: markdownOf(markdown),\n fu4: recommended(),\n test: { projects: [...workspace.testProjects], passWithNoTests: true },\n staged: { \"*\": \"vp fmt --no-error-on-unmatched-pattern\" },\n fmt: {\n ignorePatterns: [...generated, ...workspace.lint.ignorePatterns],\n sortImports: true,\n sortTailwindcss: true,\n sortPackageJson: true,\n },\n lint: lintOf(options),\n run: {\n cache: cacheOf(run.remoteCache),\n tasks: tasksOf({ workspace, commands: run.tasks ?? {} }),\n },\n };\n};\n"],"mappings":";;;;;;AAYA,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAUA,MAAM,SAAS,KACb;CARA;CACA;CACA;CACA;CACA;AAIU,GACVA,MAAI,KAAK,SAAS,yCAAyC,MAAM,CACnE;AAIA,MAAM,QAAQ,8DAA8D,OAAO,GAAmB,EAAE;AAExG,MAAM,QACJ;AAEF,MAAM,eAAe;AACrB,MAAM,QAAQ,yBAAyB,aAAa,uBAAuB,aAAa;AAExF,MAAa,WAAW,EACtB,WACA,eACuE;CACvE,MAAM,SAAS;EAAC,EAAE,MAAM,KAAK;EAAG,GAAG,UAAU;EAAoB,GAAG;CAAU;CAC9E,MAAM,SAAgB;EACpB,QAAQ;GACN,SAAS;GACT,OAAO;IACL,OAAO;KAAC,GAAG;KAAQ;KAAe;KAAe;IAAsB;IACvE,QAAQ,CAAC;GACX;EACF;EACA,OAAO;GACL,SAAS;GACT,OAAO;IAAE,OAAO;IAAQ,cAAc;GAAc;EACtD;EACA,MAAM;GACJ,SAAS;GACT,WAAW,CAAC,SAAS,GAAG,UAAU,MAAM,MAAM;GAC9C,OAAO,EAAE,OAAO,CAAC,GAAG,QAAQ,eAAe,EAAE;EAC/C;EACA,MAAM;GAAE,SAAS;GAAQ,WAAW,CAAC,SAAS,GAAG,UAAU,M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AW,UAAU,CAAC,GAAG,WAAW,CAAC,GAAG,WAAW,CAAC,GAAG,MAAM,CAAC,MAAM;CAC5E,OAAO;EACL,YAAY,EAAE,SAAS,CAAC,iBAAiB,EAAE;EAC3C,iBAAiB;GACf,SAAS;IACP,GAAG,UAAU,UAAU,iBAAiB,iBAAiB;IACzD,GAAG,UAAU,UAAU,cAAc,cAAc;GACrD;GACA,QAAQ;GACR,YAAY;EACd;EACA,MAAM,UAAU,OAAO;EACvB,MAAM,YAAY;GAChB,SAAS,UAAU;GACnB,gBAAgB,UAAU,KAAK;EACjC,CAAC;EACD,UAAU,WAAW,QAAQ;EAC7B,IAAI,WAAW,QAAQ;EACvB,KAAK,YAAY;EACjB,MAAM;GAAE,UAAU,CAAC,GAAG,UAAU,YAAY;GAAG,iBAAiB;EAAK;EACrE,QAAQ,EAAE,KAAK,yCAAyC;EACxD,KAAK;GACH,gBAAgB,CAAC,GAAG,WAAW,GAAG,UAAU,KAAK,cAAc;GAC/D,aAAa;GACb,iBAAiB;GACjB,iBAAiB;EACnB;EACA,MAAM,OAAO,OAAO;EACpB,KAAK;GACH,OAAO,QAAQ,IAAI,WAAW;GAC9B,OAAO,QAAQ;IAAE;IAAW,UAAU,IAAI,SAAS,CAAC;GAAE,CAAC;EACzD;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"config.mjs","names":["Arr","Rec","Arr","Rec","preset"],"sources":["../src/app/repository-tasks.ts","../src/app/repository-text.ts","../src/app/repository-config.ts"],"sourcesContent":["import { Array as Arr, Record as Rec, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport type { WorkspaceSettings } from \"#/features/build-workspace-settings/index.ts\";\n\ntype Tasks = NonNullable<NonNullable<UserConfig[\"run\"]>[\"tasks\"]>;\n\nexport interface TaskOptions {\n readonly workspace: WorkspaceSettings;\n readonly commands: Readonly<Record<string, string>>;\n}\n\nconst NOT_INPUTS = [\n \"!node_modules/.pnpm-store\",\n \"!node_modules/.pnpm-store/**\",\n \"!node_modules/.tmp\",\n \"!node_modules/.tmp/**\",\n \"!target/**\",\n \"!node_modules/.vitest-cache/**\",\n \"!node_modules/.cache/**\",\n];\n\nconst UNTRACKED_ENV = [\n \"CLOUDFLARE_ACCOUNT_ID\",\n \"CLOUDFLARE_AI_GATEWAY_ID\",\n \"CLOUDFLARE_API_TOKEN\",\n \"CLAUDECODE\",\n \"CLAUDE_CODE_REMOTE\",\n \"GITHUB_ACTIONS\",\n \"HTTPS_PROXY\",\n \"https_proxy\",\n \"NO_PROXY\",\n \"no_proxy\",\n \"SSL_CERT_FILE\",\n \"NODE_EXTRA_CA_CERTS\",\n];\n\nconst FALLOW_ARGS = [\n \"--skip dupes --fail-on-issues --quiet --format compact\",\n \"dead-code --no-production --fail-on-issues --quiet --format compact\",\n \"dead-code --no-production --quiet --format json | jq -n 'input | {prop_drilling_chains, thin_wrappers, duplicate_prop_shapes} | with_entries(select(.value | length > 0)) | if length > 0 then halt_error else empty end'\",\n \"dupes --fail-on-issues --quiet --format compact\",\n \"security --fail-on-issues --quiet\",\n];\n\nconst FALLOW = pipe(\n FALLOW_ARGS,\n Arr.map((args) => `FALLOW_TYPE_AWARE_BACKEND=tsrs fallow ${args}`),\n);\n\nconst CHECK_BATCH_SOURCES = 1000;\n\nconst CHECK = `TSRS_LINT_RUN_EXTERNAL_CODE=1 msch-changed --batch-sources ${String(CHECK_BATCH_SOURCES)} vp check --deny-warnings --continue-on-error`;\n\nconst AUDIT =\n 'before=\"$(cksum pnpm-workspace.yaml)\"; vp pm audit --fix || exit; if [ \"$before\" != \"$(cksum pnpm-workspace.yaml)\" ]; then echo \"vp pm audit --fix rewrote pnpm-workspace.yaml. Run vp install and commit the diff.\" >&2; exit 1; fi';\n\nconst BROKER_TOKEN = `GH_TOKEN=\"\\${GITHUB_APP_TOKEN:-$GH_TOKEN}\"`;\nconst DAILY = `msch-exits; ${BROKER_TOKEN} msch-refs; refs=$?; ${BROKER_TOKEN} msch-upstream; upstream=$?; exit $((refs | upstream))`;\n\nexport const tasksOf = ({\n workspace,\n commands,\n}: TaskOptions): NonNullable<NonNullable<UserConfig[\"run\"]>[\"tasks\"]> => {\n const inputs = [{ auto: true }, ...workspace.ignoredDirectories, ...NOT_INPUTS];\n const checks: Tasks = {\n fallow: {\n command: FALLOW,\n cache: {\n input: [...inputs, \"!.fallow/**\", \"!**/dist/**\", \"!**/.fallow-verified\"],\n output: [],\n },\n },\n check: {\n command: CHECK,\n cache: { input: inputs, untrackedEnv: UNTRACKED_ENV },\n },\n test: {\n command: \"msch-changed vp test run --passWithNoTests\",\n dependsOn: [\"check\", ...workspace.tasks.native],\n cache: { input: [...inputs, \"!**/.cache/**\"] },\n },\n msch: { command: \"msch\", dependsOn: [\"check\", ...workspace.tasks.native], cache: false },\n audit: { command: AUDIT, cache: false },\n published: { command: \"msch-published\", cache: false },\n ...commands,\n };\n return {\n ...checks,\n daily: { command: DAILY, cache: false },\n verify: { command: [], dependsOn: [...workspace.tasks.verify, ...Rec.keys(checks)] },\n };\n};\n","import type { H56mConfig } from \"@r_masseater/h56m\";\nimport { betterleaks } from \"@r_masseater/h56m/presets\";\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Array as Arr, pipe } from \"effect\";\n\nimport { textlintFilters, textlintPresets } from \"#/features/define-lint-preset/index.ts\";\n\nexport interface TextOptions {\n readonly ignores?: readonly string[];\n readonly kanji?: readonly string[];\n readonly technicalWriting?: Readonly<Record<string, boolean | object>>;\n readonly rules?: Readonly<Record<string, boolean | object>>;\n readonly filters?: Readonly<Record<string, boolean | object>>;\n readonly sources?: NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"sources\"]>;\n}\n\nexport interface SecretOptions {\n readonly lines?: readonly string[];\n readonly paths?: readonly string[];\n}\n\nconst TEXT_IGNORES = [\"AGENTS.md\", \"CLAUDE.md\", \".agents/skills/**\", \"CHANGELOG.md\"];\nconst SENTENCE_LENGTH = 120;\nconst KANJI_RUN = 6;\nconst PUBLIC_LINES = [String.raw`\\bCF_BEACON_TOKEN = \"[0-9a-f]{32}\"`];\n\nexport const textlintOf = ({\n ignores = [],\n kanji = [],\n technicalWriting = {},\n rules = {},\n filters = {},\n sources = [],\n}: TextOptions): NonNullable<ToolSections[\"textlint\"]> => ({\n ignores: [...TEXT_IGNORES, ...ignores],\n presets: textlintPresets,\n filterModules: textlintFilters,\n reportUnusedDirectives: true,\n sources: pipe(\n sources,\n Arr.map((source) => ({ ...source, filters: { comments: true, ...source.filters } })),\n ),\n filters: { comments: true, ...filters },\n rules: {\n \"@textlint-ja/preset-ai-writing\": true,\n \"@r_masseater/preset-ja\": true,\n \"preset-ja-technical-writing\": {\n \"sentence-length\": { max: SENTENCE_LENGTH },\n \"ja-no-mixed-period\": { allowPeriodMarks: [\":\"] },\n \"no-mix-dearu-desumasu\": { preferInBody: \"である\", preferInList: \"である\" },\n \"max-kanji-continuous-len\": { max: KANJI_RUN, allow: [...kanji] },\n ...technicalWriting,\n },\n ...rules,\n },\n});\n\nconst anyOf =\n (subject: string) =>\n (patterns: readonly string[]): readonly string[] => {\n if (Arr.isReadonlyArrayEmpty(patterns)) {\n return [];\n }\n const listed = pipe(\n patterns,\n Arr.map((pattern) => `\\`${pattern}\\``),\n Arr.join(\", \"),\n );\n return [`matchesAny(${subject}, [${listed}])`];\n };\n\nexport const secretsOf = ({ lines = [], paths = [] }: SecretOptions): H56mConfig => ({\n extend: { path: betterleaks },\n filter: pipe(\n [...anyOf(\"finding.line\")([...PUBLIC_LINES, ...lines]), ...anyOf(`attributes[\"path\"]`)(paths)],\n Arr.join(\" || \"),\n ),\n});\n","import { fileURLToPath } from \"node:url\";\n\nimport { recommended } from \"@r_masseater/fu4/presets\";\nimport { Option, Record as Rec, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\nimport type { OxlintOverride } from \"vite-plus/lint\";\n\nimport type { WorkspaceSettings } from \"#/features/build-workspace-settings/index.ts\";\nimport type { MarkdownOptions } from \"#/features/define-lint-preset/index.ts\";\nimport {\n decisionTestRules,\n generated,\n lint as preset,\n markdownOf,\n requiredStack,\n structureOf,\n} from \"#/features/define-lint-preset/index.ts\";\n\nimport { tasksOf } from \"./repository-tasks.ts\";\nimport { secretsOf, textlintOf } from \"./repository-text.ts\";\nimport type { SecretOptions, TextOptions } from \"./repository-text.ts\";\n\nexport interface RepositoryOptions {\n readonly workspace: WorkspaceSettings;\n readonly overrides?: readonly OxlintOverride[];\n readonly secrets?: SecretOptions;\n readonly textlint?: TextOptions;\n readonly markdown?: MarkdownOptions;\n readonly run?: {\n readonly tasks?: Readonly<Record<string, string>>;\n readonly remoteCache?: string;\n };\n}\n\ninterface SharedCache {\n readonly scripts: true;\n readonly tasks: true;\n readonly remote: { readonly url: string };\n}\n\nconst cacheOf = (remoteCache: string | undefined): SharedCache | true =>\n pipe(\n Option.fromNullishOr(remoteCache),\n Option.match({\n onNone: (): SharedCache | true => true,\n onSome: (url) => ({ scripts: true, tasks: true, remote: { url } }),\n }),\n );\n\ntype Allowed = NonNullable<NonNullable<UserConfig[\"dependencyRules\"]>[\"allowed\"]>;\n\nconst allowedIn = (\n allowances: WorkspaceSettings[\"devDependencies\"],\n field: \"dependencies\" | \"devDependencies\",\n): Allowed =>\n pipe(\n allowances,\n Rec.map(({ workspaces, dependencies }) => ({ workspaces, dependencies, fields: [field] })),\n );\n\nconst COMMIT_CONVENTION = fileURLToPath(import.meta.resolve(\"@commitlint/config-conventional\"));\n\nconst lintOf = ({\n workspace,\n overrides = [],\n}: RepositoryOptions): NonNullable<UserConfig[\"lint\"]> => ({\n ...preset,\n ignorePatterns: [...generated, ...workspace.lint.ignorePatterns],\n overrides: [\n ...preset.overrides,\n {\n files: [...workspace.lint.shadcnUi],\n rules: { \"react/jsx-props-no-spreading\": \"off\" },\n },\n {\n files: [\n ...workspace.lint.publicEntries,\n ...workspace.lint.deployEntries,\n ...workspace.lint.siteEntries,\n ],\n rules: { \"import/no-default-export\": \"off\" },\n },\n ...overrides,\n ...workspace.lint.overrides,\n { files: [\"**/*.test.ts\"], rules: decisionTestRules },\n ],\n});\n\nexport const repositoryConfig = (options: RepositoryOptions): UserConfig => {\n const { workspace, secrets = {}, textlint = {}, markdown = {}, run = {} } = options;\n return {\n commitlint: { extends: [COMMIT_CONVENTION] },\n dependencyRules: {\n allowed: {\n ...allowedIn(workspace.devDependencies, \"devDependencies\"),\n ...allowedIn(workspace.dependencies, \"dependencies\"),\n },\n banned: requiredStack,\n peerRanges: \"intersect\",\n },\n h56m: secretsOf(secrets),\n wism: structureOf({\n members: workspace.members,\n ignorePatterns: workspace.lint.ignorePatterns,\n }),\n textlint: textlintOf(textlint),\n y8: markdownOf(markdown),\n fu4: recommended(),\n test: { projects: [...workspace.testProjects], passWithNoTests: true },\n staged: { \"*\": \"vp fmt --no-error-on-unmatched-pattern\" },\n fmt: {\n ignorePatterns: [...generated, ...workspace.lint.ignorePatterns],\n sortImports: true,\n sortTailwindcss: true,\n sortPackageJson: true,\n },\n lint: lintOf(options),\n run: {\n cache: cacheOf(run.remoteCache),\n tasks: tasksOf({ workspace, commands: run.tasks ?? {} }),\n },\n };\n};\n"],"mappings":";;;;;;AAYA,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAUA,MAAM,SAAS,KACb;CARA;CACA;CACA;CACA;CACA;AAIU,GACVA,MAAI,KAAK,SAAS,yCAAyC,MAAM,CACnE;AAIA,MAAM,QAAQ,8DAA8D,OAAO,GAAmB,EAAE;AAExG,MAAM,QACJ;AAEF,MAAM,eAAe;AACrB,MAAM,QAAQ,eAAe,aAAa,uBAAuB,aAAa;AAE9E,MAAa,WAAW,EACtB,WACA,eACuE;CACvE,MAAM,SAAS;EAAC,EAAE,MAAM,KAAK;EAAG,GAAG,UAAU;EAAoB,GAAG;CAAU;CAC9E,MAAM,SAAgB;EACpB,QAAQ;GACN,SAAS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|
|
2
|
-
import { t as lookupReport } from "./lookup-report-
|
|
2
|
+
import { t as lookupReport } from "./lookup-report-jWcGgE_D.mjs";
|
|
3
3
|
import { t as runCli } from "./runtime-CFZ41rB0.mjs";
|
|
4
|
-
import { n as upstreamExitsMet } from "./upstream-exits-
|
|
4
|
+
import { n as upstreamExitsMet } from "./upstream-exits-BVey4j2q.mjs";
|
|
5
5
|
import { n as RepositoryFiles } from "./repository-files-C2gVviac.mjs";
|
|
6
6
|
import { Array, Effect, Schema, pipe } from "effect";
|
|
7
7
|
// bin/msch-exits.ts
|
package/dist/judge.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as writeProblems, n as failWhenAny, r as writeJsonProblems } from "./output-
|
|
2
|
+
import { i as writeProblems, n as failWhenAny, r as writeJsonProblems } from "./output-DMksIc-0.mjs";
|
|
3
3
|
import { t as runCli } from "./runtime-CFZ41rB0.mjs";
|
|
4
4
|
import { n as DECISION_TIMEOUT_MS, t as DECISION_MODEL } from "./config-BBdsNPSO.mjs";
|
|
5
|
-
import { a as problemAtPosition, o as problemInFile, s as sortProblems } from "./problem-
|
|
5
|
+
import { a as problemAtPosition, o as problemInFile, s as sortProblems } from "./problem-DGGF-vjW.mjs";
|
|
6
6
|
import { n as RepositoryFiles } from "./repository-files-C2gVviac.mjs";
|
|
7
7
|
import { t as JSON_FLAG } from "./cli-contract-D7btWrEu.mjs";
|
|
8
8
|
import { Array, Effect, FileSystem, Option, Order, Path, Schema, Stdio, Stream, String as String$1, pipe } from "effect";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as JSON_FLAG } from "./cli-contract-D7btWrEu.mjs";
|
|
2
2
|
import { n as RepositoryFiles } from "./repository-files-C2gVviac.mjs";
|
|
3
|
-
import { a as writeStdout, t as ProblemsFound } from "./output-
|
|
3
|
+
import { a as writeStdout, t as ProblemsFound } from "./output-DMksIc-0.mjs";
|
|
4
4
|
import { Array, Effect, Order, Schema, Stdio, pipe } from "effect";
|
|
5
5
|
// src/app/lookup-report.ts
|
|
6
6
|
const NONE_FOUND = 0;
|
|
@@ -26,4 +26,4 @@ const lookupReport = ({ row, rows, describe }) => Effect.gen(function* report()
|
|
|
26
26
|
});
|
|
27
27
|
export { lookupReport as t };
|
|
28
28
|
|
|
29
|
-
//# sourceMappingURL=lookup-report-
|
|
29
|
+
//# sourceMappingURL=lookup-report-jWcGgE_D.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup-report-
|
|
1
|
+
{"version":3,"file":"lookup-report-jWcGgE_D.mjs","names":["Arr"],"sources":["../src/app/lookup-report.ts"],"sourcesContent":["import { Array as Arr, Effect, Order, Schema, Stdio, pipe } from \"effect\";\n\nimport { JSON_FLAG } from \"#/shared/lib/cli-contract.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { ProblemsFound, writeStdout } from \"./output.ts\";\n\nconst NONE_FOUND = 0;\nconst LINE_BREAK = \"\\n\";\n\nconst byPlace = Order.Struct({ file: Order.String, line: Order.Number });\n\n/** @internal */\nexport interface Place {\n readonly file: string;\n readonly line: number;\n}\n\n/** @internal */\nexport interface LookupReport<Row extends Place, Failure, Requirements> {\n readonly row: Schema.Codec<Row>;\n readonly rows: (root: string) => Effect.Effect<readonly Row[], Failure, Requirements>;\n readonly describe: (row: Row) => string;\n}\n\nconst textOf =\n <Row extends Place>(row: Schema.Codec<Row>, describe: (row: Row) => string) =>\n (json: boolean, rows: readonly Row[]): Effect.Effect<string, Schema.SchemaError> => {\n if (json) {\n return Schema.encodeEffect(row.pipe(Schema.Array, Schema.fromJsonString))(rows);\n }\n return Effect.succeed(\n pipe(\n rows,\n Arr.map((found) => `${describe(found)}${LINE_BREAK}`),\n Arr.join(\"\"),\n ),\n );\n };\n\n/** @internal */\nexport const lookupReport = <Row extends Place, Failure, Requirements>({\n row,\n rows,\n describe,\n}: LookupReport<Row, Failure, Requirements>): Effect.Effect<\n number,\n Failure | Schema.SchemaError | ProblemsFound,\n Requirements | RepositoryFiles | Stdio.Stdio\n> =>\n Effect.gen(function* report() {\n const stdio = yield* Stdio.Stdio;\n const files = yield* RepositoryFiles;\n const args = yield* stdio.args;\n const found = yield* rows(files.resolve(\".\"));\n const text = yield* textOf(row, describe)(\n Arr.contains(args, JSON_FLAG),\n Arr.sort(found, byPlace),\n );\n yield* writeStdout(text);\n if (found.length > NONE_FOUND) {\n return yield* ProblemsFound.make({ count: found.length });\n }\n return NONE_FOUND;\n });\n"],"mappings":";;;;;AAOA,MAAM,aAAa;AACnB,MAAM,aAAa;AAEnB,MAAM,UAAU,MAAM,OAAO;CAAE,MAAM,MAAM;CAAQ,MAAM,MAAM;AAAO,CAAC;AAevE,MAAM,UACgB,KAAwB,cAC3C,MAAe,SAAoE;CAClF,IAAI,MACF,OAAO,OAAO,aAAa,IAAI,KAAK,OAAO,OAAO,OAAO,cAAc,CAAC,CAAC,CAAC,IAAI;CAEhF,OAAO,OAAO,QACZ,KACE,MACAA,MAAI,KAAK,UAAU,GAAG,SAAS,KAAK,IAAI,YAAY,GACpDA,MAAI,KAAK,EAAE,CACb,CACF;AACF;;AAGF,MAAa,gBAA0D,EACrE,KACA,MACA,eAMA,OAAO,IAAI,UAAU,SAAS;CAC5B,MAAM,QAAQ,OAAO,MAAM;CAC3B,MAAM,QAAQ,OAAO;CACrB,MAAM,OAAO,OAAO,MAAM;CAC1B,MAAM,QAAQ,OAAO,KAAK,MAAM,QAAQ,GAAG,CAAC;CAC5C,MAAM,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC,CACvCA,MAAI,SAAS,MAAM,SAAS,GAC5BA,MAAI,KAAK,OAAO,OAAO,CACzB;CACA,OAAO,YAAY,IAAI;CACvB,IAAI,MAAM,SAAS,YACjB,OAAO,OAAO,cAAc,KAAK,EAAE,OAAO,MAAM,OAAO,CAAC;CAE1D,OAAO;AACT,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as formatProblem, t as ProblemList } from "./problem-
|
|
1
|
+
import { r as formatProblem, t as ProblemList } from "./problem-DGGF-vjW.mjs";
|
|
2
2
|
import { n as RepositoryFiles } from "./repository-files-C2gVviac.mjs";
|
|
3
3
|
import { Array, Effect, Runtime, Schema, Stdio, Stream, pipe } from "effect";
|
|
4
4
|
// src/app/output.ts
|
|
@@ -30,4 +30,4 @@ const failWhenAny = (count) => {
|
|
|
30
30
|
};
|
|
31
31
|
export { writeStdout as a, writeProblems as i, failWhenAny as n, writeJsonProblems as r, ProblemsFound as t };
|
|
32
32
|
|
|
33
|
-
//# sourceMappingURL=output-
|
|
33
|
+
//# sourceMappingURL=output-DMksIc-0.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-
|
|
1
|
+
{"version":3,"file":"output-DMksIc-0.mjs","names":["Arr"],"sources":["../src/app/output.ts"],"sourcesContent":["import { Array as Arr, Effect, Runtime, Schema, Stdio, Stream, pipe } from \"effect\";\n\nimport { ProblemList, formatProblem } from \"#/shared/lib/problem.ts\";\nimport type { Problem } from \"#/shared/lib/problem.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst taggedError = Schema.TaggedError;\nconst NO_PROBLEMS = 0;\n\nexport class ProblemsFound extends taggedError<ProblemsFound, { readonly brand: unique symbol }>()(\n \"ProblemsFound\",\n {\n count: Schema.Finite,\n },\n) {\n public override readonly [Runtime.errorReported] = false;\n}\n\n/** @internal */\nexport const writeStdout = Effect.fn(\"writeStdout\")(function* writeStdout(text: string) {\n const stdio = yield* Stdio.Stdio;\n yield* Stream.make(text).pipe(Stream.run(stdio.stdout()), Effect.orDie);\n});\n\n/** @internal */\nexport const writeProblems =\n (root: string) =>\n (problems: readonly Problem[]): Effect.Effect<void, never, RepositoryFiles | Stdio.Stdio> =>\n Effect.gen(function* report() {\n const files = yield* RepositoryFiles;\n const format = formatProblem((file) => files.relative(root, file));\n yield* writeStdout(\n pipe(\n problems,\n Arr.map((problem) => `${format(problem)}\\n`),\n Arr.join(\"\"),\n ),\n );\n });\n\n/** @internal */\nexport const writeJsonProblems = Effect.fn(\"writeJsonProblems\")(function* writeJsonProblems(\n problems: readonly Problem[],\n) {\n const text = yield* Schema.encodeEffect(Schema.fromJsonString(ProblemList))(problems);\n return yield* writeStdout(text);\n});\n\n/** @internal */\nexport const failWhenAny = (count: number): Effect.Effect<void, ProblemsFound> => {\n if (count > NO_PROBLEMS) {\n return Effect.fail(ProblemsFound.make({ count }));\n }\n return Effect.void;\n};\n"],"mappings":";;;;AAMA,MAAM,cAAc,OAAO;AAC3B,MAAM,cAAc;AAEpB,IAAa,gBAAb,cAAmC,YAA8D,CAAC,CAChG,iBACA,EACE,OAAO,OAAO,OAChB,CACF,CAAC,CAAC;CACA,CAA0B,QAAQ,iBAAiB;AACrD;;AAGA,MAAa,cAAc,OAAO,GAAG,aAAa,CAAC,CAAC,UAAU,YAAY,MAAc;CACtF,MAAM,QAAQ,OAAO,MAAM;CAC3B,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,KAAK,OAAO,IAAI,MAAM,OAAO,CAAC,GAAG,OAAO,KAAK;AACxE,CAAC;;AAGD,MAAa,iBACV,UACA,aACC,OAAO,IAAI,UAAU,SAAS;CAC5B,MAAM,QAAQ,OAAO;CACrB,MAAM,SAAS,eAAe,SAAS,MAAM,SAAS,MAAM,IAAI,CAAC;CACjE,OAAO,YACL,KACE,UACAA,MAAI,KAAK,YAAY,GAAG,OAAO,OAAO,EAAE,GAAG,GAC3CA,MAAI,KAAK,EAAE,CACb,CACF;AACF,CAAC;;AAGL,MAAa,oBAAoB,OAAO,GAAG,mBAAmB,CAAC,CAAC,UAAU,kBACxE,UACA;CACA,MAAM,OAAO,OAAO,OAAO,aAAa,OAAO,eAAe,WAAW,CAAC,CAAC,CAAC,QAAQ;CACpF,OAAO,OAAO,YAAY,IAAI;AAChC,CAAC;;AAGD,MAAa,eAAe,UAAsD;CAChF,IAAI,QAAQ,aACV,OAAO,OAAO,KAAK,cAAc,KAAK,EAAE,MAAM,CAAC,CAAC;CAElD,OAAO,OAAO;AAChB"}
|
package/dist/oxlint.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as describeFinding, t as ProblemList } from "./problem-
|
|
1
|
+
import { n as describeFinding, t as ProblemList } from "./problem-DGGF-vjW.mjs";
|
|
2
2
|
import { t as JSON_FLAG } from "./cli-contract-D7btWrEu.mjs";
|
|
3
3
|
import { i as nodeServicesLayer } from "./repository-files-C2gVviac.mjs";
|
|
4
4
|
import { Array, Effect, Layer, Schema, Stream, pipe } from "effect";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-C2gVviac.mjs";
|
|
2
2
|
import { n as readManifest, r as workspaceDependencies, t as dependencyEntries } from "./dependencies-BAjtDvY4.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { D as resolvedSymbol, M as IndexKind, N as InternalSymbolName, R as getLeadingCommentRanges, T as propertyNamesOf, _ as isGenericDeclaration, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, f as declarationsOf, j as API, p as declaresAType, rt as isModuleDeclaration } from "./problem-DGGF-vjW.mjs";
|
|
4
4
|
import { Array, Effect, Function, Number, Option, Order, Schema, String as String$1, pipe } from "effect";
|
|
5
5
|
import { PACKAGE_JSON_FILE } from "@r_masseater/kestrion";
|
|
6
6
|
// src/shared/lib/values.ts
|
|
@@ -434,4 +434,4 @@ const keepOnly = Effect.fn("keepOnly")(function* keepOnly(records, keys) {
|
|
|
434
434
|
});
|
|
435
435
|
export { valueKey as C, schemaTypeOf as S, formatValues as _, nearestManifestDirectory as a, literalValuesOf as b, listConfigFiles as c, withProject as d, declarationKey as f, finiteValuesOf as g, locationOf as h, installedPackages as i, mentions as l, isObjectType as m, keepOnly as n, projectInputs as o, describeLibraryType as p, recordsIn as r, workspaceClosure as s, contentKey as t, typeScriptCompiler as u, isSubsetOf as v, vocabularyOf as w, sameValues as x, literalUnionOf as y };
|
|
436
436
|
|
|
437
|
-
//# sourceMappingURL=pass-records-
|
|
437
|
+
//# sourceMappingURL=pass-records-fctupGWy.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pass-records-6XLhXZL3.mjs","names":["Arr","Fn","Arr","Num","Str","Arr","HIDDEN_PREFIX","Str","Arr","Arr","Str","Arr"],"sources":["../src/shared/lib/values.ts","../src/entities/project/model/library.ts","../src/entities/project/model/telemetry.ts","../src/entities/project/model/project.ts","../src/entities/project/model/inputs.ts","../src/shared/lib/pass-records.ts"],"sourcesContent":["import { Array as Arr, Function as Fn, Option, pipe } from \"effect\";\n\nimport { IndexKind } from \"./compiler.ts\";\nimport type { Checker, Type } from \"./compiler.ts\";\n\nexport type Value = string | number;\n\nexport interface Vocabulary {\n readonly values: readonly Value[];\n readonly admitsUnnamedValues: boolean;\n}\n\nconst SCHEMA_TYPE_PROPERTIES = [\"Type\", \"_output\"] as const;\n\nconst MINIMUM_SET_SIZE = 2;\n\nconst DATA_FIRST_ARITY = 2;\n\nexport const valueKey = (value: Value): string => `${typeof value}:${String(value)}`;\n\nconst literalValueOf = (type: Type): Option.Option<Value> => {\n if (type.isStringLiteralType() || type.isNumberLiteralType()) {\n return Option.some(type.value);\n }\n return Option.none();\n};\n\nexport const literalValuesOf = (types: readonly Type[]): Option.Option<readonly Value[]> => {\n const values = pipe(\n types,\n Arr.map((member) => literalValueOf(member)),\n Arr.getSomes,\n Arr.dedupeWith((left, right) => valueKey(left) === valueKey(right)),\n );\n if (values.length !== types.length || values.length < MINIMUM_SET_SIZE) {\n return Option.none();\n }\n return Option.some(values);\n};\n\nexport const literalUnionOf = (type: Type): Option.Option<readonly Value[]> => {\n if (!type.isUnionType()) {\n return Option.none();\n }\n return literalValuesOf(type.getTypes());\n};\n\nconst elementTypeOf = (checker: Checker, type: Type): Option.Option<Type> => {\n if (!checker.isArrayLikeType(type)) {\n return Option.none();\n }\n return Option.fromUndefinedOr(checker.getIndexTypeOfType(type, IndexKind.Number));\n};\n\nexport const schemaTypeOf =\n (checker: Checker) =>\n (type: Type): Option.Option<Type> =>\n Arr.findFirst(SCHEMA_TYPE_PROPERTIES, (name) =>\n Option.fromUndefinedOr(checker.getPropertyOfType(type, name)),\n ).pipe(Option.map((property) => checker.getTypeOfSymbol(property)));\n\nexport const finiteValuesOf =\n (checker: Checker) =>\n (type: Type): Option.Option<readonly Value[]> =>\n literalUnionOf(type).pipe(\n Option.orElse(() => elementTypeOf(checker, type).pipe(Option.flatMap(literalUnionOf))),\n Option.orElse(() => schemaTypeOf(checker)(type).pipe(Option.flatMap(literalUnionOf))),\n );\n\nexport const vocabularyOf =\n (checker: Checker) =>\n (type: Type): Option.Option<Vocabulary> => {\n if (!type.isUnionType()) {\n return Option.none();\n }\n const optionalIds = new Set([checker.getUndefinedType().id, checker.getNullType().id]);\n const members = pipe(\n type.getTypes(),\n Arr.filter((member) => !optionalIds.has(member.id)),\n );\n const values = Arr.getSomes(\n pipe(\n members,\n Arr.map((member) => literalValueOf(member)),\n ),\n );\n if (values.length < MINIMUM_SET_SIZE) {\n return Option.none();\n }\n return Option.some({ values, admitsUnnamedValues: values.length !== members.length });\n };\n\nexport const isSubsetOf: {\n (superset: readonly Value[]): (subset: readonly Value[]) => boolean;\n (subset: readonly Value[], superset: readonly Value[]): boolean;\n} = Fn.dual(DATA_FIRST_ARITY, (subset: readonly Value[], superset: readonly Value[]): boolean => {\n const held = new Set(\n pipe(\n superset,\n Arr.map((value) => valueKey(value)),\n ),\n );\n return pipe(\n subset,\n Arr.every((value) => held.has(valueKey(value))),\n );\n});\n\nexport const sameValues: {\n (right: readonly Value[]): (left: readonly Value[]) => boolean;\n (left: readonly Value[], right: readonly Value[]): boolean;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n (left: readonly Value[], right: readonly Value[]): boolean =>\n left.length === right.length && isSubsetOf(left, right),\n);\n\nconst valueText = (value: Value): string => {\n if (typeof value === \"string\") {\n return `\"${value}\"`;\n }\n return String(value);\n};\n\nexport const formatValues = (values: readonly Value[]): string =>\n pipe(values, Arr.map(valueText), Arr.join(\" | \"));\n","import { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport type { DependencyEntry } from \"#/entities/package/@x/project.ts\";\nimport {\n InternalSymbolName,\n isModuleDeclaration,\n isVariableDeclaration,\n} from \"#/shared/lib/compiler.ts\";\nimport type {\n Checker,\n Declaration,\n Node,\n SyntaxKind,\n TypeSymbol,\n Type,\n} from \"#/shared/lib/compiler.ts\";\nimport {\n declarationsOf,\n isGenericDeclaration,\n isTypeDeclaration,\n carriesTag,\n declaresAType,\n propertyNamesOf,\n resolvedSymbol,\n} from \"#/shared/lib/syntax.ts\";\nimport { schemaTypeOf, vocabularyOf } from \"#/shared/lib/values.ts\";\nimport type { Vocabulary } from \"#/shared/lib/values.ts\";\n\nexport interface LibraryType {\n readonly specifier: string;\n readonly typeName: string;\n}\n\nexport interface LibraryVocabulary extends LibraryType {\n readonly vocabulary: Vocabulary;\n}\n\nexport interface DeclarationLocation {\n readonly file: string;\n readonly pos: number;\n readonly kind: SyntaxKind;\n}\n\nexport interface LibraryShape extends LibraryType {\n readonly form: \"declared\" | \"schema\";\n readonly declaration: DeclarationLocation;\n readonly propertyNames: readonly string[];\n}\n\nexport interface LibraryIndex {\n readonly vocabularies: readonly LibraryVocabulary[];\n readonly shapes: readonly LibraryShape[];\n readonly typeNames: readonly string[];\n readonly tagNames: readonly string[];\n}\n\ninterface Walk {\n readonly checker: Checker;\n readonly entry: DependencyEntry;\n}\n\ninterface Visit {\n readonly exported: TypeSymbol;\n readonly qualifier: string;\n readonly ancestors: readonly TypeSymbol[];\n}\n\ninterface Exported {\n readonly symbol: TypeSymbol;\n readonly typeName: string;\n}\n\nconst NAMESPACE_DEPTH_LIMIT = 8;\nconst EMPTY_INDEX: LibraryIndex = { vocabularies: [], shapes: [], typeNames: [], tagNames: [] };\n\nexport const isObjectType =\n (checker: Checker) =>\n (type: Type): boolean =>\n !type.isUnionType() &&\n !type.isLiteralType() &&\n checker.getApparentType(type).id === type.id &&\n Arr.isReadonlyArrayNonEmpty(checker.getPropertiesOfType(type));\n\nexport const describeLibraryType = (type: LibraryType): string =>\n `${type.typeName} from ${type.specifier}`;\n\nexport const locationOf = (declaration: Node): DeclarationLocation => ({\n file: declaration.getSourceFile().fileName,\n pos: declaration.pos,\n kind: declaration.kind,\n});\n\nexport const declarationKey = (location: DeclarationLocation): string =>\n `${location.file}#${String(location.pos)}#${String(location.kind)}`;\n\ntype ShapeSource = LibraryType & Pick<LibraryShape, \"form\">;\n\nconst shapeOf =\n (checker: Checker) =>\n (source: ShapeSource, declaration: Declaration, type: Type): readonly LibraryShape[] =>\n Arr.filter(\n [\n {\n ...source,\n declaration: locationOf(declaration),\n propertyNames: propertyNamesOf(checker)(type),\n },\n ],\n () => isObjectType(checker)(type),\n );\n\nconst declaredTypeIndex = (walk: Walk, exported: Exported): LibraryIndex => {\n const declaration = Arr.findFirst(declarationsOf(exported.symbol), isTypeDeclaration);\n if (Option.isNone(declaration) || isGenericDeclaration(declaration.value)) {\n return EMPTY_INDEX;\n }\n const located = { specifier: walk.entry.specifier, typeName: exported.typeName };\n const type = walk.checker.getDeclaredTypeOfSymbol(exported.symbol);\n const vocabularies = vocabularyOf(walk.checker)(type).pipe(\n Option.map((vocabulary) => ({ ...located, vocabulary })),\n Option.toArray,\n );\n const shapes = shapeOf(walk.checker)({ ...located, form: \"declared\" }, declaration.value, type);\n return { ...EMPTY_INDEX, vocabularies, shapes };\n};\n\nconst schemaTypeIndex =\n (walk: Walk, located: LibraryType) =>\n (declaration: Declaration, schemaType: Type): LibraryIndex => ({\n ...EMPTY_INDEX,\n vocabularies: vocabularyOf(walk.checker)(schemaType).pipe(\n Option.map((vocabulary) => ({ ...located, vocabulary })),\n Option.toArray,\n ),\n shapes: shapeOf(walk.checker)({ ...located, form: \"schema\" }, declaration, schemaType),\n });\n\nconst schemaValueIndex = (walk: Walk, exported: Exported): LibraryIndex => {\n const declaration = Arr.findFirst(declarationsOf(exported.symbol), isVariableDeclaration);\n if (Option.isNone(declaration)) {\n return EMPTY_INDEX;\n }\n const valueType = walk.checker.getTypeOfSymbolAtLocation(exported.symbol, declaration.value);\n const located = {\n specifier: walk.entry.specifier,\n typeName: `(typeof ${exported.typeName})[\"Type\"]`,\n };\n return Option.match(schemaTypeOf(walk.checker)(valueType), {\n onNone: () => EMPTY_INDEX,\n onSome: (schemaType) => schemaTypeIndex(walk, located)(declaration.value, schemaType),\n });\n};\n\nconst mergeIndexes = (indexes: readonly LibraryIndex[]): LibraryIndex => ({\n vocabularies: pipe(\n indexes,\n Arr.flatMap((index) => index.vocabularies),\n ),\n shapes: pipe(\n indexes,\n Arr.flatMap((index) => index.shapes),\n ),\n typeNames: pipe(\n indexes,\n Arr.flatMap((index) => index.typeNames),\n ),\n tagNames: pipe(\n indexes,\n Arr.flatMap((index) => index.tagNames),\n ),\n});\n\nconst isNamespace = (symbol: TypeSymbol): boolean =>\n Arr.some(declarationsOf(symbol), isModuleDeclaration);\n\nconst typeNameIndex = (visit: Visit, symbol: TypeSymbol): LibraryIndex => {\n const declarations = declarationsOf(symbol);\n const typeNames = pipe(\n [visit.exported.name],\n Arr.filter(() => declaresAType(declarations)),\n );\n const tagNames = pipe(\n typeNames,\n Arr.filter((name) => carriesTag(name)(declarations)),\n );\n return { ...EMPTY_INDEX, typeNames, tagNames };\n};\n\nconst indexUnder = (walk: Walk, visit: Visit): LibraryIndex => {\n const symbol = resolvedSymbol(walk.checker)(visit.exported);\n const named = { symbol, typeName: `${visit.qualifier}${visit.exported.name}` };\n const own = mergeIndexes([\n declaredTypeIndex(walk, named),\n schemaValueIndex(walk, named),\n typeNameIndex(visit, symbol),\n ]);\n if (\n !isNamespace(symbol) ||\n visit.ancestors.length >= NAMESPACE_DEPTH_LIMIT ||\n visit.ancestors.includes(symbol)\n ) {\n return own;\n }\n const nested = pipe(\n walk.checker.getExportsOfModule(symbol),\n Arr.map((member) =>\n indexUnder(walk, {\n exported: member,\n qualifier: `${named.typeName}.`,\n ancestors: [...visit.ancestors, symbol],\n }),\n ),\n );\n return mergeIndexes([own, ...nested]);\n};\n\nconst exportAssignmentOf = (moduleSymbol: TypeSymbol): Option.Option<TypeSymbol> =>\n Option.fromUndefinedOr(moduleSymbol.getExports().get(InternalSymbolName.ExportEquals));\n\nconst indexOfEntry =\n (checker: Checker) =>\n (entry: DependencyEntry): LibraryIndex => {\n const moduleSymbol = Option.fromUndefinedOr(\n checker.getSymbolOfSourceFile(entry.declarationsPath),\n );\n if (Option.isNone(moduleSymbol)) {\n return EMPTY_INDEX;\n }\n const walk: Walk = { checker, entry };\n const roots = Option.match(exportAssignmentOf(moduleSymbol.value), {\n onNone: () => checker.getExportsOfModule(moduleSymbol.value),\n onSome: (assigned) => [resolvedSymbol(checker)(assigned)],\n });\n return mergeIndexes(\n pipe(\n roots,\n Arr.map((exported) => indexUnder(walk, { exported, qualifier: \"\", ancestors: [] })),\n ),\n );\n };\n\nexport interface CachedIndex {\n readonly index: LibraryIndex;\n readonly cached: boolean;\n}\n\nexport interface LibraryCache {\n readonly indexOf: (entry: DependencyEntry, compute: () => LibraryIndex) => CachedIndex;\n}\n\nexport const libraryCache = (): LibraryCache => {\n const indexes = new Map<string, LibraryIndex>();\n return {\n indexOf: (entry, compute) =>\n Option.match(Option.fromUndefinedOr(indexes.get(entry.declarationsPath)), {\n onSome: (index) => ({ index, cached: true }),\n onNone: () => {\n const index = compute();\n indexes.set(entry.declarationsPath, index);\n return { index, cached: false };\n },\n }),\n };\n};\n\nconst indexEntry =\n (cache: LibraryCache) =>\n (checker: Checker) =>\n (entry: DependencyEntry): Effect.Effect<LibraryIndex> =>\n Effect.sync(() => cache.indexOf(entry, () => indexOfEntry(checker)(entry))).pipe(\n Effect.tap(({ index, cached }) =>\n Effect.annotateCurrentSpan({\n \"msch.library.cached\": cached,\n \"msch.library.vocabularies\": index.vocabularies.length,\n \"msch.library.shapes\": index.shapes.length,\n }),\n ),\n Effect.map(({ index }) => index),\n Effect.withSpan(\"indexLibraryEntry\", {\n attributes: { \"msch.library.specifier\": entry.specifier },\n }),\n );\n\nexport const libraryIndex =\n (cache: LibraryCache) =>\n (checker: Checker) =>\n (entries: readonly DependencyEntry[]): Effect.Effect<LibraryIndex> =>\n pipe(\n entries,\n (items) => Effect.forEach(items, indexEntry(cache)(checker), { concurrency: 1 }),\n Effect.map(mergeIndexes),\n Effect.withSpan(\"libraryIndex\"),\n );\n","import { Array as Arr, Effect, Number as Num, Option, String as Str, pipe } from \"effect\";\n\nimport type { API } from \"#/shared/lib/compiler.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst RSS_LINE = /^VmRSS:\\s+(?<kib>\\d+) kB$/mu;\nconst BYTES_PER_KIB = 1024;\nconst UNKNOWN_RSS = 0;\n\nconst kibibytesIn = (status: string): Option.Option<string> =>\n Option.fromNullishOr(RSS_LINE.exec(status)).pipe(\n Option.flatMap((match) => Option.fromUndefinedOr(match.groups)),\n Option.flatMap((groups) => Option.fromUndefinedOr(groups[\"kib\"])),\n );\n\nconst residentBytesOf = (pid: string): Effect.Effect<number, never, RepositoryFiles> =>\n Effect.gen(function* residentBytes() {\n const files = yield* RepositoryFiles;\n const status = yield* files.readFile(`/proc/${pid}/status`);\n return pipe(\n status,\n Option.flatMap(kibibytesIn),\n Option.flatMap(Num.parse),\n Option.map((kib) => kib * BYTES_PER_KIB),\n Option.getOrElse(() => UNKNOWN_RSS),\n );\n });\n\nconst childPids = Effect.gen(function* childPids() {\n const files = yield* RepositoryFiles;\n const pid = String(process.pid);\n const children = yield* files.readFile(`/proc/${pid}/task/${pid}/children`);\n return pipe(\n children,\n Option.map((text) => pipe(Str.trim(text), Str.split(\" \"), Arr.filter(Str.isNonEmpty))),\n Option.getOrElse((): readonly string[] => []),\n );\n});\n\nconst annotateMemory = Effect.gen(function* annotateMemory() {\n const own = yield* residentBytesOf(String(process.pid));\n const pids = yield* childPids;\n const children = yield* Effect.forEach(pids, (pid) => residentBytesOf(pid), { concurrency: 1 });\n const { heapUsed } = process.memoryUsage();\n yield* Effect.annotateCurrentSpan({\n \"process.memory.rss\": own,\n \"process.memory.heap_used\": heapUsed,\n \"msch.compiler.memory.rss\": Num.sumAll(children),\n });\n});\n\nexport const annotateResources = (api: API): Effect.Effect<void, never, RepositoryFiles> =>\n Effect.gen(function* annotateCompiler() {\n yield* annotateMemory;\n const { totals } = api.getTimingInfo();\n yield* Effect.annotateCurrentSpan({\n \"msch.compiler.requests\": totals.requestCount,\n \"msch.compiler.round_trip_ms\": totals.roundTripMs,\n \"msch.compiler.server_ms\": totals.serverTimeMs,\n });\n });\n","import { PACKAGE_JSON_FILE } from \"@r_masseater/kestrion\";\nimport { Array as Arr, Effect, Option, Order, String as Str, pipe } from \"effect\";\n\nimport {\n dependencyEntries,\n readManifest,\n workspaceDependencies,\n} from \"#/entities/package/@x/project.ts\";\nimport { API, getLeadingCommentRanges } from \"#/shared/lib/compiler.ts\";\nimport type { Checker, ParsedCommandLine, Program, SourceFile } from \"#/shared/lib/compiler.ts\";\nimport type { Problem } from \"#/shared/lib/problem.ts\";\nimport { NODE_MODULES, RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { libraryCache, libraryIndex } from \"./library.ts\";\nimport type { LibraryCache, LibraryIndex } from \"./library.ts\";\nimport { annotateResources } from \"./telemetry.ts\";\n\nexport interface Project {\n readonly packageName: Option.Option<string>;\n readonly workspaceDependencies: readonly string[];\n readonly program: Program;\n readonly checker: Checker;\n readonly sourceFiles: readonly SourceFile[];\n readonly library: LibraryIndex;\n}\n\nexport type SourceCheck = (checker: Checker) => (sourceFile: SourceFile) => readonly Problem[];\n\ninterface PackageInfo {\n readonly directory: string;\n readonly name: Option.Option<string>;\n readonly workspaceDependencies: readonly string[];\n}\n\nconst CONFIG_FILE = \"tsconfig.json\";\nconst CONFIG_PATHSPEC = `:(glob)**/${CONFIG_FILE}`;\nconst HIDDEN_PREFIX = \".\";\nconst SKIPPED_DIRECTORIES: ReadonlySet<string> = new Set([NODE_MODULES, \"dist\", \"coverage\"]);\n\nconst isVisible = (file: string): boolean =>\n pipe(\n Str.split(file, \"/\"),\n Arr.every(\n (segment) => !Str.startsWith(HIDDEN_PREFIX)(segment) && !SKIPPED_DIRECTORIES.has(segment),\n ),\n );\n\nexport const listConfigFiles = (\n root: string,\n): Effect.Effect<readonly string[], never, RepositoryFiles> =>\n Effect.gen(function* configFilesUnder() {\n const files = yield* RepositoryFiles;\n const listed = yield* files.matchingFiles(root, [CONFIG_PATHSPEC]);\n const visible = pipe(\n listed,\n Arr.filter(isVisible),\n Arr.map((file) => files.join(root, file)),\n );\n return Arr.sort(visible, Order.String);\n });\n\nexport const parseConfig =\n (api: API) =>\n (configPath: string): Option.Option<ParsedCommandLine> =>\n Option.some(api.parseConfigFile(configPath)).pipe(\n Option.filter((parsed) => Arr.isReadonlyArrayNonEmpty(parsed.fileNames)),\n );\n\nconst nearestPackageDirectory = (\n directory: string,\n root: string,\n): Effect.Effect<string, never, RepositoryFiles> =>\n Effect.gen(function* nearestPackage() {\n const files = yield* RepositoryFiles;\n const hasManifest = yield* files.exists(files.join(directory, PACKAGE_JSON_FILE));\n const parent = files.dirname(directory);\n if (hasManifest || directory === root || parent === directory) {\n return directory;\n }\n return yield* nearestPackageDirectory(parent, root);\n });\n\nexport const packageDirectoryOf =\n (root: string) =>\n (directory: string): Effect.Effect<string, never, RepositoryFiles> =>\n nearestPackageDirectory(directory, root);\n\nconst packageInfoOf = Effect.fn(\"packageInfoOf\")(function* packageInfoOf(\n configPath: string,\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const directory = yield* nearestPackageDirectory(files.dirname(configPath), root);\n const manifest = yield* readManifest(directory);\n return {\n directory,\n name: manifest.pipe(Option.flatMap((found) => Option.fromUndefinedOr(found.name))),\n workspaceDependencies: manifest.pipe(\n Option.map(workspaceDependencies),\n Option.getOrElse(() => []),\n ),\n } satisfies PackageInfo;\n});\n\nconst NO_CHECK_PRAGMA = /^\\/\\/\\s*@ts-nocheck/u;\nconst FILE_START = 0;\n\nconst skipsTypeChecking = (sourceFile: SourceFile): boolean =>\n pipe(\n getLeadingCommentRanges(sourceFile.text, FILE_START) ?? [],\n Arr.some((range) => NO_CHECK_PRAGMA.test(Str.slice(range.pos, range.end)(sourceFile.text))),\n );\n\nconst buildProject = Effect.fn(\"buildProject\")(function* buildProject(\n { compiler: { api, libraries }, generated }: Workspace,\n parsed: ParsedCommandLine,\n info: PackageInfo,\n) {\n const entries = yield* dependencyEntries(info.directory);\n const program = yield* Effect.sync(() =>\n api.createProgram(\n [\n ...parsed.fileNames,\n ...pipe(\n entries,\n Arr.map((entry) => entry.declarationsPath),\n ),\n ],\n { ...parsed.options, noEmit: true },\n ),\n ).pipe(Effect.withSpan(\"createProgram\"));\n const { checker } = program.getProject();\n const library = yield* libraryIndex(libraries)(checker)(entries);\n const projectFiles: ReadonlySet<string> = new Set(\n pipe(\n parsed.fileNames,\n Arr.filter((fileName) => !generated.includes(fileName)),\n ),\n );\n return {\n packageName: info.name,\n workspaceDependencies: info.workspaceDependencies,\n program,\n checker,\n sourceFiles: pipe(\n program.getSourceFileNames(),\n Arr.filter((fileName) => projectFiles.has(fileName)),\n Arr.flatMap((fileName) =>\n Option.toArray(Option.fromUndefinedOr(program.getSourceFile(fileName))),\n ),\n Arr.filter((sourceFile) => !sourceFile.isDeclarationFile && !skipsTypeChecking(sourceFile)),\n ),\n library,\n } satisfies Project;\n});\n\nexport interface Compiler {\n readonly api: API;\n readonly libraries: LibraryCache;\n}\n\nexport interface Workspace {\n readonly compiler: Compiler;\n readonly root: string;\n readonly generated: readonly string[];\n}\n\nexport const typeScriptCompiler = Effect.acquireRelease(\n Effect.sync((): Compiler => ({\n api: new API({ collectTiming: true }),\n libraries: libraryCache(),\n })),\n ({ api }) =>\n Effect.sync(() => {\n api.close();\n }),\n);\n\nconst loadProject = Effect.fn(\"loadProject\")(function* loadProject(\n workspace: Workspace,\n configPath: string,\n) {\n const { compiler, root } = workspace;\n const parsed = parseConfig(compiler.api)(configPath);\n if (Option.isNone(parsed)) {\n return Option.none<Project>();\n }\n const info = yield* packageInfoOf(configPath, root);\n const project = yield* buildProject(workspace, parsed.value, info);\n yield* Effect.annotateCurrentSpan({\n \"msch.project.config\": configPath,\n \"msch.project.program_files\": project.program.getSourceFileNames().length,\n \"msch.project.source_files\": project.sourceFiles.length,\n });\n yield* annotateResources(compiler.api);\n return Option.some(project);\n});\n\nconst releaseProject = (project: Project): Effect.Effect<void> =>\n Effect.sync(() => {\n project.program.dispose();\n });\n\nexport const withProject =\n (workspace: Workspace) =>\n (configPath: string) =>\n <Value, Failure, Requirements>(\n work: (project: Project) => Effect.Effect<Value, Failure, Requirements>,\n ): Effect.Effect<Option.Option<Value>, Failure, Requirements | RepositoryFiles> =>\n Effect.acquireUseRelease(\n loadProject(workspace, configPath),\n (loaded) =>\n Option.match(loaded, {\n onNone: () => Effect.succeedNone,\n onSome: (project) => work(project).pipe(Effect.asSome),\n }),\n (loaded) => Option.match(loaded, { onNone: () => Effect.void, onSome: releaseProject }),\n );\n\nexport const mentions =\n (needle: string) =>\n ({ api }: Compiler) =>\n (configPath: string): Effect.Effect<boolean, never, RepositoryFiles> =>\n Effect.gen(function* mentionsNeedle() {\n const files = yield* RepositoryFiles;\n const fileNames = Option.match(parseConfig(api)(configPath), {\n onNone: (): readonly string[] => [],\n onSome: (parsed): readonly string[] => parsed.fileNames,\n });\n const texts = yield* Effect.forEach(fileNames, (fileName) => files.readFile(fileName), {\n concurrency: 1,\n });\n const includesNeedle = Str.includes(needle);\n return pipe(\n texts,\n Arr.some((text) => Option.exists(text, includesNeedle)),\n );\n });\n","import { PACKAGE_JSON_FILE } from \"@r_masseater/kestrion\";\nimport { Array as Arr, Effect, Option, Order, Schema, String as Str, pipe } from \"effect\";\n\nimport { readManifest, workspaceDependencies } from \"#/entities/package/@x/project.ts\";\nimport { NODE_MODULES, RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { packageDirectoryOf, parseConfig } from \"./project.ts\";\nimport type { Workspace } from \"./project.ts\";\n\nexport interface ProjectInputs {\n readonly options: string;\n readonly files: readonly string[];\n readonly dependencies: readonly string[];\n}\n\nconst SEPARATOR = \"/\";\nconst SCOPE_PREFIX = \"@\";\nconst HIDDEN_PREFIX = \".\";\n\nconst encodeOptions = Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown));\n\nexport const nearestManifestDirectory = Effect.fn(\"nearestManifestDirectory\")(\n function* nearestManifestDirectory(start: string) {\n const files = yield* RepositoryFiles;\n let directory = start;\n let parent = files.dirname(directory);\n while (\n parent !== directory &&\n !(yield* files.exists(files.join(directory, PACKAGE_JSON_FILE)))\n ) {\n directory = parent;\n parent = files.dirname(directory);\n }\n return directory;\n },\n);\n\nconst dependenciesOf = Effect.fn(\"dependenciesOf\")(function* dependenciesOf(directory: string) {\n const files = yield* RepositoryFiles;\n const manifest = yield* readManifest(directory);\n const names = Option.match(manifest, {\n onNone: (): readonly string[] => [],\n onSome: workspaceDependencies,\n });\n return yield* Effect.forEach(\n names,\n (name) => files.realPath(files.join(directory, NODE_MODULES, name)),\n {\n concurrency: 1,\n },\n );\n});\n\nexport const workspaceClosure = Effect.fn(\"workspaceClosure\")(function* workspaceClosure(\n start: string,\n) {\n const seen = new Set([start]);\n const queue = [start];\n for (const directory of queue) {\n const next = yield* dependenciesOf(directory);\n for (const dependency of next) {\n if (!seen.has(dependency)) {\n seen.add(dependency);\n queue.push(dependency);\n }\n }\n }\n return [...seen];\n});\n\nconst isUnder =\n (prefixes: readonly string[]) =>\n (file: string): boolean =>\n pipe(\n prefixes,\n Arr.some((prefix) => Str.startsWith(prefix)(file)),\n );\n\nconst closureOf = Effect.fn(\"closureOf\")(function* closureOf(root: string, configPath: string) {\n const files = yield* RepositoryFiles;\n const directory = yield* packageDirectoryOf(root)(files.dirname(configPath));\n const directories = yield* workspaceClosure(directory);\n const prefixes = pipe(\n directories,\n Arr.map((found) => `${files.relative(root, found)}${SEPARATOR}`),\n );\n return { directories, prefixes };\n});\n\nconst scopedNames =\n (modules: string) =>\n (name: string): Effect.Effect<readonly string[], never, RepositoryFiles> =>\n Effect.gen(function* listScope() {\n const files = yield* RepositoryFiles;\n if (!Str.startsWith(SCOPE_PREFIX)(name)) {\n return [name];\n }\n const scoped = yield* files.readDirectory(files.join(modules, name));\n return pipe(\n scoped,\n Arr.map((entry) => `${name}${SEPARATOR}${entry}`),\n );\n });\n\nconst installedNames = Effect.fn(\"installedNames\")(function* installedNames(modules: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.readDirectory(modules);\n const nested = yield* pipe(\n listed,\n Arr.filter((name) => !Str.startsWith(HIDDEN_PREFIX)(name)),\n (items) => Effect.forEach(items, scopedNames(modules), { concurrency: 1 }),\n );\n return Arr.flatten(nested);\n});\n\nexport const installedPackages = Effect.fn(\"installedPackages\")(function* installedPackages(\n root: string,\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const modules = files.join(directory, NODE_MODULES);\n const names = yield* installedNames(modules);\n return yield* Effect.forEach(\n names,\n (name) =>\n files\n .realPath(files.join(modules, name))\n .pipe(Effect.map((found) => files.relative(root, found))),\n { concurrency: 1 },\n );\n});\n\nconst dependencyVersions = Effect.fn(\"dependencyVersions\")(function* dependencyVersions(\n root: string,\n directories: readonly string[],\n) {\n const installed = yield* Effect.forEach(\n Arr.dedupe([root, ...directories]),\n (directory) => installedPackages(root, directory),\n { concurrency: 1 },\n );\n return Arr.sort(Arr.dedupe(Arr.flatten(installed)), Order.String);\n});\n\nexport interface InputScope {\n readonly workspace: Workspace;\n readonly listed: readonly string[];\n}\n\nexport const projectInputs =\n ({ workspace: { compiler, root }, listed }: InputScope) =>\n (configPath: string): Effect.Effect<Option.Option<ProjectInputs>, never, RepositoryFiles> =>\n Effect.gen(function* collectInputs() {\n const files = yield* RepositoryFiles;\n const parsed = parseConfig(compiler.api)(configPath);\n if (Option.isNone(parsed)) {\n return Option.none();\n }\n const closure = yield* closureOf(root, configPath);\n const dependencies = yield* dependencyVersions(root, closure.directories);\n const options = yield* encodeOptions(parsed.value.options).pipe(\n Effect.orElseSucceed(() => \"\"),\n );\n const sources = pipe(\n parsed.value.fileNames,\n Arr.map((fileName) => files.relative(root, fileName)),\n );\n const shared = pipe(listed, Arr.filter(isUnder(closure.prefixes)));\n return Option.some({\n options,\n files: Arr.sort(Arr.dedupe([...sources, ...shared]), Order.String),\n dependencies,\n });\n });\n","import { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"./repository-files.ts\";\n\nconst PASSED = \"\";\nconst UNREADABLE = \"\";\nconst FIELD_SEPARATOR = \"\\0\";\nconst LINE_SEPARATOR = \"\\n\";\n\nexport interface Records {\n readonly directory: string;\n readonly passed: readonly string[];\n}\n\nexport type NamedFile = readonly [name: string, file: string];\n\nexport const contentKey = Effect.fn(\"contentKey\")(function* contentKey(\n salt: readonly string[],\n named: readonly NamedFile[],\n) {\n const files = yield* RepositoryFiles;\n const entries = yield* Effect.forEach(\n named,\n ([name, file]) =>\n files\n .hashFile(file)\n .pipe(\n Effect.map(\n (found) => `${name}${FIELD_SEPARATOR}${Option.getOrElse(found, () => UNREADABLE)}`,\n ),\n ),\n { concurrency: 1 },\n );\n return yield* files.hash(Arr.join([...salt, ...entries], LINE_SEPARATOR));\n});\n\nexport const recordsIn = Effect.fn(\"recordsIn\")(function* recordsIn(directory: string) {\n const files = yield* RepositoryFiles;\n const present = yield* files.readDirectory(directory);\n return { directory, passed: present } satisfies Records;\n});\n\nexport const keepOnly = Effect.fn(\"keepOnly\")(function* keepOnly(\n records: Records,\n keys: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const stale = pipe(\n records.passed,\n Arr.filter((key) => !Arr.contains(keys, key)),\n );\n yield* Effect.forEach(stale, (key) => files.removeFile(files.join(records.directory, key)), {\n concurrency: 1,\n discard: true,\n });\n yield* Effect.forEach(\n keys,\n (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,SAAS,MAAM,GAAG,CAAC,CAC9C;CACA,OAAO,OAAO,QAAQ,QAAQ,QAAQ,MAAM,WAAW,MAAM,KAAK,QAAQ,WAAW,GAAG,CAAC,GAAG;EAC1F,aAAa;EACb,SAAS;CACX,CAAC;CACD,OAAO,OAAO,QACZ,OACC,QAAQ,MAAM,UAAU,MAAM,KAAK,QAAQ,WAAW,GAAG,GAAG,MAAM,GACnE;EAAE,aAAa;EAAG,SAAS;CAAK,CAClC;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"pass-records-fctupGWy.mjs","names":["Arr","Fn","Arr","Num","Str","Arr","HIDDEN_PREFIX","Str","Arr","Arr","Str","Arr"],"sources":["../src/shared/lib/values.ts","../src/entities/project/model/library.ts","../src/entities/project/model/telemetry.ts","../src/entities/project/model/project.ts","../src/entities/project/model/inputs.ts","../src/shared/lib/pass-records.ts"],"sourcesContent":["import { Array as Arr, Function as Fn, Option, pipe } from \"effect\";\n\nimport { IndexKind } from \"./compiler.ts\";\nimport type { Checker, Type } from \"./compiler.ts\";\n\nexport type Value = string | number;\n\nexport interface Vocabulary {\n readonly values: readonly Value[];\n readonly admitsUnnamedValues: boolean;\n}\n\nconst SCHEMA_TYPE_PROPERTIES = [\"Type\", \"_output\"] as const;\n\nconst MINIMUM_SET_SIZE = 2;\n\nconst DATA_FIRST_ARITY = 2;\n\nexport const valueKey = (value: Value): string => `${typeof value}:${String(value)}`;\n\nconst literalValueOf = (type: Type): Option.Option<Value> => {\n if (type.isStringLiteralType() || type.isNumberLiteralType()) {\n return Option.some(type.value);\n }\n return Option.none();\n};\n\nexport const literalValuesOf = (types: readonly Type[]): Option.Option<readonly Value[]> => {\n const values = pipe(\n types,\n Arr.map((member) => literalValueOf(member)),\n Arr.getSomes,\n Arr.dedupeWith((left, right) => valueKey(left) === valueKey(right)),\n );\n if (values.length !== types.length || values.length < MINIMUM_SET_SIZE) {\n return Option.none();\n }\n return Option.some(values);\n};\n\nexport const literalUnionOf = (type: Type): Option.Option<readonly Value[]> => {\n if (!type.isUnionType()) {\n return Option.none();\n }\n return literalValuesOf(type.getTypes());\n};\n\nconst elementTypeOf = (checker: Checker, type: Type): Option.Option<Type> => {\n if (!checker.isArrayLikeType(type)) {\n return Option.none();\n }\n return Option.fromUndefinedOr(checker.getIndexTypeOfType(type, IndexKind.Number));\n};\n\nexport const schemaTypeOf =\n (checker: Checker) =>\n (type: Type): Option.Option<Type> =>\n Arr.findFirst(SCHEMA_TYPE_PROPERTIES, (name) =>\n Option.fromUndefinedOr(checker.getPropertyOfType(type, name)),\n ).pipe(Option.map((property) => checker.getTypeOfSymbol(property)));\n\nexport const finiteValuesOf =\n (checker: Checker) =>\n (type: Type): Option.Option<readonly Value[]> =>\n literalUnionOf(type).pipe(\n Option.orElse(() => elementTypeOf(checker, type).pipe(Option.flatMap(literalUnionOf))),\n Option.orElse(() => schemaTypeOf(checker)(type).pipe(Option.flatMap(literalUnionOf))),\n );\n\nexport const vocabularyOf =\n (checker: Checker) =>\n (type: Type): Option.Option<Vocabulary> => {\n if (!type.isUnionType()) {\n return Option.none();\n }\n const optionalIds = new Set([checker.getUndefinedType().id, checker.getNullType().id]);\n const members = pipe(\n type.getTypes(),\n Arr.filter((member) => !optionalIds.has(member.id)),\n );\n const values = Arr.getSomes(\n pipe(\n members,\n Arr.map((member) => literalValueOf(member)),\n ),\n );\n if (values.length < MINIMUM_SET_SIZE) {\n return Option.none();\n }\n return Option.some({ values, admitsUnnamedValues: values.length !== members.length });\n };\n\nexport const isSubsetOf: {\n (superset: readonly Value[]): (subset: readonly Value[]) => boolean;\n (subset: readonly Value[], superset: readonly Value[]): boolean;\n} = Fn.dual(DATA_FIRST_ARITY, (subset: readonly Value[], superset: readonly Value[]): boolean => {\n const held = new Set(\n pipe(\n superset,\n Arr.map((value) => valueKey(value)),\n ),\n );\n return pipe(\n subset,\n Arr.every((value) => held.has(valueKey(value))),\n );\n});\n\nexport const sameValues: {\n (right: readonly Value[]): (left: readonly Value[]) => boolean;\n (left: readonly Value[], right: readonly Value[]): boolean;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n (left: readonly Value[], right: readonly Value[]): boolean =>\n left.length === right.length && isSubsetOf(left, right),\n);\n\nconst valueText = (value: Value): string => {\n if (typeof value === \"string\") {\n return `\"${value}\"`;\n }\n return String(value);\n};\n\nexport const formatValues = (values: readonly Value[]): string =>\n pipe(values, Arr.map(valueText), Arr.join(\" | \"));\n","import { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport type { DependencyEntry } from \"#/entities/package/@x/project.ts\";\nimport {\n InternalSymbolName,\n isModuleDeclaration,\n isVariableDeclaration,\n} from \"#/shared/lib/compiler.ts\";\nimport type {\n Checker,\n Declaration,\n Node,\n SyntaxKind,\n TypeSymbol,\n Type,\n} from \"#/shared/lib/compiler.ts\";\nimport {\n declarationsOf,\n isGenericDeclaration,\n isTypeDeclaration,\n carriesTag,\n declaresAType,\n propertyNamesOf,\n resolvedSymbol,\n} from \"#/shared/lib/syntax.ts\";\nimport { schemaTypeOf, vocabularyOf } from \"#/shared/lib/values.ts\";\nimport type { Vocabulary } from \"#/shared/lib/values.ts\";\n\nexport interface LibraryType {\n readonly specifier: string;\n readonly typeName: string;\n}\n\nexport interface LibraryVocabulary extends LibraryType {\n readonly vocabulary: Vocabulary;\n}\n\nexport interface DeclarationLocation {\n readonly file: string;\n readonly pos: number;\n readonly kind: SyntaxKind;\n}\n\nexport interface LibraryShape extends LibraryType {\n readonly form: \"declared\" | \"schema\";\n readonly declaration: DeclarationLocation;\n readonly propertyNames: readonly string[];\n}\n\nexport interface LibraryIndex {\n readonly vocabularies: readonly LibraryVocabulary[];\n readonly shapes: readonly LibraryShape[];\n readonly typeNames: readonly string[];\n readonly tagNames: readonly string[];\n}\n\ninterface Walk {\n readonly checker: Checker;\n readonly entry: DependencyEntry;\n}\n\ninterface Visit {\n readonly exported: TypeSymbol;\n readonly qualifier: string;\n readonly ancestors: readonly TypeSymbol[];\n}\n\ninterface Exported {\n readonly symbol: TypeSymbol;\n readonly typeName: string;\n}\n\nconst NAMESPACE_DEPTH_LIMIT = 8;\nconst EMPTY_INDEX: LibraryIndex = { vocabularies: [], shapes: [], typeNames: [], tagNames: [] };\n\nexport const isObjectType =\n (checker: Checker) =>\n (type: Type): boolean =>\n !type.isUnionType() &&\n !type.isLiteralType() &&\n checker.getApparentType(type).id === type.id &&\n Arr.isReadonlyArrayNonEmpty(checker.getPropertiesOfType(type));\n\nexport const describeLibraryType = (type: LibraryType): string =>\n `${type.typeName} from ${type.specifier}`;\n\nexport const locationOf = (declaration: Node): DeclarationLocation => ({\n file: declaration.getSourceFile().fileName,\n pos: declaration.pos,\n kind: declaration.kind,\n});\n\nexport const declarationKey = (location: DeclarationLocation): string =>\n `${location.file}#${String(location.pos)}#${String(location.kind)}`;\n\ntype ShapeSource = LibraryType & Pick<LibraryShape, \"form\">;\n\nconst shapeOf =\n (checker: Checker) =>\n (source: ShapeSource, declaration: Declaration, type: Type): readonly LibraryShape[] =>\n Arr.filter(\n [\n {\n ...source,\n declaration: locationOf(declaration),\n propertyNames: propertyNamesOf(checker)(type),\n },\n ],\n () => isObjectType(checker)(type),\n );\n\nconst declaredTypeIndex = (walk: Walk, exported: Exported): LibraryIndex => {\n const declaration = Arr.findFirst(declarationsOf(exported.symbol), isTypeDeclaration);\n if (Option.isNone(declaration) || isGenericDeclaration(declaration.value)) {\n return EMPTY_INDEX;\n }\n const located = { specifier: walk.entry.specifier, typeName: exported.typeName };\n const type = walk.checker.getDeclaredTypeOfSymbol(exported.symbol);\n const vocabularies = vocabularyOf(walk.checker)(type).pipe(\n Option.map((vocabulary) => ({ ...located, vocabulary })),\n Option.toArray,\n );\n const shapes = shapeOf(walk.checker)({ ...located, form: \"declared\" }, declaration.value, type);\n return { ...EMPTY_INDEX, vocabularies, shapes };\n};\n\nconst schemaTypeIndex =\n (walk: Walk, located: LibraryType) =>\n (declaration: Declaration, schemaType: Type): LibraryIndex => ({\n ...EMPTY_INDEX,\n vocabularies: vocabularyOf(walk.checker)(schemaType).pipe(\n Option.map((vocabulary) => ({ ...located, vocabulary })),\n Option.toArray,\n ),\n shapes: shapeOf(walk.checker)({ ...located, form: \"schema\" }, declaration, schemaType),\n });\n\nconst schemaValueIndex = (walk: Walk, exported: Exported): LibraryIndex => {\n const declaration = Arr.findFirst(declarationsOf(exported.symbol), isVariableDeclaration);\n if (Option.isNone(declaration)) {\n return EMPTY_INDEX;\n }\n const valueType = walk.checker.getTypeOfSymbolAtLocation(exported.symbol, declaration.value);\n const located = {\n specifier: walk.entry.specifier,\n typeName: `(typeof ${exported.typeName})[\"Type\"]`,\n };\n return Option.match(schemaTypeOf(walk.checker)(valueType), {\n onNone: () => EMPTY_INDEX,\n onSome: (schemaType) => schemaTypeIndex(walk, located)(declaration.value, schemaType),\n });\n};\n\nconst mergeIndexes = (indexes: readonly LibraryIndex[]): LibraryIndex => ({\n vocabularies: pipe(\n indexes,\n Arr.flatMap((index) => index.vocabularies),\n ),\n shapes: pipe(\n indexes,\n Arr.flatMap((index) => index.shapes),\n ),\n typeNames: pipe(\n indexes,\n Arr.flatMap((index) => index.typeNames),\n ),\n tagNames: pipe(\n indexes,\n Arr.flatMap((index) => index.tagNames),\n ),\n});\n\nconst isNamespace = (symbol: TypeSymbol): boolean =>\n Arr.some(declarationsOf(symbol), isModuleDeclaration);\n\nconst typeNameIndex = (visit: Visit, symbol: TypeSymbol): LibraryIndex => {\n const declarations = declarationsOf(symbol);\n const typeNames = pipe(\n [visit.exported.name],\n Arr.filter(() => declaresAType(declarations)),\n );\n const tagNames = pipe(\n typeNames,\n Arr.filter((name) => carriesTag(name)(declarations)),\n );\n return { ...EMPTY_INDEX, typeNames, tagNames };\n};\n\nconst indexUnder = (walk: Walk, visit: Visit): LibraryIndex => {\n const symbol = resolvedSymbol(walk.checker)(visit.exported);\n const named = { symbol, typeName: `${visit.qualifier}${visit.exported.name}` };\n const own = mergeIndexes([\n declaredTypeIndex(walk, named),\n schemaValueIndex(walk, named),\n typeNameIndex(visit, symbol),\n ]);\n if (\n !isNamespace(symbol) ||\n visit.ancestors.length >= NAMESPACE_DEPTH_LIMIT ||\n visit.ancestors.includes(symbol)\n ) {\n return own;\n }\n const nested = pipe(\n walk.checker.getExportsOfModule(symbol),\n Arr.map((member) =>\n indexUnder(walk, {\n exported: member,\n qualifier: `${named.typeName}.`,\n ancestors: [...visit.ancestors, symbol],\n }),\n ),\n );\n return mergeIndexes([own, ...nested]);\n};\n\nconst exportAssignmentOf = (moduleSymbol: TypeSymbol): Option.Option<TypeSymbol> =>\n Option.fromUndefinedOr(moduleSymbol.getExports().get(InternalSymbolName.ExportEquals));\n\nconst indexOfEntry =\n (checker: Checker) =>\n (entry: DependencyEntry): LibraryIndex => {\n const moduleSymbol = Option.fromUndefinedOr(\n checker.getSymbolOfSourceFile(entry.declarationsPath),\n );\n if (Option.isNone(moduleSymbol)) {\n return EMPTY_INDEX;\n }\n const walk: Walk = { checker, entry };\n const roots = Option.match(exportAssignmentOf(moduleSymbol.value), {\n onNone: () => checker.getExportsOfModule(moduleSymbol.value),\n onSome: (assigned) => [resolvedSymbol(checker)(assigned)],\n });\n return mergeIndexes(\n pipe(\n roots,\n Arr.map((exported) => indexUnder(walk, { exported, qualifier: \"\", ancestors: [] })),\n ),\n );\n };\n\nexport interface CachedIndex {\n readonly index: LibraryIndex;\n readonly cached: boolean;\n}\n\nexport interface LibraryCache {\n readonly indexOf: (entry: DependencyEntry, compute: () => LibraryIndex) => CachedIndex;\n}\n\nexport const libraryCache = (): LibraryCache => {\n const indexes = new Map<string, LibraryIndex>();\n return {\n indexOf: (entry, compute) =>\n Option.match(Option.fromUndefinedOr(indexes.get(entry.declarationsPath)), {\n onSome: (index) => ({ index, cached: true }),\n onNone: () => {\n const index = compute();\n indexes.set(entry.declarationsPath, index);\n return { index, cached: false };\n },\n }),\n };\n};\n\nconst indexEntry =\n (cache: LibraryCache) =>\n (checker: Checker) =>\n (entry: DependencyEntry): Effect.Effect<LibraryIndex> =>\n Effect.sync(() => cache.indexOf(entry, () => indexOfEntry(checker)(entry))).pipe(\n Effect.tap(({ index, cached }) =>\n Effect.annotateCurrentSpan({\n \"msch.library.cached\": cached,\n \"msch.library.vocabularies\": index.vocabularies.length,\n \"msch.library.shapes\": index.shapes.length,\n }),\n ),\n Effect.map(({ index }) => index),\n Effect.withSpan(\"indexLibraryEntry\", {\n attributes: { \"msch.library.specifier\": entry.specifier },\n }),\n );\n\nexport const libraryIndex =\n (cache: LibraryCache) =>\n (checker: Checker) =>\n (entries: readonly DependencyEntry[]): Effect.Effect<LibraryIndex> =>\n pipe(\n entries,\n (items) => Effect.forEach(items, indexEntry(cache)(checker), { concurrency: 1 }),\n Effect.map(mergeIndexes),\n Effect.withSpan(\"libraryIndex\"),\n );\n","import { Array as Arr, Effect, Number as Num, Option, String as Str, pipe } from \"effect\";\n\nimport type { API } from \"#/shared/lib/compiler.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst RSS_LINE = /^VmRSS:\\s+(?<kib>\\d+) kB$/mu;\nconst BYTES_PER_KIB = 1024;\nconst UNKNOWN_RSS = 0;\n\nconst kibibytesIn = (status: string): Option.Option<string> =>\n Option.fromNullishOr(RSS_LINE.exec(status)).pipe(\n Option.flatMap((match) => Option.fromUndefinedOr(match.groups)),\n Option.flatMap((groups) => Option.fromUndefinedOr(groups[\"kib\"])),\n );\n\nconst residentBytesOf = (pid: string): Effect.Effect<number, never, RepositoryFiles> =>\n Effect.gen(function* residentBytes() {\n const files = yield* RepositoryFiles;\n const status = yield* files.readFile(`/proc/${pid}/status`);\n return pipe(\n status,\n Option.flatMap(kibibytesIn),\n Option.flatMap(Num.parse),\n Option.map((kib) => kib * BYTES_PER_KIB),\n Option.getOrElse(() => UNKNOWN_RSS),\n );\n });\n\nconst childPids = Effect.gen(function* childPids() {\n const files = yield* RepositoryFiles;\n const pid = String(process.pid);\n const children = yield* files.readFile(`/proc/${pid}/task/${pid}/children`);\n return pipe(\n children,\n Option.map((text) => pipe(Str.trim(text), Str.split(\" \"), Arr.filter(Str.isNonEmpty))),\n Option.getOrElse((): readonly string[] => []),\n );\n});\n\nconst annotateMemory = Effect.gen(function* annotateMemory() {\n const own = yield* residentBytesOf(String(process.pid));\n const pids = yield* childPids;\n const children = yield* Effect.forEach(pids, (pid) => residentBytesOf(pid), { concurrency: 1 });\n const { heapUsed } = process.memoryUsage();\n yield* Effect.annotateCurrentSpan({\n \"process.memory.rss\": own,\n \"process.memory.heap_used\": heapUsed,\n \"msch.compiler.memory.rss\": Num.sumAll(children),\n });\n});\n\nexport const annotateResources = (api: API): Effect.Effect<void, never, RepositoryFiles> =>\n Effect.gen(function* annotateCompiler() {\n yield* annotateMemory;\n const { totals } = api.getTimingInfo();\n yield* Effect.annotateCurrentSpan({\n \"msch.compiler.requests\": totals.requestCount,\n \"msch.compiler.round_trip_ms\": totals.roundTripMs,\n \"msch.compiler.server_ms\": totals.serverTimeMs,\n });\n });\n","import { PACKAGE_JSON_FILE } from \"@r_masseater/kestrion\";\nimport { Array as Arr, Effect, Option, Order, String as Str, pipe } from \"effect\";\n\nimport {\n dependencyEntries,\n readManifest,\n workspaceDependencies,\n} from \"#/entities/package/@x/project.ts\";\nimport { API, getLeadingCommentRanges } from \"#/shared/lib/compiler.ts\";\nimport type { Checker, ParsedCommandLine, Program, SourceFile } from \"#/shared/lib/compiler.ts\";\nimport type { Problem } from \"#/shared/lib/problem.ts\";\nimport { NODE_MODULES, RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { libraryCache, libraryIndex } from \"./library.ts\";\nimport type { LibraryCache, LibraryIndex } from \"./library.ts\";\nimport { annotateResources } from \"./telemetry.ts\";\n\nexport interface Project {\n readonly packageName: Option.Option<string>;\n readonly workspaceDependencies: readonly string[];\n readonly program: Program;\n readonly checker: Checker;\n readonly sourceFiles: readonly SourceFile[];\n readonly library: LibraryIndex;\n}\n\nexport type SourceCheck = (checker: Checker) => (sourceFile: SourceFile) => readonly Problem[];\n\ninterface PackageInfo {\n readonly directory: string;\n readonly name: Option.Option<string>;\n readonly workspaceDependencies: readonly string[];\n}\n\nconst CONFIG_FILE = \"tsconfig.json\";\nconst CONFIG_PATHSPEC = `:(glob)**/${CONFIG_FILE}`;\nconst HIDDEN_PREFIX = \".\";\nconst SKIPPED_DIRECTORIES: ReadonlySet<string> = new Set([NODE_MODULES, \"dist\", \"coverage\"]);\n\nconst isVisible = (file: string): boolean =>\n pipe(\n Str.split(file, \"/\"),\n Arr.every(\n (segment) => !Str.startsWith(HIDDEN_PREFIX)(segment) && !SKIPPED_DIRECTORIES.has(segment),\n ),\n );\n\nexport const listConfigFiles = (\n root: string,\n): Effect.Effect<readonly string[], never, RepositoryFiles> =>\n Effect.gen(function* configFilesUnder() {\n const files = yield* RepositoryFiles;\n const listed = yield* files.matchingFiles(root, [CONFIG_PATHSPEC]);\n const visible = pipe(\n listed,\n Arr.filter(isVisible),\n Arr.map((file) => files.join(root, file)),\n );\n return Arr.sort(visible, Order.String);\n });\n\nexport const parseConfig =\n (api: API) =>\n (configPath: string): Option.Option<ParsedCommandLine> =>\n Option.some(api.parseConfigFile(configPath)).pipe(\n Option.filter((parsed) => Arr.isReadonlyArrayNonEmpty(parsed.fileNames)),\n );\n\nconst nearestPackageDirectory = (\n directory: string,\n root: string,\n): Effect.Effect<string, never, RepositoryFiles> =>\n Effect.gen(function* nearestPackage() {\n const files = yield* RepositoryFiles;\n const hasManifest = yield* files.exists(files.join(directory, PACKAGE_JSON_FILE));\n const parent = files.dirname(directory);\n if (hasManifest || directory === root || parent === directory) {\n return directory;\n }\n return yield* nearestPackageDirectory(parent, root);\n });\n\nexport const packageDirectoryOf =\n (root: string) =>\n (directory: string): Effect.Effect<string, never, RepositoryFiles> =>\n nearestPackageDirectory(directory, root);\n\nconst packageInfoOf = Effect.fn(\"packageInfoOf\")(function* packageInfoOf(\n configPath: string,\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const directory = yield* nearestPackageDirectory(files.dirname(configPath), root);\n const manifest = yield* readManifest(directory);\n return {\n directory,\n name: manifest.pipe(Option.flatMap((found) => Option.fromUndefinedOr(found.name))),\n workspaceDependencies: manifest.pipe(\n Option.map(workspaceDependencies),\n Option.getOrElse(() => []),\n ),\n } satisfies PackageInfo;\n});\n\nconst NO_CHECK_PRAGMA = /^\\/\\/\\s*@ts-nocheck/u;\nconst FILE_START = 0;\n\nconst skipsTypeChecking = (sourceFile: SourceFile): boolean =>\n pipe(\n getLeadingCommentRanges(sourceFile.text, FILE_START) ?? [],\n Arr.some((range) => NO_CHECK_PRAGMA.test(Str.slice(range.pos, range.end)(sourceFile.text))),\n );\n\nconst buildProject = Effect.fn(\"buildProject\")(function* buildProject(\n { compiler: { api, libraries }, generated }: Workspace,\n parsed: ParsedCommandLine,\n info: PackageInfo,\n) {\n const entries = yield* dependencyEntries(info.directory);\n const program = yield* Effect.sync(() =>\n api.createProgram(\n [\n ...parsed.fileNames,\n ...pipe(\n entries,\n Arr.map((entry) => entry.declarationsPath),\n ),\n ],\n { ...parsed.options, noEmit: true },\n ),\n ).pipe(Effect.withSpan(\"createProgram\"));\n const { checker } = program.getProject();\n const library = yield* libraryIndex(libraries)(checker)(entries);\n const projectFiles: ReadonlySet<string> = new Set(\n pipe(\n parsed.fileNames,\n Arr.filter((fileName) => !generated.includes(fileName)),\n ),\n );\n return {\n packageName: info.name,\n workspaceDependencies: info.workspaceDependencies,\n program,\n checker,\n sourceFiles: pipe(\n program.getSourceFileNames(),\n Arr.filter((fileName) => projectFiles.has(fileName)),\n Arr.flatMap((fileName) =>\n Option.toArray(Option.fromUndefinedOr(program.getSourceFile(fileName))),\n ),\n Arr.filter((sourceFile) => !sourceFile.isDeclarationFile && !skipsTypeChecking(sourceFile)),\n ),\n library,\n } satisfies Project;\n});\n\nexport interface Compiler {\n readonly api: API;\n readonly libraries: LibraryCache;\n}\n\nexport interface Workspace {\n readonly compiler: Compiler;\n readonly root: string;\n readonly generated: readonly string[];\n}\n\nexport const typeScriptCompiler = Effect.acquireRelease(\n Effect.sync((): Compiler => ({\n api: new API({ collectTiming: true }),\n libraries: libraryCache(),\n })),\n ({ api }) =>\n Effect.sync(() => {\n api.close();\n }),\n);\n\nconst loadProject = Effect.fn(\"loadProject\")(function* loadProject(\n workspace: Workspace,\n configPath: string,\n) {\n const { compiler, root } = workspace;\n const parsed = parseConfig(compiler.api)(configPath);\n if (Option.isNone(parsed)) {\n return Option.none<Project>();\n }\n const info = yield* packageInfoOf(configPath, root);\n const project = yield* buildProject(workspace, parsed.value, info);\n yield* Effect.annotateCurrentSpan({\n \"msch.project.config\": configPath,\n \"msch.project.program_files\": project.program.getSourceFileNames().length,\n \"msch.project.source_files\": project.sourceFiles.length,\n });\n yield* annotateResources(compiler.api);\n return Option.some(project);\n});\n\nconst releaseProject = (project: Project): Effect.Effect<void> =>\n Effect.sync(() => {\n project.program.dispose();\n });\n\nexport const withProject =\n (workspace: Workspace) =>\n (configPath: string) =>\n <Value, Failure, Requirements>(\n work: (project: Project) => Effect.Effect<Value, Failure, Requirements>,\n ): Effect.Effect<Option.Option<Value>, Failure, Requirements | RepositoryFiles> =>\n Effect.acquireUseRelease(\n loadProject(workspace, configPath),\n (loaded) =>\n Option.match(loaded, {\n onNone: () => Effect.succeedNone,\n onSome: (project) => work(project).pipe(Effect.asSome),\n }),\n (loaded) => Option.match(loaded, { onNone: () => Effect.void, onSome: releaseProject }),\n );\n\nexport const mentions =\n (needle: string) =>\n ({ api }: Compiler) =>\n (configPath: string): Effect.Effect<boolean, never, RepositoryFiles> =>\n Effect.gen(function* mentionsNeedle() {\n const files = yield* RepositoryFiles;\n const fileNames = Option.match(parseConfig(api)(configPath), {\n onNone: (): readonly string[] => [],\n onSome: (parsed): readonly string[] => parsed.fileNames,\n });\n const texts = yield* Effect.forEach(fileNames, (fileName) => files.readFile(fileName), {\n concurrency: 1,\n });\n const includesNeedle = Str.includes(needle);\n return pipe(\n texts,\n Arr.some((text) => Option.exists(text, includesNeedle)),\n );\n });\n","import { PACKAGE_JSON_FILE } from \"@r_masseater/kestrion\";\nimport { Array as Arr, Effect, Option, Order, Schema, String as Str, pipe } from \"effect\";\n\nimport { readManifest, workspaceDependencies } from \"#/entities/package/@x/project.ts\";\nimport { NODE_MODULES, RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { packageDirectoryOf, parseConfig } from \"./project.ts\";\nimport type { Workspace } from \"./project.ts\";\n\nexport interface ProjectInputs {\n readonly options: string;\n readonly files: readonly string[];\n readonly dependencies: readonly string[];\n}\n\nconst SEPARATOR = \"/\";\nconst SCOPE_PREFIX = \"@\";\nconst HIDDEN_PREFIX = \".\";\n\nconst encodeOptions = Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown));\n\nexport const nearestManifestDirectory = Effect.fn(\"nearestManifestDirectory\")(\n function* nearestManifestDirectory(start: string) {\n const files = yield* RepositoryFiles;\n let directory = start;\n let parent = files.dirname(directory);\n while (\n parent !== directory &&\n !(yield* files.exists(files.join(directory, PACKAGE_JSON_FILE)))\n ) {\n directory = parent;\n parent = files.dirname(directory);\n }\n return directory;\n },\n);\n\nconst dependenciesOf = Effect.fn(\"dependenciesOf\")(function* dependenciesOf(directory: string) {\n const files = yield* RepositoryFiles;\n const manifest = yield* readManifest(directory);\n const names = Option.match(manifest, {\n onNone: (): readonly string[] => [],\n onSome: workspaceDependencies,\n });\n return yield* Effect.forEach(\n names,\n (name) => files.realPath(files.join(directory, NODE_MODULES, name)),\n {\n concurrency: 1,\n },\n );\n});\n\nexport const workspaceClosure = Effect.fn(\"workspaceClosure\")(function* workspaceClosure(\n start: string,\n) {\n const seen = new Set([start]);\n const queue = [start];\n for (const directory of queue) {\n const next = yield* dependenciesOf(directory);\n for (const dependency of next) {\n if (!seen.has(dependency)) {\n seen.add(dependency);\n queue.push(dependency);\n }\n }\n }\n return [...seen];\n});\n\nconst isUnder =\n (prefixes: readonly string[]) =>\n (file: string): boolean =>\n pipe(\n prefixes,\n Arr.some((prefix) => Str.startsWith(prefix)(file)),\n );\n\nconst closureOf = Effect.fn(\"closureOf\")(function* closureOf(root: string, configPath: string) {\n const files = yield* RepositoryFiles;\n const directory = yield* packageDirectoryOf(root)(files.dirname(configPath));\n const directories = yield* workspaceClosure(directory);\n const prefixes = pipe(\n directories,\n Arr.map((found) => `${files.relative(root, found)}${SEPARATOR}`),\n );\n return { directories, prefixes };\n});\n\nconst scopedNames =\n (modules: string) =>\n (name: string): Effect.Effect<readonly string[], never, RepositoryFiles> =>\n Effect.gen(function* listScope() {\n const files = yield* RepositoryFiles;\n if (!Str.startsWith(SCOPE_PREFIX)(name)) {\n return [name];\n }\n const scoped = yield* files.readDirectory(files.join(modules, name));\n return pipe(\n scoped,\n Arr.map((entry) => `${name}${SEPARATOR}${entry}`),\n );\n });\n\nconst installedNames = Effect.fn(\"installedNames\")(function* installedNames(modules: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.readDirectory(modules);\n const nested = yield* pipe(\n listed,\n Arr.filter((name) => !Str.startsWith(HIDDEN_PREFIX)(name)),\n (items) => Effect.forEach(items, scopedNames(modules), { concurrency: 1 }),\n );\n return Arr.flatten(nested);\n});\n\nexport const installedPackages = Effect.fn(\"installedPackages\")(function* installedPackages(\n root: string,\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const modules = files.join(directory, NODE_MODULES);\n const names = yield* installedNames(modules);\n return yield* Effect.forEach(\n names,\n (name) =>\n files\n .realPath(files.join(modules, name))\n .pipe(Effect.map((found) => files.relative(root, found))),\n { concurrency: 1 },\n );\n});\n\nconst dependencyVersions = Effect.fn(\"dependencyVersions\")(function* dependencyVersions(\n root: string,\n directories: readonly string[],\n) {\n const installed = yield* Effect.forEach(\n Arr.dedupe([root, ...directories]),\n (directory) => installedPackages(root, directory),\n { concurrency: 1 },\n );\n return Arr.sort(Arr.dedupe(Arr.flatten(installed)), Order.String);\n});\n\nexport interface InputScope {\n readonly workspace: Workspace;\n readonly listed: readonly string[];\n}\n\nexport const projectInputs =\n ({ workspace: { compiler, root }, listed }: InputScope) =>\n (configPath: string): Effect.Effect<Option.Option<ProjectInputs>, never, RepositoryFiles> =>\n Effect.gen(function* collectInputs() {\n const files = yield* RepositoryFiles;\n const parsed = parseConfig(compiler.api)(configPath);\n if (Option.isNone(parsed)) {\n return Option.none();\n }\n const closure = yield* closureOf(root, configPath);\n const dependencies = yield* dependencyVersions(root, closure.directories);\n const options = yield* encodeOptions(parsed.value.options).pipe(\n Effect.orElseSucceed(() => \"\"),\n );\n const sources = pipe(\n parsed.value.fileNames,\n Arr.map((fileName) => files.relative(root, fileName)),\n );\n const shared = pipe(listed, Arr.filter(isUnder(closure.prefixes)));\n return Option.some({\n options,\n files: Arr.sort(Arr.dedupe([...sources, ...shared]), Order.String),\n dependencies,\n });\n });\n","import { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"./repository-files.ts\";\n\nconst PASSED = \"\";\nconst UNREADABLE = \"\";\nconst FIELD_SEPARATOR = \"\\0\";\nconst LINE_SEPARATOR = \"\\n\";\n\nexport interface Records {\n readonly directory: string;\n readonly passed: readonly string[];\n}\n\nexport type NamedFile = readonly [name: string, file: string];\n\nexport const contentKey = Effect.fn(\"contentKey\")(function* contentKey(\n salt: readonly string[],\n named: readonly NamedFile[],\n) {\n const files = yield* RepositoryFiles;\n const entries = yield* Effect.forEach(\n named,\n ([name, file]) =>\n files\n .hashFile(file)\n .pipe(\n Effect.map(\n (found) => `${name}${FIELD_SEPARATOR}${Option.getOrElse(found, () => UNREADABLE)}`,\n ),\n ),\n { concurrency: 1 },\n );\n return yield* files.hash(Arr.join([...salt, ...entries], LINE_SEPARATOR));\n});\n\nexport const recordsIn = Effect.fn(\"recordsIn\")(function* recordsIn(directory: string) {\n const files = yield* RepositoryFiles;\n const present = yield* files.readDirectory(directory);\n return { directory, passed: present } satisfies Records;\n});\n\nexport const keepOnly = Effect.fn(\"keepOnly\")(function* keepOnly(\n records: Records,\n keys: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const stale = pipe(\n records.passed,\n Arr.filter((key) => !Arr.contains(keys, key)),\n );\n yield* Effect.forEach(stale, (key) => files.removeFile(files.join(records.directory, key)), {\n concurrency: 1,\n discard: true,\n });\n yield* Effect.forEach(\n keys,\n (key) => files.writeFile(files.join(records.directory, key), PASSED),\n { concurrency: 1, discard: true },\n );\n});\n"],"mappings":";;;;;;AAYA,MAAM,yBAAyB,CAAC,QAAQ,SAAS;AAEjD,MAAM,mBAAmB;AAEzB,MAAM,mBAAmB;AAEzB,MAAa,YAAY,UAAyB,GAAG,OAAO,MAAM,GAAG,OAAO,KAAK;AAEjF,MAAM,kBAAkB,SAAqC;CAC3D,IAAI,KAAK,oBAAoB,KAAK,KAAK,oBAAoB,GACzD,OAAO,OAAO,KAAK,KAAK,KAAK;CAE/B,OAAO,OAAO,KAAK;AACrB;AAEA,MAAa,mBAAmB,UAA4D;CAC1F,MAAM,SAAS,KACb,OACAA,MAAI,KAAK,WAAW,eAAe,MAAM,CAAC,GAC1CA,MAAI,UACJA,MAAI,YAAY,MAAM,UAAU,SAAS,IAAI,MAAM,SAAS,KAAK,CAAC,CACpE;CACA,IAAI,OAAO,WAAW,MAAM,UAAU,OAAO,SAAS,kBACpD,OAAO,OAAO,KAAK;CAErB,OAAO,OAAO,KAAK,MAAM;AAC3B;AAEA,MAAa,kBAAkB,SAAgD;CAC7E,IAAI,CAAC,KAAK,YAAY,GACpB,OAAO,OAAO,KAAK;CAErB,OAAO,gBAAgB,KAAK,SAAS,CAAC;AACxC;AAEA,MAAM,iBAAiB,SAAkB,SAAoC;CAC3E,IAAI,CAAC,QAAQ,gBAAgB,IAAI,GAC/B,OAAO,OAAO,KAAK;CAErB,OAAO,OAAO,gBAAgB,QAAQ,mBAAmB,MAAM,UAAU,MAAM,CAAC;AAClF;AAEA,MAAa,gBACV,aACA,SACCA,MAAI,UAAU,yBAAyB,SACrC,OAAO,gBAAgB,QAAQ,kBAAkB,MAAM,IAAI,CAAC,CAC9D,CAAC,CAAC,KAAK,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,OAAO,GAAG,UAAU,CAAC,CAAC,UAAU,SACtD,SACA,MACA;CACA,MAAM,QAAQ,OAAO;CACrB,MAAM,QAAQ,KACZ,QAAQ,QACRA,MAAI,QAAQ,QAAQ,CAACA,MAAI,SAAS,MAAM,GAAG,CAAC,CAC9C;CACA,OAAO,OAAO,QAAQ,QAAQ,QAAQ,MAAM,WAAW,MAAM,KAAK,QAAQ,WAAW,GAAG,CAAC,GAAG;EAC1F,aAAa;EACb,SAAS;CACX,CAAC;CACD,OAAO,OAAO,QACZ,OACC,QAAQ,MAAM,UAAU,MAAM,KAAK,QAAQ,WAAW,GAAG,GAAG,MAAM,GACnE;EAAE,aAAa;EAAG,SAAS;CAAK,CAClC;AACF,CAAC"}
|
|
@@ -73,10 +73,11 @@ const declaresAType = (declarations) => pipe(declarations, Array.some((declarati
|
|
|
73
73
|
const carriesTag = (name) => (declarations) => pipe(declarations, Array.flatMap(membersOf), Array.some(isTagNamed(name)));
|
|
74
74
|
const isGenericDeclaration = (declaration) => (isTypeAliasDeclaration(declaration) || isInterfaceDeclaration(declaration)) && Array.isReadonlyArrayNonEmpty(declaration.typeParameters ?? []);
|
|
75
75
|
const propertyNamesOf = (checker) => (type) => pipe(checker.getPropertiesOfType(type), Array.map((property) => property.name));
|
|
76
|
-
const
|
|
76
|
+
const moduleSpecifierLiteralOf = (statement) => {
|
|
77
77
|
if (!isImportDeclaration(statement) && !isExportDeclaration(statement)) return Option.none();
|
|
78
|
-
return Option.fromUndefinedOr(statement.moduleSpecifier).pipe(Option.filter(
|
|
78
|
+
return Option.fromUndefinedOr(statement.moduleSpecifier).pipe(Option.filter(isStringLiteral));
|
|
79
79
|
};
|
|
80
|
+
const moduleSpecifierOf = (statement) => Option.map(moduleSpecifierLiteralOf(statement), (specifier) => specifier.text);
|
|
80
81
|
const importedModulesOf = (sourceFile) => pipe(sourceFile.statements, Array.map((statement) => moduleSpecifierOf(statement)), Array.getSomes);
|
|
81
82
|
// src/shared/lib/problem.ts
|
|
82
83
|
const RuleNameSchema = Schema.String.check(Schema.isPattern(/^[a-z]+(?:-[a-z]+)*$/u));
|
|
@@ -124,6 +125,6 @@ const problemKey = (problem) => pipe([
|
|
|
124
125
|
const sortProblems = (problems) => Array.sort(Array.dedupeWith(problems, (left, right) => problemKey(left) === problemKey(right)), problemOrder);
|
|
125
126
|
const describeFinding = (problem) => `[${problem.rule}] ${problem.message}`;
|
|
126
127
|
const formatProblem = (relative) => (problem) => `${relative(problem.file)}:${String(problem.line)}:${String(problem.column)} ${describeFinding(problem)}`;
|
|
127
|
-
export {
|
|
128
|
+
export { isIdentifier as $, uniqueByReference as A, getTextOfJSDocComment as B, moduleSpecifierOf as C, resolvedSymbol as D, referencedSymbols as E, SymbolFlags$1 as F, isCallExpression as G, isArrowFunction as H, SyntaxKind as I, isEnumDeclaration as J, isClassDeclaration as K, getJSDocTags as L, IndexKind as M, InternalSymbolName as N, symbolAt as O, SignatureKind as P, isFunctionExpression as Q, getLeadingCommentRanges as R, moduleSpecifierLiteralOf as S, isVariableStatement as St, propertyNamesOf as T, isBinaryExpression as U, isArrayLiteralExpression as V, isBlock as W, isExpressionStatement as X, isExportDeclaration as Y, isFunctionDeclaration as Z, isGenericDeclaration as _, isTypeLiteralNode as _t, problemAtPosition as a, isNumericLiteral as at, isTypeDeclaration as b, isVariableDeclaration as bt, carriesTag as c, isPropertyAccessExpression as ct, contains as d, isSatisfiesExpression as dt, isImportDeclaration as et, declarationsOf as f, isSignatureDeclaration as ft, isExternalDeclaration as g, isTypeAliasDeclaration as gt, importedModulesOf as h, isStringLiteral as ht, problemAt as i, isNewExpression as it, API as j, symbolAtLocation as k, childrenOf as l, isPropertyAssignment as lt, descendantsOf as m, isSpreadElement as mt, describeFinding as n, isModuleBlock as nt, problemInFile as o, isObjectLiteralExpression as ot, declaresAType as p, isSourceFile as pt, isElementAccessExpression as q, formatProblem as r, isModuleDeclaration as rt, sortProblems as s, isParenthesizedExpression as st, ProblemList as t, isInterfaceDeclaration as tt, columnOf as u, isReturnStatement as ut, isInsideAny as v, isTypeReferenceNode as vt, packageOf as w, lineOf as x, isVariableDeclarationList as xt, isOutsideDeclaration as y, isUnionTypeNode as yt, getNameOfDeclaration as z };
|
|
128
129
|
|
|
129
|
-
//# sourceMappingURL=problem-
|
|
130
|
+
//# sourceMappingURL=problem-DGGF-vjW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"problem-DGGF-vjW.mjs","names":["Arr","Str","Arr"],"sources":["../src/shared/lib/syntax.ts","../src/shared/lib/problem.ts"],"sourcesContent":["import { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nimport {\n isClassDeclaration,\n isEnumDeclaration,\n isExportAssignment,\n isExportDeclaration,\n isIdentifier,\n isImportDeclaration,\n isInterfaceDeclaration,\n isLiteralTypeNode,\n isPropertyAccessExpression,\n isPropertyDeclaration,\n isPropertySignatureDeclaration,\n isStringLiteral,\n isTypeAliasDeclaration,\n isTypeLiteralNode,\n SyntaxKind,\n} from \"./compiler.ts\";\nimport type {\n Checker,\n Declaration,\n EnumDeclaration,\n Expression,\n InterfaceDeclaration,\n Node,\n Program,\n SourceFile,\n StringLiteral,\n TypeSymbol,\n Type,\n TypeAliasDeclaration,\n} from \"./compiler.ts\";\nimport { NODE_MODULES } from \"./repository-files.ts\";\n\nconst NODE_MODULES_SEGMENT = `/${NODE_MODULES}/`;\n\nexport const POSITION_BASE = 1;\n\nexport const uniqueByReference = <Item>(items: readonly Item[]): readonly Item[] =>\n Arr.dedupeWith(items, (left, right) => left === right);\n\nexport const childrenOf = (node: Node): readonly Node[] => {\n const children: Node[] = [];\n node.forEachChild((child) => {\n children.push(child);\n });\n return children;\n};\n\nconst SCOPE_PREFIX = \"@\";\nconst SCOPED_SEGMENTS = 2;\nconst UNSCOPED_SEGMENTS = 1;\n\nexport const packageOf = (fileName: string): string => {\n const afterModules = pipe(\n fileName,\n Str.lastIndexOf(NODE_MODULES_SEGMENT),\n Option.match({\n onNone: () => fileName,\n onSome: (index) => Str.slice(index + NODE_MODULES_SEGMENT.length)(fileName),\n }),\n );\n const segments = Str.split(\"/\")(afterModules);\n if (Str.startsWith(SCOPE_PREFIX)(afterModules)) {\n return pipe(Arr.take(segments, SCOPED_SEGMENTS), Arr.join(\"/\"));\n }\n return pipe(Arr.take(segments, UNSCOPED_SEGMENTS), Arr.join(\"/\"));\n};\n\nexport const descendantsOf = (node: Node): readonly Node[] =>\n pipe(\n childrenOf(node),\n Arr.flatMap((child) => Arr.prepend(descendantsOf(child), child)),\n );\n\nconst isExternalFile =\n (program: Program) =>\n (sourceFile: SourceFile): boolean =>\n !program.isSourceFileDefaultLibrary(sourceFile) &&\n (Str.includes(NODE_MODULES_SEGMENT)(sourceFile.fileName) ||\n program.isSourceFileFromExternalLibrary(sourceFile));\n\nexport const isExternalDeclaration =\n (program: Program) =>\n (declaration: Node): boolean =>\n isExternalFile(program)(declaration.getSourceFile());\n\nexport const isOutsideDeclaration =\n (program: Program) =>\n (declaration: Node): boolean =>\n program.isSourceFileDefaultLibrary(declaration.getSourceFile()) ||\n isExternalDeclaration(program)(declaration);\n\nconst ALIAS_KINDS: ReadonlySet<SyntaxKind> = new Set([\n SyntaxKind.ImportSpecifier,\n SyntaxKind.ImportClause,\n SyntaxKind.NamespaceImport,\n SyntaxKind.ExportSpecifier,\n SyntaxKind.ImportEqualsDeclaration,\n SyntaxKind.ExportAssignment,\n]);\n\nexport const declarationsOf = (symbol: TypeSymbol): readonly Declaration[] =>\n pipe(\n symbol.declarations,\n Arr.flatMap((handle) => Option.toArray(Option.fromUndefinedOr(handle.resolve()))),\n );\n\nconst isEntityName = (expression: Expression): boolean =>\n isIdentifier(expression) ||\n (isPropertyAccessExpression(expression) && isEntityName(expression.expression));\n\nconst aliasesAnEntity = (declaration: Node): boolean =>\n !isExportAssignment(declaration) || isEntityName(declaration.expression);\n\nconst isAliasDeclaration = (declaration: Node): boolean =>\n ALIAS_KINDS.has(declaration.kind) && aliasesAnEntity(declaration);\n\nexport const resolvedSymbol =\n (checker: Checker) =>\n (symbol: TypeSymbol): TypeSymbol => {\n if (\n !pipe(\n declarationsOf(symbol),\n Arr.some((declaration) => isAliasDeclaration(declaration)),\n )\n ) {\n return symbol;\n }\n return checker.getAliasedSymbol(symbol);\n };\n\nexport const symbolAtLocation =\n (checker: Checker) =>\n (node: Node): Option.Option<TypeSymbol> =>\n Option.fromUndefinedOr(checker.getSymbolAtLocation(node));\n\nexport const symbolAt =\n (checker: Checker) =>\n (node: Node): Option.Option<TypeSymbol> =>\n symbolAtLocation(checker)(node).pipe(Option.map(resolvedSymbol(checker)));\n\nexport const referencedSymbols =\n (checker: Checker) =>\n (node: Node): readonly TypeSymbol[] => {\n const identifiers = pipe(\n Arr.prepend(descendantsOf(node), node),\n Arr.filter((candidate) => isIdentifier(candidate)),\n );\n const symbols = pipe(\n checker.getSymbolAtLocation(identifiers),\n Arr.flatMap((symbol) => Option.toArray(Option.fromUndefinedOr(symbol))),\n Arr.map(resolvedSymbol(checker)),\n );\n return uniqueByReference(symbols);\n };\n\nexport const lineOf = (node: Node): number => {\n const sourceFile = node.getSourceFile();\n return sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + POSITION_BASE;\n};\n\nexport const columnOf = (node: Node): number => {\n const sourceFile = node.getSourceFile();\n return (\n sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).character + POSITION_BASE\n );\n};\n\nexport const contains =\n (outer: Node) =>\n (inner: Node): boolean =>\n outer.getSourceFile().fileName === inner.getSourceFile().fileName &&\n outer.getStart() <= inner.getStart() &&\n inner.getEnd() <= outer.getEnd();\n\nexport const isInsideAny =\n (outers: readonly Node[]) =>\n (node: Node): boolean =>\n pipe(\n outers,\n Arr.some((outer) => contains(outer)(node)),\n );\n\nexport const isTypeDeclaration = (\n declaration: Node,\n): declaration is TypeAliasDeclaration | InterfaceDeclaration | EnumDeclaration =>\n isTypeAliasDeclaration(declaration) ||\n isInterfaceDeclaration(declaration) ||\n isEnumDeclaration(declaration);\n\nconst membersOf = (declaration: Node): readonly Node[] => {\n if (isInterfaceDeclaration(declaration) || isClassDeclaration(declaration)) {\n return declaration.members;\n }\n if (isTypeAliasDeclaration(declaration) && isTypeLiteralNode(declaration.type)) {\n return declaration.type.members;\n }\n return [];\n};\n\nconst isTagNamed =\n (name: string) =>\n (member: Node): boolean =>\n (isPropertySignatureDeclaration(member) || isPropertyDeclaration(member)) &&\n pipe(\n Option.fromUndefinedOr(member.type),\n Option.exists(\n (type) =>\n isLiteralTypeNode(type) && isStringLiteral(type.literal) && type.literal.text === name,\n ),\n );\n\nexport const declaresAType = (declarations: readonly Node[]): boolean =>\n pipe(\n declarations,\n Arr.some((declaration) => isTypeDeclaration(declaration) || isClassDeclaration(declaration)),\n );\n\nexport const carriesTag =\n (name: string) =>\n (declarations: readonly Node[]): boolean =>\n pipe(declarations, Arr.flatMap(membersOf), Arr.some(isTagNamed(name)));\n\nexport const isGenericDeclaration = (declaration: Node): boolean =>\n (isTypeAliasDeclaration(declaration) || isInterfaceDeclaration(declaration)) &&\n Arr.isReadonlyArrayNonEmpty(declaration.typeParameters ?? []);\n\nexport const propertyNamesOf =\n (checker: Checker) =>\n (type: Type): readonly string[] =>\n pipe(\n checker.getPropertiesOfType(type),\n Arr.map((property) => property.name),\n );\n\nexport const moduleSpecifierLiteralOf = (statement: Node): Option.Option<StringLiteral> => {\n if (!isImportDeclaration(statement) && !isExportDeclaration(statement)) {\n return Option.none();\n }\n return Option.fromUndefinedOr(statement.moduleSpecifier).pipe(Option.filter(isStringLiteral));\n};\n\nexport const moduleSpecifierOf = (statement: Node): Option.Option<string> =>\n Option.map(moduleSpecifierLiteralOf(statement), (specifier) => specifier.text);\n\nexport const importedModulesOf = (sourceFile: SourceFile): readonly string[] =>\n pipe(\n sourceFile.statements,\n Arr.map((statement) => moduleSpecifierOf(statement)),\n Arr.getSomes,\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.String.check(Schema.isPattern(/^[a-z]+(?:-[a-z]+)*$/u));\n\nexport type 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\nexport type Problem = typeof ProblemSchema.Type;\n\nexport const ProblemList = Schema.Array(ProblemSchema);\n\nexport const CANDIDATE_LIMIT = 3;\n\nconst FIRST = 1;\n\nexport interface Position {\n readonly line: number;\n readonly column: number;\n}\n\nexport const problemAtPosition =\n (rule: RuleName) =>\n (file: string, { line, column }: Readonly<Position>, message: string): Problem => ({\n file,\n line,\n column,\n rule,\n message,\n });\n\nexport const problemInFile =\n (rule: RuleName) =>\n (file: string, message: string): Problem =>\n problemAtPosition(rule)(file, { line: FIRST, column: FIRST }, message);\n\nexport interface Finding {\n readonly rule: RuleName;\n readonly message: string;\n}\n\nexport const 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\nexport const sortProblems = (problems: readonly Problem[]): readonly Problem[] =>\n Arr.sort(\n Arr.dedupeWith(problems, (left, right) => problemKey(left) === problemKey(right)),\n problemOrder,\n );\n\nexport const describeFinding = (problem: Problem): string => `[${problem.rule}] ${problem.message}`;\n\nexport const formatProblem =\n (relative: (file: string) => string) =>\n (problem: Problem): string =>\n `${relative(problem.file)}:${String(problem.line)}:${String(problem.column)} ${describeFinding(problem)}`;\n"],"mappings":";;;;;;AAmCA,MAAM,uBAAuB,IAAI,aAAa;AAI9C,MAAa,qBAA2B,UACtCA,MAAI,WAAW,QAAQ,MAAM,UAAU,SAAS,KAAK;AAEvD,MAAa,cAAc,SAAgC;CACzD,MAAM,WAAmB,CAAC;CAC1B,KAAK,cAAc,UAAU;EAC3B,SAAS,KAAK,KAAK;CACrB,CAAC;CACD,OAAO;AACT;AAEA,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,oBAAoB;AAE1B,MAAa,aAAa,aAA6B;CACrD,MAAM,eAAe,KACnB,UACAC,SAAI,YAAY,oBAAoB,GACpC,OAAO,MAAM;EACX,cAAc;EACd,SAAS,UAAUA,SAAI,MAAM,QAAQ,qBAAqB,MAAM,CAAC,CAAC,QAAQ;CAC5E,CAAC,CACH;CACA,MAAM,WAAWA,SAAI,MAAM,GAAG,CAAC,CAAC,YAAY;CAC5C,IAAIA,SAAI,WAAW,YAAY,CAAC,CAAC,YAAY,GAC3C,OAAO,KAAKD,MAAI,KAAK,UAAU,eAAe,GAAGA,MAAI,KAAK,GAAG,CAAC;CAEhE,OAAO,KAAKA,MAAI,KAAK,UAAU,iBAAiB,GAAGA,MAAI,KAAK,GAAG,CAAC;AAClE;AAEA,MAAa,iBAAiB,SAC5B,KACE,WAAW,IAAI,GACfA,MAAI,SAAS,UAAUA,MAAI,QAAQ,cAAc,KAAK,GAAG,KAAK,CAAC,CACjE;AAEF,MAAM,kBACH,aACA,eACC,CAAC,QAAQ,2BAA2B,UAAU,MAC7CC,SAAI,SAAS,oBAAoB,CAAC,CAAC,WAAW,QAAQ,KACrD,QAAQ,gCAAgC,UAAU;AAExD,MAAa,yBACV,aACA,gBACC,eAAe,OAAO,CAAC,CAAC,YAAY,cAAc,CAAC;AAEvD,MAAa,wBACV,aACA,gBACC,QAAQ,2BAA2B,YAAY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,SAAS,YAAqB,QAAQ,IAAI;CAC/D,MAAM,SAAS,MAAM,SAAS,YAAqB,QAAQ,MAAM;CACjE,MAAM,SAAS,MAAM,SAAS,YAAqB,QAAQ,IAAI;CAC/D,MAAM,SAAS,MAAM,SAAS,YAAqB,QAAQ,OAAO;AACpE,CAAC;AAED,MAAM,cAAc,YAClB,KACE;CAAC,QAAQ;CAAM,OAAO,QAAQ,IAAI;CAAG,OAAO,QAAQ,MAAM;CAAG,QAAQ;CAAM,QAAQ;AAAO,GAC1FE,MAAI,KAAK,IAAI,CACf;AAEF,MAAa,gBAAgB,aAC3BA,MAAI,KACFA,MAAI,WAAW,WAAW,MAAM,UAAU,WAAW,IAAI,MAAM,WAAW,KAAK,CAAC,GAChF,YACF;AAEF,MAAa,mBAAmB,YAA6B,IAAI,QAAQ,KAAK,IAAI,QAAQ;AAE1F,MAAa,iBACV,cACA,YACC,GAAG,SAAS,QAAQ,IAAI,EAAE,GAAG,OAAO,QAAQ,IAAI,EAAE,GAAG,OAAO,QAAQ,MAAM,EAAE,GAAG,gBAAgB,OAAO"}
|
package/dist/published.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as lookupReport } from "./lookup-report-
|
|
2
|
+
import { t as lookupReport } from "./lookup-report-jWcGgE_D.mjs";
|
|
3
3
|
import { t as runCli } from "./runtime-CFZ41rB0.mjs";
|
|
4
4
|
import { i as namedCatalogsOf, s as specifiedIn, t as fieldsOf } from "./specifiers-D9L0OV3r.mjs";
|
|
5
5
|
import { t as workspaceManifest } from "./workspace-manifest-CAVYfp66.mjs";
|
package/dist/refs.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as lookupReport } from "./lookup-report-
|
|
2
|
+
import { t as lookupReport } from "./lookup-report-jWcGgE_D.mjs";
|
|
3
3
|
import { t as runCli } from "./runtime-CFZ41rB0.mjs";
|
|
4
4
|
import { a as groupOf, n as RepositoryFiles } from "./repository-files-C2gVviac.mjs";
|
|
5
5
|
import { a as sent, i as publicLookup, n as githubToken, r as jsonLookup } from "./lookup-DjQU0W6q.mjs";
|
package/dist/unbumped.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as writeProblems, n as failWhenAny } from "./output-
|
|
2
|
+
import { i as writeProblems, n as failWhenAny } from "./output-DMksIc-0.mjs";
|
|
3
3
|
import { t as runCli } from "./runtime-CFZ41rB0.mjs";
|
|
4
4
|
import { t as checkPackageVersions } from "./package-versions-G9Unih6I.mjs";
|
|
5
|
-
import { s as sortProblems } from "./problem-
|
|
5
|
+
import { s as sortProblems } from "./problem-DGGF-vjW.mjs";
|
|
6
6
|
import { n as RepositoryFiles } from "./repository-files-C2gVviac.mjs";
|
|
7
7
|
import { Effect } from "effect";
|
|
8
8
|
// bin/msch-unbumped.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as groupOf, n as RepositoryFiles } from "./repository-files-C2gVviac.mjs";
|
|
2
|
-
import { a as problemAtPosition } from "./problem-
|
|
2
|
+
import { a as problemAtPosition } from "./problem-DGGF-vjW.mjs";
|
|
3
3
|
import { n as githubToken, r as jsonLookup, t as fetched } from "./lookup-DjQU0W6q.mjs";
|
|
4
4
|
import { t as registryRelease } from "./registry-releases-E0PE3Wq-.mjs";
|
|
5
5
|
import { Array, Effect, HashMap, HashSet, Match, Option, Record, Schema, String as String$1, pipe } from "effect";
|
|
@@ -354,4 +354,4 @@ const upstreamExitsMet = Effect.fn("upstreamExitsMet")(function* upstreamExitsMe
|
|
|
354
354
|
});
|
|
355
355
|
export { workspaceDeviations as a, tomlSourceComments as c, problemAtIndex as d, cargoDeviations as i, yamlSourceComments as l, upstreamExitsMet as n, collectNodes as o, WORKSPACE_SECTIONS as r, isRecord as s, checkUpstreamExits as t, positionOf as u };
|
|
356
356
|
|
|
357
|
-
//# sourceMappingURL=upstream-exits-
|
|
357
|
+
//# sourceMappingURL=upstream-exits-BVey4j2q.mjs.map
|