everything-dev
Version:
A consolidated product package for building Module Federation apps with oRPC APIs.
1 lines • 3.23 kB
Source Map (JSON)
{"version":3,"file":"apply.mjs","names":[],"sources":["../../../../src/services/scaffold/upgrade-audit/apply.ts"],"sourcesContent":["import { Effect } from \"effect\";\nimport { audit } from \"./audit\";\nimport { scanImports } from \"./checks/imports\";\nimport { GateBlocked } from \"./domain\";\nimport { applyManifest } from \"./steps/apply-manifest\";\nimport { authorConfig, type StepResult } from \"./steps/author-config\";\nimport { migratePnpm } from \"./steps/migrate-pnpm\";\nimport { migrateRouteMounts } from \"./steps/migrate-route-mounts\";\nimport { migrateUiSeam } from \"./steps/migrate-ui-seam\";\nimport { retireV1Shell } from \"./steps/retire-v1-shell\";\nimport { retireZephyr } from \"./steps/retire-zephyr\";\n\nexport interface ApplyStepLog {\n readonly name: string;\n readonly result: StepResult;\n}\n\nexport const apply = (\n projectDir: string,\n dryRun: boolean,\n): Effect.Effect<ApplyStepLog[], GateBlocked | Error> =>\n Effect.gen(function* () {\n // Route mount restructure clears blocker-class findings (unknown mounts),\n // so it runs before the audit gate. Re-run the audit after it so the gate\n // sees the corrected tree.\n const mountResult = yield* migrateRouteMounts(projectDir, dryRun);\n\n const report = yield* audit(projectDir);\n if (report.manifest.blockerCount > 0) {\n return yield* Effect.fail(\n new GateBlocked({\n findings: report.findings.filter((f) => f.severity === \"blocker\"),\n }),\n );\n }\n\n const rewrites = yield* scanImports(projectDir);\n\n const configResult = yield* authorConfig(projectDir, report.manifest.plugins, dryRun);\n const pnpmResult = yield* migratePnpm(projectDir, dryRun);\n const seamResult = yield* migrateUiSeam(projectDir, dryRun);\n const shellResult = yield* retireV1Shell(projectDir, dryRun);\n const zephyrResult = yield* retireZephyr(projectDir, dryRun);\n const manifestResult = yield* applyManifest(projectDir, rewrites, dryRun);\n\n return [\n { name: \"migrate-route-mounts\", result: mountResult },\n { name: \"author-config\", result: configResult },\n { name: \"migrate-pnpm\", result: pnpmResult },\n { name: \"migrate-ui-seam\", result: seamResult },\n { name: \"retire-v1-shell\", result: shellResult },\n { name: \"retire-zephyr\", result: zephyrResult },\n { name: \"apply-manifest\", result: manifestResult },\n ];\n });\n"],"mappings":";;;;;;;;;;;;;AAiBA,MAAa,SACX,YACA,WAEA,OAAO,IAAI,aAAa;CAItB,MAAM,cAAc,OAAO,mBAAmB,YAAY,MAAM;CAEhE,MAAM,SAAS,OAAO,MAAM,UAAU;CACtC,IAAI,OAAO,SAAS,eAAe,GACjC,OAAO,OAAO,OAAO,KACnB,IAAI,YAAY,EACd,UAAU,OAAO,SAAS,QAAQ,MAAM,EAAE,aAAa,SAAS,EAClE,CAAC,CACH;CAGF,MAAM,WAAW,OAAO,YAAY,UAAU;CAE9C,MAAM,eAAe,OAAO,aAAa,YAAY,OAAO,SAAS,SAAS,MAAM;CACpF,MAAM,aAAa,OAAO,YAAY,YAAY,MAAM;CACxD,MAAM,aAAa,OAAO,cAAc,YAAY,MAAM;CAC1D,MAAM,cAAc,OAAO,cAAc,YAAY,MAAM;CAC3D,MAAM,eAAe,OAAO,aAAa,YAAY,MAAM;CAC3D,MAAM,iBAAiB,OAAO,cAAc,YAAY,UAAU,MAAM;CAExE,OAAO;EACL;GAAE,MAAM;GAAwB,QAAQ;EAAY;EACpD;GAAE,MAAM;GAAiB,QAAQ;EAAa;EAC9C;GAAE,MAAM;GAAgB,QAAQ;EAAW;EAC3C;GAAE,MAAM;GAAmB,QAAQ;EAAW;EAC9C;GAAE,MAAM;GAAmB,QAAQ;EAAY;EAC/C;GAAE,MAAM;GAAiB,QAAQ;EAAa;EAC9C;GAAE,MAAM;GAAkB,QAAQ;EAAe;CACnD;AACF,CAAC"}