void 0.21.9 → 0.23.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/README.md +5 -1
- package/dist/{account-cmd-DZZGK80W.mjs → account-cmd-C84Ee8cO.mjs} +5 -5
- package/dist/{scan-ClYmX3sa.mjs → application-analysis-BVsVqc11.mjs} +135 -18
- package/dist/application-routing-B7QEjqSR.mjs +27 -0
- package/dist/{auth-CZuiVsFh.mjs → auth-CCjt0hcq.mjs} +1 -1
- package/dist/{auth-DLNN0D3Z.mjs → auth-CSkdO2Bb.mjs} +4 -47
- package/dist/{auth-link-B_CeugBw.mjs → auth-link-CioEg6uY.mjs} +5 -5
- package/dist/{auth-router-BgEFRuvZ.mjs → auth-router-BsR981d4.mjs} +5 -5
- package/dist/{better-auth-shared-rsBGBvWJ.mjs → better-auth-shared-hy6RPh9W.mjs} +13 -2
- package/dist/{build-cmd-Dpt0jd-x.mjs → build-cmd-LzvNJORH.mjs} +19 -7
- package/dist/{cache-7_UeZdTk.mjs → cache-C4MvnrMH.mjs} +4 -4
- package/dist/{cancel-deploy-D23R1RXT.mjs → cancel-deploy-abUxpP2n.mjs} +4 -4
- package/dist/{cf-build-output-CGT03qCD.mjs → cf-build-output-BPqOT964.mjs} +141 -63
- package/dist/cf-build-output-_0HNWysu.mjs +2 -0
- package/dist/cli/cli.mjs +114 -460
- package/dist/cli/cloudflare-operation-process.mjs +1103 -0
- package/dist/cli/env-schema-probe.d.mts +2 -1
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/client-Cu7jWiF1.mjs +2 -0
- package/dist/{client-QTl6ko_D.mjs → client-RV8NVeB8.mjs} +165 -21
- package/dist/{cloudflare-auth-C4_GPZr0.mjs → cloudflare-auth-Qdc7tw8F.mjs} +41 -43
- package/dist/{cloudflare-cmd-bSmZ1d5L.mjs → cloudflare-cmd-BcrVyTmJ.mjs} +9 -10
- package/dist/cloudflare-config-Bktvwtpf.mjs +182 -0
- package/dist/{cloudflare-connect-jAwacxxP.mjs → cloudflare-connect-B8uPZ4nx.mjs} +4 -4
- package/dist/{cloudflare-operations-BipGMJ5O.mjs → cloudflare-operations-AiWashgg.mjs} +1 -1
- package/dist/{cloudflare-operations-sMZXpk_S.mjs → cloudflare-operations-fxHb-byx.mjs} +118 -203
- package/dist/{preset-UHj9ARyP.mjs → cloudflare-process-B-wekeR6.mjs} +93 -6
- package/dist/{config-CF69HgXc.d.mts → config-BMHb8RCj.d.mts} +2 -2
- package/dist/{config-CafTW6Cz.mjs → config-Br_JZD6u.mjs} +2 -7
- package/dist/config-C_XRIPx2.mjs +89 -0
- package/dist/{config-s7Xj7tPb.mjs → config-CyQ-wVd7.mjs} +1 -1
- package/dist/config-entry.d.mts +1 -1
- package/dist/{config-write-BSduPMY8.mjs → config-write-B1f88wJA.mjs} +1 -1
- package/dist/{connect-BsUSRzln.mjs → connect-Bd4kJd9U.mjs} +6 -6
- package/dist/{create-project-BniEV0OW.mjs → create-project-Boczwj5r.mjs} +1 -1
- package/dist/{create-project-DBfFSZKY.mjs → create-project-bMf6ffLZ.mjs} +9 -5
- package/dist/{db-hRrvZaq_.mjs → db-8uG64XLl.mjs} +26 -26
- package/dist/{delete-D6dZ9B6B.mjs → delete-NvbiyeJf.mjs} +4 -4
- package/dist/{deploy-WaAQez1O.mjs → deploy-DzAIwqNU.mjs} +944 -607
- package/dist/{deploy-DDz7c8LK.mjs → deploy-bjXdFCtn.mjs} +1 -1
- package/dist/{dist-BR1quN_w.mjs → dist-AoCzRTJE.mjs} +226 -60
- package/dist/{dist-C5fND3R0.mjs → dist-BuDuKZJv.mjs} +1 -1
- package/dist/{dist-Dn6nn2IU.mjs → dist-CTBk70IR.mjs} +42 -42
- package/dist/{domain-Dmhvb2oU.mjs → domain-y5Tvydvo.mjs} +5 -5
- package/dist/{email-DFi-s2t4.mjs → email-B3umsW75.mjs} +15 -30
- package/dist/{env-Csi-tMbT.mjs → env-BS6qYHDb.mjs} +6 -6
- package/dist/{env-public-D_6u46fX.d.mts → env-public-BX_r8HR6.d.mts} +2 -1
- package/dist/{env-validation-BB4GkLxn.mjs → env-validation-BPn7vk-V.mjs} +18 -71
- package/dist/{env-validation-BXge7uyK.mjs → env-validation-DbTg7-ar.mjs} +1 -1
- package/dist/{fetch-CXDChK7B.mjs → fetch-BIZJh7vR.mjs} +2 -2
- package/dist/{fetch-stream-AOByI7Ki.mjs → fetch-stream-IvCYKyQL.mjs} +24 -4
- package/dist/{gen-Dz3X1Qab.mjs → gen-B580--vC.mjs} +5 -5
- package/dist/gen-BVaUUumi.mjs +2 -0
- package/dist/{github-cmd-BED3_9JD.mjs → github-cmd-v45BdfKX.mjs} +6 -8
- package/dist/{handler-BXJTXd02.d.mts → handler-CZ4nAylQ.d.mts} +2 -1
- package/dist/{headers-BOg_velo.mjs → headers-DWi2IXWx.mjs} +1 -1
- package/dist/help-DofyZuY7.mjs +2 -0
- package/dist/{help-DC7gdz7L.mjs → help-daGKjXGk.mjs} +268 -666
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +305 -1490
- package/dist/info-B97bTX9N.mjs +113 -0
- package/dist/{init-WO0JlPx8.mjs → init-Bvy7zrBo.mjs} +51 -20
- package/dist/limits-Bq5LG8Id.d.mts +27 -0
- package/dist/limits-Cjuk2VPm.mjs +68 -0
- package/dist/{link-CsHOinF7.mjs → link-CDqqCjFl.mjs} +5 -5
- package/dist/{list-CDb-4bZ1.mjs → list-CZj0dzKY.mjs} +5 -5
- package/dist/{live-CKiJilLr.d.mts → live-Chw1eIMv.d.mts} +1 -1
- package/dist/{local-d1-CC8sKFGu.mjs → local-d1-2CMnpuW_.mjs} +2 -2
- package/dist/login-DYt_An22.mjs +2 -0
- package/dist/{login-DvqXsfGs.mjs → login-UZKFM_u7.mjs} +5 -5
- package/dist/{logs-BdfiOezj.mjs → logs-CUZ6t9t3.mjs} +5 -5
- package/dist/migrate-8_2u55MD.mjs +2 -0
- package/dist/{migrate-B8KuoYsO.mjs → migrate-DHul7PRV.mjs} +5 -4
- package/dist/{node-BM43oz4G.mjs → node-BkyRWRx8.mjs} +2 -2
- package/dist/operator-args-CLgKGlwU.mjs +690 -0
- package/dist/{operator-cmd-03819ATr.mjs → operator-cmd-DBA6dl0m.mjs} +69 -23
- package/dist/output-Dm_A4Tbv.mjs +81 -0
- package/dist/pages/client.d.mts +34 -2
- package/dist/pages/client.mjs +59 -3
- package/dist/pages/index.d.mts +1 -1
- package/dist/pages/index.mjs +3 -3
- package/dist/pages/islands-plugin.d.mts +16 -6
- package/dist/pages/islands-plugin.mjs +2 -2
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -308
- package/dist/{parse-filename-DioPHiR9.mjs → parse-filename-CUbj-1MP.mjs} +35 -1
- package/dist/{output-CCH48AMM.mjs → picocolors-BTps1_gs.mjs} +2 -76
- package/dist/plan-D1Q5rf-r.mjs +2 -0
- package/dist/plan-NPpwZ_kc.mjs +58 -0
- package/dist/platform-args-BJdRtlLq.mjs +506 -0
- package/dist/platform-args-D3RXyR6h.mjs +2 -0
- package/dist/{platform-auth-config-z92h63q5.mjs → platform-auth-config-B56E9YP1.mjs} +4 -4
- package/dist/{platform-auth-protection-DeE3yr2R.mjs → platform-auth-protection-BDWO_aER.mjs} +3 -3
- package/dist/{platform-auth-recovery-o_340Ixx.mjs → platform-auth-recovery-1gg4CSRe.mjs} +4 -4
- package/dist/{platform-cmd-C4ZV3Vpy.mjs → platform-cmd-Bt-1w6pY.mjs} +1 -1
- package/dist/{platform-cmd-DNl8WosH.mjs → platform-cmd-DMcQStSc.mjs} +26 -5
- package/dist/{platform-domain-CU1JtJkW.mjs → platform-domain-BNkcz0OB.mjs} +36 -9
- package/dist/{platform-lifecycle-Bc047IeT.mjs → platform-lifecycle-9OyBALhH.mjs} +850 -276
- package/dist/{platform-lifecycle-Bs2qx1E3.mjs → platform-lifecycle-BE6C_jxh.mjs} +1 -1
- package/dist/{platform-management-CVpGI9Y5.mjs → platform-management-CjwLVQwN.mjs} +59 -11
- package/dist/{platform-management-C8tt6D8h.mjs → platform-management-CnyTdcWX.mjs} +1 -1
- package/dist/platform-plans-config-BNGKGr4P.mjs +359 -0
- package/dist/{platform-recovery-dvUaptLr.mjs → platform-recovery-D6KSpuFm.mjs} +2 -2
- package/dist/{plugin-inference-BMfKRSqE.mjs → plugin-inference-CXWnn79A.mjs} +174 -64
- package/dist/{prepare-DyZ-Yok5.mjs → prepare-B5Mkic5u.mjs} +3 -3
- package/dist/{prepare-C3kt3Rst.mjs → prepare-DOsL0CC9.mjs} +4 -20
- package/dist/prepare-cgvDMtSb.mjs +2 -0
- package/dist/{project-cmd-B44I8J_W.mjs → project-cmd-CNzrqvBv.mjs} +30 -16
- package/dist/{project-team-BkbYIsXN.mjs → project-team-DQOWPfQT.mjs} +4 -4
- package/dist/{project-token-C8xEEQnB.mjs → project-token-CTDYU0Cc.mjs} +4 -4
- package/dist/project-zero-trust-BNAkW-_0.mjs +63 -0
- package/dist/{protocol-ZH3jP4a7.d.mts → protocol-CjF_iI9X.d.mts} +2 -2
- package/dist/protocol-U7bfjHmA.mjs +331 -0
- package/dist/{provision-DNtrtaVD.mjs → provision-C4ORE7G7.mjs} +1 -1
- package/dist/{provision-BhreDAOS.mjs → provision-CJFgTZY8.mjs} +111 -215
- package/dist/{requests-DFyhBMaf.mjs → requests-MhxYnau8.mjs} +4 -4
- package/dist/resource-name-C7LVpcRm.mjs +11 -0
- package/dist/{rollback-DHHxXZiS.mjs → rollback-CJ6iSDoU.mjs} +5 -5
- package/dist/route-url-CG7U-cRN.mjs +15 -0
- package/dist/{runner-B8wXwWlo.mjs → runner-CXA9Fh8h.mjs} +1 -1
- package/dist/{runner-p-dMs2UN.mjs → runner-Ol0TNjk6.mjs} +2 -2
- package/dist/runtime/ai.d.mts +12 -8
- package/dist/runtime/ai.mjs +84 -17
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.mjs +2 -2
- package/dist/runtime/client-solid.mjs +2 -2
- package/dist/runtime/client-svelte.mjs +2 -2
- package/dist/runtime/client-vue.mjs +2 -2
- package/dist/runtime/client.mjs +2 -2
- package/dist/runtime/durable.d.mts +3 -1
- package/dist/runtime/durable.mjs +4 -1
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/kv.mjs +0 -1
- package/dist/runtime/limits.d.mts +2 -0
- package/dist/runtime/limits.mjs +2 -0
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-server.mjs +25 -16
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/migration-handler.mjs +62 -42
- package/dist/runtime/route-url.d.mts +4 -0
- package/dist/runtime/route-url.mjs +2 -0
- package/dist/runtime/routing.d.mts +180 -0
- package/dist/runtime/routing.mjs +1082 -0
- package/dist/runtime/sandbox-container.d.mts +3 -0
- package/dist/runtime/sandbox-container.mjs +2 -0
- package/dist/runtime/sandbox.d.mts +4 -32
- package/dist/runtime/sandbox.mjs +151 -75
- package/dist/runtime/sse.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +4 -2
- package/dist/runtime/ws-server.mjs +27 -2
- package/dist/runtime/ws.d.mts +2 -2
- package/dist/runtime/ws.mjs +8 -6
- package/dist/sandbox-XZAqzFlG.d.mts +52 -0
- package/dist/sandbox-container-Bo0eiFKz.d.mts +73 -0
- package/dist/sandbox-container-C6ItmVuN.mjs +281 -0
- package/dist/{scan-4tfN-PSn.mjs → scan-C7okrLyM.mjs} +4 -35
- package/dist/{secret-DN9sSNiV.mjs → secret-Dli5fP0B.mjs} +6 -6
- package/dist/{skills-O6FUaizK.mjs → skills-D1II1Juz.mjs} +1 -1
- package/dist/{sse-BaC1jXko.mjs → sse-CQNaDFFV.mjs} +6 -3
- package/dist/{subcommand-prompt-BuGYkAkC.mjs → subcommand-prompt-CY1C4fvl.mjs} +2 -2
- package/dist/validate-Dq_L3s0S.mjs +2 -0
- package/dist/{validate-CIUwFpjB.mjs → validate-ctOrgiS3.mjs} +2 -1
- package/dist/{wrangler-BymcxrRa.mjs → wrangler-7K-bW_DL.mjs} +14 -235
- package/dist/{ws-BwcqizuH.d.mts → ws-CL1w7GXU.d.mts} +13 -2
- package/package.json +48 -33
- package/sandbox.Dockerfile +4 -0
- package/schema.json +10 -22
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +34 -157
- package/skills/void/SKILL.md +50 -133
- package/skills/void/docs/guide/ai.md +94 -84
- package/skills/void/docs/guide/app-types.md +3 -32
- package/skills/void/docs/guide/auth.md +12 -116
- package/skills/void/docs/guide/database/d1.md +9 -54
- package/skills/void/docs/guide/database/mysql.md +1 -1
- package/skills/void/docs/guide/database/postgresql.md +5 -26
- package/skills/void/docs/guide/database.md +23 -75
- package/skills/void/docs/guide/deployment.md +27 -113
- package/skills/void/docs/guide/durable-state.md +43 -18
- package/skills/void/docs/guide/edge/headers.md +3 -47
- package/skills/void/docs/guide/edge/prerendering.md +5 -20
- package/skills/void/docs/guide/edge/redirects.md +11 -64
- package/skills/void/docs/guide/edge/revalidation.md +6 -19
- package/skills/void/docs/guide/edge/rewrites.md +56 -284
- package/skills/void/docs/guide/edge/static-assets.md +23 -72
- package/skills/void/docs/guide/email/domains.md +112 -0
- package/skills/void/docs/guide/email/receiving.md +139 -0
- package/skills/void/docs/guide/email/sending.md +231 -0
- package/skills/void/docs/guide/email.md +13 -619
- package/skills/void/docs/guide/env-migration.md +11 -11
- package/skills/void/docs/guide/env-vars.md +9 -29
- package/skills/void/docs/guide/index.md +0 -15
- package/skills/void/docs/guide/jobs.md +3 -18
- package/skills/void/docs/guide/kv.md +5 -11
- package/skills/void/docs/guide/live.md +5 -56
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +78 -125
- package/skills/void/docs/guide/pages-routing/head.md +10 -10
- package/skills/void/docs/guide/pages-routing/islands.md +6 -36
- package/skills/void/docs/guide/pages-routing/layouts.md +6 -128
- package/skills/void/docs/guide/pages-routing/loaders.md +3 -19
- package/skills/void/docs/guide/pages-routing/markdown.md +13 -171
- package/skills/void/docs/guide/pages-routing/overview.md +7 -17
- package/skills/void/docs/guide/pages-routing/view-transitions.md +1 -1
- package/skills/void/docs/guide/platform/administration/access.md +1 -4
- package/skills/void/docs/guide/platform/administration/email.md +35 -8
- package/skills/void/docs/guide/platform/administration/operations.md +26 -4
- package/skills/void/docs/guide/platform/administration/plans.md +126 -0
- package/skills/void/docs/guide/platform/administration/projects.md +5 -2
- package/skills/void/docs/guide/platform/administration/zero-trust.md +189 -0
- package/skills/void/docs/guide/platform/development/local.md +2 -2
- package/skills/void/docs/guide/platform/development/runtime.md +3 -13
- package/skills/void/docs/guide/platform/development/schema-ci.md +0 -58
- package/skills/void/docs/guide/platform/installation/credentials.md +6 -4
- package/skills/void/docs/guide/platform/installation/domains.md +31 -3
- package/skills/void/docs/guide/platform/installation/first-deployment.md +6 -0
- package/skills/void/docs/guide/platform/installation/maintenance.md +3 -1
- package/skills/void/docs/guide/platform/installation/prerequisites.md +21 -16
- package/skills/void/docs/guide/platform/installation/setup.md +9 -5
- package/skills/void/docs/guide/platform/installation/uninstall.md +17 -2
- package/skills/void/docs/guide/platform-administration.md +2 -0
- package/skills/void/docs/guide/queues.md +7 -9
- package/skills/void/docs/guide/quickstart.md +38 -37
- package/skills/void/docs/guide/remote-dev.md +4 -9
- package/skills/void/docs/guide/sandboxes.md +78 -41
- package/skills/void/docs/guide/server-routing.md +9 -72
- package/skills/void/docs/guide/sse.md +4 -18
- package/skills/void/docs/guide/ssg.md +3 -15
- package/skills/void/docs/guide/ssr.md +14 -62
- package/skills/void/docs/guide/storage.md +9 -4
- package/skills/void/docs/guide/type-safety.md +3 -14
- package/skills/void/docs/guide/typed-fetch.md +3 -7
- package/skills/void/docs/guide/websockets.md +68 -40
- package/skills/void/docs/integrations/agents.md +3 -3
- package/skills/void/docs/integrations/cloudflare.md +85 -316
- package/skills/void/docs/integrations/frameworks/analog.md +5 -64
- package/skills/void/docs/integrations/frameworks/astro.md +4 -73
- package/skills/void/docs/integrations/frameworks/nuxt.md +5 -62
- package/skills/void/docs/integrations/frameworks/overview.md +11 -54
- package/skills/void/docs/integrations/frameworks/react-router.md +5 -60
- package/skills/void/docs/integrations/frameworks/sveltekit.md +6 -65
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +4 -62
- package/skills/void/docs/integrations/nodejs-bun-deno.md +5 -69
- package/skills/void/docs/reference/api/auth.md +156 -0
- package/skills/void/docs/reference/api/client.md +87 -0
- package/skills/void/docs/reference/api/database.md +95 -0
- package/skills/void/docs/reference/api/durable.md +46 -0
- package/skills/void/docs/reference/api/env.md +50 -0
- package/skills/void/docs/reference/api/handlers.md +254 -0
- package/skills/void/docs/reference/api/pages.md +241 -0
- package/skills/void/docs/reference/api/plugin.md +39 -0
- package/skills/void/docs/reference/api/resources.md +109 -0
- package/skills/void/docs/reference/api/rewrites.md +76 -0
- package/skills/void/docs/reference/api/types.md +92 -0
- package/skills/void/docs/reference/api.md +56 -1218
- package/skills/void/docs/reference/cli/auth.md +88 -0
- package/skills/void/docs/reference/cli/database.md +128 -0
- package/skills/void/docs/reference/cli/deploy.md +85 -0
- package/skills/void/docs/reference/cli/domains.md +41 -0
- package/skills/void/docs/reference/cli/email.md +129 -0
- package/skills/void/docs/reference/cli/generate.md +116 -0
- package/skills/void/docs/reference/cli/github.md +189 -0
- package/skills/void/docs/reference/cli/platform-config.md +92 -0
- package/skills/void/docs/reference/cli/platform-email.md +81 -0
- package/skills/void/docs/reference/cli/platform-installation.md +127 -0
- package/skills/void/docs/reference/cli/platform-operations.md +90 -0
- package/skills/void/docs/reference/cli/platform-users.md +89 -0
- package/skills/void/docs/reference/cli/platform-zero-trust.md +45 -0
- package/skills/void/docs/reference/cli/platform.md +70 -0
- package/skills/void/docs/reference/cli/project.md +214 -0
- package/skills/void/docs/reference/cli/secrets.md +76 -0
- package/skills/void/docs/reference/cli/setup.md +70 -0
- package/skills/void/docs/reference/cli.md +33 -1621
- package/skills/void/docs/reference/config.md +26 -32
- package/skills/void/docs/reference/resource-inference.md +3 -58
- package/skills/void/docs/reference/structure.md +14 -41
- package/dist/canonical-json-DuDiiUsQ.mjs +0 -13
- package/dist/cli/cf-compat.mjs +0 -968
- package/dist/client-4cDVv7BO.mjs +0 -2
- package/dist/gen-Vnv2f65C.mjs +0 -2
- package/dist/help-DQMfeKMz.mjs +0 -2
- package/dist/login-DFQk7rbW.mjs +0 -2
- package/dist/migrate-TsHGBnDA.mjs +0 -2
- package/dist/plan-BEZ8VJW0.mjs +0 -256
- package/dist/plan-DpuOr14e.mjs +0 -2
- package/dist/prepare-BZXkjdNe.mjs +0 -2
- package/dist/validate-EKmJWxmy.mjs +0 -2
- /package/dist/cli/{cf-compat.d.mts → cloudflare-operation-process.d.mts} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as parseRootWranglerConfig, J as runDeploy, f as checkWranglerMigrationApplySet } from "./deploy-
|
|
1
|
+
import { A as parseRootWranglerConfig, J as runDeploy, f as checkWranglerMigrationApplySet } from "./deploy-DzAIwqNU.mjs";
|
|
2
2
|
export { checkWranglerMigrationApplySet, parseRootWranglerConfig, runDeploy };
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
var comma = ",".charCodeAt(0);
|
|
3
3
|
var semicolon = ";".charCodeAt(0);
|
|
4
4
|
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
5
|
-
var intToChar = /* @__PURE__ */ new Uint8Array(64);
|
|
5
|
+
var intToChar$1 = /* @__PURE__ */ new Uint8Array(64);
|
|
6
6
|
var charToInt = /* @__PURE__ */ new Uint8Array(128);
|
|
7
7
|
for (let i = 0; i < chars.length; i++) {
|
|
8
8
|
const c = chars.charCodeAt(i);
|
|
9
|
-
intToChar[i] = c;
|
|
9
|
+
intToChar$1[i] = c;
|
|
10
10
|
charToInt[c] = i;
|
|
11
11
|
}
|
|
12
12
|
function encodeInteger(builder, num) {
|
|
@@ -14,7 +14,7 @@ function encodeInteger(builder, num) {
|
|
|
14
14
|
let clamped = num & 31;
|
|
15
15
|
num >>>= 5;
|
|
16
16
|
if (num > 0) clamped |= 32;
|
|
17
|
-
builder.write(intToChar[clamped]);
|
|
17
|
+
builder.write(intToChar$1[clamped]);
|
|
18
18
|
} while (num > 0);
|
|
19
19
|
}
|
|
20
20
|
function encodeSign(num) {
|
|
@@ -93,7 +93,7 @@ function encode(decoded) {
|
|
|
93
93
|
return writer.flush();
|
|
94
94
|
}
|
|
95
95
|
//#endregion
|
|
96
|
-
//#region ../../node_modules/.pnpm/magic-string@1.
|
|
96
|
+
//#region ../../node_modules/.pnpm/magic-string@1.4.2/node_modules/magic-string/dist/index.mjs
|
|
97
97
|
var BitSet = class BitSet {
|
|
98
98
|
constructor(arg) {
|
|
99
99
|
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
@@ -187,7 +187,7 @@ var Chunk = class Chunk {
|
|
|
187
187
|
this.outro = "";
|
|
188
188
|
this.end = index;
|
|
189
189
|
if (this.edited) {
|
|
190
|
-
newChunk.edit("", false);
|
|
190
|
+
newChunk.edit("", false, true);
|
|
191
191
|
this.content = "";
|
|
192
192
|
} else this.content = originalBefore;
|
|
193
193
|
newChunk.next = this.next;
|
|
@@ -265,7 +265,7 @@ var SourceMap = class {
|
|
|
265
265
|
this.sources = properties.sources;
|
|
266
266
|
this.sourcesContent = properties.sourcesContent;
|
|
267
267
|
this.names = properties.names;
|
|
268
|
-
this.mappings = encode(properties.mappings);
|
|
268
|
+
this.mappings = typeof properties.mappings === "string" ? properties.mappings : encode(properties.mappings);
|
|
269
269
|
if (typeof properties.x_google_ignoreList !== "undefined") this.x_google_ignoreList = properties.x_google_ignoreList;
|
|
270
270
|
if (typeof properties.debugId !== "undefined") this.debugId = properties.debugId;
|
|
271
271
|
if (typeof properties.rangeMappings !== "undefined") {
|
|
@@ -339,12 +339,100 @@ const toString = Object.prototype.toString;
|
|
|
339
339
|
function isObject(thing) {
|
|
340
340
|
return toString.call(thing) === "[object Object]";
|
|
341
341
|
}
|
|
342
|
+
const BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
343
|
+
const intToChar = /* #__PURE__ */ (() => {
|
|
344
|
+
const chars = /* @__PURE__ */ new Uint8Array(64);
|
|
345
|
+
for (let i = 0; i < 64; i++) chars[i] = BASE64_CHARS.charCodeAt(i);
|
|
346
|
+
return chars;
|
|
347
|
+
})();
|
|
348
|
+
const COMMA = 44;
|
|
349
|
+
const SEMICOLON = 59;
|
|
350
|
+
const BUFFER_SIZE = 16384;
|
|
351
|
+
const FLUSH_THRESHOLD = 16348;
|
|
352
|
+
const scratch = /* #__PURE__ */ new Uint8Array(BUFFER_SIZE);
|
|
353
|
+
function writeVlq(pos, num) {
|
|
354
|
+
num = num < 0 ? -num << 1 | 1 : num << 1;
|
|
355
|
+
do {
|
|
356
|
+
let clamped = num & 31;
|
|
357
|
+
num >>>= 5;
|
|
358
|
+
if (num > 0) clamped |= 32;
|
|
359
|
+
scratch[pos++] = intToChar[clamped];
|
|
360
|
+
} while (num > 0);
|
|
361
|
+
return pos;
|
|
362
|
+
}
|
|
363
|
+
const decoder = /* #__PURE__ */ new TextDecoder();
|
|
364
|
+
var MappingsEncoder = class {
|
|
365
|
+
constructor() {
|
|
366
|
+
this.out = "";
|
|
367
|
+
this.pos = 0;
|
|
368
|
+
this.lines = [];
|
|
369
|
+
this.buffered = 0;
|
|
370
|
+
this.needsComma = false;
|
|
371
|
+
this.prevGenColumn = 0;
|
|
372
|
+
this.prevSourceIndex = 0;
|
|
373
|
+
this.prevSourceLine = 0;
|
|
374
|
+
this.prevSourceColumn = 0;
|
|
375
|
+
this.prevNameIndex = 0;
|
|
376
|
+
}
|
|
377
|
+
endLine(segments) {
|
|
378
|
+
this.lines.push(segments);
|
|
379
|
+
this.buffered += segments.length + 1;
|
|
380
|
+
if (this.buffered >= 4096) this.drain(null);
|
|
381
|
+
}
|
|
382
|
+
segments(segments) {
|
|
383
|
+
this.drain(segments);
|
|
384
|
+
}
|
|
385
|
+
finish(segments) {
|
|
386
|
+
this.drain(segments);
|
|
387
|
+
this.flush();
|
|
388
|
+
return this.out;
|
|
389
|
+
}
|
|
390
|
+
drain(trailing) {
|
|
391
|
+
const lines = this.lines;
|
|
392
|
+
const lineCount = lines.length;
|
|
393
|
+
for (let l = 0; l <= lineCount; l++) {
|
|
394
|
+
const line = l < lineCount ? lines[l] : trailing;
|
|
395
|
+
if (line === null) break;
|
|
396
|
+
for (let i = 0; i < line.length; i++) {
|
|
397
|
+
if (this.pos > FLUSH_THRESHOLD) this.flush();
|
|
398
|
+
const segment = line[i];
|
|
399
|
+
if (this.needsComma) scratch[this.pos++] = COMMA;
|
|
400
|
+
this.needsComma = true;
|
|
401
|
+
this.pos = writeVlq(this.pos, segment[0] - this.prevGenColumn);
|
|
402
|
+
this.prevGenColumn = segment[0];
|
|
403
|
+
this.pos = writeVlq(this.pos, segment[1] - this.prevSourceIndex);
|
|
404
|
+
this.prevSourceIndex = segment[1];
|
|
405
|
+
this.pos = writeVlq(this.pos, segment[2] - this.prevSourceLine);
|
|
406
|
+
this.prevSourceLine = segment[2];
|
|
407
|
+
this.pos = writeVlq(this.pos, segment[3] - this.prevSourceColumn);
|
|
408
|
+
this.prevSourceColumn = segment[3];
|
|
409
|
+
if (segment.length === 5) {
|
|
410
|
+
this.pos = writeVlq(this.pos, segment[4] - this.prevNameIndex);
|
|
411
|
+
this.prevNameIndex = segment[4];
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
if (l < lineCount) {
|
|
415
|
+
if (this.pos > FLUSH_THRESHOLD) this.flush();
|
|
416
|
+
scratch[this.pos++] = SEMICOLON;
|
|
417
|
+
this.needsComma = false;
|
|
418
|
+
this.prevGenColumn = 0;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
lines.length = 0;
|
|
422
|
+
this.buffered = 0;
|
|
423
|
+
this.flush();
|
|
424
|
+
}
|
|
425
|
+
flush() {
|
|
426
|
+
this.out += decoder.decode(scratch.subarray(0, this.pos));
|
|
427
|
+
this.pos = 0;
|
|
428
|
+
}
|
|
429
|
+
};
|
|
342
430
|
const NEWLINE_CHAR$1 = 10;
|
|
343
431
|
function isWordCode(code) {
|
|
344
432
|
return code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 48 && code <= 57 || code === 95;
|
|
345
433
|
}
|
|
346
434
|
var Mappings = class {
|
|
347
|
-
constructor(hires) {
|
|
435
|
+
constructor(hires, encoder = null) {
|
|
348
436
|
this.hires = hires;
|
|
349
437
|
this.generatedCodeLine = 0;
|
|
350
438
|
this.generatedCodeColumn = 0;
|
|
@@ -352,10 +440,21 @@ var Mappings = class {
|
|
|
352
440
|
this.rawSegments = this.raw[this.generatedCodeLine] = [];
|
|
353
441
|
this.rawRangeMappings = [];
|
|
354
442
|
this.rawRangeMappingsIndices = this.rawRangeMappings[this.generatedCodeLine] = [];
|
|
355
|
-
this.
|
|
443
|
+
this.encoder = encoder;
|
|
444
|
+
}
|
|
445
|
+
nextLine() {
|
|
446
|
+
if (this.encoder === null) {
|
|
447
|
+
this.generatedCodeLine += 1;
|
|
448
|
+
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
449
|
+
} else {
|
|
450
|
+
this.encoder.endLine(this.rawSegments);
|
|
451
|
+
this.rawSegments = [];
|
|
452
|
+
this.generatedCodeLine += 1;
|
|
453
|
+
}
|
|
454
|
+
this.generatedCodeColumn = 0;
|
|
455
|
+
this.rawRangeMappings[this.generatedCodeLine] = this.rawRangeMappingsIndices = [];
|
|
356
456
|
}
|
|
357
457
|
addEdit(sourceIndex, content, loc, nameIndex) {
|
|
358
|
-
/* v8 ignore else -- `pending` is never assigned a truthy value */
|
|
359
458
|
if (content.length) {
|
|
360
459
|
const contentLengthMinusOne = content.length - 1;
|
|
361
460
|
let contentLineEnd = content.indexOf("\n", 0);
|
|
@@ -369,10 +468,7 @@ var Mappings = class {
|
|
|
369
468
|
];
|
|
370
469
|
if (nameIndex >= 0) segment.push(nameIndex);
|
|
371
470
|
this.rawSegments.push(segment);
|
|
372
|
-
this.
|
|
373
|
-
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
374
|
-
this.rawRangeMappings[this.generatedCodeLine] = this.rawRangeMappingsIndices = [];
|
|
375
|
-
this.generatedCodeColumn = 0;
|
|
471
|
+
this.nextLine();
|
|
376
472
|
previousContentLineEnd = contentLineEnd;
|
|
377
473
|
contentLineEnd = content.indexOf("\n", contentLineEnd + 1);
|
|
378
474
|
}
|
|
@@ -385,11 +481,7 @@ var Mappings = class {
|
|
|
385
481
|
if (nameIndex >= 0) segment.push(nameIndex);
|
|
386
482
|
this.rawSegments.push(segment);
|
|
387
483
|
this.advance(content.slice(previousContentLineEnd + 1));
|
|
388
|
-
} else if (this.pending) {
|
|
389
|
-
this.rawSegments.push(this.pending);
|
|
390
|
-
this.advance(content);
|
|
391
484
|
}
|
|
392
|
-
this.pending = null;
|
|
393
485
|
}
|
|
394
486
|
addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
|
|
395
487
|
const end = chunk.end;
|
|
@@ -397,8 +489,13 @@ var Mappings = class {
|
|
|
397
489
|
if (this.hires) {
|
|
398
490
|
const boundary = this.hires === "boundary";
|
|
399
491
|
const experimentalRange = this.hires === "experimental-range";
|
|
492
|
+
const encoder = experimentalRange ? null : this.encoder;
|
|
400
493
|
let charInHiresBoundary = false;
|
|
401
494
|
while (i < end) {
|
|
495
|
+
if (encoder !== null && this.rawSegments.length >= 4096) {
|
|
496
|
+
encoder.segments(this.rawSegments);
|
|
497
|
+
this.rawSegments.length = 0;
|
|
498
|
+
}
|
|
402
499
|
if (experimentalRange && i + 1 >= end) this.rawSegments.push([
|
|
403
500
|
this.generatedCodeColumn,
|
|
404
501
|
sourceIndex,
|
|
@@ -409,10 +506,7 @@ var Mappings = class {
|
|
|
409
506
|
if (code === NEWLINE_CHAR$1) {
|
|
410
507
|
loc.line += 1;
|
|
411
508
|
loc.column = 0;
|
|
412
|
-
this.
|
|
413
|
-
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
414
|
-
this.rawRangeMappings[this.generatedCodeLine] = this.rawRangeMappingsIndices = [];
|
|
415
|
-
this.generatedCodeColumn = 0;
|
|
509
|
+
this.nextLine();
|
|
416
510
|
charInHiresBoundary = false;
|
|
417
511
|
} else {
|
|
418
512
|
if (boundary) {
|
|
@@ -493,26 +587,15 @@ var Mappings = class {
|
|
|
493
587
|
if (newline === end) break;
|
|
494
588
|
loc.line += 1;
|
|
495
589
|
loc.column = 0;
|
|
496
|
-
this.
|
|
497
|
-
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
498
|
-
this.rawRangeMappings[this.generatedCodeLine] = this.rawRangeMappingsIndices = [];
|
|
499
|
-
this.generatedCodeColumn = 0;
|
|
590
|
+
this.nextLine();
|
|
500
591
|
i = newline + 1;
|
|
501
592
|
}
|
|
502
593
|
}
|
|
503
|
-
this.pending = null;
|
|
504
594
|
}
|
|
505
595
|
advance(str) {
|
|
506
596
|
if (!str) return;
|
|
507
597
|
const lastNewline = str.lastIndexOf("\n");
|
|
508
|
-
|
|
509
|
-
for (let i = str.indexOf("\n"); i !== -1; i = str.indexOf("\n", i + 1)) {
|
|
510
|
-
this.generatedCodeLine++;
|
|
511
|
-
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
512
|
-
this.rawRangeMappings[this.generatedCodeLine] = this.rawRangeMappingsIndices = [];
|
|
513
|
-
}
|
|
514
|
-
this.generatedCodeColumn = 0;
|
|
515
|
-
}
|
|
598
|
+
for (let i = str.indexOf("\n"); i !== -1; i = str.indexOf("\n", i + 1)) this.nextLine();
|
|
516
599
|
this.generatedCodeColumn += str.length - lastNewline - 1;
|
|
517
600
|
}
|
|
518
601
|
};
|
|
@@ -731,9 +814,32 @@ var MagicString = class MagicString {
|
|
|
731
814
|
*/
|
|
732
815
|
generateDecodedMap(options) {
|
|
733
816
|
options = options || {};
|
|
817
|
+
const mappings = new Mappings(options.hires);
|
|
818
|
+
const names = this._generateMappings(mappings);
|
|
819
|
+
return {
|
|
820
|
+
...this._mapProperties(options, names),
|
|
821
|
+
mappings: mappings.raw,
|
|
822
|
+
rangeMappings: mappings.rawRangeMappings
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Generates a version 3 sourcemap.
|
|
827
|
+
*/
|
|
828
|
+
generateMap(options) {
|
|
829
|
+
options = options || {};
|
|
830
|
+
const encoder = new MappingsEncoder();
|
|
831
|
+
const mappings = new Mappings(options.hires, encoder);
|
|
832
|
+
const names = this._generateMappings(mappings);
|
|
833
|
+
return new SourceMap({
|
|
834
|
+
...this._mapProperties(options, names),
|
|
835
|
+
mappings: encoder.finish(mappings.rawSegments),
|
|
836
|
+
rangeMappings: mappings.rawRangeMappings
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
/** @internal */
|
|
840
|
+
_generateMappings(mappings) {
|
|
734
841
|
const sourceIndex = 0;
|
|
735
842
|
const names = Object.keys(this.storedNames);
|
|
736
|
-
const mappings = new Mappings(options.hires);
|
|
737
843
|
const locate = getLocator(this.original);
|
|
738
844
|
if (this.intro) mappings.advance(this.intro);
|
|
739
845
|
this.firstChunk.eachNext((chunk) => {
|
|
@@ -744,22 +850,18 @@ var MagicString = class MagicString {
|
|
|
744
850
|
if (chunk.outro.length) mappings.advance(chunk.outro);
|
|
745
851
|
});
|
|
746
852
|
if (this.outro) mappings.advance(this.outro);
|
|
853
|
+
return names;
|
|
854
|
+
}
|
|
855
|
+
/** @internal */
|
|
856
|
+
_mapProperties(options, names) {
|
|
747
857
|
return {
|
|
748
858
|
file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
|
|
749
859
|
sources: [options.source ? getRelativePath(options.file || "", options.source) : options.file || ""],
|
|
750
860
|
sourcesContent: options.includeContent ? [this.original] : void 0,
|
|
751
861
|
names,
|
|
752
|
-
|
|
753
|
-
x_google_ignoreList: this.ignoreList ? [sourceIndex] : void 0,
|
|
754
|
-
rangeMappings: mappings.rawRangeMappings
|
|
862
|
+
x_google_ignoreList: this.ignoreList ? [0] : void 0
|
|
755
863
|
};
|
|
756
864
|
}
|
|
757
|
-
/**
|
|
758
|
-
* Generates a version 3 sourcemap.
|
|
759
|
-
*/
|
|
760
|
-
generateMap(options) {
|
|
761
|
-
return new SourceMap(this.generateDecodedMap(options));
|
|
762
|
-
}
|
|
763
865
|
/** @internal */
|
|
764
866
|
_ensureindentStr() {
|
|
765
867
|
if (this.indentStr === void 0) this.indentStr = guessIndent(this.original);
|
|
@@ -872,8 +974,14 @@ var MagicString = class MagicString {
|
|
|
872
974
|
}
|
|
873
975
|
/**
|
|
874
976
|
* Moves the characters from `start` and `end` to `index`.
|
|
977
|
+
*
|
|
978
|
+
* `affinity` controls where the range is anchored at `index`. With the
|
|
979
|
+
* default `'right'`, it is inserted before the content that starts at `index`;
|
|
980
|
+
* with `'left'`, it is inserted after the content that ends at `index`. The
|
|
981
|
+
* two differ only when other content has already been moved to that boundary,
|
|
982
|
+
* mirroring the `appendLeft`/`appendRight` distinction.
|
|
875
983
|
*/
|
|
876
|
-
move(start, end, index) {
|
|
984
|
+
move(start, end, index, affinity = "right") {
|
|
877
985
|
start = start + this.offset;
|
|
878
986
|
end = end + this.offset;
|
|
879
987
|
index = index + this.offset;
|
|
@@ -893,9 +1001,27 @@ var MagicString = class MagicString {
|
|
|
893
1001
|
}
|
|
894
1002
|
const oldLeft = first.previous;
|
|
895
1003
|
const oldRight = last.next;
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
1004
|
+
let newLeft;
|
|
1005
|
+
let newRight;
|
|
1006
|
+
if (affinity === "left") {
|
|
1007
|
+
newLeft = this.byEnd.get(index) ?? null;
|
|
1008
|
+
if (!newLeft) {
|
|
1009
|
+
if (first === this.firstChunk) return this;
|
|
1010
|
+
newRight = this.firstChunk;
|
|
1011
|
+
} else {
|
|
1012
|
+
if (newLeft.next === first) return this;
|
|
1013
|
+
newRight = newLeft.next;
|
|
1014
|
+
}
|
|
1015
|
+
} else {
|
|
1016
|
+
newRight = this.byStart.get(index) ?? null;
|
|
1017
|
+
if (!newRight) {
|
|
1018
|
+
if (last === this.lastChunk) return this;
|
|
1019
|
+
newLeft = this.lastChunk;
|
|
1020
|
+
} else {
|
|
1021
|
+
if (newRight.previous === last) return this;
|
|
1022
|
+
newLeft = newRight.previous;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
899
1025
|
if (oldLeft) oldLeft.next = oldRight;
|
|
900
1026
|
if (oldRight) oldRight.previous = oldLeft;
|
|
901
1027
|
if (newLeft) newLeft.next = first;
|
|
@@ -1020,7 +1146,10 @@ var MagicString = class MagicString {
|
|
|
1020
1146
|
}
|
|
1021
1147
|
/**
|
|
1022
1148
|
* Removes the characters from `start` to `end` (of the original string, **not** the generated string).
|
|
1023
|
-
*
|
|
1149
|
+
* Content appended or prepended at positions strictly inside the range is removed with it, while
|
|
1150
|
+
* content attached at `start` or `end` is preserved — use `s.overwrite(start, end, '')` to remove
|
|
1151
|
+
* the range including its edge inserts.
|
|
1152
|
+
* Repeated removals and removals with partially overlapping ranges are allowed.
|
|
1024
1153
|
*/
|
|
1025
1154
|
remove(start, end) {
|
|
1026
1155
|
start = start + this.offset;
|
|
@@ -1036,9 +1165,9 @@ var MagicString = class MagicString {
|
|
|
1036
1165
|
this._split(end);
|
|
1037
1166
|
let chunk = this.byStart.get(start);
|
|
1038
1167
|
while (chunk) {
|
|
1039
|
-
chunk.intro = "";
|
|
1040
|
-
chunk.outro = "";
|
|
1041
|
-
chunk.edit("");
|
|
1168
|
+
if (chunk.start > start) chunk.intro = "";
|
|
1169
|
+
if (chunk.end < end) chunk.outro = "";
|
|
1170
|
+
chunk.edit("", false, true);
|
|
1042
1171
|
chunk = end > chunk.end ? this.byStart.get(chunk.end) : null;
|
|
1043
1172
|
}
|
|
1044
1173
|
return this;
|
|
@@ -1118,12 +1247,13 @@ var MagicString = class MagicString {
|
|
|
1118
1247
|
let result = "";
|
|
1119
1248
|
let chunk = this.firstChunk;
|
|
1120
1249
|
while (chunk && (chunk.start > start || chunk.end <= start)) {
|
|
1121
|
-
if (chunk.start < end && chunk.end >= end) return result;
|
|
1250
|
+
if (chunk.start < end && chunk.end >= end || end === 0 && chunk.start === 0) return result;
|
|
1122
1251
|
chunk = chunk.next;
|
|
1123
1252
|
}
|
|
1124
1253
|
if (chunk && chunk.edited && chunk.start !== start) throw new MagicStringError(`cannot use edited character ${start} as slice start anchor`);
|
|
1125
1254
|
const startChunk = chunk;
|
|
1126
1255
|
while (chunk) {
|
|
1256
|
+
if (end === 0 && chunk.start === 0) break;
|
|
1127
1257
|
if (chunk.intro && (startChunk !== chunk || chunk.start === start)) result += chunk.intro;
|
|
1128
1258
|
const containsEnd = chunk.start < end && chunk.end >= end;
|
|
1129
1259
|
if (containsEnd && chunk.edited && chunk.end !== end) throw new MagicStringError(`cannot use edited character ${end} as slice end anchor`);
|
|
@@ -1236,7 +1366,8 @@ var MagicString = class MagicString {
|
|
|
1236
1366
|
if (aborted) return true;
|
|
1237
1367
|
chunk = chunk.previous;
|
|
1238
1368
|
} while (chunk);
|
|
1239
|
-
|
|
1369
|
+
this.intro = this.intro.replace(rx, "");
|
|
1370
|
+
return this.intro.length > 0;
|
|
1240
1371
|
}
|
|
1241
1372
|
/**
|
|
1242
1373
|
* Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the end.
|
|
@@ -1263,7 +1394,8 @@ var MagicString = class MagicString {
|
|
|
1263
1394
|
if (aborted) return true;
|
|
1264
1395
|
chunk = chunk.next;
|
|
1265
1396
|
} while (chunk);
|
|
1266
|
-
|
|
1397
|
+
this.outro = this.outro.replace(rx, "");
|
|
1398
|
+
return this.outro.length > 0;
|
|
1267
1399
|
}
|
|
1268
1400
|
/**
|
|
1269
1401
|
* Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start.
|
|
@@ -1290,6 +1422,28 @@ var MagicString = class MagicString {
|
|
|
1290
1422
|
}
|
|
1291
1423
|
return outputIndex !== this.original.length;
|
|
1292
1424
|
}
|
|
1425
|
+
/**
|
|
1426
|
+
* Whether the original range [start, end) has had any of its characters
|
|
1427
|
+
* removed. `replace`/`replaceAll` search `original`, so a match can land on
|
|
1428
|
+
* text that is no longer in the output - overwriting it would resurrect the
|
|
1429
|
+
* removed characters, so such matches are skipped instead.
|
|
1430
|
+
*
|
|
1431
|
+
* @internal
|
|
1432
|
+
*/
|
|
1433
|
+
_hasRemovedContent(start, end) {
|
|
1434
|
+
let chunk = this.byStart.get(start);
|
|
1435
|
+
if (!chunk) {
|
|
1436
|
+
chunk = this.lastSearchedChunk;
|
|
1437
|
+
const searchForward = start >= chunk.end;
|
|
1438
|
+
while (chunk && !chunk.contains(start)) chunk = searchForward ? this.byStart.get(chunk.end) : this.byEnd.get(chunk.start);
|
|
1439
|
+
if (chunk) this.lastSearchedChunk = chunk;
|
|
1440
|
+
}
|
|
1441
|
+
while (chunk && chunk.start < end) {
|
|
1442
|
+
if (chunk.content === "") return true;
|
|
1443
|
+
chunk = this.byStart.get(chunk.end);
|
|
1444
|
+
}
|
|
1445
|
+
return false;
|
|
1446
|
+
}
|
|
1293
1447
|
/** @internal */
|
|
1294
1448
|
_replaceRegexp(searchValue, replacement) {
|
|
1295
1449
|
function getReplacement(match, str) {
|
|
@@ -1298,32 +1452,42 @@ var MagicString = class MagicString {
|
|
|
1298
1452
|
}
|
|
1299
1453
|
const replaceMatch = (match) => {
|
|
1300
1454
|
/* v8 ignore next 2 -- `match.index` is always defined for matches from `matchAll` */
|
|
1301
|
-
if (match.index == null) return;
|
|
1455
|
+
if (match.index == null) return false;
|
|
1456
|
+
if (this._hasRemovedContent(match.index, match.index + match[0].length)) return false;
|
|
1302
1457
|
const replacement = getReplacement(match, this.original);
|
|
1303
|
-
if (replacement === match[0]) return;
|
|
1458
|
+
if (replacement === match[0]) return true;
|
|
1304
1459
|
if (match[0].length === 0) this.appendRight(match.index, replacement);
|
|
1305
1460
|
else this.overwrite(match.index, match.index + match[0].length, replacement);
|
|
1461
|
+
return true;
|
|
1306
1462
|
};
|
|
1307
1463
|
if (searchValue.global) {
|
|
1308
1464
|
searchValue.lastIndex = 0;
|
|
1309
1465
|
for (const match of this.original.matchAll(searchValue)) replaceMatch(match);
|
|
1310
1466
|
} else {
|
|
1311
1467
|
const match = this.original.match(searchValue);
|
|
1312
|
-
if (match
|
|
1468
|
+
if (match && !replaceMatch(match)) {
|
|
1469
|
+
const global = new RegExp(searchValue.source, `${searchValue.flags}g`);
|
|
1470
|
+
for (const next of this.original.matchAll(global)) if (replaceMatch(next)) break;
|
|
1471
|
+
}
|
|
1313
1472
|
}
|
|
1314
1473
|
return this;
|
|
1315
1474
|
}
|
|
1316
1475
|
/** @internal */
|
|
1317
1476
|
_replaceString(string, replacement) {
|
|
1318
1477
|
const { original } = this;
|
|
1319
|
-
|
|
1320
|
-
|
|
1478
|
+
let index = original.indexOf(string);
|
|
1479
|
+
while (index !== -1) {
|
|
1480
|
+
if (this._hasRemovedContent(index, index + string.length)) {
|
|
1481
|
+
index = original.indexOf(string, index + string.length);
|
|
1482
|
+
continue;
|
|
1483
|
+
}
|
|
1321
1484
|
if (typeof replacement === "function") replacement = replacement(string, index, original);
|
|
1322
1485
|
else replacement = expandReplacement(replacement, string, index, original, [], void 0);
|
|
1323
1486
|
if (string !== replacement) {
|
|
1324
1487
|
if (string.length === 0) this.appendRight(index, replacement);
|
|
1325
1488
|
else this.overwrite(index, index + string.length, replacement);
|
|
1326
1489
|
}
|
|
1490
|
+
break;
|
|
1327
1491
|
}
|
|
1328
1492
|
return this;
|
|
1329
1493
|
}
|
|
@@ -1340,12 +1504,14 @@ var MagicString = class MagicString {
|
|
|
1340
1504
|
const stringLength = string.length;
|
|
1341
1505
|
if (stringLength === 0) {
|
|
1342
1506
|
for (let index = 0; index <= original.length; index += 1) {
|
|
1507
|
+
if (this._hasRemovedContent(index, index)) continue;
|
|
1343
1508
|
const _replacement = typeof replacement === "function" ? replacement("", index, original) : expandReplacement(replacement, "", index, original, [], void 0);
|
|
1344
1509
|
if (_replacement !== "") this.appendRight(index, _replacement);
|
|
1345
1510
|
}
|
|
1346
1511
|
return this;
|
|
1347
1512
|
}
|
|
1348
1513
|
for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
|
|
1514
|
+
if (this._hasRemovedContent(index, index + stringLength)) continue;
|
|
1349
1515
|
const previous = original.slice(index, index + stringLength);
|
|
1350
1516
|
const _replacement = typeof replacement === "function" ? replacement(previous, index, original) : expandReplacement(replacement, previous, index, original, [], void 0);
|
|
1351
1517
|
if (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { B as text, I as select, W as isCancel, j as log } from "./dist-
|
|
1
|
+
import { B as text, I as select, W as isCancel, j as log } from "./dist-CTBk70IR.mjs";
|
|
2
2
|
export { isCancel, log, select, text };
|