pr-checkmate 3.0.4 → 3.2.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/{core → cjs/core}/checks/languages/go-format.js +21 -21
- 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/cjs/core/checks/quality/markdown-lint.js +147 -0
- 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/profiles.js +1 -1
- 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/{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/esm/core/checks/languages/go-format.js +163 -0
- 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 +141 -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/esm/utils/execa.js +10 -0
- 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/duplicate/package-lock.json +0 -12
- package/install-manifests/js/package-lock.json +17 -41
- package/install-manifests/js/package.json +1 -1
- package/install-manifests/markdown/package-lock.json +1 -492
- package/install-manifests/markdown/package.json +1 -1
- package/package.json +17 -15
- package/dist/core/checks/languages/lint.d.ts +0 -2
- package/dist/core/checks/quality/markdown-lint.js +0 -110
- 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}/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}/execa.js +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
|
@@ -8,25 +8,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.Logger = exports.hasLocalConfig = exports.getPackageConfigPath = exports.getIgnoredDirs = exports.getSourcePaths = exports.getSourcePath = exports.defineCheck = exports.skip = exports.fail = exports.warn = exports.pass = exports.REGISTRY = exports.buildContext = exports.runChecks = void 0;
|
|
9
9
|
// Primary programmatic API: run checks and receive a structured report.
|
|
10
10
|
// Never throws for violations, never calls process.exit — the caller decides.
|
|
11
|
-
var
|
|
12
|
-
Object.defineProperty(exports, "runChecks", { enumerable: true, get: function () { return
|
|
13
|
-
Object.defineProperty(exports, "buildContext", { enumerable: true, get: function () { return
|
|
14
|
-
Object.defineProperty(exports, "REGISTRY", { enumerable: true, get: function () { return
|
|
11
|
+
var index_js_1 = require("./core/index.js");
|
|
12
|
+
Object.defineProperty(exports, "runChecks", { enumerable: true, get: function () { return index_js_1.runChecks; } });
|
|
13
|
+
Object.defineProperty(exports, "buildContext", { enumerable: true, get: function () { return index_js_1.buildContext; } });
|
|
14
|
+
Object.defineProperty(exports, "REGISTRY", { enumerable: true, get: function () { return index_js_1.REGISTRY; } });
|
|
15
15
|
// Authoring helpers for consumers writing their own checks (plugins).
|
|
16
|
-
var
|
|
17
|
-
Object.defineProperty(exports, "pass", { enumerable: true, get: function () { return
|
|
18
|
-
Object.defineProperty(exports, "warn", { enumerable: true, get: function () { return
|
|
19
|
-
Object.defineProperty(exports, "fail", { enumerable: true, get: function () { return
|
|
20
|
-
Object.defineProperty(exports, "skip", { enumerable: true, get: function () { return
|
|
21
|
-
Object.defineProperty(exports, "defineCheck", { enumerable: true, get: function () { return
|
|
16
|
+
var index_js_2 = require("./core/index.js");
|
|
17
|
+
Object.defineProperty(exports, "pass", { enumerable: true, get: function () { return index_js_2.pass; } });
|
|
18
|
+
Object.defineProperty(exports, "warn", { enumerable: true, get: function () { return index_js_2.warn; } });
|
|
19
|
+
Object.defineProperty(exports, "fail", { enumerable: true, get: function () { return index_js_2.fail; } });
|
|
20
|
+
Object.defineProperty(exports, "skip", { enumerable: true, get: function () { return index_js_2.skip; } });
|
|
21
|
+
Object.defineProperty(exports, "defineCheck", { enumerable: true, get: function () { return index_js_2.defineCheck; } });
|
|
22
22
|
// Config helpers for consumers embedding pr-checkmate.
|
|
23
|
-
var
|
|
24
|
-
Object.defineProperty(exports, "getSourcePath", { enumerable: true, get: function () { return
|
|
25
|
-
Object.defineProperty(exports, "getSourcePaths", { enumerable: true, get: function () { return
|
|
26
|
-
Object.defineProperty(exports, "getIgnoredDirs", { enumerable: true, get: function () { return
|
|
27
|
-
Object.defineProperty(exports, "getPackageConfigPath", { enumerable: true, get: function () { return
|
|
28
|
-
Object.defineProperty(exports, "hasLocalConfig", { enumerable: true, get: function () { return
|
|
23
|
+
var index_js_3 = require("./config/index.js");
|
|
24
|
+
Object.defineProperty(exports, "getSourcePath", { enumerable: true, get: function () { return index_js_3.getSourcePath; } });
|
|
25
|
+
Object.defineProperty(exports, "getSourcePaths", { enumerable: true, get: function () { return index_js_3.getSourcePaths; } });
|
|
26
|
+
Object.defineProperty(exports, "getIgnoredDirs", { enumerable: true, get: function () { return index_js_3.getIgnoredDirs; } });
|
|
27
|
+
Object.defineProperty(exports, "getPackageConfigPath", { enumerable: true, get: function () { return index_js_3.getPackageConfigPath; } });
|
|
28
|
+
Object.defineProperty(exports, "hasLocalConfig", { enumerable: true, get: function () { return index_js_3.hasLocalConfig; } });
|
|
29
29
|
// Standalone logging utility. Consumers instantiate their own Logger so their
|
|
30
30
|
// log level and buffer stay independent from pr-checkmate's internal logger.
|
|
31
|
-
var
|
|
32
|
-
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return
|
|
31
|
+
var logger_js_1 = require("./utils/logger.js");
|
|
32
|
+
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return logger_js_1.Logger; } });
|
|
@@ -10,9 +10,9 @@ exports.init = init;
|
|
|
10
10
|
const fs_1 = __importDefault(require("fs"));
|
|
11
11
|
const path_1 = __importDefault(require("path"));
|
|
12
12
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
13
|
+
const index_js_1 = require("./config/index.js");
|
|
14
|
+
const findings_js_1 = require("./core/checks/findings.js");
|
|
15
|
+
const index_js_2 = require("./utils/index.js");
|
|
16
16
|
const CONFIG_FILE = path_1.default.resolve(process.cwd(), 'pr-checkmate.json');
|
|
17
17
|
/**
|
|
18
18
|
* Points editors at the bundled JSON schema. With the generated config reduced
|
|
@@ -92,40 +92,52 @@ const ADVISORY_FLAG = ' continue-on-error: true';
|
|
|
92
92
|
* were just asked about.
|
|
93
93
|
*/
|
|
94
94
|
function setupWorkflow(root, mode) {
|
|
95
|
-
//
|
|
96
|
-
//
|
|
95
|
+
// We can't know for sure whether a repo will end up depending on the npm
|
|
96
|
+
// package by the time this workflow first runs (that's a decision the client
|
|
97
|
+
// makes after `init`, e.g. by running `npm install pr-checkmate`), so instead
|
|
98
|
+
// of guessing we scaffold both variants and let them keep the one that
|
|
99
|
+
// matches, deleting the other:
|
|
97
100
|
//
|
|
98
|
-
// -
|
|
99
|
-
// which is fast and reproducible;
|
|
100
|
-
// - no
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
// - the npm variant: `npx pr-checkmate` runs the copy the lockfile pins,
|
|
102
|
+
// which is fast and reproducible, but assumes the install happens;
|
|
103
|
+
// - the docker variant: works with no install, but `npx` (nothing to run
|
|
104
|
+
// locally) resolves to the newest release and downloads it on every job —
|
|
105
|
+
// 547 MB, about five minutes, and a major version can land without anyone
|
|
106
|
+
// changing a line.
|
|
107
|
+
const candidates = [
|
|
108
|
+
{ source: 'pr-checkmate-workflow.yml', dest: 'pr-checkmate.yml', label: 'npm package' },
|
|
109
|
+
{
|
|
110
|
+
source: 'pr-checkmate-workflow-docker.yml',
|
|
111
|
+
dest: 'pr-checkmate-docker.yml',
|
|
112
|
+
label: 'Docker image',
|
|
113
|
+
},
|
|
114
|
+
];
|
|
110
115
|
const workflowDir = path_1.default.join(root, '.github', 'workflows');
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
const recommended = installsPackage(root) ? candidates[0] : candidates[1];
|
|
117
|
+
for (const { source, dest, label } of candidates) {
|
|
118
|
+
const workflowSource = path_1.default.join(__dirname, 'config', source);
|
|
119
|
+
const workflowDest = path_1.default.join(workflowDir, dest);
|
|
120
|
+
if (!fs_1.default.existsSync(workflowSource)) {
|
|
121
|
+
index_js_2.logger.warn(`[init]: ⚠️ Workflow template ${source} not found, skipping`);
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (fs_1.default.existsSync(workflowDest)) {
|
|
125
|
+
index_js_2.logger.info(`[init]: ⏭️ .github/workflows/${dest} already exists — left untouched`);
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
if (!fs_1.default.existsSync(workflowDir)) {
|
|
129
|
+
fs_1.default.mkdirSync(workflowDir, { recursive: true });
|
|
130
|
+
}
|
|
131
|
+
const template = fs_1.default.readFileSync(workflowSource, 'utf-8').replace(/__IMAGE_TAG__/g, imageTag());
|
|
132
|
+
const workflow = mode === 'advisory'
|
|
133
|
+
? template.replace(RUN_STEP_ANCHOR, `${ADVISORY_NOTICE}\n${RUN_STEP_ANCHOR}\n${ADVISORY_FLAG}`)
|
|
134
|
+
: template;
|
|
135
|
+
fs_1.default.writeFileSync(workflowDest, workflow);
|
|
136
|
+
const recommendedNote = dest === recommended.dest ? ', recommended for this repo' : '';
|
|
137
|
+
index_js_2.logger.info(`[init]: ✅ Created .github/workflows/${dest} (${label}${recommendedNote})`);
|
|
122
138
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
? template.replace(RUN_STEP_ANCHOR, `${ADVISORY_NOTICE}\n${RUN_STEP_ANCHOR}\n${ADVISORY_FLAG}`)
|
|
126
|
-
: template;
|
|
127
|
-
fs_1.default.writeFileSync(workflowDest, workflow);
|
|
128
|
-
utils_1.logger.info(`[init]: ✅ Created .github/workflows/pr-checkmate.yml (${mode === 'strict' ? 'blocking' : 'advisory'})`);
|
|
139
|
+
index_js_2.logger.info('[init]: ℹ️ Both workflow variants were created — keep the one that fits and delete the other, ' +
|
|
140
|
+
'otherwise checks run twice on every PR.');
|
|
129
141
|
}
|
|
130
142
|
/**
|
|
131
143
|
* Whether this repository installs pr-checkmate rather than reaching for it on
|
|
@@ -152,7 +164,7 @@ function installsPackage(root) {
|
|
|
152
164
|
*/
|
|
153
165
|
function imageTag() {
|
|
154
166
|
try {
|
|
155
|
-
const manifest = path_1.default.resolve(__dirname, '..', 'package.json');
|
|
167
|
+
const manifest = path_1.default.join((0, index_js_2.findOwnPackageRoot)() ?? path_1.default.resolve(__dirname, '..'), 'package.json');
|
|
156
168
|
const version = JSON.parse(fs_1.default.readFileSync(manifest, 'utf-8')).version;
|
|
157
169
|
return version.split('.')[0] || 'latest';
|
|
158
170
|
}
|
|
@@ -185,7 +197,7 @@ function setupTsConfig(root, sourcePath) {
|
|
|
185
197
|
exclude: ['node_modules', 'dist'],
|
|
186
198
|
};
|
|
187
199
|
fs_1.default.writeFileSync(tsconfigPath, JSON.stringify(newTsConfig, null, 2));
|
|
188
|
-
|
|
200
|
+
index_js_2.logger.info('[init]: ✅ Created tsconfig.json using your sourcePath');
|
|
189
201
|
}
|
|
190
202
|
/**
|
|
191
203
|
* The file `init` writes for a new project — the client's decisions, nothing else.
|
|
@@ -255,14 +267,14 @@ const HOW_TO = [
|
|
|
255
267
|
'Make everything advisory while adopting: "severityDefaults": { "failOn": "warn" }',
|
|
256
268
|
'Skip a file or folder: "excludePaths": ["src/generated/**", "vendor/legacy.ts"]',
|
|
257
269
|
'Check names are the ones printed in the report.',
|
|
258
|
-
`Every option, annotated, with its default: ${
|
|
259
|
-
`Docs: ${
|
|
270
|
+
`Every option, annotated, with its default: ${index_js_1.FULL_CONFIG_URL}`,
|
|
271
|
+
`Docs: ${index_js_1.DOCS_URL}`,
|
|
260
272
|
].join(' ');
|
|
261
273
|
function buildInitialConfig(sourcePath, languages) {
|
|
262
274
|
return {
|
|
263
275
|
$schema: SCHEMA_PATH,
|
|
264
276
|
'// how-to': HOW_TO,
|
|
265
|
-
commands:
|
|
277
|
+
commands: index_js_1.DEFAULT_COMMANDS,
|
|
266
278
|
'// reporting': REPORTING_HINT,
|
|
267
279
|
sourcePath,
|
|
268
280
|
// Which checks can stop a merge — named, but NOT written as values.
|
|
@@ -298,11 +310,11 @@ function buildInitialConfig(sourcePath, languages) {
|
|
|
298
310
|
excludePaths: [],
|
|
299
311
|
// REPLACES the default. Copied out so the list is editable in place —
|
|
300
312
|
// note that ESLint does not read it; ESLint honours `eslint.ignorePatterns`.
|
|
301
|
-
ignoreDirs: [...
|
|
313
|
+
ignoreDirs: [...index_js_1.IGNORED_DIRS],
|
|
302
314
|
// Spelling: `words` and `ignorePaths` are both APPENDED to the bundled lists,
|
|
303
315
|
// so both stay empty. What the bundled list already skips is spelled out in
|
|
304
316
|
// the sibling comment rather than duplicated here.
|
|
305
|
-
'// cspell': `Already skipped by default: ${
|
|
317
|
+
'// cspell': `Already skipped by default: ${index_js_1.GENERATED_DOC_FILES.join(', ')}, test and mock paths, lockfiles, minified bundles, and every directory in "ignoreDirs". Anything listed below is ADDED to that.`,
|
|
306
318
|
cspell: { words: [], ignorePaths: [] },
|
|
307
319
|
// `max-len` is written out at its default rather than left implicit: it is
|
|
308
320
|
// the rule people hit first and tune first, and a line limit is a house
|
|
@@ -318,8 +330,8 @@ function buildInitialConfig(sourcePath, languages) {
|
|
|
318
330
|
// repeat their setup, the runner is the only consumer of what they export,
|
|
319
331
|
// and a security test's whole job may be to call the dangerous function.
|
|
320
332
|
// Delete an entry to have that check start reporting on tests again.
|
|
321
|
-
duplicate: { ignore: [...
|
|
322
|
-
deadCode: { ignoreFiles: [...
|
|
333
|
+
duplicate: { ignore: [...index_js_1.DUPLICATE_IGNORE_DEFAULTS] },
|
|
334
|
+
deadCode: { ignoreFiles: [...index_js_1.DEAD_CODE_IGNORE_DEFAULTS] },
|
|
323
335
|
// `dataflowWindow` is written out at its default for the same reason as
|
|
324
336
|
// `max-len`: it is a number people will want to change, and a number nobody
|
|
325
337
|
// can see is a number nobody can change. It is also the one finding in this
|
|
@@ -337,10 +349,10 @@ function buildInitialConfig(sourcePath, languages) {
|
|
|
337
349
|
'gate and does not want the heuristic blocking should set dataflowWindow to 0.',
|
|
338
350
|
].join(' '),
|
|
339
351
|
diffSecurity: {
|
|
340
|
-
dataflowWindow:
|
|
341
|
-
ignorePaths: [...
|
|
352
|
+
dataflowWindow: findings_js_1.DEFAULT_DATAFLOW_WINDOW,
|
|
353
|
+
ignorePaths: [...index_js_1.DIFF_SECURITY_IGNORE_DEFAULTS],
|
|
342
354
|
},
|
|
343
|
-
documentation:
|
|
355
|
+
documentation: index_js_1.documentation,
|
|
344
356
|
languages,
|
|
345
357
|
};
|
|
346
358
|
}
|
|
@@ -348,12 +360,12 @@ function buildInitialConfig(sourcePath, languages) {
|
|
|
348
360
|
async function createConfig(root) {
|
|
349
361
|
const sourcePath = await promptSourcePath();
|
|
350
362
|
const gateMode = await promptGateMode();
|
|
351
|
-
const languages = await (0,
|
|
352
|
-
|
|
363
|
+
const languages = await (0, index_js_2.detectLanguages)(root);
|
|
364
|
+
index_js_2.logger.info(`[init]: 🔍 Detected languages: ${languages.length ? languages.join(', ') : 'none'}`);
|
|
353
365
|
const config = buildInitialConfig(sourcePath, languages);
|
|
354
366
|
fs_1.default.writeFileSync(CONFIG_FILE, `${JSON.stringify(config, null, 2)}\n`);
|
|
355
|
-
|
|
356
|
-
|
|
367
|
+
index_js_2.logger.info(`[init]: ✅ Created pr-checkmate.json with sourcePath: ${sourcePath}`);
|
|
368
|
+
index_js_2.logger.info(`[init]: 💡 You can now customize ESLint rules, Prettier settings,
|
|
357
369
|
and cspell words in pr-checkmate.json`);
|
|
358
370
|
setupWorkflow(root, gateMode);
|
|
359
371
|
setupTsConfig(root, sourcePath);
|
|
@@ -366,7 +378,7 @@ async function createConfig(root) {
|
|
|
366
378
|
* now apply when the config is loaded, so there is nothing to top up.
|
|
367
379
|
*/
|
|
368
380
|
async function updateConfig(root) {
|
|
369
|
-
|
|
381
|
+
index_js_2.logger.info('[init]: pr-checkmate.json already exists — updating it.');
|
|
370
382
|
try {
|
|
371
383
|
const raw = fs_1.default.readFileSync(CONFIG_FILE, 'utf-8');
|
|
372
384
|
const json = JSON.parse(raw);
|
|
@@ -374,8 +386,8 @@ async function updateConfig(root) {
|
|
|
374
386
|
// tuned `detect` (or `ignoreDirs`) precisely because detection was wrong
|
|
375
387
|
// would otherwise get the wrong answer written back over the right one on
|
|
376
388
|
// the next `init`.
|
|
377
|
-
const languages = await (0,
|
|
378
|
-
|
|
389
|
+
const languages = await (0, index_js_2.detectLanguages)(root, json.ignoreDirs, json.detect);
|
|
390
|
+
index_js_2.logger.info(`[init]: 🔍 Detected languages: ${languages.length ? languages.join(', ') : 'none'}`);
|
|
379
391
|
// The client's file is left exactly as they wrote it. Defaults are no longer
|
|
380
392
|
// copied into it, because they never needed to be: they are merged in when
|
|
381
393
|
// the config is loaded, so a new default reaches every repository on upgrade
|
|
@@ -394,11 +406,11 @@ async function updateConfig(root) {
|
|
|
394
406
|
languages,
|
|
395
407
|
};
|
|
396
408
|
fs_1.default.writeFileSync(CONFIG_FILE, `${JSON.stringify(updated, null, 2)}\n`);
|
|
397
|
-
|
|
398
|
-
|
|
409
|
+
index_js_2.logger.info('[init]: 🔧 Refreshed the detected languages in pr-checkmate.json.');
|
|
410
|
+
index_js_2.logger.info(`[init]: 💡 Everything else is left as you wrote it — defaults apply on their own. Options: ${index_js_1.DOCS_URL}`);
|
|
399
411
|
}
|
|
400
412
|
catch (e) {
|
|
401
|
-
|
|
413
|
+
index_js_2.logger.error(`[init]: ❌ Failed to update pr-checkmate.json: ${e}`);
|
|
402
414
|
}
|
|
403
415
|
}
|
|
404
416
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Language } from '../utils/detect-language';
|
|
1
|
+
import type { Language } from '../utils/detect-language.js';
|
|
2
2
|
export interface ConfigFile {
|
|
3
3
|
source: string;
|
|
4
4
|
dest: string;
|
|
@@ -428,5 +428,5 @@ export interface PRCheckMateConfig {
|
|
|
428
428
|
allowLicenses?: string[];
|
|
429
429
|
};
|
|
430
430
|
}
|
|
431
|
-
export type { CheckStatus, CheckResult } from '../utils/result-collector';
|
|
432
|
-
export type { Language } from '../utils/detect-language';
|
|
431
|
+
export type { CheckStatus, CheckResult } from '../utils/result-collector.js';
|
|
432
|
+
export type { Language } from '../utils/detect-language.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
7
7
|
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
-
const
|
|
8
|
+
const index_js_1 = require("../utils/index.js");
|
|
9
9
|
const configFiles = [
|
|
10
10
|
// Source is named so ESLint's auto-discovery does NOT treat it as a nested
|
|
11
11
|
// config for files under src/config/ — it ships to the package root as the
|
|
@@ -16,10 +16,25 @@ const configFiles = [
|
|
|
16
16
|
{ source: 'src/config/.prettierrc', dest: '.prettierrc' },
|
|
17
17
|
{ source: 'src/config/cspell.json', dest: 'cspell.json' },
|
|
18
18
|
{ source: 'tsconfig.json', dest: 'tsconfig.json' },
|
|
19
|
-
|
|
19
|
+
// `init.ts` reads these as a sibling of its own compiled location
|
|
20
|
+
// (`__dirname/config/...`), which means they must exist under both build
|
|
21
|
+
// outputs — dist/cjs and dist/esm are no longer siblings of a single
|
|
22
|
+
// shared dist/config the way the old flat dist/ layout was.
|
|
23
|
+
{
|
|
24
|
+
source: 'src/config/pr-checkmate-workflow.yml',
|
|
25
|
+
dest: 'dist/cjs/config/pr-checkmate-workflow.yml',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
source: 'src/config/pr-checkmate-workflow.yml',
|
|
29
|
+
dest: 'dist/esm/config/pr-checkmate-workflow.yml',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
source: 'src/config/pr-checkmate-workflow-docker.yml',
|
|
33
|
+
dest: 'dist/cjs/config/pr-checkmate-workflow-docker.yml',
|
|
34
|
+
},
|
|
20
35
|
{
|
|
21
36
|
source: 'src/config/pr-checkmate-workflow-docker.yml',
|
|
22
|
-
dest: 'dist/config/pr-checkmate-workflow-docker.yml',
|
|
37
|
+
dest: 'dist/esm/config/pr-checkmate-workflow-docker.yml',
|
|
23
38
|
},
|
|
24
39
|
{ source: 'src/config/pr-checkmate.schema.json', dest: 'pr-checkmate.schema.json' },
|
|
25
40
|
];
|
|
@@ -28,12 +43,12 @@ const configFiles = [
|
|
|
28
43
|
*/
|
|
29
44
|
function copyConfigs() {
|
|
30
45
|
const root = node_path_1.default.resolve(__dirname, '../..');
|
|
31
|
-
|
|
46
|
+
index_js_1.logger.log('[copyConfigs]: Copying config files to package root...\n');
|
|
32
47
|
configFiles.forEach(({ source, dest }) => {
|
|
33
48
|
const srcPath = node_path_1.default.join(root, source);
|
|
34
49
|
const destPath = node_path_1.default.join(root, dest);
|
|
35
50
|
if (!node_fs_1.default.existsSync(srcPath)) {
|
|
36
|
-
|
|
51
|
+
index_js_1.logger.warn(`[copyConfigs]: ⚠️ Source not found: ${source}`);
|
|
37
52
|
return;
|
|
38
53
|
}
|
|
39
54
|
// Create destination directory if it doesn't exist
|
|
@@ -42,9 +57,9 @@ function copyConfigs() {
|
|
|
42
57
|
node_fs_1.default.mkdirSync(destDir, { recursive: true });
|
|
43
58
|
}
|
|
44
59
|
node_fs_1.default.copyFileSync(srcPath, destPath);
|
|
45
|
-
|
|
60
|
+
index_js_1.logger.log(`[copyConfigs]: ✅ Copied ${dest}`);
|
|
46
61
|
});
|
|
47
|
-
|
|
62
|
+
index_js_1.logger.info('\n[copyConfigs]: ✨ Configs successfully copied to root!\n');
|
|
48
63
|
}
|
|
49
64
|
if (require.main === module) {
|
|
50
65
|
copyConfigs();
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.buildManifest = buildManifest;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
-
const
|
|
9
|
+
const profiles_js_1 = require("../core/install/profiles.js");
|
|
10
10
|
/**
|
|
11
11
|
* Find the entry npm would resolve `name` to from inside `fromPath`.
|
|
12
12
|
*
|
|
@@ -107,7 +107,7 @@ function main() {
|
|
|
107
107
|
const manifest = JSON.parse(node_fs_1.default.readFileSync(node_path_1.default.join(root, 'package.json'), 'utf-8'));
|
|
108
108
|
const outDir = node_path_1.default.join(root, 'install-manifests');
|
|
109
109
|
node_fs_1.default.rmSync(outDir, { recursive: true, force: true });
|
|
110
|
-
for (const profile of
|
|
110
|
+
for (const profile of profiles_js_1.PROFILES) {
|
|
111
111
|
const { pkg, lockfile } = buildManifest(lock, profile.name, profile.packages, manifest.overrides);
|
|
112
112
|
const dir = node_path_1.default.join(outDir, profile.name);
|
|
113
113
|
node_fs_1.default.mkdirSync(dir, { recursive: true });
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const child_process_1 = require("child_process");
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const
|
|
9
|
+
const index_js_1 = require("../utils/index.js");
|
|
10
10
|
function publishToGithub() {
|
|
11
11
|
const root = process.cwd();
|
|
12
12
|
const pkgPath = path_1.default.join(root, 'package.json');
|
|
@@ -29,10 +29,10 @@ function publishToGithub() {
|
|
|
29
29
|
fs_1.default.renameSync(pkgPath, backupPath);
|
|
30
30
|
fs_1.default.renameSync(tempPath, pkgPath);
|
|
31
31
|
(0, child_process_1.execSync)('npm publish --registry=https://npm.pkg.github.com', { stdio: 'inherit' });
|
|
32
|
-
|
|
32
|
+
index_js_1.logger.log('[publishToGithub]: ✅ Published to GitHub Packages');
|
|
33
33
|
}
|
|
34
34
|
catch (err) {
|
|
35
|
-
|
|
35
|
+
index_js_1.logger.error(`[publishToGithub]: ${err}`);
|
|
36
36
|
}
|
|
37
37
|
finally {
|
|
38
38
|
// The backup only exists if the first rename succeeded; restoring is
|
|
@@ -42,7 +42,7 @@ function publishToGithub() {
|
|
|
42
42
|
fs_1.default.renameSync(backupPath, pkgPath);
|
|
43
43
|
}
|
|
44
44
|
catch (err) {
|
|
45
|
-
|
|
45
|
+
index_js_1.logger.error(`[publishToGithub]: could not restore package.json: ${err}`);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -7,10 +7,10 @@ exports.detectLanguageUsage = detectLanguageUsage;
|
|
|
7
7
|
exports.detectLanguages = detectLanguages;
|
|
8
8
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
10
|
+
const constants_js_1 = require("../config/constants.js");
|
|
11
|
+
const execa_js_1 = require("./execa.js");
|
|
12
|
+
const glob_js_1 = require("./glob.js");
|
|
13
|
+
const logger_js_1 = require("./logger.js");
|
|
14
14
|
/**
|
|
15
15
|
* Marker files that unambiguously indicate a language's presence, independent of
|
|
16
16
|
* how many source files are tracked. Presence of any marker forces detection even
|
|
@@ -98,7 +98,7 @@ function hasMarker(root, lang) {
|
|
|
98
98
|
return node_fs_1.default.existsSync(node_path_1.default.join(root, name));
|
|
99
99
|
// Glob marker (e.g. `*.csproj`): match against root-directory entries.
|
|
100
100
|
try {
|
|
101
|
-
const re = (0,
|
|
101
|
+
const re = (0, glob_js_1.globToRegExp)(name);
|
|
102
102
|
return node_fs_1.default.readdirSync(root).some(entry => re.test(entry));
|
|
103
103
|
}
|
|
104
104
|
catch {
|
|
@@ -154,7 +154,7 @@ async function countTrackedFiles(root, ignoreDirs, excludePaths) {
|
|
|
154
154
|
php: 0,
|
|
155
155
|
};
|
|
156
156
|
try {
|
|
157
|
-
const { stdout } = await (0,
|
|
157
|
+
const { stdout } = await (0, execa_js_1.execa)('git', ['ls-files'], { cwd: root });
|
|
158
158
|
const files = stdout.split('\n').map(f => f.trim());
|
|
159
159
|
const ignored = new Set(ignoreDirs);
|
|
160
160
|
const markers = markerFilenames();
|
|
@@ -167,10 +167,10 @@ async function countTrackedFiles(root, ignoreDirs, excludePaths) {
|
|
|
167
167
|
// languages absent from the source. Detection has to describe the repo's own
|
|
168
168
|
// code, since it decides which checks run at all — the same exclusion every
|
|
169
169
|
// check's file list already applies via `excludeIgnoredDirs`.
|
|
170
|
-
if ((0,
|
|
170
|
+
if ((0, glob_js_1.isUnderIgnoredDir)(file, ignored))
|
|
171
171
|
continue;
|
|
172
172
|
// Generated reports and vendored bootstrap scripts are not the repo's code.
|
|
173
|
-
if ((0,
|
|
173
|
+
if ((0, glob_js_1.matchesAnyGlob)(file, excludePaths))
|
|
174
174
|
continue;
|
|
175
175
|
// A manifest that happens to be source-shaped (`Package.swift`) declares a
|
|
176
176
|
// language; it is not a line of it.
|
|
@@ -182,7 +182,7 @@ async function countTrackedFiles(root, ignoreDirs, excludePaths) {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
catch {
|
|
185
|
-
|
|
185
|
+
logger_js_1.logger.debug('[detectLanguages]: git ls-files unavailable, using marker files only');
|
|
186
186
|
}
|
|
187
187
|
return counts;
|
|
188
188
|
}
|
|
@@ -209,7 +209,7 @@ async function countTrackedFiles(root, ignoreDirs, excludePaths) {
|
|
|
209
209
|
* @returns languages ordered by tracked file count (most-used first). `.h` headers
|
|
210
210
|
* are intentionally excluded from the C++ count since they are ambiguous with C.
|
|
211
211
|
*/
|
|
212
|
-
async function detectLanguageUsage(root = process.cwd(), ignoreDirs =
|
|
212
|
+
async function detectLanguageUsage(root = process.cwd(), ignoreDirs = constants_js_1.IGNORED_DIRS, detect = {}) {
|
|
213
213
|
const excludePaths = [...DEFAULT_DETECT_EXCLUDES, ...(detect.excludePaths ?? [])];
|
|
214
214
|
const counts = await countTrackedFiles(root, ignoreDirs, excludePaths);
|
|
215
215
|
// 1 by default: with the causes of the false positives fixed above, a single
|
|
@@ -228,7 +228,7 @@ async function detectLanguageUsage(root = process.cwd(), ignoreDirs = constants_
|
|
|
228
228
|
detected.sort((a, b) => b.files - a.files);
|
|
229
229
|
const countStr = Object.keys(counts).map(l => `${l}=${counts[l]}`).join(', ');
|
|
230
230
|
const names = detected.map(u => u.lang).join(', ');
|
|
231
|
-
|
|
231
|
+
logger_js_1.logger.info(`[detectLanguages]: Detected ${names || 'none'} (counts: ${countStr})`);
|
|
232
232
|
return detected;
|
|
233
233
|
}
|
|
234
234
|
/**
|
|
@@ -236,6 +236,6 @@ async function detectLanguageUsage(root = process.cwd(), ignoreDirs = constants_
|
|
|
236
236
|
* should run". See {@link detectLanguageUsage} when the file counts matter, as
|
|
237
237
|
* they do for deciding what to download.
|
|
238
238
|
*/
|
|
239
|
-
async function detectLanguages(root = process.cwd(), ignoreDirs =
|
|
239
|
+
async function detectLanguages(root = process.cwd(), ignoreDirs = constants_js_1.IGNORED_DIRS, detect = {}) {
|
|
240
240
|
return (await detectLanguageUsage(root, ignoreDirs, detect)).map(u => u.lang);
|
|
241
241
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveGitRef = resolveGitRef;
|
|
4
|
-
const
|
|
4
|
+
const execa_js_1 = require("./execa.js");
|
|
5
5
|
/**
|
|
6
6
|
* Resolve a git ref to a concrete commit SHA, or `undefined` when this clone
|
|
7
7
|
* cannot resolve it.
|
|
@@ -16,7 +16,7 @@ const execa_1 = require("./execa");
|
|
|
16
16
|
* missing base means "review everything", never "review nothing".
|
|
17
17
|
*/
|
|
18
18
|
async function resolveGitRef(cwd, ref) {
|
|
19
|
-
const { stdout } = await (0,
|
|
19
|
+
const { stdout } = await (0, execa_js_1.execa)('git', ['rev-parse', '--verify', '--quiet', `${ref}^{commit}`], {
|
|
20
20
|
cwd,
|
|
21
21
|
reject: false,
|
|
22
22
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.request = request;
|
|
4
4
|
exports.paginate = paginate;
|
|
5
|
-
const
|
|
5
|
+
const logger_js_1 = require("./logger.js");
|
|
6
6
|
const DEFAULT_TIMEOUT_MS = 10000;
|
|
7
7
|
const DEFAULT_RETRIES = 3;
|
|
8
8
|
/** 5xx and 429 are worth another attempt; a 4xx will fail identically forever. */
|
|
@@ -60,7 +60,7 @@ async function request(url, init = {}, opts = {}) {
|
|
|
60
60
|
if (attempt < attempts) {
|
|
61
61
|
// Exponential backoff, capped so three attempts stay well inside a CI step.
|
|
62
62
|
const waitMs = Math.min(2000, 250 * 2 ** (attempt - 1));
|
|
63
|
-
|
|
63
|
+
logger_js_1.logger.warn(`${label}retrying after ${last.error} (attempt ${attempt}/${attempts})`);
|
|
64
64
|
await new Promise(resolve => setTimeout(resolve, waitMs));
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './logger.js';
|
|
2
|
+
export * from './result-collector.js';
|
|
3
|
+
export * from './resolve-bin.js';
|
|
4
|
+
export * from './own-deps.js';
|
|
5
|
+
export * from './direct-deps.js';
|
|
6
|
+
export * from './detect-language.js';
|
|
7
|
+
export * from './glob.js';
|
|
8
|
+
export * from './update-notifier.js';
|
|
9
|
+
export * from './package-version.js';
|
|
10
|
+
export * from './ci.js';
|
|
11
|
+
export * from './git.js';
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export declare function cleanupTempFile(filePath: string): void;
|
|
@@ -19,18 +19,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.cleanupTempFile = cleanupTempFile;
|
|
21
21
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
22
|
-
const
|
|
23
|
-
__exportStar(require("./logger"), exports);
|
|
24
|
-
__exportStar(require("./result-collector"), exports);
|
|
25
|
-
__exportStar(require("./resolve-bin"), exports);
|
|
26
|
-
__exportStar(require("./own-deps"), exports);
|
|
27
|
-
__exportStar(require("./direct-deps"), exports);
|
|
28
|
-
__exportStar(require("./detect-language"), exports);
|
|
29
|
-
__exportStar(require("./glob"), exports);
|
|
30
|
-
__exportStar(require("./update-notifier"), exports);
|
|
31
|
-
__exportStar(require("./package-version"), exports);
|
|
32
|
-
__exportStar(require("./ci"), exports);
|
|
33
|
-
__exportStar(require("./git"), exports);
|
|
22
|
+
const logger_js_1 = require("./logger.js");
|
|
23
|
+
__exportStar(require("./logger.js"), exports);
|
|
24
|
+
__exportStar(require("./result-collector.js"), exports);
|
|
25
|
+
__exportStar(require("./resolve-bin.js"), exports);
|
|
26
|
+
__exportStar(require("./own-deps.js"), exports);
|
|
27
|
+
__exportStar(require("./direct-deps.js"), exports);
|
|
28
|
+
__exportStar(require("./detect-language.js"), exports);
|
|
29
|
+
__exportStar(require("./glob.js"), exports);
|
|
30
|
+
__exportStar(require("./update-notifier.js"), exports);
|
|
31
|
+
__exportStar(require("./package-version.js"), exports);
|
|
32
|
+
__exportStar(require("./ci.js"), exports);
|
|
33
|
+
__exportStar(require("./git.js"), exports);
|
|
34
34
|
/**
|
|
35
35
|
*
|
|
36
36
|
*/
|
|
@@ -41,6 +41,6 @@ function cleanupTempFile(filePath) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
catch (err) {
|
|
44
|
-
|
|
44
|
+
logger_js_1.logger.warn(`[cleanupTempFile]: ⚠️ Failed cleanup: ${filePath}\n${err}`);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** Walk up from this module until we find pr-checkmate's own package root. */
|
|
2
|
+
export declare function findOwnPackageRoot(): string | null;
|
|
1
3
|
/**
|
|
2
4
|
* Compute the full set of package names in pr-checkmate's own dependency
|
|
3
5
|
* closure (direct + transitive runtime dependencies), plus pr-checkmate itself.
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.findOwnPackageRoot = findOwnPackageRoot;
|
|
6
7
|
exports.getOwnDependencyClosure = getOwnDependencyClosure;
|
|
7
8
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
@@ -7,6 +7,7 @@ exports.packageVersion = packageVersion;
|
|
|
7
7
|
exports.packageName = packageName;
|
|
8
8
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
+
const own_deps_js_1 = require("./own-deps.js");
|
|
10
11
|
/**
|
|
11
12
|
* Our own name and version, read from the manifest that ships inside the package.
|
|
12
13
|
*
|
|
@@ -23,7 +24,7 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
23
24
|
*/
|
|
24
25
|
function readManifest() {
|
|
25
26
|
try {
|
|
26
|
-
const manifest = node_path_1.default.resolve(__dirname, '
|
|
27
|
+
const manifest = node_path_1.default.join((0, own_deps_js_1.findOwnPackageRoot)() ?? node_path_1.default.resolve(__dirname, '../../..'), 'package.json');
|
|
27
28
|
const parsed = JSON.parse(node_fs_1.default.readFileSync(manifest, 'utf-8'));
|
|
28
29
|
return { name: parsed.name ?? 'pr-checkmate', version: parsed.version ?? '0.0.0' };
|
|
29
30
|
}
|
|
@@ -11,6 +11,7 @@ exports.resolveTool = resolveTool;
|
|
|
11
11
|
exports.resolvePackageBin = resolvePackageBin;
|
|
12
12
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
13
13
|
const node_path_1 = __importDefault(require("node:path"));
|
|
14
|
+
const own_deps_js_1 = require("./own-deps.js");
|
|
14
15
|
/**
|
|
15
16
|
* Extra roots to search, registered once per run by the install layer.
|
|
16
17
|
*
|
|
@@ -38,7 +39,7 @@ function clearToolPaths() {
|
|
|
38
39
|
}
|
|
39
40
|
/** The root of the installed pr-checkmate package — where our own tooling lives. */
|
|
40
41
|
function ownPackageRoot() {
|
|
41
|
-
return node_path_1.default.resolve(__dirname, '
|
|
42
|
+
return (0, own_deps_js_1.findOwnPackageRoot)() ?? node_path_1.default.resolve(__dirname, '../../..');
|
|
42
43
|
}
|
|
43
44
|
/**
|
|
44
45
|
* Whether a package is physically present in our own dependency tree.
|