@geekmidas/cli 1.0.1 → 1.1.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/{SSMStateProvider-C4wp4AZe.mjs → SSMStateProvider-BjCi_58g.mjs} +16 -7
- package/dist/SSMStateProvider-BjCi_58g.mjs.map +1 -0
- package/dist/{SSMStateProvider-BxAPU99a.cjs → SSMStateProvider-D79o_JjM.cjs} +16 -7
- package/dist/SSMStateProvider-D79o_JjM.cjs.map +1 -0
- package/dist/{config-BGeJsW1r.cjs → config-CKfif10N.cjs} +2 -2
- package/dist/{config-BGeJsW1r.cjs.map → config-CKfif10N.cjs.map} +1 -1
- package/dist/{config-C6awcFBx.mjs → config-ClfjsfwH.mjs} +2 -2
- package/dist/{config-C6awcFBx.mjs.map → config-ClfjsfwH.mjs.map} +1 -1
- package/dist/config.cjs +2 -2
- package/dist/config.d.cts +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +2 -2
- package/dist/{index-KFEbMIRa.d.mts → index-CHQs8G3q.d.mts} +6 -1
- package/dist/index-CHQs8G3q.d.mts.map +1 -0
- package/dist/{index-B5rGIc4g.d.cts → index-afBljZKY.d.cts} +6 -1
- package/dist/index-afBljZKY.d.cts.map +1 -0
- package/dist/index.cjs +39 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +39 -26
- package/dist/index.mjs.map +1 -1
- package/dist/{openapi-BMFmLnX6.mjs → openapi-C6sa0L8b.mjs} +2 -2
- package/dist/{openapi-BMFmLnX6.mjs.map → openapi-C6sa0L8b.mjs.map} +1 -1
- package/dist/{openapi-D1KXv2Ml.cjs → openapi-D3p6s8UA.cjs} +2 -2
- package/dist/{openapi-D1KXv2Ml.cjs.map → openapi-D3p6s8UA.cjs.map} +1 -1
- package/dist/openapi.cjs +3 -3
- package/dist/openapi.mjs +3 -3
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.d.cts +1 -1
- package/dist/workspace/index.d.mts +1 -1
- package/dist/workspace/index.mjs +1 -1
- package/dist/{workspace-BFRUOOrh.cjs → workspace-CjT323qw.cjs} +3 -2
- package/dist/{workspace-BFRUOOrh.cjs.map → workspace-CjT323qw.cjs.map} +1 -1
- package/dist/{workspace-DAxG3_H2.mjs → workspace-CmITpum4.mjs} +3 -2
- package/dist/{workspace-DAxG3_H2.mjs.map → workspace-CmITpum4.mjs.map} +1 -1
- package/package.json +4 -4
- package/scripts/sync-versions.ts +25 -3
- package/src/deploy/SSMStateProvider.ts +20 -7
- package/src/deploy/StateProvider.ts +1 -1
- package/src/deploy/__tests__/SSMStateProvider.spec.ts +15 -8
- package/src/deploy/__tests__/state-e2e.spec.ts +385 -0
- package/src/init/__tests__/init.spec.ts +10 -1
- package/src/init/versions.ts +24 -2
- package/src/secrets/__tests__/storage.spec.ts +6 -2
- package/src/workspace/__tests__/index.spec.ts +61 -0
- package/src/workspace/index.ts +1 -0
- package/src/workspace/types.ts +7 -0
- package/dist/SSMStateProvider-BxAPU99a.cjs.map +0 -1
- package/dist/SSMStateProvider-C4wp4AZe.mjs.map +0 -1
- package/dist/index-B5rGIc4g.d.cts.map +0 -1
- package/dist/index-KFEbMIRa.d.mts.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env -S npx tsx
|
|
2
|
-
import { __require, getAppBuildOrder, getDependencyEnvVars, getDeployTargetError, isDeployTargetSupported } from "./workspace-
|
|
3
|
-
import { getAppNameFromCwd, loadAppConfig, loadConfig, loadWorkspaceConfig, parseModuleConfig } from "./config-
|
|
2
|
+
import { __require, getAppBuildOrder, getDependencyEnvVars, getDeployTargetError, isDeployTargetSupported } from "./workspace-CmITpum4.mjs";
|
|
3
|
+
import { getAppNameFromCwd, loadAppConfig, loadConfig, loadWorkspaceConfig, parseModuleConfig } from "./config-ClfjsfwH.mjs";
|
|
4
4
|
import { getCredentialsPath, getDokployCredentials, getDokployRegistryId, getDokployToken, removeDokployCredentials, storeDokployCredentials, storeDokployRegistryId } from "./credentials-DT1dSxIx.mjs";
|
|
5
|
-
import { ConstructGenerator, EndpointGenerator, OPENAPI_OUTPUT_PATH, OpenApiTsGenerator, generateOpenApi, openapiCommand, resolveOpenApiConfig } from "./openapi-
|
|
5
|
+
import { ConstructGenerator, EndpointGenerator, OPENAPI_OUTPUT_PATH, OpenApiTsGenerator, generateOpenApi, openapiCommand, resolveOpenApiConfig } from "./openapi-C6sa0L8b.mjs";
|
|
6
6
|
import { getKeyPath, maskPassword, readStageSecrets, secretsExist, setCustomSecret, toEmbeddableSecrets, writeStageSecrets } from "./storage-BMW6yLu3.mjs";
|
|
7
7
|
import { DokployApi } from "./dokploy-api-7k3t7_zd.mjs";
|
|
8
8
|
import { encryptSecrets } from "./encryption-JtMsiGNp.mjs";
|
|
@@ -31,7 +31,7 @@ import prompts from "prompts";
|
|
|
31
31
|
|
|
32
32
|
//#region package.json
|
|
33
33
|
var name = "@geekmidas/cli";
|
|
34
|
-
var version = "1.0.
|
|
34
|
+
var version = "1.0.2";
|
|
35
35
|
var description = "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs";
|
|
36
36
|
var private$1 = false;
|
|
37
37
|
var type = "module";
|
|
@@ -1125,13 +1125,13 @@ async function validateFrontendApp(appName, appPath, workspaceRoot) {
|
|
|
1125
1125
|
if (!hasConfigFile) errors.push(`Next.js config file not found. Expected one of: ${NEXTJS_CONFIG_FILES.join(", ")}`);
|
|
1126
1126
|
const packageJsonPath = join(fullPath, "package.json");
|
|
1127
1127
|
if (existsSync(packageJsonPath)) try {
|
|
1128
|
-
const pkg = __require(packageJsonPath);
|
|
1128
|
+
const pkg$1 = __require(packageJsonPath);
|
|
1129
1129
|
const deps = {
|
|
1130
|
-
...pkg.dependencies,
|
|
1131
|
-
...pkg.devDependencies
|
|
1130
|
+
...pkg$1.dependencies,
|
|
1131
|
+
...pkg$1.devDependencies
|
|
1132
1132
|
};
|
|
1133
1133
|
if (!deps.next) errors.push("Next.js not found in dependencies. Run: pnpm add next react react-dom");
|
|
1134
|
-
if (!pkg.scripts?.dev) warnings.push("No \"dev\" script found in package.json. Turbo expects a \"dev\" script to run.");
|
|
1134
|
+
if (!pkg$1.scripts?.dev) warnings.push("No \"dev\" script found in package.json. Turbo expects a \"dev\" script to run.");
|
|
1135
1135
|
} catch {
|
|
1136
1136
|
errors.push(`Failed to read package.json at ${packageJsonPath}`);
|
|
1137
1137
|
}
|
|
@@ -3364,8 +3364,8 @@ function resolveDockerConfig$1(config$1) {
|
|
|
3364
3364
|
const docker = config$1.docker ?? {};
|
|
3365
3365
|
let defaultImageName = "api";
|
|
3366
3366
|
try {
|
|
3367
|
-
const pkg = __require(`${process.cwd()}/package.json`);
|
|
3368
|
-
if (pkg.name) defaultImageName = pkg.name.replace(/^@[^/]+\//, "");
|
|
3367
|
+
const pkg$1 = __require(`${process.cwd()}/package.json`);
|
|
3368
|
+
if (pkg$1.name) defaultImageName = pkg$1.name.replace(/^@[^/]+\//, "");
|
|
3369
3369
|
} catch {}
|
|
3370
3370
|
return {
|
|
3371
3371
|
registry: docker.registry ?? "",
|
|
@@ -3721,9 +3721,9 @@ async function dockerCommand(options) {
|
|
|
3721
3721
|
} else throw new Error("Monorepo detected but turbo.json not found.\n\nDocker builds in monorepos require Turborepo for proper dependency isolation.\n\nTo fix this:\n 1. Install turbo: pnpm add -Dw turbo\n 2. Create turbo.json in your monorepo root\n 3. Run this command again\n\nSee: https://turbo.build/repo/docs/guides/tools/docker");
|
|
3722
3722
|
let turboPackage = options.turboPackage ?? dockerConfig.imageName;
|
|
3723
3723
|
if (useTurbo && !options.turboPackage) try {
|
|
3724
|
-
const pkg = __require(`${process.cwd()}/package.json`);
|
|
3725
|
-
if (pkg.name) {
|
|
3726
|
-
turboPackage = pkg.name;
|
|
3724
|
+
const pkg$1 = __require(`${process.cwd()}/package.json`);
|
|
3725
|
+
if (pkg$1.name) {
|
|
3726
|
+
turboPackage = pkg$1.name;
|
|
3727
3727
|
logger$5.log(` Turbo package: ${turboPackage}`);
|
|
3728
3728
|
}
|
|
3729
3729
|
} catch {}
|
|
@@ -3848,8 +3848,8 @@ function getAppPackageName(appPath) {
|
|
|
3848
3848
|
const pkgPath = join(appPath, "package.json");
|
|
3849
3849
|
if (!existsSync(pkgPath)) return void 0;
|
|
3850
3850
|
const content = readFileSync(pkgPath, "utf-8");
|
|
3851
|
-
const pkg = JSON.parse(content);
|
|
3852
|
-
return pkg.name;
|
|
3851
|
+
const pkg$1 = JSON.parse(content);
|
|
3852
|
+
return pkg$1.name;
|
|
3853
3853
|
} catch {
|
|
3854
3854
|
return void 0;
|
|
3855
3855
|
}
|
|
@@ -3945,8 +3945,8 @@ function getAppNameFromCwd$1() {
|
|
|
3945
3945
|
const packageJsonPath = join(process.cwd(), "package.json");
|
|
3946
3946
|
if (!existsSync(packageJsonPath)) return void 0;
|
|
3947
3947
|
try {
|
|
3948
|
-
const pkg = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
3949
|
-
if (pkg.name) return pkg.name.replace(/^@[^/]+\//, "");
|
|
3948
|
+
const pkg$1 = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
3949
|
+
if (pkg$1.name) return pkg$1.name.replace(/^@[^/]+\//, "");
|
|
3950
3950
|
} catch {}
|
|
3951
3951
|
return void 0;
|
|
3952
3952
|
}
|
|
@@ -3962,8 +3962,8 @@ function getAppNameFromPackageJson() {
|
|
|
3962
3962
|
const packageJsonPath = join(projectRoot, "package.json");
|
|
3963
3963
|
if (!existsSync(packageJsonPath)) return void 0;
|
|
3964
3964
|
try {
|
|
3965
|
-
const pkg = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
3966
|
-
if (pkg.name) return pkg.name.replace(/^@[^/]+\//, "");
|
|
3965
|
+
const pkg$1 = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
3966
|
+
if (pkg$1.name) return pkg$1.name.replace(/^@[^/]+\//, "");
|
|
3967
3967
|
} catch {}
|
|
3968
3968
|
return void 0;
|
|
3969
3969
|
}
|
|
@@ -4540,10 +4540,10 @@ async function createStateProvider(options) {
|
|
|
4540
4540
|
if (provider === "ssm") {
|
|
4541
4541
|
if (!workspaceName) throw new Error("Workspace name is required for SSM state provider. Set \"name\" in gkm.config.ts.");
|
|
4542
4542
|
const { LocalStateProvider } = await import("./LocalStateProvider-DxoSaWUV.mjs");
|
|
4543
|
-
const { SSMStateProvider } = await import("./SSMStateProvider-
|
|
4543
|
+
const { SSMStateProvider } = await import("./SSMStateProvider-BjCi_58g.mjs");
|
|
4544
4544
|
const { CachedStateProvider: CachedStateProvider$1 } = await import("./CachedStateProvider-OiFUGr7p.mjs");
|
|
4545
4545
|
const local = new LocalStateProvider(workspaceRoot);
|
|
4546
|
-
const ssm =
|
|
4546
|
+
const ssm = SSMStateProvider.create({
|
|
4547
4547
|
workspaceName,
|
|
4548
4548
|
region: config$1.region
|
|
4549
4549
|
});
|
|
@@ -4658,8 +4658,8 @@ const __dirname = dirname(__filename);
|
|
|
4658
4658
|
* This ensures tsx is available regardless of whether the target project has it installed.
|
|
4659
4659
|
*/
|
|
4660
4660
|
function resolveTsxPath() {
|
|
4661
|
-
const require$
|
|
4662
|
-
return require$
|
|
4661
|
+
const require$2 = createRequire(import.meta.url);
|
|
4662
|
+
return require$2.resolve("tsx");
|
|
4663
4663
|
}
|
|
4664
4664
|
/**
|
|
4665
4665
|
* Resolve the path to a sniffer helper file.
|
|
@@ -6291,17 +6291,29 @@ function rotateServicePassword(secrets, service) {
|
|
|
6291
6291
|
|
|
6292
6292
|
//#endregion
|
|
6293
6293
|
//#region src/init/versions.ts
|
|
6294
|
+
const require$1 = createRequire(import.meta.url);
|
|
6295
|
+
function loadPackageJson() {
|
|
6296
|
+
try {
|
|
6297
|
+
return require$1("../package.json");
|
|
6298
|
+
} catch {
|
|
6299
|
+
return require$1("../../package.json");
|
|
6300
|
+
}
|
|
6301
|
+
}
|
|
6302
|
+
const pkg = loadPackageJson();
|
|
6303
|
+
/**
|
|
6304
|
+
* CLI version resolved from package.json at runtime
|
|
6305
|
+
*/
|
|
6306
|
+
const CLI_VERSION = `~${pkg.version}`;
|
|
6294
6307
|
/**
|
|
6295
6308
|
* Package versions for @geekmidas packages
|
|
6296
6309
|
*
|
|
6297
|
-
* AUTO-GENERATED - Do not edit manually
|
|
6310
|
+
* AUTO-GENERATED (except CLI) - Do not edit manually
|
|
6298
6311
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
6299
6312
|
*/
|
|
6300
6313
|
const GEEKMIDAS_VERSIONS = {
|
|
6301
6314
|
"@geekmidas/audit": "~1.0.0",
|
|
6302
6315
|
"@geekmidas/auth": "~1.0.0",
|
|
6303
6316
|
"@geekmidas/cache": "~1.0.0",
|
|
6304
|
-
"@geekmidas/cli": "~1.0.0",
|
|
6305
6317
|
"@geekmidas/client": "~1.0.0",
|
|
6306
6318
|
"@geekmidas/cloud": "~1.0.0",
|
|
6307
6319
|
"@geekmidas/constructs": "~1.0.0",
|
|
@@ -6317,7 +6329,8 @@ const GEEKMIDAS_VERSIONS = {
|
|
|
6317
6329
|
"@geekmidas/storage": "~1.0.0",
|
|
6318
6330
|
"@geekmidas/studio": "~1.0.0",
|
|
6319
6331
|
"@geekmidas/telescope": "~1.0.0",
|
|
6320
|
-
"@geekmidas/testkit": "~1.0.0"
|
|
6332
|
+
"@geekmidas/testkit": "~1.0.0",
|
|
6333
|
+
"@geekmidas/cli": CLI_VERSION
|
|
6321
6334
|
};
|
|
6322
6335
|
|
|
6323
6336
|
//#endregion
|