@mnaoumov/typescript-dev-toolkit 0.0.0 → 1.0.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/LICENSE +21 -0
- package/README.md +15 -1
- package/bundlers/esbuild-impl/change-extension-plugin/package.json +6 -0
- package/bundlers/esbuild-impl/custom-esbuild-options-plugin/package.json +6 -0
- package/bundlers/esbuild-impl/fix-esm-plugin/package.json +6 -0
- package/bundlers/esbuild-impl/index/package.json +6 -0
- package/bundlers/esbuild-impl/package.json +6 -0
- package/bundlers/esbuild-impl/preprocess-plugin/package.json +6 -0
- package/bundlers/esbuild-impl/svelte-wrapper-plugin/package.json +6 -0
- package/bundlers/index/package.json +6 -0
- package/bundlers/package.json +6 -0
- package/dist/lib/cjs/build.cjs +191 -0
- package/dist/lib/cjs/build.d.cts +59 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/change-extension-plugin.cjs +139 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/change-extension-plugin.d.cts +25 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/custom-esbuild-options-plugin.cjs +96 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/custom-esbuild-options-plugin.d.cts +14 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/fix-esm-plugin.cjs +106 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/fix-esm-plugin.d.cts +13 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/index.cjs +111 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/index.d.cts +6 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/preprocess-plugin.cjs +211 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/preprocess-plugin.d.cts +143 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/svelte-wrapper-plugin.cjs +129 -0
- package/dist/lib/cjs/bundlers/esbuild-impl/svelte-wrapper-plugin.d.cts +14 -0
- package/dist/lib/cjs/bundlers/index.cjs +99 -0
- package/dist/lib/cjs/bundlers/index.d.cts +2 -0
- package/dist/lib/cjs/check-project-types.cjs +163 -0
- package/dist/lib/cjs/check-project-types.d.cts +92 -0
- package/dist/lib/cjs/cli-utils.cjs +276 -0
- package/dist/lib/cjs/cli-utils.d.cts +123 -0
- package/dist/lib/cjs/code-generator.cjs +96 -0
- package/dist/lib/cjs/code-generator.d.cts +14 -0
- package/dist/lib/cjs/commitlint-config.cjs +110 -0
- package/dist/lib/cjs/commitlint-config.d.cts +14 -0
- package/dist/lib/cjs/commitlint-forbidden-patterns.cjs +110 -0
- package/dist/lib/cjs/commitlint-forbidden-patterns.d.cts +37 -0
- package/dist/lib/cjs/commitlint-spellcheck-header.cjs +126 -0
- package/dist/lib/cjs/commitlint-spellcheck-header.d.cts +40 -0
- package/dist/lib/cjs/env-toggle.cjs +133 -0
- package/dist/lib/cjs/env-toggle.d.cts +42 -0
- package/dist/lib/cjs/exec.cjs +455 -0
- package/dist/lib/cjs/exec.d.cts +162 -0
- package/dist/lib/cjs/forbidden-patterns.cjs +157 -0
- package/dist/lib/cjs/forbidden-patterns.d.cts +57 -0
- package/dist/lib/cjs/formatters/dprint.cjs +108 -0
- package/dist/lib/cjs/formatters/dprint.d.cts +33 -0
- package/dist/lib/cjs/formatters/index.cjs +99 -0
- package/dist/lib/cjs/formatters/index.d.cts +2 -0
- package/dist/lib/cjs/fs.cjs +123 -0
- package/dist/lib/cjs/fs.d.cts +80 -0
- package/dist/lib/cjs/gate.cjs +140 -0
- package/dist/lib/cjs/gate.d.cts +93 -0
- package/dist/lib/cjs/git.cjs +109 -0
- package/dist/lib/cjs/git.d.cts +37 -0
- package/dist/lib/cjs/index.cjs +186 -0
- package/dist/lib/cjs/index.d.cts +35 -0
- package/dist/lib/cjs/json.cjs +141 -0
- package/dist/lib/cjs/json.d.cts +102 -0
- package/dist/lib/cjs/library-build.cjs +475 -0
- package/dist/lib/cjs/library-build.d.cts +97 -0
- package/dist/lib/cjs/linters/cspell-content.cjs +124 -0
- package/dist/lib/cjs/linters/cspell-content.d.cts +46 -0
- package/dist/lib/cjs/linters/cspell.cjs +103 -0
- package/dist/lib/cjs/linters/cspell.d.cts +36 -0
- package/dist/lib/cjs/linters/eslint-agnostic-core-boundary.cjs +94 -0
- package/dist/lib/cjs/linters/eslint-agnostic-core-boundary.d.cts +49 -0
- package/dist/lib/cjs/linters/eslint-config.cjs +1068 -0
- package/dist/lib/cjs/linters/eslint-config.d.cts +123 -0
- package/dist/lib/cjs/linters/eslint-no-restricted-syntax.cjs +130 -0
- package/dist/lib/cjs/linters/eslint-no-restricted-syntax.d.cts +27 -0
- package/dist/lib/cjs/linters/eslint-rules/in-house-plugin.cjs +116 -0
- package/dist/lib/cjs/linters/eslint-rules/in-house-plugin.d.cts +26 -0
- package/dist/lib/cjs/linters/eslint-rules/index.cjs +132 -0
- package/dist/lib/cjs/linters/eslint-rules/index.d.cts +13 -0
- package/dist/lib/cjs/linters/eslint-rules/no-async-callback-to-unsafe-return.cjs +175 -0
- package/dist/lib/cjs/linters/eslint-rules/no-async-callback-to-unsafe-return.d.cts +10 -0
- package/dist/lib/cjs/linters/eslint-rules/no-unresolved-jsdoc-link.cjs +290 -0
- package/dist/lib/cjs/linters/eslint-rules/no-unresolved-jsdoc-link.d.cts +10 -0
- package/dist/lib/cjs/linters/eslint-rules/no-unused-params-members.cjs +265 -0
- package/dist/lib/cjs/linters/eslint-rules/no-unused-params-members.d.cts +41 -0
- package/dist/lib/cjs/linters/eslint-rules/no-used-underscore-variables.cjs +134 -0
- package/dist/lib/cjs/linters/eslint-rules/no-used-underscore-variables.d.cts +20 -0
- package/dist/lib/cjs/linters/eslint-rules/params-options-name-match.cjs +217 -0
- package/dist/lib/cjs/linters/eslint-rules/params-options-name-match.d.cts +36 -0
- package/dist/lib/cjs/linters/eslint-rules/prefer-noop-async.cjs +126 -0
- package/dist/lib/cjs/linters/eslint-rules/prefer-noop-async.d.cts +10 -0
- package/dist/lib/cjs/linters/eslint-rules/readonly-params-options-result-members.cjs +125 -0
- package/dist/lib/cjs/linters/eslint-rules/readonly-params-options-result-members.d.cts +20 -0
- package/dist/lib/cjs/linters/eslint-rules/require-method-template.cjs +181 -0
- package/dist/lib/cjs/linters/eslint-rules/require-method-template.d.cts +14 -0
- package/dist/lib/cjs/linters/eslint-rules/require-super-call.cjs +217 -0
- package/dist/lib/cjs/linters/eslint-rules/require-super-call.d.cts +10 -0
- package/dist/lib/cjs/linters/eslint-rules/rule-tester-helper.cjs +92 -0
- package/dist/lib/cjs/linters/eslint-rules/rule-tester-helper.d.cts +18 -0
- package/dist/lib/cjs/linters/eslint-rules/ts-estree-node.cjs +92 -0
- package/dist/lib/cjs/linters/eslint-rules/ts-estree-node.d.cts +23 -0
- package/dist/lib/cjs/linters/eslint-types/@types/@eslint-community__eslint-plugin-eslint-comments__configs.d.cts +20 -0
- package/dist/lib/cjs/linters/eslint-types/@types/eslint-plugin-verify-tsdoc.d.cts +17 -0
- package/dist/lib/cjs/linters/eslint.cjs +122 -0
- package/dist/lib/cjs/linters/eslint.d.cts +35 -0
- package/dist/lib/cjs/linters/index.cjs +138 -0
- package/dist/lib/cjs/linters/index.d.cts +15 -0
- package/dist/lib/cjs/linters/lint-ignores.cjs +91 -0
- package/dist/lib/cjs/linters/lint-ignores.d.cts +30 -0
- package/dist/lib/cjs/linters/markdownlint-cli2-config.cjs +169 -0
- package/dist/lib/cjs/linters/markdownlint-cli2-config.d.cts +11 -0
- package/dist/lib/cjs/linters/markdownlint-content.cjs +120 -0
- package/dist/lib/cjs/linters/markdownlint-content.d.cts +47 -0
- package/dist/lib/cjs/linters/markdownlint-ignores.cjs +95 -0
- package/dist/lib/cjs/linters/markdownlint-ignores.d.cts +35 -0
- package/dist/lib/cjs/linters/markdownlint-rules/index.cjs +99 -0
- package/dist/lib/cjs/linters/markdownlint-rules/index.d.cts +2 -0
- package/dist/lib/cjs/linters/markdownlint-rules/no-soft-break-in-paragraph.cjs +152 -0
- package/dist/lib/cjs/linters/markdownlint-rules/no-soft-break-in-paragraph.d.cts +35 -0
- package/dist/lib/cjs/linters/markdownlint-types/@types/markdownlint-cli2-config-schema.d.cts +1344 -0
- package/dist/lib/cjs/linters/markdownlint-types/@types/markdownlint-cli2.d.cts +67 -0
- package/dist/lib/cjs/linters/markdownlint.cjs +151 -0
- package/dist/lib/cjs/linters/markdownlint.d.cts +32 -0
- package/dist/lib/cjs/linters/over-exposure.cjs +685 -0
- package/dist/lib/cjs/linters/over-exposure.d.cts +357 -0
- package/dist/lib/cjs/nano-staged-config.cjs +148 -0
- package/dist/lib/cjs/nano-staged-config.d.cts +54 -0
- package/dist/lib/cjs/npm-publish.cjs +93 -0
- package/dist/lib/cjs/npm-publish.d.cts +19 -0
- package/dist/lib/cjs/npm-run.cjs +120 -0
- package/dist/lib/cjs/npm-run.d.cts +34 -0
- package/dist/lib/cjs/npm.cjs +200 -0
- package/dist/lib/cjs/npm.d.cts +168 -0
- package/dist/lib/cjs/package-lock-integrity.cjs +134 -0
- package/dist/lib/cjs/package-lock-integrity.d.cts +38 -0
- package/dist/lib/cjs/package-manager.cjs +291 -0
- package/dist/lib/cjs/package-manager.d.cts +93 -0
- package/dist/lib/cjs/released-issues.cjs +178 -0
- package/dist/lib/cjs/released-issues.d.cts +79 -0
- package/dist/lib/cjs/repo-paths.cjs +167 -0
- package/dist/lib/cjs/repo-paths.d.cts +318 -0
- package/dist/lib/cjs/root.cjs +150 -0
- package/dist/lib/cjs/root.d.cts +107 -0
- package/dist/lib/cjs/test-runners/index.cjs +102 -0
- package/dist/lib/cjs/test-runners/index.d.cts +3 -0
- package/dist/lib/cjs/test-runners/vitest-config.cjs +126 -0
- package/dist/lib/cjs/test-runners/vitest-config.d.cts +90 -0
- package/dist/lib/cjs/test-runners/vitest.cjs +115 -0
- package/dist/lib/cjs/test-runners/vitest.d.cts +52 -0
- package/dist/lib/cjs/validate-declarations.cjs +120 -0
- package/dist/lib/cjs/validate-declarations.d.cts +37 -0
- package/dist/lib/cjs/version.cjs +758 -0
- package/dist/lib/cjs/version.d.cts +418 -0
- package/dist/lib/esm/build.d.mts +59 -0
- package/dist/lib/esm/build.mjs +165 -0
- package/dist/lib/esm/bundlers/esbuild-impl/change-extension-plugin.d.mts +25 -0
- package/dist/lib/esm/bundlers/esbuild-impl/change-extension-plugin.mjs +101 -0
- package/dist/lib/esm/bundlers/esbuild-impl/custom-esbuild-options-plugin.d.mts +14 -0
- package/dist/lib/esm/bundlers/esbuild-impl/custom-esbuild-options-plugin.mjs +59 -0
- package/dist/lib/esm/bundlers/esbuild-impl/fix-esm-plugin.d.mts +13 -0
- package/dist/lib/esm/bundlers/esbuild-impl/fix-esm-plugin.mjs +69 -0
- package/dist/lib/esm/bundlers/esbuild-impl/index.d.mts +6 -0
- package/dist/lib/esm/bundlers/esbuild-impl/index.mjs +60 -0
- package/dist/lib/esm/bundlers/esbuild-impl/preprocess-plugin.d.mts +143 -0
- package/dist/lib/esm/bundlers/esbuild-impl/preprocess-plugin.mjs +176 -0
- package/dist/lib/esm/bundlers/esbuild-impl/svelte-wrapper-plugin.d.mts +14 -0
- package/dist/lib/esm/bundlers/esbuild-impl/svelte-wrapper-plugin.mjs +82 -0
- package/dist/lib/esm/bundlers/index.d.mts +2 -0
- package/dist/lib/esm/bundlers/index.mjs +52 -0
- package/dist/lib/esm/check-project-types.d.mts +92 -0
- package/dist/lib/esm/check-project-types.mjs +123 -0
- package/dist/lib/esm/cli-utils.d.mts +123 -0
- package/dist/lib/esm/cli-utils.mjs +225 -0
- package/dist/lib/esm/code-generator.d.mts +14 -0
- package/dist/lib/esm/code-generator.mjs +59 -0
- package/dist/lib/esm/commitlint-config.d.mts +14 -0
- package/dist/lib/esm/commitlint-config.mjs +79 -0
- package/dist/lib/esm/commitlint-forbidden-patterns.d.mts +37 -0
- package/dist/lib/esm/commitlint-forbidden-patterns.mjs +75 -0
- package/dist/lib/esm/commitlint-spellcheck-header.d.mts +40 -0
- package/dist/lib/esm/commitlint-spellcheck-header.mjs +87 -0
- package/dist/lib/esm/env-toggle.d.mts +42 -0
- package/dist/lib/esm/env-toggle.mjs +84 -0
- package/dist/lib/esm/exec.d.mts +162 -0
- package/dist/lib/esm/exec.mjs +410 -0
- package/dist/lib/esm/forbidden-patterns.d.mts +57 -0
- package/dist/lib/esm/forbidden-patterns.mjs +108 -0
- package/dist/lib/esm/formatters/dprint.d.mts +33 -0
- package/dist/lib/esm/formatters/dprint.mjs +75 -0
- package/dist/lib/esm/formatters/index.d.mts +2 -0
- package/dist/lib/esm/formatters/index.mjs +52 -0
- package/dist/lib/esm/fs.d.mts +80 -0
- package/dist/lib/esm/fs.mjs +89 -0
- package/dist/lib/esm/gate.d.mts +93 -0
- package/dist/lib/esm/gate.mjs +106 -0
- package/dist/lib/esm/git.d.mts +37 -0
- package/dist/lib/esm/git.mjs +72 -0
- package/dist/lib/esm/index.d.mts +35 -0
- package/dist/lib/esm/index.mjs +110 -0
- package/dist/lib/esm/json.d.mts +102 -0
- package/dist/lib/esm/json.mjs +106 -0
- package/dist/lib/esm/library-build.d.mts +97 -0
- package/dist/lib/esm/library-build.mjs +435 -0
- package/dist/lib/esm/linters/cspell-content.d.mts +46 -0
- package/dist/lib/esm/linters/cspell-content.mjs +87 -0
- package/dist/lib/esm/linters/cspell.d.mts +36 -0
- package/dist/lib/esm/linters/cspell.mjs +69 -0
- package/dist/lib/esm/linters/eslint-agnostic-core-boundary.d.mts +49 -0
- package/dist/lib/esm/linters/eslint-agnostic-core-boundary.mjs +57 -0
- package/dist/lib/esm/linters/eslint-config.d.mts +123 -0
- package/dist/lib/esm/linters/eslint-config.mjs +1022 -0
- package/dist/lib/esm/linters/eslint-no-restricted-syntax.d.mts +27 -0
- package/dist/lib/esm/linters/eslint-no-restricted-syntax.mjs +93 -0
- package/dist/lib/esm/linters/eslint-rules/in-house-plugin.d.mts +26 -0
- package/dist/lib/esm/linters/eslint-rules/in-house-plugin.mjs +77 -0
- package/dist/lib/esm/linters/eslint-rules/index.d.mts +13 -0
- package/dist/lib/esm/linters/eslint-rules/index.mjs +74 -0
- package/dist/lib/esm/linters/eslint-rules/no-async-callback-to-unsafe-return.d.mts +10 -0
- package/dist/lib/esm/linters/eslint-rules/no-async-callback-to-unsafe-return.mjs +144 -0
- package/dist/lib/esm/linters/eslint-rules/no-unresolved-jsdoc-link.d.mts +10 -0
- package/dist/lib/esm/linters/eslint-rules/no-unresolved-jsdoc-link.mjs +277 -0
- package/dist/lib/esm/linters/eslint-rules/no-unused-params-members.d.mts +41 -0
- package/dist/lib/esm/linters/eslint-rules/no-unused-params-members.mjs +227 -0
- package/dist/lib/esm/linters/eslint-rules/no-used-underscore-variables.d.mts +20 -0
- package/dist/lib/esm/linters/eslint-rules/no-used-underscore-variables.mjs +96 -0
- package/dist/lib/esm/linters/eslint-rules/params-options-name-match.d.mts +36 -0
- package/dist/lib/esm/linters/eslint-rules/params-options-name-match.mjs +179 -0
- package/dist/lib/esm/linters/eslint-rules/prefer-noop-async.d.mts +10 -0
- package/dist/lib/esm/linters/eslint-rules/prefer-noop-async.mjs +88 -0
- package/dist/lib/esm/linters/eslint-rules/readonly-params-options-result-members.d.mts +20 -0
- package/dist/lib/esm/linters/eslint-rules/readonly-params-options-result-members.mjs +87 -0
- package/dist/lib/esm/linters/eslint-rules/require-method-template.d.mts +14 -0
- package/dist/lib/esm/linters/eslint-rules/require-method-template.mjs +142 -0
- package/dist/lib/esm/linters/eslint-rules/require-super-call.d.mts +10 -0
- package/dist/lib/esm/linters/eslint-rules/require-super-call.mjs +183 -0
- package/dist/lib/esm/linters/eslint-rules/rule-tester-helper.d.mts +18 -0
- package/dist/lib/esm/linters/eslint-rules/rule-tester-helper.mjs +55 -0
- package/dist/lib/esm/linters/eslint-rules/ts-estree-node.d.mts +23 -0
- package/dist/lib/esm/linters/eslint-rules/ts-estree-node.mjs +55 -0
- package/dist/lib/esm/linters/eslint-types/@types/@eslint-community__eslint-plugin-eslint-comments__configs.d.mts +20 -0
- package/dist/lib/esm/linters/eslint-types/@types/eslint-plugin-verify-tsdoc.d.mts +17 -0
- package/dist/lib/esm/linters/eslint.d.mts +35 -0
- package/dist/lib/esm/linters/eslint.mjs +88 -0
- package/dist/lib/esm/linters/index.d.mts +15 -0
- package/dist/lib/esm/linters/index.mjs +78 -0
- package/dist/lib/esm/linters/lint-ignores.d.mts +30 -0
- package/dist/lib/esm/linters/lint-ignores.mjs +54 -0
- package/dist/lib/esm/linters/markdownlint-cli2-config.d.mts +11 -0
- package/dist/lib/esm/linters/markdownlint-cli2-config.mjs +122 -0
- package/dist/lib/esm/linters/markdownlint-content.d.mts +47 -0
- package/dist/lib/esm/linters/markdownlint-content.mjs +83 -0
- package/dist/lib/esm/linters/markdownlint-ignores.d.mts +35 -0
- package/dist/lib/esm/linters/markdownlint-ignores.mjs +57 -0
- package/dist/lib/esm/linters/markdownlint-rules/index.d.mts +2 -0
- package/dist/lib/esm/linters/markdownlint-rules/index.mjs +52 -0
- package/dist/lib/esm/linters/markdownlint-rules/no-soft-break-in-paragraph.d.mts +35 -0
- package/dist/lib/esm/linters/markdownlint-rules/no-soft-break-in-paragraph.mjs +114 -0
- package/dist/lib/esm/linters/markdownlint-types/@types/markdownlint-cli2-config-schema.d.mts +1344 -0
- package/dist/lib/esm/linters/markdownlint-types/@types/markdownlint-cli2.d.mts +67 -0
- package/dist/lib/esm/linters/markdownlint.d.mts +32 -0
- package/dist/lib/esm/linters/markdownlint.mjs +124 -0
- package/dist/lib/esm/linters/over-exposure.d.mts +357 -0
- package/dist/lib/esm/linters/over-exposure.mjs +672 -0
- package/dist/lib/esm/nano-staged-config.d.mts +54 -0
- package/dist/lib/esm/nano-staged-config.mjs +103 -0
- package/dist/lib/esm/npm-publish.d.mts +19 -0
- package/dist/lib/esm/npm-publish.mjs +56 -0
- package/dist/lib/esm/npm-run.d.mts +34 -0
- package/dist/lib/esm/npm-run.mjs +81 -0
- package/dist/lib/esm/npm.d.mts +168 -0
- package/dist/lib/esm/npm.mjs +155 -0
- package/dist/lib/esm/package-lock-integrity.d.mts +38 -0
- package/dist/lib/esm/package-lock-integrity.mjs +99 -0
- package/dist/lib/esm/package-manager.d.mts +93 -0
- package/dist/lib/esm/package-manager.mjs +245 -0
- package/dist/lib/esm/released-issues.d.mts +79 -0
- package/dist/lib/esm/released-issues.mjs +143 -0
- package/dist/lib/esm/repo-paths.d.mts +318 -0
- package/dist/lib/esm/repo-paths.mjs +130 -0
- package/dist/lib/esm/root.d.mts +107 -0
- package/dist/lib/esm/root.mjs +115 -0
- package/dist/lib/esm/test-runners/index.d.mts +3 -0
- package/dist/lib/esm/test-runners/index.mjs +54 -0
- package/dist/lib/esm/test-runners/vitest-config.d.mts +90 -0
- package/dist/lib/esm/test-runners/vitest-config.mjs +86 -0
- package/dist/lib/esm/test-runners/vitest.d.mts +52 -0
- package/dist/lib/esm/test-runners/vitest.mjs +76 -0
- package/dist/lib/esm/validate-declarations.d.mts +37 -0
- package/dist/lib/esm/validate-declarations.mjs +87 -0
- package/dist/lib/esm/version.d.mts +418 -0
- package/dist/lib/esm/version.mjs +723 -0
- package/formatters/dprint/package.json +6 -0
- package/formatters/index/package.json +6 -0
- package/formatters/package.json +6 -0
- package/linters/cspell/package.json +6 -0
- package/linters/cspell-content/package.json +6 -0
- package/linters/eslint/package.json +6 -0
- package/linters/eslint-agnostic-core-boundary/package.json +6 -0
- package/linters/eslint-config/package.json +6 -0
- package/linters/eslint-no-restricted-syntax/package.json +6 -0
- package/linters/eslint-rules/in-house-plugin/package.json +6 -0
- package/linters/eslint-rules/index/package.json +6 -0
- package/linters/eslint-rules/no-async-callback-to-unsafe-return/package.json +6 -0
- package/linters/eslint-rules/no-unresolved-jsdoc-link/package.json +6 -0
- package/linters/eslint-rules/no-unused-params-members/package.json +6 -0
- package/linters/eslint-rules/no-used-underscore-variables/package.json +6 -0
- package/linters/eslint-rules/package.json +6 -0
- package/linters/eslint-rules/params-options-name-match/package.json +6 -0
- package/linters/eslint-rules/prefer-noop-async/package.json +6 -0
- package/linters/eslint-rules/readonly-params-options-result-members/package.json +6 -0
- package/linters/eslint-rules/require-method-template/package.json +6 -0
- package/linters/eslint-rules/require-super-call/package.json +6 -0
- package/linters/eslint-rules/rule-tester-helper/package.json +6 -0
- package/linters/eslint-rules/ts-estree-node/package.json +6 -0
- package/linters/eslint-types/@types/@eslint-community__eslint-plugin-eslint-comments__configs/package.json +4 -0
- package/linters/eslint-types/@types/eslint-plugin-verify-tsdoc/package.json +4 -0
- package/linters/index/package.json +6 -0
- package/linters/lint-ignores/package.json +6 -0
- package/linters/markdownlint/package.json +6 -0
- package/linters/markdownlint-cli2-config/package.json +6 -0
- package/linters/markdownlint-content/package.json +6 -0
- package/linters/markdownlint-ignores/package.json +6 -0
- package/linters/markdownlint-rules/index/package.json +6 -0
- package/linters/markdownlint-rules/no-soft-break-in-paragraph/package.json +6 -0
- package/linters/markdownlint-rules/package.json +6 -0
- package/linters/markdownlint-types/@types/markdownlint-cli2/package.json +4 -0
- package/linters/markdownlint-types/@types/markdownlint-cli2-config-schema/package.json +4 -0
- package/linters/over-exposure/package.json +6 -0
- package/linters/package.json +6 -0
- package/package.json +329 -13
- package/test-runners/index/package.json +6 -0
- package/test-runners/package.json +6 -0
- package/test-runners/vitest/package.json +6 -0
- package/test-runners/vitest-config/package.json +6 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/// <reference path="./index.d.cts" />
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* The build pipeline of a TypeScript LIBRARY package: one `dist/lib/{cjs,esm}` tree of unbundled modules beside its
|
|
6
|
+
* `.d.cts` / `.d.mts` declarations, the generated `index.ts` barrels, and the generated `package.json` `exports` map.
|
|
7
|
+
*
|
|
8
|
+
* Each step works on the current working folder, which is the package being built. A repository's
|
|
9
|
+
* `scripts/build-*.ts` entry points are thin `wrapCliTask` wrappers around these functions, and its `build` script
|
|
10
|
+
* runs them in order through {@link runBuildSteps}.
|
|
11
|
+
*/
|
|
12
|
+
import type { Plugin } from 'esbuild' with { 'resolution-mode': 'import' };
|
|
13
|
+
/**
|
|
14
|
+
* The banner every emitted library module opens with.
|
|
15
|
+
*/
|
|
16
|
+
export declare const LIBRARY_BANNER = "/*\nTHIS IS A GENERATED/BUNDLED FILE BY ESBUILD\nif you want to view the source, please visit the github repository of this plugin\n*/\n";
|
|
17
|
+
/**
|
|
18
|
+
* The steps of a library build, in the order {@link runBuildSteps} runs them.
|
|
19
|
+
*/
|
|
20
|
+
export declare const LIBRARY_BUILD_STEPS: readonly string[];
|
|
21
|
+
/**
|
|
22
|
+
* The export condition the `obsidian-dev-utils` workspace maps every subpath onto its TypeScript source with, so a
|
|
23
|
+
* package there can import a sibling package's source before anything is built. Pass it to
|
|
24
|
+
* {@link generateLibraryExports} through {@link GenerateLibraryExportsOptions.sourceCondition}.
|
|
25
|
+
*/
|
|
26
|
+
export declare const SOURCE_CONDITION = "@mnaoumov/source";
|
|
27
|
+
/**
|
|
28
|
+
* Options for {@link buildLibrary}.
|
|
29
|
+
*/
|
|
30
|
+
export interface BuildLibraryOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Creates the preprocess plugin for one output format. Defaults to the generic one, which carries no
|
|
33
|
+
* environment-specific `require` patch.
|
|
34
|
+
*/
|
|
35
|
+
readonly preprocessPluginFactory?: (isEsm: boolean) => Plugin;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Options for {@link generateLibraryExports}.
|
|
39
|
+
*/
|
|
40
|
+
export interface GenerateLibraryExportsOptions {
|
|
41
|
+
/**
|
|
42
|
+
* An export condition to put first in every entry, mapping the subpath onto its TypeScript source. Only a
|
|
43
|
+
* repository holding several packages that import each other needs one; nothing outside it sets the condition, and
|
|
44
|
+
* the sources it points at do not ship, so the publish has to strip it again. Omitted, the map has none.
|
|
45
|
+
*/
|
|
46
|
+
readonly sourceCondition?: string | undefined;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Removes everything an earlier build left: `dist/`, the generated `index.ts` barrels, the `.d.ts` files `tsc` wrote
|
|
50
|
+
* beside the sources (hand-authored ones under `@types` stay), and the per-subpath `package.json` stubs.
|
|
51
|
+
*
|
|
52
|
+
* @returns A {@link Promise} that resolves when everything has been removed.
|
|
53
|
+
*/
|
|
54
|
+
export declare function buildCleanLibrary(): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Builds every source module, unbundled, into `dist/lib/cjs` (`.cjs`) and `dist/lib/esm` (`.mjs`).
|
|
57
|
+
*
|
|
58
|
+
* The output folders must already exist; {@link buildLibraryTypes} creates them.
|
|
59
|
+
*
|
|
60
|
+
* @param options - The build options.
|
|
61
|
+
* @returns A {@link Promise} that resolves when both formats have been built.
|
|
62
|
+
*/
|
|
63
|
+
export declare function buildLibrary(options?: BuildLibraryOptions): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Emits the declarations with `tsc --project ./tsconfig.types.json`, then copies each one into `dist/lib` twice: as a
|
|
66
|
+
* `.d.cts` whose relative imports name `.cjs` files and whose bare type imports carry `resolution-mode: import`, and
|
|
67
|
+
* as a `.d.mts` whose relative imports name `.mjs` files.
|
|
68
|
+
*
|
|
69
|
+
* The library's root declaration (`library.ts` where the package has one, otherwise the generated `index.ts`) carries
|
|
70
|
+
* every `lib` and `types` reference the package needs; every other declaration references it by path.
|
|
71
|
+
*
|
|
72
|
+
* @returns A {@link Promise} that resolves when the declarations have been written.
|
|
73
|
+
*/
|
|
74
|
+
export declare function buildLibraryTypes(): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Regenerates the `exports` map of the package's `package.json` from its source folders, and writes a `package.json`
|
|
77
|
+
* stub per subpath for resolvers that do not read `exports`.
|
|
78
|
+
*
|
|
79
|
+
* @param options - The {@link GenerateLibraryExportsOptions}.
|
|
80
|
+
* @returns A {@link Promise} that resolves when the map is current.
|
|
81
|
+
* @throws If the map changed, so the change gets reviewed and committed rather than shipped unseen.
|
|
82
|
+
*/
|
|
83
|
+
export declare function generateLibraryExports(options?: GenerateLibraryExportsOptions): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Generates an `index.ts` barrel in every source folder that has something to export, re-exporting each module and
|
|
86
|
+
* each sub-barrel under its own name.
|
|
87
|
+
*
|
|
88
|
+
* @returns A {@link Promise} that resolves when the barrels have been written.
|
|
89
|
+
*/
|
|
90
|
+
export declare function generateLibraryIndex(): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Runs each named npm script the package defines, in order, skipping the ones it does not define.
|
|
93
|
+
*
|
|
94
|
+
* @param steps - The npm script names.
|
|
95
|
+
* @returns A {@link Promise} that resolves when every step has run.
|
|
96
|
+
*/
|
|
97
|
+
export declare function runBuildSteps(steps?: readonly string[]): Promise<void>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/*
|
|
2
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function () {
|
|
7
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
8
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for('Symbol.asyncDispose');
|
|
9
|
+
symbolConstructor.dispose ??= symbolConstructor.for('Symbol.dispose');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function ensureBrowserProcess() {
|
|
13
|
+
const browserProcess = {
|
|
14
|
+
browser: true,
|
|
15
|
+
cwd() {
|
|
16
|
+
return '/';
|
|
17
|
+
},
|
|
18
|
+
env: {},
|
|
19
|
+
platform: 'android'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const existingProcess = globalThis.process;
|
|
23
|
+
|
|
24
|
+
if (!existingProcess) {
|
|
25
|
+
globalThis.process = browserProcess;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (existingProcess.versions?.node) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const existingProcessRecord = existingProcess;
|
|
34
|
+
|
|
35
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
36
|
+
existingProcessRecord[key] ??= value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
existingProcessRecord['browser'] = true;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function keepName($unknown) {
|
|
43
|
+
return $unknown;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
(function initCjs() {
|
|
47
|
+
const globalThisRecord = globalThis;
|
|
48
|
+
ensureDisposeSymbols();
|
|
49
|
+
globalThisRecord['__name'] ??= keepName;
|
|
50
|
+
globalThisRecord['__extractDefault'] ??= extractDefault;
|
|
51
|
+
|
|
52
|
+
ensureBrowserProcess();
|
|
53
|
+
|
|
54
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping -- Serialized with initCjs into the banner; at module scope it would be left out of it.
|
|
55
|
+
function extractDefault(module) {
|
|
56
|
+
return module && module.__esModule && 'default' in module ? module.default : module;
|
|
57
|
+
}
|
|
58
|
+
})();
|
|
59
|
+
})();
|
|
60
|
+
|
|
61
|
+
"use strict";
|
|
62
|
+
var __defProp = Object.defineProperty;
|
|
63
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
64
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
65
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
66
|
+
var __export = (target, all) => {
|
|
67
|
+
for (var name in all)
|
|
68
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
69
|
+
};
|
|
70
|
+
var __copyProps = (to, from, except, desc) => {
|
|
71
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
72
|
+
for (let key of __getOwnPropNames(from))
|
|
73
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
74
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
75
|
+
}
|
|
76
|
+
return to;
|
|
77
|
+
};
|
|
78
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
79
|
+
var cspell_content_exports = {};
|
|
80
|
+
__export(cspell_content_exports, {
|
|
81
|
+
spellcheckContent: () => spellcheckContent
|
|
82
|
+
});
|
|
83
|
+
module.exports = __toCommonJS(cspell_content_exports);
|
|
84
|
+
var import_debug = require('@mnaoumov/typescript-lib/debug');
|
|
85
|
+
var import_path = require('@mnaoumov/typescript-lib/path');
|
|
86
|
+
var import_package_manager = require('../package-manager.cjs');
|
|
87
|
+
var import_root = require('../root.cjs');
|
|
88
|
+
const SUCCESS_EXIT_CODE = 0;
|
|
89
|
+
async function spellcheckContent(params) {
|
|
90
|
+
const { content, filePath } = params;
|
|
91
|
+
const contentDebugger = (0, import_debug.getLibDebugger)("cspell:spellcheckContent");
|
|
92
|
+
const result = await (0, import_root.execFromRoot)([
|
|
93
|
+
...(0, import_package_manager.resolveToolCommand)({ tool: "cspell" }),
|
|
94
|
+
"lint",
|
|
95
|
+
"--no-progress",
|
|
96
|
+
"--no-must-find-files",
|
|
97
|
+
// The `CSpell: Files checked: …` summary and the color codes are both noise in a finding that ends up
|
|
98
|
+
// quoted in an error message, and both are printed by default when they are not asked away.
|
|
99
|
+
"--no-summary",
|
|
100
|
+
"--no-color",
|
|
101
|
+
// A POSIX path, because this is parsed as a URL: a Windows path's backslashes do not survive that.
|
|
102
|
+
`stdin://${(0, import_path.toPosixPath)(filePath)}`
|
|
103
|
+
], {
|
|
104
|
+
isQuiet: true,
|
|
105
|
+
shouldIgnoreExitCode: true,
|
|
106
|
+
shouldIncludeDetails: true,
|
|
107
|
+
stdin: content
|
|
108
|
+
});
|
|
109
|
+
contentDebugger(result.stderr);
|
|
110
|
+
if (result.exitCode === SUCCESS_EXIT_CODE) {
|
|
111
|
+
return [];
|
|
112
|
+
}
|
|
113
|
+
const findings = result.stdout.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
114
|
+
if (findings.length === 0) {
|
|
115
|
+
throw new Error(`\`cspell\` exited with ${String(result.exitCode)} without reporting anything:
|
|
116
|
+
${result.stderr}`);
|
|
117
|
+
}
|
|
118
|
+
return findings;
|
|
119
|
+
}
|
|
120
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
121
|
+
0 && (module.exports = {
|
|
122
|
+
spellcheckContent
|
|
123
|
+
});
|
|
124
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL2xpbnRlcnMvY3NwZWxsLWNvbnRlbnQudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBTcGVsbGNoZWNrcyBtYXJrZG93biB0aGF0IGlzIHN0aWxsIGluIG1lbW9yeSwgd2l0aCB0aGUgcmVwb3NpdG9yeSdzIG93biBgc3BlbGxjaGVja2AgY29uZmlndXJhdGlvbi5cbiAqXG4gKiBUaGUgc2libGluZyBvZiBgbWFya2Rvd25saW50LWNvbnRlbnQudHNgLCBmb3IgdGhlIG90aGVyIGhhbGYgb2YgdGhlIHNhbWUgZ2FwOiBgc3BlbGxjaGVja2AgY2FuIG9ubHkgYW5zd2VyXG4gKiBmb3Igd2hhdCBpcyBhbHJlYWR5IG9uIGRpc2ssIHNvIGEgZG9jdW1lbnQgY29tcG9zZWQgZHVyaW5nIGEgcnVuIFx1MjAxNCB0aGUgcmVsZWFzZSdzIGNoYW5nZWxvZyBiZWluZyB0aGUgb25lXG4gKiB0aGF0IGNvc3RzIGEgcmVkIGBtYWluYCBcdTIwMTQgaXMgY2hlY2tlZCBieSBub3RoaW5nIHVudGlsIHRoZSBuZXh0IGdhdGUuIEEgY29pbmVkIHdvcmQgaW4gYSByZWxlYXNlIG5vdGUgbGFuZHNcbiAqIG9uIHRoZSBkZWZhdWx0IGJyYW5jaCBpbnNpZGUgdGhlIHJlbGVhc2UgY29tbWl0LCBhbmQgdGhlIE5FWFQgcmVsZWFzZSBhYm9ydHMgaW4gaXRzIHNlY29uZCBw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|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* Spellchecks markdown that is still in memory, with the repository's own `spellcheck` configuration.
|
|
6
|
+
*
|
|
7
|
+
* The sibling of `markdownlint-content.ts`, for the other half of the same gap: `spellcheck` can only answer
|
|
8
|
+
* for what is already on disk, so a document composed during a run — the release's changelog being the one
|
|
9
|
+
* that costs a red `main` — is checked by nothing until the next gate. A coined word in a release note lands
|
|
10
|
+
* on the default branch inside the release commit, and the NEXT release aborts in its second preflight step,
|
|
11
|
+
* in a repository nobody was working on.
|
|
12
|
+
*
|
|
13
|
+
* It SHELLS OUT where the markdownlint half calls a library, and the difference has a reason rather than
|
|
14
|
+
* being an oversight. `cspell` does export a CLI-layer `lint(fileGlobs, options, reporter)` that would be the
|
|
15
|
+
* exact analogue of `markdownlint-cli2`'s `main`, but the only way to hand it content that is not on disk is
|
|
16
|
+
* a `stdin://` glob, and its reader is `streamConsumers.text(process.stdin)` — the HOST process's own stdin,
|
|
17
|
+
* which the release's interactive review also uses. Reaching for it in-process would mean monkey-patching
|
|
18
|
+
* `process.stdin` for the whole process, so the content goes to a child's stdin instead.
|
|
19
|
+
*
|
|
20
|
+
* The `stdin://<path>` form is what makes the check the repository's own rather than a generic one: the
|
|
21
|
+
* virtual document is attributed to a REAL path, so `cspell.json` beside it — its `words`, its dictionaries,
|
|
22
|
+
* its `ignorePaths` — resolves exactly as it would for the written file. A temp file outside the repository
|
|
23
|
+
* would lose all of that, which is why it is not used.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Parameters for {@link spellcheckContent}.
|
|
27
|
+
*/
|
|
28
|
+
export interface SpellcheckContentParams {
|
|
29
|
+
/**
|
|
30
|
+
* The content to spellcheck.
|
|
31
|
+
*/
|
|
32
|
+
readonly content: string;
|
|
33
|
+
/**
|
|
34
|
+
* The path the content is checked AS — normally the path it is about to be written to. It decides which
|
|
35
|
+
* `cspell` configuration applies, and it is what every reported finding is named after.
|
|
36
|
+
*/
|
|
37
|
+
readonly filePath: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Spellchecks content that is not on disk, with the configuration `spellcheck` would have used for it.
|
|
41
|
+
*
|
|
42
|
+
* @param params - The {@link SpellcheckContentParams}.
|
|
43
|
+
* @returns A {@link Promise} that resolves to the findings, each one the line the `spellcheck` output would
|
|
44
|
+
* have carried — `<path>:<line>:<column> - Unknown word (<word>)` — or an empty array when there are none.
|
|
45
|
+
*/
|
|
46
|
+
export declare function spellcheckContent(params: SpellcheckContentParams): Promise<string[]>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/*
|
|
2
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function () {
|
|
7
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
8
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for('Symbol.asyncDispose');
|
|
9
|
+
symbolConstructor.dispose ??= symbolConstructor.for('Symbol.dispose');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function ensureBrowserProcess() {
|
|
13
|
+
const browserProcess = {
|
|
14
|
+
browser: true,
|
|
15
|
+
cwd() {
|
|
16
|
+
return '/';
|
|
17
|
+
},
|
|
18
|
+
env: {},
|
|
19
|
+
platform: 'android'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const existingProcess = globalThis.process;
|
|
23
|
+
|
|
24
|
+
if (!existingProcess) {
|
|
25
|
+
globalThis.process = browserProcess;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (existingProcess.versions?.node) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const existingProcessRecord = existingProcess;
|
|
34
|
+
|
|
35
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
36
|
+
existingProcessRecord[key] ??= value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
existingProcessRecord['browser'] = true;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function keepName($unknown) {
|
|
43
|
+
return $unknown;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
(function initCjs() {
|
|
47
|
+
const globalThisRecord = globalThis;
|
|
48
|
+
ensureDisposeSymbols();
|
|
49
|
+
globalThisRecord['__name'] ??= keepName;
|
|
50
|
+
globalThisRecord['__extractDefault'] ??= extractDefault;
|
|
51
|
+
|
|
52
|
+
ensureBrowserProcess();
|
|
53
|
+
|
|
54
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping -- Serialized with initCjs into the banner; at module scope it would be left out of it.
|
|
55
|
+
function extractDefault(module) {
|
|
56
|
+
return module && module.__esModule && 'default' in module ? module.default : module;
|
|
57
|
+
}
|
|
58
|
+
})();
|
|
59
|
+
})();
|
|
60
|
+
|
|
61
|
+
"use strict";
|
|
62
|
+
var __defProp = Object.defineProperty;
|
|
63
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
64
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
65
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
66
|
+
var __export = (target, all) => {
|
|
67
|
+
for (var name in all)
|
|
68
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
69
|
+
};
|
|
70
|
+
var __copyProps = (to, from, except, desc) => {
|
|
71
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
72
|
+
for (let key of __getOwnPropNames(from))
|
|
73
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
74
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
75
|
+
}
|
|
76
|
+
return to;
|
|
77
|
+
};
|
|
78
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
79
|
+
var cspell_exports = {};
|
|
80
|
+
__export(cspell_exports, {
|
|
81
|
+
spellcheck: () => spellcheck
|
|
82
|
+
});
|
|
83
|
+
module.exports = __toCommonJS(cspell_exports);
|
|
84
|
+
var import_package_manager = require('../package-manager.cjs');
|
|
85
|
+
var import_root = require('../root.cjs');
|
|
86
|
+
async function spellcheck(options) {
|
|
87
|
+
const { paths } = options ?? {};
|
|
88
|
+
const targets = paths?.length ? paths : ["."];
|
|
89
|
+
const rootFolder = (0, import_root.getRootFolder)();
|
|
90
|
+
await (0, import_root.execFromRoot)([
|
|
91
|
+
...(0, import_package_manager.resolveToolCommand)({ tool: "cspell" }),
|
|
92
|
+
"--no-progress",
|
|
93
|
+
"--no-must-find-files",
|
|
94
|
+
"--gitignore",
|
|
95
|
+
...rootFolder === null ? [] : ["--gitignore-root", rootFolder],
|
|
96
|
+
{ batchedArguments: targets }
|
|
97
|
+
]);
|
|
98
|
+
}
|
|
99
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
100
|
+
0 && (module.exports = {
|
|
101
|
+
spellcheck
|
|
102
|
+
});
|
|
103
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL2xpbnRlcnMvY3NwZWxsLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqIEBmaWxlXG4gKlxuICogVGhpcyBtb2R1bGUgcHJvdmlkZXMgYSBmdW5jdGlvbiBmb3IgcnVubmluZyBhIHNwZWxsY2hlY2sgb24gdGhlIGNvZGViYXNlIHVzaW5nIHRoZSBgY3NwZWxsYCBsaWJyYXJ5LlxuICogSXQgcmVwb3J0cyBhbnkgc3BlbGxpbmcgaXNzdWVzIGZvdW5kIGluIHRoZSBjb2RlIGFuZCByZXR1cm5zIGEge0BsaW5rIENsaVRhc2tSZXN1bHR9IGluZGljYXRpbmcgd2hldGhlciB0aGUgc3BlbGxjaGVjayB3YXMgc3VjY2Vzc2Z1bC5cbiAqL1xuX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DQUFDLEdBQUc7QUFFNUMsUUFBTSxpQkFBYSwyQkFBYztBQUNqQyxZQUFNLDBCQUFhO0FBQUEsSUFDakIsT0FBRywyQ0FBbUIsRUFBRSxNQUFNLFNBQVMsQ0FBQztBQUFBLElBQ3hDO0FBQUEsSUFDQTtBQUFBLElBQ0E7QUFBQSxJQUNBLEdBQUcsZUFBZSxPQUFPLENBQUMsSUFBSSxDQUFDLG9CQUFvQixVQUFVO0FBQUEsSUFDN0QsRUFBRSxrQkFBa0IsUUFBUTtBQUFBLEVBQzlCLENBQUM7QUFDSDsiLAogICJuYW1lcyI6IFtdCn0K
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference path="../index.d.cts" />
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* This module provides a function for running a spellcheck on the codebase using the `cspell` library.
|
|
6
|
+
* It reports any spelling issues found in the code and returns a {@link CliTaskResult} indicating whether the spellcheck was successful.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Parameters for the {@link spellcheck} function.
|
|
10
|
+
*/
|
|
11
|
+
export interface SpellcheckOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Optional file paths to check. If omitted, checks the entire project.
|
|
14
|
+
*/
|
|
15
|
+
readonly paths?: string[] | undefined;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Runs a spellcheck on the entire codebase using `cspell`.
|
|
19
|
+
*
|
|
20
|
+
* Checks all files in the current folder and its subfolders for spelling issues.
|
|
21
|
+
* If issues are found, they are logged to the console with their file path, line, and column number.
|
|
22
|
+
*
|
|
23
|
+
* Uses `--no-must-find-files` so that cspell does not fail when all provided paths
|
|
24
|
+
* are excluded by built-in ignore rules (e.g., `package-lock.json`).
|
|
25
|
+
*
|
|
26
|
+
* Uses `--gitignore` so a path git ignores is a path cspell skips — generated output, build folders and
|
|
27
|
+
* every `node_modules` are covered without a hand-maintained `ignorePaths` list that drifts from
|
|
28
|
+
* `.gitignore`. It is passed on the command line rather than set in `cspell.json` so that every project
|
|
29
|
+
* consuming this function inherits it, rather than each having to edit its own config. `--gitignore-root`
|
|
30
|
+
* stops the search at the project root, so a `.gitignore` in some parent folder outside the project cannot
|
|
31
|
+
* silently remove files from the check.
|
|
32
|
+
*
|
|
33
|
+
* @param options - The {@link SpellcheckOptions}.
|
|
34
|
+
* @returns A {@link Promise} that resolves to a {@link CliTaskResult}, indicating the success or failure of the spellcheck.
|
|
35
|
+
*/
|
|
36
|
+
export declare function spellcheck(options?: SpellcheckOptions): Promise<void>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function () {
|
|
7
|
+
function ensureDisposeSymbols(symbolConstructor = Symbol) {
|
|
8
|
+
symbolConstructor.asyncDispose ??= symbolConstructor.for('Symbol.asyncDispose');
|
|
9
|
+
symbolConstructor.dispose ??= symbolConstructor.for('Symbol.dispose');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function ensureBrowserProcess() {
|
|
13
|
+
const browserProcess = {
|
|
14
|
+
browser: true,
|
|
15
|
+
cwd() {
|
|
16
|
+
return '/';
|
|
17
|
+
},
|
|
18
|
+
env: {},
|
|
19
|
+
platform: 'android'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const existingProcess = globalThis.process;
|
|
23
|
+
|
|
24
|
+
if (!existingProcess) {
|
|
25
|
+
globalThis.process = browserProcess;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (existingProcess.versions?.node) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const existingProcessRecord = existingProcess;
|
|
34
|
+
|
|
35
|
+
for (const [key, value] of Object.entries(browserProcess)) {
|
|
36
|
+
existingProcessRecord[key] ??= value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
existingProcessRecord['browser'] = true;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function keepName($unknown) {
|
|
43
|
+
return $unknown;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
(function initCjs() {
|
|
47
|
+
const globalThisRecord = globalThis;
|
|
48
|
+
ensureDisposeSymbols();
|
|
49
|
+
globalThisRecord['__name'] ??= keepName;
|
|
50
|
+
globalThisRecord['__extractDefault'] ??= extractDefault;
|
|
51
|
+
|
|
52
|
+
ensureBrowserProcess();
|
|
53
|
+
|
|
54
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping -- Serialized with initCjs into the banner; at module scope it would be left out of it.
|
|
55
|
+
function extractDefault(module) {
|
|
56
|
+
return module && module.__esModule && 'default' in module ? module.default : module;
|
|
57
|
+
}
|
|
58
|
+
})();
|
|
59
|
+
})();
|
|
60
|
+
|
|
61
|
+
"use strict";
|
|
62
|
+
var __defProp = Object.defineProperty;
|
|
63
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
64
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
65
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
66
|
+
var __export = (target, all) => {
|
|
67
|
+
for (var name in all)
|
|
68
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
69
|
+
};
|
|
70
|
+
var __copyProps = (to, from, except, desc) => {
|
|
71
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
72
|
+
for (let key of __getOwnPropNames(from))
|
|
73
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
74
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
75
|
+
}
|
|
76
|
+
return to;
|
|
77
|
+
};
|
|
78
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
79
|
+
var eslint_agnostic_core_boundary_exports = {};
|
|
80
|
+
__export(eslint_agnostic_core_boundary_exports, {
|
|
81
|
+
getPackageBoundaryNoRestrictedImportPatterns: () => getPackageBoundaryNoRestrictedImportPatterns
|
|
82
|
+
});
|
|
83
|
+
module.exports = __toCommonJS(eslint_agnostic_core_boundary_exports);
|
|
84
|
+
function getPackageBoundaryNoRestrictedImportPatterns(params) {
|
|
85
|
+
return params.forbiddenPackageNames.map((forbiddenPackageName) => ({
|
|
86
|
+
group: [forbiddenPackageName, `${forbiddenPackageName}/*`, `${forbiddenPackageName}/**`],
|
|
87
|
+
message: `\`${params.packageName}\` must not import \`${forbiddenPackageName}\`: the dependency arrows between the workspace packages point the other way.`
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
91
|
+
0 && (module.exports = {
|
|
92
|
+
getPackageBoundaryNoRestrictedImportPatterns
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL2xpbnRlcnMvZXNsaW50LWFnbm9zdGljLWNvcmUtYm91bmRhcnkudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBgbm8tcmVzdHJpY3RlZC1pbXBvcnRzYCBwYXR0ZXJuIGVudHJpZXMgdGhhdCBlbmZvcmNlIHRoZSBkZXBlbmRlbmN5IGFycm93cyBiZXR3ZWVuIHRoZSBwYWNrYWdlcyBvZiBhIHdvcmtzcGFjZTpcbiAqIHdoaWNoIHBhY2thZ2VzIGEgcGFja2FnZSdzIGNvZGUgbWF5IGltcG9ydCwgYnkgbmFtaW5nIHRoZSBvbmVzIGl0IG1heSBub3QuXG4gKlxuICogRXhwb3J0ZWQgYXMgc3RhbmRhbG9uZSBidWlsZGVycyBzbyB0aGUgcGF0dGVybnMgY2FuIGJlIHVuaXQtdGVzdGVkIGluZGVwZW5kZ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HLG9CQUFvQixNQUFNLEdBQUcsb0JBQW9CLEtBQUs7QUFBQSxJQUN2RixTQUFTLEtBQUssT0FBTyxXQUFXLHdCQUF3QixvQkFBb0I7QUFBQSxFQUM5RSxFQUFFO0FBQ0o7IiwKICAibmFtZXMiOiBbXQp9Cg==
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/// <reference path="../index.d.cts" />
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* `no-restricted-imports` pattern entries that enforce the dependency arrows between the packages of a workspace:
|
|
6
|
+
* which packages a package's code may import, by naming the ones it may not.
|
|
7
|
+
*
|
|
8
|
+
* Exported as standalone builders so the patterns can be unit-tested independently of the larger declarative
|
|
9
|
+
* config, and so the owning project can apply them scoped to each package's source files.
|
|
10
|
+
*
|
|
11
|
+
* Workspace `package.json` dependencies enforce the same boundary in the end, because an import of an undeclared
|
|
12
|
+
* package fails to resolve once the package is installed on its own. Inside the workspace every package is
|
|
13
|
+
* resolvable from every other, so without this rule a wrong arrow would surface only after publishing.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Parameters for {@link getPackageBoundaryNoRestrictedImportPatterns}.
|
|
17
|
+
*/
|
|
18
|
+
export interface GetPackageBoundaryNoRestrictedImportPatternsParams {
|
|
19
|
+
/**
|
|
20
|
+
* The packages the package's code must not import, by package name.
|
|
21
|
+
*/
|
|
22
|
+
readonly forbiddenPackageNames: readonly string[];
|
|
23
|
+
/**
|
|
24
|
+
* The name of the package the patterns apply to, named in the message.
|
|
25
|
+
*/
|
|
26
|
+
readonly packageName: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A single `no-restricted-imports` pattern entry pairing a group of banned import specifiers with a
|
|
30
|
+
* human-readable message explaining why they are banned.
|
|
31
|
+
*/
|
|
32
|
+
export interface NoRestrictedImportPatternEntry {
|
|
33
|
+
/**
|
|
34
|
+
* The glob group of import specifiers to ban.
|
|
35
|
+
*/
|
|
36
|
+
group: string[];
|
|
37
|
+
/**
|
|
38
|
+
* Human-readable message shown when an import matches the group.
|
|
39
|
+
*/
|
|
40
|
+
message: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Builds the `no-restricted-imports` pattern entries banning a package's code from importing the given packages,
|
|
44
|
+
* through their root or any subpath.
|
|
45
|
+
*
|
|
46
|
+
* @param params - The {@link GetPackageBoundaryNoRestrictedImportPatternsParams}.
|
|
47
|
+
* @returns One pattern entry per forbidden package; none when nothing is forbidden.
|
|
48
|
+
*/
|
|
49
|
+
export declare function getPackageBoundaryNoRestrictedImportPatterns(params: GetPackageBoundaryNoRestrictedImportPatternsParams): NoRestrictedImportPatternEntry[];
|