@geekmidas/cli 1.2.3 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/{CachedStateProvider-DVyKfaMm.mjs → CachedStateProvider-BDq5WqSy.mjs} +1 -1
- package/dist/{CachedStateProvider-DVyKfaMm.mjs.map → CachedStateProvider-BDq5WqSy.mjs.map} +1 -1
- package/dist/CachedStateProvider-CI61keQ1.mjs +3 -0
- package/dist/{HostingerProvider-DqUq6e9i.mjs → HostingerProvider-B9N-TKbp.mjs} +2 -2
- package/dist/{HostingerProvider-DqUq6e9i.mjs.map → HostingerProvider-B9N-TKbp.mjs.map} +1 -1
- package/dist/{LocalStateProvider-DxoSaWUV.mjs → LocalStateProvider-BDm7ZqJo.mjs} +1 -1
- package/dist/{LocalStateProvider-DxoSaWUV.mjs.map → LocalStateProvider-BDm7ZqJo.mjs.map} +1 -1
- package/dist/{Route53Provider-KUAX3vz9.mjs → Route53Provider-DOWmFnwN.mjs} +2 -2
- package/dist/{Route53Provider-KUAX3vz9.mjs.map → Route53Provider-DOWmFnwN.mjs.map} +1 -1
- package/dist/{Route53Provider-CpRIqu69.cjs → Route53Provider-xrWuBXih.cjs} +2 -2
- package/dist/{Route53Provider-CpRIqu69.cjs.map → Route53Provider-xrWuBXih.cjs.map} +1 -1
- package/dist/{SSMStateProvider-D79o_JjM.cjs → SSMStateProvider-DGrqYll0.cjs} +8 -4
- package/dist/SSMStateProvider-DGrqYll0.cjs.map +1 -0
- package/dist/{SSMStateProvider-BjCi_58g.mjs → SSMStateProvider-DT0WV-E_.mjs} +9 -4
- package/dist/SSMStateProvider-DT0WV-E_.mjs.map +1 -0
- package/dist/{bundler-BqTN5Dj5.mjs → bundler-DgXsOSxc.mjs} +3 -3
- package/dist/{bundler-BqTN5Dj5.mjs.map → bundler-DgXsOSxc.mjs.map} +1 -1
- package/dist/chunk-Duj1WY3L.mjs +7 -0
- package/dist/{config-BQ4a36Rq.mjs → config-C1bidhvG.mjs} +2 -2
- package/dist/{config-BQ4a36Rq.mjs.map → config-C1bidhvG.mjs.map} +1 -1
- package/dist/{config-Bayob8pB.cjs → config-C1dM7aZb.cjs} +2 -2
- package/dist/{config-Bayob8pB.cjs.map → config-C1dM7aZb.cjs.map} +1 -1
- package/dist/config.cjs +2 -2
- package/dist/config.d.cts +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +2 -2
- package/dist/{credentials-DT1dSxIx.mjs → credentials-s1kLcIzK.mjs} +1 -1
- package/dist/{credentials-DT1dSxIx.mjs.map → credentials-s1kLcIzK.mjs.map} +1 -1
- package/dist/deploy/sniffer-routes-worker.cjs +65 -0
- package/dist/deploy/sniffer-routes-worker.cjs.map +1 -0
- package/dist/deploy/sniffer-routes-worker.d.cts +1 -0
- package/dist/deploy/sniffer-routes-worker.d.mts +1 -0
- package/dist/deploy/sniffer-routes-worker.mjs +64 -0
- package/dist/deploy/sniffer-routes-worker.mjs.map +1 -0
- package/dist/dokploy-api-DSJYNx88.mjs +3 -0
- package/dist/{dokploy-api-7k3t7_zd.mjs → dokploy-api-z0833e7r.mjs} +1 -1
- package/dist/{dokploy-api-7k3t7_zd.mjs.map → dokploy-api-z0833e7r.mjs.map} +1 -1
- package/dist/{encryption-JtMsiGNp.mjs → encryption-BOH5M-f-.mjs} +1 -1
- package/dist/{encryption-JtMsiGNp.mjs.map → encryption-BOH5M-f-.mjs.map} +1 -1
- package/dist/encryption-a9TNMWav.mjs +3 -0
- package/dist/{index-Bi9vGQJy.d.mts → index-DvpWzLD7.d.mts} +5 -2
- package/dist/index-DvpWzLD7.d.mts.map +1 -0
- package/dist/{index-CufAAnge.d.cts → index-DzmZ6SUW.d.cts} +4 -1
- package/dist/index-DzmZ6SUW.d.cts.map +1 -0
- package/dist/index.cjs +27 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +42 -27
- package/dist/index.mjs.map +1 -1
- package/dist/{openapi-NthphEWK.mjs → openapi-9k6a6VA4.mjs} +2 -2
- package/dist/{openapi-NthphEWK.mjs.map → openapi-9k6a6VA4.mjs.map} +1 -1
- package/dist/{openapi-ZhO7wwya.cjs → openapi-Dcja4e1C.cjs} +2 -2
- package/dist/{openapi-ZhO7wwya.cjs.map → openapi-Dcja4e1C.cjs.map} +1 -1
- package/dist/{openapi-react-query-DGEkD39r.mjs → openapi-react-query-DaTMSPD5.mjs} +1 -1
- package/dist/{openapi-react-query-DGEkD39r.mjs.map → openapi-react-query-DaTMSPD5.mjs.map} +1 -1
- package/dist/openapi-react-query.mjs +1 -1
- package/dist/openapi.cjs +3 -3
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.mjs +3 -3
- package/dist/{storage-BMW6yLu3.mjs → storage-DmCbr6DI.mjs} +1 -1
- package/dist/{storage-BMW6yLu3.mjs.map → storage-DmCbr6DI.mjs.map} +1 -1
- package/dist/{storage-D8XzjVaO.mjs → storage-Dx_jZbq6.mjs} +1 -1
- package/dist/{types-BldpmqQX.d.mts → types-B9UZ7fOG.d.mts} +1 -1
- package/dist/{types-BldpmqQX.d.mts.map → types-B9UZ7fOG.d.mts.map} +1 -1
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.d.cts +1 -1
- package/dist/workspace/index.d.mts +2 -2
- package/dist/workspace/index.mjs +1 -1
- package/dist/{workspace-CASoZOjs.mjs → workspace-Cb_I7oCJ.mjs} +5 -8
- package/dist/{workspace-CASoZOjs.mjs.map → workspace-Cb_I7oCJ.mjs.map} +1 -1
- package/dist/{workspace-BMJE18LV.cjs → workspace-CeFgIDC-.cjs} +3 -2
- package/dist/{workspace-BMJE18LV.cjs.map → workspace-CeFgIDC-.cjs.map} +1 -1
- package/package.json +3 -3
- package/src/deploy/SSMStateProvider.ts +14 -3
- package/src/deploy/StateProvider.ts +5 -1
- package/src/deploy/__tests__/SSMStateProvider.spec.ts +12 -0
- package/src/deploy/__tests__/createStateProvider.spec.ts +10 -0
- package/src/deploy/__tests__/env-resolver.spec.ts +145 -2
- package/src/deploy/__tests__/index.spec.ts +393 -5
- package/src/deploy/env-resolver.ts +10 -0
- package/src/deploy/index.ts +11 -0
- package/src/init/generators/monorepo.ts +3 -1
- package/src/init/generators/web.ts +6 -2
- package/src/workspace/schema.ts +2 -0
- package/tsdown.config.ts +1 -0
- package/dist/CachedStateProvider-OiFUGr7p.mjs +0 -3
- package/dist/SSMStateProvider-BjCi_58g.mjs.map +0 -1
- package/dist/SSMStateProvider-D79o_JjM.cjs.map +0 -1
- package/dist/dokploy-api-CHa8G51l.mjs +0 -3
- package/dist/encryption-UUmaWAmz.mjs +0 -3
- package/dist/index-Bi9vGQJy.d.mts.map +0 -1
- package/dist/index-CufAAnge.d.cts.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env -S npx tsx
|
|
2
|
-
import { __require
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
import { __require } from "./chunk-Duj1WY3L.mjs";
|
|
3
|
+
import { getAppBuildOrder, getDependencyEnvVars, getDeployTargetError, isDeployTargetSupported } from "./workspace-Cb_I7oCJ.mjs";
|
|
4
|
+
import { getAppNameFromCwd, loadAppConfig, loadConfig, loadWorkspaceConfig, parseModuleConfig } from "./config-C1bidhvG.mjs";
|
|
5
|
+
import { getCredentialsPath, getDokployCredentials, getDokployRegistryId, getDokployToken, removeDokployCredentials, storeDokployCredentials, storeDokployRegistryId } from "./credentials-s1kLcIzK.mjs";
|
|
6
|
+
import { ConstructGenerator, EndpointGenerator, OPENAPI_OUTPUT_PATH, generateOpenApi, openapiCommand, resolveOpenApiConfig } from "./openapi-9k6a6VA4.mjs";
|
|
7
|
+
import { getKeyPath, maskPassword, readStageSecrets, secretsExist, setCustomSecret, toEmbeddableSecrets, writeStageSecrets } from "./storage-DmCbr6DI.mjs";
|
|
8
|
+
import { DokployApi } from "./dokploy-api-z0833e7r.mjs";
|
|
9
|
+
import { encryptSecrets } from "./encryption-BOH5M-f-.mjs";
|
|
10
|
+
import { CachedStateProvider } from "./CachedStateProvider-BDq5WqSy.mjs";
|
|
11
|
+
import { generateReactQueryCommand } from "./openapi-react-query-DaTMSPD5.mjs";
|
|
11
12
|
import { createRequire } from "node:module";
|
|
12
13
|
import { copyFileSync, existsSync, readFileSync, unlinkSync } from "node:fs";
|
|
13
14
|
import { basename, dirname, join, parse, relative, resolve } from "node:path";
|
|
@@ -31,7 +32,7 @@ import prompts from "prompts";
|
|
|
31
32
|
|
|
32
33
|
//#region package.json
|
|
33
34
|
var name = "@geekmidas/cli";
|
|
34
|
-
var version = "1.
|
|
35
|
+
var version = "1.3.0";
|
|
35
36
|
var description = "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs";
|
|
36
37
|
var private$1 = false;
|
|
37
38
|
var type = "module";
|
|
@@ -131,7 +132,7 @@ const logger$11 = console;
|
|
|
131
132
|
* Validate Dokploy token by making a test API call
|
|
132
133
|
*/
|
|
133
134
|
async function validateDokployToken(endpoint, token) {
|
|
134
|
-
const { DokployApi: DokployApi$1 } = await import("./dokploy-api-
|
|
135
|
+
const { DokployApi: DokployApi$1 } = await import("./dokploy-api-DSJYNx88.mjs");
|
|
135
136
|
const api = new DokployApi$1({
|
|
136
137
|
baseUrl: endpoint,
|
|
137
138
|
token
|
|
@@ -1954,7 +1955,7 @@ async function buildForProvider(provider, context, rootOutputDir, endpointGenera
|
|
|
1954
1955
|
let masterKey;
|
|
1955
1956
|
if (context.production?.bundle && !skipBundle) {
|
|
1956
1957
|
logger$7.log(`\n📦 Bundling production server...`);
|
|
1957
|
-
const { bundleServer } = await import("./bundler-
|
|
1958
|
+
const { bundleServer } = await import("./bundler-DgXsOSxc.mjs");
|
|
1958
1959
|
const allConstructs = [
|
|
1959
1960
|
...endpoints.map((e) => e.construct),
|
|
1960
1961
|
...functions.map((f) => f.construct),
|
|
@@ -2198,11 +2199,11 @@ async function createDnsProvider(options) {
|
|
|
2198
2199
|
if (isDnsProvider(config$1.provider)) return config$1.provider;
|
|
2199
2200
|
const provider = config$1.provider;
|
|
2200
2201
|
if (provider === "hostinger") {
|
|
2201
|
-
const { HostingerProvider } = await import("./HostingerProvider-
|
|
2202
|
+
const { HostingerProvider } = await import("./HostingerProvider-B9N-TKbp.mjs");
|
|
2202
2203
|
return new HostingerProvider();
|
|
2203
2204
|
}
|
|
2204
2205
|
if (provider === "route53") {
|
|
2205
|
-
const { Route53Provider } = await import("./Route53Provider-
|
|
2206
|
+
const { Route53Provider } = await import("./Route53Provider-DOWmFnwN.mjs");
|
|
2206
2207
|
const route53Config = config$1;
|
|
2207
2208
|
return new Route53Provider({
|
|
2208
2209
|
region: route53Config.region,
|
|
@@ -4223,6 +4224,10 @@ function resolveEnvVar(varName, context) {
|
|
|
4223
4224
|
if (context.masterKey) return context.masterKey;
|
|
4224
4225
|
break;
|
|
4225
4226
|
}
|
|
4227
|
+
if (context.dependencyUrls && varName.endsWith("_URL")) {
|
|
4228
|
+
const depName = varName.slice(0, -4).toLowerCase();
|
|
4229
|
+
if (context.dependencyUrls[depName]) return context.dependencyUrls[depName];
|
|
4230
|
+
}
|
|
4226
4231
|
if (context.userSecrets) {
|
|
4227
4232
|
if (context.userSecrets.custom[varName]) return context.userSecrets.custom[varName];
|
|
4228
4233
|
if (varName in context.userSecrets.urls) return context.userSecrets.urls[varName];
|
|
@@ -4457,24 +4462,26 @@ function isStateProvider(value) {
|
|
|
4457
4462
|
async function createStateProvider(options) {
|
|
4458
4463
|
const { config: config$1, workspaceRoot, workspaceName } = options;
|
|
4459
4464
|
if (!config$1) {
|
|
4460
|
-
const { LocalStateProvider } = await import("./LocalStateProvider-
|
|
4465
|
+
const { LocalStateProvider } = await import("./LocalStateProvider-BDm7ZqJo.mjs");
|
|
4461
4466
|
return new LocalStateProvider(workspaceRoot);
|
|
4462
4467
|
}
|
|
4463
4468
|
if (isStateProvider(config$1.provider)) return config$1.provider;
|
|
4464
4469
|
const provider = config$1.provider;
|
|
4465
4470
|
if (provider === "local") {
|
|
4466
|
-
const { LocalStateProvider } = await import("./LocalStateProvider-
|
|
4471
|
+
const { LocalStateProvider } = await import("./LocalStateProvider-BDm7ZqJo.mjs");
|
|
4467
4472
|
return new LocalStateProvider(workspaceRoot);
|
|
4468
4473
|
}
|
|
4469
4474
|
if (provider === "ssm") {
|
|
4470
4475
|
if (!workspaceName) throw new Error("Workspace name is required for SSM state provider. Set \"name\" in gkm.config.ts.");
|
|
4471
|
-
const { LocalStateProvider } = await import("./LocalStateProvider-
|
|
4472
|
-
const { SSMStateProvider } = await import("./SSMStateProvider-
|
|
4473
|
-
const { CachedStateProvider: CachedStateProvider$1 } = await import("./CachedStateProvider-
|
|
4476
|
+
const { LocalStateProvider } = await import("./LocalStateProvider-BDm7ZqJo.mjs");
|
|
4477
|
+
const { SSMStateProvider } = await import("./SSMStateProvider-DT0WV-E_.mjs");
|
|
4478
|
+
const { CachedStateProvider: CachedStateProvider$1 } = await import("./CachedStateProvider-CI61keQ1.mjs");
|
|
4479
|
+
const ssmConfig = config$1;
|
|
4474
4480
|
const local = new LocalStateProvider(workspaceRoot);
|
|
4475
4481
|
const ssm = SSMStateProvider.create({
|
|
4476
4482
|
workspaceName,
|
|
4477
|
-
region:
|
|
4483
|
+
region: ssmConfig.region,
|
|
4484
|
+
profile: ssmConfig.profile
|
|
4478
4485
|
});
|
|
4479
4486
|
return new CachedStateProvider$1(ssm, local);
|
|
4480
4487
|
}
|
|
@@ -5593,6 +5600,10 @@ async function workspaceDeployCommand(workspace, options) {
|
|
|
5593
5600
|
buildArgs
|
|
5594
5601
|
});
|
|
5595
5602
|
const backendHost = resolveHost(appName, app, stage, dokployConfig, false);
|
|
5603
|
+
const dependencyUrls = {};
|
|
5604
|
+
if (app.dependencies) {
|
|
5605
|
+
for (const dep of app.dependencies) if (publicUrls[dep]) dependencyUrls[dep] = publicUrls[dep];
|
|
5606
|
+
}
|
|
5596
5607
|
const envContext = {
|
|
5597
5608
|
app,
|
|
5598
5609
|
appName,
|
|
@@ -5612,7 +5623,8 @@ async function workspaceDeployCommand(workspace, options) {
|
|
|
5612
5623
|
appHostname: backendHost,
|
|
5613
5624
|
frontendUrls,
|
|
5614
5625
|
userSecrets: stageSecrets ?? void 0,
|
|
5615
|
-
masterKey: appSecrets?.masterKey
|
|
5626
|
+
masterKey: appSecrets?.masterKey,
|
|
5627
|
+
dependencyUrls
|
|
5616
5628
|
};
|
|
5617
5629
|
const appRequirements = sniffedApps.get(appName);
|
|
5618
5630
|
const sniffedVars = appRequirements?.requiredEnvVars ?? [];
|
|
@@ -5848,7 +5860,7 @@ async function deployCommand(options) {
|
|
|
5848
5860
|
dokployConfig = setupResult.config;
|
|
5849
5861
|
finalRegistry = dokployConfig.registry ?? dockerConfig.registry;
|
|
5850
5862
|
if (setupResult.serviceUrls) {
|
|
5851
|
-
const { readStageSecrets: readStageSecrets$1, writeStageSecrets: writeStageSecrets$1, initStageSecrets } = await import("./storage-
|
|
5863
|
+
const { readStageSecrets: readStageSecrets$1, writeStageSecrets: writeStageSecrets$1, initStageSecrets } = await import("./storage-Dx_jZbq6.mjs");
|
|
5852
5864
|
let secrets = await readStageSecrets$1(stage);
|
|
5853
5865
|
if (!secrets) {
|
|
5854
5866
|
logger$1.log(` Creating secrets file for stage "${stage}"...`);
|
|
@@ -7080,6 +7092,7 @@ function generateMonorepoFiles(options, _template) {
|
|
|
7080
7092
|
"@biomejs/biome": "~2.3.0",
|
|
7081
7093
|
"@geekmidas/cli": GEEKMIDAS_VERSIONS["@geekmidas/cli"],
|
|
7082
7094
|
esbuild: "~0.27.0",
|
|
7095
|
+
tsx: "~4.20.0",
|
|
7083
7096
|
turbo: "~2.3.0",
|
|
7084
7097
|
typescript: "~5.8.2",
|
|
7085
7098
|
vitest: "~4.0.0"
|
|
@@ -7326,7 +7339,8 @@ export default defineWorkspace({
|
|
|
7326
7339
|
port: 3000,
|
|
7327
7340
|
routes: '${getRoutesGlob()}',
|
|
7328
7341
|
envParser: './src/config/env#envParser',
|
|
7329
|
-
logger: './src/config/logger#logger'
|
|
7342
|
+
logger: './src/config/logger#logger',
|
|
7343
|
+
dependencies: ['auth'],`;
|
|
7330
7344
|
if (telescope) config$1 += `
|
|
7331
7345
|
telescope: {
|
|
7332
7346
|
enabled: true,
|
|
@@ -9904,14 +9918,14 @@ export default nextConfig;
|
|
|
9904
9918
|
jsx: "preserve",
|
|
9905
9919
|
incremental: true,
|
|
9906
9920
|
plugins: [{ name: "next" }],
|
|
9921
|
+
baseUrl: ".",
|
|
9907
9922
|
paths: {
|
|
9908
|
-
"~/*": ["./src/*"],
|
|
9923
|
+
"~/*": ["./src/*", "../../packages/ui/src/*"],
|
|
9909
9924
|
[`${modelsPackage}`]: ["../../packages/models/src"],
|
|
9910
9925
|
[`${modelsPackage}/*`]: ["../../packages/models/src/*"],
|
|
9911
9926
|
[`${uiPackage}`]: ["../../packages/ui/src"],
|
|
9912
9927
|
[`${uiPackage}/*`]: ["../../packages/ui/src/*"]
|
|
9913
|
-
}
|
|
9914
|
-
baseUrl: "."
|
|
9928
|
+
}
|
|
9915
9929
|
},
|
|
9916
9930
|
include: [
|
|
9917
9931
|
"next-env.d.ts",
|
|
@@ -9919,7 +9933,8 @@ export default nextConfig;
|
|
|
9919
9933
|
"**/*.tsx",
|
|
9920
9934
|
".next/types/**/*.ts"
|
|
9921
9935
|
],
|
|
9922
|
-
exclude: ["node_modules"]
|
|
9936
|
+
exclude: ["node_modules"],
|
|
9937
|
+
references: [{ path: "../../packages/ui" }, { path: "../../packages/models" }]
|
|
9923
9938
|
};
|
|
9924
9939
|
const queryClientTs = `import { QueryClient } from '@tanstack/react-query';
|
|
9925
9940
|
|