pr-checkmate 3.0.3 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cli.js → cjs/cli.js} +30 -30
- package/dist/{config → cjs/config}/index.d.ts +2 -2
- package/dist/{config → cjs/config}/index.js +8 -7
- package/dist/{config → cjs/config}/loader.d.ts +1 -1
- package/dist/{config → cjs/config}/loader.js +8 -8
- package/dist/{core → cjs/core}/checks/dependencies/banned-imports.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/banned-imports.js +10 -10
- package/dist/{core → cjs/core}/checks/dependencies/circular-deps.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/circular-deps.js +27 -27
- package/dist/{core → cjs/core}/checks/dependencies/dependency-check.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/dependency-check.js +17 -17
- package/dist/{core → cjs/core}/checks/dependencies/grype-scan.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/grype-scan.js +18 -18
- package/dist/{core → cjs/core}/checks/dependencies/license-check.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/license-check.js +12 -12
- package/dist/{core → cjs/core}/checks/dependencies/npm-audit.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/npm-audit.js +14 -14
- package/dist/{core → cjs/core}/checks/dependencies/outdated-deps.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/outdated-deps.js +14 -14
- package/dist/{core → cjs/core}/checks/dependencies/vuln-scan.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/dependencies/vuln-scan.js +14 -14
- package/dist/{core → cjs/core}/checks/findings.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/findings.js +16 -16
- package/dist/{core → cjs/core}/checks/git/custom-rules.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/git/custom-rules.js +19 -19
- package/dist/{core → cjs/core}/checks/git/diff-smell.d.ts +2 -2
- package/dist/{core → cjs/core}/checks/git/diff-smell.js +13 -13
- package/dist/{core → cjs/core}/checks/git/large-files.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/git/large-files.js +15 -15
- package/dist/{core → cjs/core}/checks/git/leftover-debug.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/git/leftover-debug.js +13 -13
- package/dist/{core → cjs/core}/checks/git/lockfile-drift.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/git/lockfile-drift.js +12 -12
- package/dist/{core → cjs/core}/checks/git/merge-conflict.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/git/merge-conflict.js +15 -15
- package/dist/{core → cjs/core}/checks/git/missing-tests.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/git/missing-tests.js +15 -15
- package/dist/{core → cjs/core}/checks/git/todo-fixme.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/git/todo-fixme.js +11 -11
- package/dist/{core → cjs/core}/checks/languages/cpp-format.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/languages/cpp-format.js +18 -18
- package/dist/{core → cjs/core}/checks/languages/external-checks.d.ts +9 -9
- package/dist/{core → cjs/core}/checks/languages/external-checks.js +10 -10
- package/dist/{core → cjs/core}/checks/languages/external-runner.d.ts +2 -2
- package/dist/{core → cjs/core}/checks/languages/external-runner.js +21 -21
- package/dist/{core → cjs/core}/checks/languages/go-format.d.ts +1 -1
- package/dist/cjs/core/checks/languages/go-format.js +202 -0
- package/dist/cjs/core/checks/languages/lint.d.ts +2 -0
- package/dist/{core → cjs/core}/checks/languages/lint.js +21 -21
- package/dist/{core → cjs/core}/checks/languages/prettier.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/languages/prettier.js +18 -18
- package/dist/{core → cjs/core}/checks/languages/python-format.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/languages/python-format.js +14 -14
- package/dist/{core → cjs/core}/checks/languages/python-lint.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/languages/python-lint.js +13 -13
- package/dist/{core → cjs/core}/checks/languages/python-typecheck.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/languages/python-typecheck.js +29 -29
- package/dist/{core → cjs/core}/checks/languages/typecheck.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/languages/typecheck.js +13 -13
- package/dist/{core → cjs/core}/checks/pr/commitlint.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/pr/commitlint.js +12 -12
- package/dist/{core → cjs/core}/checks/pr/pr-body.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/pr/pr-body.js +8 -8
- package/dist/{core → cjs/core}/checks/pr/pr-size-check.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/pr/pr-size-check.js +10 -10
- package/dist/{core → cjs/core}/checks/pr/pr-title-lint.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/pr/pr-title-lint.js +8 -8
- package/dist/{core → cjs/core}/checks/quality/case-collision.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/case-collision.js +7 -7
- package/dist/{core → cjs/core}/checks/quality/config-validation.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/config-validation.js +9 -9
- package/dist/{core → cjs/core}/checks/quality/coverage.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/coverage.js +4 -4
- package/dist/{core → cjs/core}/checks/quality/dead-code.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/dead-code.js +23 -23
- package/dist/{core → cjs/core}/checks/quality/duplicate-check.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/duplicate-check.js +22 -22
- package/dist/{core → cjs/core}/checks/quality/license-header.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/license-header.js +16 -16
- package/dist/{core → cjs/core}/checks/quality/markdown-lint.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/markdown-lint.js +17 -17
- package/dist/{core → cjs/core}/checks/quality/package-size.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/package-size.js +12 -12
- package/dist/{core → cjs/core}/checks/quality/spellcheck.d.ts +2 -2
- package/dist/{core → cjs/core}/checks/quality/spellcheck.js +18 -18
- package/dist/{core → cjs/core}/checks/quality/symlinks.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/symlinks.js +8 -8
- package/dist/{core → cjs/core}/checks/quality/yaml-lint.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/quality/yaml-lint.js +12 -12
- package/dist/{core → cjs/core}/checks/security/diff-security.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/security/diff-security.js +15 -15
- package/dist/{core → cjs/core}/checks/security/dockerfile-security.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/security/dockerfile-security.js +16 -16
- package/dist/{core → cjs/core}/checks/security/migration-safety.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/security/migration-safety.js +17 -17
- package/dist/{core → cjs/core}/checks/security/security.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/security/security.js +21 -21
- package/dist/{core → cjs/core}/checks/security/sensitive-file-guard.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/security/sensitive-file-guard.js +14 -14
- package/dist/{core → cjs/core}/checks/security/workflow-security.d.ts +2 -2
- package/dist/{core → cjs/core}/checks/security/workflow-security.js +14 -14
- package/dist/{core → cjs/core}/checks/tool-install.d.ts +1 -1
- package/dist/{core → cjs/core}/checks/tool-install.js +2 -2
- package/dist/{core → cjs/core}/context.d.ts +1 -1
- package/dist/{core → cjs/core}/context.js +16 -16
- package/dist/cjs/core/index.d.ts +4 -0
- package/dist/{core → cjs/core}/index.js +7 -7
- package/dist/{core → cjs/core}/install/cache.js +2 -2
- package/dist/{core → cjs/core}/install/doctor.d.ts +4 -4
- package/dist/{core → cjs/core}/install/doctor.js +34 -34
- package/dist/{core → cjs/core}/install/ensure.d.ts +2 -2
- package/dist/{core → cjs/core}/install/ensure.js +15 -14
- package/dist/{core → cjs/core}/install/lock.js +4 -4
- package/dist/{core → cjs/core}/install/prepare.d.ts +4 -4
- package/dist/{core → cjs/core}/install/prepare.js +13 -13
- package/dist/{core → cjs/core}/install/profiles.d.ts +2 -2
- package/dist/{core → cjs/core}/install/reuse.d.ts +1 -1
- package/dist/{core → cjs/core}/install/reuse.js +4 -4
- package/dist/{core → cjs/core}/registry.d.ts +1 -1
- package/dist/cjs/core/registry.js +112 -0
- package/dist/{core → cjs/core}/reporters.d.ts +1 -1
- package/dist/{core → cjs/core}/reporters.js +28 -28
- package/dist/{core → cjs/core}/run-checks.d.ts +2 -2
- package/dist/{core → cjs/core}/run-checks.js +31 -31
- package/dist/{core → cjs/core}/targets.d.ts +1 -1
- package/dist/{core → cjs/core}/targets.js +20 -20
- package/dist/{core → cjs/core}/types.d.ts +3 -3
- package/dist/cjs/index.d.ts +12 -0
- package/dist/{index.js → cjs/index.js} +18 -18
- package/dist/{init.js → cjs/init.js} +68 -56
- package/dist/{interfaces → cjs/interfaces}/index.d.ts +3 -3
- package/dist/cjs/package.json +1 -0
- package/dist/{scripts → cjs/scripts}/copy-configs.js +22 -7
- package/dist/{scripts → cjs/scripts}/generate-install-manifests.js +2 -2
- package/dist/{scripts → cjs/scripts}/publish-github.js +4 -4
- package/dist/{utils → cjs/utils}/detect-language.js +12 -12
- package/dist/cjs/utils/execa.js +46 -0
- package/dist/{utils → cjs/utils}/git.js +2 -2
- package/dist/{utils → cjs/utils}/http.js +2 -2
- package/dist/cjs/utils/index.d.ts +15 -0
- package/dist/{utils → cjs/utils}/index.js +13 -13
- package/dist/{utils → cjs/utils}/own-deps.d.ts +2 -0
- package/dist/{utils → cjs/utils}/own-deps.js +1 -0
- package/dist/{utils → cjs/utils}/package-version.js +2 -1
- package/dist/{utils → cjs/utils}/resolve-bin.js +2 -1
- package/dist/{utils → cjs/utils}/update-notifier.js +4 -4
- package/dist/esm/cli.d.ts +2 -0
- package/dist/esm/cli.js +137 -0
- package/dist/esm/config/constants.d.ts +153 -0
- package/dist/esm/config/constants.js +360 -0
- package/dist/esm/config/index.d.ts +40 -0
- package/dist/esm/config/index.js +60 -0
- package/dist/esm/config/loader.d.ts +6 -0
- package/dist/esm/config/loader.js +191 -0
- package/dist/esm/config/pr-checkmate-workflow-docker.yml +79 -0
- package/dist/esm/config/pr-checkmate-workflow.yml +92 -0
- package/dist/esm/core/checks/dependencies/banned-imports.d.ts +2 -0
- package/dist/esm/core/checks/dependencies/banned-imports.js +70 -0
- package/dist/esm/core/checks/dependencies/circular-deps.d.ts +2 -0
- package/dist/esm/core/checks/dependencies/circular-deps.js +155 -0
- package/dist/esm/core/checks/dependencies/dependency-check.d.ts +43 -0
- package/dist/esm/core/checks/dependencies/dependency-check.js +174 -0
- package/dist/esm/core/checks/dependencies/grype-scan.d.ts +22 -0
- package/dist/esm/core/checks/dependencies/grype-scan.js +112 -0
- package/dist/esm/core/checks/dependencies/license-check.d.ts +2 -0
- package/dist/esm/core/checks/dependencies/license-check.js +61 -0
- package/dist/esm/core/checks/dependencies/npm-audit.d.ts +6 -0
- package/dist/esm/core/checks/dependencies/npm-audit.js +80 -0
- package/dist/esm/core/checks/dependencies/outdated-deps.d.ts +2 -0
- package/dist/esm/core/checks/dependencies/outdated-deps.js +66 -0
- package/dist/esm/core/checks/dependencies/vuln-scan.d.ts +2 -0
- package/dist/esm/core/checks/dependencies/vuln-scan.js +54 -0
- package/dist/esm/core/checks/findings.d.ts +299 -0
- package/dist/esm/core/checks/findings.js +701 -0
- package/dist/esm/core/checks/git/custom-rules.d.ts +2 -0
- package/dist/esm/core/checks/git/custom-rules.js +106 -0
- package/dist/esm/core/checks/git/diff-smell.d.ts +19 -0
- package/dist/esm/core/checks/git/diff-smell.js +69 -0
- package/dist/esm/core/checks/git/large-files.d.ts +2 -0
- package/dist/esm/core/checks/git/large-files.js +112 -0
- package/dist/esm/core/checks/git/leftover-debug.d.ts +2 -0
- package/dist/esm/core/checks/git/leftover-debug.js +89 -0
- package/dist/esm/core/checks/git/lockfile-drift.d.ts +2 -0
- package/dist/esm/core/checks/git/lockfile-drift.js +114 -0
- package/dist/esm/core/checks/git/merge-conflict.d.ts +2 -0
- package/dist/esm/core/checks/git/merge-conflict.js +117 -0
- package/dist/esm/core/checks/git/missing-tests.d.ts +2 -0
- package/dist/esm/core/checks/git/missing-tests.js +105 -0
- package/dist/esm/core/checks/git/todo-fixme.d.ts +7 -0
- package/dist/esm/core/checks/git/todo-fixme.js +80 -0
- package/dist/esm/core/checks/languages/cpp-format.d.ts +7 -0
- package/dist/esm/core/checks/languages/cpp-format.js +91 -0
- package/dist/esm/core/checks/languages/external-checks.d.ts +77 -0
- package/dist/esm/core/checks/languages/external-checks.js +197 -0
- package/dist/esm/core/checks/languages/external-runner.d.ts +119 -0
- package/dist/esm/core/checks/languages/external-runner.js +138 -0
- package/dist/esm/core/checks/languages/go-format.d.ts +8 -0
- package/dist/{core → esm/core}/checks/languages/go-format.js +29 -35
- package/dist/esm/core/checks/languages/lint.d.ts +2 -0
- package/dist/esm/core/checks/languages/lint.js +92 -0
- package/dist/esm/core/checks/languages/prettier.d.ts +2 -0
- package/dist/esm/core/checks/languages/prettier.js +85 -0
- package/dist/esm/core/checks/languages/python-format.d.ts +7 -0
- package/dist/esm/core/checks/languages/python-format.js +61 -0
- package/dist/esm/core/checks/languages/python-lint.d.ts +9 -0
- package/dist/esm/core/checks/languages/python-lint.js +55 -0
- package/dist/esm/core/checks/languages/python-typecheck.d.ts +14 -0
- package/dist/esm/core/checks/languages/python-typecheck.js +184 -0
- package/dist/esm/core/checks/languages/ruff-shared.d.ts +10 -0
- package/dist/esm/core/checks/languages/ruff-shared.js +35 -0
- package/dist/esm/core/checks/languages/typecheck.d.ts +2 -0
- package/dist/esm/core/checks/languages/typecheck.js +61 -0
- package/dist/esm/core/checks/pr/commitlint.d.ts +2 -0
- package/dist/esm/core/checks/pr/commitlint.js +102 -0
- package/dist/esm/core/checks/pr/pr-body.d.ts +2 -0
- package/dist/esm/core/checks/pr/pr-body.js +43 -0
- package/dist/esm/core/checks/pr/pr-size-check.d.ts +2 -0
- package/dist/esm/core/checks/pr/pr-size-check.js +42 -0
- package/dist/esm/core/checks/pr/pr-title-lint.d.ts +2 -0
- package/dist/esm/core/checks/pr/pr-title-lint.js +31 -0
- package/dist/esm/core/checks/quality/case-collision.d.ts +8 -0
- package/dist/esm/core/checks/quality/case-collision.js +39 -0
- package/dist/esm/core/checks/quality/config-validation.d.ts +11 -0
- package/dist/esm/core/checks/quality/config-validation.js +188 -0
- package/dist/esm/core/checks/quality/coverage.d.ts +2 -0
- package/dist/esm/core/checks/quality/coverage.js +62 -0
- package/dist/esm/core/checks/quality/dead-code.d.ts +2 -0
- package/dist/esm/core/checks/quality/dead-code.js +124 -0
- package/dist/esm/core/checks/quality/duplicate-check.d.ts +2 -0
- package/dist/esm/core/checks/quality/duplicate-check.js +141 -0
- package/dist/esm/core/checks/quality/license-header.d.ts +7 -0
- package/dist/esm/core/checks/quality/license-header.js +81 -0
- package/dist/esm/core/checks/quality/markdown-lint.d.ts +2 -0
- package/dist/esm/core/checks/quality/markdown-lint.js +104 -0
- package/dist/esm/core/checks/quality/package-size.d.ts +36 -0
- package/dist/esm/core/checks/quality/package-size.js +196 -0
- package/dist/esm/core/checks/quality/spellcheck.d.ts +77 -0
- package/dist/esm/core/checks/quality/spellcheck.js +296 -0
- package/dist/esm/core/checks/quality/symlinks.d.ts +16 -0
- package/dist/esm/core/checks/quality/symlinks.js +57 -0
- package/dist/esm/core/checks/quality/yaml-lint.d.ts +20 -0
- package/dist/esm/core/checks/quality/yaml-lint.js +116 -0
- package/dist/esm/core/checks/security/diff-security.d.ts +2 -0
- package/dist/esm/core/checks/security/diff-security.js +354 -0
- package/dist/esm/core/checks/security/dockerfile-security.d.ts +2 -0
- package/dist/esm/core/checks/security/dockerfile-security.js +98 -0
- package/dist/esm/core/checks/security/migration-safety.d.ts +2 -0
- package/dist/esm/core/checks/security/migration-safety.js +137 -0
- package/dist/esm/core/checks/security/security.d.ts +63 -0
- package/dist/esm/core/checks/security/security.js +201 -0
- package/dist/esm/core/checks/security/sensitive-file-guard.d.ts +2 -0
- package/dist/esm/core/checks/security/sensitive-file-guard.js +160 -0
- package/dist/esm/core/checks/security/workflow-security.d.ts +12 -0
- package/dist/esm/core/checks/security/workflow-security.js +100 -0
- package/dist/esm/core/checks/tool-install.d.ts +102 -0
- package/dist/esm/core/checks/tool-install.js +66 -0
- package/dist/esm/core/commands.d.ts +27 -0
- package/dist/esm/core/commands.js +89 -0
- package/dist/esm/core/context.d.ts +62 -0
- package/dist/esm/core/context.js +241 -0
- package/dist/esm/core/index.d.ts +4 -0
- package/dist/esm/core/index.js +4 -0
- package/dist/esm/core/install/cache.d.ts +58 -0
- package/dist/esm/core/install/cache.js +142 -0
- package/dist/esm/core/install/doctor.d.ts +35 -0
- package/dist/esm/core/install/doctor.js +164 -0
- package/dist/esm/core/install/ensure.d.ts +77 -0
- package/dist/esm/core/install/ensure.js +269 -0
- package/dist/esm/core/install/lock.d.ts +34 -0
- package/dist/esm/core/install/lock.js +92 -0
- package/dist/esm/core/install/merge.d.ts +47 -0
- package/dist/esm/core/install/merge.js +85 -0
- package/dist/esm/core/install/prepare.d.ts +76 -0
- package/dist/esm/core/install/prepare.js +142 -0
- package/dist/esm/core/install/profiles.d.ts +78 -0
- package/dist/esm/core/install/profiles.js +192 -0
- package/dist/esm/core/install/reuse.d.ts +41 -0
- package/dist/esm/core/install/reuse.js +100 -0
- package/dist/esm/core/registry.d.ts +6 -0
- package/dist/esm/core/registry.js +109 -0
- package/dist/esm/core/reporters.d.ts +18 -0
- package/dist/esm/core/reporters.js +266 -0
- package/dist/esm/core/run-checks.d.ts +33 -0
- package/dist/esm/core/run-checks.js +293 -0
- package/dist/esm/core/targets.d.ts +140 -0
- package/dist/esm/core/targets.js +213 -0
- package/dist/esm/core/types.d.ts +195 -0
- package/dist/esm/core/types.js +38 -0
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/init.d.ts +38 -0
- package/dist/esm/init.js +421 -0
- package/dist/esm/interfaces/index.d.ts +432 -0
- package/dist/esm/interfaces/index.js +2 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/scripts/copy-configs.d.ts +1 -0
- package/dist/esm/scripts/copy-configs.js +64 -0
- package/dist/esm/scripts/generate-install-manifests.d.ts +39 -0
- package/dist/esm/scripts/generate-install-manifests.js +115 -0
- package/dist/esm/scripts/publish-github.d.ts +1 -0
- package/dist/esm/scripts/publish-github.js +45 -0
- package/dist/esm/utils/ci.d.ts +11 -0
- package/dist/esm/utils/ci.js +40 -0
- package/dist/esm/utils/detect-language.d.ts +48 -0
- package/dist/esm/utils/detect-language.js +234 -0
- package/dist/esm/utils/direct-deps.d.ts +21 -0
- package/dist/esm/utils/direct-deps.js +220 -0
- package/dist/esm/utils/execa.d.ts +22 -0
- package/dist/{utils → esm/utils}/execa.js +1 -4
- package/dist/esm/utils/git.d.ts +14 -0
- package/dist/esm/utils/git.js +21 -0
- package/dist/esm/utils/glob.d.ts +24 -0
- package/dist/esm/utils/glob.js +40 -0
- package/dist/esm/utils/http.d.ts +59 -0
- package/dist/esm/utils/http.js +115 -0
- package/dist/esm/utils/index.d.ts +15 -0
- package/dist/esm/utils/index.js +26 -0
- package/dist/esm/utils/logger.d.ts +65 -0
- package/dist/esm/utils/logger.js +157 -0
- package/dist/esm/utils/own-deps.d.ts +16 -0
- package/dist/esm/utils/own-deps.js +107 -0
- package/dist/esm/utils/package-version.d.ts +4 -0
- package/dist/esm/utils/package-version.js +38 -0
- package/dist/esm/utils/pool.d.ts +49 -0
- package/dist/esm/utils/pool.js +113 -0
- package/dist/esm/utils/resolve-bin.d.ts +67 -0
- package/dist/esm/utils/resolve-bin.js +156 -0
- package/dist/esm/utils/result-collector.d.ts +33 -0
- package/dist/esm/utils/result-collector.js +44 -0
- package/dist/esm/utils/update-notifier.d.ts +19 -0
- package/dist/esm/utils/update-notifier.js +108 -0
- package/install-manifests/core/package-lock.json +4 -4
- package/install-manifests/core/package.json +1 -1
- package/install-manifests/cpp/package-lock.json +4 -4
- package/install-manifests/cpp/package.json +1 -1
- package/package.json +16 -14
- package/dist/core/checks/languages/lint.d.ts +0 -2
- package/dist/core/index.d.ts +0 -4
- package/dist/core/registry.js +0 -112
- package/dist/index.d.ts +0 -12
- package/dist/utils/index.d.ts +0 -15
- /package/dist/{cli.d.ts → cjs/cli.d.ts} +0 -0
- /package/dist/{config → cjs/config}/constants.d.ts +0 -0
- /package/dist/{config → cjs/config}/constants.js +0 -0
- /package/dist/{config → cjs/config}/pr-checkmate-workflow-docker.yml +0 -0
- /package/dist/{config → cjs/config}/pr-checkmate-workflow.yml +0 -0
- /package/dist/{core → cjs/core}/checks/languages/ruff-shared.d.ts +0 -0
- /package/dist/{core → cjs/core}/checks/languages/ruff-shared.js +0 -0
- /package/dist/{core → cjs/core}/commands.d.ts +0 -0
- /package/dist/{core → cjs/core}/commands.js +0 -0
- /package/dist/{core → cjs/core}/install/cache.d.ts +0 -0
- /package/dist/{core → cjs/core}/install/lock.d.ts +0 -0
- /package/dist/{core → cjs/core}/install/merge.d.ts +0 -0
- /package/dist/{core → cjs/core}/install/merge.js +0 -0
- /package/dist/{core → cjs/core}/install/profiles.js +0 -0
- /package/dist/{core → cjs/core}/types.js +0 -0
- /package/dist/{init.d.ts → cjs/init.d.ts} +0 -0
- /package/dist/{interfaces → cjs/interfaces}/index.js +0 -0
- /package/dist/{scripts → cjs/scripts}/copy-configs.d.ts +0 -0
- /package/dist/{scripts → cjs/scripts}/generate-install-manifests.d.ts +0 -0
- /package/dist/{scripts → cjs/scripts}/publish-github.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/ci.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/ci.js +0 -0
- /package/dist/{utils → cjs/utils}/detect-language.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/direct-deps.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/direct-deps.js +0 -0
- /package/dist/{utils → cjs/utils}/execa.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/git.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/glob.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/glob.js +0 -0
- /package/dist/{utils → cjs/utils}/http.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/logger.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/logger.js +0 -0
- /package/dist/{utils → cjs/utils}/package-version.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/pool.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/pool.js +0 -0
- /package/dist/{utils → cjs/utils}/resolve-bin.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/result-collector.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/result-collector.js +0 -0
- /package/dist/{utils → cjs/utils}/update-notifier.d.ts +0 -0
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import type { Language } from '../utils/detect-language.js';
|
|
2
|
+
export interface ConfigFile {
|
|
3
|
+
source: string;
|
|
4
|
+
dest: string;
|
|
5
|
+
}
|
|
6
|
+
export interface PrettierConfig {
|
|
7
|
+
semi: boolean;
|
|
8
|
+
singleQuote: boolean;
|
|
9
|
+
trailingComma: string;
|
|
10
|
+
bracketSpacing: boolean;
|
|
11
|
+
arrowParens: string;
|
|
12
|
+
printWidth: number;
|
|
13
|
+
}
|
|
14
|
+
export interface CspellConfig {
|
|
15
|
+
version: string;
|
|
16
|
+
language: string;
|
|
17
|
+
import?: string[];
|
|
18
|
+
words: string[];
|
|
19
|
+
ignorePaths: string[];
|
|
20
|
+
enableFiletypes: string[];
|
|
21
|
+
ignoreRegExpList: string[];
|
|
22
|
+
dictionaries?: string[];
|
|
23
|
+
enabled?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Client `reporter` block: where the summary goes and what happens if it cannot
|
|
27
|
+
* get there.
|
|
28
|
+
*
|
|
29
|
+
* Lives here rather than beside the other run types in `core/types.ts` because
|
|
30
|
+
* it is part of the config file's shape, and `core/types.ts` already imports
|
|
31
|
+
* this module — declaring it in both is what let the two copies drift.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Client `install` block: which tooling is fetched, when, and what a failure to
|
|
35
|
+
* fetch it means.
|
|
36
|
+
*
|
|
37
|
+
* The defaults are chosen so that an existing installation behaves exactly as it
|
|
38
|
+
* did before this block existed. `strategy: "eager"` is the documented way back
|
|
39
|
+
* to the old behaviour without waiting for a release from us.
|
|
40
|
+
*/
|
|
41
|
+
export interface InstallConfig {
|
|
42
|
+
strategy?: 'adaptive' | 'eager' | 'manual';
|
|
43
|
+
profiles?: string[];
|
|
44
|
+
excludeProfiles?: string[];
|
|
45
|
+
minFilesPerLanguage?: number;
|
|
46
|
+
reuseLocal?: 'compatible' | 'always' | 'off';
|
|
47
|
+
onMissingTool?: 'auto' | 'skip' | 'error';
|
|
48
|
+
offline?: boolean;
|
|
49
|
+
waitTimeoutMs?: number;
|
|
50
|
+
installTimeoutMs?: number;
|
|
51
|
+
cacheDir?: string;
|
|
52
|
+
prewarm?: boolean;
|
|
53
|
+
deny?: string[];
|
|
54
|
+
}
|
|
55
|
+
export interface ReporterConfig {
|
|
56
|
+
/**
|
|
57
|
+
* What a failed post means for the run.
|
|
58
|
+
* - `warn` (default) — log it, exit code unchanged.
|
|
59
|
+
* - `error` — fail the run, for teams whose review depends on the comment.
|
|
60
|
+
* - `off` — stay silent.
|
|
61
|
+
*/
|
|
62
|
+
onPostFailure?: 'warn' | 'error' | 'off';
|
|
63
|
+
/**
|
|
64
|
+
* `update` (default) edits the previous summary in place; `append` leaves one
|
|
65
|
+
* comment per run, giving a history in the thread.
|
|
66
|
+
*/
|
|
67
|
+
mode?: 'update' | 'append';
|
|
68
|
+
/** Per-request timeout in ms (default 10000). A hung API must not hold the run open. */
|
|
69
|
+
timeoutMs?: number;
|
|
70
|
+
/** Attempts per request for retryable failures — 5xx, 429, network (default 3). */
|
|
71
|
+
retries?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Pages of existing comments searched for our marker before giving up
|
|
74
|
+
* (default 10, 100 comments per page). Raise it on very long threads.
|
|
75
|
+
*/
|
|
76
|
+
maxPages?: number;
|
|
77
|
+
/** Trim the comment: a table of forty green rows helps nobody. */
|
|
78
|
+
include?: {
|
|
79
|
+
passed?: boolean;
|
|
80
|
+
skipped?: boolean;
|
|
81
|
+
details?: boolean;
|
|
82
|
+
docsLink?: boolean;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Post nothing when the run produced no warnings and no failures, so a clean
|
|
86
|
+
* PR does not notify every subscriber.
|
|
87
|
+
*/
|
|
88
|
+
skipWhenClean?: boolean;
|
|
89
|
+
}
|
|
90
|
+
export interface PRCheckMateConfig {
|
|
91
|
+
sourcePath: string | string[];
|
|
92
|
+
excludePaths?: string[];
|
|
93
|
+
ignoreDirs?: string[];
|
|
94
|
+
languages?: Language[];
|
|
95
|
+
detect?: {
|
|
96
|
+
minFiles?: number;
|
|
97
|
+
excludePaths?: string[];
|
|
98
|
+
disable?: Language[];
|
|
99
|
+
};
|
|
100
|
+
customRules?: Array<{
|
|
101
|
+
name: string;
|
|
102
|
+
pattern: string;
|
|
103
|
+
message?: string;
|
|
104
|
+
severity?: 'error' | 'warn';
|
|
105
|
+
include?: string[];
|
|
106
|
+
exclude?: string[];
|
|
107
|
+
flags?: string;
|
|
108
|
+
}>;
|
|
109
|
+
severity?: Record<string, 'error' | 'warn' | 'off'>;
|
|
110
|
+
log?: {
|
|
111
|
+
level?: 'error' | 'warn' | 'info' | 'log' | 'debug';
|
|
112
|
+
format?: 'pretty' | 'ci' | 'json';
|
|
113
|
+
color?: 'auto' | 'always' | 'never';
|
|
114
|
+
timestamps?: boolean;
|
|
115
|
+
stderrLevels?: Array<'error' | 'warn' | 'info' | 'log' | 'debug'>;
|
|
116
|
+
sampleLimit?: number;
|
|
117
|
+
};
|
|
118
|
+
install?: InstallConfig;
|
|
119
|
+
reporter?: ReporterConfig;
|
|
120
|
+
run?: {
|
|
121
|
+
reportSkipped?: 'auto' | 'always' | 'never';
|
|
122
|
+
onDegradedScope?: 'warn' | 'error' | 'off';
|
|
123
|
+
concurrency?: number | 'auto' | 'unlimited';
|
|
124
|
+
heavyConcurrency?: number;
|
|
125
|
+
checkTimeoutMs?: number;
|
|
126
|
+
timings?: boolean;
|
|
127
|
+
fullScanBehaviour?: 'scan' | 'skip';
|
|
128
|
+
};
|
|
129
|
+
severityDefaults?: {
|
|
130
|
+
failOn?: 'error' | 'warn' | 'never';
|
|
131
|
+
};
|
|
132
|
+
lint?: {
|
|
133
|
+
rules?: Record<string, any>;
|
|
134
|
+
ignorePatterns?: string[];
|
|
135
|
+
};
|
|
136
|
+
prettier?: {
|
|
137
|
+
config?: Record<string, any>;
|
|
138
|
+
};
|
|
139
|
+
spellcheck?: {
|
|
140
|
+
enabled?: boolean;
|
|
141
|
+
words?: string[];
|
|
142
|
+
ignoreWords?: string[];
|
|
143
|
+
ignorePaths?: string[];
|
|
144
|
+
};
|
|
145
|
+
cspell?: {
|
|
146
|
+
enabled?: boolean;
|
|
147
|
+
words?: string[];
|
|
148
|
+
ignorePaths?: string[];
|
|
149
|
+
ignoreRegExpList?: string[];
|
|
150
|
+
dictionaries?: string[];
|
|
151
|
+
language?: string;
|
|
152
|
+
};
|
|
153
|
+
security?: {
|
|
154
|
+
gitleaks?: {
|
|
155
|
+
enabled?: boolean;
|
|
156
|
+
version?: string;
|
|
157
|
+
depth?: number;
|
|
158
|
+
};
|
|
159
|
+
'npm-audit'?: {
|
|
160
|
+
enabled?: boolean;
|
|
161
|
+
auditLevel?: string;
|
|
162
|
+
ignore?: string[];
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
typecheck?: {
|
|
166
|
+
enabled?: boolean;
|
|
167
|
+
};
|
|
168
|
+
cpp?: {
|
|
169
|
+
enabled?: boolean;
|
|
170
|
+
clangFormat?: {
|
|
171
|
+
style?: string;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
python?: {
|
|
175
|
+
enabled?: boolean;
|
|
176
|
+
ruff?: {
|
|
177
|
+
lint?: boolean;
|
|
178
|
+
format?: boolean;
|
|
179
|
+
};
|
|
180
|
+
typecheck?: boolean;
|
|
181
|
+
typeChecker?: 'mypy' | 'pyright';
|
|
182
|
+
};
|
|
183
|
+
packageSize?: {
|
|
184
|
+
enabled?: boolean;
|
|
185
|
+
maxGrowthPercent?: number;
|
|
186
|
+
compareWith?: string;
|
|
187
|
+
};
|
|
188
|
+
diffSmell?: {
|
|
189
|
+
enabled?: boolean;
|
|
190
|
+
ignorePaths?: string[];
|
|
191
|
+
};
|
|
192
|
+
prSize?: {
|
|
193
|
+
enabled?: boolean;
|
|
194
|
+
maxFiles?: number;
|
|
195
|
+
maxLines?: number;
|
|
196
|
+
};
|
|
197
|
+
leftoverDebug?: {
|
|
198
|
+
enabled?: boolean;
|
|
199
|
+
severity?: 'error' | 'warn';
|
|
200
|
+
commentHandling?: 'language' | 'legacy' | 'off';
|
|
201
|
+
};
|
|
202
|
+
todoFixme?: {
|
|
203
|
+
enabled?: boolean;
|
|
204
|
+
severity?: 'error' | 'warn';
|
|
205
|
+
requireTicket?: boolean;
|
|
206
|
+
keywords?: string[];
|
|
207
|
+
};
|
|
208
|
+
lockfileDrift?: {
|
|
209
|
+
enabled?: boolean;
|
|
210
|
+
severity?: 'error' | 'warn';
|
|
211
|
+
};
|
|
212
|
+
missingTests?: {
|
|
213
|
+
enabled?: boolean;
|
|
214
|
+
severity?: 'error' | 'warn';
|
|
215
|
+
ignore?: string[];
|
|
216
|
+
};
|
|
217
|
+
migrationSafety?: {
|
|
218
|
+
enabled?: boolean;
|
|
219
|
+
severity?: 'error' | 'warn';
|
|
220
|
+
paths?: string[];
|
|
221
|
+
};
|
|
222
|
+
coverage?: {
|
|
223
|
+
enabled?: boolean;
|
|
224
|
+
severity?: 'error' | 'warn';
|
|
225
|
+
reportPath?: string | string[];
|
|
226
|
+
};
|
|
227
|
+
largeFiles?: {
|
|
228
|
+
enabled?: boolean;
|
|
229
|
+
severity?: 'error' | 'warn';
|
|
230
|
+
maxSizeKb?: number;
|
|
231
|
+
allow?: string[];
|
|
232
|
+
};
|
|
233
|
+
prBody?: {
|
|
234
|
+
enabled?: boolean;
|
|
235
|
+
minLength?: number;
|
|
236
|
+
requireTicket?: boolean;
|
|
237
|
+
};
|
|
238
|
+
duplicate?: {
|
|
239
|
+
enabled?: boolean;
|
|
240
|
+
minLines?: number;
|
|
241
|
+
minTokens?: number;
|
|
242
|
+
/**
|
|
243
|
+
* Glob patterns excluded from duplicate detection, in addition to the always-on
|
|
244
|
+
* node_modules/dist/.git ignores. Defaults to test files/folders
|
|
245
|
+
* (see DUPLICATE_IGNORE_DEFAULTS). Setting this replaces the default list.
|
|
246
|
+
*/
|
|
247
|
+
ignore?: string[];
|
|
248
|
+
/**
|
|
249
|
+
* jscpd formats to scan. Defaults to source-code formats only
|
|
250
|
+
* (see DUPLICATE_CODE_FORMATS) — data formats like `yaml`, `json` and
|
|
251
|
+
* `markdown` are intentionally NOT scanned, since their repetition is rarely
|
|
252
|
+
* meaningful duplication. Add them back (e.g. `["typescript", "yaml"]`) if you
|
|
253
|
+
* do want to detect duplication in those files. Setting this replaces the list.
|
|
254
|
+
*/
|
|
255
|
+
formats?: string[];
|
|
256
|
+
};
|
|
257
|
+
dependency?: {
|
|
258
|
+
enabled?: boolean;
|
|
259
|
+
/**
|
|
260
|
+
* Dependency names to exclude from the unused/missing check (knip).
|
|
261
|
+
* Supports globs matched against the whole name, e.g. "@types/*" — so
|
|
262
|
+
* "eslint-*" covers "eslint-plugin-x" but never "eslint" itself. Use for
|
|
263
|
+
* packages that are invoked only as CLI binaries or referenced from config —
|
|
264
|
+
* knip sees no `import` for them and would otherwise report them as unused.
|
|
265
|
+
* Compiled into a temporary knip config, so a repo that ships its own knip
|
|
266
|
+
* config keeps full control instead.
|
|
267
|
+
*/
|
|
268
|
+
ignore?: string[];
|
|
269
|
+
};
|
|
270
|
+
outdatedDeps?: {
|
|
271
|
+
enabled?: boolean;
|
|
272
|
+
timeoutMs?: number;
|
|
273
|
+
/**
|
|
274
|
+
* Exact package names to exclude from the outdated-deps warning, e.g.
|
|
275
|
+
* "commander". Use for dependencies deliberately pinned behind their latest
|
|
276
|
+
* major (a breaking upgrade you have chosen not to take, or one held back by
|
|
277
|
+
* an `overrides` entry) so `npm outdated` no longer flags them as major-behind.
|
|
278
|
+
* Matched by exact name — no globs or version ranges.
|
|
279
|
+
*/
|
|
280
|
+
ignore?: string[];
|
|
281
|
+
};
|
|
282
|
+
commitlint?: {
|
|
283
|
+
enabled?: boolean;
|
|
284
|
+
types?: string[];
|
|
285
|
+
/**
|
|
286
|
+
* Regex sources (matched case-insensitively) for commit messages to skip,
|
|
287
|
+
* e.g. release PRs or squash-merge titles that don't follow conventional
|
|
288
|
+
* commits. Applied in addition to commitlint's built-in merge/revert ignores.
|
|
289
|
+
*/
|
|
290
|
+
ignores?: string[];
|
|
291
|
+
};
|
|
292
|
+
diffSecurity?: {
|
|
293
|
+
enabled?: boolean;
|
|
294
|
+
ignore?: string[];
|
|
295
|
+
failOn?: 'error' | 'warn' | 'never';
|
|
296
|
+
severityOverrides?: Record<string, 'error' | 'warn' | 'off'>;
|
|
297
|
+
ignorePaths?: string[];
|
|
298
|
+
disablePatterns?: string[];
|
|
299
|
+
extraPatterns?: Array<{
|
|
300
|
+
label: string;
|
|
301
|
+
pattern: string;
|
|
302
|
+
severity?: 'error' | 'warn';
|
|
303
|
+
view?: 'raw' | 'code';
|
|
304
|
+
flags?: string;
|
|
305
|
+
}>;
|
|
306
|
+
commentHandling?: 'language' | 'legacy' | 'off';
|
|
307
|
+
dataflowWindow?: number;
|
|
308
|
+
};
|
|
309
|
+
mergeConflict?: {
|
|
310
|
+
enabled?: boolean;
|
|
311
|
+
severity?: 'error' | 'warn';
|
|
312
|
+
};
|
|
313
|
+
workflowSecurity?: {
|
|
314
|
+
enabled?: boolean;
|
|
315
|
+
ignore?: string[];
|
|
316
|
+
failOn?: 'error' | 'warn' | 'never';
|
|
317
|
+
severityOverrides?: Record<string, 'error' | 'warn' | 'off'>;
|
|
318
|
+
ignorePaths?: string[];
|
|
319
|
+
};
|
|
320
|
+
dockerfileSecurity?: {
|
|
321
|
+
enabled?: boolean;
|
|
322
|
+
ignore?: string[];
|
|
323
|
+
failOn?: 'error' | 'warn' | 'never';
|
|
324
|
+
severityOverrides?: Record<string, 'error' | 'warn' | 'off'>;
|
|
325
|
+
ignorePaths?: string[];
|
|
326
|
+
};
|
|
327
|
+
caseCollision?: {
|
|
328
|
+
enabled?: boolean;
|
|
329
|
+
};
|
|
330
|
+
configValidation?: {
|
|
331
|
+
enabled?: boolean;
|
|
332
|
+
severity?: 'error' | 'warn';
|
|
333
|
+
validateCheckNames?: boolean;
|
|
334
|
+
allowUnknownKeys?: string[];
|
|
335
|
+
};
|
|
336
|
+
symlinks?: {
|
|
337
|
+
enabled?: boolean;
|
|
338
|
+
severity?: 'error' | 'warn';
|
|
339
|
+
ignore?: string[];
|
|
340
|
+
};
|
|
341
|
+
shellcheck?: {
|
|
342
|
+
enabled?: boolean;
|
|
343
|
+
minSeverity?: 'error' | 'warning' | 'info' | 'style';
|
|
344
|
+
ignore?: string[];
|
|
345
|
+
};
|
|
346
|
+
yamlLint?: {
|
|
347
|
+
enabled?: boolean;
|
|
348
|
+
severity?: 'error' | 'warn';
|
|
349
|
+
ignore?: string[];
|
|
350
|
+
};
|
|
351
|
+
circularDeps?: {
|
|
352
|
+
enabled?: boolean;
|
|
353
|
+
severity?: 'error' | 'warn';
|
|
354
|
+
ignore?: string[];
|
|
355
|
+
timeoutMs?: number;
|
|
356
|
+
};
|
|
357
|
+
vulnScan?: {
|
|
358
|
+
enabled?: boolean;
|
|
359
|
+
timeoutMs?: number;
|
|
360
|
+
};
|
|
361
|
+
grypeScan?: {
|
|
362
|
+
enabled?: boolean;
|
|
363
|
+
minSeverity?: 'negligible' | 'low' | 'medium' | 'high' | 'critical';
|
|
364
|
+
ignore?: string[];
|
|
365
|
+
/**
|
|
366
|
+
* Max time (ms) for the grype scan before the check skips. Default 120000.
|
|
367
|
+
* `ignoreDirs` already keeps `node_modules`, `dist` and friends out of the walk,
|
|
368
|
+
* which is what makes the scan fast; this is the backstop so an advisory check
|
|
369
|
+
* can never stall a commit.
|
|
370
|
+
*/
|
|
371
|
+
timeoutMs?: number;
|
|
372
|
+
};
|
|
373
|
+
bannedImports?: Array<{
|
|
374
|
+
name: string;
|
|
375
|
+
message?: string;
|
|
376
|
+
severity?: 'error' | 'warn';
|
|
377
|
+
}>;
|
|
378
|
+
licenseHeader?: {
|
|
379
|
+
enabled?: boolean;
|
|
380
|
+
pattern?: string;
|
|
381
|
+
lines?: number;
|
|
382
|
+
};
|
|
383
|
+
sensitiveFileGuard?: {
|
|
384
|
+
enabled?: boolean;
|
|
385
|
+
ignorePaths?: string[];
|
|
386
|
+
ignore?: string[];
|
|
387
|
+
failOn?: 'error' | 'warn' | 'never';
|
|
388
|
+
severityOverrides?: Record<string, 'error' | 'warn' | 'off'>;
|
|
389
|
+
};
|
|
390
|
+
swift?: {
|
|
391
|
+
enabled?: boolean;
|
|
392
|
+
};
|
|
393
|
+
kotlin?: {
|
|
394
|
+
enabled?: boolean;
|
|
395
|
+
};
|
|
396
|
+
go?: {
|
|
397
|
+
enabled?: boolean;
|
|
398
|
+
};
|
|
399
|
+
rust?: {
|
|
400
|
+
enabled?: boolean;
|
|
401
|
+
};
|
|
402
|
+
csharp?: {
|
|
403
|
+
enabled?: boolean;
|
|
404
|
+
};
|
|
405
|
+
ruby?: {
|
|
406
|
+
enabled?: boolean;
|
|
407
|
+
};
|
|
408
|
+
php?: {
|
|
409
|
+
enabled?: boolean;
|
|
410
|
+
};
|
|
411
|
+
deadCode?: {
|
|
412
|
+
enabled?: boolean;
|
|
413
|
+
/**
|
|
414
|
+
* Regex sources matched against reported file paths; matching files are
|
|
415
|
+
* dropped from the dead-code report. Use to exempt intentional public
|
|
416
|
+
* surface — a package entry point (`src/index.ts`) or re-export barrels
|
|
417
|
+
* whose exports are consumed by external installers, not within the repo.
|
|
418
|
+
* Applied to the report (not ts-unused-exports' own `--ignoreFiles`), so it
|
|
419
|
+
* never removes a file from analysis and cannot cascade onto other files.
|
|
420
|
+
* Defaults to test/mock files (see DEAD_CODE_IGNORE_DEFAULTS), whose exports
|
|
421
|
+
* are consumed only by the test runner and would otherwise show as unused.
|
|
422
|
+
* Setting this replaces the default list.
|
|
423
|
+
*/
|
|
424
|
+
ignoreFiles?: string[];
|
|
425
|
+
};
|
|
426
|
+
licenseCheck?: {
|
|
427
|
+
allowPackages?: string[];
|
|
428
|
+
allowLicenses?: string[];
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
export type { CheckStatus, CheckResult } from '../utils/result-collector.js';
|
|
432
|
+
export type { Language } from '../utils/detect-language.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
2
|
+
import { dirname as __dirnameFn } from 'node:path';
|
|
3
|
+
const __dirname = __dirnameFn(__fileURLToPath(import.meta.url));
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { logger } from '../utils/index.js';
|
|
7
|
+
const configFiles = [
|
|
8
|
+
// Source is named so ESLint's auto-discovery does NOT treat it as a nested
|
|
9
|
+
// config for files under src/config/ — it ships to the package root as the
|
|
10
|
+
// canonical `eslint.config.mjs`.
|
|
11
|
+
{ source: 'src/config/eslint-flat-config.mjs', dest: 'eslint.config.mjs' },
|
|
12
|
+
{ source: 'src/config/eslint-default-rules.json', dest: 'eslint-default-rules.json' },
|
|
13
|
+
{ source: 'src/config/.eslintrc.js', dest: '.eslintrc.js' },
|
|
14
|
+
{ source: 'src/config/.prettierrc', dest: '.prettierrc' },
|
|
15
|
+
{ source: 'src/config/cspell.json', dest: 'cspell.json' },
|
|
16
|
+
{ source: 'tsconfig.json', dest: 'tsconfig.json' },
|
|
17
|
+
// `init.ts` reads these as a sibling of its own compiled location
|
|
18
|
+
// (`__dirname/config/...`), which means they must exist under both build
|
|
19
|
+
// outputs — dist/cjs and dist/esm are no longer siblings of a single
|
|
20
|
+
// shared dist/config the way the old flat dist/ layout was.
|
|
21
|
+
{
|
|
22
|
+
source: 'src/config/pr-checkmate-workflow.yml',
|
|
23
|
+
dest: 'dist/cjs/config/pr-checkmate-workflow.yml',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
source: 'src/config/pr-checkmate-workflow.yml',
|
|
27
|
+
dest: 'dist/esm/config/pr-checkmate-workflow.yml',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
source: 'src/config/pr-checkmate-workflow-docker.yml',
|
|
31
|
+
dest: 'dist/cjs/config/pr-checkmate-workflow-docker.yml',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
source: 'src/config/pr-checkmate-workflow-docker.yml',
|
|
35
|
+
dest: 'dist/esm/config/pr-checkmate-workflow-docker.yml',
|
|
36
|
+
},
|
|
37
|
+
{ source: 'src/config/pr-checkmate.schema.json', dest: 'pr-checkmate.schema.json' },
|
|
38
|
+
];
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
function copyConfigs() {
|
|
43
|
+
const root = path.resolve(__dirname, '../..');
|
|
44
|
+
logger.log('[copyConfigs]: Copying config files to package root...\n');
|
|
45
|
+
configFiles.forEach(({ source, dest }) => {
|
|
46
|
+
const srcPath = path.join(root, source);
|
|
47
|
+
const destPath = path.join(root, dest);
|
|
48
|
+
if (!fs.existsSync(srcPath)) {
|
|
49
|
+
logger.warn(`[copyConfigs]: ⚠️ Source not found: ${source}`);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
// Create destination directory if it doesn't exist
|
|
53
|
+
const destDir = path.dirname(destPath);
|
|
54
|
+
if (!fs.existsSync(destDir)) {
|
|
55
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
56
|
+
}
|
|
57
|
+
fs.copyFileSync(srcPath, destPath);
|
|
58
|
+
logger.log(`[copyConfigs]: ✅ Copied ${dest}`);
|
|
59
|
+
});
|
|
60
|
+
logger.info('\n[copyConfigs]: ✨ Configs successfully copied to root!\n');
|
|
61
|
+
}
|
|
62
|
+
if (require.main === module) {
|
|
63
|
+
copyConfigs();
|
|
64
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build step: turn our own lockfile into one installable manifest per profile.
|
|
3
|
+
*
|
|
4
|
+
* Why the manifests are cut out of `package-lock.json` rather than resolved
|
|
5
|
+
* fresh from the registry:
|
|
6
|
+
*
|
|
7
|
+
* - **What clients fetch is then exactly what we tested.** Resolving at build
|
|
8
|
+
* time would drift the moment a transitive dependency publishes a patch, and
|
|
9
|
+
* the tooling clients run would stop being the tooling that passed our suite.
|
|
10
|
+
* - **The build stays offline.** A release pipeline that needs the network to
|
|
11
|
+
* produce a manifest is a release pipeline that fails when the registry does.
|
|
12
|
+
* - **Integrity comes free.** Every entry carries the hash npm recorded, so the
|
|
13
|
+
* runtime install is a plain `npm ci`, and npm refuses a tampered tarball
|
|
14
|
+
* itself — over the whole transitive tree, not just the packages we name.
|
|
15
|
+
*/
|
|
16
|
+
interface LockEntry {
|
|
17
|
+
version?: string;
|
|
18
|
+
resolved?: string;
|
|
19
|
+
integrity?: string;
|
|
20
|
+
dependencies?: Record<string, string>;
|
|
21
|
+
optionalDependencies?: Record<string, string>;
|
|
22
|
+
peerDependencies?: Record<string, string>;
|
|
23
|
+
peerDependenciesMeta?: Record<string, {
|
|
24
|
+
optional?: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
dev?: boolean;
|
|
27
|
+
link?: boolean;
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
export interface Lock {
|
|
31
|
+
lockfileVersion: number;
|
|
32
|
+
packages: Record<string, LockEntry>;
|
|
33
|
+
}
|
|
34
|
+
/** Build the `package.json` + `package-lock.json` pair for one profile. */
|
|
35
|
+
export declare function buildManifest(lock: Lock, profile: string, packages: string[], overrides?: Record<string, unknown>): {
|
|
36
|
+
pkg: object;
|
|
37
|
+
lockfile: object;
|
|
38
|
+
};
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { PROFILES } from '../core/install/profiles.js';
|
|
4
|
+
/**
|
|
5
|
+
* Find the entry npm would resolve `name` to from inside `fromPath`.
|
|
6
|
+
*
|
|
7
|
+
* This reproduces node's own lookup: nearest `node_modules` first, then upwards
|
|
8
|
+
* to the root. Getting it wrong shows up as a package silently resolved to the
|
|
9
|
+
* wrong copy — `dpdm` bundles its own TypeScript, so "nearest wins" is not
|
|
10
|
+
* theoretical here.
|
|
11
|
+
*/
|
|
12
|
+
function resolveEntry(lock, name, fromPath) {
|
|
13
|
+
const segments = fromPath === '' ? [] : fromPath.split('/');
|
|
14
|
+
for (let depth = segments.length; depth >= 0; depth--) {
|
|
15
|
+
const prefix = segments.slice(0, depth).join('/');
|
|
16
|
+
const candidate = prefix ? `${prefix}/node_modules/${name}` : `node_modules/${name}`;
|
|
17
|
+
if (lock.packages[candidate])
|
|
18
|
+
return candidate;
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
/** Every dependency path reachable from the given top-level packages. */
|
|
23
|
+
function closureOf(lock, roots) {
|
|
24
|
+
const seen = new Set();
|
|
25
|
+
const queue = [];
|
|
26
|
+
for (const name of roots) {
|
|
27
|
+
const entryPath = resolveEntry(lock, name, '');
|
|
28
|
+
if (entryPath)
|
|
29
|
+
queue.push(entryPath);
|
|
30
|
+
}
|
|
31
|
+
while (queue.length > 0) {
|
|
32
|
+
const current = queue.shift();
|
|
33
|
+
if (seen.has(current))
|
|
34
|
+
continue;
|
|
35
|
+
seen.add(current);
|
|
36
|
+
const entry = lock.packages[current];
|
|
37
|
+
if (!entry)
|
|
38
|
+
continue;
|
|
39
|
+
// Optional AND peer dependencies are included, both for the same reason:
|
|
40
|
+
// npm 7+ installs peers automatically, so a peer absent from the manifest is
|
|
41
|
+
// not simply skipped — npm resolves it fresh against the registry, gets the
|
|
42
|
+
// latest version, and then rejects the manifest as out of sync. That is
|
|
43
|
+
// exactly how the commitlint profile failed: `Missing: typescript@7.0.2 from
|
|
44
|
+
// lock file`, a version we never shipped and never tested.
|
|
45
|
+
const names = [
|
|
46
|
+
...Object.keys(entry.dependencies ?? {}),
|
|
47
|
+
...Object.keys(entry.optionalDependencies ?? {}),
|
|
48
|
+
...Object.keys(entry.peerDependencies ?? {}),
|
|
49
|
+
];
|
|
50
|
+
for (const name of names) {
|
|
51
|
+
const resolved = resolveEntry(lock, name, current);
|
|
52
|
+
if (resolved && !seen.has(resolved))
|
|
53
|
+
queue.push(resolved);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return seen;
|
|
57
|
+
}
|
|
58
|
+
/** Build the `package.json` + `package-lock.json` pair for one profile. */
|
|
59
|
+
export function buildManifest(lock, profile, packages, overrides) {
|
|
60
|
+
const closure = closureOf(lock, packages);
|
|
61
|
+
const dependencies = {};
|
|
62
|
+
for (const name of packages) {
|
|
63
|
+
const entryPath = resolveEntry(lock, name, '');
|
|
64
|
+
const version = entryPath ? lock.packages[entryPath]?.version : undefined;
|
|
65
|
+
if (!version)
|
|
66
|
+
throw new Error(`profile "${profile}": ${name} is not in package-lock.json`);
|
|
67
|
+
// Pinned, not ranged: a range would let the client resolve a version we
|
|
68
|
+
// never ran a single check against.
|
|
69
|
+
dependencies[name] = version;
|
|
70
|
+
}
|
|
71
|
+
const name = `pr-checkmate-profile-${profile}`;
|
|
72
|
+
// `overrides` are carried over — without them npm re-checks each declared
|
|
73
|
+
// range against the tree and rejects the manifest: `dpdm` asks for
|
|
74
|
+
// `typescript@^5.9.3`, our override points it at the copy we ship, and a
|
|
75
|
+
// manifest that dropped the override fails with `Missing: typescript@5.9.3`.
|
|
76
|
+
//
|
|
77
|
+
// Only the ones that apply, though. These manifests are the list of what a
|
|
78
|
+
// client's machine downloads at run time, so they are meant to be read; an
|
|
79
|
+
// override naming a package this profile never installs is noise in exactly
|
|
80
|
+
// the artefact that has to be scrutable.
|
|
81
|
+
const applicable = Object.fromEntries(Object.entries(overrides ?? {}).filter(([pkg]) => closure.has(resolveEntry(lock, pkg, '') ?? '')));
|
|
82
|
+
const scoped = Object.keys(applicable).length > 0 ? { overrides: applicable } : {};
|
|
83
|
+
const root = { name, version: '1.0.0', dependencies, ...scoped };
|
|
84
|
+
const pkg = { ...root, private: true };
|
|
85
|
+
const packagesOut = { '': root };
|
|
86
|
+
for (const entryPath of [...closure].sort()) {
|
|
87
|
+
const entry = { ...lock.packages[entryPath] };
|
|
88
|
+
// `dev` is about our repository, not about this manifest; leaving it set
|
|
89
|
+
// would make `npm ci --omit=dev` skip tooling the client needs.
|
|
90
|
+
delete entry.dev;
|
|
91
|
+
packagesOut[entryPath] = entry;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
pkg,
|
|
95
|
+
lockfile: { name, version: '1.0.0', lockfileVersion: 3, requires: true, packages: packagesOut },
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function main() {
|
|
99
|
+
const root = process.cwd();
|
|
100
|
+
const lock = JSON.parse(fs.readFileSync(path.join(root, 'package-lock.json'), 'utf-8'));
|
|
101
|
+
const manifest = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf-8'));
|
|
102
|
+
const outDir = path.join(root, 'install-manifests');
|
|
103
|
+
fs.rmSync(outDir, { recursive: true, force: true });
|
|
104
|
+
for (const profile of PROFILES) {
|
|
105
|
+
const { pkg, lockfile } = buildManifest(lock, profile.name, profile.packages, manifest.overrides);
|
|
106
|
+
const dir = path.join(outDir, profile.name);
|
|
107
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
108
|
+
fs.writeFileSync(path.join(dir, 'package.json'), `${JSON.stringify(pkg, null, 2)}\n`);
|
|
109
|
+
fs.writeFileSync(path.join(dir, 'package-lock.json'), `${JSON.stringify(lockfile, null, 2)}\n`);
|
|
110
|
+
const count = Object.keys(lockfile.packages).length - 1;
|
|
111
|
+
process.stdout.write(`[manifests]: ${profile.name} — ${count} package(s)\n`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (require.main === module)
|
|
115
|
+
main();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|