@geekmidas/cli 1.1.0 → 1.2.1

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{config-ClfjsfwH.mjs → config-BQ4a36Rq.mjs} +2 -2
  3. package/dist/{config-ClfjsfwH.mjs.map → config-BQ4a36Rq.mjs.map} +1 -1
  4. package/dist/{config-CKfif10N.cjs → config-Bayob8pB.cjs} +2 -2
  5. package/dist/{config-CKfif10N.cjs.map → config-Bayob8pB.cjs.map} +1 -1
  6. package/dist/config.cjs +2 -2
  7. package/dist/config.d.cts +1 -1
  8. package/dist/config.d.mts +1 -1
  9. package/dist/config.mjs +2 -2
  10. package/dist/{index-CHQs8G3q.d.mts → index-Bi9vGQJy.d.mts} +56 -13
  11. package/dist/index-Bi9vGQJy.d.mts.map +1 -0
  12. package/dist/{index-afBljZKY.d.cts → index-CufAAnge.d.cts} +56 -13
  13. package/dist/index-CufAAnge.d.cts.map +1 -0
  14. package/dist/index.cjs +17 -10
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.mjs +17 -10
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/{openapi-D3p6s8UA.cjs → openapi-BZP8jkI4.cjs} +2 -2
  19. package/dist/{openapi-D3p6s8UA.cjs.map → openapi-BZP8jkI4.cjs.map} +1 -1
  20. package/dist/{openapi-C6sa0L8b.mjs → openapi-DrbBWq0s.mjs} +2 -2
  21. package/dist/{openapi-C6sa0L8b.mjs.map → openapi-DrbBWq0s.mjs.map} +1 -1
  22. package/dist/openapi.cjs +3 -3
  23. package/dist/openapi.mjs +3 -3
  24. package/dist/workspace/index.cjs +2 -1
  25. package/dist/workspace/index.d.cts +2 -2
  26. package/dist/workspace/index.d.mts +2 -2
  27. package/dist/workspace/index.mjs +2 -2
  28. package/dist/{workspace-CjT323qw.cjs → workspace-BMJE18LV.cjs} +44 -5
  29. package/dist/workspace-BMJE18LV.cjs.map +1 -0
  30. package/dist/{workspace-CmITpum4.mjs → workspace-CASoZOjs.mjs} +39 -6
  31. package/dist/workspace-CASoZOjs.mjs.map +1 -0
  32. package/package.json +3 -3
  33. package/src/deploy/__tests__/CachedStateProvider.spec.ts +7 -0
  34. package/src/deploy/__tests__/LocalStateProvider.spec.ts +4 -0
  35. package/src/deploy/__tests__/SSMStateProvider.spec.ts +5 -0
  36. package/src/deploy/__tests__/dns-verification.spec.ts +1 -1
  37. package/src/deploy/__tests__/env-resolver.spec.ts +9 -9
  38. package/src/deploy/__tests__/state-e2e.spec.ts +2 -0
  39. package/src/deploy/__tests__/state.spec.ts +53 -29
  40. package/src/deploy/index.ts +6 -1
  41. package/src/deploy/sniffer.ts +1 -1
  42. package/src/deploy/state.ts +4 -0
  43. package/src/dev/index.ts +2 -2
  44. package/src/init/generators/web.ts +2 -0
  45. package/src/init/versions.ts +1 -1
  46. package/src/workspace/__tests__/index.spec.ts +68 -0
  47. package/src/workspace/index.ts +43 -0
  48. package/src/workspace/schema.ts +17 -6
  49. package/src/workspace/types.ts +19 -9
  50. package/dist/index-CHQs8G3q.d.mts.map +0 -1
  51. package/dist/index-afBljZKY.d.cts.map +0 -1
  52. package/dist/workspace-CjT323qw.cjs.map +0 -1
  53. package/dist/workspace-CmITpum4.mjs.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-CmITpum4.mjs";
