@geekmidas/cli 1.0.1 → 1.0.2

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.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs",
5
5
  "private": false,
6
6
  "type": "module",
@@ -56,8 +56,8 @@
56
56
  "@geekmidas/constructs": "~1.0.0",
57
57
  "@geekmidas/envkit": "~1.0.0",
58
58
  "@geekmidas/errors": "~1.0.0",
59
- "@geekmidas/schema": "~1.0.0",
60
- "@geekmidas/logger": "~1.0.0"
59
+ "@geekmidas/logger": "~1.0.0",
60
+ "@geekmidas/schema": "~1.0.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/lodash.kebabcase": "^4.1.9",
@@ -16,7 +16,6 @@ const PACKAGES = [
16
16
  'audit',
17
17
  'auth',
18
18
  'cache',
19
- 'cli',
20
19
  'client',
21
20
  'cloud',
22
21
  'constructs',
@@ -54,16 +53,39 @@ function generateVersionsFile(): string {
54
53
  versions[`@geekmidas/${pkg}`] = `~${version}`;
55
54
  }
56
55
 
57
- const content = `/**
56
+ const content = `import { createRequire } from 'node:module';
57
+
58
+ const require = createRequire(import.meta.url);
59
+
60
+ // Load package.json - handles both bundled (flat dist/) and source (nested src/init/)
61
+ function loadPackageJson(): { version: string } {
62
+ try {
63
+ // Try flat dist path first (../package.json from dist/)
64
+ return require('../package.json');
65
+ } catch {
66
+ // Fall back to nested source path (../../package.json from src/init/)
67
+ return require('../../package.json');
68
+ }
69
+ }
70
+
71
+ const pkg = loadPackageJson();
72
+
73
+ /**
74
+ * CLI version resolved from package.json at runtime
75
+ */
76
+ export const CLI_VERSION = \`~\${pkg.version}\`;
77
+
78
+ /**
58
79
  * Package versions for @geekmidas packages
59
80
  *
60
- * AUTO-GENERATED - Do not edit manually
81
+ * AUTO-GENERATED (except CLI) - Do not edit manually
61
82
  * Run: pnpm --filter @geekmidas/cli sync-versions
62
83
  */
63
84
  export const GEEKMIDAS_VERSIONS = {
64
85
  ${Object.entries(versions)
65
86
  .map(([pkg, version]) => `\t'${pkg}': '${version}',`)
66
87
  .join('\n')}
88
+ '@geekmidas/cli': CLI_VERSION,
67
89
  } as const;
68
90
 
69
91
  export type GeekmidasPackage = keyof typeof GEEKMIDAS_VERSIONS;
@@ -1,14 +1,35 @@
1
+ import { createRequire } from 'node:module';
2
+
3
+ const require = createRequire(import.meta.url);
4
+
5
+ // Load package.json - handles both bundled (flat dist/) and source (nested src/init/)
6
+ function loadPackageJson(): { version: string } {
7
+ try {
8
+ // Try flat dist path first (../package.json from dist/)
9
+ return require('../package.json');
10
+ } catch {
11
+ // Fall back to nested source path (../../package.json from src/init/)
12
+ return require('../../package.json');
13
+ }
14
+ }
15
+
16
+ const pkg = loadPackageJson();
17
+
18
+ /**
19
+ * CLI version resolved from package.json at runtime
20
+ */
21
+ export const CLI_VERSION = `~${pkg.version}`;
22
+
1
23
  /**
2
24
  * Package versions for @geekmidas packages
3
25
  *
4
- * AUTO-GENERATED - Do not edit manually
26
+ * AUTO-GENERATED (except CLI) - Do not edit manually
5
27
  * Run: pnpm --filter @geekmidas/cli sync-versions
6
28
  */
7
29
  export const GEEKMIDAS_VERSIONS = {
8
30
  '@geekmidas/audit': '~1.0.0',
9
31
  '@geekmidas/auth': '~1.0.0',
10
32
  '@geekmidas/cache': '~1.0.0',
11
- '@geekmidas/cli': '~1.0.0',
12
33
  '@geekmidas/client': '~1.0.0',
13
34
  '@geekmidas/cloud': '~1.0.0',
14
35
  '@geekmidas/constructs': '~1.0.0',
@@ -25,6 +46,7 @@ export const GEEKMIDAS_VERSIONS = {
25
46
  '@geekmidas/studio': '~1.0.0',
26
47
  '@geekmidas/telescope': '~1.0.0',
27
48
  '@geekmidas/testkit': '~1.0.0',
49
+ '@geekmidas/cli': CLI_VERSION,
28
50
  } as const;
29
51
 
30
52
  export type GeekmidasPackage = keyof typeof GEEKMIDAS_VERSIONS;