@geekmidas/cli 10.0.0-alpha.9 → 10.0.0-alpha.90
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 +315 -414
- package/bin/adjacent-tsconfig.mjs +46 -8
- package/bin/gkm.mjs +11 -3
- package/bin/owning-tsconfig-jsx-register.mjs +18 -0
- package/bin/owning-tsconfig-jsx.mjs +108 -0
- package/dist/EndpointGenerator-CVc6Oi1Y.mjs +1021 -0
- package/dist/EndpointGenerator-CVc6Oi1Y.mjs.map +1 -0
- package/dist/EndpointGenerator-CwLjBCFE.cjs +1080 -0
- package/dist/EndpointGenerator-CwLjBCFE.cjs.map +1 -0
- package/dist/GoDaddyProvider-DSStJVAv.mjs +387 -0
- package/dist/GoDaddyProvider-DSStJVAv.mjs.map +1 -0
- package/dist/GoDaddyProvider-DqZ1qD_F.cjs +387 -0
- package/dist/GoDaddyProvider-DqZ1qD_F.cjs.map +1 -0
- package/dist/{HostingerProvider-Cft7lEYr.mjs → HostingerProvider-BI6J7oJr.mjs} +22 -23
- package/dist/HostingerProvider-BI6J7oJr.mjs.map +1 -0
- package/dist/{HostingerProvider-h3EbEp-Z.cjs → HostingerProvider-CyTpG_jy.cjs} +22 -23
- package/dist/HostingerProvider-CyTpG_jy.cjs.map +1 -0
- package/dist/LegacyStateStore-DXmNA7hy.cjs +89 -0
- package/dist/LegacyStateStore-DXmNA7hy.cjs.map +1 -0
- package/dist/LegacyStateStore-ZkdmiUFZ.mjs +89 -0
- package/dist/LegacyStateStore-ZkdmiUFZ.mjs.map +1 -0
- package/dist/LocalStateStore-BBeTlRTH.cjs +178 -0
- package/dist/LocalStateStore-BBeTlRTH.cjs.map +1 -0
- package/dist/LocalStateStore-CU-O0SBp.mjs +167 -0
- package/dist/LocalStateStore-CU-O0SBp.mjs.map +1 -0
- package/dist/OpenApiTsGenerator-B--HV-sW.cjs +541 -0
- package/dist/OpenApiTsGenerator-B--HV-sW.cjs.map +1 -0
- package/dist/OpenApiTsGenerator-CkvsPdgg.mjs +536 -0
- package/dist/OpenApiTsGenerator-CkvsPdgg.mjs.map +1 -0
- package/dist/{Route53Provider-di2fMM5N.cjs → Route53Provider-Bllus2NR.cjs} +21 -22
- package/dist/Route53Provider-Bllus2NR.cjs.map +1 -0
- package/dist/{Route53Provider-RdpUDJQk.mjs → Route53Provider-QXxjkZO1.mjs} +13 -13
- package/dist/Route53Provider-QXxjkZO1.mjs.map +1 -0
- package/dist/S3StateStore-Br8VMY22.cjs +160 -0
- package/dist/S3StateStore-Br8VMY22.cjs.map +1 -0
- package/dist/S3StateStore-bwxcI_wQ.mjs +161 -0
- package/dist/S3StateStore-bwxcI_wQ.mjs.map +1 -0
- package/dist/SSMStateStore-CsOS0W1y.mjs +154 -0
- package/dist/SSMStateStore-CsOS0W1y.mjs.map +1 -0
- package/dist/SSMStateStore-DoZE1Wi1.cjs +153 -0
- package/dist/SSMStateStore-DoZE1Wi1.cjs.map +1 -0
- package/dist/SubscriberGenerator-BPqQf8fB.mjs +448 -0
- package/dist/SubscriberGenerator-BPqQf8fB.mjs.map +1 -0
- package/dist/SubscriberGenerator-BVn7cQ-2.cjs +489 -0
- package/dist/SubscriberGenerator-BVn7cQ-2.cjs.map +1 -0
- package/dist/add-CNMF0Q3m.cjs +594 -0
- package/dist/add-CNMF0Q3m.cjs.map +1 -0
- package/dist/add-DHk1roh_.mjs +592 -0
- package/dist/add-DHk1roh_.mjs.map +1 -0
- package/dist/appPorts-C9z9Pzn9.mjs +223 -0
- package/dist/appPorts-C9z9Pzn9.mjs.map +1 -0
- package/dist/appPorts-Cu79hJF6.cjs +264 -0
- package/dist/appPorts-Cu79hJF6.cjs.map +1 -0
- package/dist/aws-B-6uEhgP.mjs +71 -0
- package/dist/aws-B-6uEhgP.mjs.map +1 -0
- package/dist/aws-BTawF0F-.cjs +82 -0
- package/dist/aws-BTawF0F-.cjs.map +1 -0
- package/dist/awsStore-7VmS_cZR.cjs +54 -0
- package/dist/awsStore-7VmS_cZR.cjs.map +1 -0
- package/dist/awsStore-B529csle.mjs +43 -0
- package/dist/awsStore-B529csle.mjs.map +1 -0
- package/dist/{backup-provisioner-Bgj5Vi_L.mjs → backup-provisioner-C8DnCmxK.mjs} +11 -8
- package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
- package/dist/{backup-provisioner-BrsHwYG0.cjs → backup-provisioner-oDEsPj02.cjs} +22 -20
- package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
- package/dist/{bundler-BY1OmV1e.cjs → bundler-BQJiB7Ub.cjs} +38 -35
- package/dist/bundler-BQJiB7Ub.cjs.map +1 -0
- package/dist/{bundler-Be8Zg4Wd.mjs → bundler-D6eBfVkl.mjs} +36 -32
- package/dist/bundler-D6eBfVkl.mjs.map +1 -0
- package/dist/cli-BE9mqeX8.cjs +69 -0
- package/dist/cli-BE9mqeX8.cjs.map +1 -0
- package/dist/cli-DD-Yk-I5.mjs +69 -0
- package/dist/cli-DD-Yk-I5.mjs.map +1 -0
- package/dist/compose-Bhmf0n4o.mjs +3140 -0
- package/dist/compose-Bhmf0n4o.mjs.map +1 -0
- package/dist/compose-CvpU6ooi.cjs +3265 -0
- package/dist/compose-CvpU6ooi.cjs.map +1 -0
- package/dist/config-CdEcTrjG.d.mts +269 -0
- package/dist/config-CdEcTrjG.d.mts.map +1 -0
- package/dist/config-pST7E0CS.d.cts +269 -0
- package/dist/config-pST7E0CS.d.cts.map +1 -0
- package/dist/config.cjs +420 -11
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +4 -120
- package/dist/config.d.mts +4 -120
- package/dist/config.mjs +404 -4
- package/dist/config.mjs.map +1 -0
- package/dist/credentialSchemas-BJqRJNK4.mjs +236 -0
- package/dist/credentialSchemas-BJqRJNK4.mjs.map +1 -0
- package/dist/credentialSchemas-DCR4Wd1W.cjs +271 -0
- package/dist/credentialSchemas-DCR4Wd1W.cjs.map +1 -0
- package/dist/credentials-BKfIugu2.cjs +513 -0
- package/dist/credentials-BKfIugu2.cjs.map +1 -0
- package/dist/credentials-CnVqoXMb.mjs +388 -0
- package/dist/credentials-CnVqoXMb.mjs.map +1 -0
- package/dist/databases-BY-pEImp.cjs +597 -0
- package/dist/databases-BY-pEImp.cjs.map +1 -0
- package/dist/databases-CzszQV0N.mjs +494 -0
- package/dist/databases-CzszQV0N.mjs.map +1 -0
- package/dist/define-DR8xGYfL.mjs +97 -0
- package/dist/define-DR8xGYfL.mjs.map +1 -0
- package/dist/define-DzRz8FgH.cjs +144 -0
- package/dist/define-DzRz8FgH.cjs.map +1 -0
- package/dist/deploy/public.cjs +208 -0
- package/dist/deploy/public.cjs.map +1 -0
- package/dist/deploy/public.d.cts +649 -0
- package/dist/deploy/public.d.cts.map +1 -0
- package/dist/deploy/public.d.mts +649 -0
- package/dist/deploy/public.d.mts.map +1 -0
- package/dist/deploy/public.mjs +142 -0
- package/dist/deploy/public.mjs.map +1 -0
- package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
- package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
- package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
- package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
- package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
- package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
- package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
- package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
- package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
- package/dist/deploy/sniffer-hooks.cjs +13 -7
- package/dist/deploy/sniffer-hooks.cjs.map +1 -1
- package/dist/deploy/sniffer-hooks.d.cts +1 -2
- package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
- package/dist/deploy/sniffer-hooks.d.mts +1 -2
- package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
- package/dist/deploy/sniffer-hooks.mjs +10 -3
- package/dist/deploy/sniffer-hooks.mjs.map +1 -1
- package/dist/deploy/sniffer-loader.cjs +16 -7
- package/dist/deploy/sniffer-loader.cjs.map +1 -1
- package/dist/deploy/sniffer-loader.d.cts +1 -1
- package/dist/deploy/sniffer-loader.d.mts +1 -1
- package/dist/deploy/sniffer-loader.mjs +14 -3
- package/dist/deploy/sniffer-loader.mjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.cjs +11 -11
- package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
- package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
- package/dist/deploy/sniffer-routes-worker.mjs +4 -4
- package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
- package/dist/deploy/sniffer-worker.cjs +15 -6
- package/dist/deploy/sniffer-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-worker.d.cts +1 -3
- package/dist/deploy/sniffer-worker.d.cts.map +1 -1
- package/dist/deploy/sniffer-worker.d.mts +1 -3
- package/dist/deploy/sniffer-worker.d.mts.map +1 -1
- package/dist/deploy/sniffer-worker.mjs +15 -4
- package/dist/deploy/sniffer-worker.mjs.map +1 -1
- package/dist/deploy-CuHasEA4.cjs +554 -0
- package/dist/deploy-CuHasEA4.cjs.map +1 -0
- package/dist/deploy-QNtx_eWR.mjs +525 -0
- package/dist/deploy-QNtx_eWR.mjs.map +1 -0
- package/dist/derive-B4vDpzgP.mjs +150 -0
- package/dist/derive-B4vDpzgP.mjs.map +1 -0
- package/dist/derive-DAbo49sm.cjs +161 -0
- package/dist/derive-DAbo49sm.cjs.map +1 -0
- package/dist/discover-BPelzeGW.mjs +526 -0
- package/dist/discover-BPelzeGW.mjs.map +1 -0
- package/dist/discover-CU0paUyH.d.cts +108 -0
- package/dist/discover-CU0paUyH.d.cts.map +1 -0
- package/dist/discover-D1It5r_h.cjs +599 -0
- package/dist/discover-D1It5r_h.cjs.map +1 -0
- package/dist/discover-DFiJxwfv.d.mts +108 -0
- package/dist/discover-DFiJxwfv.d.mts.map +1 -0
- package/dist/dokploy-CYcMLh9-.mjs +38 -0
- package/dist/dokploy-CYcMLh9-.mjs.map +1 -0
- package/dist/dokploy-DIowwyIB.cjs +38 -0
- package/dist/dokploy-DIowwyIB.cjs.map +1 -0
- package/dist/drivers-DTZzxeIl.mjs +177 -0
- package/dist/drivers-DTZzxeIl.mjs.map +1 -0
- package/dist/drivers-LYSdQDmd.cjs +200 -0
- package/dist/drivers-LYSdQDmd.cjs.map +1 -0
- package/dist/{emit-CiZS_5Ub.mjs → emit-C1e8qD08.mjs} +13 -26
- package/dist/emit-C1e8qD08.mjs.map +1 -0
- package/dist/{emit-CbcRolsa.cjs → emit-Dmc1nvdS.cjs} +31 -57
- package/dist/emit-Dmc1nvdS.cjs.map +1 -0
- package/dist/encryption-BrEef7Jk.mjs +88 -0
- package/dist/encryption-BrEef7Jk.mjs.map +1 -0
- package/dist/encryption-CjYdUb2s.cjs +89 -0
- package/dist/encryption-CjYdUb2s.cjs.map +1 -0
- package/dist/engine-2h4k5ICq.mjs +3085 -0
- package/dist/engine-2h4k5ICq.mjs.map +1 -0
- package/dist/engine-BhJ7ZP9K.cjs +3198 -0
- package/dist/engine-BhJ7ZP9K.cjs.map +1 -0
- package/dist/github-B5Bw4HIu.cjs +669 -0
- package/dist/github-B5Bw4HIu.cjs.map +1 -0
- package/dist/github-BCDF6xVH.mjs +669 -0
- package/dist/github-BCDF6xVH.mjs.map +1 -0
- package/dist/{index-C6e-ULLx.d.mts → index-D-F_hTDz.d.cts} +39 -24
- package/dist/index-D-F_hTDz.d.cts.map +1 -0
- package/dist/{index-CR5urhWX.d.cts → index-YFNxR5Ns.d.mts} +39 -24
- package/dist/index-YFNxR5Ns.d.mts.map +1 -0
- package/dist/index.cjs +9487 -12080
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +9420 -12026
- package/dist/index.mjs.map +1 -1
- package/dist/local-BjxDfPvy.cjs +241 -0
- package/dist/local-BjxDfPvy.cjs.map +1 -0
- package/dist/local-IuoIF3CT.mjs +224 -0
- package/dist/local-IuoIF3CT.mjs.map +1 -0
- package/dist/migrate-CGaancHY.cjs +93 -0
- package/dist/migrate-CGaancHY.cjs.map +1 -0
- package/dist/migrate-DWZz9kah.mjs +93 -0
- package/dist/migrate-DWZz9kah.mjs.map +1 -0
- package/dist/migrate-DbtcuOr_.mjs +265 -0
- package/dist/migrate-DbtcuOr_.mjs.map +1 -0
- package/dist/migrate-q2YYLJLE.cjs +270 -0
- package/dist/migrate-q2YYLJLE.cjs.map +1 -0
- package/dist/openapi.cjs +214 -10
- package/dist/openapi.cjs.map +1 -0
- package/dist/openapi.d.cts +47 -17
- package/dist/openapi.d.cts.map +1 -1
- package/dist/openapi.d.mts +47 -17
- package/dist/openapi.d.mts.map +1 -1
- package/dist/openapi.mjs +208 -5
- package/dist/openapi.mjs.map +1 -0
- package/dist/provider-C9_-45d5.cjs +56 -0
- package/dist/provider-C9_-45d5.cjs.map +1 -0
- package/dist/provider-q4lsYzYG.mjs +45 -0
- package/dist/provider-q4lsYzYG.mjs.map +1 -0
- package/dist/ready-BpNbORRB.cjs +402 -0
- package/dist/ready-BpNbORRB.cjs.map +1 -0
- package/dist/ready-b6vm0-W-.mjs +373 -0
- package/dist/ready-b6vm0-W-.mjs.map +1 -0
- package/dist/reconcile/public.cjs +3 -5
- package/dist/reconcile/public.d.cts +11 -87
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +11 -87
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +3 -4
- package/dist/{reconcile-D0pimNiy.cjs → reconcile-CuCQBa5-.cjs} +5 -8
- package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
- package/dist/{reconcile-CFs8C_1a.mjs → reconcile-Dh1Jk7WE.mjs} +4 -7
- package/dist/reconcile-Dh1Jk7WE.mjs.map +1 -0
- package/dist/resolve-Cns0v6dN.cjs +315 -0
- package/dist/resolve-Cns0v6dN.cjs.map +1 -0
- package/dist/resolve-DNg0icnh.mjs +262 -0
- package/dist/resolve-DNg0icnh.mjs.map +1 -0
- package/dist/rollback-CFrNLmxs.mjs +132 -0
- package/dist/rollback-CFrNLmxs.mjs.map +1 -0
- package/dist/rollback-UIjS25F1.cjs +161 -0
- package/dist/rollback-UIjS25F1.cjs.map +1 -0
- package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
- package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
- package/dist/runtime-CN_kmqxo.d.cts +90 -0
- package/dist/runtime-CN_kmqxo.d.cts.map +1 -0
- package/dist/runtime-Cjvon3oj.d.mts +90 -0
- package/dist/runtime-Cjvon3oj.d.mts.map +1 -0
- package/dist/sandbox/config-worker.cjs +43 -0
- package/dist/sandbox/config-worker.cjs.map +1 -0
- package/dist/sandbox/config-worker.d.cts +1 -0
- package/dist/sandbox/config-worker.d.mts +1 -0
- package/dist/sandbox/config-worker.mjs +44 -0
- package/dist/sandbox/config-worker.mjs.map +1 -0
- package/dist/sandbox/credentials-worker.cjs +54 -0
- package/dist/sandbox/credentials-worker.cjs.map +1 -0
- package/dist/sandbox/credentials-worker.d.cts +1 -0
- package/dist/sandbox/credentials-worker.d.mts +1 -0
- package/dist/sandbox/credentials-worker.mjs +55 -0
- package/dist/sandbox/credentials-worker.mjs.map +1 -0
- package/dist/sandbox/discover-worker.cjs +47 -0
- package/dist/sandbox/discover-worker.cjs.map +1 -0
- package/dist/sandbox/discover-worker.d.cts +1 -0
- package/dist/sandbox/discover-worker.d.mts +1 -0
- package/dist/sandbox/discover-worker.mjs +48 -0
- package/dist/sandbox/discover-worker.mjs.map +1 -0
- package/dist/sandbox/migrate-worker.cjs +75 -0
- package/dist/sandbox/migrate-worker.cjs.map +1 -0
- package/dist/sandbox/migrate-worker.d.cts +1 -0
- package/dist/sandbox/migrate-worker.d.mts +1 -0
- package/dist/sandbox/migrate-worker.mjs +76 -0
- package/dist/sandbox/migrate-worker.mjs.map +1 -0
- package/dist/sandbox-CL--ZDui.cjs +164 -0
- package/dist/sandbox-CL--ZDui.cjs.map +1 -0
- package/dist/sandbox-Dm247NGx.mjs +117 -0
- package/dist/sandbox-Dm247NGx.mjs.map +1 -0
- package/dist/sandbox-M8UnLhXE.d.cts +126 -0
- package/dist/sandbox-M8UnLhXE.d.cts.map +1 -0
- package/dist/sandbox-M8UnLhXE.d.mts +126 -0
- package/dist/sandbox-M8UnLhXE.d.mts.map +1 -0
- package/dist/{workspace-zoqRbihZ.mjs → schemas-BObwxB_t.cjs} +998 -1659
- package/dist/schemas-BObwxB_t.cjs.map +1 -0
- package/dist/{workspace-C6VJQVtG.cjs → schemas-D-xeKJDD.mjs} +913 -1842
- package/dist/schemas-D-xeKJDD.mjs.map +1 -0
- package/dist/secretsManager-Chs9VV2r.mjs +76 -0
- package/dist/secretsManager-Chs9VV2r.mjs.map +1 -0
- package/dist/secretsManager-DcMlHnRC.cjs +87 -0
- package/dist/secretsManager-DcMlHnRC.cjs.map +1 -0
- package/dist/seeds-CkIPFGNO.cjs +10560 -0
- package/dist/seeds-CkIPFGNO.cjs.map +1 -0
- package/dist/seeds-odfgSCmu.mjs +9538 -0
- package/dist/seeds-odfgSCmu.mjs.map +1 -0
- package/dist/sniffer-BTtX3NUM.mjs +1262 -0
- package/dist/sniffer-BTtX3NUM.mjs.map +1 -0
- package/dist/sniffer-IAQEpsQb.cjs +1333 -0
- package/dist/sniffer-IAQEpsQb.cjs.map +1 -0
- package/dist/sst-BgcOsaBi.cjs +453 -0
- package/dist/sst-BgcOsaBi.cjs.map +1 -0
- package/dist/sst-CJzvyrEz.mjs +430 -0
- package/dist/sst-CJzvyrEz.mjs.map +1 -0
- package/dist/stages-CUn6gvXL.cjs +174 -0
- package/dist/stages-CUn6gvXL.cjs.map +1 -0
- package/dist/stages-CnZRYmkI.mjs +174 -0
- package/dist/stages-CnZRYmkI.mjs.map +1 -0
- package/dist/target/public.cjs +15 -0
- package/dist/target/public.d.cts +28 -0
- package/dist/target/public.d.cts.map +1 -0
- package/dist/target/public.d.mts +28 -0
- package/dist/target/public.d.mts.map +1 -0
- package/dist/target/public.mjs +4 -0
- package/dist/terminal-D8TPK7o9.mjs +84 -0
- package/dist/terminal-D8TPK7o9.mjs.map +1 -0
- package/dist/terminal-DuapRxh6.cjs +84 -0
- package/dist/terminal-DuapRxh6.cjs.map +1 -0
- package/dist/types-NqX1Hz4P.d.cts +7454 -0
- package/dist/types-NqX1Hz4P.d.cts.map +1 -0
- package/dist/types-ZHuZ89hv.d.mts +7453 -0
- package/dist/types-ZHuZ89hv.d.mts.map +1 -0
- package/dist/utils-D2Nk1Nv2.cjs +205 -0
- package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
- package/dist/utils-D_fxUqvU.mjs +156 -0
- package/dist/utils-D_fxUqvU.mjs.map +1 -0
- package/dist/vitest.cjs +65 -0
- package/dist/vitest.cjs.map +1 -0
- package/dist/vitest.d.cts +29 -0
- package/dist/vitest.d.cts.map +1 -0
- package/dist/vitest.d.mts +29 -0
- package/dist/vitest.d.mts.map +1 -0
- package/dist/vitest.mjs +65 -0
- package/dist/vitest.mjs.map +1 -0
- package/dist/workerRuntime-BXfhbe13.cjs +108 -0
- package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
- package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
- package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
- package/dist/workspace/index.cjs +8 -4
- package/dist/workspace/index.d.cts +3 -3
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +2 -3
- package/dist/workspace-CJ0lKFq-.mjs +1979 -0
- package/dist/workspace-CJ0lKFq-.mjs.map +1 -0
- package/dist/workspace-CwW3Gkru.cjs +2355 -0
- package/dist/workspace-CwW3Gkru.cjs.map +1 -0
- package/package.json +53 -22
- package/dist/CachedStateProvider-BLo7zv7S.cjs +0 -3
- package/dist/CachedStateProvider-BxoAm-B2.mjs +0 -3
- package/dist/CachedStateProvider-CqPdW7CB.cjs +0 -60
- package/dist/CachedStateProvider-CqPdW7CB.cjs.map +0 -1
- package/dist/CachedStateProvider-DTniehMP.mjs +0 -54
- package/dist/CachedStateProvider-DTniehMP.mjs.map +0 -1
- package/dist/HostingerProvider-Cft7lEYr.mjs.map +0 -1
- package/dist/HostingerProvider-h3EbEp-Z.cjs.map +0 -1
- package/dist/LocalStateProvider-Bn6tS-oL.mjs +0 -42
- package/dist/LocalStateProvider-Bn6tS-oL.mjs.map +0 -1
- package/dist/LocalStateProvider-Db9SEjyH.cjs +0 -43
- package/dist/LocalStateProvider-Db9SEjyH.cjs.map +0 -1
- package/dist/Route53Provider-RdpUDJQk.mjs.map +0 -1
- package/dist/Route53Provider-di2fMM5N.cjs.map +0 -1
- package/dist/SSMStateProvider-BRt2py-A.mjs +0 -66
- package/dist/SSMStateProvider-BRt2py-A.mjs.map +0 -1
- package/dist/SSMStateProvider-DyX8s9HI.cjs +0 -66
- package/dist/SSMStateProvider-DyX8s9HI.cjs.map +0 -1
- package/dist/backup-provisioner-Bgj5Vi_L.mjs.map +0 -1
- package/dist/backup-provisioner-BrsHwYG0.cjs.map +0 -1
- package/dist/bundler-BY1OmV1e.cjs.map +0 -1
- package/dist/bundler-Be8Zg4Wd.mjs.map +0 -1
- package/dist/chunk-Duj1WY3L.mjs +0 -7
- package/dist/config-BZ1F0WuA.cjs +0 -462
- package/dist/config-BZ1F0WuA.cjs.map +0 -1
- package/dist/config-DVVph9yz.mjs +0 -402
- package/dist/config-DVVph9yz.mjs.map +0 -1
- package/dist/config.d.cts.map +0 -1
- package/dist/config.d.mts.map +0 -1
- package/dist/credentials-B5zRHdAl.mjs +0 -141
- package/dist/credentials-B5zRHdAl.mjs.map +0 -1
- package/dist/credentials-BapzjyV5.cjs +0 -195
- package/dist/credentials-BapzjyV5.cjs.map +0 -1
- package/dist/credentials-Xamqe_NJ.cjs +0 -2681
- package/dist/credentials-Xamqe_NJ.cjs.map +0 -1
- package/dist/credentials-dP8vRVRv.mjs +0 -2549
- package/dist/credentials-dP8vRVRv.mjs.map +0 -1
- package/dist/discover-CAlFgYec.mjs +0 -229
- package/dist/discover-CAlFgYec.mjs.map +0 -1
- package/dist/discover-DTmFeloL.cjs +0 -271
- package/dist/discover-DTmFeloL.cjs.map +0 -1
- package/dist/dokploy-api-BS2xnJLZ.mjs +0 -3
- package/dist/dokploy-api-BsVH0y_s.cjs +0 -718
- package/dist/dokploy-api-BsVH0y_s.cjs.map +0 -1
- package/dist/dokploy-api-BuxDRo3l.cjs +0 -3
- package/dist/dokploy-api-aTFPz7_4.mjs +0 -706
- package/dist/dokploy-api-aTFPz7_4.mjs.map +0 -1
- package/dist/emit-CbcRolsa.cjs.map +0 -1
- package/dist/emit-CiZS_5Ub.mjs.map +0 -1
- package/dist/encryption-C6jaU0hE.cjs +0 -54
- package/dist/encryption-C6jaU0hE.cjs.map +0 -1
- package/dist/encryption-CHzzeR8a.cjs +0 -4
- package/dist/encryption-CQUncu7v.mjs +0 -3
- package/dist/encryption-D-abyhZx.mjs +0 -42
- package/dist/encryption-D-abyhZx.mjs.map +0 -1
- package/dist/fullstack-secrets-C-GGohke.cjs +0 -111
- package/dist/fullstack-secrets-C-GGohke.cjs.map +0 -1
- package/dist/fullstack-secrets-D1o9-G5l.mjs +0 -87
- package/dist/fullstack-secrets-D1o9-G5l.mjs.map +0 -1
- package/dist/generator-CNzBw7g5.cjs +0 -289
- package/dist/generator-CNzBw7g5.cjs.map +0 -1
- package/dist/generator-VE2JrFlY.mjs +0 -253
- package/dist/generator-VE2JrFlY.mjs.map +0 -1
- package/dist/index-C6e-ULLx.d.mts.map +0 -1
- package/dist/index-CR5urhWX.d.cts.map +0 -1
- package/dist/openapi-SjsgARie.cjs +0 -2075
- package/dist/openapi-SjsgARie.cjs.map +0 -1
- package/dist/openapi-Xx0A7Wg0.mjs +0 -2021
- package/dist/openapi-Xx0A7Wg0.mjs.map +0 -1
- package/dist/openapi-react-query-Byltvm_7.mjs +0 -167
- package/dist/openapi-react-query-Byltvm_7.mjs.map +0 -1
- package/dist/openapi-react-query-CmJ1xDbn.cjs +0 -173
- package/dist/openapi-react-query-CmJ1xDbn.cjs.map +0 -1
- package/dist/openapi-react-query.cjs +0 -4
- package/dist/openapi-react-query.d.cts +0 -11
- package/dist/openapi-react-query.d.cts.map +0 -1
- package/dist/openapi-react-query.d.mts +0 -11
- package/dist/openapi-react-query.d.mts.map +0 -1
- package/dist/openapi-react-query.mjs +0 -4
- package/dist/reconcile-CFs8C_1a.mjs.map +0 -1
- package/dist/reconcile-D0pimNiy.cjs.map +0 -1
- package/dist/setup-BA8ciTPU.mjs +0 -11
- package/dist/setup-BsZvZP6f.cjs +0 -11
- package/dist/setup-C8KOx8_8.mjs +0 -443
- package/dist/setup-C8KOx8_8.mjs.map +0 -1
- package/dist/setup-hC6hI86f.cjs +0 -473
- package/dist/setup-hC6hI86f.cjs.map +0 -1
- package/dist/storage-BJmzYxt8.cjs +0 -363
- package/dist/storage-BJmzYxt8.cjs.map +0 -1
- package/dist/storage-BM9hGpgv.cjs +0 -7
- package/dist/storage-Bi24WfoW.mjs +0 -297
- package/dist/storage-Bi24WfoW.mjs.map +0 -1
- package/dist/storage-CYlGwWTj.mjs +0 -3
- package/dist/sync-CmEuNZsB.mjs +0 -76
- package/dist/sync-CmEuNZsB.mjs.map +0 -1
- package/dist/sync-D306yOWu.cjs +0 -4
- package/dist/sync-SizaChmC.cjs +0 -93
- package/dist/sync-SizaChmC.cjs.map +0 -1
- package/dist/sync-hOqAWHR6.mjs +0 -3
- package/dist/types-6pkp2RRj.d.mts +0 -2220
- package/dist/types-6pkp2RRj.d.mts.map +0 -1
- package/dist/types-Y3fKQSAK.d.cts +0 -2220
- package/dist/types-Y3fKQSAK.d.cts.map +0 -1
- package/dist/workspace-BzrG_2SI.mjs +0 -8
- package/dist/workspace-C6VJQVtG.cjs.map +0 -1
- package/dist/workspace-XXtNhqJl.cjs +0 -9
- package/dist/workspace-zoqRbihZ.mjs.map +0 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { dirname, join, parse } from "node:path";
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import fg from "fast-glob";
|
|
4
|
+
import { parse as parse$1 } from "yaml";
|
|
5
|
+
//#region src/init/utils.ts
|
|
6
|
+
/**
|
|
7
|
+
* Detect the package manager being used based on lockfiles or npm_config_user_agent
|
|
8
|
+
*/
|
|
9
|
+
function detectPackageManager(cwd = process.cwd()) {
|
|
10
|
+
if (existsSync(join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
11
|
+
if (existsSync(join(cwd, "yarn.lock"))) return "yarn";
|
|
12
|
+
if (existsSync(join(cwd, "bun.lockb"))) return "bun";
|
|
13
|
+
if (existsSync(join(cwd, "package-lock.json"))) return "npm";
|
|
14
|
+
const userAgent = process.env.npm_config_user_agent || "";
|
|
15
|
+
if (userAgent.includes("pnpm")) return "pnpm";
|
|
16
|
+
if (userAgent.includes("yarn")) return "yarn";
|
|
17
|
+
if (userAgent.includes("bun")) return "bun";
|
|
18
|
+
return "npm";
|
|
19
|
+
}
|
|
20
|
+
/** `gkm init`'s flags, which a name can swallow when a space goes missing. */
|
|
21
|
+
const INIT_FLAGS = [
|
|
22
|
+
"yes",
|
|
23
|
+
"name",
|
|
24
|
+
"template",
|
|
25
|
+
"monorepo",
|
|
26
|
+
"api-path",
|
|
27
|
+
"pm",
|
|
28
|
+
"skip-install"
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* Validate project name for npm package naming conventions
|
|
32
|
+
*/
|
|
33
|
+
function validateProjectName(name) {
|
|
34
|
+
if (!name) return "Project name is required";
|
|
35
|
+
if (!/^[a-z0-9-_@/.]+$/i.test(name)) return "Project name can only contain letters, numbers, hyphens, underscores, @, /, and .";
|
|
36
|
+
const flag = name.match(/--(\w[\w-]*)$/)?.[1];
|
|
37
|
+
if (flag && INIT_FLAGS.includes(flag)) return `"${name}" ends in the --${flag} flag. Did you mean \`${name.slice(0, -(flag.length + 2))} --${flag}\`?`;
|
|
38
|
+
if ([
|
|
39
|
+
"node_modules",
|
|
40
|
+
".git",
|
|
41
|
+
"package.json",
|
|
42
|
+
"src"
|
|
43
|
+
].includes(name.toLowerCase())) return `"${name}" is a reserved name`;
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Check if a directory already exists at the target path
|
|
48
|
+
*/
|
|
49
|
+
function checkDirectoryExists(name, cwd = process.cwd()) {
|
|
50
|
+
const targetPath = join(cwd, name);
|
|
51
|
+
if (existsSync(targetPath)) return `Directory "${name}" already exists`;
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get the install command for a package manager
|
|
56
|
+
*/
|
|
57
|
+
function getInstallCommand(pkgManager) {
|
|
58
|
+
switch (pkgManager) {
|
|
59
|
+
case "pnpm": return "pnpm install";
|
|
60
|
+
case "yarn": return "yarn";
|
|
61
|
+
case "bun": return "bun install";
|
|
62
|
+
default: return "npm install";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get the dev command for a package manager
|
|
67
|
+
*/
|
|
68
|
+
function getRunCommand(pkgManager, script) {
|
|
69
|
+
switch (pkgManager) {
|
|
70
|
+
case "pnpm": return `pnpm ${script}`;
|
|
71
|
+
case "yarn": return `yarn ${script}`;
|
|
72
|
+
case "bun": return `bun run ${script}`;
|
|
73
|
+
default: return `npm run ${script}`;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Run a binary the project installed, through its package manager — so it is
|
|
78
|
+
* the project's own version, not whatever \`npx\` would fetch.
|
|
79
|
+
*/
|
|
80
|
+
function getExecCommand(pkgManager, command) {
|
|
81
|
+
switch (pkgManager) {
|
|
82
|
+
case "pnpm": return `pnpm exec ${command}`;
|
|
83
|
+
case "yarn": return `yarn ${command}`;
|
|
84
|
+
case "bun": return `bunx ${command}`;
|
|
85
|
+
default: return `npx --no-install ${command}`;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const lockfileByPm = {
|
|
89
|
+
pnpm: "pnpm-lock.yaml",
|
|
90
|
+
yarn: "yarn.lock",
|
|
91
|
+
npm: "package-lock.json",
|
|
92
|
+
bun: "bun.lockb"
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Find the workspace/project root by walking up from cwd.
|
|
96
|
+
* Checks for PM-specific workspace config, package.json#workspaces,
|
|
97
|
+
* and lockfiles.
|
|
98
|
+
*/
|
|
99
|
+
function findWorkspaceRoot(cwd, pm) {
|
|
100
|
+
let dir = cwd;
|
|
101
|
+
const root = parse(dir).root;
|
|
102
|
+
const lockfile = lockfileByPm[pm];
|
|
103
|
+
while (dir !== root) {
|
|
104
|
+
if (pm === "pnpm" && existsSync(join(dir, "pnpm-workspace.yaml"))) return dir;
|
|
105
|
+
const pkgJsonPath = join(dir, "package.json");
|
|
106
|
+
if (existsSync(pkgJsonPath)) try {
|
|
107
|
+
if (JSON.parse(readFileSync(pkgJsonPath, "utf-8")).workspaces) return dir;
|
|
108
|
+
} catch {}
|
|
109
|
+
if (existsSync(join(dir, lockfile))) return dir;
|
|
110
|
+
dir = dirname(dir);
|
|
111
|
+
}
|
|
112
|
+
return cwd;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get workspace package glob patterns from pnpm-workspace.yaml
|
|
116
|
+
* or package.json#workspaces.
|
|
117
|
+
*/
|
|
118
|
+
function getWorkspaceGlobs(root) {
|
|
119
|
+
const pnpmWorkspacePath = join(root, "pnpm-workspace.yaml");
|
|
120
|
+
if (existsSync(pnpmWorkspacePath)) {
|
|
121
|
+
const content = readFileSync(pnpmWorkspacePath, "utf-8");
|
|
122
|
+
return parse$1(content)?.packages ?? [];
|
|
123
|
+
}
|
|
124
|
+
const rootPkgJsonPath = join(root, "package.json");
|
|
125
|
+
if (existsSync(rootPkgJsonPath)) {
|
|
126
|
+
const pkg = JSON.parse(readFileSync(rootPkgJsonPath, "utf-8"));
|
|
127
|
+
if (Array.isArray(pkg.workspaces)) return pkg.workspaces;
|
|
128
|
+
if (pkg.workspaces?.packages) return pkg.workspaces.packages;
|
|
129
|
+
}
|
|
130
|
+
return [];
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Find all package.json files across a workspace.
|
|
134
|
+
* Returns the root package.json plus all workspace member package.json paths.
|
|
135
|
+
*/
|
|
136
|
+
function findWorkspacePackages(cwd, pm) {
|
|
137
|
+
const workspaceRoot = findWorkspaceRoot(cwd, pm);
|
|
138
|
+
const results = [];
|
|
139
|
+
const rootPkgJson = join(workspaceRoot, "package.json");
|
|
140
|
+
if (existsSync(rootPkgJson)) results.push(rootPkgJson);
|
|
141
|
+
const globs = getWorkspaceGlobs(workspaceRoot);
|
|
142
|
+
for (const glob of globs) {
|
|
143
|
+
const pattern = `${glob}/package.json`;
|
|
144
|
+
const matches = fg.sync(pattern, {
|
|
145
|
+
cwd: workspaceRoot,
|
|
146
|
+
absolute: true,
|
|
147
|
+
ignore: ["**/node_modules/**"]
|
|
148
|
+
});
|
|
149
|
+
results.push(...matches);
|
|
150
|
+
}
|
|
151
|
+
return [...new Set(results)];
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
154
|
+
export { getExecCommand as a, validateProjectName as c, findWorkspaceRoot as i, detectPackageManager as n, getInstallCommand as o, findWorkspacePackages as r, getRunCommand as s, checkDirectoryExists as t };
|
|
155
|
+
|
|
156
|
+
//# sourceMappingURL=utils-D_fxUqvU.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-D_fxUqvU.mjs","names":["parseYaml"],"sources":["../src/init/utils.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join, parse } from 'node:path';\nimport fg from 'fast-glob';\nimport { parse as parseYaml } from 'yaml';\n\nexport type PackageManager = 'pnpm' | 'npm' | 'yarn' | 'bun';\n\n/**\n * Detect the package manager being used based on lockfiles or npm_config_user_agent\n */\nexport function detectPackageManager(\n\tcwd: string = process.cwd(),\n): PackageManager {\n\t// Check for lockfiles in cwd\n\tif (existsSync(join(cwd, 'pnpm-lock.yaml'))) return 'pnpm';\n\tif (existsSync(join(cwd, 'yarn.lock'))) return 'yarn';\n\tif (existsSync(join(cwd, 'bun.lockb'))) return 'bun';\n\tif (existsSync(join(cwd, 'package-lock.json'))) return 'npm';\n\n\t// Check npm_config_user_agent (set when running via npx/pnpm dlx/etc)\n\tconst userAgent = process.env.npm_config_user_agent || '';\n\tif (userAgent.includes('pnpm')) return 'pnpm';\n\tif (userAgent.includes('yarn')) return 'yarn';\n\tif (userAgent.includes('bun')) return 'bun';\n\n\treturn 'npm';\n}\n\n/** `gkm init`'s flags, which a name can swallow when a space goes missing. */\nconst INIT_FLAGS = [\n\t'yes',\n\t'name',\n\t'template',\n\t'monorepo',\n\t'api-path',\n\t'pm',\n\t'skip-install',\n];\n\n/**\n * Validate project name for npm package naming conventions\n */\nexport function validateProjectName(name: string): boolean | string {\n\tif (!name) {\n\t\treturn 'Project name is required';\n\t}\n\n\t// Check for valid npm package name characters\n\tif (!/^[a-z0-9-_@/.]+$/i.test(name)) {\n\t\treturn 'Project name can only contain letters, numbers, hyphens, underscores, @, /, and .';\n\t}\n\n\t// `init shop--monorepo` is `init shop --monorepo` with the space\n\t// lost, and the flag then ends up in every package scope and physical name.\n\tconst flag = name.match(/--(\\w[\\w-]*)$/)?.[1];\n\tif (flag && INIT_FLAGS.includes(flag)) {\n\t\tconst intended = name.slice(0, -(flag.length + 2));\n\t\treturn `\"${name}\" ends in the --${flag} flag. Did you mean \\`${intended} --${flag}\\`?`;\n\t}\n\n\t// Check for reserved names\n\tconst reserved = ['node_modules', '.git', 'package.json', 'src'];\n\tif (reserved.includes(name.toLowerCase())) {\n\t\treturn `\"${name}\" is a reserved name`;\n\t}\n\n\treturn true;\n}\n\n/**\n * Check if a directory already exists at the target path\n */\nexport function checkDirectoryExists(\n\tname: string,\n\tcwd: string = process.cwd(),\n): boolean | string {\n\tconst targetPath = join(cwd, name);\n\tif (existsSync(targetPath)) {\n\t\treturn `Directory \"${name}\" already exists`;\n\t}\n\treturn true;\n}\n\n/**\n * Get the install command for a package manager\n */\nexport function getInstallCommand(pkgManager: PackageManager): string {\n\tswitch (pkgManager) {\n\t\tcase 'pnpm':\n\t\t\treturn 'pnpm install';\n\t\tcase 'yarn':\n\t\t\treturn 'yarn';\n\t\tcase 'bun':\n\t\t\treturn 'bun install';\n\t\tdefault:\n\t\t\treturn 'npm install';\n\t}\n}\n\n/**\n * Get the dev command for a package manager\n */\nexport function getRunCommand(\n\tpkgManager: PackageManager,\n\tscript: string,\n): string {\n\tswitch (pkgManager) {\n\t\tcase 'pnpm':\n\t\t\treturn `pnpm ${script}`;\n\t\tcase 'yarn':\n\t\t\treturn `yarn ${script}`;\n\t\tcase 'bun':\n\t\t\treturn `bun run ${script}`;\n\t\tdefault:\n\t\t\treturn `npm run ${script}`;\n\t}\n}\n\n/**\n * Run a binary the project installed, through its package manager — so it is\n * the project's own version, not whatever \\`npx\\` would fetch.\n */\nexport function getExecCommand(\n\tpkgManager: PackageManager,\n\tcommand: string,\n): string {\n\tswitch (pkgManager) {\n\t\tcase 'pnpm':\n\t\t\treturn `pnpm exec ${command}`;\n\t\tcase 'yarn':\n\t\t\treturn `yarn ${command}`;\n\t\tcase 'bun':\n\t\t\treturn `bunx ${command}`;\n\t\tdefault:\n\t\t\treturn `npx --no-install ${command}`;\n\t}\n}\n\nconst lockfileByPm: Record<PackageManager, string> = {\n\tpnpm: 'pnpm-lock.yaml',\n\tyarn: 'yarn.lock',\n\tnpm: 'package-lock.json',\n\tbun: 'bun.lockb',\n};\n\n/**\n * Find the workspace/project root by walking up from cwd.\n * Checks for PM-specific workspace config, package.json#workspaces,\n * and lockfiles.\n */\nexport function findWorkspaceRoot(cwd: string, pm: PackageManager): string {\n\tlet dir = cwd;\n\tconst root = parse(dir).root;\n\tconst lockfile = lockfileByPm[pm];\n\n\twhile (dir !== root) {\n\t\tif (pm === 'pnpm' && existsSync(join(dir, 'pnpm-workspace.yaml'))) {\n\t\t\treturn dir;\n\t\t}\n\n\t\tconst pkgJsonPath = join(dir, 'package.json');\n\t\tif (existsSync(pkgJsonPath)) {\n\t\t\ttry {\n\t\t\t\tconst pkg = JSON.parse(readFileSync(pkgJsonPath, 'utf-8'));\n\t\t\t\tif (pkg.workspaces) return dir;\n\t\t\t} catch {\n\t\t\t\t// ignore malformed package.json\n\t\t\t}\n\t\t}\n\n\t\tif (existsSync(join(dir, lockfile))) {\n\t\t\treturn dir;\n\t\t}\n\n\t\tdir = dirname(dir);\n\t}\n\n\treturn cwd;\n}\n\n/**\n * Get workspace package glob patterns from pnpm-workspace.yaml\n * or package.json#workspaces.\n */\nexport function getWorkspaceGlobs(root: string): string[] {\n\tconst pnpmWorkspacePath = join(root, 'pnpm-workspace.yaml');\n\tif (existsSync(pnpmWorkspacePath)) {\n\t\tconst content = readFileSync(pnpmWorkspacePath, 'utf-8');\n\t\tconst parsed = parseYaml(content);\n\t\treturn parsed?.packages ?? [];\n\t}\n\n\tconst rootPkgJsonPath = join(root, 'package.json');\n\tif (existsSync(rootPkgJsonPath)) {\n\t\tconst pkg = JSON.parse(readFileSync(rootPkgJsonPath, 'utf-8'));\n\t\tif (Array.isArray(pkg.workspaces)) {\n\t\t\treturn pkg.workspaces;\n\t\t}\n\t\tif (pkg.workspaces?.packages) {\n\t\t\treturn pkg.workspaces.packages;\n\t\t}\n\t}\n\n\treturn [];\n}\n\n/**\n * Find all package.json files across a workspace.\n * Returns the root package.json plus all workspace member package.json paths.\n */\nexport function findWorkspacePackages(\n\tcwd: string,\n\tpm: PackageManager,\n): string[] {\n\tconst workspaceRoot = findWorkspaceRoot(cwd, pm);\n\tconst results: string[] = [];\n\n\tconst rootPkgJson = join(workspaceRoot, 'package.json');\n\tif (existsSync(rootPkgJson)) {\n\t\tresults.push(rootPkgJson);\n\t}\n\n\tconst globs = getWorkspaceGlobs(workspaceRoot);\n\n\tfor (const glob of globs) {\n\t\tconst pattern = `${glob}/package.json`;\n\t\tconst matches = fg.sync(pattern, {\n\t\t\tcwd: workspaceRoot,\n\t\t\tabsolute: true,\n\t\t\tignore: ['**/node_modules/**'],\n\t\t});\n\t\tresults.push(...matches);\n\t}\n\n\treturn [...new Set(results)];\n}\n"],"mappings":";;;;;;;;AAUA,SAAgB,qBACf,MAAc,QAAQ,IAAI,GACT;CAEjB,IAAI,WAAW,KAAK,KAAK,gBAAgB,CAAC,GAAG,OAAO;CACpD,IAAI,WAAW,KAAK,KAAK,WAAW,CAAC,GAAG,OAAO;CAC/C,IAAI,WAAW,KAAK,KAAK,WAAW,CAAC,GAAG,OAAO;CAC/C,IAAI,WAAW,KAAK,KAAK,mBAAmB,CAAC,GAAG,OAAO;CAGvD,MAAM,YAAY,QAAQ,IAAI,yBAAyB;CACvD,IAAI,UAAU,SAAS,MAAM,GAAG,OAAO;CACvC,IAAI,UAAU,SAAS,MAAM,GAAG,OAAO;CACvC,IAAI,UAAU,SAAS,KAAK,GAAG,OAAO;CAEtC,OAAO;AACR;;AAGA,MAAM,aAAa;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;AAKA,SAAgB,oBAAoB,MAAgC;CACnE,IAAI,CAAC,MACJ,OAAO;CAIR,IAAI,CAAC,oBAAoB,KAAK,IAAI,GACjC,OAAO;CAKR,MAAM,OAAO,KAAK,MAAM,eAAe,CAAC,GAAG;CAC3C,IAAI,QAAQ,WAAW,SAAS,IAAI,GAEnC,OAAO,IAAI,KAAK,kBAAkB,KAAK,wBADtB,KAAK,MAAM,GAAG,EAAE,KAAK,SAAS,EACuB,EAAE,KAAK,KAAK;CAKnF,IAAI;EADc;EAAgB;EAAQ;EAAgB;CAC/C,CAAC,CAAC,SAAS,KAAK,YAAY,CAAC,GACvC,OAAO,IAAI,KAAK;CAGjB,OAAO;AACR;;;;AAKA,SAAgB,qBACf,MACA,MAAc,QAAQ,IAAI,GACP;CACnB,MAAM,aAAa,KAAK,KAAK,IAAI;CACjC,IAAI,WAAW,UAAU,GACxB,OAAO,cAAc,KAAK;CAE3B,OAAO;AACR;;;;AAKA,SAAgB,kBAAkB,YAAoC;CACrE,QAAQ,YAAR;EACC,KAAK,QACJ,OAAO;EACR,KAAK,QACJ,OAAO;EACR,KAAK,OACJ,OAAO;EACR,SACC,OAAO;CACT;AACD;;;;AAKA,SAAgB,cACf,YACA,QACS;CACT,QAAQ,YAAR;EACC,KAAK,QACJ,OAAO,QAAQ;EAChB,KAAK,QACJ,OAAO,QAAQ;EAChB,KAAK,OACJ,OAAO,WAAW;EACnB,SACC,OAAO,WAAW;CACpB;AACD;;;;;AAMA,SAAgB,eACf,YACA,SACS;CACT,QAAQ,YAAR;EACC,KAAK,QACJ,OAAO,aAAa;EACrB,KAAK,QACJ,OAAO,QAAQ;EAChB,KAAK,OACJ,OAAO,QAAQ;EAChB,SACC,OAAO,oBAAoB;CAC7B;AACD;AAEA,MAAM,eAA+C;CACpD,MAAM;CACN,MAAM;CACN,KAAK;CACL,KAAK;AACN;;;;;;AAOA,SAAgB,kBAAkB,KAAa,IAA4B;CAC1E,IAAI,MAAM;CACV,MAAM,OAAO,MAAM,GAAG,CAAC,CAAC;CACxB,MAAM,WAAW,aAAa;CAE9B,OAAO,QAAQ,MAAM;EACpB,IAAI,OAAO,UAAU,WAAW,KAAK,KAAK,qBAAqB,CAAC,GAC/D,OAAO;EAGR,MAAM,cAAc,KAAK,KAAK,cAAc;EAC5C,IAAI,WAAW,WAAW,GACzB,IAAI;GAEH,IADY,KAAK,MAAM,aAAa,aAAa,OAAO,CAClD,CAAC,CAAC,YAAY,OAAO;EAC5B,QAAQ,CAER;EAGD,IAAI,WAAW,KAAK,KAAK,QAAQ,CAAC,GACjC,OAAO;EAGR,MAAM,QAAQ,GAAG;CAClB;CAEA,OAAO;AACR;;;;;AAMA,SAAgB,kBAAkB,MAAwB;CACzD,MAAM,oBAAoB,KAAK,MAAM,qBAAqB;CAC1D,IAAI,WAAW,iBAAiB,GAAG;EAClC,MAAM,UAAU,aAAa,mBAAmB,OAAO;EAEvD,OADeA,QAAU,OACb,CAAC,EAAE,YAAY,CAAC;CAC7B;CAEA,MAAM,kBAAkB,KAAK,MAAM,cAAc;CACjD,IAAI,WAAW,eAAe,GAAG;EAChC,MAAM,MAAM,KAAK,MAAM,aAAa,iBAAiB,OAAO,CAAC;EAC7D,IAAI,MAAM,QAAQ,IAAI,UAAU,GAC/B,OAAO,IAAI;EAEZ,IAAI,IAAI,YAAY,UACnB,OAAO,IAAI,WAAW;CAExB;CAEA,OAAO,CAAC;AACT;;;;;AAMA,SAAgB,sBACf,KACA,IACW;CACX,MAAM,gBAAgB,kBAAkB,KAAK,EAAE;CAC/C,MAAM,UAAoB,CAAC;CAE3B,MAAM,cAAc,KAAK,eAAe,cAAc;CACtD,IAAI,WAAW,WAAW,GACzB,QAAQ,KAAK,WAAW;CAGzB,MAAM,QAAQ,kBAAkB,aAAa;CAE7C,KAAK,MAAM,QAAQ,OAAO;EACzB,MAAM,UAAU,GAAG,KAAK;EACxB,MAAM,UAAU,GAAG,KAAK,SAAS;GAChC,KAAK;GACL,UAAU;GACV,QAAQ,CAAC,oBAAoB;EAC9B,CAAC;EACD,QAAQ,KAAK,GAAG,OAAO;CACxB;CAEA,OAAO,CAAC,GAAG,IAAI,IAAI,OAAO,CAAC;AAC5B"}
|
package/dist/vitest.cjs
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const require_ready = require("./ready-BpNbORRB.cjs");
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
let node_fs = require("node:fs");
|
|
4
|
+
let node_url = require("node:url");
|
|
5
|
+
let node_child_process = require("node:child_process");
|
|
6
|
+
//#region src/vitest.ts
|
|
7
|
+
/**
|
|
8
|
+
* The Vitest global setup for a gkm project: the test stage, reconciled,
|
|
9
|
+
* migrated and seeded, before any test runs.
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* // vitest.config.ts — the only one
|
|
13
|
+
* export default defineConfig({
|
|
14
|
+
* test: { globalSetup: ['@geekmidas/cli/vitest'] },
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Declared once, at the root, it runs however the suite starts — `gkm test`,
|
|
19
|
+
* plain `vitest`, an editor's runner, a filtered run of one project. Its
|
|
20
|
+
* databases are created, migrated and seeded for every construct at once, so
|
|
21
|
+
* there is no per-project setup to be skipped by a filter — and dropped by the
|
|
22
|
+
* teardown it returns when the suite ends, once, so the next run starts from
|
|
23
|
+
* its migrations rather than from whatever the last one left.
|
|
24
|
+
*/
|
|
25
|
+
/** This package's `gkm`, whichever install of it loaded this file. */
|
|
26
|
+
const GKM = (0, node_path.join)((0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href)), "..", "bin", "gkm.mjs");
|
|
27
|
+
function setup(project) {
|
|
28
|
+
const cwd = process.cwd();
|
|
29
|
+
const readyPath = process.env["GKM_TEST_READY"] ?? prepare(cwd);
|
|
30
|
+
const ready = JSON.parse((0, node_fs.readFileSync)(readyPath, "utf-8"));
|
|
31
|
+
const env = JSON.parse((0, node_fs.readFileSync)(ready.env, "utf-8"));
|
|
32
|
+
Object.assign(process.env, env);
|
|
33
|
+
if (ready.manifest) process.env[require_ready.TEST_MANIFEST_ENV] = ready.manifest;
|
|
34
|
+
project?.onTestsRerun(() => {
|
|
35
|
+
gkm([
|
|
36
|
+
"seed",
|
|
37
|
+
"--stage",
|
|
38
|
+
"test"
|
|
39
|
+
], cwd);
|
|
40
|
+
});
|
|
41
|
+
return () => {
|
|
42
|
+
gkm(["test", "--teardown"], cwd);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function prepare(cwd) {
|
|
46
|
+
gkm(["test", "--setup"], cwd);
|
|
47
|
+
return (0, node_path.join)(cwd, require_ready.TEST_READY_FILE);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Run `gkm` as its own process.
|
|
51
|
+
*
|
|
52
|
+
* Not in this one: discovery imports the project's constructs, with its path
|
|
53
|
+
* aliases, through the loader `gkm` registers for itself — which a module
|
|
54
|
+
* Vite loaded into Vitest does not have.
|
|
55
|
+
*/
|
|
56
|
+
function gkm(args, cwd) {
|
|
57
|
+
(0, node_child_process.execFileSync)(process.execPath, [GKM, ...args], {
|
|
58
|
+
cwd,
|
|
59
|
+
stdio: "inherit"
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
module.exports = setup;
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=vitest.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.cjs","names":["join","dirname","fileURLToPath","readFileSync","TEST_MANIFEST_ENV","TEST_READY_FILE"],"sources":["../src/vitest.ts"],"sourcesContent":["/**\n * The Vitest global setup for a gkm project: the test stage, reconciled,\n * migrated and seeded, before any test runs.\n *\n * ```ts\n * // vitest.config.ts — the only one\n * export default defineConfig({\n * test: { globalSetup: ['@geekmidas/cli/vitest'] },\n * });\n * ```\n *\n * Declared once, at the root, it runs however the suite starts — `gkm test`,\n * plain `vitest`, an editor's runner, a filtered run of one project. Its\n * databases are created, migrated and seeded for every construct at once, so\n * there is no per-project setup to be skipped by a filter — and dropped by the\n * teardown it returns when the suite ends, once, so the next run starts from\n * its migrations rather than from whatever the last one left.\n */\n\nimport { execFileSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { TEST_MANIFEST_ENV } from './test/harness';\nimport { TEST_READY_ENV, TEST_READY_FILE, type TestReady } from './test/ready';\n\n/** This package's `gkm`, whichever install of it loaded this file. */\nconst GKM = join(\n\tdirname(fileURLToPath(import.meta.url)),\n\t'..',\n\t'bin',\n\t'gkm.mjs',\n);\n\n/**\n * What this setup uses of Vitest's `TestProject` — written out rather than\n * imported, so declaring it does not drag Vite's types into this package's.\n */\nexport interface RerunningProject {\n\tonTestsRerun(callback: () => void | Promise<void>): void;\n}\n\nexport default function setup(project?: RerunningProject): () => void {\n\tconst cwd = process.cwd();\n\n\t// `gkm test` did the work before starting Vitest; anything else — plain\n\t// `vitest`, an editor — has it done now, the same way.\n\tconst readyPath = process.env[TEST_READY_ENV] ?? prepare(cwd);\n\tconst ready = JSON.parse(readFileSync(readyPath, 'utf-8')) as TestReady;\n\n\t// Into this process's environment, which every worker Vitest starts after\n\t// this inherits — the URLs an app reads, and where the harness is.\n\tconst env = JSON.parse(readFileSync(ready.env, 'utf-8')) as Record<\n\t\tstring,\n\t\tstring\n\t>;\n\tObject.assign(process.env, env);\n\tif (ready.manifest) process.env[TEST_MANIFEST_ENV] = ready.manifest;\n\n\t// A migration or seed written while watching is applied on the next run,\n\t// rather than waiting for Vitest to be restarted.\n\tproject?.onTestsRerun(() => {\n\t\tgkm(['seed', '--stage', 'test'], cwd);\n\t});\n\n\t// When the suite ends — once, after the last run in watch mode. Every test\n\t// rolled back, so nothing in the databases is anyone's.\n\treturn () => {\n\t\tgkm(['test', '--teardown'], cwd);\n\t};\n}\n\nfunction prepare(cwd: string): string {\n\tgkm(['test', '--setup'], cwd);\n\treturn join(cwd, TEST_READY_FILE);\n}\n\n/**\n * Run `gkm` as its own process.\n *\n * Not in this one: discovery imports the project's constructs, with its path\n * aliases, through the loader `gkm` registers for itself — which a module\n * Vite loaded into Vitest does not have.\n */\nfunction gkm(args: string[], cwd: string): void {\n\texecFileSync(process.execPath, [GKM, ...args], { cwd, stdio: 'inherit' });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,OAAA,GAAMA,UAAAA,KAAAA,EAAAA,GACXC,UAAAA,QAAAA,EAAAA,GAAQC,SAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B,CAAC,GACtC,MACA,OACA,SACD;AAUA,SAAwB,MAAM,SAAwC;CACrE,MAAM,MAAM,QAAQ,IAAI;CAIxB,MAAM,YAAY,QAAQ,IAAA,qBAAuB,QAAQ,GAAG;CAC5D,MAAM,QAAQ,KAAK,OAAA,GAAMC,QAAAA,aAAAA,CAAa,WAAW,OAAO,CAAC;CAIzD,MAAM,MAAM,KAAK,OAAA,GAAMA,QAAAA,aAAAA,CAAa,MAAM,KAAK,OAAO,CAAC;CAIvD,OAAO,OAAO,QAAQ,KAAK,GAAG;CAC9B,IAAI,MAAM,UAAU,QAAQ,IAAIC,cAAAA,qBAAqB,MAAM;CAI3D,SAAS,mBAAmB;EAC3B,IAAI;GAAC;GAAQ;GAAW;EAAM,GAAG,GAAG;CACrC,CAAC;CAID,aAAa;EACZ,IAAI,CAAC,QAAQ,YAAY,GAAG,GAAG;CAChC;AACD;AAEA,SAAS,QAAQ,KAAqB;CACrC,IAAI,CAAC,QAAQ,SAAS,GAAG,GAAG;CAC5B,QAAA,GAAOJ,UAAAA,KAAAA,CAAK,KAAKK,cAAAA,eAAe;AACjC;;;;;;;;AASA,SAAS,IAAI,MAAgB,KAAmB;CAC/C,CAAA,GAAA,mBAAA,aAAA,CAAa,QAAQ,UAAU,CAAC,KAAK,GAAG,IAAI,GAAG;EAAE;EAAK,OAAO;CAAU,CAAC;AACzE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/vitest.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The Vitest global setup for a gkm project: the test stage, reconciled,
|
|
4
|
+
* migrated and seeded, before any test runs.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* // vitest.config.ts — the only one
|
|
8
|
+
* export default defineConfig({
|
|
9
|
+
* test: { globalSetup: ['@geekmidas/cli/vitest'] },
|
|
10
|
+
* });
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* Declared once, at the root, it runs however the suite starts — `gkm test`,
|
|
14
|
+
* plain `vitest`, an editor's runner, a filtered run of one project. Its
|
|
15
|
+
* databases are created, migrated and seeded for every construct at once, so
|
|
16
|
+
* there is no per-project setup to be skipped by a filter — and dropped by the
|
|
17
|
+
* teardown it returns when the suite ends, once, so the next run starts from
|
|
18
|
+
* its migrations rather than from whatever the last one left.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* What this setup uses of Vitest's `TestProject` — written out rather than
|
|
22
|
+
* imported, so declaring it does not drag Vite's types into this package's.
|
|
23
|
+
*/
|
|
24
|
+
export interface RerunningProject {
|
|
25
|
+
onTestsRerun(callback: () => void | Promise<void>): void;
|
|
26
|
+
}
|
|
27
|
+
export default function setup(project?: RerunningProject): () => void;
|
|
28
|
+
//#endregion
|
|
29
|
+
//# sourceMappingURL=vitest.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.d.cts","names":[],"sources":["../src/vitest.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;iBAsCiB;EAChB,aAAa,uBAAuB;;wBAGb,MAAM,UAAU"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/vitest.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The Vitest global setup for a gkm project: the test stage, reconciled,
|
|
4
|
+
* migrated and seeded, before any test runs.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* // vitest.config.ts — the only one
|
|
8
|
+
* export default defineConfig({
|
|
9
|
+
* test: { globalSetup: ['@geekmidas/cli/vitest'] },
|
|
10
|
+
* });
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* Declared once, at the root, it runs however the suite starts — `gkm test`,
|
|
14
|
+
* plain `vitest`, an editor's runner, a filtered run of one project. Its
|
|
15
|
+
* databases are created, migrated and seeded for every construct at once, so
|
|
16
|
+
* there is no per-project setup to be skipped by a filter — and dropped by the
|
|
17
|
+
* teardown it returns when the suite ends, once, so the next run starts from
|
|
18
|
+
* its migrations rather than from whatever the last one left.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* What this setup uses of Vitest's `TestProject` — written out rather than
|
|
22
|
+
* imported, so declaring it does not drag Vite's types into this package's.
|
|
23
|
+
*/
|
|
24
|
+
export interface RerunningProject {
|
|
25
|
+
onTestsRerun(callback: () => void | Promise<void>): void;
|
|
26
|
+
}
|
|
27
|
+
export default function setup(project?: RerunningProject): () => void;
|
|
28
|
+
//#endregion
|
|
29
|
+
//# sourceMappingURL=vitest.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.d.mts","names":[],"sources":["../src/vitest.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;iBAsCiB;EAChB,aAAa,uBAAuB;;wBAGb,MAAM,UAAU"}
|
package/dist/vitest.mjs
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { i as TEST_MANIFEST_ENV, n as TEST_READY_FILE } from "./ready-b6vm0-W-.mjs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { execFileSync } from "node:child_process";
|
|
6
|
+
//#region src/vitest.ts
|
|
7
|
+
/**
|
|
8
|
+
* The Vitest global setup for a gkm project: the test stage, reconciled,
|
|
9
|
+
* migrated and seeded, before any test runs.
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* // vitest.config.ts — the only one
|
|
13
|
+
* export default defineConfig({
|
|
14
|
+
* test: { globalSetup: ['@geekmidas/cli/vitest'] },
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Declared once, at the root, it runs however the suite starts — `gkm test`,
|
|
19
|
+
* plain `vitest`, an editor's runner, a filtered run of one project. Its
|
|
20
|
+
* databases are created, migrated and seeded for every construct at once, so
|
|
21
|
+
* there is no per-project setup to be skipped by a filter — and dropped by the
|
|
22
|
+
* teardown it returns when the suite ends, once, so the next run starts from
|
|
23
|
+
* its migrations rather than from whatever the last one left.
|
|
24
|
+
*/
|
|
25
|
+
/** This package's `gkm`, whichever install of it loaded this file. */
|
|
26
|
+
const GKM = join(dirname(fileURLToPath(import.meta.url)), "..", "bin", "gkm.mjs");
|
|
27
|
+
function setup(project) {
|
|
28
|
+
const cwd = process.cwd();
|
|
29
|
+
const readyPath = process.env["GKM_TEST_READY"] ?? prepare(cwd);
|
|
30
|
+
const ready = JSON.parse(readFileSync(readyPath, "utf-8"));
|
|
31
|
+
const env = JSON.parse(readFileSync(ready.env, "utf-8"));
|
|
32
|
+
Object.assign(process.env, env);
|
|
33
|
+
if (ready.manifest) process.env[TEST_MANIFEST_ENV] = ready.manifest;
|
|
34
|
+
project?.onTestsRerun(() => {
|
|
35
|
+
gkm([
|
|
36
|
+
"seed",
|
|
37
|
+
"--stage",
|
|
38
|
+
"test"
|
|
39
|
+
], cwd);
|
|
40
|
+
});
|
|
41
|
+
return () => {
|
|
42
|
+
gkm(["test", "--teardown"], cwd);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function prepare(cwd) {
|
|
46
|
+
gkm(["test", "--setup"], cwd);
|
|
47
|
+
return join(cwd, TEST_READY_FILE);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Run `gkm` as its own process.
|
|
51
|
+
*
|
|
52
|
+
* Not in this one: discovery imports the project's constructs, with its path
|
|
53
|
+
* aliases, through the loader `gkm` registers for itself — which a module
|
|
54
|
+
* Vite loaded into Vitest does not have.
|
|
55
|
+
*/
|
|
56
|
+
function gkm(args, cwd) {
|
|
57
|
+
execFileSync(process.execPath, [GKM, ...args], {
|
|
58
|
+
cwd,
|
|
59
|
+
stdio: "inherit"
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { setup as default };
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=vitest.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.mjs","names":[],"sources":["../src/vitest.ts"],"sourcesContent":["/**\n * The Vitest global setup for a gkm project: the test stage, reconciled,\n * migrated and seeded, before any test runs.\n *\n * ```ts\n * // vitest.config.ts — the only one\n * export default defineConfig({\n * test: { globalSetup: ['@geekmidas/cli/vitest'] },\n * });\n * ```\n *\n * Declared once, at the root, it runs however the suite starts — `gkm test`,\n * plain `vitest`, an editor's runner, a filtered run of one project. Its\n * databases are created, migrated and seeded for every construct at once, so\n * there is no per-project setup to be skipped by a filter — and dropped by the\n * teardown it returns when the suite ends, once, so the next run starts from\n * its migrations rather than from whatever the last one left.\n */\n\nimport { execFileSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { TEST_MANIFEST_ENV } from './test/harness';\nimport { TEST_READY_ENV, TEST_READY_FILE, type TestReady } from './test/ready';\n\n/** This package's `gkm`, whichever install of it loaded this file. */\nconst GKM = join(\n\tdirname(fileURLToPath(import.meta.url)),\n\t'..',\n\t'bin',\n\t'gkm.mjs',\n);\n\n/**\n * What this setup uses of Vitest's `TestProject` — written out rather than\n * imported, so declaring it does not drag Vite's types into this package's.\n */\nexport interface RerunningProject {\n\tonTestsRerun(callback: () => void | Promise<void>): void;\n}\n\nexport default function setup(project?: RerunningProject): () => void {\n\tconst cwd = process.cwd();\n\n\t// `gkm test` did the work before starting Vitest; anything else — plain\n\t// `vitest`, an editor — has it done now, the same way.\n\tconst readyPath = process.env[TEST_READY_ENV] ?? prepare(cwd);\n\tconst ready = JSON.parse(readFileSync(readyPath, 'utf-8')) as TestReady;\n\n\t// Into this process's environment, which every worker Vitest starts after\n\t// this inherits — the URLs an app reads, and where the harness is.\n\tconst env = JSON.parse(readFileSync(ready.env, 'utf-8')) as Record<\n\t\tstring,\n\t\tstring\n\t>;\n\tObject.assign(process.env, env);\n\tif (ready.manifest) process.env[TEST_MANIFEST_ENV] = ready.manifest;\n\n\t// A migration or seed written while watching is applied on the next run,\n\t// rather than waiting for Vitest to be restarted.\n\tproject?.onTestsRerun(() => {\n\t\tgkm(['seed', '--stage', 'test'], cwd);\n\t});\n\n\t// When the suite ends — once, after the last run in watch mode. Every test\n\t// rolled back, so nothing in the databases is anyone's.\n\treturn () => {\n\t\tgkm(['test', '--teardown'], cwd);\n\t};\n}\n\nfunction prepare(cwd: string): string {\n\tgkm(['test', '--setup'], cwd);\n\treturn join(cwd, TEST_READY_FILE);\n}\n\n/**\n * Run `gkm` as its own process.\n *\n * Not in this one: discovery imports the project's constructs, with its path\n * aliases, through the loader `gkm` registers for itself — which a module\n * Vite loaded into Vitest does not have.\n */\nfunction gkm(args: string[], cwd: string): void {\n\texecFileSync(process.execPath, [GKM, ...args], { cwd, stdio: 'inherit' });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,MAAM,KACX,QAAQ,cAAc,YAAY,GAAG,CAAC,GACtC,MACA,OACA,SACD;AAUA,SAAwB,MAAM,SAAwC;CACrE,MAAM,MAAM,QAAQ,IAAI;CAIxB,MAAM,YAAY,QAAQ,IAAA,qBAAuB,QAAQ,GAAG;CAC5D,MAAM,QAAQ,KAAK,MAAM,aAAa,WAAW,OAAO,CAAC;CAIzD,MAAM,MAAM,KAAK,MAAM,aAAa,MAAM,KAAK,OAAO,CAAC;CAIvD,OAAO,OAAO,QAAQ,KAAK,GAAG;CAC9B,IAAI,MAAM,UAAU,QAAQ,IAAI,qBAAqB,MAAM;CAI3D,SAAS,mBAAmB;EAC3B,IAAI;GAAC;GAAQ;GAAW;EAAM,GAAG,GAAG;CACrC,CAAC;CAID,aAAa;EACZ,IAAI,CAAC,QAAQ,YAAY,GAAG,GAAG;CAChC;AACD;AAEA,SAAS,QAAQ,KAAqB;CACrC,IAAI,CAAC,QAAQ,SAAS,GAAG,GAAG;CAC5B,OAAO,KAAK,KAAK,eAAe;AACjC;;;;;;;;AASA,SAAS,IAAI,MAAgB,KAAmB;CAC/C,aAAa,QAAQ,UAAU,CAAC,KAAK,GAAG,IAAI,GAAG;EAAE;EAAK,OAAO;CAAU,CAAC;AACzE"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
let node_path = require("node:path");
|
|
2
|
+
let node_fs = require("node:fs");
|
|
3
|
+
let node_url = require("node:url");
|
|
4
|
+
//#region src/sandbox/workerRuntime.ts
|
|
5
|
+
/**
|
|
6
|
+
* What a worker script needs on its side of the sandbox: to answer, to say
|
|
7
|
+
* what would not cross as data, and to resolve the project's path aliases the
|
|
8
|
+
* way `gkm` does.
|
|
9
|
+
*
|
|
10
|
+
* Kept apart from `worker.ts`, which the host runs, so a worker loads nothing
|
|
11
|
+
* of the host's side.
|
|
12
|
+
*/
|
|
13
|
+
/** The line prefix a worker's answer is written after, on stdout. */
|
|
14
|
+
const WORKER_RESULT_MARKER = "@@gkm-worker-result@@";
|
|
15
|
+
/**
|
|
16
|
+
* Write a worker's answer, and end the worker once it is out.
|
|
17
|
+
*
|
|
18
|
+
* Exiting rather than returning: the project's code may have left a server, a
|
|
19
|
+
* timer or a connection open, and the answer is all the deploy waits for. The
|
|
20
|
+
* callback, because a pipe on macOS is written asynchronously and an exit
|
|
21
|
+
* before it drains would cut the answer short.
|
|
22
|
+
*/
|
|
23
|
+
function answer(value) {
|
|
24
|
+
process.stdout.write(`${WORKER_RESULT_MARKER}${JSON.stringify(value)}\n`, () => process.exit(0));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Where in `value` something is that JSON cannot carry faithfully: a
|
|
28
|
+
* function, a class instance, a symbol, a bigint, a `Date`, a `Map` — as
|
|
29
|
+
* paths like `state.provider` or `apps.api.hooks[0]`.
|
|
30
|
+
*
|
|
31
|
+
* `JSON.stringify` drops a function silently and turns a store into `{}`, so a
|
|
32
|
+
* config that crossed it would arrive *different* rather than refused.
|
|
33
|
+
*/
|
|
34
|
+
function liveValuePaths(value, path = "") {
|
|
35
|
+
if (value === null) return [];
|
|
36
|
+
switch (typeof value) {
|
|
37
|
+
case "string":
|
|
38
|
+
case "boolean":
|
|
39
|
+
case "undefined": return [];
|
|
40
|
+
case "number": return Number.isFinite(value) ? [] : [path || "(root)"];
|
|
41
|
+
case "object": break;
|
|
42
|
+
default: return [path || "(root)"];
|
|
43
|
+
}
|
|
44
|
+
if (Array.isArray(value)) return value.flatMap((item, index) => liveValuePaths(item, `${path}[${index}]`));
|
|
45
|
+
const proto = Object.getPrototypeOf(value);
|
|
46
|
+
if (proto !== Object.prototype && proto !== null) return [path || "(root)"];
|
|
47
|
+
return Object.entries(value).flatMap(([key, item]) => liveValuePaths(item, path ? `${path}.${key}` : key));
|
|
48
|
+
}
|
|
49
|
+
/** An error, as plain data a host can rebuild a message from. */
|
|
50
|
+
function errorData(error) {
|
|
51
|
+
if (!(error instanceof Error)) return {
|
|
52
|
+
name: "Error",
|
|
53
|
+
message: String(error)
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
...Object.fromEntries(Object.entries(error).filter(([, v]) => liveValuePaths(v).length === 0)),
|
|
57
|
+
name: error.name,
|
|
58
|
+
message: error.message
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Resolve each module's path aliases through its own tsconfig, as `gkm` does
|
|
63
|
+
* — the hook ships beside `bin/gkm.mjs`. Without it a construct importing
|
|
64
|
+
* `~/db` resolves in `gkm dev` and not in a deploy.
|
|
65
|
+
*/
|
|
66
|
+
async function registerAdjacentTsconfig() {
|
|
67
|
+
for (let dir = (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href)); (0, node_path.dirname)(dir) !== dir; dir = (0, node_path.dirname)(dir)) {
|
|
68
|
+
const hook = (0, node_path.join)(dir, "bin", "adjacent-tsconfig.mjs");
|
|
69
|
+
if ((0, node_fs.existsSync)(hook)) {
|
|
70
|
+
const { registerAdjacentTsconfig: register } = await import((0, node_url.pathToFileURL)(hook).href);
|
|
71
|
+
await register();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
Object.defineProperty(exports, "WORKER_RESULT_MARKER", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function() {
|
|
80
|
+
return WORKER_RESULT_MARKER;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
Object.defineProperty(exports, "answer", {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
get: function() {
|
|
86
|
+
return answer;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(exports, "errorData", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
get: function() {
|
|
92
|
+
return errorData;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
Object.defineProperty(exports, "liveValuePaths", {
|
|
96
|
+
enumerable: true,
|
|
97
|
+
get: function() {
|
|
98
|
+
return liveValuePaths;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(exports, "registerAdjacentTsconfig", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function() {
|
|
104
|
+
return registerAdjacentTsconfig;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=workerRuntime-BXfhbe13.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workerRuntime-BXfhbe13.cjs","names":["dirname","fileURLToPath","join","existsSync","pathToFileURL"],"sources":["../src/sandbox/workerRuntime.ts"],"sourcesContent":["/**\n * What a worker script needs on its side of the sandbox: to answer, to say\n * what would not cross as data, and to resolve the project's path aliases the\n * way `gkm` does.\n *\n * Kept apart from `worker.ts`, which the host runs, so a worker loads nothing\n * of the host's side.\n */\n\nimport { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\n/** The line prefix a worker's answer is written after, on stdout. */\nexport const WORKER_RESULT_MARKER = '@@gkm-worker-result@@';\n\n/**\n * Write a worker's answer, and end the worker once it is out.\n *\n * Exiting rather than returning: the project's code may have left a server, a\n * timer or a connection open, and the answer is all the deploy waits for. The\n * callback, because a pipe on macOS is written asynchronously and an exit\n * before it drains would cut the answer short.\n */\nexport function answer(value: unknown): void {\n\tprocess.stdout.write(\n\t\t`${WORKER_RESULT_MARKER}${JSON.stringify(value)}\\n`,\n\t\t() => process.exit(0),\n\t);\n}\n\n/**\n * Where in `value` something is that JSON cannot carry faithfully: a\n * function, a class instance, a symbol, a bigint, a `Date`, a `Map` — as\n * paths like `state.provider` or `apps.api.hooks[0]`.\n *\n * `JSON.stringify` drops a function silently and turns a store into `{}`, so a\n * config that crossed it would arrive *different* rather than refused.\n */\nexport function liveValuePaths(value: unknown, path = ''): string[] {\n\tif (value === null) return [];\n\tswitch (typeof value) {\n\t\tcase 'string':\n\t\tcase 'boolean':\n\t\tcase 'undefined':\n\t\t\treturn [];\n\t\tcase 'number':\n\t\t\treturn Number.isFinite(value) ? [] : [path || '(root)'];\n\t\tcase 'object':\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn [path || '(root)'];\n\t}\n\n\tif (Array.isArray(value)) {\n\t\treturn value.flatMap((item, index) =>\n\t\t\tliveValuePaths(item, `${path}[${index}]`),\n\t\t);\n\t}\n\n\tconst proto = Object.getPrototypeOf(value);\n\tif (proto !== Object.prototype && proto !== null) return [path || '(root)'];\n\n\treturn Object.entries(value as Record<string, unknown>).flatMap(\n\t\t([key, item]) => liveValuePaths(item, path ? `${path}.${key}` : key),\n\t);\n}\n\n/** An error, as plain data a host can rebuild a message from. */\nexport function errorData(error: unknown): {\n\tname: string;\n\tmessage: string;\n\t[field: string]: unknown;\n} {\n\tif (!(error instanceof Error))\n\t\treturn { name: 'Error', message: String(error) };\n\tconst fields = Object.fromEntries(\n\t\tObject.entries(error).filter(([, v]) => liveValuePaths(v).length === 0),\n\t);\n\treturn { ...fields, name: error.name, message: error.message };\n}\n\n/**\n * Resolve each module's path aliases through its own tsconfig, as `gkm` does\n * — the hook ships beside `bin/gkm.mjs`. Without it a construct importing\n * `~/db` resolves in `gkm dev` and not in a deploy.\n */\nexport async function registerAdjacentTsconfig(): Promise<void> {\n\tfor (\n\t\tlet dir = dirname(fileURLToPath(import.meta.url));\n\t\tdirname(dir) !== dir;\n\t\tdir = dirname(dir)\n\t) {\n\t\tconst hook = join(dir, 'bin', 'adjacent-tsconfig.mjs');\n\t\tif (existsSync(hook)) {\n\t\t\tconst { registerAdjacentTsconfig: register } = await import(\n\t\t\t\tpathToFileURL(hook).href\n\t\t\t);\n\t\t\tawait register();\n\t\t\treturn;\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,uBAAuB;;;;;;;;;AAUpC,SAAgB,OAAO,OAAsB;CAC5C,QAAQ,OAAO,MACd,GAAG,uBAAuB,KAAK,UAAU,KAAK,EAAE,WAC1C,QAAQ,KAAK,CAAC,CACrB;AACD;;;;;;;;;AAUA,SAAgB,eAAe,OAAgB,OAAO,IAAc;CACnE,IAAI,UAAU,MAAM,OAAO,CAAC;CAC5B,QAAQ,OAAO,OAAf;EACC,KAAK;EACL,KAAK;EACL,KAAK,aACJ,OAAO,CAAC;EACT,KAAK,UACJ,OAAO,OAAO,SAAS,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,QAAQ;EACvD,KAAK,UACJ;EACD,SACC,OAAO,CAAC,QAAQ,QAAQ;CAC1B;CAEA,IAAI,MAAM,QAAQ,KAAK,GACtB,OAAO,MAAM,SAAS,MAAM,UAC3B,eAAe,MAAM,GAAG,KAAK,GAAG,MAAM,EAAE,CACzC;CAGD,MAAM,QAAQ,OAAO,eAAe,KAAK;CACzC,IAAI,UAAU,OAAO,aAAa,UAAU,MAAM,OAAO,CAAC,QAAQ,QAAQ;CAE1E,OAAO,OAAO,QAAQ,KAAgC,CAAC,CAAC,SACtD,CAAC,KAAK,UAAU,eAAe,MAAM,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,CACpE;AACD;;AAGA,SAAgB,UAAU,OAIxB;CACD,IAAI,EAAE,iBAAiB,QACtB,OAAO;EAAE,MAAM;EAAS,SAAS,OAAO,KAAK;CAAE;CAIhD,OAAO;EAAE,GAHM,OAAO,YACrB,OAAO,QAAQ,KAAK,CAAC,CAAC,QAAQ,GAAG,OAAO,eAAe,CAAC,CAAC,CAAC,WAAW,CAAC,CAEtD;EAAG,MAAM,MAAM;EAAM,SAAS,MAAM;CAAQ;AAC9D;;;;;;AAOA,eAAsB,2BAA0C;CAC/D,KACC,IAAI,OAAA,GAAMA,UAAAA,QAAAA,EAAAA,GAAQC,SAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B,CAAC,IAAA,GAChDD,UAAAA,QAAAA,CAAQ,GAAG,MAAM,KACjB,OAAA,GAAMA,UAAAA,QAAAA,CAAQ,GAAG,GAChB;EACD,MAAM,QAAA,GAAOE,UAAAA,KAAAA,CAAK,KAAK,OAAO,uBAAuB;EACrD,KAAA,GAAIC,QAAAA,WAAAA,CAAW,IAAI,GAAG;GACrB,MAAM,EAAE,0BAA0B,aAAa,MAAM,QAAA,GACpDC,SAAAA,cAAAA,CAAc,IAAI,CAAC,CAAC;GAErB,MAAM,SAAS;GACf;EACD;CACD;AACD"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { dirname, join } from "node:path";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
4
|
+
//#region src/sandbox/workerRuntime.ts
|
|
5
|
+
/**
|
|
6
|
+
* What a worker script needs on its side of the sandbox: to answer, to say
|
|
7
|
+
* what would not cross as data, and to resolve the project's path aliases the
|
|
8
|
+
* way `gkm` does.
|
|
9
|
+
*
|
|
10
|
+
* Kept apart from `worker.ts`, which the host runs, so a worker loads nothing
|
|
11
|
+
* of the host's side.
|
|
12
|
+
*/
|
|
13
|
+
/** The line prefix a worker's answer is written after, on stdout. */
|
|
14
|
+
const WORKER_RESULT_MARKER = "@@gkm-worker-result@@";
|
|
15
|
+
/**
|
|
16
|
+
* Write a worker's answer, and end the worker once it is out.
|
|
17
|
+
*
|
|
18
|
+
* Exiting rather than returning: the project's code may have left a server, a
|
|
19
|
+
* timer or a connection open, and the answer is all the deploy waits for. The
|
|
20
|
+
* callback, because a pipe on macOS is written asynchronously and an exit
|
|
21
|
+
* before it drains would cut the answer short.
|
|
22
|
+
*/
|
|
23
|
+
function answer(value) {
|
|
24
|
+
process.stdout.write(`${WORKER_RESULT_MARKER}${JSON.stringify(value)}\n`, () => process.exit(0));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Where in `value` something is that JSON cannot carry faithfully: a
|
|
28
|
+
* function, a class instance, a symbol, a bigint, a `Date`, a `Map` — as
|
|
29
|
+
* paths like `state.provider` or `apps.api.hooks[0]`.
|
|
30
|
+
*
|
|
31
|
+
* `JSON.stringify` drops a function silently and turns a store into `{}`, so a
|
|
32
|
+
* config that crossed it would arrive *different* rather than refused.
|
|
33
|
+
*/
|
|
34
|
+
function liveValuePaths(value, path = "") {
|
|
35
|
+
if (value === null) return [];
|
|
36
|
+
switch (typeof value) {
|
|
37
|
+
case "string":
|
|
38
|
+
case "boolean":
|
|
39
|
+
case "undefined": return [];
|
|
40
|
+
case "number": return Number.isFinite(value) ? [] : [path || "(root)"];
|
|
41
|
+
case "object": break;
|
|
42
|
+
default: return [path || "(root)"];
|
|
43
|
+
}
|
|
44
|
+
if (Array.isArray(value)) return value.flatMap((item, index) => liveValuePaths(item, `${path}[${index}]`));
|
|
45
|
+
const proto = Object.getPrototypeOf(value);
|
|
46
|
+
if (proto !== Object.prototype && proto !== null) return [path || "(root)"];
|
|
47
|
+
return Object.entries(value).flatMap(([key, item]) => liveValuePaths(item, path ? `${path}.${key}` : key));
|
|
48
|
+
}
|
|
49
|
+
/** An error, as plain data a host can rebuild a message from. */
|
|
50
|
+
function errorData(error) {
|
|
51
|
+
if (!(error instanceof Error)) return {
|
|
52
|
+
name: "Error",
|
|
53
|
+
message: String(error)
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
...Object.fromEntries(Object.entries(error).filter(([, v]) => liveValuePaths(v).length === 0)),
|
|
57
|
+
name: error.name,
|
|
58
|
+
message: error.message
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Resolve each module's path aliases through its own tsconfig, as `gkm` does
|
|
63
|
+
* — the hook ships beside `bin/gkm.mjs`. Without it a construct importing
|
|
64
|
+
* `~/db` resolves in `gkm dev` and not in a deploy.
|
|
65
|
+
*/
|
|
66
|
+
async function registerAdjacentTsconfig() {
|
|
67
|
+
for (let dir = dirname(fileURLToPath(import.meta.url)); dirname(dir) !== dir; dir = dirname(dir)) {
|
|
68
|
+
const hook = join(dir, "bin", "adjacent-tsconfig.mjs");
|
|
69
|
+
if (existsSync(hook)) {
|
|
70
|
+
const { registerAdjacentTsconfig: register } = await import(pathToFileURL(hook).href);
|
|
71
|
+
await register();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
export { registerAdjacentTsconfig as a, liveValuePaths as i, answer as n, errorData as r, WORKER_RESULT_MARKER as t };
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=workerRuntime-CsOyBRx2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workerRuntime-CsOyBRx2.mjs","names":[],"sources":["../src/sandbox/workerRuntime.ts"],"sourcesContent":["/**\n * What a worker script needs on its side of the sandbox: to answer, to say\n * what would not cross as data, and to resolve the project's path aliases the\n * way `gkm` does.\n *\n * Kept apart from `worker.ts`, which the host runs, so a worker loads nothing\n * of the host's side.\n */\n\nimport { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\n/** The line prefix a worker's answer is written after, on stdout. */\nexport const WORKER_RESULT_MARKER = '@@gkm-worker-result@@';\n\n/**\n * Write a worker's answer, and end the worker once it is out.\n *\n * Exiting rather than returning: the project's code may have left a server, a\n * timer or a connection open, and the answer is all the deploy waits for. The\n * callback, because a pipe on macOS is written asynchronously and an exit\n * before it drains would cut the answer short.\n */\nexport function answer(value: unknown): void {\n\tprocess.stdout.write(\n\t\t`${WORKER_RESULT_MARKER}${JSON.stringify(value)}\\n`,\n\t\t() => process.exit(0),\n\t);\n}\n\n/**\n * Where in `value` something is that JSON cannot carry faithfully: a\n * function, a class instance, a symbol, a bigint, a `Date`, a `Map` — as\n * paths like `state.provider` or `apps.api.hooks[0]`.\n *\n * `JSON.stringify` drops a function silently and turns a store into `{}`, so a\n * config that crossed it would arrive *different* rather than refused.\n */\nexport function liveValuePaths(value: unknown, path = ''): string[] {\n\tif (value === null) return [];\n\tswitch (typeof value) {\n\t\tcase 'string':\n\t\tcase 'boolean':\n\t\tcase 'undefined':\n\t\t\treturn [];\n\t\tcase 'number':\n\t\t\treturn Number.isFinite(value) ? [] : [path || '(root)'];\n\t\tcase 'object':\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn [path || '(root)'];\n\t}\n\n\tif (Array.isArray(value)) {\n\t\treturn value.flatMap((item, index) =>\n\t\t\tliveValuePaths(item, `${path}[${index}]`),\n\t\t);\n\t}\n\n\tconst proto = Object.getPrototypeOf(value);\n\tif (proto !== Object.prototype && proto !== null) return [path || '(root)'];\n\n\treturn Object.entries(value as Record<string, unknown>).flatMap(\n\t\t([key, item]) => liveValuePaths(item, path ? `${path}.${key}` : key),\n\t);\n}\n\n/** An error, as plain data a host can rebuild a message from. */\nexport function errorData(error: unknown): {\n\tname: string;\n\tmessage: string;\n\t[field: string]: unknown;\n} {\n\tif (!(error instanceof Error))\n\t\treturn { name: 'Error', message: String(error) };\n\tconst fields = Object.fromEntries(\n\t\tObject.entries(error).filter(([, v]) => liveValuePaths(v).length === 0),\n\t);\n\treturn { ...fields, name: error.name, message: error.message };\n}\n\n/**\n * Resolve each module's path aliases through its own tsconfig, as `gkm` does\n * — the hook ships beside `bin/gkm.mjs`. Without it a construct importing\n * `~/db` resolves in `gkm dev` and not in a deploy.\n */\nexport async function registerAdjacentTsconfig(): Promise<void> {\n\tfor (\n\t\tlet dir = dirname(fileURLToPath(import.meta.url));\n\t\tdirname(dir) !== dir;\n\t\tdir = dirname(dir)\n\t) {\n\t\tconst hook = join(dir, 'bin', 'adjacent-tsconfig.mjs');\n\t\tif (existsSync(hook)) {\n\t\t\tconst { registerAdjacentTsconfig: register } = await import(\n\t\t\t\tpathToFileURL(hook).href\n\t\t\t);\n\t\t\tawait register();\n\t\t\treturn;\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,uBAAuB;;;;;;;;;AAUpC,SAAgB,OAAO,OAAsB;CAC5C,QAAQ,OAAO,MACd,GAAG,uBAAuB,KAAK,UAAU,KAAK,EAAE,WAC1C,QAAQ,KAAK,CAAC,CACrB;AACD;;;;;;;;;AAUA,SAAgB,eAAe,OAAgB,OAAO,IAAc;CACnE,IAAI,UAAU,MAAM,OAAO,CAAC;CAC5B,QAAQ,OAAO,OAAf;EACC,KAAK;EACL,KAAK;EACL,KAAK,aACJ,OAAO,CAAC;EACT,KAAK,UACJ,OAAO,OAAO,SAAS,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,QAAQ;EACvD,KAAK,UACJ;EACD,SACC,OAAO,CAAC,QAAQ,QAAQ;CAC1B;CAEA,IAAI,MAAM,QAAQ,KAAK,GACtB,OAAO,MAAM,SAAS,MAAM,UAC3B,eAAe,MAAM,GAAG,KAAK,GAAG,MAAM,EAAE,CACzC;CAGD,MAAM,QAAQ,OAAO,eAAe,KAAK;CACzC,IAAI,UAAU,OAAO,aAAa,UAAU,MAAM,OAAO,CAAC,QAAQ,QAAQ;CAE1E,OAAO,OAAO,QAAQ,KAAgC,CAAC,CAAC,SACtD,CAAC,KAAK,UAAU,eAAe,MAAM,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,CACpE;AACD;;AAGA,SAAgB,UAAU,OAIxB;CACD,IAAI,EAAE,iBAAiB,QACtB,OAAO;EAAE,MAAM;EAAS,SAAS,OAAO,KAAK;CAAE;CAIhD,OAAO;EAAE,GAHM,OAAO,YACrB,OAAO,QAAQ,KAAK,CAAC,CAAC,QAAQ,GAAG,OAAO,eAAe,CAAC,CAAC,CAAC,WAAW,CAAC,CAEtD;EAAG,MAAM,MAAM;EAAM,SAAS,MAAM;CAAQ;AAC9D;;;;;;AAOA,eAAsB,2BAA0C;CAC/D,KACC,IAAI,MAAM,QAAQ,cAAc,YAAY,GAAG,CAAC,GAChD,QAAQ,GAAG,MAAM,KACjB,MAAM,QAAQ,GAAG,GAChB;EACD,MAAM,OAAO,KAAK,KAAK,OAAO,uBAAuB;EACrD,IAAI,WAAW,IAAI,GAAG;GACrB,MAAM,EAAE,0BAA0B,aAAa,MAAM,OACpD,cAAc,IAAI,CAAC,CAAC;GAErB,MAAM,SAAS;GACf;EACD;CACD;AACD"}
|
package/dist/workspace/index.cjs
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_workspace = require("../workspace-CwW3Gkru.cjs");
|
|
3
|
+
exports.DnsMoved = require_workspace.DnsMoved;
|
|
4
|
+
exports.DokployRegistryMoved = require_workspace.DokployRegistryMoved;
|
|
5
|
+
exports.DomainsMoved = require_workspace.DomainsMoved;
|
|
6
|
+
exports.InvalidWorkspaceConfig = require_workspace.InvalidWorkspaceConfig;
|
|
3
7
|
exports.PHASE_2_DEPLOY_TARGETS = require_workspace.PHASE_2_DEPLOY_TARGETS;
|
|
4
8
|
exports.PUBLIC_ENV_PREFIXES = require_workspace.PUBLIC_ENV_PREFIXES;
|
|
5
9
|
exports.SUPPORTED_DEPLOY_TARGETS = require_workspace.SUPPORTED_DEPLOY_TARGETS;
|
|
6
10
|
exports.WorkspaceConfigSchema = require_workspace.WorkspaceConfigSchema;
|
|
7
11
|
exports.allConstructGlobs = require_workspace.allConstructGlobs;
|
|
8
12
|
exports.appConstructGlobs = require_workspace.appConstructGlobs;
|
|
13
|
+
exports.assertNoMovedDeployKeys = require_workspace.assertNoMovedDeployKeys;
|
|
9
14
|
exports.constructPatterns = require_workspace.constructPatterns;
|
|
10
15
|
exports.defineWorkspace = require_workspace.defineWorkspace;
|
|
11
16
|
exports.formatValidationErrors = require_workspace.formatValidationErrors;
|
|
12
17
|
exports.getAppBuildOrder = require_workspace.getAppBuildOrder;
|
|
13
18
|
exports.getAppGkmConfig = require_workspace.getAppGkmConfig;
|
|
14
|
-
exports.getDependencyEnvVars = require_workspace.getDependencyEnvVars;
|
|
15
19
|
exports.getDeployTargetError = require_workspace.getDeployTargetError;
|
|
16
20
|
exports.getEndpointForStage = require_workspace.getEndpointForStage;
|
|
17
21
|
exports.getPublicEnvPrefix = require_workspace.getPublicEnvPrefix;
|
|
@@ -24,4 +28,4 @@ exports.safeValidateWorkspaceConfig = require_workspace.safeValidateWorkspaceCon
|
|
|
24
28
|
exports.stripPublicPrefix = require_workspace.stripPublicPrefix;
|
|
25
29
|
exports.validateWorkspaceConfig = require_workspace.validateWorkspaceConfig;
|
|
26
30
|
exports.workspaceConstructGlobs = require_workspace.workspaceConstructGlobs;
|
|
27
|
-
exports.wrapSingleAppAsWorkspace = require_workspace.wrapSingleAppAsWorkspace;
|
|
31
|
+
exports.wrapSingleAppAsWorkspace = require_workspace.wrapSingleAppAsWorkspace;
|