3
- import { getAppNameFromCwd, loadAppConfig, loadConfig, loadWorkspaceConfig, parseModuleConfig } from "./config-ClfjsfwH.mjs";
2
+ import { __require, getAppBuildOrder, getDependencyEnvVars, getDeployTargetError, isDeployTargetSupported } from "./workspace-CASoZOjs.mjs";
3
+ import { getAppNameFromCwd, loadAppConfig, loadConfig, loadWorkspaceConfig, parseModuleConfig } from "./config-BQ4a36Rq.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-C6sa0L8b.mjs";
5
+ import { ConstructGenerator, EndpointGenerator, OPENAPI_OUTPUT_PATH, OpenApiTsGenerator, generateOpenApi, openapiCommand, resolveOpenApiConfig } from "./openapi-DrbBWq0s.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.2";
34
+ var version = "1.2.0";
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";
@@ -1827,8 +1827,8 @@ async function execCommand(commandArgs, options = {}) {
1827
1827
  if (!cmd) throw new Error("No command specified");
1828
1828
  logger$9.log(`🚀 Running: ${commandArgs.join(" ")}`);
1829
1829
  const existingNodeOptions = process.env.NODE_OPTIONS ?? "";
1830
- const tsxImport = "--import tsx";
1831
- const preloadImport = `--import ${preloadPath}`;
1830
+ const tsxImport = "--import=tsx";
1831
+ const preloadImport = `--import=${preloadPath}`;
1832
1832
  const nodeOptions = [
1833
1833
  existingNodeOptions,
1834
1834
  tsxImport,
@@ -2156,10 +2156,11 @@ function getAppOutputPath(workspace, _appName, app) {
2156
2156
  /**
2157
2157
  * Create a new empty state for a stage
2158
2158
  */
2159
- function createEmptyState(stage, environmentId) {
2159
+ function createEmptyState(stage, projectId, environmentId) {
2160
2160
  return {
2161
2161
  provider: "dokploy",
2162
2162
  stage,
2163
+ projectId,
2163
2164
  environmentId,
2164
2165
  applications: {},
2165
2166
  services: {},
@@ -4779,7 +4780,7 @@ async function sniffEntryFile(entryPath, appPath, workspacePath) {
4779
4780
  ],
4780
4781
  env: {
4781
4782
  ...process.env,
4782
- NODE_OPTIONS: "--import tsx"
4783
+ NODE_OPTIONS: "--import=tsx"
4783
4784
  }
4784
4785
  });
4785
4786
  let stdout$1 = "";
@@ -5507,13 +5508,17 @@ async function workspaceDeployCommand(workspace, options) {
5507
5508
  let state = await stateProvider.read(stage);
5508
5509
  if (state) {
5509
5510
  logger$1.log(` Found existing state for stage "${stage}"`);
5511
+ if (state.projectId !== project.projectId) {
5512
+ logger$1.log(` ⚠ Project ID changed, updating state`);
5513
+ state.projectId = project.projectId;
5514
+ }
5510
5515
  if (state.environmentId !== environmentId) {
5511
5516
  logger$1.log(` ⚠ Environment ID changed, updating state`);
5512
5517
  state.environmentId = environmentId;
5513
5518
  }
5514
5519
  } else {
5515
5520
  logger$1.log(` Creating new state for stage "${stage}"`);
5516
- state = createEmptyState(stage, environmentId);
5521
+ state = createEmptyState(stage, project.projectId, environmentId);
5517
5522
  }
5518
5523
  logger$1.log("\n🐳 Checking registry...");
5519
5524
  let registryId = await getDokployRegistryId();
@@ -6329,7 +6334,7 @@ const GEEKMIDAS_VERSIONS = {
6329
6334
  "@geekmidas/storage": "~1.0.0",
6330
6335
  "@geekmidas/studio": "~1.0.0",
6331
6336
  "@geekmidas/telescope": "~1.0.0",
6332
- "@geekmidas/testkit": "~1.0.0",
6337
+ "@geekmidas/testkit": "~1.0.1",
6333
6338
  "@geekmidas/cli": CLI_VERSION
6334
6339
  };
6335
6340
 
@@ -9917,6 +9922,7 @@ function generateWebAppFiles(options) {
9917
9922
  [modelsPackage]: "workspace:*",
9918
9923
  [uiPackage]: "workspace:*",
9919
9924
  "@geekmidas/client": GEEKMIDAS_VERSIONS["@geekmidas/client"],
9925
+ "@geekmidas/envkit": GEEKMIDAS_VERSIONS["@geekmidas/envkit"],
9920
9926
  "@tanstack/react-query": "~5.80.0",
9921
9927
  "better-auth": "~1.2.0",
9922
9928
  next: "~16.1.0",
@@ -9930,6 +9936,7 @@ function generateWebAppFiles(options) {
9930
9936
  "@types/react": "~19.0.0",
9931
9937
  "@types/react-dom": "~19.0.0",
9932
9938
  tailwindcss: "^4.0.0",
9939
+ tsx: "~4.20.0",
9933
9940
  typescript: "~5.8.2"
9934
9941
  }
9935
9942
  };