@shrkcrft/inspector 0.1.0-alpha.2
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 +43 -0
- package/dist/area-map.d.ts.map +1 -0
- package/dist/area-map.js +197 -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 +201 -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 +26 -0
- package/dist/git-helpers.d.ts.map +1 -0
- package/dist/git-helpers.js +110 -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 +413 -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 +223 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +233 -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.d.ts +28 -0
- package/dist/onboarding-drafts.d.ts.map +1 -0
- package/dist/onboarding-drafts.js +234 -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 +60 -0
- package/dist/pack-symbol-compat.d.ts.map +1 -0
- package/dist/pack-symbol-compat.js +371 -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 +71 -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 +66 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polyglot boundary enforcement.
|
|
3
|
+
*
|
|
4
|
+
* Evaluates built-in per-language boundary rules against the polyglot
|
|
5
|
+
* dependency scan and reports violations + suggested fixes. Pure
|
|
6
|
+
* file/regex-driven, no compiler integration.
|
|
7
|
+
*
|
|
8
|
+
* The existing TypeScript boundary engine is unchanged. This report is a
|
|
9
|
+
* cross-cutting view used by `shrk boundaries enforce --language ...`,
|
|
10
|
+
* `shrk check boundaries --polyglot`, and `get_polyglot_boundary_report`.
|
|
11
|
+
*/
|
|
12
|
+
import { LanguageId } from "./language-id.js";
|
|
13
|
+
import { detectLanguageProfiles } from "./language-detection.js";
|
|
14
|
+
import { scanPolyglotDependencies } from "./dependency-scan.js";
|
|
15
|
+
export const POLYGLOT_BOUNDARY_REPORT_SCHEMA = 'sharkcraft.polyglot-boundary-report/v1';
|
|
16
|
+
const JAVA_RULES = [
|
|
17
|
+
{
|
|
18
|
+
id: 'java.domain.no-spring-web',
|
|
19
|
+
title: 'Domain must not depend on Spring Web',
|
|
20
|
+
language: LanguageId.Java,
|
|
21
|
+
severity: 'error',
|
|
22
|
+
fromPattern: /(^|\/)domain\//i,
|
|
23
|
+
forbiddenTargetPattern: /^org\.springframework\.web\./,
|
|
24
|
+
reason: 'Domain stays framework-agnostic; routing concerns belong in the web/controller layer.',
|
|
25
|
+
suggestedFix: 'Move web-binding to a controller and expose a service interface in domain.',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'java.controller.no-repository-direct',
|
|
29
|
+
title: 'Controllers should not import repositories directly',
|
|
30
|
+
language: LanguageId.Java,
|
|
31
|
+
severity: 'warning',
|
|
32
|
+
fromPattern: /(^|\/)controller\//i,
|
|
33
|
+
forbiddenTargetPattern: /\.(repository|dao)\./i,
|
|
34
|
+
reason: 'Controllers should call services; persistence is an internal concern.',
|
|
35
|
+
suggestedFix: 'Inject a service that wraps the repository instead.',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'java.main.no-test-import',
|
|
39
|
+
title: 'Production code must not import the test tree',
|
|
40
|
+
language: LanguageId.Java,
|
|
41
|
+
severity: 'error',
|
|
42
|
+
fromPattern: /(^|\/)src\/main\/java\//,
|
|
43
|
+
forbiddenTargetPattern: /(^|\.)(?:test|tests|junit|testng)\./,
|
|
44
|
+
reason: 'src/main code may not depend on src/test code.',
|
|
45
|
+
suggestedFix: 'Extract shared fixture into src/main or a dedicated test-fixtures module.',
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
const CSHARP_RULES = [
|
|
49
|
+
{
|
|
50
|
+
id: 'csharp.domain.no-aspnet',
|
|
51
|
+
title: 'Domain must not depend on ASP.NET',
|
|
52
|
+
language: LanguageId.CSharp,
|
|
53
|
+
severity: 'error',
|
|
54
|
+
fromPattern: /(^|\/)Domain\//,
|
|
55
|
+
forbiddenTargetPattern: /^Microsoft\.AspNetCore\./,
|
|
56
|
+
reason: 'Clean architecture: outer layers depend inward; Domain stays framework-agnostic.',
|
|
57
|
+
suggestedFix: 'Keep ASP.NET types in Web/Application; expose interfaces in Domain.',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'csharp.web.no-infrastructure-direct',
|
|
61
|
+
title: 'Web project depends on Application, not Infrastructure',
|
|
62
|
+
language: LanguageId.CSharp,
|
|
63
|
+
severity: 'warning',
|
|
64
|
+
fromPattern: /(^|\/)Web\//,
|
|
65
|
+
forbiddenTargetPattern: /^.*\.Infrastructure\./,
|
|
66
|
+
reason: 'Application orchestrates Infrastructure; Web should not bind to it directly.',
|
|
67
|
+
suggestedFix: 'Call an Application service; inject Infrastructure via DI.',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'csharp.main.no-test-import',
|
|
71
|
+
title: 'Production code must not import test projects',
|
|
72
|
+
language: LanguageId.CSharp,
|
|
73
|
+
severity: 'error',
|
|
74
|
+
fromPattern: /\.cs$/,
|
|
75
|
+
toPattern: /\.Tests\.csproj$/,
|
|
76
|
+
forbiddenTargetPattern: /\.Tests(\.|$)/,
|
|
77
|
+
reason: 'Production projects must not depend on test projects.',
|
|
78
|
+
suggestedFix: 'Move shared helpers into a non-test project.',
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
const PYTHON_RULES = [
|
|
82
|
+
{
|
|
83
|
+
id: 'python.domain.no-web-framework',
|
|
84
|
+
title: 'Domain must not import web frameworks',
|
|
85
|
+
language: LanguageId.Python,
|
|
86
|
+
severity: 'error',
|
|
87
|
+
fromPattern: /(^|\/)domain(\/|\.)/i,
|
|
88
|
+
forbiddenTargetPattern: /^(fastapi|django|flask|starlette)\b/,
|
|
89
|
+
reason: 'Domain stays framework-agnostic.',
|
|
90
|
+
suggestedFix: 'Wire web framework usage in the api/app layer; keep domain pure.',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'python.app.no-tests-import',
|
|
94
|
+
title: 'Application code must not import the tests tree',
|
|
95
|
+
language: LanguageId.Python,
|
|
96
|
+
severity: 'error',
|
|
97
|
+
fromPattern: /^(?:src|app)\//,
|
|
98
|
+
forbiddenTargetPattern: /^(tests?|test_[a-z0-9_]+)(\.|$)/,
|
|
99
|
+
reason: 'Production code must not depend on tests.',
|
|
100
|
+
suggestedFix: 'Move shared fixtures to src/<package>/_fixtures.py or conftest.py.',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: 'python.no-cross-layer-parent-relative',
|
|
104
|
+
title: 'Avoid relative imports across layers',
|
|
105
|
+
language: LanguageId.Python,
|
|
106
|
+
severity: 'warning',
|
|
107
|
+
fromPattern: /\.py$/,
|
|
108
|
+
forbiddenTargetPattern: /^\.\.\.+\w+/,
|
|
109
|
+
reason: 'Deep parent-relative imports (`from ...x`) cross too many layers.',
|
|
110
|
+
suggestedFix: 'Use an absolute import via the package root.',
|
|
111
|
+
},
|
|
112
|
+
];
|
|
113
|
+
const GO_RULES = [
|
|
114
|
+
{
|
|
115
|
+
id: 'go.pkg.no-cmd-import',
|
|
116
|
+
title: 'pkg/ must not import cmd/',
|
|
117
|
+
language: LanguageId.Go,
|
|
118
|
+
severity: 'error',
|
|
119
|
+
fromPattern: /^pkg\//,
|
|
120
|
+
forbiddenTargetPattern: /\/cmd\//,
|
|
121
|
+
reason: 'cmd/ is the entry point; library code must not depend on it.',
|
|
122
|
+
suggestedFix: 'Move shared helpers out of cmd/ into pkg/ or internal/.',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 'go.internal.visibility',
|
|
126
|
+
title: 'internal/ must not be imported from outside its parent',
|
|
127
|
+
language: LanguageId.Go,
|
|
128
|
+
severity: 'error',
|
|
129
|
+
fromPattern: /\.go$/,
|
|
130
|
+
forbiddenTargetPattern: /\/internal\//,
|
|
131
|
+
reason: 'Go enforces internal at compile time; surface it earlier in review.',
|
|
132
|
+
suggestedFix: 'Promote the type to a non-internal package or duplicate the small helper.',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: 'go.no-import-cycle-hint',
|
|
136
|
+
title: 'Watch for cyclic imports between sibling packages',
|
|
137
|
+
language: LanguageId.Go,
|
|
138
|
+
severity: 'warning',
|
|
139
|
+
fromPattern: /\.go$/,
|
|
140
|
+
forbiddenTargetPattern: /^cycle:.*$/,
|
|
141
|
+
reason: 'Cyclic imports break compilation; surfaced from the dep-graph cycle list.',
|
|
142
|
+
suggestedFix: 'Extract the cyclic surface into a third package both sides depend on.',
|
|
143
|
+
},
|
|
144
|
+
];
|
|
145
|
+
const RUST_RULES = [
|
|
146
|
+
{
|
|
147
|
+
id: 'rust.lib.no-tests-import',
|
|
148
|
+
title: 'Library crate must not depend on tests/',
|
|
149
|
+
language: LanguageId.Rust,
|
|
150
|
+
severity: 'error',
|
|
151
|
+
fromPattern: /^src\//,
|
|
152
|
+
forbiddenTargetPattern: /^tests::/,
|
|
153
|
+
reason: 'Production crate code must not depend on the tests/ tree.',
|
|
154
|
+
suggestedFix: 'Move shared fixtures into src/test_helpers (gated by #[cfg(test)]).',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: 'rust.no-test-only-module-import',
|
|
158
|
+
title: 'Do not import `#[cfg(test)]`-gated modules from non-test code',
|
|
159
|
+
language: LanguageId.Rust,
|
|
160
|
+
severity: 'warning',
|
|
161
|
+
fromPattern: /\.rs$/,
|
|
162
|
+
forbiddenTargetPattern: /^crate::test(_| ::)/,
|
|
163
|
+
reason: 'cfg(test) modules disappear in release builds; relying on them breaks the build.',
|
|
164
|
+
suggestedFix: 'Promote the symbol or wrap with #[cfg(test)] guard at the import site.',
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: 'rust.no-super-cross-crate-hint',
|
|
168
|
+
title: 'Avoid `super::super::super::` chains',
|
|
169
|
+
language: LanguageId.Rust,
|
|
170
|
+
severity: 'warning',
|
|
171
|
+
fromPattern: /\.rs$/,
|
|
172
|
+
forbiddenTargetPattern: /^(?:super::){3,}/,
|
|
173
|
+
reason: 'Deep super chains indicate accidental crate boundary crossing.',
|
|
174
|
+
suggestedFix: 'Reorganise the module tree or use `crate::` absolute paths.',
|
|
175
|
+
},
|
|
176
|
+
];
|
|
177
|
+
const TYPESCRIPT_RULES = [
|
|
178
|
+
// TS rules deliberately live in the existing TS engine — kept empty
|
|
179
|
+
// here so `--language all` doesn't return surprising TS results.
|
|
180
|
+
];
|
|
181
|
+
const ALL_RULES_BY_LANG = {
|
|
182
|
+
[LanguageId.TypeScript]: TYPESCRIPT_RULES,
|
|
183
|
+
[LanguageId.JavaScript]: TYPESCRIPT_RULES,
|
|
184
|
+
[LanguageId.Java]: JAVA_RULES,
|
|
185
|
+
[LanguageId.CSharp]: CSHARP_RULES,
|
|
186
|
+
[LanguageId.Python]: PYTHON_RULES,
|
|
187
|
+
[LanguageId.Go]: GO_RULES,
|
|
188
|
+
[LanguageId.Rust]: RUST_RULES,
|
|
189
|
+
[LanguageId.Mixed]: [],
|
|
190
|
+
[LanguageId.Unknown]: [],
|
|
191
|
+
};
|
|
192
|
+
export function listPolyglotBoundaryRules(language) {
|
|
193
|
+
if (language)
|
|
194
|
+
return ALL_RULES_BY_LANG[language] ?? [];
|
|
195
|
+
return [
|
|
196
|
+
...JAVA_RULES,
|
|
197
|
+
...CSHARP_RULES,
|
|
198
|
+
...PYTHON_RULES,
|
|
199
|
+
...GO_RULES,
|
|
200
|
+
...RUST_RULES,
|
|
201
|
+
];
|
|
202
|
+
}
|
|
203
|
+
function applyRule(rule, edge) {
|
|
204
|
+
if (edge.language !== rule.language)
|
|
205
|
+
return null;
|
|
206
|
+
if (!rule.fromPattern.test(edge.from))
|
|
207
|
+
return null;
|
|
208
|
+
if (rule.toPattern && edge.to && !rule.toPattern.test(edge.to))
|
|
209
|
+
return null;
|
|
210
|
+
if (!rule.forbiddenTargetPattern.test(edge.to))
|
|
211
|
+
return null;
|
|
212
|
+
let confidence = 'medium';
|
|
213
|
+
if (rule.severity === 'error')
|
|
214
|
+
confidence = 'high';
|
|
215
|
+
return {
|
|
216
|
+
ruleId: rule.id,
|
|
217
|
+
language: rule.language,
|
|
218
|
+
severity: rule.severity,
|
|
219
|
+
fromFile: edge.from,
|
|
220
|
+
importSpecifier: edge.to,
|
|
221
|
+
reason: rule.reason,
|
|
222
|
+
suggestedFix: rule.suggestedFix,
|
|
223
|
+
confidence,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
export function buildPolyglotBoundaryReport(options) {
|
|
227
|
+
const limit = options.limit ?? 200;
|
|
228
|
+
const profile = options.cached ?? detectLanguageProfiles(options.projectRoot);
|
|
229
|
+
const detected = new Set(profile.profiles.map((p) => p.language));
|
|
230
|
+
const wantedLanguages = options.languages && options.languages.length > 0
|
|
231
|
+
? options.languages
|
|
232
|
+
: [LanguageId.Java, LanguageId.CSharp, LanguageId.Python, LanguageId.Go, LanguageId.Rust];
|
|
233
|
+
const evaluatedLanguages = wantedLanguages.filter((l) => detected.has(l));
|
|
234
|
+
const rules = [];
|
|
235
|
+
for (const lang of evaluatedLanguages)
|
|
236
|
+
rules.push(...(ALL_RULES_BY_LANG[lang] ?? []));
|
|
237
|
+
// Reuse caller's dep graph or compute one. When evaluatedLanguages is empty
|
|
238
|
+
// we still produce an empty report rather than failing.
|
|
239
|
+
let graph;
|
|
240
|
+
if (options.graph) {
|
|
241
|
+
graph = options.graph;
|
|
242
|
+
}
|
|
243
|
+
else if (evaluatedLanguages.length === 0) {
|
|
244
|
+
graph = {
|
|
245
|
+
schema: 'sharkcraft.polyglot-dependency-graph/v1',
|
|
246
|
+
generatedAt: new Date().toISOString(),
|
|
247
|
+
projectRoot: options.projectRoot,
|
|
248
|
+
perLanguage: [],
|
|
249
|
+
notes: ['No applicable polyglot languages detected.'],
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
graph = scanPolyglotDependencies(options.projectRoot, { languages: evaluatedLanguages });
|
|
254
|
+
}
|
|
255
|
+
const edges = [];
|
|
256
|
+
for (const langDeps of graph.perLanguage) {
|
|
257
|
+
if (!evaluatedLanguages.includes(langDeps.language))
|
|
258
|
+
continue;
|
|
259
|
+
edges.push(...langDeps.imports);
|
|
260
|
+
}
|
|
261
|
+
const violations = [];
|
|
262
|
+
for (const edge of edges) {
|
|
263
|
+
for (const rule of rules) {
|
|
264
|
+
const v = applyRule(rule, edge);
|
|
265
|
+
if (v) {
|
|
266
|
+
violations.push(v);
|
|
267
|
+
if (violations.length >= limit)
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
if (violations.length >= limit)
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
const errors = violations.filter((v) => v.severity === 'error').length;
|
|
275
|
+
const warnings = violations.filter((v) => v.severity === 'warning').length;
|
|
276
|
+
const limitations = [
|
|
277
|
+
'Polyglot dep scan is regex-based — false positives/negatives are possible.',
|
|
278
|
+
'Rules are conservative built-ins; tune via project-local boundary rules when needed.',
|
|
279
|
+
];
|
|
280
|
+
if (violations.length >= limit) {
|
|
281
|
+
limitations.push(`Result capped at ${limit} violations; rerun with --limit to widen.`);
|
|
282
|
+
}
|
|
283
|
+
if (evaluatedLanguages.length === 0) {
|
|
284
|
+
limitations.push('No applicable polyglot languages detected in the workspace.');
|
|
285
|
+
}
|
|
286
|
+
const suggestedFixes = Array.from(new Set(violations.map((v) => v.suggestedFix))).slice(0, 10);
|
|
287
|
+
return {
|
|
288
|
+
schema: POLYGLOT_BOUNDARY_REPORT_SCHEMA,
|
|
289
|
+
generatedAt: new Date().toISOString(),
|
|
290
|
+
projectRoot: options.projectRoot,
|
|
291
|
+
languages: evaluatedLanguages,
|
|
292
|
+
rules,
|
|
293
|
+
edges,
|
|
294
|
+
violations,
|
|
295
|
+
counts: { rules: rules.length, edges: edges.length, violations: violations.length, errors, warnings },
|
|
296
|
+
limitations,
|
|
297
|
+
suggestedFixes,
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
export function renderPolyglotBoundaryReportText(r) {
|
|
301
|
+
let out = `=== Polyglot boundary report ===\n`;
|
|
302
|
+
out += ` project root ${r.projectRoot}\n`;
|
|
303
|
+
out += ` languages ${r.languages.join(', ') || '(none)'}\n`;
|
|
304
|
+
out += ` rules ${r.counts.rules}\n`;
|
|
305
|
+
out += ` edges ${r.counts.edges}\n`;
|
|
306
|
+
out += ` violations ${r.counts.violations} (errors=${r.counts.errors} warnings=${r.counts.warnings})\n`;
|
|
307
|
+
if (r.violations.length > 0) {
|
|
308
|
+
out += `\nViolations:\n`;
|
|
309
|
+
for (const v of r.violations.slice(0, 60)) {
|
|
310
|
+
out += ` [${v.severity}] ${v.ruleId}\n`;
|
|
311
|
+
out += ` from ${v.fromFile}\n`;
|
|
312
|
+
out += ` import ${v.importSpecifier}\n`;
|
|
313
|
+
out += ` fix ${v.suggestedFix}\n`;
|
|
314
|
+
}
|
|
315
|
+
if (r.violations.length > 60)
|
|
316
|
+
out += ` ... ${r.violations.length - 60} more\n`;
|
|
317
|
+
}
|
|
318
|
+
if (r.limitations.length > 0) {
|
|
319
|
+
out += `\nLimitations:\n`;
|
|
320
|
+
for (const l of r.limitations)
|
|
321
|
+
out += ` - ${l}\n`;
|
|
322
|
+
}
|
|
323
|
+
return out;
|
|
324
|
+
}
|
|
325
|
+
export function renderPolyglotBoundaryReportMarkdown(r) {
|
|
326
|
+
const lines = [];
|
|
327
|
+
lines.push('# Polyglot boundary report');
|
|
328
|
+
lines.push('');
|
|
329
|
+
lines.push(`- Languages: ${r.languages.map((l) => '`' + l + '`').join(', ') || '_(none)_'}`);
|
|
330
|
+
lines.push(`- Rules: **${r.counts.rules}**`);
|
|
331
|
+
lines.push(`- Edges: **${r.counts.edges}**`);
|
|
332
|
+
lines.push(`- Violations: **${r.counts.violations}** (errors=${r.counts.errors}, warnings=${r.counts.warnings})`);
|
|
333
|
+
lines.push('');
|
|
334
|
+
if (r.violations.length > 0) {
|
|
335
|
+
lines.push('## Violations');
|
|
336
|
+
lines.push('');
|
|
337
|
+
lines.push('| Severity | Rule | From | Import | Fix |');
|
|
338
|
+
lines.push('|---|---|---|---|---|');
|
|
339
|
+
for (const v of r.violations) {
|
|
340
|
+
lines.push(`| ${v.severity} | \`${v.ruleId}\` | \`${v.fromFile}\` | \`${v.importSpecifier}\` | ${v.suggestedFix} |`);
|
|
341
|
+
}
|
|
342
|
+
lines.push('');
|
|
343
|
+
}
|
|
344
|
+
if (r.suggestedFixes.length > 0) {
|
|
345
|
+
lines.push('## Suggested fixes');
|
|
346
|
+
lines.push('');
|
|
347
|
+
for (const f of r.suggestedFixes)
|
|
348
|
+
lines.push(`- ${f}`);
|
|
349
|
+
lines.push('');
|
|
350
|
+
}
|
|
351
|
+
if (r.limitations.length > 0) {
|
|
352
|
+
lines.push('## Limitations');
|
|
353
|
+
lines.push('');
|
|
354
|
+
for (const l of r.limitations)
|
|
355
|
+
lines.push(`- ${l}`);
|
|
356
|
+
}
|
|
357
|
+
return lines.join('\n');
|
|
358
|
+
}
|
|
359
|
+
export function renderPolyglotBoundaryReportJson(r) {
|
|
360
|
+
// Strip RegExp objects from rules for safe JSON serialisation.
|
|
361
|
+
const safe = {
|
|
362
|
+
...r,
|
|
363
|
+
rules: r.rules.map((rule) => ({
|
|
364
|
+
id: rule.id,
|
|
365
|
+
title: rule.title,
|
|
366
|
+
language: rule.language,
|
|
367
|
+
severity: rule.severity,
|
|
368
|
+
reason: rule.reason,
|
|
369
|
+
suggestedFix: rule.suggestedFix,
|
|
370
|
+
})),
|
|
371
|
+
};
|
|
372
|
+
return JSON.stringify(safe, null, 2);
|
|
373
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polyglot CI scaffold.
|
|
3
|
+
*
|
|
4
|
+
* Emits GitHub Actions job snippets for detected language profiles. Each job
|
|
5
|
+
* runs install / build / test (and optional lint/format when detected). No
|
|
6
|
+
* publish/deploy steps. Output is concatenated to the existing CI YAML.
|
|
7
|
+
*/
|
|
8
|
+
import { LanguageId } from './language-id.js';
|
|
9
|
+
import { type ILanguageProfileReport } from './language-detection.js';
|
|
10
|
+
export interface IPolyglotCiOptions {
|
|
11
|
+
cached?: ILanguageProfileReport;
|
|
12
|
+
}
|
|
13
|
+
export declare function renderPolyglotGitHubActionsJobs(projectRoot: string, options?: IPolyglotCiOptions): string;
|
|
14
|
+
export declare function listPolyglotCiLanguages(projectRoot: string): readonly LanguageId[];
|
|
15
|
+
interface IRenderPolyglotOptions {
|
|
16
|
+
cached?: ILanguageProfileReport;
|
|
17
|
+
/** When provided, restricts the emitted languages. */
|
|
18
|
+
languages?: readonly LanguageId[];
|
|
19
|
+
}
|
|
20
|
+
export declare function renderPolyglotGitlabJobs(projectRoot: string, options?: IRenderPolyglotOptions): string;
|
|
21
|
+
export declare function renderPolyglotBitbucketSteps(projectRoot: string, options?: IRenderPolyglotOptions): string;
|
|
22
|
+
export declare function renderPolyglotAzureStages(projectRoot: string, options?: IRenderPolyglotOptions): string;
|
|
23
|
+
export declare function renderPolyglotJenkinsStages(projectRoot: string, options?: IRenderPolyglotOptions): string;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=polyglot-ci.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polyglot-ci.d.ts","sourceRoot":"","sources":["../../src/languages/polyglot-ci.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAA0B,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAuF9F,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,sBAAsB,CAAC;CACjC;AAED,wBAAgB,+BAA+B,CAC7C,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAgCR;AAED,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,UAAU,EAAE,CAKlF;AASD,UAAU,sBAAsB;IAC9B,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,sDAAsD;IACtD,SAAS,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;CACnC;AAoBD,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,sBAA2B,GACnC,MAAM,CA4BR;AAED,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,sBAA2B,GACnC,MAAM,CAsBR;AAED,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,sBAA2B,GACnC,MAAM,CAsBR;AAED,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,sBAA2B,GACnC,MAAM,CAuBR"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polyglot CI scaffold.
|
|
3
|
+
*
|
|
4
|
+
* Emits GitHub Actions job snippets for detected language profiles. Each job
|
|
5
|
+
* runs install / build / test (and optional lint/format when detected). No
|
|
6
|
+
* publish/deploy steps. Output is concatenated to the existing CI YAML.
|
|
7
|
+
*/
|
|
8
|
+
import { LanguageId } from "./language-id.js";
|
|
9
|
+
import { detectLanguageProfiles } from "./language-detection.js";
|
|
10
|
+
import { buildLanguageCommandReport } from "./command-inference.js";
|
|
11
|
+
function jobIdFor(lang) {
|
|
12
|
+
return `polyglot-${lang}`;
|
|
13
|
+
}
|
|
14
|
+
function githubJobForJava(c) {
|
|
15
|
+
const isMaven = c.install?.startsWith('mvn') ?? false;
|
|
16
|
+
const javaVersion = '21';
|
|
17
|
+
let yaml = ` ${jobIdFor(c.language)}:\n`;
|
|
18
|
+
yaml += ` runs-on: ubuntu-latest\n`;
|
|
19
|
+
yaml += ` timeout-minutes: 25\n`;
|
|
20
|
+
yaml += ` steps:\n`;
|
|
21
|
+
yaml += ` - uses: actions/checkout@v4\n`;
|
|
22
|
+
yaml += ` - uses: actions/setup-java@v4\n`;
|
|
23
|
+
yaml += ` with:\n`;
|
|
24
|
+
yaml += ` distribution: temurin\n`;
|
|
25
|
+
yaml += ` java-version: '${javaVersion}'\n`;
|
|
26
|
+
if (isMaven) {
|
|
27
|
+
yaml += ` cache: maven\n`;
|
|
28
|
+
yaml += ` - run: mvn -B verify\n`;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
yaml += ` cache: gradle\n`;
|
|
32
|
+
yaml += ` - run: ./gradlew test\n`;
|
|
33
|
+
}
|
|
34
|
+
return yaml;
|
|
35
|
+
}
|
|
36
|
+
function githubJobForCSharp(_c) {
|
|
37
|
+
let yaml = ` polyglot-csharp:\n`;
|
|
38
|
+
yaml += ` runs-on: ubuntu-latest\n`;
|
|
39
|
+
yaml += ` timeout-minutes: 25\n`;
|
|
40
|
+
yaml += ` steps:\n`;
|
|
41
|
+
yaml += ` - uses: actions/checkout@v4\n`;
|
|
42
|
+
yaml += ` - uses: actions/setup-dotnet@v4\n`;
|
|
43
|
+
yaml += ` with:\n`;
|
|
44
|
+
yaml += ` dotnet-version: '8.x'\n`;
|
|
45
|
+
yaml += ` - run: dotnet restore\n`;
|
|
46
|
+
yaml += ` - run: dotnet build --no-restore\n`;
|
|
47
|
+
yaml += ` - run: dotnet test --no-build\n`;
|
|
48
|
+
return yaml;
|
|
49
|
+
}
|
|
50
|
+
function githubJobForPython(c) {
|
|
51
|
+
let yaml = ` polyglot-python:\n`;
|
|
52
|
+
yaml += ` runs-on: ubuntu-latest\n`;
|
|
53
|
+
yaml += ` timeout-minutes: 20\n`;
|
|
54
|
+
yaml += ` steps:\n`;
|
|
55
|
+
yaml += ` - uses: actions/checkout@v4\n`;
|
|
56
|
+
yaml += ` - uses: actions/setup-python@v5\n`;
|
|
57
|
+
yaml += ` with:\n`;
|
|
58
|
+
yaml += ` python-version: '3.12'\n`;
|
|
59
|
+
if (c.install)
|
|
60
|
+
yaml += ` - run: ${c.install}\n`;
|
|
61
|
+
if (c.lint)
|
|
62
|
+
yaml += ` - run: ${c.lint}\n`;
|
|
63
|
+
if (c.typecheck)
|
|
64
|
+
yaml += ` - run: ${c.typecheck}\n`;
|
|
65
|
+
if (c.test)
|
|
66
|
+
yaml += ` - run: ${c.test}\n`;
|
|
67
|
+
return yaml;
|
|
68
|
+
}
|
|
69
|
+
function githubJobForGo(_c) {
|
|
70
|
+
let yaml = ` polyglot-go:\n`;
|
|
71
|
+
yaml += ` runs-on: ubuntu-latest\n`;
|
|
72
|
+
yaml += ` timeout-minutes: 20\n`;
|
|
73
|
+
yaml += ` steps:\n`;
|
|
74
|
+
yaml += ` - uses: actions/checkout@v4\n`;
|
|
75
|
+
yaml += ` - uses: actions/setup-go@v5\n`;
|
|
76
|
+
yaml += ` with:\n`;
|
|
77
|
+
yaml += ` go-version: '1.22'\n`;
|
|
78
|
+
yaml += ` - run: go vet ./...\n`;
|
|
79
|
+
yaml += ` - run: go test ./...\n`;
|
|
80
|
+
return yaml;
|
|
81
|
+
}
|
|
82
|
+
function githubJobForRust(_c) {
|
|
83
|
+
let yaml = ` polyglot-rust:\n`;
|
|
84
|
+
yaml += ` runs-on: ubuntu-latest\n`;
|
|
85
|
+
yaml += ` timeout-minutes: 25\n`;
|
|
86
|
+
yaml += ` steps:\n`;
|
|
87
|
+
yaml += ` - uses: actions/checkout@v4\n`;
|
|
88
|
+
yaml += ` - uses: dtolnay/rust-toolchain@stable\n`;
|
|
89
|
+
yaml += ` - run: cargo fmt --check\n`;
|
|
90
|
+
yaml += ` - run: cargo clippy -- -D warnings\n`;
|
|
91
|
+
yaml += ` - run: cargo test\n`;
|
|
92
|
+
return yaml;
|
|
93
|
+
}
|
|
94
|
+
export function renderPolyglotGitHubActionsJobs(projectRoot, options = {}) {
|
|
95
|
+
const cmds = buildLanguageCommandReport(projectRoot, options.cached);
|
|
96
|
+
let yaml = `\n # Polyglot jobs\n`;
|
|
97
|
+
let any = false;
|
|
98
|
+
for (const c of cmds.profiles) {
|
|
99
|
+
switch (c.language) {
|
|
100
|
+
case LanguageId.Java:
|
|
101
|
+
yaml += githubJobForJava(c);
|
|
102
|
+
any = true;
|
|
103
|
+
break;
|
|
104
|
+
case LanguageId.CSharp:
|
|
105
|
+
yaml += githubJobForCSharp(c);
|
|
106
|
+
any = true;
|
|
107
|
+
break;
|
|
108
|
+
case LanguageId.Python:
|
|
109
|
+
yaml += githubJobForPython(c);
|
|
110
|
+
any = true;
|
|
111
|
+
break;
|
|
112
|
+
case LanguageId.Go:
|
|
113
|
+
yaml += githubJobForGo(c);
|
|
114
|
+
any = true;
|
|
115
|
+
break;
|
|
116
|
+
case LanguageId.Rust:
|
|
117
|
+
yaml += githubJobForRust(c);
|
|
118
|
+
any = true;
|
|
119
|
+
break;
|
|
120
|
+
default:
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (!any)
|
|
125
|
+
yaml += ` # (no non-JS/TS languages detected — nothing to add)\n`;
|
|
126
|
+
return yaml;
|
|
127
|
+
}
|
|
128
|
+
export function listPolyglotCiLanguages(projectRoot) {
|
|
129
|
+
const r = detectLanguageProfiles(projectRoot);
|
|
130
|
+
return r.profiles
|
|
131
|
+
.map((p) => p.language)
|
|
132
|
+
.filter((l) => l === LanguageId.Java || l === LanguageId.CSharp || l === LanguageId.Python || l === LanguageId.Go || l === LanguageId.Rust);
|
|
133
|
+
}
|
|
134
|
+
function selectCommands(projectRoot, options) {
|
|
135
|
+
const cmds = buildLanguageCommandReport(projectRoot, options.cached);
|
|
136
|
+
if (!options.languages || options.languages.length === 0) {
|
|
137
|
+
return cmds.profiles.filter((c) => c.language === LanguageId.Java
|
|
138
|
+
|| c.language === LanguageId.CSharp
|
|
139
|
+
|| c.language === LanguageId.Python
|
|
140
|
+
|| c.language === LanguageId.Go
|
|
141
|
+
|| c.language === LanguageId.Rust);
|
|
142
|
+
}
|
|
143
|
+
const wanted = new Set(options.languages);
|
|
144
|
+
return cmds.profiles.filter((c) => wanted.has(c.language));
|
|
145
|
+
}
|
|
146
|
+
export function renderPolyglotGitlabJobs(projectRoot, options = {}) {
|
|
147
|
+
const cmds = selectCommands(projectRoot, options);
|
|
148
|
+
if (cmds.length === 0)
|
|
149
|
+
return '# (no non-JS/TS languages detected — no polyglot stages added)\n';
|
|
150
|
+
let yaml = '\n# Polyglot stages\n';
|
|
151
|
+
for (const c of cmds) {
|
|
152
|
+
if (c.language === LanguageId.Java) {
|
|
153
|
+
const isMaven = (c.install ?? '').startsWith('mvn');
|
|
154
|
+
yaml += `polyglot:java:\n stage: sharkcraft_quality\n image: ${isMaven ? 'maven:3-eclipse-temurin-21' : 'gradle:8-jdk21'}\n script:\n`;
|
|
155
|
+
if (isMaven) {
|
|
156
|
+
yaml += ` - mvn -B verify\n`;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
yaml += ` - ./gradlew test\n`;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
else if (c.language === LanguageId.CSharp) {
|
|
163
|
+
yaml += `polyglot:csharp:\n stage: sharkcraft_quality\n image: mcr.microsoft.com/dotnet/sdk:8.0\n script:\n - dotnet restore\n - dotnet build --no-restore\n - dotnet test --no-build\n`;
|
|
164
|
+
}
|
|
165
|
+
else if (c.language === LanguageId.Python) {
|
|
166
|
+
yaml += `polyglot:python:\n stage: sharkcraft_quality\n image: python:3.12\n script:\n`;
|
|
167
|
+
if (c.install)
|
|
168
|
+
yaml += ` - ${c.install}\n`;
|
|
169
|
+
if (c.lint)
|
|
170
|
+
yaml += ` - ${c.lint}\n`;
|
|
171
|
+
if (c.typecheck)
|
|
172
|
+
yaml += ` - ${c.typecheck}\n`;
|
|
173
|
+
if (c.test)
|
|
174
|
+
yaml += ` - ${c.test}\n`;
|
|
175
|
+
}
|
|
176
|
+
else if (c.language === LanguageId.Go) {
|
|
177
|
+
yaml += `polyglot:go:\n stage: sharkcraft_quality\n image: golang:1.22\n script:\n - go vet ./...\n - go test ./...\n`;
|
|
178
|
+
}
|
|
179
|
+
else if (c.language === LanguageId.Rust) {
|
|
180
|
+
yaml += `polyglot:rust:\n stage: sharkcraft_quality\n image: rust:1\n script:\n - cargo fmt --check\n - cargo clippy -- -D warnings\n - cargo test\n`;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return yaml;
|
|
184
|
+
}
|
|
185
|
+
export function renderPolyglotBitbucketSteps(projectRoot, options = {}) {
|
|
186
|
+
const cmds = selectCommands(projectRoot, options);
|
|
187
|
+
if (cmds.length === 0)
|
|
188
|
+
return '# (no non-JS/TS languages detected — no polyglot steps added)\n';
|
|
189
|
+
let yaml = '\n# Polyglot steps\n';
|
|
190
|
+
for (const c of cmds) {
|
|
191
|
+
if (c.language === LanguageId.Java) {
|
|
192
|
+
const isMaven = (c.install ?? '').startsWith('mvn');
|
|
193
|
+
yaml += ` - step: &polyglot-java\n name: Polyglot Java\n image: ${isMaven ? 'maven:3-eclipse-temurin-21' : 'gradle:8-jdk21'}\n script:\n - ${isMaven ? 'mvn -B verify' : './gradlew test'}\n`;
|
|
194
|
+
}
|
|
195
|
+
else if (c.language === LanguageId.CSharp) {
|
|
196
|
+
yaml += ` - step: &polyglot-csharp\n name: Polyglot .NET\n image: mcr.microsoft.com/dotnet/sdk:8.0\n script:\n - dotnet restore\n - dotnet build --no-restore\n - dotnet test --no-build\n`;
|
|
197
|
+
}
|
|
198
|
+
else if (c.language === LanguageId.Python) {
|
|
199
|
+
yaml += ` - step: &polyglot-python\n name: Polyglot Python\n image: python:3.12\n script:\n`;
|
|
200
|
+
if (c.install)
|
|
201
|
+
yaml += ` - ${c.install}\n`;
|
|
202
|
+
if (c.lint)
|
|
203
|
+
yaml += ` - ${c.lint}\n`;
|
|
204
|
+
if (c.test)
|
|
205
|
+
yaml += ` - ${c.test}\n`;
|
|
206
|
+
}
|
|
207
|
+
else if (c.language === LanguageId.Go) {
|
|
208
|
+
yaml += ` - step: &polyglot-go\n name: Polyglot Go\n image: golang:1.22\n script:\n - go vet ./...\n - go test ./...\n`;
|
|
209
|
+
}
|
|
210
|
+
else if (c.language === LanguageId.Rust) {
|
|
211
|
+
yaml += ` - step: &polyglot-rust\n name: Polyglot Rust\n image: rust:1\n script:\n - cargo fmt --check\n - cargo clippy -- -D warnings\n - cargo test\n`;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return yaml;
|
|
215
|
+
}
|
|
216
|
+
export function renderPolyglotAzureStages(projectRoot, options = {}) {
|
|
217
|
+
const cmds = selectCommands(projectRoot, options);
|
|
218
|
+
if (cmds.length === 0)
|
|
219
|
+
return '# (no non-JS/TS languages detected — no polyglot stages added)\n';
|
|
220
|
+
let yaml = '\n# Polyglot stages\n';
|
|
221
|
+
for (const c of cmds) {
|
|
222
|
+
if (c.language === LanguageId.Java) {
|
|
223
|
+
const isMaven = (c.install ?? '').startsWith('mvn');
|
|
224
|
+
yaml += ` - stage: Polyglot_Java\n dependsOn: SharkCraft_Install\n jobs:\n - job: Java\n steps:\n - task: ${isMaven ? 'Maven@4' : 'Gradle@2'}\n displayName: ${isMaven ? 'mvn verify' : 'gradle test'}\n`;
|
|
225
|
+
}
|
|
226
|
+
else if (c.language === LanguageId.CSharp) {
|
|
227
|
+
yaml += ` - stage: Polyglot_DotNet\n dependsOn: SharkCraft_Install\n jobs:\n - job: DotNet\n steps:\n - task: UseDotNet@2\n inputs:\n version: '8.x'\n - script: dotnet restore && dotnet build --no-restore && dotnet test --no-build\n displayName: 'dotnet test'\n`;
|
|
228
|
+
}
|
|
229
|
+
else if (c.language === LanguageId.Python) {
|
|
230
|
+
yaml += ` - stage: Polyglot_Python\n dependsOn: SharkCraft_Install\n jobs:\n - job: Python\n steps:\n - task: UsePythonVersion@0\n inputs:\n versionSpec: '3.12'\n`;
|
|
231
|
+
if (c.install)
|
|
232
|
+
yaml += ` - script: ${c.install}\n displayName: install\n`;
|
|
233
|
+
if (c.lint)
|
|
234
|
+
yaml += ` - script: ${c.lint}\n displayName: lint\n`;
|
|
235
|
+
if (c.test)
|
|
236
|
+
yaml += ` - script: ${c.test}\n displayName: test\n`;
|
|
237
|
+
}
|
|
238
|
+
else if (c.language === LanguageId.Go) {
|
|
239
|
+
yaml += ` - stage: Polyglot_Go\n dependsOn: SharkCraft_Install\n jobs:\n - job: Go\n steps:\n - task: GoTool@0\n inputs:\n version: '1.22'\n - script: go vet ./... && go test ./...\n displayName: 'go test'\n`;
|
|
240
|
+
}
|
|
241
|
+
else if (c.language === LanguageId.Rust) {
|
|
242
|
+
yaml += ` - stage: Polyglot_Rust\n dependsOn: SharkCraft_Install\n jobs:\n - job: Rust\n steps:\n - script: curl -sSf https://sh.rustup.rs | sh -s -- -y && source $HOME/.cargo/env && cargo fmt --check && cargo clippy -- -D warnings && cargo test\n displayName: 'cargo test'\n`;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return yaml;
|
|
246
|
+
}
|
|
247
|
+
export function renderPolyglotJenkinsStages(projectRoot, options = {}) {
|
|
248
|
+
const cmds = selectCommands(projectRoot, options);
|
|
249
|
+
if (cmds.length === 0)
|
|
250
|
+
return '// (no non-JS/TS languages detected — no polyglot stages added)\n';
|
|
251
|
+
let groovy = '\n// Polyglot stages\n';
|
|
252
|
+
for (const c of cmds) {
|
|
253
|
+
if (c.language === LanguageId.Java) {
|
|
254
|
+
const isMaven = (c.install ?? '').startsWith('mvn');
|
|
255
|
+
groovy += ` stage('Polyglot Java') {\n steps {\n sh '${isMaven ? 'mvn -B verify' : './gradlew test'}'\n }\n }\n`;
|
|
256
|
+
}
|
|
257
|
+
else if (c.language === LanguageId.CSharp) {
|
|
258
|
+
groovy += ` stage('Polyglot .NET') {\n steps {\n sh 'dotnet restore && dotnet build --no-restore && dotnet test --no-build'\n }\n }\n`;
|
|
259
|
+
}
|
|
260
|
+
else if (c.language === LanguageId.Python) {
|
|
261
|
+
groovy += ` stage('Polyglot Python') {\n steps {\n`;
|
|
262
|
+
if (c.install)
|
|
263
|
+
groovy += ` sh '${c.install}'\n`;
|
|
264
|
+
if (c.lint)
|
|
265
|
+
groovy += ` sh '${c.lint}'\n`;
|
|
266
|
+
if (c.test)
|
|
267
|
+
groovy += ` sh '${c.test}'\n`;
|
|
268
|
+
groovy += ` }\n }\n`;
|
|
269
|
+
}
|
|
270
|
+
else if (c.language === LanguageId.Go) {
|
|
271
|
+
groovy += ` stage('Polyglot Go') {\n steps {\n sh 'go vet ./...'\n sh 'go test ./...'\n }\n }\n`;
|
|
272
|
+
}
|
|
273
|
+
else if (c.language === LanguageId.Rust) {
|
|
274
|
+
groovy += ` stage('Polyglot Rust') {\n steps {\n sh 'cargo fmt --check'\n sh 'cargo clippy -- -D warnings'\n sh 'cargo test'\n }\n }\n`;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return groovy;
|
|
278
|
+
}
|