@geekmidas/cli 10.0.0-alpha.116 → 10.0.0-alpha.118
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 +7 -2
- package/dist/{GoDaddyProvider-BDvIMTO-.cjs → GoDaddyProvider-B6SPHBCU.cjs} +2 -2
- package/dist/{GoDaddyProvider-BDvIMTO-.cjs.map → GoDaddyProvider-B6SPHBCU.cjs.map} +1 -1
- package/dist/{GoDaddyProvider-eW1mre1g.mjs → GoDaddyProvider-CcjbFkLt.mjs} +2 -2
- package/dist/{GoDaddyProvider-eW1mre1g.mjs.map → GoDaddyProvider-CcjbFkLt.mjs.map} +1 -1
- package/dist/{LegacyStateStore-DFeykTd8.cjs → LegacyStateStore-2l5jw_VI.cjs} +3 -3
- package/dist/{LegacyStateStore-DFeykTd8.cjs.map → LegacyStateStore-2l5jw_VI.cjs.map} +1 -1
- package/dist/{LegacyStateStore-Ba1_x0cr.mjs → LegacyStateStore-D-D6r_JT.mjs} +3 -3
- package/dist/{LegacyStateStore-Ba1_x0cr.mjs.map → LegacyStateStore-D-D6r_JT.mjs.map} +1 -1
- package/dist/{LocalStateStore-C1rUUvBr.mjs → LocalStateStore-DIAY7j1O.mjs} +2 -2
- package/dist/{LocalStateStore-C1rUUvBr.mjs.map → LocalStateStore-DIAY7j1O.mjs.map} +1 -1
- package/dist/{LocalStateStore-CV-04jpI.cjs → LocalStateStore-Dg3rvwwe.cjs} +2 -2
- package/dist/{LocalStateStore-CV-04jpI.cjs.map → LocalStateStore-Dg3rvwwe.cjs.map} +1 -1
- package/dist/{S3StateStore-Dszt4fN5.mjs → S3StateStore-BKi1eamw.mjs} +2 -2
- package/dist/{S3StateStore-Dszt4fN5.mjs.map → S3StateStore-BKi1eamw.mjs.map} +1 -1
- package/dist/{S3StateStore-CqYi-1sb.cjs → S3StateStore-BdcgQNhO.cjs} +2 -2
- package/dist/{S3StateStore-CqYi-1sb.cjs.map → S3StateStore-BdcgQNhO.cjs.map} +1 -1
- package/dist/{SSMStateStore-zpHjDCAW.cjs → SSMStateStore-CS-pAKT9.cjs} +2 -2
- package/dist/{SSMStateStore-zpHjDCAW.cjs.map → SSMStateStore-CS-pAKT9.cjs.map} +1 -1
- package/dist/{SSMStateStore-BYRUyMkE.mjs → SSMStateStore-DHgaNW75.mjs} +2 -2
- package/dist/{SSMStateStore-BYRUyMkE.mjs.map → SSMStateStore-DHgaNW75.mjs.map} +1 -1
- package/dist/{add-0XI8_HOf.cjs → add-6VPdRbRT.cjs} +3 -3
- package/dist/{add-0XI8_HOf.cjs.map → add-6VPdRbRT.cjs.map} +1 -1
- package/dist/{add-DXdJjp0b.mjs → add-BcZXHa3Z.mjs} +3 -3
- package/dist/{add-DXdJjp0b.mjs.map → add-BcZXHa3Z.mjs.map} +1 -1
- package/dist/{bundler-CgcwaVI0.mjs → bundler-Ciim6amq.mjs} +7 -59
- package/dist/bundler-Ciim6amq.mjs.map +1 -0
- package/dist/{bundler-B2_2-Dum.cjs → bundler-jjWtQ882.cjs} +6 -58
- package/dist/bundler-jjWtQ882.cjs.map +1 -0
- package/dist/{cli-H0uB_znq.mjs → cli-BkxlWYfI.mjs} +2 -2
- package/dist/{cli-H0uB_znq.mjs.map → cli-BkxlWYfI.mjs.map} +1 -1
- package/dist/{cli-5k6kV_i4.cjs → cli-CQ2ij0Mi.cjs} +2 -2
- package/dist/{cli-5k6kV_i4.cjs.map → cli-CQ2ij0Mi.cjs.map} +1 -1
- package/dist/{compose-CYeMW2_o.cjs → compose-JOasAHcd.cjs} +4 -4
- package/dist/{compose-CYeMW2_o.cjs.map → compose-JOasAHcd.cjs.map} +1 -1
- package/dist/{compose-BEiJWrB7.mjs → compose-qLTNYJAY.mjs} +4 -4
- package/dist/{compose-BEiJWrB7.mjs.map → compose-qLTNYJAY.mjs.map} +1 -1
- package/dist/deploy/public.cjs +6 -6
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +6 -6
- package/dist/{deploy-Q5qo1OP-.cjs → deploy-D-liNXfx.cjs} +5 -5
- package/dist/{deploy-Q5qo1OP-.cjs.map → deploy-D-liNXfx.cjs.map} +1 -1
- package/dist/{deploy-Cyx5fSb7.mjs → deploy-_g-2dX38.mjs} +5 -5
- package/dist/{deploy-Cyx5fSb7.mjs.map → deploy-_g-2dX38.mjs.map} +1 -1
- package/dist/{dns-CsApfzLc.mjs → dns-DGq4xkJT.mjs} +2 -2
- package/dist/{dns-CsApfzLc.mjs.map → dns-DGq4xkJT.mjs.map} +1 -1
- package/dist/{dns-v9viladZ.cjs → dns-DfQKqAyt.cjs} +2 -2
- package/dist/{dns-v9viladZ.cjs.map → dns-DfQKqAyt.cjs.map} +1 -1
- package/dist/{dokploy-DfUo_QRw.mjs → dokploy-ClIPZaPH.mjs} +2 -2
- package/dist/{dokploy-DfUo_QRw.mjs.map → dokploy-ClIPZaPH.mjs.map} +1 -1
- package/dist/{dokploy-Di7rC2z0.cjs → dokploy-D17I2BCE.cjs} +2 -2
- package/dist/{dokploy-Di7rC2z0.cjs.map → dokploy-D17I2BCE.cjs.map} +1 -1
- package/dist/{drivers-D11JHxrD.mjs → drivers-3klmg9Sk.mjs} +22 -4
- package/dist/drivers-3klmg9Sk.mjs.map +1 -0
- package/dist/{drivers-GKaA6ITM.cjs → drivers-CoqD5zYP.cjs} +27 -3
- package/dist/drivers-CoqD5zYP.cjs.map +1 -0
- package/dist/{eas-CTfRmndW.mjs → eas-DJXhARYb.mjs} +2 -2
- package/dist/{eas-CTfRmndW.mjs.map → eas-DJXhARYb.mjs.map} +1 -1
- package/dist/{eas-CIvNT6qa.cjs → eas-b95MCG14.cjs} +2 -2
- package/dist/{eas-CIvNT6qa.cjs.map → eas-b95MCG14.cjs.map} +1 -1
- package/dist/{encryption--U4NsK7N.cjs → encryption-C_NRQ9cY.cjs} +2 -2
- package/dist/{encryption--U4NsK7N.cjs.map → encryption-C_NRQ9cY.cjs.map} +1 -1
- package/dist/{encryption-BpTPmd7h.mjs → encryption-CldvLtip.mjs} +2 -2
- package/dist/{encryption-BpTPmd7h.mjs.map → encryption-CldvLtip.mjs.map} +1 -1
- package/dist/{engine-BFmHfek1.mjs → engine-BBnTj8OD.mjs} +12 -6
- package/dist/engine-BBnTj8OD.mjs.map +1 -0
- package/dist/{engine-Ovl1PB6i.cjs → engine-CKfdvEVt.cjs} +11 -5
- package/dist/engine-CKfdvEVt.cjs.map +1 -0
- package/dist/{github-tWAGuR9i.mjs → github-BMPci2wg.mjs} +4 -4
- package/dist/{github-tWAGuR9i.mjs.map → github-BMPci2wg.mjs.map} +1 -1
- package/dist/{github-CTlPQ5Ra.cjs → github-D5Ck3srU.cjs} +4 -4
- package/dist/{github-CTlPQ5Ra.cjs.map → github-D5Ck3srU.cjs.map} +1 -1
- package/dist/{googlePlay-BNH729It.cjs → googlePlay-C-GBRDMp.cjs} +3 -3
- package/dist/{googlePlay-BNH729It.cjs.map → googlePlay-C-GBRDMp.cjs.map} +1 -1
- package/dist/{googlePlay-m1De-qIJ.mjs → googlePlay-fw0VWly7.mjs} +3 -3
- package/dist/{googlePlay-m1De-qIJ.mjs.map → googlePlay-fw0VWly7.mjs.map} +1 -1
- package/dist/index.cjs +245 -139
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +245 -139
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-4B4RgAjU.mjs → migrate-1bHqjfIe.mjs} +2 -2
- package/dist/{migrate-4B4RgAjU.mjs.map → migrate-1bHqjfIe.mjs.map} +1 -1
- package/dist/{migrate-DZ2--SaO.cjs → migrate-BndHuwqw.cjs} +2 -2
- package/dist/{migrate-DZ2--SaO.cjs.map → migrate-BndHuwqw.cjs.map} +1 -1
- package/dist/{migrate-X0Y7fz3N.mjs → migrate-WyWhSivN.mjs} +2 -2
- package/dist/{migrate-X0Y7fz3N.mjs.map → migrate-WyWhSivN.mjs.map} +1 -1
- package/dist/{migrate-BYEmpoIg.cjs → migrate-rke2Qvj2.cjs} +2 -2
- package/dist/{migrate-BYEmpoIg.cjs.map → migrate-rke2Qvj2.cjs.map} +1 -1
- package/dist/{publish-BUvYjiZH.cjs → publish-B22IhdS9.cjs} +2 -2
- package/dist/{publish-BUvYjiZH.cjs.map → publish-B22IhdS9.cjs.map} +1 -1
- package/dist/{publish-hhgraEhO.mjs → publish-BBG4zx8E.mjs} +2 -2
- package/dist/{publish-hhgraEhO.mjs.map → publish-BBG4zx8E.mjs.map} +1 -1
- package/dist/{ready-CIt5SOtg.mjs → ready-4hEoQ_cr.mjs} +2 -2
- package/dist/{ready-CIt5SOtg.mjs.map → ready-4hEoQ_cr.mjs.map} +1 -1
- package/dist/{ready-BMFjxBYA.cjs → ready-gc9IFByS.cjs} +2 -2
- package/dist/{ready-BMFjxBYA.cjs.map → ready-gc9IFByS.cjs.map} +1 -1
- package/dist/{resolve-DotGHvtX.mjs → resolve-CC6ndodR.mjs} +3 -3
- package/dist/{resolve-DotGHvtX.mjs.map → resolve-CC6ndodR.mjs.map} +1 -1
- package/dist/{resolve-DdFKTx8l.cjs → resolve-isFTuJp4.cjs} +3 -3
- package/dist/{resolve-DdFKTx8l.cjs.map → resolve-isFTuJp4.cjs.map} +1 -1
- package/dist/{rollback-9t9G3c_u.mjs → rollback-DaEmEC2Y.mjs} +4 -4
- package/dist/{rollback-9t9G3c_u.mjs.map → rollback-DaEmEC2Y.mjs.map} +1 -1
- package/dist/{rollback-D4xeUQvG.cjs → rollback-Lj9bQvHq.cjs} +4 -4
- package/dist/{rollback-D4xeUQvG.cjs.map → rollback-Lj9bQvHq.cjs.map} +1 -1
- package/dist/{seeds-DbKNcs3o.cjs → seeds-CF9Nx6_g.cjs} +33 -6
- package/dist/seeds-CF9Nx6_g.cjs.map +1 -0
- package/dist/{seeds-CRkKeyW0.mjs → seeds-CYzoBDg2.mjs} +33 -6
- package/dist/seeds-CYzoBDg2.mjs.map +1 -0
- package/dist/{serverSetup-DlRKRfTi.mjs → serverSetup-0h1Vh5un.mjs} +5 -5
- package/dist/{serverSetup-DlRKRfTi.mjs.map → serverSetup-0h1Vh5un.mjs.map} +1 -1
- package/dist/{serverSetup-CcWgNtiC.cjs → serverSetup-CbuJK4zg.cjs} +5 -5
- package/dist/{serverSetup-CcWgNtiC.cjs.map → serverSetup-CbuJK4zg.cjs.map} +1 -1
- package/dist/{sniffer-CakkKKqQ.mjs → sniffer-CRJHtBaK.mjs} +6 -6
- package/dist/{sniffer-CakkKKqQ.mjs.map → sniffer-CRJHtBaK.mjs.map} +1 -1
- package/dist/{sniffer-B6T6za4n.cjs → sniffer-Dz3Va1Jo.cjs} +6 -6
- package/dist/{sniffer-B6T6za4n.cjs.map → sniffer-Dz3Va1Jo.cjs.map} +1 -1
- package/dist/{stage-Mp6qQIoD.mjs → stage-CIo8s2WT.mjs} +4 -4
- package/dist/{stage-Mp6qQIoD.mjs.map → stage-CIo8s2WT.mjs.map} +1 -1
- package/dist/{stage-W3PUt7ar.cjs → stage-y9qFelxT.cjs} +4 -4
- package/dist/{stage-W3PUt7ar.cjs.map → stage-y9qFelxT.cjs.map} +1 -1
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.mjs +1 -1
- package/dist/vitest.cjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/package.json +15 -15
- package/dist/bundler-B2_2-Dum.cjs.map +0 -1
- package/dist/bundler-CgcwaVI0.mjs.map +0 -1
- package/dist/drivers-D11JHxrD.mjs.map +0 -1
- package/dist/drivers-GKaA6ITM.cjs.map +0 -1
- package/dist/engine-BFmHfek1.mjs.map +0 -1
- package/dist/engine-Ovl1PB6i.cjs.map +0 -1
- package/dist/seeds-CRkKeyW0.mjs.map +0 -1
- package/dist/seeds-DbKNcs3o.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -4,27 +4,28 @@ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
|
4
4
|
const require_errors = require("./errors-DMC4Umsb.cjs");
|
|
5
5
|
const require_run = require("./run-fVZ-rLnc.cjs");
|
|
6
6
|
const require_credentials = require("./credentials-Zqr3QQYB.cjs");
|
|
7
|
-
const require_compose = require("./compose-
|
|
7
|
+
const require_compose = require("./compose-JOasAHcd.cjs");
|
|
8
8
|
const require_workspace = require("./workspace-BwqQnool.cjs");
|
|
9
|
-
const require_dns = require("./dns-
|
|
10
|
-
const
|
|
9
|
+
const require_dns = require("./dns-DfQKqAyt.cjs");
|
|
10
|
+
const require_schemas = require("./schemas-BQ_v0lEX.cjs");
|
|
11
|
+
const require_seeds = require("./seeds-CF9Nx6_g.cjs");
|
|
11
12
|
const require_derive = require("./derive-DAbo49sm.cjs");
|
|
12
13
|
const require_SubscriberGenerator = require("./SubscriberGenerator-CeH7wbYt.cjs");
|
|
13
14
|
const require_identity = require("./identity-CbLfgQNT.cjs");
|
|
14
15
|
const require_EndpointGenerator = require("./EndpointGenerator-BwbYTMtB.cjs");
|
|
15
16
|
const require_discover = require("./discover-Bsr7HjqJ.cjs");
|
|
16
17
|
const require_config = require("./config.cjs");
|
|
17
|
-
const require_deploy = require("./deploy-
|
|
18
|
+
const require_deploy = require("./deploy-D-liNXfx.cjs");
|
|
18
19
|
const require_openapi = require("./openapi.cjs");
|
|
19
20
|
const require_appPorts = require("./appPorts-IW-OZmRi.cjs");
|
|
20
|
-
const require_drivers = require("./drivers-
|
|
21
|
+
const require_drivers = require("./drivers-CoqD5zYP.cjs");
|
|
21
22
|
const require_emit = require("./emit-Dmc1nvdS.cjs");
|
|
22
23
|
const require_local = require("./local-DNhnkugT.cjs");
|
|
23
|
-
const require_sniffer = require("./sniffer-
|
|
24
|
+
const require_sniffer = require("./sniffer-Dz3Va1Jo.cjs");
|
|
24
25
|
const require_credentialSchemas = require("./credentialSchemas-D_VUCDUh.cjs");
|
|
25
|
-
const require_LocalStateStore = require("./LocalStateStore-
|
|
26
|
+
const require_LocalStateStore = require("./LocalStateStore-Dg3rvwwe.cjs");
|
|
26
27
|
const require_utils = require("./utils-D2Nk1Nv2.cjs");
|
|
27
|
-
const require_ready = require("./ready-
|
|
28
|
+
const require_ready = require("./ready-gc9IFByS.cjs");
|
|
28
29
|
let node_path = require("node:path");
|
|
29
30
|
let commander = require("commander");
|
|
30
31
|
let node_process = require("node:process");
|
|
@@ -57,7 +58,7 @@ crypto = require_rolldown_runtime.__toESM(crypto, 1);
|
|
|
57
58
|
let _geekmidas_constructs_functions = require("@geekmidas/constructs/functions");
|
|
58
59
|
let _geekmidas_constructs_topic = require("@geekmidas/constructs/topic");
|
|
59
60
|
//#region package.json
|
|
60
|
-
var version = "10.0.0-alpha.
|
|
61
|
+
var version = "10.0.0-alpha.118";
|
|
61
62
|
//#endregion
|
|
62
63
|
//#region src/prompt.ts
|
|
63
64
|
/**
|
|
@@ -140,7 +141,7 @@ const logger$8 = console;
|
|
|
140
141
|
* Validate Dokploy token by making a test API call
|
|
141
142
|
*/
|
|
142
143
|
async function validateDokployToken(endpoint, token) {
|
|
143
|
-
const { DokployApi } = await Promise.resolve().then(() => require("./sniffer-
|
|
144
|
+
const { DokployApi } = await Promise.resolve().then(() => require("./sniffer-Dz3Va1Jo.cjs")).then((n) => n.dokploy_api_exports);
|
|
144
145
|
return new DokployApi({
|
|
145
146
|
baseUrl: endpoint,
|
|
146
147
|
token
|
|
@@ -2180,7 +2181,7 @@ async function execCommand(commandArgs, options = {}, stageDeps) {
|
|
|
2180
2181
|
const cwd = options.cwd ?? process.cwd();
|
|
2181
2182
|
if (!commandArgs[0]) throw new NoCommandSpecified();
|
|
2182
2183
|
if (options.stage && !require_seeds.isImageBuild()) {
|
|
2183
|
-
const { execOnStage } = await Promise.resolve().then(() => require("./stage-
|
|
2184
|
+
const { execOnStage } = await Promise.resolve().then(() => require("./stage-y9qFelxT.cjs")).then((n) => n.stage_exports);
|
|
2184
2185
|
const { loadWorkspaceConfig } = await Promise.resolve().then(() => require("./config.cjs"));
|
|
2185
2186
|
const { workspace } = await loadWorkspaceConfig(cwd);
|
|
2186
2187
|
if (options.stage !== workspace.stages.local) {
|
|
@@ -2753,9 +2754,9 @@ async function workspaceDevCommand(configured, options) {
|
|
|
2753
2754
|
for (const { id, port } of fakes) logger$5.log(`🎭 ${id} fake: http://localhost:${port}`);
|
|
2754
2755
|
logger$5.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
|
|
2755
2756
|
if (options.migrate || options.seed) {
|
|
2756
|
-
const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-
|
|
2757
|
+
const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-rke2Qvj2.cjs"));
|
|
2757
2758
|
await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
|
|
2758
|
-
} else await Promise.resolve().then(() => require("./migrate-
|
|
2759
|
+
} else await Promise.resolve().then(() => require("./migrate-rke2Qvj2.cjs")).then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
|
|
2759
2760
|
logger$5.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
|
|
2760
2761
|
});
|
|
2761
2762
|
const appUrls = {};
|
|
@@ -3831,7 +3832,7 @@ async function buildApp(input) {
|
|
|
3831
3832
|
...production,
|
|
3832
3833
|
...telemetry ? { telemetry } : {}
|
|
3833
3834
|
});
|
|
3834
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
3835
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-jjWtQ882.cjs"));
|
|
3835
3836
|
await bundleServer({
|
|
3836
3837
|
entryPoint,
|
|
3837
3838
|
outputDir: (0, node_path.join)(outputDir, "dist"),
|
|
@@ -3906,7 +3907,8 @@ async function buildApp(input) {
|
|
|
3906
3907
|
appRoot,
|
|
3907
3908
|
reach,
|
|
3908
3909
|
cacheBackend,
|
|
3909
|
-
eventsBackend
|
|
3910
|
+
eventsBackend,
|
|
3911
|
+
target
|
|
3910
3912
|
}));
|
|
3911
3913
|
if (target === "server") buildContext.telemetry = require_EndpointGenerator.telemetryFor({
|
|
3912
3914
|
node: processTelemetry(declared, derived.surface?.id, servesOnly ? [] : hosted.map((unit) => unit.id)),
|
|
@@ -3939,7 +3941,8 @@ async function buildApp(input) {
|
|
|
3939
3941
|
appRoot,
|
|
3940
3942
|
reach: reachedBy(declared, [workerId], work),
|
|
3941
3943
|
cacheBackend,
|
|
3942
|
-
eventsBackend
|
|
3944
|
+
eventsBackend,
|
|
3945
|
+
target
|
|
3943
3946
|
})
|
|
3944
3947
|
}),
|
|
3945
3948
|
telemetry: (workerId) => require_EndpointGenerator.telemetryFor({
|
|
@@ -3989,7 +3992,8 @@ function processTelemetry(declared, surfaceId, workers) {
|
|
|
3989
3992
|
* The drivers a process's entry registers, from the declarations it reaches:
|
|
3990
3993
|
* the cache's — the declaration for one that named its database, the deploy
|
|
3991
3994
|
* target's default for one that named nowhere — and the broker's, only when
|
|
3992
|
-
* it reaches a topic or a queue (see `eventsBackendsIn`)
|
|
3995
|
+
* it reaches a topic or a queue (see `eventsBackendsIn`) — and the KMS
|
|
3996
|
+
* cipher, only built for AWS and only when it reaches an `Encryption`.
|
|
3993
3997
|
*/
|
|
3994
3998
|
function runtimeDrivers(options) {
|
|
3995
3999
|
const eventsBackends = require_drivers.eventsBackendsIn(options.reach, options.eventsBackend);
|
|
@@ -3997,7 +4001,8 @@ function runtimeDrivers(options) {
|
|
|
3997
4001
|
storageDrivers: require_drivers.driversFor({
|
|
3998
4002
|
appRoot: options.appRoot,
|
|
3999
4003
|
cache: require_drivers.cacheBackendsIn(options.reach, options.cacheBackend),
|
|
4000
|
-
events: eventsBackends
|
|
4004
|
+
events: eventsBackends,
|
|
4005
|
+
kms: require_drivers.opensKmsKeys(options.reach, options.target)
|
|
4001
4006
|
}),
|
|
4002
4007
|
eventsBackends
|
|
4003
4008
|
};
|
|
@@ -4030,7 +4035,7 @@ async function buildWorkers(input) {
|
|
|
4030
4035
|
});
|
|
4031
4036
|
logger$4.log(`Generated worker ${worker.id}: ${crons.length} crons, ${queues.length} queues, ${subscribers.length} subscribers`);
|
|
4032
4037
|
if (!input.bundle) continue;
|
|
4033
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
4038
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-jjWtQ882.cjs"));
|
|
4034
4039
|
const outfile = require_seeds.workerBundleName(worker.id);
|
|
4035
4040
|
await bundleServer({
|
|
4036
4041
|
entryPoint,
|
|
@@ -4116,7 +4121,7 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
|
|
|
4116
4121
|
let masterKey;
|
|
4117
4122
|
if (context.production?.bundle && !skipBundle) {
|
|
4118
4123
|
logger$4.log(`\n📦 Bundling production server...`);
|
|
4119
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
4124
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-jjWtQ882.cjs"));
|
|
4120
4125
|
const allConstructs = [
|
|
4121
4126
|
...endpoints.map((e) => e.construct),
|
|
4122
4127
|
...functions.map((f) => f.construct),
|
|
@@ -5950,25 +5955,25 @@ function loadPackageJson() {
|
|
|
5950
5955
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
5951
5956
|
*/
|
|
5952
5957
|
const GEEKMIDAS_VERSIONS = {
|
|
5953
|
-
"@geekmidas/audit": "~10.0.0-alpha.
|
|
5954
|
-
"@geekmidas/auth": "~10.0.0-alpha.
|
|
5955
|
-
"@geekmidas/cache": "~10.0.0-alpha.
|
|
5956
|
-
"@geekmidas/client": "~10.0.0-alpha.
|
|
5957
|
-
"@geekmidas/cloud": "~10.0.0-alpha.
|
|
5958
|
-
"@geekmidas/constructs": "~10.0.0-alpha.
|
|
5959
|
-
"@geekmidas/db": "~10.0.0-alpha.
|
|
5960
|
-
"@geekmidas/emailkit": "~10.0.0-alpha.
|
|
5961
|
-
"@geekmidas/envkit": "~10.0.0-alpha.
|
|
5962
|
-
"@geekmidas/errors": "~10.0.0-alpha.
|
|
5963
|
-
"@geekmidas/events": "~10.0.0-alpha.
|
|
5964
|
-
"@geekmidas/logger": "~10.0.0-alpha.
|
|
5965
|
-
"@geekmidas/manifest": "~10.0.0-alpha.
|
|
5966
|
-
"@geekmidas/rate-limit": "~10.0.0-alpha.
|
|
5967
|
-
"@geekmidas/schema": "~10.0.0-alpha.
|
|
5968
|
-
"@geekmidas/services": "~10.0.0-alpha.
|
|
5969
|
-
"@geekmidas/storage": "~10.0.0-alpha.
|
|
5970
|
-
"@geekmidas/telescope": "~10.0.0-alpha.
|
|
5971
|
-
"@geekmidas/testkit": "~10.0.0-alpha.
|
|
5958
|
+
"@geekmidas/audit": "~10.0.0-alpha.118",
|
|
5959
|
+
"@geekmidas/auth": "~10.0.0-alpha.118",
|
|
5960
|
+
"@geekmidas/cache": "~10.0.0-alpha.118",
|
|
5961
|
+
"@geekmidas/client": "~10.0.0-alpha.118",
|
|
5962
|
+
"@geekmidas/cloud": "~10.0.0-alpha.118",
|
|
5963
|
+
"@geekmidas/constructs": "~10.0.0-alpha.118",
|
|
5964
|
+
"@geekmidas/db": "~10.0.0-alpha.118",
|
|
5965
|
+
"@geekmidas/emailkit": "~10.0.0-alpha.118",
|
|
5966
|
+
"@geekmidas/envkit": "~10.0.0-alpha.118",
|
|
5967
|
+
"@geekmidas/errors": "~10.0.0-alpha.118",
|
|
5968
|
+
"@geekmidas/events": "~10.0.0-alpha.118",
|
|
5969
|
+
"@geekmidas/logger": "~10.0.0-alpha.118",
|
|
5970
|
+
"@geekmidas/manifest": "~10.0.0-alpha.118",
|
|
5971
|
+
"@geekmidas/rate-limit": "~10.0.0-alpha.118",
|
|
5972
|
+
"@geekmidas/schema": "~10.0.0-alpha.118",
|
|
5973
|
+
"@geekmidas/services": "~10.0.0-alpha.118",
|
|
5974
|
+
"@geekmidas/storage": "~10.0.0-alpha.118",
|
|
5975
|
+
"@geekmidas/telescope": "~10.0.0-alpha.118",
|
|
5976
|
+
"@geekmidas/testkit": "~10.0.0-alpha.118",
|
|
5972
5977
|
"@geekmidas/cli": `~${loadPackageJson().version}`
|
|
5973
5978
|
};
|
|
5974
5979
|
//#endregion
|
|
@@ -7161,7 +7166,7 @@ const COMMIT = /^[0-9a-f]{40}$/;
|
|
|
7161
7166
|
* The `uses:` value for the stages action, with a comment saying which CLI
|
|
7162
7167
|
* release the pinned commit is.
|
|
7163
7168
|
*/
|
|
7164
|
-
function stagesActionUses(commit = "
|
|
7169
|
+
function stagesActionUses(commit = "01a325bb2dfb75faf9c255cb3f1d9288c6c42c1e", version = cliVersion()) {
|
|
7165
7170
|
return commit && COMMIT.test(commit) ? `${STAGES_ACTION}@${commit} # @geekmidas/cli ${version}` : `${STAGES_ACTION}@main # pin to a commit SHA: see the action's README`;
|
|
7166
7171
|
}
|
|
7167
7172
|
//#endregion
|
|
@@ -9072,6 +9077,10 @@ interface SignedIn {
|
|
|
9072
9077
|
* The \`users\` row for whoever signed in, made the first time they call the
|
|
9073
9078
|
* API and given the Member role. The auth server owns who someone is; this
|
|
9074
9079
|
* row is what the application's own tables refer to.
|
|
9080
|
+
*
|
|
9081
|
+
* Someone the seeds named before they signed in — an admin, in
|
|
9082
|
+
* \`03_admins.ts\` — already has a row with their email and no auth user: their
|
|
9083
|
+
* first sign-in claims it, roles and all.
|
|
9075
9084
|
*/
|
|
9076
9085
|
export async function memberFor(db: Kysely<Database>, user: SignedIn) {
|
|
9077
9086
|
const found = await db
|
|
@@ -9081,13 +9090,23 @@ export async function memberFor(db: Kysely<Database>, user: SignedIn) {
|
|
|
9081
9090
|
.executeTakeFirst();
|
|
9082
9091
|
if (found) return found;
|
|
9083
9092
|
|
|
9084
|
-
const member =
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9093
|
+
const member =
|
|
9094
|
+
(await db
|
|
9095
|
+
.updateTable('users')
|
|
9096
|
+
.set({ authUserId: user.id, ...(user.name ? { name: user.name } : {}) })
|
|
9097
|
+
.where('email', '=', user.email)
|
|
9098
|
+
.where('authUserId', 'is', null)
|
|
9099
|
+
.returningAll()
|
|
9100
|
+
.executeTakeFirst()) ??
|
|
9101
|
+
(await db
|
|
9102
|
+
.insertInto('users')
|
|
9103
|
+
.values({ authUserId: user.id, email: user.email, name: user.name })
|
|
9104
|
+
// Two first requests at once: the second finds the first's row.
|
|
9105
|
+
.onConflict((oc) =>
|
|
9106
|
+
oc.column('authUserId').doUpdateSet({ email: user.email }),
|
|
9107
|
+
)
|
|
9108
|
+
.returningAll()
|
|
9109
|
+
.executeTakeFirstOrThrow());
|
|
9091
9110
|
|
|
9092
9111
|
const memberRole = await db
|
|
9093
9112
|
.selectFrom('roles')
|
|
@@ -9250,65 +9269,6 @@ export const AdminUsersSchema = z
|
|
|
9250
9269
|
}];
|
|
9251
9270
|
}
|
|
9252
9271
|
/**
|
|
9253
|
-
* `scripts/grant-admin.ts`: the first Super admin. Nobody can grant a role
|
|
9254
|
-
* before someone has one, so the first is granted from a terminal.
|
|
9255
|
-
*/
|
|
9256
|
-
function grantAdminScript(options) {
|
|
9257
|
-
return {
|
|
9258
|
-
path: "scripts/grant-admin.ts",
|
|
9259
|
-
content: `/**
|
|
9260
|
-
* Make someone a Super admin — the first one, before the admin panel can.
|
|
9261
|
-
*
|
|
9262
|
-
* gkm exec -- tsx scripts/grant-admin.ts you@example.com
|
|
9263
|
-
*
|
|
9264
|
-
* They need to have signed in once (the web site, the admin panel or the app),
|
|
9265
|
-
* which is what makes their \`users\` row.
|
|
9266
|
-
*/
|
|
9267
|
-
import { database } from '@${options.name}/constructs/database.ts';
|
|
9268
|
-
import { SYSTEM_ROLES } from '@${options.name}/models/access';
|
|
9269
|
-
import { EnvironmentParser } from '@geekmidas/envkit';
|
|
9270
|
-
|
|
9271
|
-
const email = process.argv[2]?.trim().toLowerCase();
|
|
9272
|
-
if (!email) {
|
|
9273
|
-
console.error('Usage: gkm exec -- tsx scripts/grant-admin.ts <email>');
|
|
9274
|
-
process.exit(1);
|
|
9275
|
-
}
|
|
9276
|
-
|
|
9277
|
-
const db = await database.service.register({
|
|
9278
|
-
envParser: new EnvironmentParser({ ...process.env }),
|
|
9279
|
-
} as never);
|
|
9280
|
-
|
|
9281
|
-
try {
|
|
9282
|
-
const user = await db
|
|
9283
|
-
.selectFrom('users')
|
|
9284
|
-
.select('id')
|
|
9285
|
-
.where('email', '=', email)
|
|
9286
|
-
.executeTakeFirst();
|
|
9287
|
-
if (!user) {
|
|
9288
|
-
console.error(\`No one has signed in as \${email} yet. Sign in once, then run this again.\`);
|
|
9289
|
-
process.exit(1);
|
|
9290
|
-
}
|
|
9291
|
-
|
|
9292
|
-
const role = await db
|
|
9293
|
-
.selectFrom('roles')
|
|
9294
|
-
.select('id')
|
|
9295
|
-
.where('name', '=', SYSTEM_ROLES.SuperAdmin.name)
|
|
9296
|
-
.executeTakeFirstOrThrow();
|
|
9297
|
-
|
|
9298
|
-
await db
|
|
9299
|
-
.insertInto('userRoles')
|
|
9300
|
-
.values({ userId: user.id, roleId: role.id })
|
|
9301
|
-
.onConflict((oc) => oc.columns(['userId', 'roleId']).doNothing())
|
|
9302
|
-
.execute();
|
|
9303
|
-
|
|
9304
|
-
console.log(\`\${email} is a \${SYSTEM_ROLES.SuperAdmin.name}.\`);
|
|
9305
|
-
} finally {
|
|
9306
|
-
await db.destroy();
|
|
9307
|
-
}
|
|
9308
|
-
`
|
|
9309
|
-
};
|
|
9310
|
-
}
|
|
9311
|
-
/**
|
|
9312
9272
|
* The API's feature tests: signing in by email end to end, and the admin
|
|
9313
9273
|
* panel's gate. Each runs in a transaction, against the real auth server and
|
|
9314
9274
|
* the real mail catcher.
|
|
@@ -9371,6 +9331,39 @@ describe('the admin panel', () => {
|
|
|
9371
9331
|
|
|
9372
9332
|
expect(users).toContainEqual(expect.objectContaining({ id: me.id }));
|
|
9373
9333
|
});
|
|
9334
|
+
|
|
9335
|
+
it('lets in an admin the seeds named, on their first sign-in', async ({
|
|
9336
|
+
browser,
|
|
9337
|
+
db,
|
|
9338
|
+
faker,
|
|
9339
|
+
}) => {
|
|
9340
|
+
// What \`03_admins.ts\` writes: a row with no auth user yet, and the role.
|
|
9341
|
+
const email = faker.internet.email();
|
|
9342
|
+
const app = await db.get('database');
|
|
9343
|
+
const admin = await app
|
|
9344
|
+
.insertInto('users')
|
|
9345
|
+
.values({ email, name: 'Admin' })
|
|
9346
|
+
.returning('id')
|
|
9347
|
+
.executeTakeFirstOrThrow();
|
|
9348
|
+
const superAdmin = await app
|
|
9349
|
+
.selectFrom('roles')
|
|
9350
|
+
.select('id')
|
|
9351
|
+
.where('name', '=', SYSTEM_ROLES.SuperAdmin.name)
|
|
9352
|
+
.executeTakeFirstOrThrow();
|
|
9353
|
+
await app
|
|
9354
|
+
.insertInto('userRoles')
|
|
9355
|
+
.values({ userId: admin.id, roleId: superAdmin.id })
|
|
9356
|
+
.execute();
|
|
9357
|
+
|
|
9358
|
+
await browser.signIn(email);
|
|
9359
|
+
|
|
9360
|
+
expect(await browser.api.get('/profiles/me')).toMatchObject({
|
|
9361
|
+
id: admin.id,
|
|
9362
|
+
email,
|
|
9363
|
+
});
|
|
9364
|
+
const { users } = await browser.api.get('/admin/users');
|
|
9365
|
+
expect(users).toContainEqual(expect.objectContaining({ id: admin.id }));
|
|
9366
|
+
});
|
|
9374
9367
|
});
|
|
9375
9368
|
`;
|
|
9376
9369
|
}
|
|
@@ -9669,9 +9662,11 @@ export interface Database {
|
|
|
9669
9662
|
id: Generated<string>;
|
|
9670
9663
|
/**
|
|
9671
9664
|
* The Better Auth user this person signs in as. The auth schema is its
|
|
9672
|
-
* own, so this is a plain column, not a foreign key into it.
|
|
9665
|
+
* own, so this is a plain column, not a foreign key into it. Null for
|
|
9666
|
+
* someone the seeds named who has not signed in yet: their first sign-in
|
|
9667
|
+
* claims the row by email.
|
|
9673
9668
|
*/
|
|
9674
|
-
authUserId: string;
|
|
9669
|
+
authUserId: string | null;
|
|
9675
9670
|
name: string;
|
|
9676
9671
|
email: string;
|
|
9677
9672
|
createdAt: Generated<Date>;
|
|
@@ -9958,8 +9953,9 @@ export async function up(db: Kysely<unknown>): Promise<void> {
|
|
|
9958
9953
|
col.primaryKey().defaultTo(db.fn('gen_random_uuid')),
|
|
9959
9954
|
)
|
|
9960
9955
|
// The Better Auth user this person signs in as. A plain column: the auth
|
|
9961
|
-
// schema is its own, and the id's format is Better Auth's to choose.
|
|
9962
|
-
|
|
9956
|
+
// schema is its own, and the id's format is Better Auth's to choose. Null
|
|
9957
|
+
// until someone the seeds named (an admin) first signs in.
|
|
9958
|
+
.addColumn('auth_user_id', 'text', (col) => col.unique())
|
|
9963
9959
|
.addColumn('name', 'varchar(255)', (col) => col.notNull())
|
|
9964
9960
|
.addColumn('email', 'varchar(255)', (col) => col.notNull().unique())
|
|
9965
9961
|
.addColumn('created_at', 'timestamptz', (col) =>
|
|
@@ -10064,11 +10060,13 @@ export async function down(db: Kysely<unknown>): Promise<void> {
|
|
|
10064
10060
|
* upserts, run after every migration, so a changed list is applied by running
|
|
10065
10061
|
* them again.
|
|
10066
10062
|
*/
|
|
10067
|
-
function accessControlSeeds(
|
|
10063
|
+
function accessControlSeeds(options) {
|
|
10064
|
+
const { name } = options;
|
|
10068
10065
|
const folder = (0, _geekmidas_manifest.seedFolder)(databaseFor().id);
|
|
10069
|
-
return [
|
|
10070
|
-
|
|
10071
|
-
|
|
10066
|
+
return [
|
|
10067
|
+
{
|
|
10068
|
+
path: `${folder}/01_permissions.ts`,
|
|
10069
|
+
content: `import { PERMISSION_KEYS, PERMISSIONS } from '@${name}/models/access';
|
|
10072
10070
|
import type { Kysely } from 'kysely';
|
|
10073
10071
|
|
|
10074
10072
|
type Tables = { permissions: { key: string; description: string } };
|
|
@@ -10099,9 +10097,10 @@ export async function seed(db: Kysely<unknown>): Promise<void> {
|
|
|
10099
10097
|
.execute();
|
|
10100
10098
|
}
|
|
10101
10099
|
`
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10100
|
+
},
|
|
10101
|
+
{
|
|
10102
|
+
path: `${folder}/02_system_roles.ts`,
|
|
10103
|
+
content: `import { SYSTEM_ROLES } from '@${name}/models/access';
|
|
10105
10104
|
import type { Kysely } from 'kysely';
|
|
10106
10105
|
|
|
10107
10106
|
type Tables = {
|
|
@@ -10148,7 +10147,76 @@ export async function seed(db: Kysely<unknown>): Promise<void> {
|
|
|
10148
10147
|
}
|
|
10149
10148
|
}
|
|
10150
10149
|
`
|
|
10151
|
-
|
|
10150
|
+
},
|
|
10151
|
+
adminsSeed(folder, options)
|
|
10152
|
+
];
|
|
10153
|
+
}
|
|
10154
|
+
/**
|
|
10155
|
+
* The Super admins, by email — the first one asked for by `gkm init`. Each
|
|
10156
|
+
* gets a `users` row before they have signed in, which their first sign-in
|
|
10157
|
+
* claims (`memberFor`), so the admin panel lets them in straight away.
|
|
10158
|
+
*/
|
|
10159
|
+
function adminsSeed(folder, options) {
|
|
10160
|
+
const admins = options.adminEmail ? `[\n '${options.adminEmail}',\n]` : "[\n // 'you@example.com',\n]";
|
|
10161
|
+
return {
|
|
10162
|
+
path: `${folder}/03_admins.ts`,
|
|
10163
|
+
content: `import { SYSTEM_ROLES } from '@${options.name}/models/access';
|
|
10164
|
+
import type { Kysely } from 'kysely';
|
|
10165
|
+
|
|
10166
|
+
/**
|
|
10167
|
+
* Who is a Super admin, by the address they sign in with. Add someone here and
|
|
10168
|
+
* run the seeds (\`gkm dev --seed\`, or the next deploy); taking them off the
|
|
10169
|
+
* list does not take the role away — the admin panel does that.
|
|
10170
|
+
*/
|
|
10171
|
+
const ADMINS: string[] = ${admins};
|
|
10172
|
+
|
|
10173
|
+
type Tables = {
|
|
10174
|
+
users: { id?: string; email: string; name: string };
|
|
10175
|
+
roles: { id: string; name: string; is_system: boolean };
|
|
10176
|
+
user_roles: { user_id: string; role_id: string };
|
|
10177
|
+
};
|
|
10178
|
+
|
|
10179
|
+
/**
|
|
10180
|
+
* A \`users\` row for each admin who has none — their first sign-in claims it —
|
|
10181
|
+
* and the Member and Super admin roles. Runs after the system roles seed.
|
|
10182
|
+
*/
|
|
10183
|
+
export async function seed(db: Kysely<unknown>): Promise<void> {
|
|
10184
|
+
// Better Auth stores addresses lowercased; so does every \`users\` row.
|
|
10185
|
+
const emails = ADMINS.map((email) => email.trim().toLowerCase());
|
|
10186
|
+
if (emails.length === 0) return;
|
|
10187
|
+
|
|
10188
|
+
const tables = db.withTables<Tables>();
|
|
10189
|
+
|
|
10190
|
+
await tables
|
|
10191
|
+
.insertInto('users')
|
|
10192
|
+
.values(emails.map((email) => ({ email, name: email.split('@')[0]! })))
|
|
10193
|
+
.onConflict((oc) => oc.column('email').doNothing())
|
|
10194
|
+
.execute();
|
|
10195
|
+
|
|
10196
|
+
const users = await tables
|
|
10197
|
+
.selectFrom('users')
|
|
10198
|
+
.select('id')
|
|
10199
|
+
.where('email', 'in', emails)
|
|
10200
|
+
.execute();
|
|
10201
|
+
const roles = await tables
|
|
10202
|
+
.selectFrom('roles')
|
|
10203
|
+
.select('id')
|
|
10204
|
+
.where('is_system', '=', true)
|
|
10205
|
+
.where('name', 'in', [SYSTEM_ROLES.Member.name, SYSTEM_ROLES.SuperAdmin.name])
|
|
10206
|
+
.execute();
|
|
10207
|
+
|
|
10208
|
+
await tables
|
|
10209
|
+
.insertInto('user_roles')
|
|
10210
|
+
.values(
|
|
10211
|
+
users.flatMap((user) =>
|
|
10212
|
+
roles.map((role) => ({ user_id: user.id!, role_id: role.id })),
|
|
10213
|
+
),
|
|
10214
|
+
)
|
|
10215
|
+
.onConflict((oc) => oc.columns(['user_id', 'role_id']).doNothing())
|
|
10216
|
+
.execute();
|
|
10217
|
+
}
|
|
10218
|
+
`
|
|
10219
|
+
};
|
|
10152
10220
|
}
|
|
10153
10221
|
//#endregion
|
|
10154
10222
|
//#region src/init/generators/monorepo.ts
|
|
@@ -10665,8 +10733,7 @@ export const logger = createLogger();
|
|
|
10665
10733
|
},
|
|
10666
10734
|
workspaceUsersMigration(),
|
|
10667
10735
|
accessControlMigration(),
|
|
10668
|
-
...accessControlSeeds(options
|
|
10669
|
-
grantAdminScript(options)
|
|
10736
|
+
...accessControlSeeds(options)
|
|
10670
10737
|
];
|
|
10671
10738
|
if (uploads) {
|
|
10672
10739
|
const bucket = storageFor();
|
|
@@ -14876,6 +14943,27 @@ function isFullstackTemplate(name) {
|
|
|
14876
14943
|
//#region src/init/index.ts
|
|
14877
14944
|
/** `' staging, prod '` → `['staging', 'prod']`. */
|
|
14878
14945
|
const stageList = (value) => value.split(",").map((name) => name.trim()).filter(Boolean);
|
|
14946
|
+
/** Whether `value` is an email address, as the API's models check one. */
|
|
14947
|
+
const isEmail = (value) => require_schemas.email().safeParse(value.trim()).success;
|
|
14948
|
+
/**
|
|
14949
|
+
* Who `git` says you are, offered as the first admin: the address you most
|
|
14950
|
+
* likely sign in with. Nothing when git has none.
|
|
14951
|
+
*/
|
|
14952
|
+
function gitEmail() {
|
|
14953
|
+
try {
|
|
14954
|
+
const email = (0, node_child_process.execSync)("git config user.email", {
|
|
14955
|
+
encoding: "utf-8",
|
|
14956
|
+
stdio: [
|
|
14957
|
+
"ignore",
|
|
14958
|
+
"pipe",
|
|
14959
|
+
"ignore"
|
|
14960
|
+
]
|
|
14961
|
+
}).trim();
|
|
14962
|
+
return isEmail(email) ? email.toLowerCase() : void 0;
|
|
14963
|
+
} catch {
|
|
14964
|
+
return;
|
|
14965
|
+
}
|
|
14966
|
+
}
|
|
14879
14967
|
/** `eu-west-1`, `us-gov-west-1`, `ap-southeast-2`. */
|
|
14880
14968
|
const AWS_REGION = /^[a-z]{2}(-gov)?-[a-z]+-\d$/;
|
|
14881
14969
|
/**
|
|
@@ -14887,6 +14975,7 @@ async function initCommand(projectName, options = {}) {
|
|
|
14887
14975
|
if (options.deploy && !deployTargetChoices.some((choice) => choice.value === options.deploy)) throw new UnknownDeployTarget(options.deploy, deployTargetChoices.map((c) => c.value));
|
|
14888
14976
|
if (options.web && !frontendFrameworkChoices.some((choice) => choice.value === options.web)) throw new UnknownWebFramework(options.web, frontendFrameworkChoices.map((c) => c.value));
|
|
14889
14977
|
if (options.region && !AWS_REGION.test(options.region)) throw new NotAnAwsRegion(options.region);
|
|
14978
|
+
if (options.adminEmail && !isEmail(options.adminEmail)) throw new NotAnEmail(options.adminEmail);
|
|
14890
14979
|
if (options.stages || options.localStage || options.protectedStage) {
|
|
14891
14980
|
const deployed = stageList(options.stages ?? "");
|
|
14892
14981
|
const problems = [
|
|
@@ -15025,6 +15114,13 @@ async function initCommand(projectName, options = {}) {
|
|
|
15025
15114
|
name: "mobileApp",
|
|
15026
15115
|
message: "Include a mobile app? (Expo, with its sign-in and a site for App Store and Play Store reviewers)",
|
|
15027
15116
|
initial: true
|
|
15117
|
+
},
|
|
15118
|
+
{
|
|
15119
|
+
type: (_prev, values) => !options.yes && !options.adminEmail && (options.template === "fullstack" || values.template === "fullstack") ? "text" : null,
|
|
15120
|
+
name: "adminEmail",
|
|
15121
|
+
message: "Admin email (the first Super admin of the admin panel):",
|
|
15122
|
+
initial: gitEmail() ?? "",
|
|
15123
|
+
validate: (value) => isEmail(value) || "An email address, like you@example.com"
|
|
15028
15124
|
}
|
|
15029
15125
|
], { onCancel });
|
|
15030
15126
|
const name = projectName || options.name || answers.name;
|
|
@@ -15059,6 +15155,7 @@ async function initCommand(projectName, options = {}) {
|
|
|
15059
15155
|
const deployTarget = options.deploy ?? (options.yes ? "none" : answers.deployTarget ?? "none");
|
|
15060
15156
|
const frontendFramework = isFullstack ? options.web ?? (options.yes ? "nextjs" : answers.frontendFramework ?? "nextjs") : void 0;
|
|
15061
15157
|
const mobileApp = isFullstack ? options.mobileApp ?? (options.yes ? true : answers.mobileApp ?? true) : void 0;
|
|
15158
|
+
const adminEmail = isFullstack ? (options.adminEmail ?? (options.yes ? gitEmail() : answers.adminEmail))?.trim().toLowerCase() : void 0;
|
|
15062
15159
|
const templateOptions = {
|
|
15063
15160
|
name,
|
|
15064
15161
|
template,
|
|
@@ -15074,7 +15171,8 @@ async function initCommand(projectName, options = {}) {
|
|
|
15074
15171
|
...deployTarget === "sst" ? { region: options.region ?? (options.yes ? "eu-west-1" : answers.region?.trim()) } : {},
|
|
15075
15172
|
constructs,
|
|
15076
15173
|
frontendFramework,
|
|
15077
|
-
...mobileApp !== void 0 ? { mobileApp } : {}
|
|
15174
|
+
...mobileApp !== void 0 ? { mobileApp } : {},
|
|
15175
|
+
...adminEmail ? { adminEmail } : {}
|
|
15078
15176
|
};
|
|
15079
15177
|
const targetDir = (0, node_path.join)(cwd, name);
|
|
15080
15178
|
const baseTemplate = getTemplate(templateOptions.template);
|
|
@@ -15313,6 +15411,14 @@ function defaultRegistry(name) {
|
|
|
15313
15411
|
return `ghcr.io/${(name ?? "my-org").toLowerCase()}`;
|
|
15314
15412
|
}
|
|
15315
15413
|
/** `--region` that is not shaped like one, e.g. `europe` for `eu-west-1`. */
|
|
15414
|
+
var NotAnEmail = class extends require_errors.GkmError {
|
|
15415
|
+
value;
|
|
15416
|
+
constructor(value) {
|
|
15417
|
+
super(`"${value}" is not an email address. Give --admin-email the address the first admin signs in with.`);
|
|
15418
|
+
this.value = value;
|
|
15419
|
+
this.name = "NotAnEmail";
|
|
15420
|
+
}
|
|
15421
|
+
};
|
|
15316
15422
|
var NotAnAwsRegion = class extends require_errors.GkmError {
|
|
15317
15423
|
region;
|
|
15318
15424
|
constructor(region) {
|
|
@@ -16032,7 +16138,7 @@ function testDatabases(reconciled) {
|
|
|
16032
16138
|
* starts without the reference data the app needs.
|
|
16033
16139
|
*/
|
|
16034
16140
|
async function migrateTestStage(workspace, env) {
|
|
16035
|
-
const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-
|
|
16141
|
+
const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-rke2Qvj2.cjs"));
|
|
16036
16142
|
const { discover } = await Promise.resolve().then(() => require("./discover-Bsr7HjqJ.cjs")).then((n) => n.discover_exports);
|
|
16037
16143
|
const sources = {};
|
|
16038
16144
|
const manifest = await discover({
|
|
@@ -16368,7 +16474,7 @@ const program = new commander.Command();
|
|
|
16368
16474
|
program.name("gkm").description("GeekMidas backend framework CLI").version(version).option("--cwd <path>", "Change working directory").option("--debug", "Enable debug mode (verbose errors with stack traces)").hook("preAction", () => {
|
|
16369
16475
|
if (program.opts().debug) enableDebug();
|
|
16370
16476
|
});
|
|
16371
|
-
program.command("init").description("Scaffold a new project").argument("[name]", "Project name").option("--template <template>", "Project template (minimal, api, fullstack, serverless, worker)").option("--skip-install", "Skip dependency installation", false).option("-y, --yes", "Skip prompts, use defaults", false).option("--monorepo", "Setup as monorepo with packages/models", false).option("--api-path <path>", "API app path in monorepo (default: apps/api)").option("--pm <manager>", "Package manager (pnpm, npm, yarn, bun)").option("--deploy <target>", "Where it deploys (dokploy, compose, sst, none)").option("--region <region>", "AWS region for an SST deploy (e.g. eu-west-1)").option("--registry <registry>", "Container registry for a compose deploy (e.g. ghcr.io/acme)").option("--stages <names>", "Deployed stages, comma-separated (e.g. staging,prod)").option("--protected-stage <name>", "Which deployed stage is production").option("--local-stage <name>", "What gkm dev runs as (e.g. dev)").option("--web <framework>", "Fullstack: what the web site and admin panel use (nextjs, tanstack-start)").option("--mobile-app", "Fullstack: include the Expo app and its store-reviewer site").option("--no-mobile-app", "Fullstack: no mobile app").action(async (name, options) => {
|
|
16477
|
+
program.command("init").description("Scaffold a new project").argument("[name]", "Project name").option("--template <template>", "Project template (minimal, api, fullstack, serverless, worker)").option("--skip-install", "Skip dependency installation", false).option("-y, --yes", "Skip prompts, use defaults", false).option("--monorepo", "Setup as monorepo with packages/models", false).option("--api-path <path>", "API app path in monorepo (default: apps/api)").option("--pm <manager>", "Package manager (pnpm, npm, yarn, bun)").option("--deploy <target>", "Where it deploys (dokploy, compose, sst, none)").option("--region <region>", "AWS region for an SST deploy (e.g. eu-west-1)").option("--registry <registry>", "Container registry for a compose deploy (e.g. ghcr.io/acme)").option("--stages <names>", "Deployed stages, comma-separated (e.g. staging,prod)").option("--protected-stage <name>", "Which deployed stage is production").option("--local-stage <name>", "What gkm dev runs as (e.g. dev)").option("--web <framework>", "Fullstack: what the web site and admin panel use (nextjs, tanstack-start)").option("--mobile-app", "Fullstack: include the Expo app and its store-reviewer site").option("--no-mobile-app", "Fullstack: no mobile app").option("--admin-email <email>", "Fullstack: who the seeds make the first Super admin").action(async (name, options) => {
|
|
16372
16478
|
try {
|
|
16373
16479
|
const globalOptions = program.opts();
|
|
16374
16480
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
@@ -16456,7 +16562,7 @@ program.command("eas:sync").description("Set up a mobile app's EAS project for a
|
|
|
16456
16562
|
try {
|
|
16457
16563
|
const globalOptions = program.opts();
|
|
16458
16564
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16459
|
-
const { easSync } = await Promise.resolve().then(() => require("./eas-
|
|
16565
|
+
const { easSync } = await Promise.resolve().then(() => require("./eas-b95MCG14.cjs"));
|
|
16460
16566
|
await easSync(options);
|
|
16461
16567
|
} catch (error) {
|
|
16462
16568
|
exitWithError(error);
|
|
@@ -16466,7 +16572,7 @@ program.command("publish").description("Ship a mobile app for a deployed stage:
|
|
|
16466
16572
|
try {
|
|
16467
16573
|
const globalOptions = program.opts();
|
|
16468
16574
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16469
|
-
const { publish, PublishModeConflict } = await Promise.resolve().then(() => require("./publish-
|
|
16575
|
+
const { publish, PublishModeConflict } = await Promise.resolve().then(() => require("./publish-B22IhdS9.cjs"));
|
|
16470
16576
|
if (options.build && options.update) throw new PublishModeConflict();
|
|
16471
16577
|
const { build, update, ...rest } = options;
|
|
16472
16578
|
await publish({
|
|
@@ -16482,7 +16588,7 @@ program.command("deploy:google-play").description("Let EAS Submit publish a mobi
|
|
|
16482
16588
|
try {
|
|
16483
16589
|
const globalOptions = program.opts();
|
|
16484
16590
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16485
|
-
const { deployGooglePlay } = await Promise.resolve().then(() => require("./googlePlay-
|
|
16591
|
+
const { deployGooglePlay } = await Promise.resolve().then(() => require("./googlePlay-C-GBRDMp.cjs"));
|
|
16486
16592
|
await deployGooglePlay(options);
|
|
16487
16593
|
} catch (error) {
|
|
16488
16594
|
exitWithError(error);
|
|
@@ -16504,7 +16610,7 @@ program.command("migrate").description("Apply each database construct's migratio
|
|
|
16504
16610
|
try {
|
|
16505
16611
|
const globalOptions = program.opts();
|
|
16506
16612
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16507
|
-
const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
16613
|
+
const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-rke2Qvj2.cjs"));
|
|
16508
16614
|
await migrateCommand({
|
|
16509
16615
|
...options,
|
|
16510
16616
|
...construct ? { construct } : {}
|
|
@@ -16517,7 +16623,7 @@ program.command("seed").description("Migrate, then run each database construct's
|
|
|
16517
16623
|
try {
|
|
16518
16624
|
const globalOptions = program.opts();
|
|
16519
16625
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16520
|
-
const { seedCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
16626
|
+
const { seedCommand } = await Promise.resolve().then(() => require("./migrate-rke2Qvj2.cjs"));
|
|
16521
16627
|
await seedCommand({
|
|
16522
16628
|
...options,
|
|
16523
16629
|
...construct ? { construct } : {}
|
|
@@ -16530,7 +16636,7 @@ program.command("migration").description("Write a construct's next migration: an
|
|
|
16530
16636
|
try {
|
|
16531
16637
|
const globalOptions = program.opts();
|
|
16532
16638
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16533
|
-
const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
16639
|
+
const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-rke2Qvj2.cjs"));
|
|
16534
16640
|
await migrationCommand({
|
|
16535
16641
|
construct,
|
|
16536
16642
|
...name ? { name } : {}
|
|
@@ -16630,7 +16736,7 @@ program.command("secrets:add").description("Build the keys a stage must be given
|
|
|
16630
16736
|
try {
|
|
16631
16737
|
const globalOptions = program.opts();
|
|
16632
16738
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16633
|
-
const { secretsAddCommand } = await Promise.resolve().then(() => require("./add-
|
|
16739
|
+
const { secretsAddCommand } = await Promise.resolve().then(() => require("./add-6VPdRbRT.cjs"));
|
|
16634
16740
|
await secretsAddCommand(options);
|
|
16635
16741
|
} catch (error) {
|
|
16636
16742
|
exitWithError(error);
|
|
@@ -16640,7 +16746,7 @@ program.command("encryption:rotate").description("Add a new current key to an En
|
|
|
16640
16746
|
try {
|
|
16641
16747
|
const globalOptions = program.opts();
|
|
16642
16748
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16643
|
-
const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption
|
|
16749
|
+
const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption-C_NRQ9cY.cjs"));
|
|
16644
16750
|
await encryptionRotateCommand(construct, options);
|
|
16645
16751
|
} catch (error) {
|
|
16646
16752
|
exitWithError(error);
|
|
@@ -16650,7 +16756,7 @@ program.command("encryption:retire").description("Remove an old key from an Encr
|
|
|
16650
16756
|
try {
|
|
16651
16757
|
const globalOptions = program.opts();
|
|
16652
16758
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16653
|
-
const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption
|
|
16759
|
+
const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption-C_NRQ9cY.cjs"));
|
|
16654
16760
|
await encryptionRetireCommand(construct, key, options);
|
|
16655
16761
|
} catch (error) {
|
|
16656
16762
|
exitWithError(error);
|
|
@@ -16689,7 +16795,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
16689
16795
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16690
16796
|
const { loadWorkspaceConfig } = await Promise.resolve().then(() => require("./config.cjs"));
|
|
16691
16797
|
const { reconcileMissingSecrets } = await Promise.resolve().then(() => require("./reconcile-CuCQBa5-.cjs"));
|
|
16692
|
-
const { secretsStoreFor } = await Promise.resolve().then(() => require("./seeds-
|
|
16798
|
+
const { secretsStoreFor } = await Promise.resolve().then(() => require("./seeds-CF9Nx6_g.cjs")).then((n) => n.store_exports);
|
|
16693
16799
|
const { workspace } = await loadWorkspaceConfig();
|
|
16694
16800
|
const stage = options.stage ?? workspace.stages.local;
|
|
16695
16801
|
const store = await secretsStoreFor(workspace, stage);
|
|
@@ -16698,7 +16804,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
16698
16804
|
console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
|
|
16699
16805
|
process.exit(1);
|
|
16700
16806
|
}
|
|
16701
|
-
const { derivedContainers } = await Promise.resolve().then(() => require("./seeds-
|
|
16807
|
+
const { derivedContainers } = await Promise.resolve().then(() => require("./seeds-CF9Nx6_g.cjs")).then((n) => n.workspace_exports);
|
|
16702
16808
|
const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
|
|
16703
16809
|
if (!result) {
|
|
16704
16810
|
console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
|
|
@@ -16715,14 +16821,14 @@ program.command("secrets:migrate").description("Copy a deployed stage's secrets
|
|
|
16715
16821
|
try {
|
|
16716
16822
|
const globalOptions = program.opts();
|
|
16717
16823
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16718
|
-
const { secretsMigrateCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
16824
|
+
const { secretsMigrateCommand } = await Promise.resolve().then(() => require("./migrate-BndHuwqw.cjs"));
|
|
16719
16825
|
await secretsMigrateCommand(options);
|
|
16720
16826
|
} catch (error) {
|
|
16721
16827
|
exitWithError(error);
|
|
16722
16828
|
}
|
|
16723
16829
|
});
|
|
16724
16830
|
program.command("deploy").description("Deploy a stage through its target").option("--target <name>", "Deploy target: dokploy, compose, sst, or one named in deploy.targets (default: deploy.default)").option("--provider <provider>", "[DEPRECATED] Use --target instead").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").option("--tag <tag>", "Image tag (default: stage-timestamp; compose: the commit). Compose pulls a given tag").option("--skip-push", "Skip pushing image to registry").option("--skip-build", "Skip build step (use existing build)").option("--json", "Write events as JSON lines instead of progress; never prompts").option("--dry-run", "Show what would be created or reused; change, build and push nothing").option("--atomic", "If the release fails, roll back every app it released, not only the failed ones").option("--allow-dev-services", "Server targets: run the dev service (MinIO, Mailpit) for every bucket and mail the stage doesn't account for. Not production-grade").option("--skip-dns", "Compose: neither write the public hosts' DNS records nor check they point at GKM_SERVER_IPV4 (a CDN or proxy in front, or records written elsewhere)").option("--rotate-keys", "Deployed stage: each provider issues its runtime keys a successor (the old one is deleted by the next deploy)").option("--retire-old-keys", "Deployed stage: delete a rotated-out key now instead of on the next deploy").action(async (options) => {
|
|
16725
|
-
const { deployCli } = await Promise.resolve().then(() => require("./cli-
|
|
16831
|
+
const { deployCli } = await Promise.resolve().then(() => require("./cli-CQ2ij0Mi.cjs"));
|
|
16726
16832
|
const globalOptions = program.opts();
|
|
16727
16833
|
const code = await deployCli({
|
|
16728
16834
|
cwd: (0, node_path.resolve)(globalOptions.cwd ?? process.cwd()),
|
|
@@ -16742,7 +16848,7 @@ program.command("deploy").description("Deploy a stage through its target").optio
|
|
|
16742
16848
|
});
|
|
16743
16849
|
program.command("deploy:rollback").description("Put a stage's app back on its previous release (Dokploy): one app with --app, every app with --atomic").requiredOption("--stage <stage>", "A deployed stage").option("--app <app>", "The app to roll back").option("--atomic", "Roll back every app that has an earlier release").action(async (options) => {
|
|
16744
16850
|
try {
|
|
16745
|
-
const { rollbackStage } = await Promise.resolve().then(() => require("./rollback-
|
|
16851
|
+
const { rollbackStage } = await Promise.resolve().then(() => require("./rollback-Lj9bQvHq.cjs")).then((n) => n.rollback_exports);
|
|
16746
16852
|
const { terminalCredentials } = await Promise.resolve().then(() => require("./terminal-D_NRPW4W.cjs"));
|
|
16747
16853
|
const globalOptions = program.opts();
|
|
16748
16854
|
await rollbackStage({
|
|
@@ -16761,7 +16867,7 @@ program.command("compose:server").description("Set up a stage's server for compo
|
|
|
16761
16867
|
try {
|
|
16762
16868
|
const globalOptions = program.opts();
|
|
16763
16869
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16764
|
-
const { composeServerCommand } = await Promise.resolve().then(() => require("./serverSetup-
|
|
16870
|
+
const { composeServerCommand } = await Promise.resolve().then(() => require("./serverSetup-CbuJK4zg.cjs"));
|
|
16765
16871
|
await composeServerCommand(options);
|
|
16766
16872
|
} catch (error) {
|
|
16767
16873
|
exitWithError(error);
|
|
@@ -16786,7 +16892,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
|
|
|
16786
16892
|
try {
|
|
16787
16893
|
const globalOptions = program.opts();
|
|
16788
16894
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16789
|
-
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-
|
|
16895
|
+
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-D5Ck3srU.cjs"));
|
|
16790
16896
|
await deployGithubCommand(options);
|
|
16791
16897
|
} catch (error) {
|
|
16792
16898
|
exitWithError(error);
|