@geekmidas/cli 1.10.22 → 1.10.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/cli",
3
- "version": "1.10.22",
3
+ "version": "1.10.24",
4
4
  "description": "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs",
5
5
  "private": false,
6
6
  "type": "module",
@@ -56,7 +56,7 @@
56
56
  "prompts": "~2.4.2",
57
57
  "tsx": "~4.20.3",
58
58
  "yaml": "~2.8.2",
59
- "@geekmidas/constructs": "~3.0.3",
59
+ "@geekmidas/constructs": "~3.0.5",
60
60
  "@geekmidas/envkit": "~1.0.4",
61
61
  "@geekmidas/errors": "~1.0.0",
62
62
  "@geekmidas/logger": "~1.0.0",
package/src/exec/index.ts CHANGED
@@ -61,34 +61,29 @@ export async function execCommand(
61
61
  }
62
62
 
63
63
  // Create preload script that injects Credentials
64
- // Create in cwd so package resolution works (finds node_modules in app directory)
64
+ // Written as .mjs (plain ESM) so it doesn't need tsx this avoids
65
+ // breaking frameworks like Next.js whose workers inherit NODE_OPTIONS.
65
66
  const preloadDir = join(cwd, '.gkm');
66
67
  await mkdir(preloadDir, { recursive: true });
67
- const preloadPath = join(preloadDir, 'credentials-preload.ts');
68
+ const preloadPath = join(preloadDir, 'credentials-preload.mjs');
68
69
  await createCredentialsPreload(preloadPath, secretsJsonPath);
69
70
 
70
71
  // Build command
71
- const [cmd, ...rawArgs] = commandArgs;
72
+ const [cmd, ...args] = commandArgs;
72
73
 
73
74
  if (!cmd) {
74
75
  throw new Error('No command specified');
75
76
  }
76
77
 
77
- // Replace template variables in command args (e.g. $PORT -> resolved port)
78
- const args = rawArgs.map((arg) =>
79
- arg.replace(/\$PORT\b/g, credentials.PORT ?? '3000'),
80
- );
81
-
82
78
  logger.log(`🚀 Running: ${[cmd, ...args].join(' ')}`);
83
79
 
84
80
  // Merge NODE_OPTIONS with existing value (if any)
85
- // Add tsx loader first so our .ts preload can be loaded
81
+ // The preload is .mjs so no tsx loader needed safe for frameworks
82
+ // like Next.js whose workers inherit NODE_OPTIONS.
86
83
  const existingNodeOptions = process.env.NODE_OPTIONS ?? '';
87
- const tsxImport = '--import=tsx';
88
84
  const preloadImport = `--import=${preloadPath}`;
89
85
 
90
- // Build NODE_OPTIONS: existing + tsx loader + our preload
91
- const nodeOptions = [existingNodeOptions, tsxImport, preloadImport]
86
+ const nodeOptions = [existingNodeOptions, preloadImport]
92
87
  .filter(Boolean)
93
88
  .join(' ');
94
89
 
@@ -417,7 +417,6 @@ describe('initCommand', () => {
417
417
  expect(pkg.dependencies.next).toBeDefined();
418
418
  expect(pkg.dependencies.react).toBeDefined();
419
419
  expect(pkg.scripts.dev).toContain('next dev');
420
- expect(pkg.scripts.dev).toContain('-p $PORT');
421
420
  });
422
421
 
423
422
  it('should include services config in workspace', async () => {
@@ -20,7 +20,7 @@ export function generateWebAppFiles(options: TemplateOptions): GeneratedFile[] {
20
20
  private: true,
21
21
  type: 'module',
22
22
  scripts: {
23
- dev: 'gkm exec -- next dev --turbopack -p $PORT',
23
+ dev: 'gkm exec -- next dev --turbopack',
24
24
  build: 'gkm exec -- next build',
25
25
  start: 'next start',
26
26
  typecheck: 'tsc --noEmit',
@@ -30,9 +30,9 @@ export const GEEKMIDAS_VERSIONS = {
30
30
  '@geekmidas/audit': '~2.0.0',
31
31
  '@geekmidas/auth': '~2.0.0',
32
32
  '@geekmidas/cache': '~1.1.0',
33
- '@geekmidas/client': '~4.0.1',
33
+ '@geekmidas/client': '~4.0.4',
34
34
  '@geekmidas/cloud': '~1.0.0',
35
- '@geekmidas/constructs': '~3.0.3',
35
+ '@geekmidas/constructs': '~3.0.5',
36
36
  '@geekmidas/db': '~1.0.1',
37
37
  '@geekmidas/emailkit': '~1.0.0',
38
38
  '@geekmidas/envkit': '~1.0.4',