@geekmidas/cli 10.0.0-alpha.117 → 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-DY4QFpCg.cjs → GoDaddyProvider-B6SPHBCU.cjs} +2 -2
- package/dist/{GoDaddyProvider-DY4QFpCg.cjs.map → GoDaddyProvider-B6SPHBCU.cjs.map} +1 -1
- package/dist/{GoDaddyProvider-I3WR0Irc.mjs → GoDaddyProvider-CcjbFkLt.mjs} +2 -2
- package/dist/{GoDaddyProvider-I3WR0Irc.mjs.map → GoDaddyProvider-CcjbFkLt.mjs.map} +1 -1
- package/dist/{LegacyStateStore-E2rUw9Vu.cjs → LegacyStateStore-2l5jw_VI.cjs} +3 -3
- package/dist/{LegacyStateStore-E2rUw9Vu.cjs.map → LegacyStateStore-2l5jw_VI.cjs.map} +1 -1
- package/dist/{LegacyStateStore-RG7min0B.mjs → LegacyStateStore-D-D6r_JT.mjs} +3 -3
- package/dist/{LegacyStateStore-RG7min0B.mjs.map → LegacyStateStore-D-D6r_JT.mjs.map} +1 -1
- package/dist/{LocalStateStore-kI2cUMCn.mjs → LocalStateStore-DIAY7j1O.mjs} +2 -2
- package/dist/{LocalStateStore-kI2cUMCn.mjs.map → LocalStateStore-DIAY7j1O.mjs.map} +1 -1
- package/dist/{LocalStateStore-CjzhVPcn.cjs → LocalStateStore-Dg3rvwwe.cjs} +2 -2
- package/dist/{LocalStateStore-CjzhVPcn.cjs.map → LocalStateStore-Dg3rvwwe.cjs.map} +1 -1
- package/dist/{S3StateStore-DZ8TCie0.mjs → S3StateStore-BKi1eamw.mjs} +2 -2
- package/dist/{S3StateStore-DZ8TCie0.mjs.map → S3StateStore-BKi1eamw.mjs.map} +1 -1
- package/dist/{S3StateStore-C-IrziGt.cjs → S3StateStore-BdcgQNhO.cjs} +2 -2
- package/dist/{S3StateStore-C-IrziGt.cjs.map → S3StateStore-BdcgQNhO.cjs.map} +1 -1
- package/dist/{SSMStateStore-WRcHtpTy.cjs → SSMStateStore-CS-pAKT9.cjs} +2 -2
- package/dist/{SSMStateStore-WRcHtpTy.cjs.map → SSMStateStore-CS-pAKT9.cjs.map} +1 -1
- package/dist/{SSMStateStore-BqCLuXrh.mjs → SSMStateStore-DHgaNW75.mjs} +2 -2
- package/dist/{SSMStateStore-BqCLuXrh.mjs.map → SSMStateStore-DHgaNW75.mjs.map} +1 -1
- package/dist/{add-D31_V4oL.cjs → add-6VPdRbRT.cjs} +3 -3
- package/dist/{add-D31_V4oL.cjs.map → add-6VPdRbRT.cjs.map} +1 -1
- package/dist/{add-CZYOIVw8.mjs → add-BcZXHa3Z.mjs} +3 -3
- package/dist/{add-CZYOIVw8.mjs.map → add-BcZXHa3Z.mjs.map} +1 -1
- package/dist/{bundler-BADrhw79.mjs → bundler-Ciim6amq.mjs} +5 -5
- package/dist/{bundler-BADrhw79.mjs.map → bundler-Ciim6amq.mjs.map} +1 -1
- package/dist/{bundler-BY_-iPge.cjs → bundler-jjWtQ882.cjs} +5 -5
- package/dist/{bundler-BY_-iPge.cjs.map → bundler-jjWtQ882.cjs.map} +1 -1
- package/dist/{cli-BI2wjJaB.mjs → cli-BkxlWYfI.mjs} +2 -2
- package/dist/{cli-BI2wjJaB.mjs.map → cli-BkxlWYfI.mjs.map} +1 -1
- package/dist/{cli-CfB5RjJS.cjs → cli-CQ2ij0Mi.cjs} +2 -2
- package/dist/{cli-CfB5RjJS.cjs.map → cli-CQ2ij0Mi.cjs.map} +1 -1
- package/dist/{compose-BEMY3EwM.cjs → compose-JOasAHcd.cjs} +3 -3
- package/dist/{compose-BEMY3EwM.cjs.map → compose-JOasAHcd.cjs.map} +1 -1
- package/dist/{compose-C9VN0iMJ.mjs → compose-qLTNYJAY.mjs} +3 -3
- package/dist/{compose-C9VN0iMJ.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-Ch45lV7q.cjs → deploy-D-liNXfx.cjs} +5 -5
- package/dist/{deploy-Ch45lV7q.cjs.map → deploy-D-liNXfx.cjs.map} +1 -1
- package/dist/{deploy-BD70bgTu.mjs → deploy-_g-2dX38.mjs} +5 -5
- package/dist/{deploy-BD70bgTu.mjs.map → deploy-_g-2dX38.mjs.map} +1 -1
- package/dist/{dns-thzjBFvQ.mjs → dns-DGq4xkJT.mjs} +2 -2
- package/dist/{dns-thzjBFvQ.mjs.map → dns-DGq4xkJT.mjs.map} +1 -1
- package/dist/{dns-0tfef9SR.cjs → dns-DfQKqAyt.cjs} +2 -2
- package/dist/{dns-0tfef9SR.cjs.map → dns-DfQKqAyt.cjs.map} +1 -1
- package/dist/{dokploy-QvxY0Ywi.mjs → dokploy-ClIPZaPH.mjs} +2 -2
- package/dist/{dokploy-QvxY0Ywi.mjs.map → dokploy-ClIPZaPH.mjs.map} +1 -1
- package/dist/{dokploy-B3wEC6-2.cjs → dokploy-D17I2BCE.cjs} +2 -2
- package/dist/{dokploy-B3wEC6-2.cjs.map → dokploy-D17I2BCE.cjs.map} +1 -1
- package/dist/{eas-C5UZCZER.mjs → eas-DJXhARYb.mjs} +2 -2
- package/dist/{eas-C5UZCZER.mjs.map → eas-DJXhARYb.mjs.map} +1 -1
- package/dist/{eas-C8lIhY8B.cjs → eas-b95MCG14.cjs} +2 -2
- package/dist/{eas-C8lIhY8B.cjs.map → eas-b95MCG14.cjs.map} +1 -1
- package/dist/{encryption-xgKJ_098.cjs → encryption-C_NRQ9cY.cjs} +2 -2
- package/dist/{encryption-xgKJ_098.cjs.map → encryption-C_NRQ9cY.cjs.map} +1 -1
- package/dist/{encryption-BhAA51gs.mjs → encryption-CldvLtip.mjs} +2 -2
- package/dist/{encryption-BhAA51gs.mjs.map → encryption-CldvLtip.mjs.map} +1 -1
- package/dist/{engine-CV0krWXP.mjs → engine-BBnTj8OD.mjs} +12 -6
- package/dist/engine-BBnTj8OD.mjs.map +1 -0
- package/dist/{engine-BCC7wUqs.cjs → engine-CKfdvEVt.cjs} +11 -5
- package/dist/engine-CKfdvEVt.cjs.map +1 -0
- package/dist/{github-BASpyAs7.mjs → github-BMPci2wg.mjs} +4 -4
- package/dist/{github-BASpyAs7.mjs.map → github-BMPci2wg.mjs.map} +1 -1
- package/dist/{github-CeeFKscD.cjs → github-D5Ck3srU.cjs} +4 -4
- package/dist/{github-CeeFKscD.cjs.map → github-D5Ck3srU.cjs.map} +1 -1
- package/dist/{googlePlay-C7sOjdR5.cjs → googlePlay-C-GBRDMp.cjs} +3 -3
- package/dist/{googlePlay-C7sOjdR5.cjs.map → googlePlay-C-GBRDMp.cjs.map} +1 -1
- package/dist/{googlePlay-CD2Y0j8c.mjs → googlePlay-fw0VWly7.mjs} +3 -3
- package/dist/{googlePlay-CD2Y0j8c.mjs.map → googlePlay-fw0VWly7.mjs.map} +1 -1
- package/dist/index.cjs +235 -133
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +235 -133
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-Ba-pFRWc.mjs → migrate-1bHqjfIe.mjs} +2 -2
- package/dist/{migrate-Ba-pFRWc.mjs.map → migrate-1bHqjfIe.mjs.map} +1 -1
- package/dist/{migrate-Bmgy1mh4.cjs → migrate-BndHuwqw.cjs} +2 -2
- package/dist/{migrate-Bmgy1mh4.cjs.map → migrate-BndHuwqw.cjs.map} +1 -1
- package/dist/{migrate-BSnZFik_.mjs → migrate-WyWhSivN.mjs} +2 -2
- package/dist/{migrate-BSnZFik_.mjs.map → migrate-WyWhSivN.mjs.map} +1 -1
- package/dist/{migrate-D8HKeUGo.cjs → migrate-rke2Qvj2.cjs} +2 -2
- package/dist/{migrate-D8HKeUGo.cjs.map → migrate-rke2Qvj2.cjs.map} +1 -1
- package/dist/{publish-Cfe-drEb.cjs → publish-B22IhdS9.cjs} +2 -2
- package/dist/{publish-Cfe-drEb.cjs.map → publish-B22IhdS9.cjs.map} +1 -1
- package/dist/{publish-BOivOLLp.mjs → publish-BBG4zx8E.mjs} +2 -2
- package/dist/{publish-BOivOLLp.mjs.map → publish-BBG4zx8E.mjs.map} +1 -1
- package/dist/{resolve-CsJ1zX6m.mjs → resolve-CC6ndodR.mjs} +3 -3
- package/dist/{resolve-CsJ1zX6m.mjs.map → resolve-CC6ndodR.mjs.map} +1 -1
- package/dist/{resolve-BHR-Ewxo.cjs → resolve-isFTuJp4.cjs} +3 -3
- package/dist/{resolve-BHR-Ewxo.cjs.map → resolve-isFTuJp4.cjs.map} +1 -1
- package/dist/{rollback-j38F1Jn-.mjs → rollback-DaEmEC2Y.mjs} +4 -4
- package/dist/{rollback-j38F1Jn-.mjs.map → rollback-DaEmEC2Y.mjs.map} +1 -1
- package/dist/{rollback-B4yQkUSH.cjs → rollback-Lj9bQvHq.cjs} +4 -4
- package/dist/{rollback-B4yQkUSH.cjs.map → rollback-Lj9bQvHq.cjs.map} +1 -1
- package/dist/{seeds-DWaiMMi3.cjs → seeds-CF9Nx6_g.cjs} +33 -6
- package/dist/seeds-CF9Nx6_g.cjs.map +1 -0
- package/dist/{seeds-h4Wf-_hA.mjs → seeds-CYzoBDg2.mjs} +33 -6
- package/dist/seeds-CYzoBDg2.mjs.map +1 -0
- package/dist/{serverSetup-CKqCaDhI.mjs → serverSetup-0h1Vh5un.mjs} +5 -5
- package/dist/{serverSetup-CKqCaDhI.mjs.map → serverSetup-0h1Vh5un.mjs.map} +1 -1
- package/dist/{serverSetup-Dog5151C.cjs → serverSetup-CbuJK4zg.cjs} +5 -5
- package/dist/{serverSetup-Dog5151C.cjs.map → serverSetup-CbuJK4zg.cjs.map} +1 -1
- package/dist/{sniffer-Dilwm65v.mjs → sniffer-CRJHtBaK.mjs} +6 -6
- package/dist/{sniffer-Dilwm65v.mjs.map → sniffer-CRJHtBaK.mjs.map} +1 -1
- package/dist/{sniffer-B99iLT79.cjs → sniffer-Dz3Va1Jo.cjs} +6 -6
- package/dist/{sniffer-B99iLT79.cjs.map → sniffer-Dz3Va1Jo.cjs.map} +1 -1
- package/dist/{stage-dG5B6nC9.mjs → stage-CIo8s2WT.mjs} +4 -4
- package/dist/{stage-dG5B6nC9.mjs.map → stage-CIo8s2WT.mjs.map} +1 -1
- package/dist/{stage-D1Qmw-Pd.cjs → stage-y9qFelxT.cjs} +4 -4
- package/dist/{stage-D1Qmw-Pd.cjs.map → stage-y9qFelxT.cjs.map} +1 -1
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.mjs +1 -1
- package/package.json +15 -15
- package/dist/engine-BCC7wUqs.cjs.map +0 -1
- package/dist/engine-CV0krWXP.mjs.map +0 -1
- package/dist/seeds-DWaiMMi3.cjs.map +0 -1
- package/dist/seeds-h4Wf-_hA.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -4,25 +4,26 @@ 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
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
28
|
const require_ready = require("./ready-gc9IFByS.cjs");
|
|
28
29
|
let node_path = require("node:path");
|
|
@@ -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"),
|
|
@@ -4034,7 +4035,7 @@ async function buildWorkers(input) {
|
|
|
4034
4035
|
});
|
|
4035
4036
|
logger$4.log(`Generated worker ${worker.id}: ${crons.length} crons, ${queues.length} queues, ${subscribers.length} subscribers`);
|
|
4036
4037
|
if (!input.bundle) continue;
|
|
4037
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
4038
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-jjWtQ882.cjs"));
|
|
4038
4039
|
const outfile = require_seeds.workerBundleName(worker.id);
|
|
4039
4040
|
await bundleServer({
|
|
4040
4041
|
entryPoint,
|
|
@@ -4120,7 +4121,7 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
|
|
|
4120
4121
|
let masterKey;
|
|
4121
4122
|
if (context.production?.bundle && !skipBundle) {
|
|
4122
4123
|
logger$4.log(`\n📦 Bundling production server...`);
|
|
4123
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
4124
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-jjWtQ882.cjs"));
|
|
4124
4125
|
const allConstructs = [
|
|
4125
4126
|
...endpoints.map((e) => e.construct),
|
|
4126
4127
|
...functions.map((f) => f.construct),
|
|
@@ -5954,25 +5955,25 @@ function loadPackageJson() {
|
|
|
5954
5955
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
5955
5956
|
*/
|
|
5956
5957
|
const GEEKMIDAS_VERSIONS = {
|
|
5957
|
-
"@geekmidas/audit": "~10.0.0-alpha.
|
|
5958
|
-
"@geekmidas/auth": "~10.0.0-alpha.
|
|
5959
|
-
"@geekmidas/cache": "~10.0.0-alpha.
|
|
5960
|
-
"@geekmidas/client": "~10.0.0-alpha.
|
|
5961
|
-
"@geekmidas/cloud": "~10.0.0-alpha.
|
|
5962
|
-
"@geekmidas/constructs": "~10.0.0-alpha.
|
|
5963
|
-
"@geekmidas/db": "~10.0.0-alpha.
|
|
5964
|
-
"@geekmidas/emailkit": "~10.0.0-alpha.
|
|
5965
|
-
"@geekmidas/envkit": "~10.0.0-alpha.
|
|
5966
|
-
"@geekmidas/errors": "~10.0.0-alpha.
|
|
5967
|
-
"@geekmidas/events": "~10.0.0-alpha.
|
|
5968
|
-
"@geekmidas/logger": "~10.0.0-alpha.
|
|
5969
|
-
"@geekmidas/manifest": "~10.0.0-alpha.
|
|
5970
|
-
"@geekmidas/rate-limit": "~10.0.0-alpha.
|
|
5971
|
-
"@geekmidas/schema": "~10.0.0-alpha.
|
|
5972
|
-
"@geekmidas/services": "~10.0.0-alpha.
|
|
5973
|
-
"@geekmidas/storage": "~10.0.0-alpha.
|
|
5974
|
-
"@geekmidas/telescope": "~10.0.0-alpha.
|
|
5975
|
-
"@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",
|
|
5976
5977
|
"@geekmidas/cli": `~${loadPackageJson().version}`
|
|
5977
5978
|
};
|
|
5978
5979
|
//#endregion
|
|
@@ -7165,7 +7166,7 @@ const COMMIT = /^[0-9a-f]{40}$/;
|
|
|
7165
7166
|
* The `uses:` value for the stages action, with a comment saying which CLI
|
|
7166
7167
|
* release the pinned commit is.
|
|
7167
7168
|
*/
|
|
7168
|
-
function stagesActionUses(commit = "
|
|
7169
|
+
function stagesActionUses(commit = "01a325bb2dfb75faf9c255cb3f1d9288c6c42c1e", version = cliVersion()) {
|
|
7169
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`;
|
|
7170
7171
|
}
|
|
7171
7172
|
//#endregion
|
|
@@ -9076,6 +9077,10 @@ interface SignedIn {
|
|
|
9076
9077
|
* The \`users\` row for whoever signed in, made the first time they call the
|
|
9077
9078
|
* API and given the Member role. The auth server owns who someone is; this
|
|
9078
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.
|
|
9079
9084
|
*/
|
|
9080
9085
|
export async function memberFor(db: Kysely<Database>, user: SignedIn) {
|
|
9081
9086
|
const found = await db
|
|
@@ -9085,13 +9090,23 @@ export async function memberFor(db: Kysely<Database>, user: SignedIn) {
|
|
|
9085
9090
|
.executeTakeFirst();
|
|
9086
9091
|
if (found) return found;
|
|
9087
9092
|
|
|
9088
|
-
const member =
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
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());
|
|
9095
9110
|
|
|
9096
9111
|
const memberRole = await db
|
|
9097
9112
|
.selectFrom('roles')
|
|
@@ -9254,65 +9269,6 @@ export const AdminUsersSchema = z
|
|
|
9254
9269
|
}];
|
|
9255
9270
|
}
|
|
9256
9271
|
/**
|
|
9257
|
-
* `scripts/grant-admin.ts`: the first Super admin. Nobody can grant a role
|
|
9258
|
-
* before someone has one, so the first is granted from a terminal.
|
|
9259
|
-
*/
|
|
9260
|
-
function grantAdminScript(options) {
|
|
9261
|
-
return {
|
|
9262
|
-
path: "scripts/grant-admin.ts",
|
|
9263
|
-
content: `/**
|
|
9264
|
-
* Make someone a Super admin — the first one, before the admin panel can.
|
|
9265
|
-
*
|
|
9266
|
-
* gkm exec -- tsx scripts/grant-admin.ts you@example.com
|
|
9267
|
-
*
|
|
9268
|
-
* They need to have signed in once (the web site, the admin panel or the app),
|
|
9269
|
-
* which is what makes their \`users\` row.
|
|
9270
|
-
*/
|
|
9271
|
-
import { database } from '@${options.name}/constructs/database.ts';
|
|
9272
|
-
import { SYSTEM_ROLES } from '@${options.name}/models/access';
|
|
9273
|
-
import { EnvironmentParser } from '@geekmidas/envkit';
|
|
9274
|
-
|
|
9275
|
-
const email = process.argv[2]?.trim().toLowerCase();
|
|
9276
|
-
if (!email) {
|
|
9277
|
-
console.error('Usage: gkm exec -- tsx scripts/grant-admin.ts <email>');
|
|
9278
|
-
process.exit(1);
|
|
9279
|
-
}
|
|
9280
|
-
|
|
9281
|
-
const db = await database.service.register({
|
|
9282
|
-
envParser: new EnvironmentParser({ ...process.env }),
|
|
9283
|
-
} as never);
|
|
9284
|
-
|
|
9285
|
-
try {
|
|
9286
|
-
const user = await db
|
|
9287
|
-
.selectFrom('users')
|
|
9288
|
-
.select('id')
|
|
9289
|
-
.where('email', '=', email)
|
|
9290
|
-
.executeTakeFirst();
|
|
9291
|
-
if (!user) {
|
|
9292
|
-
console.error(\`No one has signed in as \${email} yet. Sign in once, then run this again.\`);
|
|
9293
|
-
process.exit(1);
|
|
9294
|
-
}
|
|
9295
|
-
|
|
9296
|
-
const role = await db
|
|
9297
|
-
.selectFrom('roles')
|
|
9298
|
-
.select('id')
|
|
9299
|
-
.where('name', '=', SYSTEM_ROLES.SuperAdmin.name)
|
|
9300
|
-
.executeTakeFirstOrThrow();
|
|
9301
|
-
|
|
9302
|
-
await db
|
|
9303
|
-
.insertInto('userRoles')
|
|
9304
|
-
.values({ userId: user.id, roleId: role.id })
|
|
9305
|
-
.onConflict((oc) => oc.columns(['userId', 'roleId']).doNothing())
|
|
9306
|
-
.execute();
|
|
9307
|
-
|
|
9308
|
-
console.log(\`\${email} is a \${SYSTEM_ROLES.SuperAdmin.name}.\`);
|
|
9309
|
-
} finally {
|
|
9310
|
-
await db.destroy();
|
|
9311
|
-
}
|
|
9312
|
-
`
|
|
9313
|
-
};
|
|
9314
|
-
}
|
|
9315
|
-
/**
|
|
9316
9272
|
* The API's feature tests: signing in by email end to end, and the admin
|
|
9317
9273
|
* panel's gate. Each runs in a transaction, against the real auth server and
|
|
9318
9274
|
* the real mail catcher.
|
|
@@ -9375,6 +9331,39 @@ describe('the admin panel', () => {
|
|
|
9375
9331
|
|
|
9376
9332
|
expect(users).toContainEqual(expect.objectContaining({ id: me.id }));
|
|
9377
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
|
+
});
|
|
9378
9367
|
});
|
|
9379
9368
|
`;
|
|
9380
9369
|
}
|
|
@@ -9673,9 +9662,11 @@ export interface Database {
|
|
|
9673
9662
|
id: Generated<string>;
|
|
9674
9663
|
/**
|
|
9675
9664
|
* The Better Auth user this person signs in as. The auth schema is its
|
|
9676
|
-
* 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.
|
|
9677
9668
|
*/
|
|
9678
|
-
authUserId: string;
|
|
9669
|
+
authUserId: string | null;
|
|
9679
9670
|
name: string;
|
|
9680
9671
|
email: string;
|
|
9681
9672
|
createdAt: Generated<Date>;
|
|
@@ -9962,8 +9953,9 @@ export async function up(db: Kysely<unknown>): Promise<void> {
|
|
|
9962
9953
|
col.primaryKey().defaultTo(db.fn('gen_random_uuid')),
|
|
9963
9954
|
)
|
|
9964
9955
|
// The Better Auth user this person signs in as. A plain column: the auth
|
|
9965
|
-
// schema is its own, and the id's format is Better Auth's to choose.
|
|
9966
|
-
|
|
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())
|
|
9967
9959
|
.addColumn('name', 'varchar(255)', (col) => col.notNull())
|
|
9968
9960
|
.addColumn('email', 'varchar(255)', (col) => col.notNull().unique())
|
|
9969
9961
|
.addColumn('created_at', 'timestamptz', (col) =>
|
|
@@ -10068,11 +10060,13 @@ export async function down(db: Kysely<unknown>): Promise<void> {
|
|
|
10068
10060
|
* upserts, run after every migration, so a changed list is applied by running
|
|
10069
10061
|
* them again.
|
|
10070
10062
|
*/
|
|
10071
|
-
function accessControlSeeds(
|
|
10063
|
+
function accessControlSeeds(options) {
|
|
10064
|
+
const { name } = options;
|
|
10072
10065
|
const folder = (0, _geekmidas_manifest.seedFolder)(databaseFor().id);
|
|
10073
|
-
return [
|
|
10074
|
-
|
|
10075
|
-
|
|
10066
|
+
return [
|
|
10067
|
+
{
|
|
10068
|
+
path: `${folder}/01_permissions.ts`,
|
|
10069
|
+
content: `import { PERMISSION_KEYS, PERMISSIONS } from '@${name}/models/access';
|
|
10076
10070
|
import type { Kysely } from 'kysely';
|
|
10077
10071
|
|
|
10078
10072
|
type Tables = { permissions: { key: string; description: string } };
|
|
@@ -10103,9 +10097,10 @@ export async function seed(db: Kysely<unknown>): Promise<void> {
|
|
|
10103
10097
|
.execute();
|
|
10104
10098
|
}
|
|
10105
10099
|
`
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
|
|
10100
|
+
},
|
|
10101
|
+
{
|
|
10102
|
+
path: `${folder}/02_system_roles.ts`,
|
|
10103
|
+
content: `import { SYSTEM_ROLES } from '@${name}/models/access';
|
|
10109
10104
|
import type { Kysely } from 'kysely';
|
|
10110
10105
|
|
|
10111
10106
|
type Tables = {
|
|
@@ -10152,7 +10147,76 @@ export async function seed(db: Kysely<unknown>): Promise<void> {
|
|
|
10152
10147
|
}
|
|
10153
10148
|
}
|
|
10154
10149
|
`
|
|
10155
|
-
|
|
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
|
+
};
|
|
10156
10220
|
}
|
|
10157
10221
|
//#endregion
|
|
10158
10222
|
//#region src/init/generators/monorepo.ts
|
|
@@ -10669,8 +10733,7 @@ export const logger = createLogger();
|
|
|
10669
10733
|
},
|
|
10670
10734
|
workspaceUsersMigration(),
|
|
10671
10735
|
accessControlMigration(),
|
|
10672
|
-
...accessControlSeeds(options
|
|
10673
|
-
grantAdminScript(options)
|
|
10736
|
+
...accessControlSeeds(options)
|
|
10674
10737
|
];
|
|
10675
10738
|
if (uploads) {
|
|
10676
10739
|
const bucket = storageFor();
|
|
@@ -14880,6 +14943,27 @@ function isFullstackTemplate(name) {
|
|
|
14880
14943
|
//#region src/init/index.ts
|
|
14881
14944
|
/** `' staging, prod '` → `['staging', 'prod']`. */
|
|
14882
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
|
+
}
|
|
14883
14967
|
/** `eu-west-1`, `us-gov-west-1`, `ap-southeast-2`. */
|
|
14884
14968
|
const AWS_REGION = /^[a-z]{2}(-gov)?-[a-z]+-\d$/;
|
|
14885
14969
|
/**
|
|
@@ -14891,6 +14975,7 @@ async function initCommand(projectName, options = {}) {
|
|
|
14891
14975
|
if (options.deploy && !deployTargetChoices.some((choice) => choice.value === options.deploy)) throw new UnknownDeployTarget(options.deploy, deployTargetChoices.map((c) => c.value));
|
|
14892
14976
|
if (options.web && !frontendFrameworkChoices.some((choice) => choice.value === options.web)) throw new UnknownWebFramework(options.web, frontendFrameworkChoices.map((c) => c.value));
|
|
14893
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);
|
|
14894
14979
|
if (options.stages || options.localStage || options.protectedStage) {
|
|
14895
14980
|
const deployed = stageList(options.stages ?? "");
|
|
14896
14981
|
const problems = [
|
|
@@ -15029,6 +15114,13 @@ async function initCommand(projectName, options = {}) {
|
|
|
15029
15114
|
name: "mobileApp",
|
|
15030
15115
|
message: "Include a mobile app? (Expo, with its sign-in and a site for App Store and Play Store reviewers)",
|
|
15031
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"
|
|
15032
15124
|
}
|
|
15033
15125
|
], { onCancel });
|
|
15034
15126
|
const name = projectName || options.name || answers.name;
|
|
@@ -15063,6 +15155,7 @@ async function initCommand(projectName, options = {}) {
|
|
|
15063
15155
|
const deployTarget = options.deploy ?? (options.yes ? "none" : answers.deployTarget ?? "none");
|
|
15064
15156
|
const frontendFramework = isFullstack ? options.web ?? (options.yes ? "nextjs" : answers.frontendFramework ?? "nextjs") : void 0;
|
|
15065
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;
|
|
15066
15159
|
const templateOptions = {
|
|
15067
15160
|
name,
|
|
15068
15161
|
template,
|
|
@@ -15078,7 +15171,8 @@ async function initCommand(projectName, options = {}) {
|
|
|
15078
15171
|
...deployTarget === "sst" ? { region: options.region ?? (options.yes ? "eu-west-1" : answers.region?.trim()) } : {},
|
|
15079
15172
|
constructs,
|
|
15080
15173
|
frontendFramework,
|
|
15081
|
-
...mobileApp !== void 0 ? { mobileApp } : {}
|
|
15174
|
+
...mobileApp !== void 0 ? { mobileApp } : {},
|
|
15175
|
+
...adminEmail ? { adminEmail } : {}
|
|
15082
15176
|
};
|
|
15083
15177
|
const targetDir = (0, node_path.join)(cwd, name);
|
|
15084
15178
|
const baseTemplate = getTemplate(templateOptions.template);
|
|
@@ -15317,6 +15411,14 @@ function defaultRegistry(name) {
|
|
|
15317
15411
|
return `ghcr.io/${(name ?? "my-org").toLowerCase()}`;
|
|
15318
15412
|
}
|
|
15319
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
|
+
};
|
|
15320
15422
|
var NotAnAwsRegion = class extends require_errors.GkmError {
|
|
15321
15423
|
region;
|
|
15322
15424
|
constructor(region) {
|
|
@@ -16036,7 +16138,7 @@ function testDatabases(reconciled) {
|
|
|
16036
16138
|
* starts without the reference data the app needs.
|
|
16037
16139
|
*/
|
|
16038
16140
|
async function migrateTestStage(workspace, env) {
|
|
16039
|
-
const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-
|
|
16141
|
+
const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-rke2Qvj2.cjs"));
|
|
16040
16142
|
const { discover } = await Promise.resolve().then(() => require("./discover-Bsr7HjqJ.cjs")).then((n) => n.discover_exports);
|
|
16041
16143
|
const sources = {};
|
|
16042
16144
|
const manifest = await discover({
|
|
@@ -16372,7 +16474,7 @@ const program = new commander.Command();
|
|
|
16372
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", () => {
|
|
16373
16475
|
if (program.opts().debug) enableDebug();
|
|
16374
16476
|
});
|
|
16375
|
-
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) => {
|
|
16376
16478
|
try {
|
|
16377
16479
|
const globalOptions = program.opts();
|
|
16378
16480
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
@@ -16460,7 +16562,7 @@ program.command("eas:sync").description("Set up a mobile app's EAS project for a
|
|
|
16460
16562
|
try {
|
|
16461
16563
|
const globalOptions = program.opts();
|
|
16462
16564
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16463
|
-
const { easSync } = await Promise.resolve().then(() => require("./eas-
|
|
16565
|
+
const { easSync } = await Promise.resolve().then(() => require("./eas-b95MCG14.cjs"));
|
|
16464
16566
|
await easSync(options);
|
|
16465
16567
|
} catch (error) {
|
|
16466
16568
|
exitWithError(error);
|
|
@@ -16470,7 +16572,7 @@ program.command("publish").description("Ship a mobile app for a deployed stage:
|
|
|
16470
16572
|
try {
|
|
16471
16573
|
const globalOptions = program.opts();
|
|
16472
16574
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16473
|
-
const { publish, PublishModeConflict } = await Promise.resolve().then(() => require("./publish-
|
|
16575
|
+
const { publish, PublishModeConflict } = await Promise.resolve().then(() => require("./publish-B22IhdS9.cjs"));
|
|
16474
16576
|
if (options.build && options.update) throw new PublishModeConflict();
|
|
16475
16577
|
const { build, update, ...rest } = options;
|
|
16476
16578
|
await publish({
|
|
@@ -16486,7 +16588,7 @@ program.command("deploy:google-play").description("Let EAS Submit publish a mobi
|
|
|
16486
16588
|
try {
|
|
16487
16589
|
const globalOptions = program.opts();
|
|
16488
16590
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16489
|
-
const { deployGooglePlay } = await Promise.resolve().then(() => require("./googlePlay-
|
|
16591
|
+
const { deployGooglePlay } = await Promise.resolve().then(() => require("./googlePlay-C-GBRDMp.cjs"));
|
|
16490
16592
|
await deployGooglePlay(options);
|
|
16491
16593
|
} catch (error) {
|
|
16492
16594
|
exitWithError(error);
|
|
@@ -16508,7 +16610,7 @@ program.command("migrate").description("Apply each database construct's migratio
|
|
|
16508
16610
|
try {
|
|
16509
16611
|
const globalOptions = program.opts();
|
|
16510
16612
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16511
|
-
const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
16613
|
+
const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-rke2Qvj2.cjs"));
|
|
16512
16614
|
await migrateCommand({
|
|
16513
16615
|
...options,
|
|
16514
16616
|
...construct ? { construct } : {}
|
|
@@ -16521,7 +16623,7 @@ program.command("seed").description("Migrate, then run each database construct's
|
|
|
16521
16623
|
try {
|
|
16522
16624
|
const globalOptions = program.opts();
|
|
16523
16625
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16524
|
-
const { seedCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
16626
|
+
const { seedCommand } = await Promise.resolve().then(() => require("./migrate-rke2Qvj2.cjs"));
|
|
16525
16627
|
await seedCommand({
|
|
16526
16628
|
...options,
|
|
16527
16629
|
...construct ? { construct } : {}
|
|
@@ -16534,7 +16636,7 @@ program.command("migration").description("Write a construct's next migration: an
|
|
|
16534
16636
|
try {
|
|
16535
16637
|
const globalOptions = program.opts();
|
|
16536
16638
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16537
|
-
const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
16639
|
+
const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-rke2Qvj2.cjs"));
|
|
16538
16640
|
await migrationCommand({
|
|
16539
16641
|
construct,
|
|
16540
16642
|
...name ? { name } : {}
|
|
@@ -16634,7 +16736,7 @@ program.command("secrets:add").description("Build the keys a stage must be given
|
|
|
16634
16736
|
try {
|
|
16635
16737
|
const globalOptions = program.opts();
|
|
16636
16738
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16637
|
-
const { secretsAddCommand } = await Promise.resolve().then(() => require("./add-
|
|
16739
|
+
const { secretsAddCommand } = await Promise.resolve().then(() => require("./add-6VPdRbRT.cjs"));
|
|
16638
16740
|
await secretsAddCommand(options);
|
|
16639
16741
|
} catch (error) {
|
|
16640
16742
|
exitWithError(error);
|
|
@@ -16644,7 +16746,7 @@ program.command("encryption:rotate").description("Add a new current key to an En
|
|
|
16644
16746
|
try {
|
|
16645
16747
|
const globalOptions = program.opts();
|
|
16646
16748
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16647
|
-
const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption-
|
|
16749
|
+
const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption-C_NRQ9cY.cjs"));
|
|
16648
16750
|
await encryptionRotateCommand(construct, options);
|
|
16649
16751
|
} catch (error) {
|
|
16650
16752
|
exitWithError(error);
|
|
@@ -16654,7 +16756,7 @@ program.command("encryption:retire").description("Remove an old key from an Encr
|
|
|
16654
16756
|
try {
|
|
16655
16757
|
const globalOptions = program.opts();
|
|
16656
16758
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16657
|
-
const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption-
|
|
16759
|
+
const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption-C_NRQ9cY.cjs"));
|
|
16658
16760
|
await encryptionRetireCommand(construct, key, options);
|
|
16659
16761
|
} catch (error) {
|
|
16660
16762
|
exitWithError(error);
|
|
@@ -16693,7 +16795,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
16693
16795
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16694
16796
|
const { loadWorkspaceConfig } = await Promise.resolve().then(() => require("./config.cjs"));
|
|
16695
16797
|
const { reconcileMissingSecrets } = await Promise.resolve().then(() => require("./reconcile-CuCQBa5-.cjs"));
|
|
16696
|
-
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);
|
|
16697
16799
|
const { workspace } = await loadWorkspaceConfig();
|
|
16698
16800
|
const stage = options.stage ?? workspace.stages.local;
|
|
16699
16801
|
const store = await secretsStoreFor(workspace, stage);
|
|
@@ -16702,7 +16804,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
16702
16804
|
console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
|
|
16703
16805
|
process.exit(1);
|
|
16704
16806
|
}
|
|
16705
|
-
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);
|
|
16706
16808
|
const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
|
|
16707
16809
|
if (!result) {
|
|
16708
16810
|
console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
|
|
@@ -16719,14 +16821,14 @@ program.command("secrets:migrate").description("Copy a deployed stage's secrets
|
|
|
16719
16821
|
try {
|
|
16720
16822
|
const globalOptions = program.opts();
|
|
16721
16823
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16722
|
-
const { secretsMigrateCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
16824
|
+
const { secretsMigrateCommand } = await Promise.resolve().then(() => require("./migrate-BndHuwqw.cjs"));
|
|
16723
16825
|
await secretsMigrateCommand(options);
|
|
16724
16826
|
} catch (error) {
|
|
16725
16827
|
exitWithError(error);
|
|
16726
16828
|
}
|
|
16727
16829
|
});
|
|
16728
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) => {
|
|
16729
|
-
const { deployCli } = await Promise.resolve().then(() => require("./cli-
|
|
16831
|
+
const { deployCli } = await Promise.resolve().then(() => require("./cli-CQ2ij0Mi.cjs"));
|
|
16730
16832
|
const globalOptions = program.opts();
|
|
16731
16833
|
const code = await deployCli({
|
|
16732
16834
|
cwd: (0, node_path.resolve)(globalOptions.cwd ?? process.cwd()),
|
|
@@ -16746,7 +16848,7 @@ program.command("deploy").description("Deploy a stage through its target").optio
|
|
|
16746
16848
|
});
|
|
16747
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) => {
|
|
16748
16850
|
try {
|
|
16749
|
-
const { rollbackStage } = await Promise.resolve().then(() => require("./rollback-
|
|
16851
|
+
const { rollbackStage } = await Promise.resolve().then(() => require("./rollback-Lj9bQvHq.cjs")).then((n) => n.rollback_exports);
|
|
16750
16852
|
const { terminalCredentials } = await Promise.resolve().then(() => require("./terminal-D_NRPW4W.cjs"));
|
|
16751
16853
|
const globalOptions = program.opts();
|
|
16752
16854
|
await rollbackStage({
|
|
@@ -16765,7 +16867,7 @@ program.command("compose:server").description("Set up a stage's server for compo
|
|
|
16765
16867
|
try {
|
|
16766
16868
|
const globalOptions = program.opts();
|
|
16767
16869
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16768
|
-
const { composeServerCommand } = await Promise.resolve().then(() => require("./serverSetup-
|
|
16870
|
+
const { composeServerCommand } = await Promise.resolve().then(() => require("./serverSetup-CbuJK4zg.cjs"));
|
|
16769
16871
|
await composeServerCommand(options);
|
|
16770
16872
|
} catch (error) {
|
|
16771
16873
|
exitWithError(error);
|
|
@@ -16790,7 +16892,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
|
|
|
16790
16892
|
try {
|
|
16791
16893
|
const globalOptions = program.opts();
|
|
16792
16894
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16793
|
-
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-
|
|
16895
|
+
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-D5Ck3srU.cjs"));
|
|
16794
16896
|
await deployGithubCommand(options);
|
|
16795
16897
|
} catch (error) {
|
|
16796
16898
|
exitWithError(error);
|