@voidzero-dev/vite-plus-core 0.1.22 → 0.1.24
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 +37 -26
- package/dist/pluginutils/filter/index.d.mts +194 -0
- package/dist/pluginutils/filter/index.mjs +2 -0
- package/dist/pluginutils/filter-B_mD-HGz.mjs +323 -0
- package/dist/pluginutils/index.d.mts +2 -0
- package/dist/pluginutils/index.mjs +2 -0
- package/dist/rolldown/cli.mjs +7 -7
- package/dist/rolldown/config.d.mts +1 -1
- package/dist/rolldown/config.mjs +3 -3
- package/dist/rolldown/experimental-index.d.mts +21 -4
- package/dist/rolldown/experimental-index.mjs +14 -9
- package/dist/rolldown/filter-index.d.mts +8 -9
- package/dist/rolldown/filter-index.mjs +2 -8
- package/dist/rolldown/get-log-filter.d.mts +3 -3
- package/dist/rolldown/index.d.mts +4 -4
- package/dist/rolldown/index.mjs +5 -5
- package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
- package/dist/rolldown/parallel-plugin.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.mjs +2 -2
- package/dist/rolldown/plugins-index.d.mts +3 -3
- package/dist/rolldown/plugins-index.mjs +2 -2
- package/dist/rolldown/shared/{binding-zH1vcmbM.d.mts → binding-BaCZTfMx.d.mts} +32 -3
- package/dist/rolldown/shared/{binding-ESkOU1xr.mjs → binding-CXquf8ay.mjs} +27 -26
- package/dist/rolldown/shared/{bindingify-input-options-wZdDRbfo.mjs → bindingify-input-options-D2ORek5s.mjs} +14 -14
- package/dist/rolldown/shared/{constructors-D6i2Tbyl.mjs → constructors-BiPdtLBB.mjs} +1 -1
- package/dist/rolldown/shared/{constructors-D0W3rNfA.d.mts → constructors-CbNaT434.d.mts} +2 -2
- package/dist/rolldown/shared/{define-config-5HJ1b9vG.d.mts → define-config-3BX_X2Am.d.mts} +70 -16
- package/dist/rolldown/shared/{error-BrnLyQ-g.mjs → error-BuvQYXuZ.mjs} +1 -1
- package/dist/rolldown/shared/{get-log-filter-semyr3Lj.d.mts → get-log-filter-BpNVNJ5-.d.mts} +1 -1
- package/dist/rolldown/shared/{load-config-BZFgt8GH.mjs → load-config-uvbpmLwO.mjs} +1 -1
- package/dist/rolldown/shared/{normalize-string-or-regex-dAjLOSbp.mjs → normalize-string-or-regex-CNPF6PU9.mjs} +2 -2
- package/dist/rolldown/shared/{parse-DFts7Hyl.mjs → parse-1VOPJ1Lj.mjs} +2 -2
- package/dist/rolldown/shared/{prompt-Bm9aMQjm.mjs → prompt-DV1XbtjC.mjs} +1 -1
- package/dist/rolldown/shared/{resolve-tsconfig-DCdBlPeK.mjs → resolve-tsconfig-CcfxWrib.mjs} +15 -4
- package/dist/rolldown/shared/{rolldown-Cs2eRf4R.mjs → rolldown-BZYLlfsv.mjs} +1 -1
- package/dist/rolldown/shared/{rolldown-build-CNhzgsn2.mjs → rolldown-build-CgMNHFY3.mjs} +54 -65
- package/dist/rolldown/shared/{transform-DgZ3paSD.d.mts → transform-7xCUVrpL.d.mts} +2 -2
- package/dist/rolldown/shared/{watch-De_8Tgeq.mjs → watch-BX_aH1Oh.mjs} +6 -6
- package/dist/rolldown/utils-index.d.mts +3 -3
- package/dist/rolldown/utils-index.mjs +5 -5
- package/dist/tsdown/{build-5FURNVr0-D2dbyiC6.js → build-BZshaq8i-C7uS6x65.js} +1173 -93
- package/dist/tsdown/{detect-DN3DXXYt-8gmDjZqp.js → detect-B97OSl92-CgjrIbmD.js} +1 -1
- package/dist/tsdown/{dist-DTzJRoOQ.js → dist-BHLOKn-2.js} +526 -224
- package/dist/tsdown/index-types.d.ts +30 -12
- package/dist/tsdown/index.js +3 -4
- package/dist/tsdown/main-nVIFtu2j.js +938 -0
- package/dist/tsdown/npm_cjs_chunk_range.cjs +11 -11
- package/dist/tsdown/npm_cjs_chunk_semver.cjs +6 -6
- package/dist/tsdown/npm_entry_semver_functions_coerce.cjs +2 -2
- package/dist/tsdown/npm_entry_semver_functions_satisfies.cjs +1 -1
- package/dist/tsdown/npm_entry_semver_ranges_min-version.cjs +1 -1
- package/dist/tsdown/{resolver-DkvdaW3s-BeVUoOo-.js → resolver-DtsKFXi2-QB-x8j3e.js} +1 -1
- package/dist/tsdown/run.js +5 -6
- package/dist/tsdown/{tsc-Dr9kCkDm.js → tsc-WMktM0FW.js} +3 -3
- package/dist/tsdown/{tsc-context-CANQEB9U.js → tsc-context-DKufFI_s.js} +2 -2
- package/dist/vite/client/client.mjs +61 -27
- package/dist/vite/node/chunks/build.js +21 -21
- package/dist/vite/node/chunks/dist.js +1 -1
- package/dist/vite/node/chunks/dist2.js +136 -110
- package/dist/vite/node/chunks/lib.js +1 -1
- package/dist/vite/node/chunks/logger.js +36 -3
- package/dist/vite/node/chunks/node.js +490 -277
- package/dist/vite/node/chunks/postcss-import.js +11 -11
- package/dist/vite/node/cli.js +1 -2
- package/dist/vite/node/index.d.ts +29 -14
- package/dist/vite/node/module-runner.d.ts +1 -2
- package/dist/vite/node/module-runner.js +19 -18
- package/dist/vite/types/customEvent.d.ts +1 -1
- package/package.json +17 -23
- package/dist/pluginutils/filter/composable-filters.d.ts +0 -90
- package/dist/pluginutils/filter/composable-filters.js +0 -256
- package/dist/pluginutils/filter/filter-vite-plugins.d.ts +0 -28
- package/dist/pluginutils/filter/filter-vite-plugins.js +0 -75
- package/dist/pluginutils/filter/index.d.ts +0 -3
- package/dist/pluginutils/filter/index.js +0 -3
- package/dist/pluginutils/filter/simple-filters.d.ts +0 -71
- package/dist/pluginutils/filter/simple-filters.js +0 -70
- package/dist/pluginutils/index.d.ts +0 -1
- package/dist/pluginutils/index.js +0 -1
- package/dist/pluginutils/utils.d.ts +0 -2
- package/dist/pluginutils/utils.js +0 -17
- package/dist/tsdown/chunk-N93fKeF6.js +0 -34
- package/dist/tsdown/debug-CLlnG64L-BkAqwHVS.js +0 -16
- package/dist/tsdown/dist-Cv2Z0Bi_.js +0 -1012
- package/dist/tsdown/filename-DQnUJlio-D7-CzKqs.js +0 -29
- package/dist/tsdown/main-BNUO6D3N.js +0 -893
- package/dist/tsdown/node-B3Gdtau1.js +0 -268
- package/dist/vite/node/chunks/chunk.js +0 -35
- /package/dist/rolldown/shared/{define-config-DJOr6Iwt.mjs → define-config-Demdg3_4.mjs} +0 -0
- /package/dist/rolldown/shared/{logging-C6h4g8dA.d.mts → logging-BSNejiLS.d.mts} +0 -0
- /package/dist/rolldown/shared/{logs-D80CXhvg.mjs → logs-aMKUxRpj.mjs} +0 -0
- /package/dist/rolldown/shared/{misc-DJYbNKZX.mjs → misc-CoQm4NHO.mjs} +0 -0
- /package/dist/tsdown/{dist-JaOach5K.js → dist-CZtGyfn3.js} +0 -0
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as ee, t as at } from "./dist-Cv2Z0Bi_.js";
|
|
5
|
-
import { n as globalContext, r as invalidateContextFile, t as createContext } from "./tsc-context-CANQEB9U.js";
|
|
1
|
+
import { A as __commonJSMin, M as __toESM, a as createDebug, j as __exportAll } from "./main-nVIFtu2j.js";
|
|
2
|
+
import { _ as filename_dts_to, b as replaceTemplateName, c as RE_CSS, d as RE_JS, f as RE_JSON, g as RE_VUE, h as RE_TS, l as RE_DTS, m as RE_ROLLDOWN_RUNTIME, o as at, p as RE_NODE_MODULES, s as ee, u as RE_DTS_MAP, v as filename_js_to_dts, x as resolveTemplateFn, y as filename_to_dts } from "./build-BZshaq8i-C7uS6x65.js";
|
|
3
|
+
import { n as globalContext, r as invalidateContextFile, t as createContext } from "./tsc-context-DKufFI_s.js";
|
|
6
4
|
import { createRequire } from "node:module";
|
|
7
5
|
import process from "node:process";
|
|
8
6
|
import { fork, spawn } from "node:child_process";
|
|
9
7
|
import path, { dirname, extname } from "node:path";
|
|
8
|
+
import { existsSync } from "node:fs";
|
|
10
9
|
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
11
10
|
import { importerId, include } from "@voidzero-dev/vite-plus-core/rolldown/filter";
|
|
12
|
-
import { existsSync } from "node:fs";
|
|
13
11
|
import { tmpdir } from "node:os";
|
|
14
12
|
import { ResolverFactory, isolatedDeclarationSync } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
|
|
15
13
|
//#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
@@ -654,11 +652,9 @@ function addMappingInternal(skipable, map, mapping) {
|
|
|
654
652
|
return addSegmentInternal(skipable, map, generated.line - 1, generated.column, source, original.line - 1, original.column, name, content);
|
|
655
653
|
}
|
|
656
654
|
//#endregion
|
|
657
|
-
//#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@8.0.0-rc.
|
|
658
|
-
const
|
|
659
|
-
const
|
|
660
|
-
const nonASCIIidentifierStart$1 = new RegExp("[" + nonASCIIidentifierStartChars$1 + "]");
|
|
661
|
-
const nonASCIIidentifier$1 = new RegExp("[" + nonASCIIidentifierStartChars$1 + nonASCIIidentifierChars$1 + "]");
|
|
655
|
+
//#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@8.0.0-rc.6/node_modules/@babel/helper-validator-identifier/lib/index.js
|
|
656
|
+
const nonASCIIidentifierStart$1 = /* @__PURE__ */ new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]");
|
|
657
|
+
const nonASCIIidentifier$1 = /* @__PURE__ */ new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・]");
|
|
662
658
|
const astralIdentifierStartCodes$1 = [
|
|
663
659
|
0,
|
|
664
660
|
11,
|
|
@@ -1718,7 +1714,7 @@ function isKeyword$1(word) {
|
|
|
1718
1714
|
return keywords$2.has(word);
|
|
1719
1715
|
}
|
|
1720
1716
|
//#endregion
|
|
1721
|
-
//#region ../../node_modules/.pnpm/@babel+helper-string-parser@8.0.0-rc.
|
|
1717
|
+
//#region ../../node_modules/.pnpm/@babel+helper-string-parser@8.0.0-rc.6/node_modules/@babel/helper-string-parser/lib/index.js
|
|
1722
1718
|
var _isDigit$1 = function isDigit(code) {
|
|
1723
1719
|
return code >= 48 && code <= 57;
|
|
1724
1720
|
};
|
|
@@ -1938,7 +1934,7 @@ function readCodePoint$1(input, pos, lineStart, curLine, throwOnInvalid, errors)
|
|
|
1938
1934
|
};
|
|
1939
1935
|
}
|
|
1940
1936
|
//#endregion
|
|
1941
|
-
//#region ../../node_modules/.pnpm/@babel+types@8.0.0-rc.
|
|
1937
|
+
//#region ../../node_modules/.pnpm/@babel+types@8.0.0-rc.6/node_modules/@babel/types/lib/index.js
|
|
1942
1938
|
var lib_exports = /* @__PURE__ */ __exportAll({
|
|
1943
1939
|
ACCESSOR_TYPES: () => ACCESSOR_TYPES,
|
|
1944
1940
|
ALIAS_KEYS: () => ALIAS_KEYS,
|
|
@@ -2842,7 +2838,7 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
2842
2838
|
isModuleExpression: () => isModuleExpression,
|
|
2843
2839
|
isModuleSpecifier: () => isModuleSpecifier,
|
|
2844
2840
|
isNewExpression: () => isNewExpression$1,
|
|
2845
|
-
isNode: () => isNode$
|
|
2841
|
+
isNode: () => isNode$2,
|
|
2846
2842
|
isNodesEquivalent: () => isNodesEquivalent,
|
|
2847
2843
|
isNullLiteral: () => isNullLiteral,
|
|
2848
2844
|
isNullLiteralTypeAnnotation: () => isNullLiteralTypeAnnotation,
|
|
@@ -5914,7 +5910,7 @@ function defineType$5(type, opts = {}) {
|
|
|
5914
5910
|
if (opts.unionShape) NODE_UNION_SHAPES__PRIVATE[type] = opts.unionShape;
|
|
5915
5911
|
store[type] = opts;
|
|
5916
5912
|
}
|
|
5917
|
-
const utils =
|
|
5913
|
+
const utils = /*#__PURE__*/ Object.defineProperty({
|
|
5918
5914
|
__proto__: null,
|
|
5919
5915
|
ALIAS_KEYS,
|
|
5920
5916
|
BUILDER_KEYS,
|
|
@@ -11641,7 +11637,7 @@ function SpreadProperty(argument) {
|
|
|
11641
11637
|
deprecationWarning("SpreadProperty", "SpreadElement", "The node type ");
|
|
11642
11638
|
return spreadElement(argument);
|
|
11643
11639
|
}
|
|
11644
|
-
const b =
|
|
11640
|
+
const b = /*#__PURE__*/ Object.defineProperty({
|
|
11645
11641
|
__proto__: null,
|
|
11646
11642
|
anyTypeAnnotation,
|
|
11647
11643
|
argumentPlaceholder,
|
|
@@ -11937,11 +11933,11 @@ function buildChildren(node) {
|
|
|
11937
11933
|
}
|
|
11938
11934
|
return elements;
|
|
11939
11935
|
}
|
|
11940
|
-
function isNode$
|
|
11936
|
+
function isNode$2(node) {
|
|
11941
11937
|
return !!(node && VISITOR_KEYS$2[node.type]);
|
|
11942
11938
|
}
|
|
11943
11939
|
function assertNode(node) {
|
|
11944
|
-
if (!isNode$
|
|
11940
|
+
if (!isNode$2(node)) {
|
|
11945
11941
|
const type = node?.type ?? JSON.stringify(node);
|
|
11946
11942
|
throw new TypeError(`Not a valid node of type "${type}"`);
|
|
11947
11943
|
}
|
|
@@ -13653,7 +13649,7 @@ const react = {
|
|
|
13653
13649
|
buildChildren
|
|
13654
13650
|
};
|
|
13655
13651
|
//#endregion
|
|
13656
|
-
//#region ../../node_modules/.pnpm/@babel+generator@8.0.0-rc.
|
|
13652
|
+
//#region ../../node_modules/.pnpm/@babel+generator@8.0.0-rc.6/node_modules/@babel/generator/lib/index.js
|
|
13657
13653
|
var import_jsesc = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
13658
13654
|
const object = {};
|
|
13659
13655
|
const hasOwnProperty = object.hasOwnProperty;
|
|
@@ -13884,7 +13880,7 @@ var SourceMap = class {
|
|
|
13884
13880
|
getRawMappings() {
|
|
13885
13881
|
return this._rawMappings ||= allMappings(this._map);
|
|
13886
13882
|
}
|
|
13887
|
-
mark(generated, line, column, identifierName, identifierNamePos, filename) {
|
|
13883
|
+
mark(generated, generatedIdentifierName, line, column, identifierName, identifierNamePos, filename) {
|
|
13888
13884
|
this._rawMappings = void 0;
|
|
13889
13885
|
let originalMapping;
|
|
13890
13886
|
if (line != null) if (this._inputMap) {
|
|
@@ -13892,7 +13888,8 @@ var SourceMap = class {
|
|
|
13892
13888
|
line,
|
|
13893
13889
|
column
|
|
13894
13890
|
});
|
|
13895
|
-
if (
|
|
13891
|
+
if (originalMapping.name && (identifierNamePos || identifierName != null && originalMapping.column === column)) identifierName = originalMapping.name;
|
|
13892
|
+
else if (identifierNamePos) {
|
|
13896
13893
|
const originalIdentifierMapping = originalPositionFor(this._inputMap, identifierNamePos);
|
|
13897
13894
|
if (originalIdentifierMapping.name) identifierName = originalIdentifierMapping.name;
|
|
13898
13895
|
}
|
|
@@ -13902,6 +13899,7 @@ var SourceMap = class {
|
|
|
13902
13899
|
line,
|
|
13903
13900
|
column
|
|
13904
13901
|
};
|
|
13902
|
+
if (identifierName != null && identifierName === generatedIdentifierName) identifierName = null;
|
|
13905
13903
|
maybeAddMapping(this._map, {
|
|
13906
13904
|
name: identifierName,
|
|
13907
13905
|
generated,
|
|
@@ -13974,9 +13972,9 @@ var Buffer$1 = class {
|
|
|
13974
13972
|
};
|
|
13975
13973
|
return result;
|
|
13976
13974
|
}
|
|
13977
|
-
append(str, maybeNewline) {
|
|
13975
|
+
append(str, maybeNewline, ignoreMapping = false) {
|
|
13978
13976
|
this._flush();
|
|
13979
|
-
this._append(str, maybeNewline);
|
|
13977
|
+
this._append(str, maybeNewline, ignoreMapping);
|
|
13980
13978
|
}
|
|
13981
13979
|
appendChar(char) {
|
|
13982
13980
|
this._flush();
|
|
@@ -14005,12 +14003,12 @@ var Buffer$1 = class {
|
|
|
14005
14003
|
if (this._map) {
|
|
14006
14004
|
const sourcePos = this._sourcePosition;
|
|
14007
14005
|
if (useSourcePos && sourcePos) {
|
|
14008
|
-
this._map.mark(position, sourcePos.line, sourcePos.column, isSpace ? void 0 : sourcePos.identifierName, isSpace ? void 0 : sourcePos.identifierNamePos, sourcePos.filename);
|
|
14006
|
+
this._map.mark(position, null, sourcePos.line, sourcePos.column, isSpace ? void 0 : sourcePos.identifierName, isSpace ? void 0 : sourcePos.identifierNamePos, sourcePos.filename);
|
|
14009
14007
|
if (!isSpace && this._canMarkIdName) {
|
|
14010
14008
|
sourcePos.identifierName = void 0;
|
|
14011
14009
|
sourcePos.identifierNamePos = void 0;
|
|
14012
14010
|
}
|
|
14013
|
-
} else this._map.mark(position);
|
|
14011
|
+
} else this._map.mark(position, null);
|
|
14014
14012
|
}
|
|
14015
14013
|
position.column += repeat;
|
|
14016
14014
|
} else {
|
|
@@ -14018,7 +14016,7 @@ var Buffer$1 = class {
|
|
|
14018
14016
|
position.column = 0;
|
|
14019
14017
|
}
|
|
14020
14018
|
}
|
|
14021
|
-
_append(str, maybeNewline) {
|
|
14019
|
+
_append(str, maybeNewline, ignoreMapping) {
|
|
14022
14020
|
const len = str.length;
|
|
14023
14021
|
const position = this._position;
|
|
14024
14022
|
const sourcePos = this._sourcePosition;
|
|
@@ -14029,7 +14027,7 @@ var Buffer$1 = class {
|
|
|
14029
14027
|
this._str = str;
|
|
14030
14028
|
this._appendCount = 0;
|
|
14031
14029
|
} else this._str += str;
|
|
14032
|
-
const hasMap = this._map !== null;
|
|
14030
|
+
const hasMap = !ignoreMapping && this._map !== null;
|
|
14033
14031
|
if (!maybeNewline && !hasMap) {
|
|
14034
14032
|
position.column += len;
|
|
14035
14033
|
return;
|
|
@@ -14042,14 +14040,14 @@ var Buffer$1 = class {
|
|
|
14042
14040
|
}
|
|
14043
14041
|
let i = str.indexOf("\n");
|
|
14044
14042
|
let last = 0;
|
|
14045
|
-
if (hasMap && i !== 0) this._map.mark(position, line, column, identifierName, identifierNamePos, filename);
|
|
14043
|
+
if (hasMap && i !== 0) this._map.mark(position, str, line, column, identifierName, identifierNamePos, filename);
|
|
14046
14044
|
while (i !== -1) {
|
|
14047
14045
|
position.line++;
|
|
14048
14046
|
position.column = 0;
|
|
14049
14047
|
last = i + 1;
|
|
14050
14048
|
if (last < len && line !== void 0) {
|
|
14051
14049
|
line++;
|
|
14052
|
-
if (hasMap) this._map.mark(position, line, 0, void 0, void 0, filename);
|
|
14050
|
+
if (hasMap) this._map.mark(position, str, line, 0, void 0, void 0, filename);
|
|
14053
14051
|
}
|
|
14054
14052
|
i = str.indexOf("\n", last);
|
|
14055
14053
|
}
|
|
@@ -14100,13 +14098,16 @@ var Buffer$1 = class {
|
|
|
14100
14098
|
_normalizePosition(prop, loc, columnOffset) {
|
|
14101
14099
|
this._flush();
|
|
14102
14100
|
const pos = loc[prop];
|
|
14103
|
-
const target = this._sourcePosition;
|
|
14104
14101
|
if (pos) {
|
|
14105
|
-
|
|
14106
|
-
|
|
14107
|
-
target.filename = loc.filename;
|
|
14102
|
+
this.setSourcePosition(pos.line, Math.max(pos.column + columnOffset, 0));
|
|
14103
|
+
this._sourcePosition.filename = loc.filename;
|
|
14108
14104
|
}
|
|
14109
14105
|
}
|
|
14106
|
+
setSourcePosition(line, column) {
|
|
14107
|
+
const target = this._sourcePosition;
|
|
14108
|
+
target.line = line;
|
|
14109
|
+
target.column = column;
|
|
14110
|
+
}
|
|
14110
14111
|
getCurrentColumn() {
|
|
14111
14112
|
return this._position.column + (this._queuedChar ? 1 : 0);
|
|
14112
14113
|
}
|
|
@@ -14337,7 +14338,7 @@ function Identifier$1(node, parent, parentId, tokenContext, getRawIdentifier) {
|
|
|
14337
14338
|
}
|
|
14338
14339
|
return parentId === 69 && parent.left === node && node.name === "async" && !parent.await;
|
|
14339
14340
|
}
|
|
14340
|
-
const parens =
|
|
14341
|
+
const parens = /*#__PURE__*/ Object.defineProperty({
|
|
14341
14342
|
__proto__: null,
|
|
14342
14343
|
ArrowFunctionExpression: ConditionalExpression$1,
|
|
14343
14344
|
AssignmentExpression: AssignmentExpression$1,
|
|
@@ -14969,6 +14970,9 @@ function _shouldPrintArrowParamsParens(node) {
|
|
|
14969
14970
|
if (this.format.retainLines) return true;
|
|
14970
14971
|
return false;
|
|
14971
14972
|
}
|
|
14973
|
+
function isRenamedIdentifier(id) {
|
|
14974
|
+
return !!id.loc?.identifierName && id.loc.identifierName !== id.name;
|
|
14975
|
+
}
|
|
14972
14976
|
function _getFuncIdName(idNode, parent) {
|
|
14973
14977
|
let id = idNode;
|
|
14974
14978
|
if (!id && parent) {
|
|
@@ -14979,18 +14983,22 @@ function _getFuncIdName(idNode, parent) {
|
|
|
14979
14983
|
if (!parent.computed || parent.key.type === "StringLiteral") id = parent.key;
|
|
14980
14984
|
} else if (parentType === "ClassPrivateProperty" || parentType === "ClassAccessorProperty") id = parent.key;
|
|
14981
14985
|
}
|
|
14982
|
-
if (!id) return;
|
|
14986
|
+
if (!id?.loc) return;
|
|
14983
14987
|
let nameInfo;
|
|
14984
|
-
if (id.type === "Identifier")
|
|
14985
|
-
|
|
14986
|
-
|
|
14987
|
-
|
|
14988
|
-
|
|
14989
|
-
|
|
14990
|
-
|
|
14991
|
-
|
|
14992
|
-
|
|
14993
|
-
|
|
14988
|
+
if (id.type === "Identifier") {
|
|
14989
|
+
if (!isRenamedIdentifier(id)) return;
|
|
14990
|
+
nameInfo = {
|
|
14991
|
+
pos: id.loc.start,
|
|
14992
|
+
name: id.loc.identifierName
|
|
14993
|
+
};
|
|
14994
|
+
} else if (id.type === "PrivateName") {
|
|
14995
|
+
if (!isRenamedIdentifier(id.id)) return;
|
|
14996
|
+
nameInfo = {
|
|
14997
|
+
pos: id.loc.start,
|
|
14998
|
+
name: "#" + id.id.loc.identifierName
|
|
14999
|
+
};
|
|
15000
|
+
} else if (id.type === "StringLiteral") nameInfo = {
|
|
15001
|
+
pos: id.loc.start,
|
|
14994
15002
|
name: id.value
|
|
14995
15003
|
};
|
|
14996
15004
|
return nameInfo;
|
|
@@ -15792,7 +15800,7 @@ function _getRawIdentifier(node) {
|
|
|
15792
15800
|
return lastRawIdentResult = node.name;
|
|
15793
15801
|
}
|
|
15794
15802
|
function Identifier(node) {
|
|
15795
|
-
if (this._buf._map
|
|
15803
|
+
if (this._buf._map && node.loc?.identifierName && node.loc.identifierName !== node.name) this.sourceIdentifierName(node.loc.identifierName);
|
|
15796
15804
|
this.word(this.tokenMap ? lastRawIdentResult : node.name);
|
|
15797
15805
|
}
|
|
15798
15806
|
function ArgumentPlaceholder() {
|
|
@@ -16758,7 +16766,7 @@ function JSXClosingFragment() {
|
|
|
16758
16766
|
this.token("</");
|
|
16759
16767
|
this.tokenChar(62);
|
|
16760
16768
|
}
|
|
16761
|
-
const generatorFunctions =
|
|
16769
|
+
const generatorFunctions = /*#__PURE__*/ Object.defineProperty({
|
|
16762
16770
|
__proto__: null,
|
|
16763
16771
|
AnyTypeAnnotation,
|
|
16764
16772
|
ArgumentPlaceholder,
|
|
@@ -17479,7 +17487,8 @@ var Printer = class {
|
|
|
17479
17487
|
const spacesCount = count > 0 ? column : column - this._buf.getCurrentColumn();
|
|
17480
17488
|
if (spacesCount > 0) {
|
|
17481
17489
|
const spaces = this._originalCode ? this._originalCode.slice(index - spacesCount, index).replace(/[^\t\v\f\uFEFF\p{Space_Separator}]/gu, " ") : " ".repeat(spacesCount);
|
|
17482
|
-
this.
|
|
17490
|
+
this._buf.append(spaces, false, true);
|
|
17491
|
+
this._buf.setSourcePosition(line, column);
|
|
17483
17492
|
this.setLastChar(32);
|
|
17484
17493
|
}
|
|
17485
17494
|
}
|
|
@@ -17857,7 +17866,7 @@ function generate(ast, opts = {}, code) {
|
|
|
17857
17866
|
return new Printer(normalizeOptions(code, opts, ast), opts.sourceMaps ? new SourceMap(opts, code) : null, ast.tokens, typeof code === "string" ? code : null).generate(ast);
|
|
17858
17867
|
}
|
|
17859
17868
|
//#endregion
|
|
17860
|
-
//#region ../../node_modules/.pnpm/@babel+parser@8.0.0-rc.
|
|
17869
|
+
//#region ../../node_modules/.pnpm/@babel+parser@8.0.0-rc.6/node_modules/@babel/parser/lib/index.js
|
|
17861
17870
|
var Position = class {
|
|
17862
17871
|
constructor(line, col, index) {
|
|
17863
17872
|
this.line = void 0;
|
|
@@ -17937,7 +17946,6 @@ const StandardErrors = {
|
|
|
17937
17946
|
ConstructorIsAsync: "Constructor can't be an async function.",
|
|
17938
17947
|
ConstructorIsGenerator: "Constructor can't be a generator.",
|
|
17939
17948
|
DeclarationMissingInitializer: ({ kind }) => `Missing initializer in ${kind} declaration.`,
|
|
17940
|
-
DecoratorAbstractMethod: "Decorators can't be used with an abstract method.",
|
|
17941
17949
|
DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",
|
|
17942
17950
|
DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",
|
|
17943
17951
|
DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
|
|
@@ -18875,10 +18883,8 @@ const types = {
|
|
|
18875
18883
|
j_cTag: new TokContext("</tag"),
|
|
18876
18884
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
18877
18885
|
};
|
|
18878
|
-
const
|
|
18879
|
-
const
|
|
18880
|
-
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
18881
|
-
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
18886
|
+
const nonASCIIidentifierStart = /* @__PURE__ */ new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]");
|
|
18887
|
+
const nonASCIIidentifier = /* @__PURE__ */ new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・]");
|
|
18882
18888
|
const astralIdentifierStartCodes = [
|
|
18883
18889
|
0,
|
|
18884
18890
|
11,
|
|
@@ -26818,10 +26824,6 @@ var StatementParser = class extends ExpressionParser {
|
|
|
26818
26824
|
decorators = [];
|
|
26819
26825
|
}
|
|
26820
26826
|
this.parseClassMember(classBody, member, state);
|
|
26821
|
-
if (member.decorators && member.decorators.length > 0) {
|
|
26822
|
-
if (this.hasPlugin("typescript") && (this.hasPlugin("estree") ? member.type === "TSAbstractMethodDefinition" : member.type === "TSDeclareMethod")) this.raise(Errors.DecoratorAbstractMethod, member);
|
|
26823
|
-
if (member.kind === "constructor") this.raise(Errors.DecoratorConstructor, member);
|
|
26824
|
-
}
|
|
26825
26827
|
}
|
|
26826
26828
|
this.state.strict = oldStrict;
|
|
26827
26829
|
this.next();
|
|
@@ -26900,6 +26902,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
26900
26902
|
let allowsDirectSuper = false;
|
|
26901
26903
|
if (isConstructor) {
|
|
26902
26904
|
publicMethod.kind = "constructor";
|
|
26905
|
+
if (publicMethod.decorators && publicMethod.decorators.length > 0) this.raise(Errors.DecoratorConstructor, member);
|
|
26903
26906
|
if (state.hadConstructor && !this.hasPlugin("typescript")) this.raise(Errors.DuplicateConstructor, key);
|
|
26904
26907
|
if (isConstructor && this.hasPlugin("typescript") && member.override) this.raise(Errors.OverrideOnConstructor, key);
|
|
26905
26908
|
state.hadConstructor = true;
|
|
@@ -27076,7 +27079,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
27076
27079
|
}
|
|
27077
27080
|
throw this.unexpected(null, 2);
|
|
27078
27081
|
}
|
|
27079
|
-
eatExportStar(
|
|
27082
|
+
eatExportStar(_) {
|
|
27080
27083
|
return this.eat(51);
|
|
27081
27084
|
}
|
|
27082
27085
|
maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) {
|
|
@@ -27457,6 +27460,7 @@ const TSErrors = ParseErrorEnum`typescript`({
|
|
|
27457
27460
|
DeclareAccessor: ({ kind }) => `'declare' is not allowed in ${kind}ters.`,
|
|
27458
27461
|
DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.",
|
|
27459
27462
|
DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.",
|
|
27463
|
+
DecoratorAbstractMethod: ({ kind }) => `Decorators can't be used with ${kind.startsWith("a") ? "an" : "a"} ${kind}.`,
|
|
27460
27464
|
DuplicateAccessibilityModifier: ({ modifier }) => `Accessibility modifier already seen: '${modifier}'.`,
|
|
27461
27465
|
DuplicateModifier: ({ modifier }) => `Duplicate modifier: '${modifier}'.`,
|
|
27462
27466
|
EmptyHeritageClauseType: ({ token }) => `'${token}' list cannot be empty.`,
|
|
@@ -29078,6 +29082,10 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
29078
29082
|
};
|
|
29079
29083
|
if (member.declare) this.tsInAmbientContext(callParseClassMemberWithIsStatic);
|
|
29080
29084
|
else callParseClassMemberWithIsStatic();
|
|
29085
|
+
if (member.decorators && member.decorators.length > 0 && !this.hasPlugin("decorators-legacy")) {
|
|
29086
|
+
if (member.type === "TSAbstractMethodDefinition" || member.type === "TSDeclareMethod") this.raise(TSErrors.DecoratorAbstractMethod, member, { kind: "abstract method" });
|
|
29087
|
+
else if (member.type === "ClassProperty" && member.abstract || member.type === "ClassProperty" && member.declare || member.type === "TSAbstractPropertyDefinition" || member.type === "PropertyDefinition" && member.declare) this.raise(TSErrors.DecoratorAbstractMethod, member, { kind: member.declare ? "declare field" : "abstract field" });
|
|
29088
|
+
}
|
|
29081
29089
|
}
|
|
29082
29090
|
parseClassMemberWithIsStatic(classBody, member, state, isStatic) {
|
|
29083
29091
|
const idx = this.tsTryParseIndexSignature(member);
|
|
@@ -30241,11 +30249,11 @@ var SyncWalker = class extends WalkerBase {
|
|
|
30241
30249
|
const nodes = value;
|
|
30242
30250
|
for (let i = 0; i < nodes.length; i += 1) {
|
|
30243
30251
|
const item = nodes[i];
|
|
30244
|
-
if (isNode(item)) {
|
|
30252
|
+
if (isNode$1(item)) {
|
|
30245
30253
|
if (!this.visit(item, node, key, i)) i--;
|
|
30246
30254
|
}
|
|
30247
30255
|
}
|
|
30248
|
-
} else if (isNode(value)) this.visit(value, node, key, null);
|
|
30256
|
+
} else if (isNode$1(value)) this.visit(value, node, key, null);
|
|
30249
30257
|
}
|
|
30250
30258
|
}
|
|
30251
30259
|
if (this.leave) {
|
|
@@ -30274,6 +30282,121 @@ var SyncWalker = class extends WalkerBase {
|
|
|
30274
30282
|
* @param {unknown} value
|
|
30275
30283
|
* @returns {value is Node}
|
|
30276
30284
|
*/
|
|
30285
|
+
function isNode$1(value) {
|
|
30286
|
+
return value !== null && typeof value === "object" && "type" in value && typeof value.type === "string";
|
|
30287
|
+
}
|
|
30288
|
+
//#endregion
|
|
30289
|
+
//#region ../../node_modules/.pnpm/estree-walker@3.0.3/node_modules/estree-walker/src/async.js
|
|
30290
|
+
/**
|
|
30291
|
+
* @typedef { import('estree').Node} Node
|
|
30292
|
+
* @typedef { import('./walker.js').WalkerContext} WalkerContext
|
|
30293
|
+
* @typedef {(
|
|
30294
|
+
* this: WalkerContext,
|
|
30295
|
+
* node: Node,
|
|
30296
|
+
* parent: Node | null,
|
|
30297
|
+
* key: string | number | symbol | null | undefined,
|
|
30298
|
+
* index: number | null | undefined
|
|
30299
|
+
* ) => Promise<void>} AsyncHandler
|
|
30300
|
+
*/
|
|
30301
|
+
var AsyncWalker = class extends WalkerBase {
|
|
30302
|
+
/**
|
|
30303
|
+
*
|
|
30304
|
+
* @param {AsyncHandler} [enter]
|
|
30305
|
+
* @param {AsyncHandler} [leave]
|
|
30306
|
+
*/
|
|
30307
|
+
constructor(enter, leave) {
|
|
30308
|
+
super();
|
|
30309
|
+
/** @type {boolean} */
|
|
30310
|
+
this.should_skip = false;
|
|
30311
|
+
/** @type {boolean} */
|
|
30312
|
+
this.should_remove = false;
|
|
30313
|
+
/** @type {Node | null} */
|
|
30314
|
+
this.replacement = null;
|
|
30315
|
+
/** @type {WalkerContext} */
|
|
30316
|
+
this.context = {
|
|
30317
|
+
skip: () => this.should_skip = true,
|
|
30318
|
+
remove: () => this.should_remove = true,
|
|
30319
|
+
replace: (node) => this.replacement = node
|
|
30320
|
+
};
|
|
30321
|
+
/** @type {AsyncHandler | undefined} */
|
|
30322
|
+
this.enter = enter;
|
|
30323
|
+
/** @type {AsyncHandler | undefined} */
|
|
30324
|
+
this.leave = leave;
|
|
30325
|
+
}
|
|
30326
|
+
/**
|
|
30327
|
+
* @template {Node} Parent
|
|
30328
|
+
* @param {Node} node
|
|
30329
|
+
* @param {Parent | null} parent
|
|
30330
|
+
* @param {keyof Parent} [prop]
|
|
30331
|
+
* @param {number | null} [index]
|
|
30332
|
+
* @returns {Promise<Node | null>}
|
|
30333
|
+
*/
|
|
30334
|
+
async visit(node, parent, prop, index) {
|
|
30335
|
+
if (node) {
|
|
30336
|
+
if (this.enter) {
|
|
30337
|
+
const _should_skip = this.should_skip;
|
|
30338
|
+
const _should_remove = this.should_remove;
|
|
30339
|
+
const _replacement = this.replacement;
|
|
30340
|
+
this.should_skip = false;
|
|
30341
|
+
this.should_remove = false;
|
|
30342
|
+
this.replacement = null;
|
|
30343
|
+
await this.enter.call(this.context, node, parent, prop, index);
|
|
30344
|
+
if (this.replacement) {
|
|
30345
|
+
node = this.replacement;
|
|
30346
|
+
this.replace(parent, prop, index, node);
|
|
30347
|
+
}
|
|
30348
|
+
if (this.should_remove) this.remove(parent, prop, index);
|
|
30349
|
+
const skipped = this.should_skip;
|
|
30350
|
+
const removed = this.should_remove;
|
|
30351
|
+
this.should_skip = _should_skip;
|
|
30352
|
+
this.should_remove = _should_remove;
|
|
30353
|
+
this.replacement = _replacement;
|
|
30354
|
+
if (skipped) return node;
|
|
30355
|
+
if (removed) return null;
|
|
30356
|
+
}
|
|
30357
|
+
/** @type {keyof Node} */
|
|
30358
|
+
let key;
|
|
30359
|
+
for (key in node) {
|
|
30360
|
+
/** @type {unknown} */
|
|
30361
|
+
const value = node[key];
|
|
30362
|
+
if (value && typeof value === "object") {
|
|
30363
|
+
if (Array.isArray(value)) {
|
|
30364
|
+
const nodes = value;
|
|
30365
|
+
for (let i = 0; i < nodes.length; i += 1) {
|
|
30366
|
+
const item = nodes[i];
|
|
30367
|
+
if (isNode(item)) {
|
|
30368
|
+
if (!await this.visit(item, node, key, i)) i--;
|
|
30369
|
+
}
|
|
30370
|
+
}
|
|
30371
|
+
} else if (isNode(value)) await this.visit(value, node, key, null);
|
|
30372
|
+
}
|
|
30373
|
+
}
|
|
30374
|
+
if (this.leave) {
|
|
30375
|
+
const _replacement = this.replacement;
|
|
30376
|
+
const _should_remove = this.should_remove;
|
|
30377
|
+
this.replacement = null;
|
|
30378
|
+
this.should_remove = false;
|
|
30379
|
+
await this.leave.call(this.context, node, parent, prop, index);
|
|
30380
|
+
if (this.replacement) {
|
|
30381
|
+
node = this.replacement;
|
|
30382
|
+
this.replace(parent, prop, index, node);
|
|
30383
|
+
}
|
|
30384
|
+
if (this.should_remove) this.remove(parent, prop, index);
|
|
30385
|
+
const removed = this.should_remove;
|
|
30386
|
+
this.replacement = _replacement;
|
|
30387
|
+
this.should_remove = _should_remove;
|
|
30388
|
+
if (removed) return null;
|
|
30389
|
+
}
|
|
30390
|
+
}
|
|
30391
|
+
return node;
|
|
30392
|
+
}
|
|
30393
|
+
};
|
|
30394
|
+
/**
|
|
30395
|
+
* Ducktype a node.
|
|
30396
|
+
*
|
|
30397
|
+
* @param {unknown} value
|
|
30398
|
+
* @returns {value is Node}
|
|
30399
|
+
*/
|
|
30277
30400
|
function isNode(value) {
|
|
30278
30401
|
return value !== null && typeof value === "object" && "type" in value && typeof value.type === "string";
|
|
30279
30402
|
}
|
|
@@ -30295,6 +30418,17 @@ function isNode(value) {
|
|
|
30295
30418
|
function walk(ast, { enter, leave }) {
|
|
30296
30419
|
return new SyncWalker(enter, leave).visit(ast, null);
|
|
30297
30420
|
}
|
|
30421
|
+
/**
|
|
30422
|
+
* @param {Node} ast
|
|
30423
|
+
* @param {{
|
|
30424
|
+
* enter?: AsyncHandler
|
|
30425
|
+
* leave?: AsyncHandler
|
|
30426
|
+
* }} walker
|
|
30427
|
+
* @returns {Promise<Node | null>}
|
|
30428
|
+
*/
|
|
30429
|
+
async function asyncWalk(ast, { enter, leave }) {
|
|
30430
|
+
return await new AsyncWalker(enter, leave).visit(ast, null);
|
|
30431
|
+
}
|
|
30298
30432
|
//#endregion
|
|
30299
30433
|
//#region ../../node_modules/.pnpm/ast-kit@3.0.0-beta.1/node_modules/ast-kit/dist/index.js
|
|
30300
30434
|
/**
|
|
@@ -30468,6 +30602,16 @@ function resolveTemplateLiteral(node) {
|
|
|
30468
30602
|
* @returns {T | null} - The modified AST node or null if the node is removed.
|
|
30469
30603
|
*/
|
|
30470
30604
|
const walkAST = walk;
|
|
30605
|
+
/**
|
|
30606
|
+
* Asynchronously walks the AST starting from the given node,
|
|
30607
|
+
* applying the provided handlers to each node encountered.
|
|
30608
|
+
*
|
|
30609
|
+
* @template T - The type of the AST node.
|
|
30610
|
+
* @param {T} node - The root node of the AST.
|
|
30611
|
+
* @param {WalkHandlers<T, Promise<void>>} handlers - The handlers to be applied to each node.
|
|
30612
|
+
* @returns {Promise<T | null>} - A promise that resolves to the modified AST or null if the AST is empty.
|
|
30613
|
+
*/
|
|
30614
|
+
const walkASTAsync = asyncWalk;
|
|
30471
30615
|
//#endregion
|
|
30472
30616
|
//#region ../../node_modules/.pnpm/dts-resolver@3.0.0_oxc-resolver@11.19.1_@emnapi+core@1.10.0_@emnapi+runtime@1.10.0_/node_modules/dts-resolver/dist/index.mjs
|
|
30473
30617
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
@@ -30581,7 +30725,7 @@ function ensureValue(value) {
|
|
|
30581
30725
|
return value && ALLOW_EXTENSIONS.has(extname(value)) ? value.replaceAll("\\", "/") : null;
|
|
30582
30726
|
}
|
|
30583
30727
|
//#endregion
|
|
30584
|
-
//#region ../../node_modules/.pnpm/rolldown-plugin-dts@0.25.
|
|
30728
|
+
//#region ../../node_modules/.pnpm/rolldown-plugin-dts@0.25.2_@typescript+native-preview@7.0.0-dev.20260122.2_oxc-resolver_8152cf0e534aee518f40abeb59f8494a/node_modules/rolldown-plugin-dts/dist/index.mjs
|
|
30585
30729
|
function createDtsInputPlugin({ sideEffects }) {
|
|
30586
30730
|
return {
|
|
30587
30731
|
name: "rolldown-plugin-dts:dts-input",
|
|
@@ -30618,7 +30762,8 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
|
30618
30762
|
let declarationIdx = 0;
|
|
30619
30763
|
const declarationMap = /* @__PURE__ */ new Map();
|
|
30620
30764
|
const commentsMap = /* @__PURE__ */ new Map();
|
|
30621
|
-
const
|
|
30765
|
+
const moduleExportsMap = /* @__PURE__ */ new Map();
|
|
30766
|
+
const warnedCjsDtsInputs = /* @__PURE__ */ new Set();
|
|
30622
30767
|
return {
|
|
30623
30768
|
name: "rolldown-plugin-dts:fake-js",
|
|
30624
30769
|
outputOptions(options) {
|
|
@@ -30656,7 +30801,7 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
|
30656
30801
|
}
|
|
30657
30802
|
}
|
|
30658
30803
|
};
|
|
30659
|
-
function transform(code, id) {
|
|
30804
|
+
async function transform(code, id) {
|
|
30660
30805
|
let file;
|
|
30661
30806
|
try {
|
|
30662
30807
|
file = parse$1(code, {
|
|
@@ -30669,8 +30814,12 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
|
30669
30814
|
throw new Error(`Failed to parse ${id}. This may be caused by a syntax error in the declaration file or a bug in the plugin. Please report this issue to https://github.com/sxzz/rolldown-plugin-dts\n${error}`, { cause: error });
|
|
30670
30815
|
}
|
|
30671
30816
|
const { program, comments } = file;
|
|
30672
|
-
|
|
30817
|
+
moduleExportsMap.set(id, await collectModuleExports(this, program.body, id));
|
|
30673
30818
|
const identifierMap = Object.create(null);
|
|
30819
|
+
if (!warnedCjsDtsInputs.has(id) && program.body.some(isCjsDtsInputSyntax)) {
|
|
30820
|
+
warnedCjsDtsInputs.add(id);
|
|
30821
|
+
this.warn(RE_NODE_MODULES.test(id) ? `${id} uses CommonJS dts syntax. CommonJS dts modules cannot be reliably bundled by rolldown-plugin-dts. Please mark this module as external in your Rolldown config.` : `${id} uses CommonJS dts syntax. rolldown-plugin-dts does not support reliably bundling CommonJS dts input.`);
|
|
30822
|
+
}
|
|
30674
30823
|
if (comments) {
|
|
30675
30824
|
const directives = collectReferenceDirectives(comments);
|
|
30676
30825
|
commentsMap.set(id, directives);
|
|
@@ -30679,7 +30828,7 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
|
30679
30828
|
const namespaceStmts = /* @__PURE__ */ new Map();
|
|
30680
30829
|
for (const [i, stmt] of program.body.entries()) {
|
|
30681
30830
|
const setStmt = (stmt) => program.body[i] = stmt;
|
|
30682
|
-
if (rewriteImportExport(stmt, setStmt
|
|
30831
|
+
if (rewriteImportExport(stmt, setStmt)) continue;
|
|
30683
30832
|
const sideEffect = stmt.type === "TSModuleDeclaration" && stmt.kind !== "namespace";
|
|
30684
30833
|
if (sideEffect && stmt.id.type === "StringLiteral" && stmt.id.value[0] === ".") this.warn(`\`declare module ${JSON.stringify(stmt.id.value)}\` will be kept as-is in the output. Relative module declaration may cause unexpected issues. Found in ${id}.`);
|
|
30685
30834
|
if (sideEffect && id.endsWith(".vue.d.ts") && code.slice(stmt.start, stmt.end).includes("__VLS_")) continue;
|
|
@@ -30717,7 +30866,7 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
|
30717
30866
|
}
|
|
30718
30867
|
const params = collectParams(decl);
|
|
30719
30868
|
const childrenSet = /* @__PURE__ */ new Set();
|
|
30720
|
-
const deps = collectDependencies(decl, namespaceStmts, childrenSet, identifierMap);
|
|
30869
|
+
const deps = await collectDependencies(this, decl, id, namespaceStmts, childrenSet, identifierMap);
|
|
30721
30870
|
const children = Array.from(childrenSet).filter((child) => bindings.every((b) => child !== b));
|
|
30722
30871
|
if (decl !== stmt) decl.leadingComments = stmt.leadingComments;
|
|
30723
30872
|
const declarationIdNode = {
|
|
@@ -30820,7 +30969,6 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
|
30820
30969
|
...program.body,
|
|
30821
30970
|
...appendStmts
|
|
30822
30971
|
];
|
|
30823
|
-
typeOnlyMap.set(id, typeOnlyIds);
|
|
30824
30972
|
const result = generate(file, {
|
|
30825
30973
|
comments: false,
|
|
30826
30974
|
sourceMaps: sourcemap,
|
|
@@ -30833,11 +30981,7 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
|
30833
30981
|
}
|
|
30834
30982
|
function renderChunk(code, chunk) {
|
|
30835
30983
|
if (!RE_DTS.test(chunk.fileName)) return;
|
|
30836
|
-
const
|
|
30837
|
-
for (const module of chunk.moduleIds) {
|
|
30838
|
-
const ids = typeOnlyMap.get(module);
|
|
30839
|
-
if (ids) typeOnlyIds.push(...ids);
|
|
30840
|
-
}
|
|
30984
|
+
const exportInfo = collectChunkExportInfo(chunk, moduleExportsMap);
|
|
30841
30985
|
let file;
|
|
30842
30986
|
try {
|
|
30843
30987
|
file = parse$1(code, { sourceType: "module" });
|
|
@@ -30850,7 +30994,7 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
|
30850
30994
|
program.body = program.body.map((node) => {
|
|
30851
30995
|
if (isHelperImport(node)) return null;
|
|
30852
30996
|
if (node.type === "ExpressionStatement") return null;
|
|
30853
|
-
const newNode = patchImportExport(node,
|
|
30997
|
+
const newNode = patchImportExport(node, exportInfo, cjsDefault);
|
|
30854
30998
|
if (newNode || newNode === false) return newNode;
|
|
30855
30999
|
if (node.type !== "VariableDeclaration") return node;
|
|
30856
31000
|
if (!isRuntimeBindingVariableDeclaration(node)) return null;
|
|
@@ -30918,10 +31062,6 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
|
30918
31062
|
map: result.map
|
|
30919
31063
|
};
|
|
30920
31064
|
}
|
|
30921
|
-
function getIdentifierIndex(identifierMap, name) {
|
|
30922
|
-
if (name in identifierMap) return ++identifierMap[name];
|
|
30923
|
-
return identifierMap[name] = 0;
|
|
30924
|
-
}
|
|
30925
31065
|
function registerDeclaration(info) {
|
|
30926
31066
|
const declarationId = declarationIdx++;
|
|
30927
31067
|
declarationMap.set(declarationId, info);
|
|
@@ -30930,141 +31070,289 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
|
30930
31070
|
function getDeclaration(declarationId) {
|
|
30931
31071
|
return declarationMap.get(declarationId);
|
|
30932
31072
|
}
|
|
30933
|
-
|
|
30934
|
-
|
|
30935
|
-
|
|
30936
|
-
|
|
30937
|
-
|
|
30938
|
-
|
|
30939
|
-
|
|
30940
|
-
|
|
30941
|
-
|
|
30942
|
-
|
|
30943
|
-
|
|
30944
|
-
|
|
30945
|
-
|
|
30946
|
-
|
|
30947
|
-
|
|
30948
|
-
|
|
30949
|
-
|
|
30950
|
-
|
|
30951
|
-
|
|
30952
|
-
|
|
30953
|
-
|
|
30954
|
-
return
|
|
30955
|
-
|
|
30956
|
-
|
|
30957
|
-
|
|
31073
|
+
}
|
|
31074
|
+
async function collectModuleExports(context, nodes, id) {
|
|
31075
|
+
const info = {
|
|
31076
|
+
typeOnlyLocals: /* @__PURE__ */ new Set(),
|
|
31077
|
+
exports: /* @__PURE__ */ new Map(),
|
|
31078
|
+
reExports: [],
|
|
31079
|
+
exportAlls: []
|
|
31080
|
+
};
|
|
31081
|
+
for (const node of nodes) collectTypeOnlyLocals(node, info.typeOnlyLocals);
|
|
31082
|
+
for (const node of nodes) await collectExportInfo(context, node, id, info);
|
|
31083
|
+
return info;
|
|
31084
|
+
}
|
|
31085
|
+
function collectTypeOnlyLocals(node, typeOnlyLocals) {
|
|
31086
|
+
if (node.type !== "ImportDeclaration") return;
|
|
31087
|
+
for (const specifier of node.specifiers) if (node.importKind === "type" || "importKind" in specifier && specifier.importKind === "type") typeOnlyLocals.add(specifier.local.name);
|
|
31088
|
+
}
|
|
31089
|
+
function collectDeclarationNames(node) {
|
|
31090
|
+
if (node.type === "VariableDeclaration") return node.declarations.flatMap((decl) => collectPatternNames(decl.id));
|
|
31091
|
+
if ("id" in node && node.id) {
|
|
31092
|
+
if (node.id.type !== "Identifier" && node.id.type !== "TSQualifiedName") return [];
|
|
31093
|
+
const id = getIdFromTSEntityName(node.id);
|
|
31094
|
+
return id.type === "Identifier" ? [id.name] : [];
|
|
31095
|
+
}
|
|
31096
|
+
return [];
|
|
31097
|
+
}
|
|
31098
|
+
function collectPatternNames(node) {
|
|
31099
|
+
if (!node) return [];
|
|
31100
|
+
if (node.type === "Identifier") return [node.name];
|
|
31101
|
+
if (node.type === "RestElement") return collectPatternNames(node.argument);
|
|
31102
|
+
if (node.type === "AssignmentPattern") return collectPatternNames(node.left);
|
|
31103
|
+
if (node.type === "ArrayPattern") return node.elements.flatMap((element) => collectPatternNames(element));
|
|
31104
|
+
if (node.type === "ObjectPattern") return node.properties.flatMap((property) => {
|
|
31105
|
+
if (property.type === "RestElement") return collectPatternNames(property.argument);
|
|
31106
|
+
return collectPatternNames(property.value);
|
|
31107
|
+
});
|
|
31108
|
+
return [];
|
|
31109
|
+
}
|
|
31110
|
+
function isTypeOnlyExport(node, specifier) {
|
|
31111
|
+
return node.exportKind === "type" || "exportKind" in specifier && specifier.exportKind === "type";
|
|
31112
|
+
}
|
|
31113
|
+
async function collectExportInfo(context, node, id, info) {
|
|
31114
|
+
if (node.type === "ExportNamedDeclaration") {
|
|
31115
|
+
if (node.declaration) {
|
|
31116
|
+
for (const name of collectDeclarationNames(node.declaration)) info.exports.set(name, false);
|
|
31117
|
+
return;
|
|
31118
|
+
}
|
|
31119
|
+
const source = await resolveExportSource(context, node.source, id);
|
|
31120
|
+
for (const specifier of node.specifiers) {
|
|
31121
|
+
const typeOnly = isTypeOnlyExport(node, specifier);
|
|
31122
|
+
if (specifier.type === "ExportSpecifier") {
|
|
31123
|
+
const exported = resolveString(specifier.exported);
|
|
31124
|
+
const local = resolveString(specifier.local);
|
|
31125
|
+
if (source) info.reExports.push({
|
|
31126
|
+
source,
|
|
31127
|
+
local,
|
|
31128
|
+
exported,
|
|
31129
|
+
typeOnly
|
|
31130
|
+
});
|
|
31131
|
+
else info.exports.set(exported, typeOnly || info.typeOnlyLocals.has(local));
|
|
31132
|
+
} else {
|
|
31133
|
+
const exported = resolveString(specifier.exported);
|
|
31134
|
+
info.exports.set(exported, typeOnly);
|
|
31135
|
+
}
|
|
31136
|
+
}
|
|
31137
|
+
return;
|
|
30958
31138
|
}
|
|
30959
|
-
|
|
30960
|
-
|
|
30961
|
-
|
|
30962
|
-
|
|
30963
|
-
|
|
30964
|
-
|
|
30965
|
-
|
|
30966
|
-
|
|
30967
|
-
|
|
30968
|
-
|
|
30969
|
-
|
|
30970
|
-
|
|
30971
|
-
|
|
30972
|
-
|
|
30973
|
-
|
|
30974
|
-
|
|
30975
|
-
|
|
30976
|
-
|
|
30977
|
-
|
|
30978
|
-
|
|
30979
|
-
|
|
30980
|
-
|
|
30981
|
-
|
|
30982
|
-
|
|
30983
|
-
|
|
30984
|
-
|
|
30985
|
-
|
|
30986
|
-
|
|
30987
|
-
|
|
30988
|
-
|
|
30989
|
-
|
|
30990
|
-
|
|
30991
|
-
|
|
30992
|
-
|
|
30993
|
-
|
|
30994
|
-
|
|
30995
|
-
|
|
30996
|
-
|
|
30997
|
-
|
|
30998
|
-
|
|
30999
|
-
|
|
31000
|
-
|
|
31001
|
-
|
|
31002
|
-
|
|
31003
|
-
|
|
31004
|
-
|
|
31005
|
-
|
|
31006
|
-
|
|
31007
|
-
|
|
31008
|
-
|
|
31009
|
-
|
|
31010
|
-
|
|
31011
|
-
|
|
31012
|
-
|
|
31139
|
+
if (node.type === "ExportDefaultDeclaration") {
|
|
31140
|
+
info.exports.set("default", false);
|
|
31141
|
+
return;
|
|
31142
|
+
}
|
|
31143
|
+
if (node.type === "ExportAllDeclaration") info.exportAlls.push({
|
|
31144
|
+
source: await resolveExportSource(context, node.source, id),
|
|
31145
|
+
rawSource: node.source.value,
|
|
31146
|
+
typeOnly: node.exportKind === "type"
|
|
31147
|
+
});
|
|
31148
|
+
}
|
|
31149
|
+
async function resolveExportSource(context, source, importer) {
|
|
31150
|
+
if (!source) return;
|
|
31151
|
+
const resolved = await context.resolve(source.value, importer);
|
|
31152
|
+
if (!resolved || resolved.external) return;
|
|
31153
|
+
return resolved.id;
|
|
31154
|
+
}
|
|
31155
|
+
function collectChunkExportInfo(chunk, moduleExportsMap) {
|
|
31156
|
+
const exportsByModule = resolveAllModuleExports(moduleExportsMap);
|
|
31157
|
+
const roots = chunk.facadeModuleId && moduleExportsMap.has(chunk.facadeModuleId) ? [chunk.facadeModuleId] : chunk.moduleIds;
|
|
31158
|
+
const mergedExports = /* @__PURE__ */ new Map();
|
|
31159
|
+
const typeOnlyExportAllSources = /* @__PURE__ */ new Set();
|
|
31160
|
+
for (const root of roots) {
|
|
31161
|
+
const exports = exportsByModule.get(root);
|
|
31162
|
+
if (exports) for (const [name, typeOnly] of exports) setExportTypeOnly(mergedExports, name, typeOnly);
|
|
31163
|
+
const moduleExports = moduleExportsMap.get(root);
|
|
31164
|
+
if (!moduleExports) continue;
|
|
31165
|
+
for (const exportAll of moduleExports.exportAlls) {
|
|
31166
|
+
if (!exportAll.typeOnly || exportAll.source) continue;
|
|
31167
|
+
typeOnlyExportAllSources.add(exportAll.rawSource);
|
|
31168
|
+
}
|
|
31169
|
+
}
|
|
31170
|
+
const typeOnlyNames = /* @__PURE__ */ new Set();
|
|
31171
|
+
for (const [name, typeOnly] of mergedExports) if (typeOnly) typeOnlyNames.add(name);
|
|
31172
|
+
return {
|
|
31173
|
+
typeOnlyNames,
|
|
31174
|
+
typeOnlyExportAllSources
|
|
31175
|
+
};
|
|
31176
|
+
}
|
|
31177
|
+
function resolveAllModuleExports(moduleExportsMap) {
|
|
31178
|
+
const exportsByModule = /* @__PURE__ */ new Map();
|
|
31179
|
+
for (const [id, info] of moduleExportsMap) exportsByModule.set(id, new Map(info.exports));
|
|
31180
|
+
let changed = true;
|
|
31181
|
+
while (changed) {
|
|
31182
|
+
changed = false;
|
|
31183
|
+
for (const [id, info] of moduleExportsMap) {
|
|
31184
|
+
const exports = exportsByModule.get(id);
|
|
31185
|
+
for (const reExport of info.reExports) {
|
|
31186
|
+
const sourceTypeOnly = (reExport.source ? exportsByModule.get(reExport.source) : void 0)?.get(reExport.local) ?? false;
|
|
31187
|
+
if (setExportTypeOnly(exports, reExport.exported, reExport.typeOnly || sourceTypeOnly)) changed = true;
|
|
31188
|
+
}
|
|
31189
|
+
for (const exportAll of info.exportAlls) {
|
|
31190
|
+
if (!exportAll.source) continue;
|
|
31191
|
+
const sourceExports = exportsByModule.get(exportAll.source);
|
|
31192
|
+
if (!sourceExports) continue;
|
|
31193
|
+
for (const [name, typeOnly] of sourceExports) {
|
|
31194
|
+
if (name === "default") continue;
|
|
31195
|
+
if (setExportTypeOnly(exports, name, exportAll.typeOnly || typeOnly)) changed = true;
|
|
31013
31196
|
}
|
|
31014
|
-
if (parent && !deps.has(node) && isChildSymbol(node, parent)) children.add(node);
|
|
31015
31197
|
}
|
|
31016
|
-
});
|
|
31017
|
-
return Array.from(deps);
|
|
31018
|
-
function addDependency(node) {
|
|
31019
|
-
if (isThisExpression(node) || isInferred(node)) return;
|
|
31020
|
-
deps.add(node);
|
|
31021
31198
|
}
|
|
31022
31199
|
}
|
|
31023
|
-
|
|
31024
|
-
|
|
31025
|
-
|
|
31200
|
+
return exportsByModule;
|
|
31201
|
+
}
|
|
31202
|
+
function setExportTypeOnly(exports, name, typeOnly) {
|
|
31203
|
+
const current = exports.get(name);
|
|
31204
|
+
if (current === false || current === typeOnly) return false;
|
|
31205
|
+
if (current === void 0 || !typeOnly) {
|
|
31206
|
+
exports.set(name, typeOnly);
|
|
31207
|
+
return true;
|
|
31208
|
+
}
|
|
31209
|
+
return false;
|
|
31210
|
+
}
|
|
31211
|
+
/**
|
|
31212
|
+
* Collects all TSTypeParameter nodes from the given node and groups them by
|
|
31213
|
+
* their name. One name can associate with one or more type parameters. These
|
|
31214
|
+
* names will be used as the parameter name in the generated JavaScript
|
|
31215
|
+
* dependency function.
|
|
31216
|
+
*/
|
|
31217
|
+
function collectParams(node) {
|
|
31218
|
+
const typeParams = [];
|
|
31219
|
+
walkAST(node, { leave(node) {
|
|
31220
|
+
if ("typeParameters" in node && node.typeParameters?.type === "TSTypeParameterDeclaration") typeParams.push(...node.typeParameters.params.map(({ name }) => typeof name === "string" ? {
|
|
31026
31221
|
type: "Identifier",
|
|
31027
|
-
name
|
|
31028
|
-
};
|
|
31029
|
-
|
|
31030
|
-
|
|
31031
|
-
|
|
31032
|
-
|
|
31033
|
-
|
|
31034
|
-
|
|
31035
|
-
|
|
31036
|
-
|
|
31037
|
-
|
|
31038
|
-
|
|
31039
|
-
|
|
31040
|
-
|
|
31041
|
-
|
|
31042
|
-
|
|
31043
|
-
|
|
31044
|
-
|
|
31045
|
-
|
|
31046
|
-
|
|
31047
|
-
|
|
31048
|
-
|
|
31049
|
-
|
|
31050
|
-
|
|
31051
|
-
|
|
31052
|
-
|
|
31053
|
-
|
|
31054
|
-
|
|
31055
|
-
|
|
31056
|
-
typeName: local,
|
|
31057
|
-
typeArguments: node.typeArguments
|
|
31058
|
-
});
|
|
31059
|
-
replacement = local;
|
|
31060
|
-
} else overwriteNode(node, local);
|
|
31061
|
-
return {
|
|
31062
|
-
...TSEntityNameToRuntime(local),
|
|
31063
|
-
replace(newNode) {
|
|
31064
|
-
overwriteNode(replacement, newNode);
|
|
31222
|
+
name
|
|
31223
|
+
} : name));
|
|
31224
|
+
} });
|
|
31225
|
+
const paramMap = /* @__PURE__ */ new Map();
|
|
31226
|
+
for (const typeParam of typeParams) {
|
|
31227
|
+
const name = typeParam.name;
|
|
31228
|
+
const group = paramMap.get(name);
|
|
31229
|
+
if (group) group.push(typeParam);
|
|
31230
|
+
else paramMap.set(name, [typeParam]);
|
|
31231
|
+
}
|
|
31232
|
+
return Array.from(paramMap.entries()).map(([name, typeParams]) => ({
|
|
31233
|
+
name,
|
|
31234
|
+
typeParams
|
|
31235
|
+
}));
|
|
31236
|
+
}
|
|
31237
|
+
async function collectDependencies(context, node, importer, namespaceStmts, children, identifierMap) {
|
|
31238
|
+
const deps = /* @__PURE__ */ new Set();
|
|
31239
|
+
const seen = /* @__PURE__ */ new Set();
|
|
31240
|
+
const preserveImportTypeCache = /* @__PURE__ */ new Map();
|
|
31241
|
+
const inferredStack = [];
|
|
31242
|
+
let currentInferred = /* @__PURE__ */ new Set();
|
|
31243
|
+
function isInferred(node) {
|
|
31244
|
+
return node.type === "Identifier" && currentInferred.has(node.name);
|
|
31245
|
+
}
|
|
31246
|
+
await walkASTAsync(node, {
|
|
31247
|
+
enter(node) {
|
|
31248
|
+
if (node.type === "TSConditionalType") {
|
|
31249
|
+
const inferred = collectInferredNames(node.extendsType);
|
|
31250
|
+
inferredStack.push(inferred);
|
|
31065
31251
|
}
|
|
31066
|
-
|
|
31252
|
+
return Promise.resolve();
|
|
31253
|
+
},
|
|
31254
|
+
async leave(node, parent) {
|
|
31255
|
+
if (node.type === "TSConditionalType") inferredStack.pop();
|
|
31256
|
+
else if (parent?.type === "TSConditionalType") {
|
|
31257
|
+
const trueBranch = parent.trueType === node;
|
|
31258
|
+
currentInferred = new Set((trueBranch ? inferredStack : inferredStack.slice(0, -1)).flat());
|
|
31259
|
+
} else currentInferred = /* @__PURE__ */ new Set();
|
|
31260
|
+
if (node.type === "ExportNamedDeclaration") {
|
|
31261
|
+
for (const specifier of node.specifiers) if (specifier.type === "ExportSpecifier") addDependency(specifier.local);
|
|
31262
|
+
} else if (node.type === "TSInterfaceDeclaration" && node.extends) for (const heritage of node.extends || []) addDependency(heritage.expression);
|
|
31263
|
+
else if (node.type === "ClassDeclaration") {
|
|
31264
|
+
if (node.superClass) addDependency(node.superClass);
|
|
31265
|
+
if (node.implements) for (const implement of node.implements) {
|
|
31266
|
+
if (implement.type === "ClassImplements") throw new Error("Unexpected Flow syntax");
|
|
31267
|
+
addDependency(implement.expression);
|
|
31268
|
+
}
|
|
31269
|
+
} else if (isTypeOf(node, [
|
|
31270
|
+
"ObjectMethod",
|
|
31271
|
+
"ObjectProperty",
|
|
31272
|
+
"ClassProperty",
|
|
31273
|
+
"TSPropertySignature",
|
|
31274
|
+
"TSDeclareMethod",
|
|
31275
|
+
"TSMethodSignature"
|
|
31276
|
+
])) {
|
|
31277
|
+
if (node.computed && isReferenceId(node.key)) addDependency(node.key);
|
|
31278
|
+
if ("value" in node && isReferenceId(node.value)) addDependency(node.value);
|
|
31279
|
+
} else switch (node.type) {
|
|
31280
|
+
case "TSTypeReference":
|
|
31281
|
+
addDependency(TSEntityNameToRuntime(node.typeName));
|
|
31282
|
+
break;
|
|
31283
|
+
case "TSTypeQuery":
|
|
31284
|
+
if (seen.has(node.exprName)) return;
|
|
31285
|
+
if (node.exprName.type === "TSImportType") break;
|
|
31286
|
+
addDependency(TSEntityNameToRuntime(node.exprName));
|
|
31287
|
+
break;
|
|
31288
|
+
case "TSImportType": {
|
|
31289
|
+
seen.add(node);
|
|
31290
|
+
const { source, qualifier } = node;
|
|
31291
|
+
const dep = await importNamespace(context, importer, node, qualifier, source, namespaceStmts, identifierMap, preserveImportTypeCache);
|
|
31292
|
+
if (dep) addDependency(dep);
|
|
31293
|
+
break;
|
|
31294
|
+
}
|
|
31295
|
+
}
|
|
31296
|
+
if (parent && !deps.has(node) && isChildSymbol(node, parent)) children.add(node);
|
|
31297
|
+
}
|
|
31298
|
+
});
|
|
31299
|
+
return Array.from(deps);
|
|
31300
|
+
function addDependency(node) {
|
|
31301
|
+
if (isThisExpression(node) || isInferred(node)) return;
|
|
31302
|
+
deps.add(node);
|
|
31303
|
+
}
|
|
31304
|
+
}
|
|
31305
|
+
async function importNamespace(context, importer, node, imported, source, namespaceStmts, identifierMap, preserveCache) {
|
|
31306
|
+
let preserve = preserveCache.get(source.value);
|
|
31307
|
+
if (preserve === void 0) {
|
|
31308
|
+
const resolved = await context.resolve(source.value, importer);
|
|
31309
|
+
preserve = !resolved || !!resolved.external;
|
|
31310
|
+
preserveCache.set(source.value, preserve);
|
|
31311
|
+
}
|
|
31312
|
+
if (preserve) return;
|
|
31313
|
+
const sourceText = source.value.replaceAll(/\W/g, "_");
|
|
31314
|
+
let local = {
|
|
31315
|
+
type: "Identifier",
|
|
31316
|
+
name: `_$${isIdentifierName(source.value) ? source.value : `${sourceText}${getIdentifierIndex(identifierMap, sourceText)}`}`
|
|
31317
|
+
};
|
|
31318
|
+
if (namespaceStmts.has(source.value)) local = namespaceStmts.get(source.value).local;
|
|
31319
|
+
else namespaceStmts.set(source.value, {
|
|
31320
|
+
stmt: {
|
|
31321
|
+
type: "ImportDeclaration",
|
|
31322
|
+
specifiers: [{
|
|
31323
|
+
type: "ImportNamespaceSpecifier",
|
|
31324
|
+
local
|
|
31325
|
+
}],
|
|
31326
|
+
source,
|
|
31327
|
+
attributes: null
|
|
31328
|
+
},
|
|
31329
|
+
local
|
|
31330
|
+
});
|
|
31331
|
+
if (imported) {
|
|
31332
|
+
const importedLeft = getIdFromTSEntityName(imported);
|
|
31333
|
+
if (imported.type === "ThisExpression" || importedLeft.type === "ThisExpression") throw new Error("Cannot import `this` from module.");
|
|
31334
|
+
overwriteNode(importedLeft, {
|
|
31335
|
+
type: "TSQualifiedName",
|
|
31336
|
+
left: local,
|
|
31337
|
+
right: { ...importedLeft }
|
|
31338
|
+
});
|
|
31339
|
+
local = imported;
|
|
31067
31340
|
}
|
|
31341
|
+
let replacement = node;
|
|
31342
|
+
if (node.typeArguments) {
|
|
31343
|
+
overwriteNode(node, {
|
|
31344
|
+
type: "TSTypeReference",
|
|
31345
|
+
typeName: local,
|
|
31346
|
+
typeArguments: node.typeArguments
|
|
31347
|
+
});
|
|
31348
|
+
replacement = local;
|
|
31349
|
+
} else overwriteNode(node, local);
|
|
31350
|
+
return {
|
|
31351
|
+
...TSEntityNameToRuntime(local),
|
|
31352
|
+
replace(newNode) {
|
|
31353
|
+
overwriteNode(replacement, newNode);
|
|
31354
|
+
}
|
|
31355
|
+
};
|
|
31068
31356
|
}
|
|
31069
31357
|
function isChildSymbol(node, parent) {
|
|
31070
31358
|
if (node.type === "Identifier") return true;
|
|
@@ -31082,6 +31370,9 @@ const REFERENCE_RE = /\/\s*<reference\s+(?:path|types)=/;
|
|
|
31082
31370
|
function collectReferenceDirectives(comment, negative = false) {
|
|
31083
31371
|
return comment.filter((c) => REFERENCE_RE.test(c.value) !== negative);
|
|
31084
31372
|
}
|
|
31373
|
+
function isCjsDtsInputSyntax(node) {
|
|
31374
|
+
return node.type === "TSExportAssignment" || node.type === "TSImportEqualsDeclaration" && node.moduleReference.type === "TSExternalModuleReference";
|
|
31375
|
+
}
|
|
31085
31376
|
/**
|
|
31086
31377
|
* Check if the given node is a {@link RuntimeBindingVariableDeclration}
|
|
31087
31378
|
*/
|
|
@@ -31136,7 +31427,7 @@ function isHelperImport(node) {
|
|
|
31136
31427
|
/**
|
|
31137
31428
|
* patch `.d.ts` suffix in import source to `.js`
|
|
31138
31429
|
*/
|
|
31139
|
-
function patchImportExport(node,
|
|
31430
|
+
function patchImportExport(node, exportInfo, cjsDefault) {
|
|
31140
31431
|
if (node.type === "ExportNamedDeclaration" && !node.declaration && !node.source && !node.specifiers.length && !node.attributes?.length) return false;
|
|
31141
31432
|
if (node.type === "ImportDeclaration" && node.specifiers.length) {
|
|
31142
31433
|
for (const specifier of node.specifiers) if (isInfer(specifier.local)) specifier.local.name = "__Infer";
|
|
@@ -31146,10 +31437,14 @@ function patchImportExport(node, typeOnlyIds, cjsDefault) {
|
|
|
31146
31437
|
"ExportAllDeclaration",
|
|
31147
31438
|
"ExportNamedDeclaration"
|
|
31148
31439
|
])) {
|
|
31149
|
-
if (node.type === "
|
|
31150
|
-
|
|
31151
|
-
|
|
31152
|
-
|
|
31440
|
+
if (node.type === "ExportAllDeclaration" && node.source && exportInfo.typeOnlyExportAllSources.has(node.source.value)) node.exportKind = "type";
|
|
31441
|
+
if (node.type === "ExportNamedDeclaration" && exportInfo.typeOnlyNames.size) {
|
|
31442
|
+
for (const spec of node.specifiers) {
|
|
31443
|
+
const name = resolveString(spec.exported);
|
|
31444
|
+
if (exportInfo.typeOnlyNames.has(name)) if (spec.type === "ExportSpecifier") spec.exportKind = "type";
|
|
31445
|
+
else node.exportKind = "type";
|
|
31446
|
+
}
|
|
31447
|
+
normalizeTypeOnlyExport(node);
|
|
31153
31448
|
}
|
|
31154
31449
|
if (node.source?.value && RE_DTS.test(node.source.value)) {
|
|
31155
31450
|
node.source.value = filename_dts_to(node.source.value, "js");
|
|
@@ -31161,13 +31456,19 @@ function patchImportExport(node, typeOnlyIds, cjsDefault) {
|
|
|
31161
31456
|
};
|
|
31162
31457
|
}
|
|
31163
31458
|
}
|
|
31459
|
+
function normalizeTypeOnlyExport(node) {
|
|
31460
|
+
if (node.declaration || !node.specifiers.length) return;
|
|
31461
|
+
for (const specifier of node.specifiers) if (specifier.type !== "ExportSpecifier" || specifier.exportKind !== "type") return;
|
|
31462
|
+
node.exportKind = "type";
|
|
31463
|
+
for (const specifier of node.specifiers) if (specifier.type === "ExportSpecifier") specifier.exportKind = "value";
|
|
31464
|
+
}
|
|
31164
31465
|
/**
|
|
31165
31466
|
* Handle `__exportAll` call
|
|
31166
31467
|
*/
|
|
31167
31468
|
function patchTsNamespace(nodes) {
|
|
31168
31469
|
const removed = /* @__PURE__ */ new Set();
|
|
31169
31470
|
for (const [i, node] of nodes.entries()) {
|
|
31170
|
-
const result =
|
|
31471
|
+
const result = getExportAllNamespace(node);
|
|
31171
31472
|
if (!result) continue;
|
|
31172
31473
|
const [binding, exports] = result;
|
|
31173
31474
|
if (!exports.properties.length) continue;
|
|
@@ -31194,10 +31495,10 @@ function patchTsNamespace(nodes) {
|
|
|
31194
31495
|
};
|
|
31195
31496
|
}
|
|
31196
31497
|
return nodes.filter((node) => !removed.has(node));
|
|
31197
|
-
|
|
31198
|
-
|
|
31199
|
-
|
|
31200
|
-
|
|
31498
|
+
}
|
|
31499
|
+
function getExportAllNamespace(node) {
|
|
31500
|
+
if (node.type !== "VariableDeclaration" || node.declarations.length !== 1 || node.declarations[0].id.type !== "Identifier" || node.declarations[0].init?.type !== "CallExpression" || node.declarations[0].init.callee.type !== "Identifier" || node.declarations[0].init.callee.name !== "__exportAll" || node.declarations[0].init.arguments.length !== 1 || node.declarations[0].init.arguments[0].type !== "ObjectExpression") return false;
|
|
31501
|
+
return [node.declarations[0].id, node.declarations[0].init.arguments[0]];
|
|
31201
31502
|
}
|
|
31202
31503
|
/**
|
|
31203
31504
|
* Handle `__reExport` call
|
|
@@ -31232,13 +31533,10 @@ function patchReExport(nodes) {
|
|
|
31232
31533
|
else if (node.type === "ExportNamedDeclaration" && node.specifiers.length === 1 && node.specifiers[0].type === "ExportSpecifier" && node.specifiers[0].local.type === "Identifier" && exportsNames.has(node.specifiers[0].local.name)) node.specifiers[0].local.name = exportsNames.get(node.specifiers[0].local.name);
|
|
31233
31534
|
return nodes;
|
|
31234
31535
|
}
|
|
31235
|
-
function rewriteImportExport(node, set
|
|
31536
|
+
function rewriteImportExport(node, set) {
|
|
31236
31537
|
if (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" && !node.declaration) {
|
|
31237
|
-
for (const specifier of node.specifiers)
|
|
31238
|
-
|
|
31239
|
-
if (specifier.type === "ImportSpecifier") specifier.importKind = "value";
|
|
31240
|
-
else if (specifier.type === "ExportSpecifier") specifier.exportKind = "value";
|
|
31241
|
-
}
|
|
31538
|
+
for (const specifier of node.specifiers) if (specifier.type === "ImportSpecifier") specifier.importKind = "value";
|
|
31539
|
+
else if (specifier.type === "ExportSpecifier") specifier.exportKind = "value";
|
|
31242
31540
|
if (node.type === "ImportDeclaration") node.importKind = "value";
|
|
31243
31541
|
else if (node.type === "ExportNamedDeclaration") node.exportKind = "value";
|
|
31244
31542
|
return true;
|
|
@@ -31296,6 +31594,10 @@ function inheritNodeComments(oldNode, newNode) {
|
|
|
31296
31594
|
newNode.leadingComments = collectReferenceDirectives(newNode.leadingComments, true);
|
|
31297
31595
|
return newNode;
|
|
31298
31596
|
}
|
|
31597
|
+
function getIdentifierIndex(identifierMap, name) {
|
|
31598
|
+
if (name in identifierMap) return ++identifierMap[name];
|
|
31599
|
+
return identifierMap[name] = 0;
|
|
31600
|
+
}
|
|
31299
31601
|
const debug$3 = createDebug("rolldown-plugin-dts:tsgo");
|
|
31300
31602
|
const spawnAsync = (...args) => new Promise((resolve, reject) => {
|
|
31301
31603
|
const child = spawn(...args);
|
|
@@ -31365,12 +31667,12 @@ function createGeneratePlugin({ entry, tsconfig, tsconfigRaw, build, incremental
|
|
|
31365
31667
|
if (tsgo) tsgoDist = await runTsgo(rootDir, tsconfig, sourcemap, tsgo.path);
|
|
31366
31668
|
else if (!oxc) if (parallel) {
|
|
31367
31669
|
childProcess = fork(new URL(WORKER_URL, import.meta.url), { stdio: "inherit" });
|
|
31368
|
-
rpc = (await import("./dist-
|
|
31670
|
+
rpc = (await import("./dist-CZtGyfn3.js")).createBirpc({}, {
|
|
31369
31671
|
post: (data) => childProcess.send(data),
|
|
31370
31672
|
on: (fn) => childProcess.on("message", fn)
|
|
31371
31673
|
});
|
|
31372
31674
|
} else {
|
|
31373
|
-
tscModule = await import("./tsc-
|
|
31675
|
+
tscModule = await import("./tsc-WMktM0FW.js");
|
|
31374
31676
|
if (newContext) tscContext = createContext();
|
|
31375
31677
|
}
|
|
31376
31678
|
if (!Array.isArray(options.input)) for (const [name, id] of Object.entries(options.input)) {
|
|
@@ -31702,7 +32004,7 @@ function createDtsResolvePlugin({ cwd, tsconfig, tsconfigRaw, resolver, sideEffe
|
|
|
31702
32004
|
async function resolveDtsPath(id, importer, rolldownResolution) {
|
|
31703
32005
|
let dtsPath;
|
|
31704
32006
|
if (resolver === "tsc") {
|
|
31705
|
-
const { tscResolve } = await import("./resolver-
|
|
32007
|
+
const { tscResolve } = await import("./resolver-DtsKFXi2-QB-x8j3e.js");
|
|
31706
32008
|
dtsPath = tscResolve(id, importer, cwd, tsconfig, tsconfigRaw);
|
|
31707
32009
|
} else dtsPath = baseDtsResolver(id, importer);
|
|
31708
32010
|
debug$1("Using %s for dts import: %O -> %O", resolver, id, dtsPath);
|