@voltro/cli 0.33.0 → 0.34.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/CHANGELOG.md +1801 -0
- package/bin/nodeEnvironment.d.mts +30 -0
- package/bin/nodeEnvironment.mjs +158 -0
- package/bin/voltro.mjs +69 -5
- package/dist/addCommand-BNeoeSxe.js +124 -0
- package/dist/addCommand-aXSQveak.js +2 -0
- package/dist/agentsMd-BTchIZku.js +2 -0
- package/dist/agentsMd-mhQMF1bx.js +254 -0
- package/dist/apiBuild-BICVGnEC.js +2 -0
- package/dist/{apiBuild-h9VHtnlw.js → apiBuild-DZF_f0_I.js} +46 -46
- package/dist/appPort-B_HpJ_ck.js +48 -0
- package/dist/baselineCommand-C2ClWZN3.js +2 -0
- package/dist/baselineCommand-DIttzO8A.js +227 -0
- package/dist/bin.js +71 -28
- package/dist/build-CE7Ca9gm.js +711 -0
- package/dist/cacheCommand-DA4OH9xt.js +42 -0
- package/dist/capabilitiesCommand-nq_pz5xd.js +123 -0
- package/dist/checkCommand-Dv8r9tGO.js +231 -0
- package/dist/checkCommand-YZDmkAGd.js +2 -0
- package/dist/{cliArgs-qdZSElM3.js → cliArgs-D4p8n7EE.js} +12 -1
- package/dist/cliError-BmdYnghb.js +10 -0
- package/dist/cliOutput-D1tSBoRM.js +15 -0
- package/dist/{cliRuntime-Oh517vCV.js → cliRuntime-Dh7UDinH.js} +20 -20
- package/dist/cloudClient-DWL-Hw_T.js +67 -0
- package/dist/cloudCmd-Cvv5HGaZ.js +364 -0
- package/dist/clusterCmd-CNXKlcvD.js +54 -0
- package/dist/codegen-CYM3Zqrf.js +605 -0
- package/dist/codegen-ChBi_hVa.js +2 -0
- package/dist/codegenCommand-DC6w2tNZ.js +30 -0
- package/dist/codemodRunner-DRRqXR74.js +5243 -0
- package/dist/commandRunner-BLAEFLjp.js +47 -0
- package/dist/commands-gutsz-Ac.js +808 -0
- package/dist/connectionConfig-UFlIEiys.js +66 -0
- package/dist/dashboardCommand-3YG8p-UA.js +25 -0
- package/dist/dataCommand-qL0r7fPO.js +535 -0
- package/dist/dataProfile-dW-PsfLB.js +15 -0
- package/dist/{dbCommand-DTLKAfbA.js → dbCommand-B6X0FZbq.js} +551 -401
- package/dist/dbCommand-CpdKLeQq.js +2 -0
- package/dist/{dev-C_P8FLSx.js → dev-CerMd0mW.js} +3122 -3129
- package/dist/dev-CoG-ZPx8.js +3 -0
- package/dist/devActivity-Dx_3nnGv.js +100 -0
- package/dist/devActivity.js +1 -1
- package/dist/dialectDriver-CgXnDfec.js +39 -0
- package/dist/discover-C9XKJDco.js +25 -0
- package/dist/doctorCommand-BvqGBwNG.js +2 -0
- package/dist/{checkCommand-xGhRFFg2.js → doctorCommand-CnDXQxfa.js} +520 -1278
- package/dist/dormancyCommand-Dszo57d6.js +69 -0
- package/dist/e2eCmd-BRabZww-.js +147 -0
- package/dist/embeddingsCommand-C0sKVRo1.js +73 -0
- package/dist/envCommand-DPgdV1Bq.js +60 -0
- package/dist/evalCommand-6RUfPen4.js +118 -0
- package/dist/evolveCommand-DHpkgjgH.js +281 -0
- package/dist/fileTaxonomy-CJfgOllU.js +457 -0
- package/dist/frameworkTableAssembly-BGHmck-x.js +2 -0
- package/dist/{frameworkTableAssembly-BwIrO5nv.js → frameworkTableAssembly-DkkP6BgC.js} +184 -148
- package/dist/generateCommand-oibemh97.js +147 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +4 -3
- package/dist/infoCommand-BJw9nLUR.js +60 -0
- package/dist/{inspect-BUUjt773.js → inspect-CBqFtAKA.js} +82 -40
- package/dist/inspect-C_T_WGvl.js +2 -0
- package/dist/inspectCmd-Bppy-GGw.js +224 -0
- package/dist/inspectFetch-Cm8_wVvp.js +151 -0
- package/dist/inspectMetrics-CfdKLh6t.js +72 -0
- package/dist/loadEnv-D9nEOClM.js +44 -0
- package/dist/logFileSink-C_D2wRN1.js +105 -0
- package/dist/logsCmd-CCca3KRZ.js +260 -0
- package/dist/manifestBuild-ChsKAhmn.js +2 -0
- package/dist/{manifestBuild-BLrVuSlM.js → manifestBuild-sxpwdKY1.js} +1 -1
- package/dist/metaCommands-7MJfZ5cf.js +196 -0
- package/dist/migrate-CBwOt_iV.js +83 -0
- package/dist/mssqlClusterPatch-_4cE_nun.js +44 -0
- package/dist/newCommand-COWOJ1_E.js +156 -0
- package/dist/nodeEnvironment-cGFAj1J8.js +28 -0
- package/dist/packageCommand-Cug_3Ogl.js +271 -0
- package/dist/pageConvention-cEiRxdab.js +5 -0
- package/dist/privacyCommand-C-Df56U_.js +146 -0
- package/dist/projectScaffold-DmzEKHib.js +2 -0
- package/dist/projectScaffold-LMMtaavR.js +814 -0
- package/dist/renderModeScan-D7J1B7Kw.js +105 -0
- package/dist/renderProfile-1OWWAAtx.js +81 -0
- package/dist/runtimeRegistry-DMeKfTHP.js +81 -0
- package/dist/runtimeTrace-CRxalXTs.js +91 -0
- package/dist/scheduleCmd--jksTrf6.js +69 -0
- package/dist/scheduleManifestCmd-D2x0CTTY.js +249 -0
- package/dist/schemaIr-UJybUUZW.js +103 -0
- package/dist/{sdkgen-C81QIkiL.js → sdkgen-CYJscZC7.js} +111 -209
- package/dist/seedRunner-TFHHiToI.js +329 -0
- package/dist/serveCommand-B_isw7q4.js +1647 -0
- package/dist/serveCommand-DOvbgRnQ.js +2 -0
- package/dist/serveEntry.js +5 -5
- package/dist/serverlessCommand-CfJZy6dS.js +482 -0
- package/dist/start-9LiUOfES.js +1087 -0
- package/dist/start-B-9Nsp-S.js +3 -0
- package/dist/startEntry.js +2 -2
- package/dist/staticCommand-Dr2M6tpU.js +304 -0
- package/dist/storageCommand-Co6NfLqN.js +42 -0
- package/dist/templates-De8IR5-c.js +102 -0
- package/dist/test-CI6iDsYc.js +115 -0
- package/dist/tracesCmd-CkEZQrtt.js +232 -0
- package/dist/tsconfigPaths-BWXBWgcl.js +107 -0
- package/dist/tsxLoader-EuXmSJ1K.js +51 -0
- package/dist/typecheckCommand-BlsWiCNq.js +61 -0
- package/dist/updateCommand-Bkptutss.js +585 -0
- package/dist/updateCommand-us1_hdIC.js +2 -0
- package/dist/{inspectMetrics-1xzTKAFx.js → webDev-CBYvPqQr.js} +975 -1559
- package/dist/webDev-Cg-fFiyd2.js +2 -0
- package/dist/webhookDiscovery-CrGAfhIG.js +2 -0
- package/dist/webhookDiscovery-D7VaeMlz.js +51 -0
- package/dist/webhooksCommand-CID96Rga.js +267 -0
- package/dist/workflowsCmd-D1VTmLMY.js +608 -0
- package/package.json +179 -17
- package/templates/AGENTS.core.md +58 -3
- package/templates/AGENTS.md +64 -7
- package/templates/agent-docs/_index.md +6 -4
- package/templates/agent-docs/_manifest.json +22 -5
- package/templates/agent-docs/ai.md +370 -0
- package/templates/agent-docs/authentication.md +265 -31
- package/templates/agent-docs/caching.md +6 -0
- package/templates/agent-docs/cli.md +794 -50
- package/templates/agent-docs/data.md +550 -11
- package/templates/agent-docs/database/migrations.md +174 -25
- package/templates/agent-docs/database/misc.md +156 -40
- package/templates/agent-docs/database/querying.md +19 -1
- package/templates/agent-docs/database/scaling.md +60 -0
- package/templates/agent-docs/database/schema.md +1 -0
- package/templates/agent-docs/database/seedsdialects.md +208 -19
- package/templates/agent-docs/database/transactions.md +68 -0
- package/templates/agent-docs/deployment.md +69 -3
- package/templates/agent-docs/introduction.md +87 -16
- package/templates/agent-docs/local-first-mobile.md +79 -4
- package/templates/agent-docs/multi-tenancy.md +95 -20
- package/templates/agent-docs/observability.md +58 -3
- package/templates/agent-docs/plugins/ai-flows.md +161 -2
- package/templates/agent-docs/plugins/analytics-postgres.md +1 -1
- package/templates/agent-docs/plugins/audit.md +37 -1
- package/templates/agent-docs/plugins/auth-social.md +143 -0
- package/templates/agent-docs/plugins/auth-workos.md +4 -2
- package/templates/agent-docs/plugins/auth.md +131 -6
- package/templates/agent-docs/plugins/billing.md +132 -15
- package/templates/agent-docs/plugins/cdc-out.md +46 -7
- package/templates/agent-docs/plugins/clickhouse.md +1 -1
- package/templates/agent-docs/plugins/duckdb.md +1 -1
- package/templates/agent-docs/plugins/flags.md +132 -0
- package/templates/agent-docs/plugins/governance.md +105 -7
- package/templates/agent-docs/plugins/multitenancy.md +9 -4
- package/templates/agent-docs/plugins/presence.md +13 -2
- package/templates/agent-docs/plugins/ratelimit.md +9 -0
- package/templates/agent-docs/plugins/search.md +157 -6
- package/templates/agent-docs/plugins/sso-saml.md +47 -8
- package/templates/agent-docs/plugins/webhooks.md +105 -0
- package/templates/agent-docs/plugins.md +150 -18
- package/templates/agent-docs/reference.md +60 -3
- package/templates/agent-docs/releases.md +1117 -0
- package/templates/agent-docs/routing.md +43 -25
- package/templates/agent-docs/scheduling.md +10 -0
- package/templates/agent-docs/schema-driven-ui.md +92 -12
- package/templates/agent-docs/security.md +426 -0
- package/templates/agent-docs/templates/apibackends.md +87 -18
- package/templates/agent-docs/templates/appshells.md +32 -14
- package/templates/agent-docs/templates/overview.md +13 -8
- package/templates/agent-docs/testing.md +211 -14
- package/templates/agent-docs/whats-new.md +1700 -104
- package/templates/agent-docs/workflows.md +130 -14
- package/templates/apps/api-ai/actions/summarize.action.ts +11 -0
- package/templates/apps/api-ai/package.json +8 -7
- package/templates/apps/api-auth/actions/me.action.ts +13 -0
- package/templates/apps/api-auth/package.json +9 -8
- package/templates/apps/api-backend/mutations/notes.create.mutation.ts +9 -0
- package/templates/apps/api-backend/package.json +12 -8
- package/templates/apps/api-backend/queries/notes.query.ts +30 -8
- package/templates/apps/api-backend-deactivation/actions/users.get.action.ts +14 -0
- package/templates/apps/api-backend-deactivation/mutations/users.create.mutation.ts +8 -0
- package/templates/apps/api-backend-deactivation/mutations/users.deactivate.mutation.ts +10 -0
- package/templates/apps/api-backend-deactivation/package.json +8 -7
- package/templates/apps/api-backend-mail/actions/sendWelcome.action.ts +17 -0
- package/templates/apps/api-backend-mail/mutations/notes.create.mutation.ts +9 -0
- package/templates/apps/api-backend-mail/package.json +9 -8
- package/templates/apps/api-backend-mail/queries/notes.query.ts +30 -8
- package/templates/apps/api-backend-mariadb/.env.example +14 -0
- package/templates/apps/api-backend-mariadb/mutations/notes.create.mutation.ts +9 -0
- package/templates/apps/api-backend-mariadb/package.json +10 -9
- package/templates/apps/api-backend-mariadb/queries/notes.query.ts +30 -8
- package/templates/apps/api-backend-sqlite/.env.example +14 -0
- package/templates/apps/api-backend-sqlite/mutations/notes.create.mutation.ts +9 -0
- package/templates/apps/api-backend-sqlite/package.json +9 -8
- package/templates/apps/api-backend-sqlite/queries/notes.query.ts +30 -8
- package/templates/apps/api-backend-storage/actions/uploadAvatar.action.ts +13 -0
- package/templates/apps/api-backend-storage/actions/uploadDocument.action.ts +12 -0
- package/templates/apps/api-backend-storage/mutations/notes.create.mutation.ts +9 -0
- package/templates/apps/api-backend-storage/package.json +9 -8
- package/templates/apps/api-backend-storage/queries/notes.query.ts +30 -8
- package/templates/apps/api-cms/actions/content.get.action.ts +7 -0
- package/templates/apps/api-cms/actions/content.types.action.ts +6 -0
- package/templates/apps/api-cms/actions/me.action.ts +13 -0
- package/templates/apps/api-cms/app.config.ts +19 -0
- package/templates/apps/api-cms/authz.ts +63 -0
- package/templates/apps/api-cms/mutations/content.publish.mutation.ts +10 -0
- package/templates/apps/api-cms/mutations/content.saveDraft.mutation.ts +10 -0
- package/templates/apps/api-cms/mutations/content.unpublish.mutation.ts +5 -0
- package/templates/apps/api-cms/package.json +11 -10
- package/templates/apps/api-cms/queries/content.list.query.ts +23 -7
- package/templates/apps/api-cms/tests/accessDecisions.test.ts +121 -0
- package/templates/apps/api-cms/tests/content.descriptors.test.ts +8 -4
- package/templates/apps/api-collab/mutations/documents.create.mutation.ts +8 -0
- package/templates/apps/api-collab/mutations/documents.setBody.mutation.ts +13 -0
- package/templates/apps/api-collab/package.json +9 -8
- package/templates/apps/api-collab/queries/documents.query.ts +19 -7
- package/templates/apps/api-data-advanced/package.json +9 -8
- package/templates/apps/api-data-advanced/queries/authors.withBooks.query.ts +12 -0
- package/templates/apps/api-data-advanced/queries/books.search.query.ts +9 -0
- package/templates/apps/api-durable/mutations/orders.approve.mutation.ts +17 -0
- package/templates/apps/api-durable/mutations/orders.place.mutation.ts +9 -0
- package/templates/apps/api-durable/package.json +9 -8
- package/templates/apps/api-feature-flags/actions/notes.export.action.ts +16 -0
- package/templates/apps/api-feature-flags/mutations/notes.create.mutation.ts +12 -0
- package/templates/apps/api-feature-flags/package.json +10 -9
- package/templates/apps/api-governance/README.md +30 -8
- package/templates/apps/api-governance/actions/profiles.get.action.server.ts +17 -1
- package/templates/apps/api-governance/actions/profiles.get.action.ts +29 -4
- package/templates/apps/api-governance/database/schema.ts +16 -4
- package/templates/apps/api-governance/mutations/profiles.create.mutation.ts +12 -0
- package/templates/apps/api-governance/package.json +9 -8
- package/templates/apps/api-kv/actions/sync.pull.action.ts +15 -0
- package/templates/apps/api-kv/actions/sync.reset.action.ts +13 -0
- package/templates/apps/api-kv/actions/sync.status.action.ts +7 -0
- package/templates/apps/api-kv/package.json +9 -8
- package/templates/apps/api-kv/queries/events.list.query.ts +19 -8
- package/templates/apps/api-moderation/mutations/comments.create.mutation.ts +11 -0
- package/templates/apps/api-moderation/mutations/posts.create.mutation.ts +13 -0
- package/templates/apps/api-moderation/package.json +9 -8
- package/templates/apps/api-observability/mutations/notes.create.mutation.ts +8 -0
- package/templates/apps/api-observability/package.json +9 -8
- package/templates/apps/api-observability/queries/notes.list.query.ts +13 -0
- package/templates/apps/api-ratelimit/mutations/notes.create.mutation.ts +14 -0
- package/templates/apps/api-ratelimit/package.json +9 -8
- package/templates/apps/api-rbac/package.json +9 -8
- package/templates/apps/api-rest/package.json +8 -7
- package/templates/apps/api-saas/mutations/projects.create.mutation.ts +13 -0
- package/templates/apps/api-saas/package.json +12 -11
- package/templates/apps/api-saas/queries/projects.list.query.ts +11 -0
- package/templates/apps/api-saas-starter/actions/me.action.ts +13 -0
- package/templates/apps/api-saas-starter/app.config.ts +19 -0
- package/templates/apps/api-saas-starter/authz.ts +75 -0
- package/templates/apps/api-saas-starter/mutations/invites.create.mutation.ts +10 -0
- package/templates/apps/api-saas-starter/mutations/projects.create.mutation.ts +9 -0
- package/templates/apps/api-saas-starter/package.json +15 -11
- package/templates/apps/api-saas-starter/queries/invites.list.query.ts +19 -8
- package/templates/apps/api-saas-starter/queries/projects.list.query.ts +18 -7
- package/templates/apps/api-saas-starter/tests/accessDecisions.test.ts +135 -0
- package/templates/apps/api-search/mutations/articles.create.mutation.ts +14 -0
- package/templates/apps/api-search/package.json +9 -8
- package/templates/apps/api-search/queries/articles.list.query.ts +21 -8
- package/templates/apps/api-status/README.md +10 -3
- package/templates/apps/api-status/app.config.ts +8 -3
- package/templates/apps/api-status/authz.ts +5 -3
- package/templates/apps/api-status/package.json +9 -8
- package/templates/apps/api-status/queries/components.list.query.ts +14 -6
- package/templates/apps/api-status/queries/incidents.live.query.ts +23 -10
- package/templates/apps/api-status/queries/updates.list.query.ts +16 -9
- package/templates/apps/api-status/tests/status.test.ts +9 -1
- package/templates/apps/api-versioning/actions/documents.asOf.action.ts +12 -0
- package/templates/apps/api-versioning/actions/documents.history.action.ts +13 -0
- package/templates/apps/api-versioning/mutations/documents.create.mutation.ts +9 -0
- package/templates/apps/api-versioning/mutations/documents.update.mutation.ts +12 -0
- package/templates/apps/api-versioning/package.json +9 -8
- package/templates/apps/api-webhooks/mutations/orders.fulfill.mutation.ts +16 -0
- package/templates/apps/api-webhooks/package.json +10 -9
- package/templates/apps/api-webhooks/queries/orders.list.query.ts +10 -0
- package/templates/apps/changelog/package.json +8 -6
- package/templates/apps/edge-functions/package.json +2 -2
- package/templates/apps/frontend-admin/package.json +10 -8
- package/templates/apps/frontend-admin/src/lib/admin.ts +20 -9
- package/templates/apps/frontend-admin/src/locales/de.ts +11 -1
- package/templates/apps/frontend-admin/src/locales/en.ts +13 -1
- package/templates/apps/frontend-admin/src/pages/admin/[entity]/page.tsx +65 -22
- package/templates/apps/frontend-admin/src/pages/admin/entity.test.tsx +130 -23
- package/templates/apps/frontend-admin/src/pages/admin/layout.tsx +3 -2
- package/templates/apps/frontend-admin/src/pages/admin/page.test.tsx +19 -2
- package/templates/apps/frontend-admin/src/pages/admin/page.tsx +9 -4
- package/templates/apps/frontend-app/app.config.ts +4 -3
- package/templates/apps/frontend-app/package.json +11 -8
- package/templates/apps/frontend-app/src/lib/api.ts +25 -0
- package/templates/apps/frontend-app/src/pages/page.test.tsx +130 -82
- package/templates/apps/frontend-app/src/pages/page.tsx +14 -18
- package/templates/apps/frontend-auth/package.json +10 -8
- package/templates/apps/frontend-blank/package.json +9 -7
- package/templates/apps/frontend-cms/package.json +11 -9
- package/templates/apps/frontend-collab/package.json +12 -9
- package/templates/apps/frontend-collab/src/pages/page.test.tsx +122 -78
- package/templates/apps/frontend-contact/package.json +9 -7
- package/templates/apps/frontend-dashboard/package.json +9 -7
- package/templates/apps/frontend-docs/package.json +9 -7
- package/templates/apps/frontend-i18n/package.json +8 -6
- package/templates/apps/frontend-landing/package.json +9 -7
- package/templates/apps/frontend-portal/package.json +10 -8
- package/templates/apps/frontend-saas/app.config.ts +10 -6
- package/templates/apps/frontend-saas/package.json +10 -8
- package/templates/apps/frontend-saas/src/lib/api.ts +27 -32
- package/templates/apps/frontend-saas/src/pages/dashboard/billing/page.tsx +7 -8
- package/templates/apps/frontend-saas/src/pages/dashboard/page.test.tsx +27 -3
- package/templates/apps/frontend-saas/src/pages/dashboard/page.tsx +4 -4
- package/templates/apps/frontend-saas/src/pages/dashboard/team/page.tsx +3 -4
- package/templates/apps/frontend-spa/package.json +9 -7
- package/templates/apps/frontend-ssr/package.json +9 -7
- package/templates/apps/frontend-ssr-api/package.json +10 -8
- package/templates/apps/frontend-static-blog/package.json +8 -6
- package/templates/apps/frontend-status/package.json +10 -8
- package/templates/apps/mobile-app/README.md +1 -0
- package/templates/apps/mobile-app/package.json +4 -2
- package/templates/apps/mobile-app/src/app/index.tsx +22 -12
- package/templates/apps/mobile-app/src/app/orders/[id].tsx +1 -1
- package/templates/apps/mobile-app/src/lib/api.ts +34 -0
- package/templates/apps/mobile-app/voltro.mobile.ts +4 -2
- package/templates/baselines/bare/.env.example +14 -0
- package/templates/baselines/bare/baseline.json +4 -4
- package/templates/baselines/compose/.env.example +14 -0
- package/templates/baselines/compose/README.md +1 -1
- package/templates/baselines/compose/baseline.json +5 -5
- package/templates/baselines/compose-mariadb/.env.example +14 -0
- package/templates/baselines/compose-mariadb/README.md +1 -1
- package/templates/baselines/compose-mariadb/baseline.json +5 -5
- package/templates/baselines/helm/.env.example +14 -0
- package/templates/baselines/helm/baseline.json +4 -4
- package/dist/apiBuild-C-x9YacA.js +0 -2
- package/dist/checkCommand-DRovTKza.js +0 -2
- package/dist/commands-CJfepbm4.js +0 -11541
- package/dist/dbCommand-b1gum4td.js +0 -2
- package/dist/dev-iiMtlkfs.js +0 -3
- package/dist/devActivity-BhIu6ncs.js +0 -159
- package/dist/frameworkTableAssembly-D-EebUQX.js +0 -2
- package/dist/inspect-mmBuRXmy.js +0 -2
- package/dist/manifestBuild-Dj8Jjoto.js +0 -2
- package/dist/seedRunner-Bqxgp7HZ.js +0 -230
- package/dist/serveCommand-DdaM4Hup.js +0 -1608
- package/dist/start-C0koT0UO.js +0 -1084
- /package/templates/apps/api-ai/actions/{summarize.action.server.tsx → summarize.action.server.ts} +0 -0
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
import { n as e, r as t, t as n } from "./codemodRunner-DRRqXR74.js";
|
|
2
|
+
import { basename as r, dirname as i, join as a, relative as o, resolve as s } from "node:path";
|
|
3
|
+
import { existsSync as c, readFileSync as l, readdirSync as u, statSync as d, writeFileSync as f } from "node:fs";
|
|
4
|
+
import { totalmem as p } from "node:os";
|
|
5
|
+
import { execFileSync as m, spawnSync as h } from "node:child_process";
|
|
6
|
+
//#region src/peerAlignment.ts
|
|
7
|
+
var g = (e) => {
|
|
8
|
+
let t = /^\s*(?:\^|~|>=|=|v)?\s*(\d+)\.(\d+)\.(\d+)/.exec(e);
|
|
9
|
+
if (t && !/\|\||\s<|\s-\s/.test(e)) return [
|
|
10
|
+
Number(t[1]),
|
|
11
|
+
Number(t[2]),
|
|
12
|
+
Number(t[3])
|
|
13
|
+
];
|
|
14
|
+
}, _ = (e, t) => e[0] === t[0] ? e[1] === t[1] ? e[2] < t[2] : e[1] < t[1] : e[0] < t[0], v = (e) => e.flatMap(({ name: e, peerDependencies: t }) => Object.entries(t ?? {}).filter(([e]) => !e.startsWith("@voltro/")).map(([t, n]) => ({
|
|
15
|
+
peer: t,
|
|
16
|
+
range: n,
|
|
17
|
+
requiredBy: e
|
|
18
|
+
}))), y = (e, t) => {
|
|
19
|
+
let n = /* @__PURE__ */ new Map();
|
|
20
|
+
for (let e of t) {
|
|
21
|
+
let t = n.get(e.peer);
|
|
22
|
+
t ? t.push(e) : n.set(e.peer, [e]);
|
|
23
|
+
}
|
|
24
|
+
let r = [], i = /* @__PURE__ */ new Map();
|
|
25
|
+
for (let [e, t] of n) {
|
|
26
|
+
let n = t.map((e) => ({
|
|
27
|
+
r: e,
|
|
28
|
+
floor: g(e.range)
|
|
29
|
+
})).filter((e) => e.floor !== void 0);
|
|
30
|
+
if (n.length !== 0) {
|
|
31
|
+
if (new Set(n.map((e) => e.r.range)).size > 1) {
|
|
32
|
+
r.push({
|
|
33
|
+
peer: e,
|
|
34
|
+
requirements: t
|
|
35
|
+
});
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
i.set(e, n[0].r);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
let a = [];
|
|
42
|
+
for (let { path: t, pkg: n } of e) for (let e of ["dependencies", "devDependencies"]) {
|
|
43
|
+
let r = n[e];
|
|
44
|
+
if (r) for (let [n, o] of i) {
|
|
45
|
+
let i = r[n];
|
|
46
|
+
if (i === void 0) continue;
|
|
47
|
+
let s = g(i), c = g(o.range);
|
|
48
|
+
!s || !c || _(s, c) && a.push({
|
|
49
|
+
path: t,
|
|
50
|
+
section: e,
|
|
51
|
+
peer: n,
|
|
52
|
+
from: i,
|
|
53
|
+
to: o.range
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
alignments: a,
|
|
59
|
+
conflicts: r
|
|
60
|
+
};
|
|
61
|
+
}, b = (e, t) => {
|
|
62
|
+
for (let n of t.alignments) {
|
|
63
|
+
let t = e.find((e) => e.path === n.path);
|
|
64
|
+
if (!t) continue;
|
|
65
|
+
let r = t.pkg[n.section];
|
|
66
|
+
r && n.peer in r && (r[n.peer] = n.to);
|
|
67
|
+
}
|
|
68
|
+
}, x = (e, t, n) => {
|
|
69
|
+
let r = /* @__PURE__ */ new Set(), i = [];
|
|
70
|
+
for (let a of e) {
|
|
71
|
+
if (t.has(a.peer) || r.has(a.peer)) continue;
|
|
72
|
+
let e = n(a.peer);
|
|
73
|
+
if (e === void 0) continue;
|
|
74
|
+
let o = g(a.range), s = g(e);
|
|
75
|
+
!o || !s || !_(s, o) || (r.add(a.peer), i.push({
|
|
76
|
+
peer: a.peer,
|
|
77
|
+
required: a.range,
|
|
78
|
+
installed: e,
|
|
79
|
+
requiredBy: a.requiredBy
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
return i;
|
|
83
|
+
}, S = /^(workspace:|catalog:|link:|file:|npm:|portal:)/, C = /* @__PURE__ */ new Set([
|
|
84
|
+
"pnpm",
|
|
85
|
+
"npm",
|
|
86
|
+
"yarn",
|
|
87
|
+
"bun"
|
|
88
|
+
]), w = [
|
|
89
|
+
["pnpm-lock.yaml", "pnpm"],
|
|
90
|
+
["yarn.lock", "yarn"],
|
|
91
|
+
["bun.lock", "bun"],
|
|
92
|
+
["bun.lockb", "bun"],
|
|
93
|
+
["package-lock.json", "npm"]
|
|
94
|
+
], T = (e) => {
|
|
95
|
+
let t = [], n = s(e);
|
|
96
|
+
for (; t.push(n), !c(a(n, ".git"));) {
|
|
97
|
+
let e = i(n);
|
|
98
|
+
if (e === n) break;
|
|
99
|
+
n = e;
|
|
100
|
+
}
|
|
101
|
+
return t;
|
|
102
|
+
}, E = (e) => {
|
|
103
|
+
for (let t of T(e)) {
|
|
104
|
+
let e = a(t, "package.json");
|
|
105
|
+
if (c(e)) try {
|
|
106
|
+
let t = JSON.parse(l(e, "utf8")).packageManager;
|
|
107
|
+
if (typeof t == "string") {
|
|
108
|
+
let e = t.split("@")[0]?.trim();
|
|
109
|
+
if (e && C.has(e)) return e;
|
|
110
|
+
}
|
|
111
|
+
} catch {}
|
|
112
|
+
for (let [e, n] of w) if (c(a(t, e))) return n;
|
|
113
|
+
}
|
|
114
|
+
return "npm";
|
|
115
|
+
}, D = 4, O = (e) => {
|
|
116
|
+
for (let t of T(e)) {
|
|
117
|
+
if (c(a(t, "pnpm-workspace.yaml")) || c(a(t, "pnpm-workspace.yml"))) return t;
|
|
118
|
+
let e = a(t, "package.json");
|
|
119
|
+
if (c(e)) try {
|
|
120
|
+
let n = JSON.parse(l(e, "utf8")).workspaces;
|
|
121
|
+
if (Array.isArray(n) ? n.length > 0 : typeof n == "object" && n) return t;
|
|
122
|
+
} catch {}
|
|
123
|
+
}
|
|
124
|
+
}, k = (e) => {
|
|
125
|
+
let n = [], r = (e, i) => {
|
|
126
|
+
let o = a(e, "package.json");
|
|
127
|
+
if (c(o) && n.push(o), i >= D) return;
|
|
128
|
+
let s;
|
|
129
|
+
try {
|
|
130
|
+
s = u(e);
|
|
131
|
+
} catch {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
for (let n of s) {
|
|
135
|
+
if (n.startsWith(".") || t.has(n)) continue;
|
|
136
|
+
let o = a(e, n);
|
|
137
|
+
try {
|
|
138
|
+
if (!d(o).isDirectory()) continue;
|
|
139
|
+
} catch {
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
r(o, i + 1);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
return r(s(e), 0), n;
|
|
146
|
+
}, A = (e) => {
|
|
147
|
+
try {
|
|
148
|
+
return m("git", ["status", "--porcelain"], {
|
|
149
|
+
cwd: e,
|
|
150
|
+
encoding: "utf8"
|
|
151
|
+
}).trim() === "";
|
|
152
|
+
} catch {
|
|
153
|
+
return !1;
|
|
154
|
+
}
|
|
155
|
+
}, j = /^\d+\.\d+\.\d+/, M = (e, t) => {
|
|
156
|
+
try {
|
|
157
|
+
let n = m(e, [...t], {
|
|
158
|
+
encoding: "utf8",
|
|
159
|
+
stdio: [
|
|
160
|
+
"ignore",
|
|
161
|
+
"pipe",
|
|
162
|
+
"ignore"
|
|
163
|
+
]
|
|
164
|
+
}).trim();
|
|
165
|
+
if (!n) return;
|
|
166
|
+
if (n.startsWith("{")) {
|
|
167
|
+
let e = JSON.parse(n).version;
|
|
168
|
+
return typeof e == "string" && j.test(e) ? e : void 0;
|
|
169
|
+
}
|
|
170
|
+
let r = n.split("\n").map((e) => e.trim()).filter(Boolean).pop();
|
|
171
|
+
return r && j.test(r) ? r : void 0;
|
|
172
|
+
} catch {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
}, N = () => {
|
|
176
|
+
try {
|
|
177
|
+
let e = m("yarn", ["--version"], {
|
|
178
|
+
encoding: "utf8",
|
|
179
|
+
stdio: [
|
|
180
|
+
"ignore",
|
|
181
|
+
"pipe",
|
|
182
|
+
"ignore"
|
|
183
|
+
]
|
|
184
|
+
}).trim();
|
|
185
|
+
return Number.parseInt(e.split(".")[0] ?? "", 10) || 1;
|
|
186
|
+
} catch {
|
|
187
|
+
return 1;
|
|
188
|
+
}
|
|
189
|
+
}, P = (e, t, n) => [...t === "pnpm" ? [["pnpm", [
|
|
190
|
+
"view",
|
|
191
|
+
e,
|
|
192
|
+
"version"
|
|
193
|
+
]]] : t === "yarn" ? n >= 2 ? [["yarn", [
|
|
194
|
+
"npm",
|
|
195
|
+
"info",
|
|
196
|
+
e,
|
|
197
|
+
"--fields",
|
|
198
|
+
"version",
|
|
199
|
+
"--json"
|
|
200
|
+
]]] : [["yarn", [
|
|
201
|
+
"info",
|
|
202
|
+
e,
|
|
203
|
+
"version",
|
|
204
|
+
"--silent"
|
|
205
|
+
]]] : t === "bun" ? [["bun", [
|
|
206
|
+
"pm",
|
|
207
|
+
"view",
|
|
208
|
+
e,
|
|
209
|
+
"version"
|
|
210
|
+
]]] : [], ["npm", [
|
|
211
|
+
"view",
|
|
212
|
+
e,
|
|
213
|
+
"version"
|
|
214
|
+
]]], F = (e, t, n) => {
|
|
215
|
+
let r = `${e}@${t}`;
|
|
216
|
+
return [...n === "pnpm" ? [["pnpm", [
|
|
217
|
+
"view",
|
|
218
|
+
r,
|
|
219
|
+
"voltro",
|
|
220
|
+
"--json"
|
|
221
|
+
]]] : [], ["npm", [
|
|
222
|
+
"view",
|
|
223
|
+
r,
|
|
224
|
+
"voltro",
|
|
225
|
+
"--json"
|
|
226
|
+
]]];
|
|
227
|
+
}, I = (e) => {
|
|
228
|
+
try {
|
|
229
|
+
let t = JSON.parse(e)?.codemods;
|
|
230
|
+
if (!Array.isArray(t)) return;
|
|
231
|
+
let n = [];
|
|
232
|
+
for (let e of t) {
|
|
233
|
+
let t = e;
|
|
234
|
+
if (typeof t.version != "string" || typeof t.id != "string") return;
|
|
235
|
+
n.push({
|
|
236
|
+
version: t.version,
|
|
237
|
+
id: t.id,
|
|
238
|
+
title: typeof t.title == "string" ? t.title : t.id,
|
|
239
|
+
kind: t.kind === "transform" ? "transform" : "manual"
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
return n;
|
|
243
|
+
} catch {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
}, L = (e, t = "npm", n = "@voltro/cli") => {
|
|
247
|
+
for (let [r, i] of F(n, e, t)) try {
|
|
248
|
+
let e = I(m(r, i, {
|
|
249
|
+
encoding: "utf8",
|
|
250
|
+
stdio: [
|
|
251
|
+
"ignore",
|
|
252
|
+
"pipe",
|
|
253
|
+
"ignore"
|
|
254
|
+
],
|
|
255
|
+
timeout: 2e4
|
|
256
|
+
}));
|
|
257
|
+
if (e !== void 0) return e;
|
|
258
|
+
} catch {}
|
|
259
|
+
}, R = (e, t, r) => e.filter((e) => n(t, e.version) < 0 && n(e.version, r) <= 0), z = (e, t = "npm") => {
|
|
260
|
+
for (let [n, r] of P(e, t, t === "yarn" ? N() : 1)) {
|
|
261
|
+
let e = M(n, r);
|
|
262
|
+
if (e) return e;
|
|
263
|
+
}
|
|
264
|
+
}, B = (e) => JSON.parse(l(e, "utf8")), V = [
|
|
265
|
+
"app.config.ts",
|
|
266
|
+
"app.config.tsx",
|
|
267
|
+
"app.config.js"
|
|
268
|
+
], H = (e) => {
|
|
269
|
+
let t = s(e);
|
|
270
|
+
for (;;) {
|
|
271
|
+
let e = i(t);
|
|
272
|
+
if (e === t) return;
|
|
273
|
+
t = e;
|
|
274
|
+
let n = a(t, "package.json");
|
|
275
|
+
if (c(n)) try {
|
|
276
|
+
if (W(B(n)).length > 0) return t;
|
|
277
|
+
} catch {}
|
|
278
|
+
}
|
|
279
|
+
}, U = (e) => {
|
|
280
|
+
let t = a(e, "node_modules", "@voltro", "cli", "package.json");
|
|
281
|
+
if (!c(t)) return;
|
|
282
|
+
let n = B(t).version;
|
|
283
|
+
return typeof n == "string" ? n : void 0;
|
|
284
|
+
}, W = (e) => {
|
|
285
|
+
let t = [];
|
|
286
|
+
for (let n of ["dependencies", "devDependencies"]) {
|
|
287
|
+
let r = e[n];
|
|
288
|
+
if (r) for (let [e, i] of Object.entries(r)) e.startsWith("@voltro/") && t.push({
|
|
289
|
+
section: n,
|
|
290
|
+
name: e,
|
|
291
|
+
spec: i
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
return t;
|
|
295
|
+
}, G = (e, t, n, i) => {
|
|
296
|
+
let s = a(e, "node_modules", "@voltro");
|
|
297
|
+
if (!c(s)) return 0;
|
|
298
|
+
let l = [];
|
|
299
|
+
for (let e of u(s)) {
|
|
300
|
+
let t = a(s, e, "package.json");
|
|
301
|
+
if (c(t)) try {
|
|
302
|
+
let n = B(t);
|
|
303
|
+
l.push({
|
|
304
|
+
name: n.name ?? `@voltro/${e}`,
|
|
305
|
+
peerDependencies: n.peerDependencies
|
|
306
|
+
});
|
|
307
|
+
} catch {}
|
|
308
|
+
}
|
|
309
|
+
let d = v(l), p = y(t, d), m = /* @__PURE__ */ new Set();
|
|
310
|
+
for (let { pkg: e } of t) for (let t of ["dependencies", "devDependencies"]) for (let n of Object.keys(e[t] ?? {})) m.add(n);
|
|
311
|
+
let h = x(d, m, (t) => {
|
|
312
|
+
let n = a(e, "node_modules", ...t.split("/"), "package.json");
|
|
313
|
+
if (c(n)) try {
|
|
314
|
+
return B(n).version;
|
|
315
|
+
} catch {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
if (h.length > 0) {
|
|
320
|
+
console.warn("\nvoltro update: these peer dependencies are UNSATISFIED and nothing here declares them:");
|
|
321
|
+
for (let e of h) console.warn(` ${e.peer} installed ${e.installed}, ${e.requiredBy} requires ${e.required}`);
|
|
322
|
+
console.warn(" They resolve transitively, so the install succeeds and the app boots on a graph"), console.warn(" the framework was not tested against. Effect types are NOMINAL — two copies"), console.warn(" produce red `tsc` on rpcGroup.generated.ts while the server runs green."), console.warn(" Fix: declare them where the @voltro/* packages are used, at the version above.");
|
|
323
|
+
}
|
|
324
|
+
for (let e of p.conflicts) {
|
|
325
|
+
console.warn(`\nvoltro update: framework packages disagree about \`${e.peer}\`:`);
|
|
326
|
+
for (let t of e.requirements) console.warn(` ${t.requiredBy} wants ${t.range}`);
|
|
327
|
+
console.warn(" Left as declared — resolving this would be a guess about which is right.");
|
|
328
|
+
}
|
|
329
|
+
if (p.alignments.length === 0) return 0;
|
|
330
|
+
console.log("\nAligning peer dependencies the framework requires:");
|
|
331
|
+
for (let t of p.alignments) console.log(` ${t.peer} ${t.from} → ${t.to} (${o(e, t.path) || r(t.path)})`);
|
|
332
|
+
b(t, p);
|
|
333
|
+
let g = new Set(p.alignments.map((e) => e.path));
|
|
334
|
+
for (let e of t) g.has(e.path) && f(e.path, JSON.stringify(e.pkg, null, 2) + "\n");
|
|
335
|
+
console.log(`\nRe-installing with ${n} so the aligned ranges resolve…`);
|
|
336
|
+
let _ = i(n, e);
|
|
337
|
+
return _ !== 0 && (console.error(`\nvoltro update: ${n} install failed after aligning peer dependencies.`), console.error(" The package.json changes above ARE written; re-run the install yourself.")), _;
|
|
338
|
+
}, K = (e, t, n) => W(e).map(({ name: e, spec: r }) => S.test(r) ? {
|
|
339
|
+
name: e,
|
|
340
|
+
from: r,
|
|
341
|
+
to: r,
|
|
342
|
+
skipped: "non-registry spec"
|
|
343
|
+
} : {
|
|
344
|
+
name: e,
|
|
345
|
+
from: r,
|
|
346
|
+
to: `${n ? "" : /^[\^~]/.exec(r)?.[0] ?? ""}${t}`
|
|
347
|
+
}), ee = (e, t) => {
|
|
348
|
+
for (let n of t) if (!n.skipped) for (let t of ["dependencies", "devDependencies"]) {
|
|
349
|
+
let r = e[t];
|
|
350
|
+
r && n.name in r && (r[n.name] = n.to);
|
|
351
|
+
}
|
|
352
|
+
}, q = (e, t, n) => e.map(({ path: e, pkg: r }) => ({
|
|
353
|
+
path: e,
|
|
354
|
+
entries: K(r, t, n)
|
|
355
|
+
})).filter((e) => e.entries.length > 0), J = (e, t) => {
|
|
356
|
+
let n = new Map(e.map((e) => [e.path, e])), r = [];
|
|
357
|
+
for (let e of t) {
|
|
358
|
+
let t = n.get(e.path);
|
|
359
|
+
t && (ee(t.pkg, e.entries), r.push(t));
|
|
360
|
+
}
|
|
361
|
+
return r;
|
|
362
|
+
}, te = /* @__PURE__ */ new Set([
|
|
363
|
+
"--to",
|
|
364
|
+
"--from",
|
|
365
|
+
"--root",
|
|
366
|
+
"--only"
|
|
367
|
+
]), ne = /* @__PURE__ */ new Set([
|
|
368
|
+
"--dry-run",
|
|
369
|
+
"--force",
|
|
370
|
+
"--exact",
|
|
371
|
+
"--codemods-only",
|
|
372
|
+
"--run-codemods",
|
|
373
|
+
"--no-install",
|
|
374
|
+
"--help",
|
|
375
|
+
"-h"
|
|
376
|
+
]), re = (e) => {
|
|
377
|
+
let t, n, r = process.cwd(), i = [], a = [], o = [], c = (e) => {
|
|
378
|
+
for (let t of e.split(",")) t.length > 0 && a.push(t);
|
|
379
|
+
};
|
|
380
|
+
for (let a = 0; a < e.length; a++) {
|
|
381
|
+
let l = e[a];
|
|
382
|
+
if (l === void 0) continue;
|
|
383
|
+
let u = l.indexOf("="), d = u > 0 ? l.slice(0, u) : l, f = u > 0 ? l.slice(u + 1) : void 0;
|
|
384
|
+
if (te.has(d)) {
|
|
385
|
+
let i = f ?? e[++a] ?? "";
|
|
386
|
+
d === "--to" ? t = i : d === "--from" ? n = i : d === "--root" ? r = s(i === "" ? "." : i) : c(i);
|
|
387
|
+
continue;
|
|
388
|
+
}
|
|
389
|
+
if (d.startsWith("-")) {
|
|
390
|
+
ne.has(d) || o.push(d);
|
|
391
|
+
continue;
|
|
392
|
+
}
|
|
393
|
+
i.push(l);
|
|
394
|
+
}
|
|
395
|
+
return i[0] && (r = s(process.cwd(), i[0])), {
|
|
396
|
+
root: r,
|
|
397
|
+
dryRun: e.includes("--dry-run"),
|
|
398
|
+
force: e.includes("--force"),
|
|
399
|
+
exact: e.includes("--exact"),
|
|
400
|
+
codemodsOnly: e.includes("--codemods-only") || e.includes("--run-codemods"),
|
|
401
|
+
noInstall: e.includes("--no-install"),
|
|
402
|
+
only: a,
|
|
403
|
+
unknownFlags: o,
|
|
404
|
+
...t === void 0 ? {} : { to: t },
|
|
405
|
+
...n === void 0 ? {} : { from: n }
|
|
406
|
+
};
|
|
407
|
+
}, Y = "voltro update [app] [flags]\n\nUpgrade an app to a newer framework release: bump every @voltro/* dependency,\ninstall, and run the codemods shipped with the target version.\n\nIn a workspace (pnpm-workspace.yaml, or a package.json \"workspaces\" field),\nEVERY member package.json that declares @voltro/* is bumped in lockstep and the\ninstall runs once at the workspace root — so api / web / shared packages never\nend up on different framework versions.\n\nFlags:\n --to <version> Target version (default: the latest published version).\n --from <version> Source version — overrides the detected installed version.\n Use it after a hand-edited bump so the codemods for the\n delta you actually crossed still run.\n --root <dir> App directory to update (default: the current directory).\n A positional [app] does the same.\n --dry-run Print the plan — every package.json that would be bumped,\n plus the codemods the target version puts IN RANGE — and\n write nothing. Installs nothing. Allowed on a dirty tree,\n which is the point: it is how you decide whether to stash.\n --force Proceed on a dirty working tree, and re-run even when the\n installed version already equals the target.\n --exact Pin exact versions (drop the ^ / ~ range prefix).\n --no-install Write the version bump, then stop — do not run the package\n manager. For a containerised / offline install: run your own\n install, then: voltro update --codemods-only --from <old>\n\n --only <id> Run only the named codemod(s) — repeatable, or comma-\n separated. Ids are what --dry-run prints. Combine with\n --codemods-only to take the load-bearing half first.\n\n --codemods-only Run ONLY the codemods for [from, to] against the installed\n tree — no version bump, no install. The recovery path after\n a manual bump, or after a failed install. Alias:\n --run-codemods.\n\nMemory: the codemod pass parses source, so it wants heap in proportion to the\nfiles it touches. It sizes the child's --max-old-space-size from THIS machine —\nnode's own default caps near 4 GB however much RAM is installed — so you should\nnot need to set anything. If it still runs out it says so and names the knob;\nNODE_OPTIONS=--max-old-space-size=<MB> overrides, and --only / --root narrow the\npass instead of enlarging it.\n -h, --help Print this help.\n\nExamples:\n voltro update\n voltro update --to 0.6.0 --dry-run\n voltro update --codemods-only --from 0.5.0 --to 0.6.0\n\nAfter updating: run `voltro db apply` (NOT db migrate) to reconcile changed\nframework tables, then your typecheck.", ie = (e) => e.includes("--help") || e.includes("-h"), ae = async (e, t = {}) => {
|
|
408
|
+
let n = t.latestVersion ?? z, i = t.isGitClean ?? A, s = t.install ?? ((e, t) => h(e, ["install"], {
|
|
409
|
+
cwd: t,
|
|
410
|
+
stdio: "inherit"
|
|
411
|
+
}).status ?? 1);
|
|
412
|
+
if (ie(e)) return console.log(Y), 0;
|
|
413
|
+
let l = re(e);
|
|
414
|
+
if (l.unknownFlags.length > 0) return console.error(`voltro update: unknown flag ${l.unknownFlags.join(", ")}`), console.error(" Run `voltro update --help` for the flags this command accepts."), 1;
|
|
415
|
+
let u = a(l.root, "package.json");
|
|
416
|
+
if (!c(u)) {
|
|
417
|
+
let e = V.find((e) => c(a(l.root, e))), t = e === void 0 ? void 0 : H(l.root);
|
|
418
|
+
return e !== void 0 && t !== void 0 ? (console.error(`voltro update: ${e} is here, but this directory has no package.json.`), console.error(" That is a supported layout — one root manifest, apps carrying only their"), console.error(" app.config.ts. The bump belongs to the manifest that declares @voltro/*, and"), console.error(" the codemods run across every app beneath it:"), console.error(` voltro update --root ${t}`), 1) : (console.error(`voltro update: no package.json at ${l.root}`), 1);
|
|
419
|
+
}
|
|
420
|
+
let d = B(u), p = W(d);
|
|
421
|
+
if (p.length === 0) {
|
|
422
|
+
let e = V.find((e) => c(a(l.root, e)));
|
|
423
|
+
if (e !== void 0) {
|
|
424
|
+
let t = H(l.root);
|
|
425
|
+
return console.error(`voltro update: ${e} is here, but ${r(u)} declares no @voltro/* dependency.`), console.error(" This IS a Voltro app — its dependencies are just declared further up, which"), console.error(" is a supported layout (one root manifest, apps carrying only app.config.ts)."), console.error(" Nothing can be bumped HERE: a bump rewrites dependency ranges, and this file"), console.error(" has none."), t === void 0 ? (console.error(" No ancestor package.json declares @voltro/* either. Add the dependencies to"), console.error(" the manifest that owns this workspace, then run update from there.")) : (console.error(" Run it where they are declared — that manifest covers every app beneath it:"), console.error(` voltro update --root ${t}`)), 1;
|
|
426
|
+
}
|
|
427
|
+
return console.error("voltro update: no @voltro/* dependencies here — not a Voltro app."), 1;
|
|
428
|
+
}
|
|
429
|
+
if (!l.dryRun && !l.force && !i(l.root)) if (l.codemodsOnly) console.warn("voltro update: working tree is not clean — the codemod diff will be mixed in"), console.warn(" with your existing changes. Review with `git diff` before committing; the"), console.warn(" codemods rewrite source and nothing here separates their edits from yours."), console.warn(" (Use --dry-run first, or --only <id> to take one codemod at a time.)");
|
|
430
|
+
else return console.error("voltro update: working tree is not clean. Commit/stash first so you can review the"), console.error(" codemod diff — or re-run with --force (not recommended) or --dry-run (preview only)."), console.error(" Only running the codemods? `--codemods-only` proceeds on a dirty tree with a warning —"), console.error(" it rewrites source without bumping or installing."), 1;
|
|
431
|
+
let m = O(l.root), g = m ?? l.root, _ = () => U(l.root) ?? (m ? U(m) : void 0), v = l.from ?? _() ?? /^\d+\.\d+\.\d+$/.exec(p.find((e) => e.name === "@voltro/cli")?.spec.replace(/^[\^~]/, "") ?? "")?.[0];
|
|
432
|
+
if (!v) return console.error("voltro update: could not determine the source framework version."), console.error(" Run your package manager install first, or pass --from <version>."), 1;
|
|
433
|
+
let y = E(l.root), b = l.to ?? (l.codemodsOnly ? _() : void 0) ?? n("@voltro/cli", y);
|
|
434
|
+
if (!b) return console.error(`voltro update: could not resolve the latest @voltro/cli version via ${y}.`), console.error(" Pin an explicit target with --to <version>."), 1;
|
|
435
|
+
if (l.codemodsOnly) return v === b ? (console.log(`voltro update: --codemods-only with from === to (${b}) — no delta, nothing to apply.`), console.log(" Pass --from <earlier-version> to re-run the codemods you skipped."), 0) : (console.log(`voltro update: re-applying codemods ${v} → ${b} (no version bump)…`), $([
|
|
436
|
+
"--root",
|
|
437
|
+
l.root,
|
|
438
|
+
"--from",
|
|
439
|
+
v,
|
|
440
|
+
"--to",
|
|
441
|
+
b,
|
|
442
|
+
...l.dryRun ? ["--dry-run"] : [],
|
|
443
|
+
...l.only.length > 0 ? ["--only", l.only.join(",")] : []
|
|
444
|
+
]));
|
|
445
|
+
if (v === b && !l.force) return console.log(`voltro update: already on ${b} — nothing to do.`), console.log(" (Bumped @voltro/* by hand? Re-run the skipped codemods with"), console.log(" `voltro update --codemods-only --from <earlier-version>`.)"), 0;
|
|
446
|
+
let x = [u, ...m ? k(m) : []], S = [], C = /* @__PURE__ */ new Set();
|
|
447
|
+
for (let e of x) if (!C.has(e)) {
|
|
448
|
+
if (C.add(e), e === u) {
|
|
449
|
+
S.push({
|
|
450
|
+
path: e,
|
|
451
|
+
pkg: d
|
|
452
|
+
});
|
|
453
|
+
continue;
|
|
454
|
+
}
|
|
455
|
+
try {
|
|
456
|
+
S.push({
|
|
457
|
+
path: e,
|
|
458
|
+
pkg: B(e)
|
|
459
|
+
});
|
|
460
|
+
} catch {}
|
|
461
|
+
}
|
|
462
|
+
let w = q(S, b, l.exact);
|
|
463
|
+
console.log(`voltro update: ${v} → ${b}`);
|
|
464
|
+
let T = w.length > 1;
|
|
465
|
+
m && console.log(` workspace: ${m} (${w.length} package.json with @voltro/* deps)`);
|
|
466
|
+
for (let e of w) {
|
|
467
|
+
let t = T ? " " : " ";
|
|
468
|
+
T && console.log(` ${o(g, e.path) || e.path}`);
|
|
469
|
+
for (let n of e.entries.filter((e) => !e.skipped)) console.log(`${t}${n.name}: ${n.from} → ${n.to}`);
|
|
470
|
+
for (let n of e.entries.filter((e) => e.skipped)) console.log(`${t}${n.name}: kept (${n.skipped})`);
|
|
471
|
+
}
|
|
472
|
+
console.log(` package manager: ${y}`), console.log(` install runs in: ${g}`);
|
|
473
|
+
let D = L(b, y);
|
|
474
|
+
if (D === void 0) console.log(` codemods: applied from ${b} after install`), console.log(` (could not preview — ${b} publishes no codemod manifest, or the registry`), console.log(" could not be reached. This is NOT the same as \"no codemods\".)");
|
|
475
|
+
else {
|
|
476
|
+
let e = R(D, v, b);
|
|
477
|
+
if (e.length === 0) console.log(` codemods: none in range for ${v} → ${b}`);
|
|
478
|
+
else {
|
|
479
|
+
console.log(` codemods: ${e.length} in range for ${v} → ${b}`);
|
|
480
|
+
for (let t of e) console.log(` ${t.kind === "transform" ? "✎" : "☰"} ${t.id} — ${t.title}`);
|
|
481
|
+
console.log(" ✎ rewrites source · ☰ prints written steps"), console.log(" In RANGE, not necessarily applicable: each one still tests your source"), console.log(" before doing anything. This is the upper bound on what a run can touch.");
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
if (l.dryRun) return console.log("\n(dry-run — nothing written, nothing installed.)"), 0;
|
|
485
|
+
for (let e of J(S, w)) f(e.path, JSON.stringify(e.pkg, null, 2) + "\n");
|
|
486
|
+
if (l.noInstall) return console.log(`\nvoltro update: bumped ${w.length} package.json to ${b}. Install NOT run (--no-install).`), console.log(" The tree is half-upgraded until you finish both steps:"), console.log(" 1. install however this project installs (container, CI image, offline mirror)"), console.log(` 2. voltro update --codemods-only --from ${v} --to ${b}`), console.log(" Step 2 is not optional: the codemods for this jump ship INSIDE the target"), console.log(" version, so nothing could have run them before the install put them on disk."), 0;
|
|
487
|
+
console.log(`\nInstalling with ${y} in ${g}…`);
|
|
488
|
+
let j = s(y, g);
|
|
489
|
+
if (j !== 0) return console.error(`\nvoltro update: ${y} install failed in ${g}.`), console.error(` • package.json was bumped to ${b} (${w.length} file${w.length === 1 ? "" : "s"}).`), console.error(" • CODEMODS WERE NOT APPLIED — they ship inside the target version, which the"), console.error(" failed install did not put on disk, so there was nothing to run."), console.error(" Fix the install, re-run it, then apply the codemods you are missing:"), console.error(` voltro update --codemods-only --from ${v} --to ${b}`), console.error(" If this project's install CANNOT run on this host — a containerised install"), console.error(" with its own store, an offline mirror — use `--no-install` next time: it writes"), console.error(" the bump, says so, and leaves the install to you."), j;
|
|
490
|
+
let M = G(g, S, y, s);
|
|
491
|
+
if (M !== 0) return M;
|
|
492
|
+
let N = [l.root, g].map((e) => a(e, "node_modules", ".bin", "voltro")).find((e) => c(e));
|
|
493
|
+
if (N) {
|
|
494
|
+
console.log("\nApplying codemods…");
|
|
495
|
+
let e = h(N, [
|
|
496
|
+
"_apply-codemods",
|
|
497
|
+
"--root",
|
|
498
|
+
l.root,
|
|
499
|
+
"--from",
|
|
500
|
+
v,
|
|
501
|
+
"--to",
|
|
502
|
+
b,
|
|
503
|
+
...l.only.length > 0 ? ["--only", l.only.join(",")] : []
|
|
504
|
+
], {
|
|
505
|
+
cwd: l.root,
|
|
506
|
+
stdio: "inherit",
|
|
507
|
+
env: Z(process.env)
|
|
508
|
+
});
|
|
509
|
+
if (e.status !== 0) {
|
|
510
|
+
let t = X(e.status, e.signal);
|
|
511
|
+
return t !== void 0 && console.error(`\n${t}`), e.status ?? 1;
|
|
512
|
+
}
|
|
513
|
+
} else console.log("\nApplying codemods (in-process — installed bin not found)…"), await $([
|
|
514
|
+
"--root",
|
|
515
|
+
l.root,
|
|
516
|
+
"--from",
|
|
517
|
+
v,
|
|
518
|
+
"--to",
|
|
519
|
+
b,
|
|
520
|
+
...l.only.length > 0 ? ["--only", l.only.join(",")] : []
|
|
521
|
+
]);
|
|
522
|
+
return console.log("\n✓ update complete. Next:"), console.log(" • voltro db apply # reconcile any changed framework tables (NOT db migrate)"), console.log(" • <your typecheck> # verify the codemods + your code compile against the new API"), 0;
|
|
523
|
+
}, X = (e, t) => {
|
|
524
|
+
if (t === "SIGABRT" || e === 134) return "The codemod pass ran out of memory (V8 aborts rather than failing cleanly, which is why\nnothing above names a limit).\n\n • It already sizes its heap from this machine — raise it explicitly with\n NODE_OPTIONS=--max-old-space-size=<MB> voltro update\n • Or narrow the pass: voltro update --only <codemod-id>, or --root <subdir>\n to run one workspace at a time.";
|
|
525
|
+
if (t !== null) return `The codemod pass was killed by ${t} — it did not fail, something stopped it.\nOn a container, this is usually the memory cgroup; give it more, or narrow the pass
|
|
526
|
+
with \`--only\` / \`--root\`.`;
|
|
527
|
+
}, Z = (e, t = p()) => {
|
|
528
|
+
if (e.NODE_OPTIONS?.includes("--max-old-space-size")) return e;
|
|
529
|
+
let n = Math.floor(t / 1024 / 1024 * .75);
|
|
530
|
+
if (!Number.isFinite(n) || n < 4096) return e;
|
|
531
|
+
let r = e.NODE_OPTIONS;
|
|
532
|
+
return {
|
|
533
|
+
...e,
|
|
534
|
+
NODE_OPTIONS: `${r ? `${r} ` : ""}--max-old-space-size=${n}`
|
|
535
|
+
};
|
|
536
|
+
}, Q = (e, t) => {
|
|
537
|
+
let n = [];
|
|
538
|
+
for (let r = 0; r < e.length; r++) {
|
|
539
|
+
let i = e[r];
|
|
540
|
+
if (i !== void 0) {
|
|
541
|
+
if (i === t) {
|
|
542
|
+
n.push(e[++r] ?? "");
|
|
543
|
+
continue;
|
|
544
|
+
}
|
|
545
|
+
i.startsWith(`${t}=`) && n.push(i.slice(t.length + 1));
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
return n;
|
|
549
|
+
}, oe = (e) => {
|
|
550
|
+
let t = (t) => Q(e, t)[0];
|
|
551
|
+
return {
|
|
552
|
+
root: s(t("--root") ?? process.cwd()),
|
|
553
|
+
from: t("--from") ?? "0.0.0",
|
|
554
|
+
to: t("--to") ?? "0.0.0",
|
|
555
|
+
dryRun: e.includes("--dry-run"),
|
|
556
|
+
only: Q(e, "--only").flatMap((e) => e.split(",")).filter((e) => e.length > 0)
|
|
557
|
+
};
|
|
558
|
+
}, $ = async (t) => {
|
|
559
|
+
let n = oe(t), r = await e({
|
|
560
|
+
root: n.root,
|
|
561
|
+
from: n.from,
|
|
562
|
+
to: n.to,
|
|
563
|
+
dryRun: n.dryRun,
|
|
564
|
+
only: n.only,
|
|
565
|
+
log: (e) => console.log(` ${e}`)
|
|
566
|
+
});
|
|
567
|
+
if (r.applied.length === 0 && r.manual.length === 0) return console.log("codemods: nothing to apply for this jump."), 0;
|
|
568
|
+
let i = n.dryRun ? "·" : "✓";
|
|
569
|
+
for (let e of r.applied) {
|
|
570
|
+
let t = [];
|
|
571
|
+
e.renamedFiles.length > 0 && t.push(`${e.renamedFiles.length} renamed`), e.changedFiles.length > 0 && t.push(`${e.changedFiles.length} edited`);
|
|
572
|
+
let r = t.length > 0 ? ` (${t.join(", ")})` : " (nothing to do)";
|
|
573
|
+
console.log(`${i} ${e.id} — ${e.title}${r}${n.dryRun ? " [would apply]" : ""}`);
|
|
574
|
+
}
|
|
575
|
+
if (r.manual.length > 0) {
|
|
576
|
+
console.log("\nManual steps required (could not be automated):");
|
|
577
|
+
for (let e of r.manual) {
|
|
578
|
+
console.log(`\n▸ ${e.id} — ${e.title}`);
|
|
579
|
+
for (let t of e.note.split("\n")) console.log(` ${t}`);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
return n.dryRun && console.log("\n(dry-run — no files written)"), 0;
|
|
583
|
+
};
|
|
584
|
+
//#endregion
|
|
585
|
+
export { X as a, O as c, q as d, $ as f, k as g, Z as h, R as i, F as l, P as m, H as n, E as o, ae as p, J as r, L as s, Y as t, K as u };
|