@shrkcrft/inspector 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/acceptance-replay.d.ts +63 -0
- package/dist/acceptance-replay.d.ts.map +1 -0
- package/dist/acceptance-replay.js +240 -0
- package/dist/action-hint-diagnostics.d.ts +32 -0
- package/dist/action-hint-diagnostics.d.ts.map +1 -0
- package/dist/action-hint-diagnostics.js +133 -0
- package/dist/adoption-check.d.ts +28 -0
- package/dist/adoption-check.d.ts.map +1 -0
- package/dist/adoption-check.js +181 -0
- package/dist/adoption-checkpoint.d.ts +97 -0
- package/dist/adoption-checkpoint.d.ts.map +1 -0
- package/dist/adoption-checkpoint.js +209 -0
- package/dist/adoption-merge-preview.d.ts +28 -0
- package/dist/adoption-merge-preview.d.ts.map +1 -0
- package/dist/adoption-merge-preview.js +254 -0
- package/dist/adoption-report-renderer.d.ts +33 -0
- package/dist/adoption-report-renderer.d.ts.map +1 -0
- package/dist/adoption-report-renderer.js +257 -0
- package/dist/adoption-state.d.ts +100 -0
- package/dist/adoption-state.d.ts.map +1 -0
- package/dist/adoption-state.js +296 -0
- package/dist/adoption-three-way.d.ts +46 -0
- package/dist/adoption-three-way.d.ts.map +1 -0
- package/dist/adoption-three-way.js +181 -0
- package/dist/agent-brief.d.ts +77 -0
- package/dist/agent-brief.d.ts.map +1 -0
- package/dist/agent-brief.js +490 -0
- package/dist/agent-contract-gate.d.ts +108 -0
- package/dist/agent-contract-gate.d.ts.map +1 -0
- package/dist/agent-contract-gate.js +412 -0
- package/dist/agent-contract-templates.d.ts +63 -0
- package/dist/agent-contract-templates.d.ts.map +1 -0
- package/dist/agent-contract-templates.js +346 -0
- package/dist/agent-contract.d.ts +65 -0
- package/dist/agent-contract.d.ts.map +1 -0
- package/dist/agent-contract.js +555 -0
- package/dist/agent-handoff.d.ts +123 -0
- package/dist/agent-handoff.d.ts.map +1 -0
- package/dist/agent-handoff.js +470 -0
- package/dist/agent-instructions.d.ts +2 -0
- package/dist/agent-instructions.d.ts.map +1 -0
- package/dist/agent-instructions.js +21 -0
- package/dist/agent-orchestration.d.ts +61 -0
- package/dist/agent-orchestration.d.ts.map +1 -0
- package/dist/agent-orchestration.js +285 -0
- package/dist/agent-task-prep.d.ts +31 -0
- package/dist/agent-task-prep.d.ts.map +1 -0
- package/dist/agent-task-prep.js +73 -0
- package/dist/ai-readiness.d.ts +30 -0
- package/dist/ai-readiness.d.ts.map +1 -0
- package/dist/ai-readiness.js +279 -0
- package/dist/api-report.d.ts +51 -0
- package/dist/api-report.d.ts.map +1 -0
- package/dist/api-report.js +254 -0
- package/dist/apply-dispatch-trace.d.ts +93 -0
- package/dist/apply-dispatch-trace.d.ts.map +1 -0
- package/dist/apply-dispatch-trace.js +283 -0
- package/dist/apply-gate-result.d.ts +52 -0
- package/dist/apply-gate-result.d.ts.map +1 -0
- package/dist/apply-gate-result.js +44 -0
- package/dist/architecture-map.d.ts +118 -0
- package/dist/architecture-map.d.ts.map +1 -0
- package/dist/architecture-map.js +543 -0
- package/dist/area-explore.d.ts +75 -0
- package/dist/area-explore.d.ts.map +1 -0
- package/dist/area-explore.js +438 -0
- package/dist/area-map.d.ts +57 -0
- package/dist/area-map.d.ts.map +1 -0
- package/dist/area-map.js +214 -0
- package/dist/asset-provenance.d.ts +123 -0
- package/dist/asset-provenance.d.ts.map +1 -0
- package/dist/asset-provenance.js +209 -0
- package/dist/barrel-operations.d.ts +45 -0
- package/dist/barrel-operations.d.ts.map +1 -0
- package/dist/barrel-operations.js +159 -0
- package/dist/boundaries-changed-only.d.ts +62 -0
- package/dist/boundaries-changed-only.d.ts.map +1 -0
- package/dist/boundaries-changed-only.js +97 -0
- package/dist/boundary-suggestions.d.ts +20 -0
- package/dist/boundary-suggestions.d.ts.map +1 -0
- package/dist/boundary-suggestions.js +51 -0
- package/dist/bundle-diff.d.ts +98 -0
- package/dist/bundle-diff.d.ts.map +1 -0
- package/dist/bundle-diff.js +531 -0
- package/dist/bundle-replay.d.ts +68 -0
- package/dist/bundle-replay.d.ts.map +1 -0
- package/dist/bundle-replay.js +273 -0
- package/dist/bundle-validate-html.d.ts +11 -0
- package/dist/bundle-validate-html.d.ts.map +1 -0
- package/dist/bundle-validate-html.js +60 -0
- package/dist/change-intent.d.ts +36 -0
- package/dist/change-intent.d.ts.map +1 -0
- package/dist/change-intent.js +259 -0
- package/dist/changed-preflight.d.ts +59 -0
- package/dist/changed-preflight.d.ts.map +1 -0
- package/dist/changed-preflight.js +358 -0
- package/dist/changed-scope.d.ts +112 -0
- package/dist/changed-scope.d.ts.map +1 -0
- package/dist/changed-scope.js +172 -0
- package/dist/changes-summary.d.ts +87 -0
- package/dist/changes-summary.d.ts.map +1 -0
- package/dist/changes-summary.js +323 -0
- package/dist/check-result-v1.d.ts +90 -0
- package/dist/check-result-v1.d.ts.map +1 -0
- package/dist/check-result-v1.js +335 -0
- package/dist/ci-integrity-report.d.ts +38 -0
- package/dist/ci-integrity-report.d.ts.map +1 -0
- package/dist/ci-integrity-report.js +324 -0
- package/dist/ci-permissions-fix.d.ts +38 -0
- package/dist/ci-permissions-fix.d.ts.map +1 -0
- package/dist/ci-permissions-fix.js +382 -0
- package/dist/ci-permissions.d.ts +51 -0
- package/dist/ci-permissions.d.ts.map +1 -0
- package/dist/ci-permissions.js +431 -0
- package/dist/ci-predict.d.ts +42 -0
- package/dist/ci-predict.d.ts.map +1 -0
- package/dist/ci-predict.js +300 -0
- package/dist/ci-scaffold.d.ts +47 -0
- package/dist/ci-scaffold.d.ts.map +1 -0
- package/dist/ci-scaffold.js +638 -0
- package/dist/codemod-assist.d.ts +97 -0
- package/dist/codemod-assist.d.ts.map +1 -0
- package/dist/codemod-assist.js +261 -0
- package/dist/command-recommender.d.ts +25 -0
- package/dist/command-recommender.d.ts.map +1 -0
- package/dist/command-recommender.js +145 -0
- package/dist/command-suggester.d.ts +61 -0
- package/dist/command-suggester.d.ts.map +1 -0
- package/dist/command-suggester.js +159 -0
- package/dist/command-taxonomy.d.ts +38 -0
- package/dist/command-taxonomy.d.ts.map +1 -0
- package/dist/command-taxonomy.js +164 -0
- package/dist/compliance-evidence.d.ts +58 -0
- package/dist/compliance-evidence.d.ts.map +1 -0
- package/dist/compliance-evidence.js +260 -0
- package/dist/compliance-profiles.d.ts +42 -0
- package/dist/compliance-profiles.d.ts.map +1 -0
- package/dist/compliance-profiles.js +171 -0
- package/dist/construct-adoption-diff.d.ts +55 -0
- package/dist/construct-adoption-diff.d.ts.map +1 -0
- package/dist/construct-adoption-diff.js +331 -0
- package/dist/construct-adoption.d.ts +71 -0
- package/dist/construct-adoption.d.ts.map +1 -0
- package/dist/construct-adoption.js +331 -0
- package/dist/construct-inference.d.ts +44 -0
- package/dist/construct-inference.d.ts.map +1 -0
- package/dist/construct-inference.js +391 -0
- package/dist/construct-registry.d.ts +32 -0
- package/dist/construct-registry.d.ts.map +1 -0
- package/dist/construct-registry.js +198 -0
- package/dist/contract-file-rule.d.ts +37 -0
- package/dist/contract-file-rule.d.ts.map +1 -0
- package/dist/contract-file-rule.js +99 -0
- package/dist/contract-template-registry.d.ts +28 -0
- package/dist/contract-template-registry.d.ts.map +1 -0
- package/dist/contract-template-registry.js +161 -0
- package/dist/contradictions.d.ts +52 -0
- package/dist/contradictions.d.ts.map +1 -0
- package/dist/contradictions.js +391 -0
- package/dist/convention-registry.d.ts +44 -0
- package/dist/convention-registry.d.ts.map +1 -0
- package/dist/convention-registry.js +195 -0
- package/dist/coverage-report.d.ts +25 -0
- package/dist/coverage-report.d.ts.map +1 -0
- package/dist/coverage-report.js +190 -0
- package/dist/custom-checks.d.ts +146 -0
- package/dist/custom-checks.d.ts.map +1 -0
- package/dist/custom-checks.js +260 -0
- package/dist/dashboard/dashboard-data.d.ts +59 -0
- package/dist/dashboard/dashboard-data.d.ts.map +1 -0
- package/dist/dashboard/dashboard-data.js +653 -0
- package/dist/dashboard-export.d.ts +67 -0
- package/dist/dashboard-export.d.ts.map +1 -0
- package/dist/dashboard-export.js +203 -0
- package/dist/decision-records.d.ts +47 -0
- package/dist/decision-records.d.ts.map +1 -0
- package/dist/decision-records.js +255 -0
- package/dist/demo-package.d.ts +49 -0
- package/dist/demo-package.d.ts.map +1 -0
- package/dist/demo-package.js +305 -0
- package/dist/demo-script.d.ts +25 -0
- package/dist/demo-script.d.ts.map +1 -0
- package/dist/demo-script.js +198 -0
- package/dist/demo-workflow.d.ts +28 -0
- package/dist/demo-workflow.d.ts.map +1 -0
- package/dist/demo-workflow.js +178 -0
- package/dist/dev-cycle.d.ts +41 -0
- package/dist/dev-cycle.d.ts.map +1 -0
- package/dist/dev-cycle.js +94 -0
- package/dist/dev-session-html.d.ts +13 -0
- package/dist/dev-session-html.d.ts.map +1 -0
- package/dist/dev-session-html.js +223 -0
- package/dist/dev-session-report.d.ts +11 -0
- package/dist/dev-session-report.d.ts.map +1 -0
- package/dist/dev-session-report.js +206 -0
- package/dist/dev-session.d.ts +257 -0
- package/dist/dev-session.d.ts.map +1 -0
- package/dist/dev-session.js +568 -0
- package/dist/diagnostics-suggest.d.ts +17 -0
- package/dist/diagnostics-suggest.d.ts.map +1 -0
- package/dist/diagnostics-suggest.js +69 -0
- package/dist/docs-check.d.ts +40 -0
- package/dist/docs-check.d.ts.map +1 -0
- package/dist/docs-check.js +221 -0
- package/dist/doctor-acknowledgements.d.ts +69 -0
- package/dist/doctor-acknowledgements.d.ts.map +1 -0
- package/dist/doctor-acknowledgements.js +150 -0
- package/dist/doctor-result.d.ts +51 -0
- package/dist/doctor-result.d.ts.map +1 -0
- package/dist/doctor-result.js +7 -0
- package/dist/doctor-suppressions.d.ts +91 -0
- package/dist/doctor-suppressions.d.ts.map +1 -0
- package/dist/doctor-suppressions.js +238 -0
- package/dist/drift-baseline.d.ts +29 -0
- package/dist/drift-baseline.d.ts.map +1 -0
- package/dist/drift-baseline.js +80 -0
- package/dist/drift.d.ts +38 -0
- package/dist/drift.d.ts.map +1 -0
- package/dist/drift.js +107 -0
- package/dist/entrypoint-matrix.d.ts +61 -0
- package/dist/entrypoint-matrix.d.ts.map +1 -0
- package/dist/entrypoint-matrix.js +221 -0
- package/dist/examples-check.d.ts +36 -0
- package/dist/examples-check.d.ts.map +1 -0
- package/dist/examples-check.js +168 -0
- package/dist/execution-graph.d.ts +98 -0
- package/dist/execution-graph.d.ts.map +1 -0
- package/dist/execution-graph.js +484 -0
- package/dist/export-bundle.d.ts +10 -0
- package/dist/export-bundle.d.ts.map +1 -0
- package/dist/export-bundle.js +90 -0
- package/dist/failure-diagnostics.d.ts +63 -0
- package/dist/failure-diagnostics.d.ts.map +1 -0
- package/dist/failure-diagnostics.js +243 -0
- package/dist/feature-bundle.d.ts +111 -0
- package/dist/feature-bundle.d.ts.map +1 -0
- package/dist/feature-bundle.js +211 -0
- package/dist/feedback-actions-v2.d.ts +65 -0
- package/dist/feedback-actions-v2.d.ts.map +1 -0
- package/dist/feedback-actions-v2.js +183 -0
- package/dist/feedback-ingestion.d.ts +96 -0
- package/dist/feedback-ingestion.d.ts.map +1 -0
- package/dist/feedback-ingestion.js +400 -0
- package/dist/fix-preview.d.ts +82 -0
- package/dist/fix-preview.d.ts.map +1 -0
- package/dist/fix-preview.js +365 -0
- package/dist/fuzzy-impact.d.ts +50 -0
- package/dist/fuzzy-impact.d.ts.map +1 -0
- package/dist/fuzzy-impact.js +446 -0
- package/dist/generated-code.d.ts +97 -0
- package/dist/generated-code.d.ts.map +1 -0
- package/dist/generated-code.js +395 -0
- package/dist/git-helpers.d.ts +38 -0
- package/dist/git-helpers.d.ts.map +1 -0
- package/dist/git-helpers.js +173 -0
- package/dist/golden-output.d.ts +33 -0
- package/dist/golden-output.d.ts.map +1 -0
- package/dist/golden-output.js +92 -0
- package/dist/grounding/build-grounding.d.ts +53 -0
- package/dist/grounding/build-grounding.d.ts.map +1 -0
- package/dist/grounding/build-grounding.js +51 -0
- package/dist/grounding/nx-projects.d.ts +29 -0
- package/dist/grounding/nx-projects.d.ts.map +1 -0
- package/dist/grounding/nx-projects.js +109 -0
- package/dist/grounding/validate-extracted-plan.d.ts +20 -0
- package/dist/grounding/validate-extracted-plan.d.ts.map +1 -0
- package/dist/grounding/validate-extracted-plan.js +127 -0
- package/dist/healing-plan.d.ts +33 -0
- package/dist/healing-plan.d.ts.map +1 -0
- package/dist/healing-plan.js +346 -0
- package/dist/helper-registry.d.ts +90 -0
- package/dist/helper-registry.d.ts.map +1 -0
- package/dist/helper-registry.js +529 -0
- package/dist/impact-analysis.d.ts +150 -0
- package/dist/impact-analysis.d.ts.map +1 -0
- package/dist/impact-analysis.js +697 -0
- package/dist/impact-graph-render.d.ts +51 -0
- package/dist/impact-graph-render.d.ts.map +1 -0
- package/dist/impact-graph-render.js +139 -0
- package/dist/impact-graph.d.ts +17 -0
- package/dist/impact-graph.d.ts.map +1 -0
- package/dist/impact-graph.js +119 -0
- package/dist/impact-render.d.ts +22 -0
- package/dist/impact-render.d.ts.map +1 -0
- package/dist/impact-render.js +422 -0
- package/dist/import-graph-analysis.d.ts +28 -0
- package/dist/import-graph-analysis.d.ts.map +1 -0
- package/dist/import-graph-analysis.js +193 -0
- package/dist/import-hygiene.d.ts +93 -0
- package/dist/import-hygiene.d.ts.map +1 -0
- package/dist/import-hygiene.js +366 -0
- package/dist/index.d.ts +224 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +234 -0
- package/dist/ingest-adoption.d.ts +50 -0
- package/dist/ingest-adoption.d.ts.map +1 -0
- package/dist/ingest-adoption.js +183 -0
- package/dist/ingest-apply.d.ts +80 -0
- package/dist/ingest-apply.d.ts.map +1 -0
- package/dist/ingest-apply.js +227 -0
- package/dist/ingest-body-extractor.d.ts +28 -0
- package/dist/ingest-body-extractor.d.ts.map +1 -0
- package/dist/ingest-body-extractor.js +129 -0
- package/dist/ingest-drafts.d.ts +16 -0
- package/dist/ingest-drafts.d.ts.map +1 -0
- package/dist/ingest-drafts.js +482 -0
- package/dist/inspector-cache.d.ts +41 -0
- package/dist/inspector-cache.d.ts.map +1 -0
- package/dist/inspector-cache.js +104 -0
- package/dist/install-smoke.d.ts +44 -0
- package/dist/install-smoke.d.ts.map +1 -0
- package/dist/install-smoke.js +31 -0
- package/dist/knowledge-authoring.d.ts +151 -0
- package/dist/knowledge-authoring.d.ts.map +1 -0
- package/dist/knowledge-authoring.js +586 -0
- package/dist/knowledge-graph.d.ts +76 -0
- package/dist/knowledge-graph.d.ts.map +1 -0
- package/dist/knowledge-graph.js +336 -0
- package/dist/knowledge-lint.d.ts +97 -0
- package/dist/knowledge-lint.d.ts.map +1 -0
- package/dist/knowledge-lint.js +302 -0
- package/dist/knowledge-rename.d.ts +38 -0
- package/dist/knowledge-rename.d.ts.map +1 -0
- package/dist/knowledge-rename.js +88 -0
- package/dist/knowledge-stale.d.ts +124 -0
- package/dist/knowledge-stale.d.ts.map +1 -0
- package/dist/knowledge-stale.js +892 -0
- package/dist/languages/command-inference.d.ts +27 -0
- package/dist/languages/command-inference.d.ts.map +1 -0
- package/dist/languages/command-inference.js +214 -0
- package/dist/languages/dependency-scan.d.ts +33 -0
- package/dist/languages/dependency-scan.d.ts.map +1 -0
- package/dist/languages/dependency-scan.js +343 -0
- package/dist/languages/index.d.ts +14 -0
- package/dist/languages/index.d.ts.map +1 -0
- package/dist/languages/index.js +13 -0
- package/dist/languages/language-boundaries.d.ts +30 -0
- package/dist/languages/language-boundaries.d.ts.map +1 -0
- package/dist/languages/language-boundaries.js +176 -0
- package/dist/languages/language-cache.d.ts +54 -0
- package/dist/languages/language-cache.d.ts.map +1 -0
- package/dist/languages/language-cache.js +236 -0
- package/dist/languages/language-detection.d.ts +30 -0
- package/dist/languages/language-detection.d.ts.map +1 -0
- package/dist/languages/language-detection.js +584 -0
- package/dist/languages/language-id.d.ts +15 -0
- package/dist/languages/language-id.d.ts.map +1 -0
- package/dist/languages/language-id.js +15 -0
- package/dist/languages/language-runner.d.ts +90 -0
- package/dist/languages/language-runner.d.ts.map +1 -0
- package/dist/languages/language-runner.js +346 -0
- package/dist/languages/polyglot-boundary.d.ts +80 -0
- package/dist/languages/polyglot-boundary.d.ts.map +1 -0
- package/dist/languages/polyglot-boundary.js +373 -0
- package/dist/languages/polyglot-ci.d.ts +25 -0
- package/dist/languages/polyglot-ci.d.ts.map +1 -0
- package/dist/languages/polyglot-ci.js +278 -0
- package/dist/languages/test-impact.d.ts +19 -0
- package/dist/languages/test-impact.d.ts.map +1 -0
- package/dist/languages/test-impact.js +157 -0
- package/dist/loader-diagnostics.d.ts +40 -0
- package/dist/loader-diagnostics.d.ts.map +1 -0
- package/dist/loader-diagnostics.js +49 -0
- package/dist/memory-diff.d.ts +60 -0
- package/dist/memory-diff.d.ts.map +1 -0
- package/dist/memory-diff.js +302 -0
- package/dist/migration-profile-registry.d.ts +26 -0
- package/dist/migration-profile-registry.d.ts.map +1 -0
- package/dist/migration-profile-registry.js +135 -0
- package/dist/migration-readiness.d.ts +101 -0
- package/dist/migration-readiness.d.ts.map +1 -0
- package/dist/migration-readiness.js +253 -0
- package/dist/monorepo-onboarding.d.ts +51 -0
- package/dist/monorepo-onboarding.d.ts.map +1 -0
- package/dist/monorepo-onboarding.js +235 -0
- package/dist/onboarding-adoption-diff.d.ts +53 -0
- package/dist/onboarding-adoption-diff.d.ts.map +1 -0
- package/dist/onboarding-adoption-diff.js +285 -0
- package/dist/onboarding-adoption.d.ts +136 -0
- package/dist/onboarding-adoption.d.ts.map +1 -0
- package/dist/onboarding-adoption.js +702 -0
- package/dist/onboarding-agent-import.d.ts +40 -0
- package/dist/onboarding-agent-import.d.ts.map +1 -0
- package/dist/onboarding-agent-import.js +114 -0
- package/dist/onboarding-diff.d.ts +39 -0
- package/dist/onboarding-diff.d.ts.map +1 -0
- package/dist/onboarding-diff.js +240 -0
- package/dist/onboarding-drafts-merge.d.ts +71 -0
- package/dist/onboarding-drafts-merge.d.ts.map +1 -0
- package/dist/onboarding-drafts-merge.js +174 -0
- package/dist/onboarding-drafts.d.ts +42 -0
- package/dist/onboarding-drafts.d.ts.map +1 -0
- package/dist/onboarding-drafts.js +268 -0
- package/dist/onboarding-report.d.ts +8 -0
- package/dist/onboarding-report.d.ts.map +1 -0
- package/dist/onboarding-report.js +239 -0
- package/dist/onboarding.d.ts +134 -0
- package/dist/onboarding.d.ts.map +1 -0
- package/dist/onboarding.js +729 -0
- package/dist/ownership.d.ts +38 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/ownership.js +102 -0
- package/dist/pack-author-ux.d.ts +58 -0
- package/dist/pack-author-ux.d.ts.map +1 -0
- package/dist/pack-author-ux.js +219 -0
- package/dist/pack-author.d.ts +94 -0
- package/dist/pack-author.d.ts.map +1 -0
- package/dist/pack-author.js +208 -0
- package/dist/pack-compatibility.d.ts +21 -0
- package/dist/pack-compatibility.d.ts.map +1 -0
- package/dist/pack-compatibility.js +114 -0
- package/dist/pack-contributions-inventory.d.ts +121 -0
- package/dist/pack-contributions-inventory.d.ts.map +1 -0
- package/dist/pack-contributions-inventory.js +732 -0
- package/dist/pack-docs.d.ts +11 -0
- package/dist/pack-docs.d.ts.map +1 -0
- package/dist/pack-docs.js +101 -0
- package/dist/pack-doctor.d.ts +50 -0
- package/dist/pack-doctor.d.ts.map +1 -0
- package/dist/pack-doctor.js +302 -0
- package/dist/pack-helper-registry.d.ts +29 -0
- package/dist/pack-helper-registry.d.ts.map +1 -0
- package/dist/pack-helper-registry.js +144 -0
- package/dist/pack-pending.d.ts +68 -0
- package/dist/pack-pending.d.ts.map +1 -0
- package/dist/pack-pending.js +189 -0
- package/dist/pack-quality-score.d.ts +44 -0
- package/dist/pack-quality-score.d.ts.map +1 -0
- package/dist/pack-quality-score.js +155 -0
- package/dist/pack-release-check.d.ts +24 -0
- package/dist/pack-release-check.d.ts.map +1 -0
- package/dist/pack-release-check.js +258 -0
- package/dist/pack-signature-status.d.ts +72 -0
- package/dist/pack-signature-status.d.ts.map +1 -0
- package/dist/pack-signature-status.js +222 -0
- package/dist/pack-symbol-compat.d.ts +73 -0
- package/dist/pack-symbol-compat.d.ts.map +1 -0
- package/dist/pack-symbol-compat.js +519 -0
- package/dist/pack-test-runner.d.ts +59 -0
- package/dist/pack-test-runner.d.ts.map +1 -0
- package/dist/pack-test-runner.js +211 -0
- package/dist/pipeline-command-dictionary.d.ts +2 -0
- package/dist/pipeline-command-dictionary.d.ts.map +1 -0
- package/dist/pipeline-command-dictionary.js +20 -0
- package/dist/pipeline-lint.d.ts +30 -0
- package/dist/pipeline-lint.d.ts.map +1 -0
- package/dist/pipeline-lint.js +134 -0
- package/dist/plan-dependency-graph.d.ts +25 -0
- package/dist/plan-dependency-graph.d.ts.map +1 -0
- package/dist/plan-dependency-graph.js +195 -0
- package/dist/plan-review.d.ts +64 -0
- package/dist/plan-review.d.ts.map +1 -0
- package/dist/plan-review.js +242 -0
- package/dist/plan-simulation.d.ts +108 -0
- package/dist/plan-simulation.d.ts.map +1 -0
- package/dist/plan-simulation.js +767 -0
- package/dist/playbook-registry.d.ts +25 -0
- package/dist/playbook-registry.d.ts.map +1 -0
- package/dist/playbook-registry.js +148 -0
- package/dist/playbook-script.d.ts +60 -0
- package/dist/playbook-script.d.ts.map +1 -0
- package/dist/playbook-script.js +161 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts +52 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts.map +1 -0
- package/dist/plugin-lifecycle-profile-registry.js +202 -0
- package/dist/plugin-lifecycle.d.ts +132 -0
- package/dist/plugin-lifecycle.d.ts.map +1 -0
- package/dist/plugin-lifecycle.js +477 -0
- package/dist/policy-engine.d.ts +101 -0
- package/dist/policy-engine.d.ts.map +1 -0
- package/dist/policy-engine.js +321 -0
- package/dist/policy-override-audit.d.ts +18 -0
- package/dist/policy-override-audit.d.ts.map +1 -0
- package/dist/policy-override-audit.js +54 -0
- package/dist/policy-overrides.d.ts +35 -0
- package/dist/policy-overrides.d.ts.map +1 -0
- package/dist/policy-overrides.js +84 -0
- package/dist/policy-test.d.ts +83 -0
- package/dist/policy-test.d.ts.map +1 -0
- package/dist/policy-test.js +342 -0
- package/dist/pr-summary.d.ts +34 -0
- package/dist/pr-summary.d.ts.map +1 -0
- package/dist/pr-summary.js +220 -0
- package/dist/product-coherence.d.ts +21 -0
- package/dist/product-coherence.d.ts.map +1 -0
- package/dist/product-coherence.js +158 -0
- package/dist/profile-registry.d.ts +42 -0
- package/dist/profile-registry.d.ts.map +1 -0
- package/dist/profile-registry.js +104 -0
- package/dist/project-coupling-audit.d.ts +64 -0
- package/dist/project-coupling-audit.d.ts.map +1 -0
- package/dist/project-coupling-audit.js +282 -0
- package/dist/project-overview.d.ts +14 -0
- package/dist/project-overview.d.ts.map +1 -0
- package/dist/project-overview.js +27 -0
- package/dist/propose-knowledge.d.ts +64 -0
- package/dist/propose-knowledge.d.ts.map +1 -0
- package/dist/propose-knowledge.js +367 -0
- package/dist/quality-baseline.d.ts +123 -0
- package/dist/quality-baseline.d.ts.map +1 -0
- package/dist/quality-baseline.js +433 -0
- package/dist/quality-html.d.ts +7 -0
- package/dist/quality-html.d.ts.map +1 -0
- package/dist/quality-html.js +64 -0
- package/dist/quality-report.d.ts +49 -0
- package/dist/quality-report.d.ts.map +1 -0
- package/dist/quality-report.js +296 -0
- package/dist/query-resolver.d.ts +38 -0
- package/dist/query-resolver.d.ts.map +1 -0
- package/dist/query-resolver.js +163 -0
- package/dist/ranker-explainability.d.ts +91 -0
- package/dist/ranker-explainability.d.ts.map +1 -0
- package/dist/ranker-explainability.js +550 -0
- package/dist/reference-lookup.d.ts +8 -0
- package/dist/reference-lookup.d.ts.map +1 -0
- package/dist/reference-lookup.js +18 -0
- package/dist/registration-hint-registry.d.ts +55 -0
- package/dist/registration-hint-registry.d.ts.map +1 -0
- package/dist/registration-hint-registry.js +327 -0
- package/dist/registry-lifecycle.d.ts +47 -0
- package/dist/registry-lifecycle.d.ts.map +1 -0
- package/dist/registry-lifecycle.js +214 -0
- package/dist/release-readiness.d.ts +64 -0
- package/dist/release-readiness.d.ts.map +1 -0
- package/dist/release-readiness.js +456 -0
- package/dist/release-smoke.d.ts +138 -0
- package/dist/release-smoke.d.ts.map +1 -0
- package/dist/release-smoke.js +459 -0
- package/dist/release-train.d.ts +33 -0
- package/dist/release-train.d.ts.map +1 -0
- package/dist/release-train.js +104 -0
- package/dist/repo-memory.d.ts +95 -0
- package/dist/repo-memory.d.ts.map +1 -0
- package/dist/repo-memory.js +614 -0
- package/dist/report-site.d.ts +92 -0
- package/dist/report-site.d.ts.map +1 -0
- package/dist/report-site.js +658 -0
- package/dist/reposet.d.ts +56 -0
- package/dist/reposet.d.ts.map +1 -0
- package/dist/reposet.js +160 -0
- package/dist/repository-intelligence.d.ts +145 -0
- package/dist/repository-intelligence.d.ts.map +1 -0
- package/dist/repository-intelligence.js +729 -0
- package/dist/repository-knowledge-model.d.ts +218 -0
- package/dist/repository-knowledge-model.d.ts.map +1 -0
- package/dist/repository-knowledge-model.js +939 -0
- package/dist/repository-map.d.ts +72 -0
- package/dist/repository-map.d.ts.map +1 -0
- package/dist/repository-map.js +332 -0
- package/dist/repository-stats.d.ts +66 -0
- package/dist/repository-stats.d.ts.map +1 -0
- package/dist/repository-stats.js +329 -0
- package/dist/review-comment-renderer.d.ts +59 -0
- package/dist/review-comment-renderer.d.ts.map +1 -0
- package/dist/review-comment-renderer.js +181 -0
- package/dist/review-comment-v2.d.ts +9 -0
- package/dist/review-comment-v2.d.ts.map +1 -0
- package/dist/review-comment-v2.js +178 -0
- package/dist/review-html.d.ts +13 -0
- package/dist/review-html.d.ts.map +1 -0
- package/dist/review-html.js +79 -0
- package/dist/review-packet-v2.d.ts +29 -0
- package/dist/review-packet-v2.d.ts.map +1 -0
- package/dist/review-packet-v2.js +81 -0
- package/dist/review-packet-v3.d.ts +22 -0
- package/dist/review-packet-v3.d.ts.map +1 -0
- package/dist/review-packet-v3.js +181 -0
- package/dist/review-packet.d.ts +49 -0
- package/dist/review-packet.d.ts.map +1 -0
- package/dist/review-packet.js +129 -0
- package/dist/risk-signals.d.ts +28 -0
- package/dist/risk-signals.d.ts.map +1 -0
- package/dist/risk-signals.js +68 -0
- package/dist/role-views.d.ts +50 -0
- package/dist/role-views.d.ts.map +1 -0
- package/dist/role-views.js +334 -0
- package/dist/rounds.d.ts +52 -0
- package/dist/rounds.d.ts.map +1 -0
- package/dist/rounds.js +172 -0
- package/dist/rule-drift.d.ts +42 -0
- package/dist/rule-drift.d.ts.map +1 -0
- package/dist/rule-drift.js +148 -0
- package/dist/rule-quality.d.ts +73 -0
- package/dist/rule-quality.d.ts.map +1 -0
- package/dist/rule-quality.js +356 -0
- package/dist/rule-scaffold.d.ts +71 -0
- package/dist/rule-scaffold.d.ts.map +1 -0
- package/dist/rule-scaffold.js +258 -0
- package/dist/safety-audit-deep.d.ts +38 -0
- package/dist/safety-audit-deep.d.ts.map +1 -0
- package/dist/safety-audit-deep.js +162 -0
- package/dist/safety-audit.d.ts +91 -0
- package/dist/safety-audit.d.ts.map +1 -0
- package/dist/safety-audit.js +138 -0
- package/dist/safety-html.d.ts +7 -0
- package/dist/safety-html.d.ts.map +1 -0
- package/dist/safety-html.js +70 -0
- package/dist/scaffold-coverage.d.ts +46 -0
- package/dist/scaffold-coverage.d.ts.map +1 -0
- package/dist/scaffold-coverage.js +273 -0
- package/dist/scaffold-patterns.d.ts +38 -0
- package/dist/scaffold-patterns.d.ts.map +1 -0
- package/dist/scaffold-patterns.js +282 -0
- package/dist/schema-inventory.d.ts +55 -0
- package/dist/schema-inventory.d.ts.map +1 -0
- package/dist/schema-inventory.js +301 -0
- package/dist/search-index.d.ts +75 -0
- package/dist/search-index.d.ts.map +1 -0
- package/dist/search-index.js +531 -0
- package/dist/search-tuning-explain.d.ts +68 -0
- package/dist/search-tuning-explain.d.ts.map +1 -0
- package/dist/search-tuning-explain.js +207 -0
- package/dist/search-tuning-registry.d.ts +54 -0
- package/dist/search-tuning-registry.d.ts.map +1 -0
- package/dist/search-tuning-registry.js +303 -0
- package/dist/self-audit.d.ts +59 -0
- package/dist/self-audit.d.ts.map +1 -0
- package/dist/self-audit.js +192 -0
- package/dist/self-config-doctor-v2.d.ts +57 -0
- package/dist/self-config-doctor-v2.d.ts.map +1 -0
- package/dist/self-config-doctor-v2.js +653 -0
- package/dist/self-config-doctor.d.ts +47 -0
- package/dist/self-config-doctor.d.ts.map +1 -0
- package/dist/self-config-doctor.js +432 -0
- package/dist/sharkcraft-inspector.d.ts +73 -0
- package/dist/sharkcraft-inspector.d.ts.map +1 -0
- package/dist/sharkcraft-inspector.js +745 -0
- package/dist/spec/spec-cross-validate.d.ts +17 -0
- package/dist/spec/spec-cross-validate.d.ts.map +1 -0
- package/dist/spec/spec-cross-validate.js +53 -0
- package/dist/spec/spec-discovery.d.ts +27 -0
- package/dist/spec/spec-discovery.d.ts.map +1 -0
- package/dist/spec/spec-discovery.js +78 -0
- package/dist/spec/spec-review.d.ts +36 -0
- package/dist/spec/spec-review.d.ts.map +1 -0
- package/dist/spec/spec-review.js +37 -0
- package/dist/stability-map.d.ts +62 -0
- package/dist/stability-map.d.ts.map +1 -0
- package/dist/stability-map.js +404 -0
- package/dist/start-here.d.ts +49 -0
- package/dist/start-here.d.ts.map +1 -0
- package/dist/start-here.js +259 -0
- package/dist/surface-profile-detect.d.ts +42 -0
- package/dist/surface-profile-detect.d.ts.map +1 -0
- package/dist/surface-profile-detect.js +76 -0
- package/dist/symbol-index.d.ts +108 -0
- package/dist/symbol-index.d.ts.map +1 -0
- package/dist/symbol-index.js +483 -0
- package/dist/task-decompose.d.ts +38 -0
- package/dist/task-decompose.d.ts.map +1 -0
- package/dist/task-decompose.js +154 -0
- package/dist/task-packet.d.ts +104 -0
- package/dist/task-packet.d.ts.map +1 -0
- package/dist/task-packet.js +156 -0
- package/dist/task-ranker.d.ts +51 -0
- package/dist/task-ranker.d.ts.map +1 -0
- package/dist/task-ranker.js +410 -0
- package/dist/task-risk.d.ts +84 -0
- package/dist/task-risk.d.ts.map +1 -0
- package/dist/task-risk.js +731 -0
- package/dist/task-routing-hint-registry.d.ts +36 -0
- package/dist/task-routing-hint-registry.d.ts.map +1 -0
- package/dist/task-routing-hint-registry.js +186 -0
- package/dist/template-authoring.d.ts +113 -0
- package/dist/template-authoring.d.ts.map +1 -0
- package/dist/template-authoring.js +521 -0
- package/dist/template-body-inference-v2.d.ts +19 -0
- package/dist/template-body-inference-v2.d.ts.map +1 -0
- package/dist/template-body-inference-v2.js +468 -0
- package/dist/template-body-inference.d.ts +59 -0
- package/dist/template-body-inference.d.ts.map +1 -0
- package/dist/template-body-inference.js +277 -0
- package/dist/template-drift.d.ts +39 -0
- package/dist/template-drift.d.ts.map +1 -0
- package/dist/template-drift.js +353 -0
- package/dist/template-lint.d.ts +31 -0
- package/dist/template-lint.d.ts.map +1 -0
- package/dist/template-lint.js +113 -0
- package/dist/test-definitions.d.ts +41 -0
- package/dist/test-definitions.d.ts.map +1 -0
- package/dist/test-definitions.js +6 -0
- package/dist/test-impact.d.ts +30 -0
- package/dist/test-impact.d.ts.map +1 -0
- package/dist/test-impact.js +173 -0
- package/dist/test-runner.d.ts +87 -0
- package/dist/test-runner.d.ts.map +1 -0
- package/dist/test-runner.js +560 -0
- package/dist/uncertainty-report.d.ts +46 -0
- package/dist/uncertainty-report.d.ts.map +1 -0
- package/dist/uncertainty-report.js +108 -0
- package/dist/uncertainty.d.ts +38 -0
- package/dist/uncertainty.d.ts.map +1 -0
- package/dist/uncertainty.js +115 -0
- package/dist/universal-search.d.ts +64 -0
- package/dist/universal-search.d.ts.map +1 -0
- package/dist/universal-search.js +347 -0
- package/dist/upgrade-advisor.d.ts +22 -0
- package/dist/upgrade-advisor.d.ts.map +1 -0
- package/dist/upgrade-advisor.js +109 -0
- package/dist/why-file.d.ts +75 -0
- package/dist/why-file.d.ts.map +1 -0
- package/dist/why-file.js +202 -0
- package/dist/workflow-simulation.d.ts +46 -0
- package/dist/workflow-simulation.d.ts.map +1 -0
- package/dist/workflow-simulation.js +154 -0
- package/package.json +65 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
2
|
+
import * as nodePath from 'node:path';
|
|
3
|
+
import { WorkspaceProfile } from '@shrkcrft/workspace';
|
|
4
|
+
const PACKAGE_LIMIT = 30;
|
|
5
|
+
const GROUPS = [
|
|
6
|
+
{ key: 'apps', dir: 'apps' },
|
|
7
|
+
{ key: 'packages', dir: 'packages' },
|
|
8
|
+
{ key: 'libs', dir: 'libs' },
|
|
9
|
+
];
|
|
10
|
+
const TRACKED_SCRIPTS = new Set([
|
|
11
|
+
'test',
|
|
12
|
+
'test:unit',
|
|
13
|
+
'test:int',
|
|
14
|
+
'lint',
|
|
15
|
+
'build',
|
|
16
|
+
'typecheck',
|
|
17
|
+
]);
|
|
18
|
+
export function buildMonorepoSummary(ws, subDirs) {
|
|
19
|
+
const isMonorepo = ws.profiles.includes(WorkspaceProfile.IsMonorepo) ||
|
|
20
|
+
ws.profiles.includes(WorkspaceProfile.HasPackageWorkspaces) ||
|
|
21
|
+
ws.profiles.includes(WorkspaceProfile.HasNx);
|
|
22
|
+
if (!isMonorepo)
|
|
23
|
+
return null;
|
|
24
|
+
const workspaces = ws.raw.packageJson?.workspaces;
|
|
25
|
+
const workspacesArr = Array.isArray(workspaces)
|
|
26
|
+
? workspaces.filter((w) => typeof w === 'string')
|
|
27
|
+
: [];
|
|
28
|
+
const groups = {
|
|
29
|
+
apps: [],
|
|
30
|
+
packages: [],
|
|
31
|
+
libs: [],
|
|
32
|
+
};
|
|
33
|
+
let scanned = 0;
|
|
34
|
+
for (const g of GROUPS) {
|
|
35
|
+
const children = subDirs.get(g.dir) ?? [];
|
|
36
|
+
for (const child of children) {
|
|
37
|
+
if (scanned >= PACKAGE_LIMIT)
|
|
38
|
+
break;
|
|
39
|
+
const rel = nodePath.posix.join(g.dir, child);
|
|
40
|
+
const full = nodePath.join(ws.projectRoot, g.dir, child);
|
|
41
|
+
if (!statSafeIsDir(full))
|
|
42
|
+
continue;
|
|
43
|
+
groups[g.key].push(describePackage(full, rel, g.key));
|
|
44
|
+
scanned += 1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const rootVerificationCommands = buildRootVerificationCommands(ws);
|
|
48
|
+
const perPackageVerificationHints = [];
|
|
49
|
+
for (const list of Object.values(groups)) {
|
|
50
|
+
for (const p of list) {
|
|
51
|
+
for (const [name, value] of Object.entries(p.scripts)) {
|
|
52
|
+
if (!TRACKED_SCRIPTS.has(name))
|
|
53
|
+
continue;
|
|
54
|
+
if (typeof value !== 'string' || !value)
|
|
55
|
+
continue;
|
|
56
|
+
perPackageVerificationHints.push({
|
|
57
|
+
packagePath: p.path,
|
|
58
|
+
script: name,
|
|
59
|
+
command: buildPackageRunCommand(ws, p.path, name),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const boundaryCandidates = buildBoundaryCandidates(groups);
|
|
65
|
+
const presetRecommendations = buildPresetRecommendations(ws);
|
|
66
|
+
const notes = buildNotes(ws, groups);
|
|
67
|
+
return {
|
|
68
|
+
rootPath: ws.projectRoot,
|
|
69
|
+
workspaces: workspacesArr,
|
|
70
|
+
apps: groups.apps,
|
|
71
|
+
packages: groups.packages,
|
|
72
|
+
libs: groups.libs,
|
|
73
|
+
rootVerificationCommands,
|
|
74
|
+
perPackageVerificationHints,
|
|
75
|
+
boundaryCandidates,
|
|
76
|
+
presetRecommendations,
|
|
77
|
+
notes,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
// ── Helpers ──────────────────────────────────────────────────────────────
|
|
81
|
+
function statSafeIsDir(p) {
|
|
82
|
+
try {
|
|
83
|
+
return existsSync(p) && statSync(p).isDirectory();
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function describePackage(full, rel, group) {
|
|
90
|
+
const pkgJsonPath = nodePath.join(full, 'package.json');
|
|
91
|
+
let name;
|
|
92
|
+
const scripts = {};
|
|
93
|
+
let hasTsConfig = false;
|
|
94
|
+
if (existsSync(pkgJsonPath)) {
|
|
95
|
+
try {
|
|
96
|
+
const raw = readFileSync(pkgJsonPath, 'utf8');
|
|
97
|
+
const parsed = JSON.parse(raw);
|
|
98
|
+
if (typeof parsed.name === 'string')
|
|
99
|
+
name = parsed.name;
|
|
100
|
+
if (parsed.scripts) {
|
|
101
|
+
for (const [k, v] of Object.entries(parsed.scripts)) {
|
|
102
|
+
if (typeof v === 'string')
|
|
103
|
+
scripts[k] = v;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
// Ignore unreadable JSON — we still emit the package entry.
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
hasTsConfig = existsSync(nodePath.join(full, 'tsconfig.json'));
|
|
112
|
+
// Optional: probe for a src/ folder marker.
|
|
113
|
+
try {
|
|
114
|
+
readdirSync(full);
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
// ignore
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
path: rel,
|
|
121
|
+
group,
|
|
122
|
+
...(name ? { name } : {}),
|
|
123
|
+
scripts,
|
|
124
|
+
hasTsConfig,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function buildRootVerificationCommands(ws) {
|
|
128
|
+
const out = [];
|
|
129
|
+
const runner = pickRunner(ws);
|
|
130
|
+
for (const name of ['test', 'typecheck', 'lint', 'build']) {
|
|
131
|
+
const v = ws.scripts[name];
|
|
132
|
+
if (typeof v === 'string' && v.length > 0) {
|
|
133
|
+
out.push(`${runner} ${name}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (out.length === 0) {
|
|
137
|
+
// Even with no scripts, suggest the deterministic checks the engine knows
|
|
138
|
+
// about so the user has *something* to run.
|
|
139
|
+
out.push('bun x tsc -p tsconfig.base.json --noEmit');
|
|
140
|
+
out.push('shrk doctor');
|
|
141
|
+
out.push('shrk check boundaries');
|
|
142
|
+
}
|
|
143
|
+
return [...new Set(out)];
|
|
144
|
+
}
|
|
145
|
+
function buildPackageRunCommand(ws, pkgPath, script) {
|
|
146
|
+
// We do not assume a specific monorepo runner. Emit a `--cwd` invocation
|
|
147
|
+
// when the manager supports it; otherwise emit a doc-friendly fallback.
|
|
148
|
+
switch (ws.packageManager.manager) {
|
|
149
|
+
case 'bun':
|
|
150
|
+
return `bun --cwd ${pkgPath} run ${script}`;
|
|
151
|
+
case 'pnpm':
|
|
152
|
+
return `pnpm --filter ./${pkgPath} run ${script}`;
|
|
153
|
+
case 'yarn':
|
|
154
|
+
return `yarn workspace ${pkgPath} ${script}`;
|
|
155
|
+
case 'npm':
|
|
156
|
+
return `npm run ${script} --workspace ${pkgPath}`;
|
|
157
|
+
default:
|
|
158
|
+
return `(cd ${pkgPath} && npm run ${script})`;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function pickRunner(ws) {
|
|
162
|
+
switch (ws.packageManager.manager) {
|
|
163
|
+
case 'bun':
|
|
164
|
+
return 'bun run';
|
|
165
|
+
case 'pnpm':
|
|
166
|
+
return 'pnpm';
|
|
167
|
+
case 'yarn':
|
|
168
|
+
return 'yarn';
|
|
169
|
+
case 'npm':
|
|
170
|
+
return 'npm run';
|
|
171
|
+
default:
|
|
172
|
+
return 'npm run';
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function buildBoundaryCandidates(groups) {
|
|
176
|
+
const out = [];
|
|
177
|
+
// Standard rule: packages/* should not import from apps/*.
|
|
178
|
+
if (groups.packages.length > 0 && groups.apps.length > 0) {
|
|
179
|
+
out.push({
|
|
180
|
+
id: 'architecture.packages.no-imports-from-apps',
|
|
181
|
+
title: 'packages/* must not import from apps/*',
|
|
182
|
+
from: ['packages/**'],
|
|
183
|
+
forbiddenImports: ['apps/**'],
|
|
184
|
+
reason: 'packages/ + apps/ both present; packages depending on apps inverts the layer order',
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
// Standard rule: libs/* should not import from apps/*.
|
|
188
|
+
if (groups.libs.length > 0 && groups.apps.length > 0) {
|
|
189
|
+
out.push({
|
|
190
|
+
id: 'architecture.libs.no-imports-from-apps',
|
|
191
|
+
title: 'libs/* must not import from apps/*',
|
|
192
|
+
from: ['libs/**'],
|
|
193
|
+
forbiddenImports: ['apps/**'],
|
|
194
|
+
reason: 'libs/ + apps/ both present; libs depending on apps inverts the layer order',
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return out;
|
|
198
|
+
}
|
|
199
|
+
function buildPresetRecommendations(ws) {
|
|
200
|
+
const out = [];
|
|
201
|
+
// Nothing fancy: hint to use 'nx-style' / 'monorepo' presets when available.
|
|
202
|
+
// The actual preset picker still runs via `recommendPresets`; this is the
|
|
203
|
+
// monorepo-flavored recommendation list shown alongside it.
|
|
204
|
+
if (ws.profiles.includes(WorkspaceProfile.HasNx)) {
|
|
205
|
+
out.push('nx-monorepo');
|
|
206
|
+
}
|
|
207
|
+
else if (ws.profiles.includes(WorkspaceProfile.HasPackageWorkspaces)) {
|
|
208
|
+
out.push('package-workspaces');
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
out.push('generic-monorepo');
|
|
212
|
+
}
|
|
213
|
+
return out;
|
|
214
|
+
}
|
|
215
|
+
function buildNotes(ws, groups) {
|
|
216
|
+
const out = [];
|
|
217
|
+
const counts = [
|
|
218
|
+
groups.apps.length > 0 ? `${groups.apps.length} app(s)` : null,
|
|
219
|
+
groups.packages.length > 0 ? `${groups.packages.length} package(s)` : null,
|
|
220
|
+
groups.libs.length > 0 ? `${groups.libs.length} lib(s)` : null,
|
|
221
|
+
].filter((s) => s !== null);
|
|
222
|
+
if (counts.length > 0) {
|
|
223
|
+
out.push(`Detected monorepo layout: ${counts.join(', ')}.`);
|
|
224
|
+
}
|
|
225
|
+
if (ws.profiles.includes(WorkspaceProfile.HasNx)) {
|
|
226
|
+
out.push('Nx workspace detected — preset suggestions reflect Nx conventions.');
|
|
227
|
+
}
|
|
228
|
+
if (ws.profiles.includes(WorkspaceProfile.HasPackageWorkspaces)) {
|
|
229
|
+
out.push('package.json workspaces detected.');
|
|
230
|
+
}
|
|
231
|
+
if (groups.apps.length === 0 && groups.packages.length === 0 && groups.libs.length === 0) {
|
|
232
|
+
out.push('Monorepo signals detected but no apps/packages/libs directories — keep onboarding bounded.');
|
|
233
|
+
}
|
|
234
|
+
return out;
|
|
235
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { AdoptionKind } from './onboarding-adoption.js';
|
|
2
|
+
import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
|
|
3
|
+
export declare const ONBOARD_ADOPTION_DIFF_SCHEMA = "sharkcraft.onboard-adoption-diff/v1";
|
|
4
|
+
export type OnboardAdoptionDiffFormat = 'text' | 'markdown' | 'html' | 'json';
|
|
5
|
+
export declare enum OnboardDiffBlockKind {
|
|
6
|
+
NewBlock = "new-block",
|
|
7
|
+
AlreadyExists = "already-exists",
|
|
8
|
+
Conflict = "conflict",
|
|
9
|
+
ManualReview = "manual-review"
|
|
10
|
+
}
|
|
11
|
+
export interface IOnboardDiffLine {
|
|
12
|
+
marker: '+' | '-' | ' ' | '~';
|
|
13
|
+
text: string;
|
|
14
|
+
}
|
|
15
|
+
export interface IOnboardDiffBlock {
|
|
16
|
+
kind: OnboardDiffBlockKind;
|
|
17
|
+
/** Target file relative to the project root. */
|
|
18
|
+
targetFile: string;
|
|
19
|
+
/** Whether the target file exists on disk. */
|
|
20
|
+
targetExists: boolean;
|
|
21
|
+
/** Adoption kind (rule / path / template / boundary / verification / pipeline). */
|
|
22
|
+
adoptionKind: AdoptionKind;
|
|
23
|
+
title: string;
|
|
24
|
+
/** Short notes for the human reviewer. */
|
|
25
|
+
notes?: readonly string[];
|
|
26
|
+
/** Line-level preview lines. */
|
|
27
|
+
lines: readonly IOnboardDiffLine[];
|
|
28
|
+
}
|
|
29
|
+
export interface IOnboardAdoptionDiff {
|
|
30
|
+
schema: typeof ONBOARD_ADOPTION_DIFF_SCHEMA;
|
|
31
|
+
generatedAt: string;
|
|
32
|
+
projectRoot: string;
|
|
33
|
+
blocks: readonly IOnboardDiffBlock[];
|
|
34
|
+
summary: {
|
|
35
|
+
newBlocks: number;
|
|
36
|
+
alreadyExists: number;
|
|
37
|
+
conflicts: number;
|
|
38
|
+
manualReview: number;
|
|
39
|
+
};
|
|
40
|
+
warnings: readonly string[];
|
|
41
|
+
}
|
|
42
|
+
export interface IBuildOnboardAdoptionDiffOptions {
|
|
43
|
+
/** Confidence threshold mirrored from the underlying adoption build. */
|
|
44
|
+
confidence?: 'high' | 'medium' | 'low';
|
|
45
|
+
include?: readonly AdoptionKind[];
|
|
46
|
+
exclude?: readonly AdoptionKind[];
|
|
47
|
+
}
|
|
48
|
+
export declare function buildOnboardAdoptionDiff(inspection: ISharkcraftInspection, options?: IBuildOnboardAdoptionDiffOptions): IOnboardAdoptionDiff;
|
|
49
|
+
export declare function renderOnboardAdoptionDiffText(diff: IOnboardAdoptionDiff): string;
|
|
50
|
+
export declare function renderOnboardAdoptionDiffMarkdown(diff: IOnboardAdoptionDiff): string;
|
|
51
|
+
export declare function renderOnboardAdoptionDiffHtml(diff: IOnboardAdoptionDiff): string;
|
|
52
|
+
export declare function renderOnboardAdoptionDiff(diff: IOnboardAdoptionDiff, format: OnboardAdoptionDiffFormat): string;
|
|
53
|
+
//# sourceMappingURL=onboarding-adoption-diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding-adoption-diff.d.ts","sourceRoot":"","sources":["../src/onboarding-adoption-diff.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,YAAY,EAIb,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,4BAA4B,wCAAwC,CAAC;AAElF,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9E,oBAAY,oBAAoB;IAC9B,QAAQ,cAAc;IACtB,aAAa,mBAAmB;IAChC,QAAQ,aAAa;IACrB,YAAY,kBAAkB;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,YAAY,EAAE,OAAO,CAAC;IACtB,mFAAmF;IACnF,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,gCAAgC;IAChC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,4BAA4B,CAAC;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACrC,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B;AA4HD,MAAM,WAAW,gCAAgC;IAC/C,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvC,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAClC,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;CACnC;AAED,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,qBAAqB,EACjC,OAAO,GAAE,gCAAqC,GAC7C,oBAAoB,CAwCtB;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAkBhF;AAED,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAuCpF;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAyChF;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,oBAAoB,EAC1B,MAAM,EAAE,yBAAyB,GAChC,MAAM,CAKR"}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import * as nodePath from 'node:path';
|
|
3
|
+
import { AdoptionCategory, AdoptionKind, buildOnboardingAdoptionPlan, } from "./onboarding-adoption.js";
|
|
4
|
+
import { buildOnboardingPlan } from "./onboarding.js";
|
|
5
|
+
export const ONBOARD_ADOPTION_DIFF_SCHEMA = 'sharkcraft.onboard-adoption-diff/v1';
|
|
6
|
+
export var OnboardDiffBlockKind;
|
|
7
|
+
(function (OnboardDiffBlockKind) {
|
|
8
|
+
OnboardDiffBlockKind["NewBlock"] = "new-block";
|
|
9
|
+
OnboardDiffBlockKind["AlreadyExists"] = "already-exists";
|
|
10
|
+
OnboardDiffBlockKind["Conflict"] = "conflict";
|
|
11
|
+
OnboardDiffBlockKind["ManualReview"] = "manual-review";
|
|
12
|
+
})(OnboardDiffBlockKind || (OnboardDiffBlockKind = {}));
|
|
13
|
+
function esc(s) {
|
|
14
|
+
return s
|
|
15
|
+
.replace(/&/g, '&')
|
|
16
|
+
.replace(/</g, '<')
|
|
17
|
+
.replace(/>/g, '>')
|
|
18
|
+
.replace(/"/g, '"');
|
|
19
|
+
}
|
|
20
|
+
function targetFor(kind) {
|
|
21
|
+
switch (kind) {
|
|
22
|
+
case AdoptionKind.Rule:
|
|
23
|
+
return 'sharkcraft/rules.ts';
|
|
24
|
+
case AdoptionKind.Path:
|
|
25
|
+
return 'sharkcraft/paths.ts';
|
|
26
|
+
case AdoptionKind.Verification:
|
|
27
|
+
return 'sharkcraft/sharkcraft.config.ts';
|
|
28
|
+
case AdoptionKind.Template:
|
|
29
|
+
return 'sharkcraft/templates.ts';
|
|
30
|
+
case AdoptionKind.Boundary:
|
|
31
|
+
return 'sharkcraft/boundaries.ts';
|
|
32
|
+
case AdoptionKind.Pipeline:
|
|
33
|
+
return 'sharkcraft/pipelines.ts';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function renderItemPreview(item) {
|
|
37
|
+
switch (item.kind) {
|
|
38
|
+
case AdoptionKind.Rule:
|
|
39
|
+
return [`// rule ${item.id} — ${item.title}`];
|
|
40
|
+
case AdoptionKind.Path:
|
|
41
|
+
return [`// path ${item.id} — ${item.title}`];
|
|
42
|
+
case AdoptionKind.Verification:
|
|
43
|
+
return [`{ id: '${item.id}', label: '${item.title}', command: '<edit>', trusted: true },`];
|
|
44
|
+
case AdoptionKind.Template:
|
|
45
|
+
return [`// template ${item.id} — ${item.title}`];
|
|
46
|
+
case AdoptionKind.Boundary:
|
|
47
|
+
return [`// boundary ${item.id} — ${item.title}`];
|
|
48
|
+
case AdoptionKind.Pipeline:
|
|
49
|
+
return [`// pipeline ${item.id} — ${item.title}`];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function buildBlocks(inspection, plan) {
|
|
53
|
+
const blocks = [];
|
|
54
|
+
const cwd = inspection.projectRoot;
|
|
55
|
+
for (const cat of Object.values(AdoptionCategory)) {
|
|
56
|
+
const items = plan.byCategory[cat];
|
|
57
|
+
if (items.length === 0)
|
|
58
|
+
continue;
|
|
59
|
+
for (const item of items) {
|
|
60
|
+
const target = targetFor(item.kind);
|
|
61
|
+
const targetExists = existsSync(nodePath.resolve(cwd, target));
|
|
62
|
+
if (cat === AdoptionCategory.AlreadyCovered) {
|
|
63
|
+
blocks.push({
|
|
64
|
+
kind: OnboardDiffBlockKind.AlreadyExists,
|
|
65
|
+
targetFile: target,
|
|
66
|
+
targetExists,
|
|
67
|
+
adoptionKind: item.kind,
|
|
68
|
+
title: `${item.id} already covered in ${target}`,
|
|
69
|
+
notes: [item.reason],
|
|
70
|
+
lines: [],
|
|
71
|
+
});
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (cat === AdoptionCategory.Conflict) {
|
|
75
|
+
blocks.push({
|
|
76
|
+
kind: OnboardDiffBlockKind.Conflict,
|
|
77
|
+
targetFile: target,
|
|
78
|
+
targetExists,
|
|
79
|
+
adoptionKind: item.kind,
|
|
80
|
+
title: `${item.id} CONFLICT (${item.kind})`,
|
|
81
|
+
notes: [item.reason],
|
|
82
|
+
lines: [
|
|
83
|
+
{ marker: '~', text: 'manual review required — existing entry differs' },
|
|
84
|
+
],
|
|
85
|
+
});
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (cat === AdoptionCategory.ManualReview) {
|
|
89
|
+
blocks.push({
|
|
90
|
+
kind: OnboardDiffBlockKind.ManualReview,
|
|
91
|
+
targetFile: target,
|
|
92
|
+
targetExists,
|
|
93
|
+
adoptionKind: item.kind,
|
|
94
|
+
title: `${item.id} — manual review`,
|
|
95
|
+
notes: [item.reason],
|
|
96
|
+
lines: renderItemPreview(item).map((text) => ({ marker: '~', text })),
|
|
97
|
+
});
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (cat === AdoptionCategory.SafeToAdopt) {
|
|
101
|
+
blocks.push({
|
|
102
|
+
kind: OnboardDiffBlockKind.NewBlock,
|
|
103
|
+
targetFile: target,
|
|
104
|
+
targetExists,
|
|
105
|
+
adoptionKind: item.kind,
|
|
106
|
+
title: `Append to ${target}: ${item.id}`,
|
|
107
|
+
notes: [item.reason],
|
|
108
|
+
lines: renderItemPreview(item).map((text) => ({ marker: '+', text })),
|
|
109
|
+
});
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
// LowConfidence / Skipped → render with informational marker only.
|
|
113
|
+
if (cat === AdoptionCategory.LowConfidence || cat === AdoptionCategory.Skipped) {
|
|
114
|
+
blocks.push({
|
|
115
|
+
kind: OnboardDiffBlockKind.ManualReview,
|
|
116
|
+
targetFile: target,
|
|
117
|
+
targetExists,
|
|
118
|
+
adoptionKind: item.kind,
|
|
119
|
+
title: `${item.id} (${cat})`,
|
|
120
|
+
notes: [item.reason],
|
|
121
|
+
lines: [],
|
|
122
|
+
});
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return blocks;
|
|
128
|
+
}
|
|
129
|
+
export function buildOnboardAdoptionDiff(inspection, options = {}) {
|
|
130
|
+
const plan = buildOnboardingPlan(inspection, {});
|
|
131
|
+
const adoption = buildOnboardingAdoptionPlan({
|
|
132
|
+
inspection,
|
|
133
|
+
plan,
|
|
134
|
+
...(options.confidence ? { confidence: options.confidence } : {}),
|
|
135
|
+
...(options.include ? { include: options.include } : {}),
|
|
136
|
+
...(options.exclude ? { exclude: options.exclude } : {}),
|
|
137
|
+
});
|
|
138
|
+
const blocks = buildBlocks(inspection, adoption);
|
|
139
|
+
const summary = {
|
|
140
|
+
newBlocks: blocks.filter((b) => b.kind === OnboardDiffBlockKind.NewBlock).length,
|
|
141
|
+
alreadyExists: blocks.filter((b) => b.kind === OnboardDiffBlockKind.AlreadyExists).length,
|
|
142
|
+
conflicts: blocks.filter((b) => b.kind === OnboardDiffBlockKind.Conflict).length,
|
|
143
|
+
manualReview: blocks.filter((b) => b.kind === OnboardDiffBlockKind.ManualReview).length,
|
|
144
|
+
};
|
|
145
|
+
const warnings = [];
|
|
146
|
+
for (const k of Object.values(AdoptionKind)) {
|
|
147
|
+
const target = targetFor(k);
|
|
148
|
+
const full = nodePath.resolve(inspection.projectRoot, target);
|
|
149
|
+
if (!existsSync(full)) {
|
|
150
|
+
warnings.push(`Target file ${target} does not exist — patch would create it.`);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
// Quick sanity: load and confirm it's a TS file we recognize. Don't fail
|
|
154
|
+
// hard — onboarding has its own draft loader for the actual semantics.
|
|
155
|
+
try {
|
|
156
|
+
readFileSync(full, 'utf8');
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
warnings.push(`Cannot read ${target}.`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
schema: ONBOARD_ADOPTION_DIFF_SCHEMA,
|
|
165
|
+
generatedAt: new Date().toISOString(),
|
|
166
|
+
projectRoot: inspection.projectRoot,
|
|
167
|
+
blocks,
|
|
168
|
+
summary,
|
|
169
|
+
warnings: [...new Set(warnings)],
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
export function renderOnboardAdoptionDiffText(diff) {
|
|
173
|
+
const lines = [];
|
|
174
|
+
lines.push(`Onboard adoption diff — generated ${diff.generatedAt}`);
|
|
175
|
+
lines.push(`Summary: +blocks=${diff.summary.newBlocks} ~review=${diff.summary.manualReview} conflicts=${diff.summary.conflicts} covered=${diff.summary.alreadyExists}`);
|
|
176
|
+
for (const b of diff.blocks) {
|
|
177
|
+
lines.push('');
|
|
178
|
+
lines.push(`-- ${b.title} [${b.kind} → ${b.targetFile}${b.targetExists ? '' : ' (new)'}]`);
|
|
179
|
+
for (const n of b.notes ?? [])
|
|
180
|
+
lines.push(` note: ${n}`);
|
|
181
|
+
for (const ln of b.lines)
|
|
182
|
+
lines.push(`${ln.marker} ${ln.text}`);
|
|
183
|
+
}
|
|
184
|
+
if (diff.warnings.length > 0) {
|
|
185
|
+
lines.push('');
|
|
186
|
+
lines.push('Warnings:');
|
|
187
|
+
for (const w of diff.warnings)
|
|
188
|
+
lines.push(` ! ${w}`);
|
|
189
|
+
}
|
|
190
|
+
return lines.join('\n') + '\n';
|
|
191
|
+
}
|
|
192
|
+
export function renderOnboardAdoptionDiffMarkdown(diff) {
|
|
193
|
+
const lines = [];
|
|
194
|
+
lines.push('# Onboard adoption diff');
|
|
195
|
+
lines.push('');
|
|
196
|
+
lines.push(`Generated: ${diff.generatedAt}`);
|
|
197
|
+
lines.push('');
|
|
198
|
+
lines.push('## Summary');
|
|
199
|
+
lines.push('');
|
|
200
|
+
lines.push(`- Append blocks: ${diff.summary.newBlocks}`);
|
|
201
|
+
lines.push(`- Manual review: ${diff.summary.manualReview}`);
|
|
202
|
+
lines.push(`- Conflicts: ${diff.summary.conflicts}`);
|
|
203
|
+
lines.push(`- Already exists: ${diff.summary.alreadyExists}`);
|
|
204
|
+
lines.push('');
|
|
205
|
+
for (const b of diff.blocks) {
|
|
206
|
+
lines.push(`## ${b.title} _[${b.kind}]_`);
|
|
207
|
+
lines.push('');
|
|
208
|
+
lines.push(`Target: \`${b.targetFile}\`${b.targetExists ? '' : ' _(new file)_'}`);
|
|
209
|
+
if (b.notes && b.notes.length > 0) {
|
|
210
|
+
for (const n of b.notes)
|
|
211
|
+
lines.push(`- ${n}`);
|
|
212
|
+
lines.push('');
|
|
213
|
+
}
|
|
214
|
+
if (b.lines.length > 0) {
|
|
215
|
+
lines.push('```diff');
|
|
216
|
+
for (const ln of b.lines)
|
|
217
|
+
lines.push(`${ln.marker} ${ln.text}`);
|
|
218
|
+
lines.push('```');
|
|
219
|
+
lines.push('');
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (diff.warnings.length > 0) {
|
|
223
|
+
lines.push('## Warnings');
|
|
224
|
+
lines.push('');
|
|
225
|
+
for (const w of diff.warnings)
|
|
226
|
+
lines.push(`- ${w}`);
|
|
227
|
+
lines.push('');
|
|
228
|
+
}
|
|
229
|
+
lines.push('## Next steps');
|
|
230
|
+
lines.push('');
|
|
231
|
+
lines.push('SharkCraft never modifies your live `sharkcraft/*.ts` files automatically.');
|
|
232
|
+
lines.push('Run `shrk onboard adopt --write-patch` and review the patch before applying.');
|
|
233
|
+
return lines.join('\n') + '\n';
|
|
234
|
+
}
|
|
235
|
+
export function renderOnboardAdoptionDiffHtml(diff) {
|
|
236
|
+
const out = [];
|
|
237
|
+
out.push('<!doctype html><html><head><meta charset="utf-8"><title>Onboard adoption diff</title>');
|
|
238
|
+
out.push('<style>');
|
|
239
|
+
out.push('body{font:14px/1.5 -apple-system,system-ui,sans-serif;max-width:920px;margin:24px auto;padding:0 16px;color:#1a1a1a;background:#fff}');
|
|
240
|
+
out.push('h1{font-size:24px;margin-bottom:8px}h2{font-size:18px;margin-top:24px;border-bottom:1px solid #e1e4e8;padding-bottom:4px}');
|
|
241
|
+
out.push('.diff{background:#f7f7f9;border:1px solid #d0d0d6;border-radius:6px;padding:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;white-space:pre;overflow-x:auto}');
|
|
242
|
+
out.push('.add{color:#22863a;background:#eaffea;display:block}.del{color:#b31d28;background:#ffeef0;display:block}.ctx{color:#586069;display:block}.cnf{color:#b08800;background:#fff8d6;display:block}');
|
|
243
|
+
out.push('.muted{color:#586069}.tag{display:inline-block;padding:2px 6px;border-radius:4px;font-size:11px;background:#eef2f6}');
|
|
244
|
+
out.push('@media (prefers-color-scheme: dark){body{background:#0d1117;color:#c9d1d9}.diff{background:#161b22;border-color:#30363d}.add{background:#0c3a1c}.del{background:#3d1a1e}.cnf{background:#3a2f0c}.muted{color:#8b949e}.tag{background:#21262d}}');
|
|
245
|
+
out.push('</style></head><body>');
|
|
246
|
+
out.push('<h1>Onboard adoption diff</h1>');
|
|
247
|
+
out.push(`<p class="muted">Generated ${esc(diff.generatedAt)}</p>`);
|
|
248
|
+
out.push(`<p>Summary: +blocks=${diff.summary.newBlocks} · ~review=${diff.summary.manualReview} · conflicts=${diff.summary.conflicts} · covered=${diff.summary.alreadyExists}</p>`);
|
|
249
|
+
for (const b of diff.blocks) {
|
|
250
|
+
out.push(`<h2>${esc(b.title)} <span class="tag">${esc(b.kind)}</span></h2>`);
|
|
251
|
+
out.push(`<p class="muted">Target: <code>${esc(b.targetFile)}</code>${b.targetExists ? '' : ' <em>(new file)</em>'}</p>`);
|
|
252
|
+
if (b.notes && b.notes.length > 0) {
|
|
253
|
+
out.push('<ul>');
|
|
254
|
+
for (const n of b.notes)
|
|
255
|
+
out.push(`<li>${esc(n)}</li>`);
|
|
256
|
+
out.push('</ul>');
|
|
257
|
+
}
|
|
258
|
+
if (b.lines.length > 0) {
|
|
259
|
+
out.push('<div class="diff">');
|
|
260
|
+
for (const ln of b.lines) {
|
|
261
|
+
const cls = ln.marker === '+' ? 'add' : ln.marker === '-' ? 'del' : ln.marker === '~' ? 'cnf' : 'ctx';
|
|
262
|
+
out.push(`<span class="${cls}">${esc(ln.marker + ' ' + ln.text)}</span>`);
|
|
263
|
+
}
|
|
264
|
+
out.push('</div>');
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
if (diff.warnings.length > 0) {
|
|
268
|
+
out.push('<h2>Warnings</h2><ul>');
|
|
269
|
+
for (const w of diff.warnings)
|
|
270
|
+
out.push(`<li>${esc(w)}</li>`);
|
|
271
|
+
out.push('</ul>');
|
|
272
|
+
}
|
|
273
|
+
out.push('<p class="muted">SharkCraft never modifies your live <code>sharkcraft/*.ts</code> files. Run <code>shrk onboard adopt --write-patch</code> to render a patch under <code>sharkcraft/onboarding/adoption/</code>.</p>');
|
|
274
|
+
out.push('</body></html>');
|
|
275
|
+
return out.join('\n') + '\n';
|
|
276
|
+
}
|
|
277
|
+
export function renderOnboardAdoptionDiff(diff, format) {
|
|
278
|
+
if (format === 'markdown')
|
|
279
|
+
return renderOnboardAdoptionDiffMarkdown(diff);
|
|
280
|
+
if (format === 'html')
|
|
281
|
+
return renderOnboardAdoptionDiffHtml(diff);
|
|
282
|
+
if (format === 'json')
|
|
283
|
+
return JSON.stringify(diff, null, 2) + '\n';
|
|
284
|
+
return renderOnboardAdoptionDiffText(diff);
|
|
285
|
+
}
|