@geekmidas/cli 1.10.5 → 1.10.7
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/config.d.cts +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/{fullstack-secrets-DqxYGrgW.cjs → fullstack-secrets-BctGaE4E.cjs} +7 -2
- package/dist/fullstack-secrets-BctGaE4E.cjs.map +1 -0
- package/dist/{fullstack-secrets-odm79Uo1.mjs → fullstack-secrets-ca0Kyrvt.mjs} +7 -2
- package/dist/fullstack-secrets-ca0Kyrvt.mjs.map +1 -0
- package/dist/{index-3n-giNaw.d.mts → index-9tjTQjFt.d.mts} +3 -3
- package/dist/{index-3n-giNaw.d.mts.map → index-9tjTQjFt.d.mts.map} +1 -1
- package/dist/{index-CiEOtKEX.d.cts → index-VOKKO-lm.d.cts} +3 -3
- package/dist/{index-CiEOtKEX.d.cts.map → index-VOKKO-lm.d.cts.map} +1 -1
- package/dist/index.cjs +22 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +22 -19
- package/dist/index.mjs.map +1 -1
- package/dist/{reconcile-WzC1oAUV.mjs → reconcile-C5OyCA7V.mjs} +2 -2
- package/dist/{reconcile-WzC1oAUV.mjs.map → reconcile-C5OyCA7V.mjs.map} +1 -1
- package/dist/{reconcile-CCtrj-zt.cjs → reconcile-TEBsryVn.cjs} +2 -2
- package/dist/{reconcile-CCtrj-zt.cjs.map → reconcile-TEBsryVn.cjs.map} +1 -1
- package/dist/workspace/index.d.cts +1 -1
- package/dist/workspace/index.d.mts +1 -1
- package/dist/workspace-4SP3Gx4Y.cjs.map +1 -1
- package/dist/workspace-D4z4A4cq.mjs.map +1 -1
- package/package.json +4 -4
- package/src/docker/__tests__/compose.spec.ts +6 -6
- package/src/docker/compose.ts +6 -6
- package/src/init/__tests__/init.spec.ts +1 -1
- package/src/init/generators/docker.ts +3 -3
- package/src/init/index.ts +3 -1
- package/src/secrets/generator.ts +11 -0
- package/src/secrets/index.ts +12 -6
- package/src/setup/index.ts +3 -1
- package/src/workspace/types.ts +2 -2
- package/dist/fullstack-secrets-DqxYGrgW.cjs.map +0 -1
- package/dist/fullstack-secrets-odm79Uo1.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { getKeyPath, maskPassword, readStageSecrets, secretsExist, setCustomSecr
|
|
|
8
8
|
import { DokployApi } from "./dokploy-api-2ldYoN3i.mjs";
|
|
9
9
|
import { encryptSecrets } from "./encryption-BOH5M-f-.mjs";
|
|
10
10
|
import { CachedStateProvider } from "./CachedStateProvider-BDq5WqSy.mjs";
|
|
11
|
-
import { createStageSecrets, generateDbPassword, generateDbUrl, generateFullstackCustomSecrets, rotateServicePassword, writeDockerEnvFromSecrets } from "./fullstack-secrets-
|
|
11
|
+
import { createStageSecrets, generateDbPassword, generateDbUrl, generateFullstackCustomSecrets, rotateServicePassword, writeDockerEnvFromSecrets } from "./fullstack-secrets-ca0Kyrvt.mjs";
|
|
12
12
|
import { generateReactQueryCommand } from "./openapi-react-query-C4UdILaI.mjs";
|
|
13
13
|
import { isSSMConfigured, pullSecrets, pushSecrets } from "./sync-CbeKrnQV.mjs";
|
|
14
14
|
import { createRequire } from "node:module";
|
|
@@ -35,7 +35,7 @@ import prompts from "prompts";
|
|
|
35
35
|
|
|
36
36
|
//#region package.json
|
|
37
37
|
var name = "@geekmidas/cli";
|
|
38
|
-
var version = "1.10.
|
|
38
|
+
var version = "1.10.6";
|
|
39
39
|
var description = "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs";
|
|
40
40
|
var private$1 = false;
|
|
41
41
|
var type = "module";
|
|
@@ -2841,7 +2841,7 @@ const DEFAULT_SERVICE_IMAGES = {
|
|
|
2841
2841
|
};
|
|
2842
2842
|
/** Default Docker image versions for services */
|
|
2843
2843
|
const DEFAULT_SERVICE_VERSIONS = {
|
|
2844
|
-
postgres: "
|
|
2844
|
+
postgres: "18-alpine",
|
|
2845
2845
|
redis: "7-alpine",
|
|
2846
2846
|
rabbitmq: "3-management-alpine"
|
|
2847
2847
|
};
|
|
@@ -2922,7 +2922,7 @@ services:
|
|
|
2922
2922
|
POSTGRES_PASSWORD: \${POSTGRES_PASSWORD:-postgres}
|
|
2923
2923
|
POSTGRES_DB: \${POSTGRES_DB:-app}
|
|
2924
2924
|
volumes:
|
|
2925
|
-
-
|
|
2925
|
+
- dbdata:/var/lib/postgresql/18/data
|
|
2926
2926
|
healthcheck:
|
|
2927
2927
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER"]
|
|
2928
2928
|
interval: 5s
|
|
@@ -2971,7 +2971,7 @@ services:
|
|
|
2971
2971
|
yaml += `
|
|
2972
2972
|
volumes:
|
|
2973
2973
|
`;
|
|
2974
|
-
if (serviceMap.has("postgres")) yaml += `
|
|
2974
|
+
if (serviceMap.has("postgres")) yaml += ` dbdata:
|
|
2975
2975
|
`;
|
|
2976
2976
|
if (serviceMap.has("redis")) yaml += ` redis_data:
|
|
2977
2977
|
`;
|
|
@@ -3051,7 +3051,7 @@ services:
|
|
|
3051
3051
|
POSTGRES_PASSWORD: \${POSTGRES_PASSWORD:-postgres}
|
|
3052
3052
|
POSTGRES_DB: \${POSTGRES_DB:-app}
|
|
3053
3053
|
volumes:
|
|
3054
|
-
-
|
|
3054
|
+
- dbdata:/var/lib/postgresql/18/data
|
|
3055
3055
|
healthcheck:
|
|
3056
3056
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER"]
|
|
3057
3057
|
interval: 5s
|
|
@@ -3089,7 +3089,7 @@ services:
|
|
|
3089
3089
|
yaml += `
|
|
3090
3090
|
volumes:
|
|
3091
3091
|
`;
|
|
3092
|
-
if (hasPostgres) yaml += `
|
|
3092
|
+
if (hasPostgres) yaml += ` dbdata:
|
|
3093
3093
|
`;
|
|
3094
3094
|
if (hasRedis) yaml += ` redis_data:
|
|
3095
3095
|
`;
|
|
@@ -3105,7 +3105,7 @@ networks:
|
|
|
3105
3105
|
*/
|
|
3106
3106
|
function getInfraServiceImage(serviceName, config$1) {
|
|
3107
3107
|
const defaults = {
|
|
3108
|
-
postgres: "postgres:
|
|
3108
|
+
postgres: "postgres:18-alpine",
|
|
3109
3109
|
redis: "redis:7-alpine"
|
|
3110
3110
|
};
|
|
3111
3111
|
if (!config$1 || config$1 === true) return defaults[serviceName];
|
|
@@ -6954,7 +6954,7 @@ function generateDockerFiles(options, template, dbApps) {
|
|
|
6954
6954
|
env_file:
|
|
6955
6955
|
- ./docker/.env` : "";
|
|
6956
6956
|
services.push(` postgres:
|
|
6957
|
-
image: postgres:
|
|
6957
|
+
image: postgres:18-alpine
|
|
6958
6958
|
container_name: ${options.name}-postgres
|
|
6959
6959
|
restart: unless-stopped${envFile}
|
|
6960
6960
|
environment:
|
|
@@ -6964,13 +6964,13 @@ function generateDockerFiles(options, template, dbApps) {
|
|
|
6964
6964
|
ports:
|
|
6965
6965
|
- '\${POSTGRES_HOST_PORT:-5432}:5432'
|
|
6966
6966
|
volumes:
|
|
6967
|
-
-
|
|
6967
|
+
- dbdata:/var/lib/postgresql/18/data${initVolume}
|
|
6968
6968
|
healthcheck:
|
|
6969
6969
|
test: ['CMD-SHELL', 'pg_isready -U $$POSTGRES_USER']
|
|
6970
6970
|
interval: 5s
|
|
6971
6971
|
timeout: 5s
|
|
6972
6972
|
retries: 5`);
|
|
6973
|
-
volumes.push("
|
|
6973
|
+
volumes.push(" dbdata:");
|
|
6974
6974
|
if (isFullstack && dbApps?.length) {
|
|
6975
6975
|
files.push({
|
|
6976
6976
|
path: "docker/postgres/init.sh",
|
|
@@ -10868,7 +10868,7 @@ async function initCommand(projectName, options = {}) {
|
|
|
10868
10868
|
const secretServices = [];
|
|
10869
10869
|
if (services.db) secretServices.push("postgres");
|
|
10870
10870
|
if (services.cache) secretServices.push("redis");
|
|
10871
|
-
const devSecrets = createStageSecrets("development", secretServices);
|
|
10871
|
+
const devSecrets = createStageSecrets("development", secretServices, { projectName: name$1 });
|
|
10872
10872
|
const customSecrets = {
|
|
10873
10873
|
NODE_ENV: "development",
|
|
10874
10874
|
PORT: "3000",
|
|
@@ -11005,16 +11005,19 @@ async function secretsInitCommand(options) {
|
|
|
11005
11005
|
const config$1 = await loadConfig();
|
|
11006
11006
|
const services = getServicesFromConfig(config$1.docker?.compose?.services);
|
|
11007
11007
|
if (services.length === 0) logger$2.warn("No services configured in docker.compose.services. Creating secrets with empty services.");
|
|
11008
|
-
|
|
11008
|
+
let projectName;
|
|
11009
|
+
let workspaceSecrets;
|
|
11009
11010
|
try {
|
|
11010
11011
|
const loaded = await loadWorkspaceConfig();
|
|
11012
|
+
projectName = loaded.workspace.name;
|
|
11011
11013
|
const isMultiApp = Object.keys(loaded.workspace.apps).length > 1;
|
|
11012
11014
|
if (isMultiApp) {
|
|
11013
|
-
|
|
11014
|
-
secrets.custom = customSecrets;
|
|
11015
|
+
workspaceSecrets = generateFullstackCustomSecrets(loaded.workspace);
|
|
11015
11016
|
logger$2.log(" Detected workspace mode — generating per-app secrets");
|
|
11016
11017
|
}
|
|
11017
11018
|
} catch {}
|
|
11019
|
+
const secrets = createStageSecrets(stage, services, { projectName });
|
|
11020
|
+
if (workspaceSecrets) secrets.custom = workspaceSecrets;
|
|
11018
11021
|
await writeStageSecrets(secrets);
|
|
11019
11022
|
logger$2.log(`\n✓ Secrets initialized for stage "${stage}"`);
|
|
11020
11023
|
logger$2.log(` Location: .gkm/secrets/${stage}.json`);
|
|
@@ -11292,7 +11295,7 @@ async function generateFreshSecrets(stage, workspace, options) {
|
|
|
11292
11295
|
const serviceNames = [];
|
|
11293
11296
|
if (workspace.services.db) serviceNames.push("postgres");
|
|
11294
11297
|
if (workspace.services.cache) serviceNames.push("redis");
|
|
11295
|
-
const secrets = createStageSecrets(stage, serviceNames);
|
|
11298
|
+
const secrets = createStageSecrets(stage, serviceNames, { projectName: workspace.name });
|
|
11296
11299
|
const isMultiApp = Object.keys(workspace.apps).length > 1;
|
|
11297
11300
|
if (isMultiApp) {
|
|
11298
11301
|
const customSecrets = generateFullstackCustomSecrets(workspace);
|
|
@@ -11829,7 +11832,7 @@ program.command("secrets:push").description("Push secrets to remote provider (SS
|
|
|
11829
11832
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11830
11833
|
const { loadWorkspaceConfig: loadWorkspaceConfig$1 } = await import("./config.mjs");
|
|
11831
11834
|
const { pushSecrets: pushSecrets$1 } = await import("./sync-6FoT41G3.mjs");
|
|
11832
|
-
const { reconcileMissingSecrets } = await import("./reconcile-
|
|
11835
|
+
const { reconcileMissingSecrets } = await import("./reconcile-C5OyCA7V.mjs");
|
|
11833
11836
|
const { readStageSecrets: readStageSecrets$1, writeStageSecrets: writeStageSecrets$1 } = await import("./storage-Dx_jZbq6.mjs");
|
|
11834
11837
|
const { workspace } = await loadWorkspaceConfig$1();
|
|
11835
11838
|
const secrets = await readStageSecrets$1(options.stage, workspace.root);
|
|
@@ -11855,7 +11858,7 @@ program.command("secrets:pull").description("Pull secrets from remote provider (
|
|
|
11855
11858
|
const { loadWorkspaceConfig: loadWorkspaceConfig$1 } = await import("./config.mjs");
|
|
11856
11859
|
const { pullSecrets: pullSecrets$1 } = await import("./sync-6FoT41G3.mjs");
|
|
11857
11860
|
const { writeStageSecrets: writeStageSecrets$1 } = await import("./storage-Dx_jZbq6.mjs");
|
|
11858
|
-
const { reconcileMissingSecrets } = await import("./reconcile-
|
|
11861
|
+
const { reconcileMissingSecrets } = await import("./reconcile-C5OyCA7V.mjs");
|
|
11859
11862
|
const { workspace } = await loadWorkspaceConfig$1();
|
|
11860
11863
|
let secrets = await pullSecrets$1(options.stage, workspace);
|
|
11861
11864
|
if (!secrets) {
|
|
@@ -11880,7 +11883,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11880
11883
|
const globalOptions = program.opts();
|
|
11881
11884
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11882
11885
|
const { loadWorkspaceConfig: loadWorkspaceConfig$1 } = await import("./config.mjs");
|
|
11883
|
-
const { reconcileMissingSecrets } = await import("./reconcile-
|
|
11886
|
+
const { reconcileMissingSecrets } = await import("./reconcile-C5OyCA7V.mjs");
|
|
11884
11887
|
const { readStageSecrets: readStageSecrets$1, writeStageSecrets: writeStageSecrets$1 } = await import("./storage-Dx_jZbq6.mjs");
|
|
11885
11888
|
const { workspace } = await loadWorkspaceConfig$1();
|
|
11886
11889
|
const secrets = await readStageSecrets$1(options.stage, workspace.root);
|