@mnaoumov/typescript-dev-toolkit 0.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +483 -0
- package/dist/lib/cjs/library-build.d.cts +101 -0
- package/dist/lib/cjs/library-references.d.cts +5 -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 +196 -0
- package/dist/lib/cjs/linters/eslint.d.cts +74 -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 +101 -0
- package/dist/lib/esm/library-build.mjs +443 -0
- package/dist/lib/esm/library-references.d.mts +5 -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 +74 -0
- package/dist/lib/esm/linters/eslint.mjs +159 -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,25 @@
|
|
|
1
|
+
/// <reference path="../../library-references.d.mts" />
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* This module defines an esbuild plugin that changes the extension of JavaScript files after the build process.
|
|
6
|
+
*/
|
|
7
|
+
import type { Plugin } from 'esbuild';
|
|
8
|
+
/**
|
|
9
|
+
* Creates an esbuild plugin that changes the extension of JavaScript files after the build process.
|
|
10
|
+
*
|
|
11
|
+
* @param extension - The extension to change the files to.
|
|
12
|
+
* @returns An esbuild `Plugin` object that handles the renaming and modification of output files.
|
|
13
|
+
*/
|
|
14
|
+
export declare function changeExtensionPlugin(extension: string): Plugin;
|
|
15
|
+
/**
|
|
16
|
+
* Rewrites the extension of every import-like path in an emitted module's text from `.ts` to the target
|
|
17
|
+
* output extension (`.mjs` / `.cjs`), so the multi-file `dist/lib` build references its real siblings.
|
|
18
|
+
*
|
|
19
|
+
* Covers `require('…')`, static `from "…"`, and dynamic `import("…")` occurrences.
|
|
20
|
+
*
|
|
21
|
+
* @param text - The emitted module text to rewrite.
|
|
22
|
+
* @param extension - The output extension to rewrite `.ts` paths to (e.g. `.mjs` or `.cjs`).
|
|
23
|
+
* @returns The rewritten module text.
|
|
24
|
+
*/
|
|
25
|
+
export declare function rewriteImportPathExtensions(text: string, extension: string): string;
|
|
@@ -0,0 +1,101 @@
|
|
|
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 initEsm() {
|
|
43
|
+
ensureDisposeSymbols();
|
|
44
|
+
ensureBrowserProcess();
|
|
45
|
+
})();
|
|
46
|
+
})();
|
|
47
|
+
|
|
48
|
+
import { replaceAll } from "@mnaoumov/typescript-lib/string";
|
|
49
|
+
import { writeFile } from "node:fs/promises";
|
|
50
|
+
import { RepoPaths } from "../../repo-paths.mjs";
|
|
51
|
+
function changeExtensionPlugin(extension) {
|
|
52
|
+
return {
|
|
53
|
+
name: "change-extension",
|
|
54
|
+
setup(build) {
|
|
55
|
+
build.onEnd(async (result) => {
|
|
56
|
+
for (const file of result.outputFiles ?? []) {
|
|
57
|
+
if (!file.path.endsWith(RepoPaths.JsExtension) || file.path.endsWith(RepoPaths.DjsExtension)) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const newPath = replaceAll({
|
|
61
|
+
$string: file.path,
|
|
62
|
+
replacer: extension,
|
|
63
|
+
searchValue: /\.js$/g
|
|
64
|
+
});
|
|
65
|
+
const newText = rewriteImportPathExtensions(file.text, extension);
|
|
66
|
+
await writeFile(newPath, newText);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function rewriteImportPathExtensions(text, extension) {
|
|
73
|
+
let newText = replaceAll({
|
|
74
|
+
$string: text,
|
|
75
|
+
replacer: ({ capturedGroupArguments: [importPath = ""] }) => `require('${rewriteTsExtension(importPath, extension)}')`,
|
|
76
|
+
searchValue: /require\(["'](?<ImportPath>.+?)["']\)/g
|
|
77
|
+
});
|
|
78
|
+
newText = replaceAll({
|
|
79
|
+
$string: newText,
|
|
80
|
+
replacer: ({ capturedGroupArguments: [importPath = ""] }) => `from "${rewriteTsExtension(importPath, extension)}"`,
|
|
81
|
+
searchValue: /from "(?<ImportPath>.+?)"/g
|
|
82
|
+
});
|
|
83
|
+
newText = replaceAll({
|
|
84
|
+
$string: newText,
|
|
85
|
+
replacer: ({ capturedGroupArguments: [importPath = ""] }) => `import("${rewriteTsExtension(importPath, extension)}")`,
|
|
86
|
+
searchValue: /import\(["'](?<ImportPath>.+?)["']\)/g
|
|
87
|
+
});
|
|
88
|
+
return newText;
|
|
89
|
+
}
|
|
90
|
+
function rewriteTsExtension(importPath, extension) {
|
|
91
|
+
return replaceAll({
|
|
92
|
+
$string: importPath,
|
|
93
|
+
replacer: extension,
|
|
94
|
+
searchValue: /\.ts$/g
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
changeExtensionPlugin,
|
|
99
|
+
rewriteImportPathExtensions
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL2J1bmRsZXJzL2VzYnVpbGQtaW1wbC9jaGFuZ2UtZXh0ZW5zaW9uLXBsdWdpbi50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAZmlsZVxuICpcbiAqIFRoaXMgbW9kdWxlIGRlZmluZXMgYW4gZXNidWlsZCBwbHVnaW4gdGhhdCBjaGFuZ2VzIHRoZSBleHRlbnNpb24gb2YgSmF2YVNjcmlwdCBmaWxlcyBhZnRlciB0aGUgYnVpbGQgcHJvY2Vzcy5cbiAqL1xuXG5pbXBvcnQgdHlwZSB7IFBsdWdpbiB9IGZyb20gJ2VzYnVpbGQnO1xuXG5pbXBvcnQgeyByZXBsYWNlQWxsIH0gZnJvbSAnQG1uYW91bW92L3R5cGVzY3JpcHQtbGliL3N0cmluZyc7XG5pbXBvcnQgeyB3cml0ZUZpbGUgfSBmcm9tICdub2RlOmZzL3Byb21pc2VzJztcblxuaW1wb3J0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2YsQ0FBQztBQUVELFNBQU87QUFDVDtBQVNBLFNBQVMsbUJBQW1CLFlBQW9CLFdBQTJCO0FBQ3pFLFNBQU8sV0FBVztBQUFBLElBQ2hCLFNBQVM7QUFBQSxJQUNULFVBQVU7QUFBQSxJQUNWLGFBQWE7QUFBQSxFQUNmLENBQUM7QUFDSDsiLAogICJuYW1lcyI6IFtdCn0K
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference path="../../library-references.d.mts" />
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* This module defines an esbuild plugin that allows for custom esbuild options to be used during the build process.
|
|
6
|
+
*/
|
|
7
|
+
import type { BuildOptions, Plugin } from 'esbuild';
|
|
8
|
+
/**
|
|
9
|
+
* A plugin that allows for custom esbuild options to be used during the build process.
|
|
10
|
+
*
|
|
11
|
+
* @param customizeEsbuildOptions - A function that customizes the esbuild options.
|
|
12
|
+
* @returns A plugin that allows for custom esbuild options to be used during the build process.
|
|
13
|
+
*/
|
|
14
|
+
export declare function customEsbuildOptionsPlugin(customizeEsbuildOptions?: (options: BuildOptions) => void): Plugin;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 initEsm() {
|
|
43
|
+
ensureDisposeSymbols();
|
|
44
|
+
ensureBrowserProcess();
|
|
45
|
+
})();
|
|
46
|
+
})();
|
|
47
|
+
|
|
48
|
+
function customEsbuildOptionsPlugin(customizeEsbuildOptions) {
|
|
49
|
+
return {
|
|
50
|
+
name: "custom-esbuild-options",
|
|
51
|
+
setup(build) {
|
|
52
|
+
customizeEsbuildOptions?.(build.initialOptions);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
customEsbuildOptionsPlugin
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL2J1bmRsZXJzL2VzYnVpbGQtaW1wbC9jdXN0b20tZXNidWlsZC1vcHRpb25zLXBsdWdpbi50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAZmlsZVxuICpcbiAqIFRoaXMgbW9kdWxlIGRlZmluZXMgYW4gZXNidWlsZCBwbHVnaW4gdGhhdCBhbGxvd3MgZm9yIGN1c3RvbSBlc2J1aWxkIG9wdGlvbnMgdG8gYmUgdXNlZCBkdXJpbmc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ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFtQk8sU0FBUywyQkFBMkIseUJBQW1FO0FBQzVHLFNBQU87QUFBQSxJQUNMLE1BQU07QUFBQSxJQUNOLE1BQU0sT0FBYTtBQUNqQixnQ0FBMEIsTUFBTSxjQUFjO0FBQUEsSUFDaEQ7QUFBQSxFQUNGO0FBQ0Y7IiwKICAibmFtZXMiOiBbXQp9Cg==
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference path="../../library-references.d.mts" />
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* This module defines a custom esbuild plugin that fixes the `require` statement for ESM modules.
|
|
6
|
+
*/
|
|
7
|
+
import type { Plugin } from 'esbuild';
|
|
8
|
+
/**
|
|
9
|
+
* Creates an esbuild plugin that fixes the `require` statement for ESM modules.
|
|
10
|
+
*
|
|
11
|
+
* @returns An esbuild `Plugin` object that fixes the `require` statement for ESM modules.
|
|
12
|
+
*/
|
|
13
|
+
export declare function fixEsmPlugin(): Plugin;
|
|
@@ -0,0 +1,69 @@
|
|
|
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 initEsm() {
|
|
43
|
+
ensureDisposeSymbols();
|
|
44
|
+
ensureBrowserProcess();
|
|
45
|
+
})();
|
|
46
|
+
})();
|
|
47
|
+
|
|
48
|
+
import { replaceAll } from "@mnaoumov/typescript-lib/string";
|
|
49
|
+
function fixEsmPlugin() {
|
|
50
|
+
return {
|
|
51
|
+
name: "fix-esm",
|
|
52
|
+
setup(build) {
|
|
53
|
+
build.onEnd((result) => {
|
|
54
|
+
for (const file of result.outputFiles ?? []) {
|
|
55
|
+
const newText = replaceAll({
|
|
56
|
+
$string: file.text,
|
|
57
|
+
replacer: "$1(__extractDefault($2), 1);",
|
|
58
|
+
searchValue: /(?<Caller>__toESM\d*)\((?<Module>.+), 1\);/g
|
|
59
|
+
});
|
|
60
|
+
file.contents = new TextEncoder().encode(newText);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
fixEsmPlugin
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL2J1bmRsZXJzL2VzYnVpbGQtaW1wbC9maXgtZXNtLXBsdWdpbi50cyJdLAogICJzb3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RzdHJpbmc6IGZpbGUudGV4dCxcbiAgICAgICAgICAgIHJlcGxhY2VyOiAnJDEoX19leHRyYWN0RGVmYXVsdCgkMiksIDEpOycsXG4gICAgICAgICAgICBzZWFyY2hWYWx1ZTogLyg/PENhbGxlcj5fX3RvRVNNXFxkKilcXCgoPzxNb2R1bGU+LispLCAxXFwpOy9nXG4gICAgICAgICAgfSk7XG4gICAgICAgICAgZmlsZS5jb250ZW50cyA9IG5ldyBUZXh0RW5jb2RlcigpLmVuY29kZShuZXdUZXh0KTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfVxuICB9O1xufVxuXG4vKiB2OCBpZ25vcmUgc3RvcCAqL1xuIl0sCiAgIm1hcHBpbmdzIjogIjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFVQSxTQUFTLGtCQUFrQjtBQU9wQixTQUFTLGVBQXVCO0FBQ3JDLFNBQU87QUFBQSxJQUNMLE1BQU07QUFBQSxJQUNOLE1BQU0sT0FBYTtBQUNqQixZQUFNLE1BQU0sQ0FBQyxXQUFXO0FBQ3RCLG1CQUFXLFFBQVEsT0FBTyxlQUFlLENBQUMsR0FBRztBQUMzQyxnQkFBTSxVQUFVLFdBQVc7QUFBQSxZQUN6QixTQUFTLEtBQUs7QUFBQSxZQUNkLFVBQVU7QUFBQSxZQUNWLGFBQWE7QUFBQSxVQUNmLENBQUM7QUFDRCxlQUFLLFdBQVcsSUFBSSxZQUFZLEVBQUUsT0FBTyxPQUFPO0FBQUEsUUFDbEQ7QUFBQSxNQUNGLENBQUM7QUFBQSxJQUNIO0FBQUEsRUFDRjtBQUNGOyIsCiAgIm5hbWVzIjogW10KfQo=
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference path="../../library-references.d.mts" />
|
|
2
|
+
export * as 'change-extension-plugin' from './change-extension-plugin.mjs';
|
|
3
|
+
export * as 'custom-esbuild-options-plugin' from './custom-esbuild-options-plugin.mjs';
|
|
4
|
+
export * as 'fix-esm-plugin' from './fix-esm-plugin.mjs';
|
|
5
|
+
export * as 'preprocess-plugin' from './preprocess-plugin.mjs';
|
|
6
|
+
export * as 'svelte-wrapper-plugin' from './svelte-wrapper-plugin.mjs';
|
|
@@ -0,0 +1,60 @@
|
|
|
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 initEsm() {
|
|
43
|
+
ensureDisposeSymbols();
|
|
44
|
+
ensureBrowserProcess();
|
|
45
|
+
})();
|
|
46
|
+
})();
|
|
47
|
+
|
|
48
|
+
import * as change_extension_plugin from "./change-extension-plugin.mjs";
|
|
49
|
+
import * as custom_esbuild_options_plugin from "./custom-esbuild-options-plugin.mjs";
|
|
50
|
+
import * as fix_esm_plugin from "./fix-esm-plugin.mjs";
|
|
51
|
+
import * as preprocess_plugin from "./preprocess-plugin.mjs";
|
|
52
|
+
import * as svelte_wrapper_plugin from "./svelte-wrapper-plugin.mjs";
|
|
53
|
+
export {
|
|
54
|
+
change_extension_plugin as "change-extension-plugin",
|
|
55
|
+
custom_esbuild_options_plugin as "custom-esbuild-options-plugin",
|
|
56
|
+
fix_esm_plugin as "fix-esm-plugin",
|
|
57
|
+
preprocess_plugin as "preprocess-plugin",
|
|
58
|
+
svelte_wrapper_plugin as "svelte-wrapper-plugin"
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL2J1bmRsZXJzL2VzYnVpbGQtaW1wbC9pbmRleC50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyogVEhJUyBJUyBBIEdFTkVSQVRFRC9CVU5ETEVEIEZJTEUgQlkgQlVJTEQgU0NSSVBUICovXG5cbmV4cG9ydCAqIGFzICdjaGFuZ2UtZXh0ZW5zaW9uLXBsdWdpbicgZnJvbSAnLi9jaGFuZ2UtZXh0ZW5zaW9uLXBsdWdpbi50cyc7XG5leHBvcnQgKiBhcyAnY3VzdG9tLWVzYnVpbGQtb3B0aW9ucy1wbHVnaW4nIGZyb20gJy4vY3VzdG9tLWVzYnVpbGQtb3B0aW9ucy1wbHVnaW4udHMnO1xuZXhwb3J0ICogYXMgJ2ZpeC1lc20tcGx1Z2luJyBmcm9tICcuL2ZpeC1lc20tcGx1Z2luLnRzJztcbmV4cG9ydCAqIGFzICdwcmVwcm9jZXNzLXBsdWdpbicgZnJvbSAnLi9wcmVwcm9jZXNzLXBsdWdpbi50cyc7XG5leHBvcnQgKiBhcyAnc3ZlbHRlLXdyYXBwZXItcGx1Z2luJyBmcm9tICcuL3N2ZWx0ZS13cmFwcGVyLXBsdWdpbi50cyc7XG4iXSwKICAibWFwcGluZ3MiOiAiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUVBLFlBQVlBLDZCQUErQjtBQUMzQyxZQUFZQyxtQ0FBcUM7QUFDakQsWUFBWUMsb0JBQXNCO0FBQ2xDLFlBQVlDLHVCQUF5QjtBQUNyQyxZQUFZQywyQkFBNkI7IiwKICAibmFtZXMiOiBbImNoYW5nZS1leHRlbnNpb24tcGx1Z2luIiwgImN1c3RvbS1lc2J1aWxkLW9wdGlvbnMtcGx1Z2luIiwgImZpeC1lc20tcGx1Z2luIiwgInByZXByb2Nlc3MtcGx1Z2luIiwgInN2ZWx0ZS13cmFwcGVyLXBsdWdpbiJdCn0K
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/// <reference path="../../library-references.d.mts" />
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* This module defines a custom esbuild plugin that preprocesses JavaScript and TypeScript files for any build target.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* We cannot use `.` instead of `(dot)` in the above description because the file itself is preprocessed with the same rule.
|
|
9
|
+
*
|
|
10
|
+
* `initCjs`, `initEsm` and the shims they call are stringified with `String(fn)` and injected into every
|
|
11
|
+
* built bundle as an esbuild banner, so they must be reachable from one another by BARE identifier. That is
|
|
12
|
+
* why they all live in this module: esbuild compiles a cross-module call to `(0, import_module.fn)(…)`,
|
|
13
|
+
* which would name a binding the emitted bundle does not have. Same-module references stay bare, and
|
|
14
|
+
* {@link makePreprocessBanner} serializes the shims alongside the `init` function so they are in scope there. A shim
|
|
15
|
+
* that is not serialized silently degrades to whatever the consumer's global scope holds under that name — which
|
|
16
|
+
* is how `__name` used to end up holding `window.name`.
|
|
17
|
+
*
|
|
18
|
+
* A caller that needs more in the banner (the Obsidian plugin builder patches `require`) hands in
|
|
19
|
+
* {@link PreprocessPluginOptions.additionalBannerInitFunctions}. Each one is serialized as its OWN immediately
|
|
20
|
+
* invoked function after the shared scope, so it must be self-contained: it cannot see the shims, and calling one
|
|
21
|
+
* from another module would hit exactly the cross-module trap above.
|
|
22
|
+
*/
|
|
23
|
+
import type { Plugin } from 'esbuild';
|
|
24
|
+
/**
|
|
25
|
+
* Options for {@link makePreprocessBanner}.
|
|
26
|
+
*/
|
|
27
|
+
export interface MakePreprocessBannerOptions {
|
|
28
|
+
/**
|
|
29
|
+
* Self-contained functions serialized after the shared shims, each invoked once.
|
|
30
|
+
*/
|
|
31
|
+
readonly additionalBannerInitFunctions?: readonly (() => void)[];
|
|
32
|
+
/**
|
|
33
|
+
* Whether the build is for an ESM format.
|
|
34
|
+
*/
|
|
35
|
+
readonly isEsm?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Options for {@link preprocessPlugin}.
|
|
39
|
+
*/
|
|
40
|
+
export interface PreprocessPluginOptions {
|
|
41
|
+
/**
|
|
42
|
+
* Self-contained functions serialized into the banner after the shared shims, each invoked once.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* Each function is emitted as `(${String(fn)})();`, so it may reference only globals and what it declares itself.
|
|
46
|
+
*/
|
|
47
|
+
readonly additionalBannerInitFunctions?: readonly (() => void)[];
|
|
48
|
+
/**
|
|
49
|
+
* The self-contained function whose result replaces `import(dot)meta(dot)url` in a CommonJS build. Serialized into
|
|
50
|
+
* every file that reads it.
|
|
51
|
+
*
|
|
52
|
+
* @default A function returning the file URL of `__filename`, or `location.href` where there is no `__filename`.
|
|
53
|
+
*/
|
|
54
|
+
readonly cjsImportMetaUrlProvider?: () => string;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the build is for an ESM format.
|
|
57
|
+
*/
|
|
58
|
+
readonly isEsm?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The slice of the `Symbol` constructor {@link ensureDisposeSymbols} reads and writes, with the two dispose
|
|
62
|
+
* symbols optional because an engine without Explicit Resource Management does not have them.
|
|
63
|
+
*/
|
|
64
|
+
interface DisposeSymbolHost {
|
|
65
|
+
asyncDispose?: symbol;
|
|
66
|
+
dispose?: symbol;
|
|
67
|
+
for: (key: string) => symbol;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Ensures the bundle runs against a `process` global that browser-targeting packages recognize.
|
|
71
|
+
*
|
|
72
|
+
* @remarks
|
|
73
|
+
* Serialized into the emitted banner, so it never runs in the builder process — but it is an ordinary
|
|
74
|
+
* function here, so it is unit-tested directly rather than by evaluating the banner text.
|
|
75
|
+
*
|
|
76
|
+
* Fills in the keys MISSING from a host-provided `process` rather than replacing or skipping it. Obsidian
|
|
77
|
+
* Mobile exposes a partial `process`, and the whole-object guards this replaced (`if (globalThis.process) {
|
|
78
|
+
* return; }` / `globalThisRecord['process'] ??= …`) took that as "already shimmed", so `browser` never
|
|
79
|
+
* landed. The bundled `debug` package then selected its Node entry point, which calls
|
|
80
|
+
* `require('util').deprecate()` at module top level, and on mobile the patched `require` returns `{}` — so
|
|
81
|
+
* the plugin threw before its `onload` ran.
|
|
82
|
+
*
|
|
83
|
+
* A real Node or Electron `process` is left completely untouched. `process.versions.node` is the signal for
|
|
84
|
+
* it, and it is self-contained, so it also holds in the Node CLI bundles this banner is emitted into.
|
|
85
|
+
*/
|
|
86
|
+
export declare function ensureBrowserProcess(): void;
|
|
87
|
+
/**
|
|
88
|
+
* Makes `Symbol.dispose` and `Symbol.asyncDispose` exist, falling back to the registry symbols esbuild's
|
|
89
|
+
* `using` helpers look up.
|
|
90
|
+
*
|
|
91
|
+
* @param symbolConstructor - The `Symbol` constructor to patch. Defaults to the ambient one; the parameter
|
|
92
|
+
* exists so a test can hand in an engine that lacks the well-known symbols.
|
|
93
|
+
*
|
|
94
|
+
* @remarks
|
|
95
|
+
* Serialized into the emitted banner. A disposable declares its method under the LITERAL key
|
|
96
|
+
* `[Symbol.dispose]`, while esbuild lowers every `using` to a lookup through `__knownSymbol('dispose')`,
|
|
97
|
+
* which falls back to `Symbol.for('Symbol.dispose')` when the engine has no well-known symbol. On such an
|
|
98
|
+
* engine the literal key evaluates to `undefined`, the method lands under the string `"undefined"`, and
|
|
99
|
+
* every `using` of it throws `Object not disposable`. Filling the well-known slot with that same registry
|
|
100
|
+
* symbol makes both sides name one key on every engine. A host that already has the symbol is left
|
|
101
|
+
* untouched: `??=` never reaches the assignment, which the host's non-writable property would refuse.
|
|
102
|
+
*
|
|
103
|
+
* The default names `Symbol` bare on purpose: it exists on every engine this runs on, and a bare reference
|
|
104
|
+
* resolves against whatever scope the banner is evaluated in, exactly as the bundle's own
|
|
105
|
+
* `[Symbol.dispose]` keys do.
|
|
106
|
+
*/
|
|
107
|
+
export declare function ensureDisposeSymbols(symbolConstructor?: DisposeSymbolHost): void;
|
|
108
|
+
/**
|
|
109
|
+
* Returns its argument unchanged.
|
|
110
|
+
*
|
|
111
|
+
* @param $unknown - The value to return.
|
|
112
|
+
* @returns The value passed in.
|
|
113
|
+
*
|
|
114
|
+
* @remarks
|
|
115
|
+
* Serialized into the emitted banner, where it stands in for esbuild's `__name` helper — which names a
|
|
116
|
+
* function and returns it — for bundles that reference the helper without emitting their own.
|
|
117
|
+
*/
|
|
118
|
+
export declare function keepName($unknown: unknown): unknown;
|
|
119
|
+
/**
|
|
120
|
+
* Builds the banner injected at the top of every emitted bundle.
|
|
121
|
+
*
|
|
122
|
+
* `String(fn)` captures only the function's own body, so every shim the `init` function calls has to be
|
|
123
|
+
* serialized next to it and wrapped in one shared scope; otherwise the call it makes resolves against the
|
|
124
|
+
* consumer's global scope at runtime. See this file's `@file` remarks.
|
|
125
|
+
*
|
|
126
|
+
* @param options - The banner options.
|
|
127
|
+
* @returns The banner source to prepend to the emitted bundle.
|
|
128
|
+
*/
|
|
129
|
+
export declare function makePreprocessBanner(options?: MakePreprocessBannerOptions): string;
|
|
130
|
+
/**
|
|
131
|
+
* Creates an esbuild plugin that preprocesses JavaScript and TypeScript files.
|
|
132
|
+
*
|
|
133
|
+
* This plugin performs the following tasks:
|
|
134
|
+
* - Replaces instances of `import(dot)meta(dot)url` with a CommonJS-compatible `__filename` alternative.
|
|
135
|
+
* - Modifies the `sourceMappingURL` comment so a template literal ending a file does not swallow it.
|
|
136
|
+
* - Adds a basic `process` object to the global scope if `process` is referenced but not defined.
|
|
137
|
+
* - Fills in `Symbol.dispose` / `Symbol.asyncDispose` on engines that lack them, so `using` works there.
|
|
138
|
+
*
|
|
139
|
+
* @param options - The plugin options.
|
|
140
|
+
* @returns An esbuild `Plugin` object that handles the preprocessing.
|
|
141
|
+
*/
|
|
142
|
+
export declare function preprocessPlugin(options?: PreprocessPluginOptions): Plugin;
|
|
143
|
+
export {};
|