@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/CHANGELOG.md +12 -0
- package/bin/gkm.mjs +11 -2
- package/dist/index.cjs +7 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +7 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/exec/index.ts +7 -12
- package/src/init/__tests__/init.spec.ts +0 -1
- package/src/init/generators/web.ts +1 -1
- package/src/init/versions.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @geekmidas/cli
|
|
2
2
|
|
|
3
|
+
## 1.10.24
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 🐛 [`b3565b8`](https://github.com/geekmidas/toolbox/commit/b3565b89e57f100157faf82d89077c3d24df78fd) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix exec script to load mjs instead of ts
|
|
8
|
+
|
|
9
|
+
## 1.10.23
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 🐛 [`61ae404`](https://github.com/geekmidas/toolbox/commit/61ae404061a1061c4a724d0f187764475903b625) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix tsx import
|
|
14
|
+
|
|
3
15
|
## 1.10.22
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/bin/gkm.mjs
CHANGED
|
@@ -9,15 +9,24 @@ import { pathToFileURL } from 'node:url';
|
|
|
9
9
|
const nodeOptions = process.env.NODE_OPTIONS || '';
|
|
10
10
|
if (
|
|
11
11
|
!nodeOptions.includes('--import tsx') &&
|
|
12
|
-
!nodeOptions.includes('--import=tsx')
|
|
12
|
+
!nodeOptions.includes('--import=tsx') &&
|
|
13
|
+
!nodeOptions.includes('--import file:') &&
|
|
14
|
+
!nodeOptions.includes('--import=file:')
|
|
13
15
|
) {
|
|
16
|
+
// Resolve tsx from the CLI package's own node_modules, not the cwd.
|
|
17
|
+
// This ensures it works when the CLI is run via `pnpm dlx` in a
|
|
18
|
+
// directory that doesn't have tsx installed.
|
|
19
|
+
const { createRequire } = await import('node:module');
|
|
20
|
+
const require = createRequire(import.meta.url);
|
|
21
|
+
const tsxPath = pathToFileURL(require.resolve('tsx')).href;
|
|
22
|
+
|
|
14
23
|
const { execFileSync } = await import('node:child_process');
|
|
15
24
|
try {
|
|
16
25
|
execFileSync(process.execPath, process.argv.slice(1), {
|
|
17
26
|
stdio: 'inherit',
|
|
18
27
|
env: {
|
|
19
28
|
...process.env,
|
|
20
|
-
NODE_OPTIONS: `${nodeOptions} --import
|
|
29
|
+
NODE_OPTIONS: `${nodeOptions} --import ${tsxPath}`.trim(),
|
|
21
30
|
},
|
|
22
31
|
});
|
|
23
32
|
} catch (e) {
|
package/dist/index.cjs
CHANGED
|
@@ -35,7 +35,7 @@ const prompts = require_chunk.__toESM(require("prompts"));
|
|
|
35
35
|
|
|
36
36
|
//#region package.json
|
|
37
37
|
var name = "@geekmidas/cli";
|
|
38
|
-
var version = "1.10.
|
|
38
|
+
var version = "1.10.23";
|
|
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";
|
|
@@ -1113,20 +1113,14 @@ async function execCommand(commandArgs, options = {}) {
|
|
|
1113
1113
|
if (secretCount > 0) logger$12.log(`🔐 Loaded ${secretCount} secret(s)`);
|
|
1114
1114
|
const preloadDir = (0, node_path.join)(cwd, ".gkm");
|
|
1115
1115
|
await (0, node_fs_promises.mkdir)(preloadDir, { recursive: true });
|
|
1116
|
-
const preloadPath = (0, node_path.join)(preloadDir, "credentials-preload.
|
|
1116
|
+
const preloadPath = (0, node_path.join)(preloadDir, "credentials-preload.mjs");
|
|
1117
1117
|
await createCredentialsPreload(preloadPath, secretsJsonPath);
|
|
1118
|
-
const [cmd, ...
|
|
1118
|
+
const [cmd, ...args] = commandArgs;
|
|
1119
1119
|
if (!cmd) throw new Error("No command specified");
|
|
1120
|
-
const args = rawArgs.map((arg) => arg.replace(/\$PORT\b/g, credentials.PORT ?? "3000"));
|
|
1121
1120
|
logger$12.log(`🚀 Running: ${[cmd, ...args].join(" ")}`);
|
|
1122
1121
|
const existingNodeOptions = process.env.NODE_OPTIONS ?? "";
|
|
1123
|
-
const tsxImport = "--import=tsx";
|
|
1124
1122
|
const preloadImport = `--import=${preloadPath}`;
|
|
1125
|
-
const nodeOptions = [
|
|
1126
|
-
existingNodeOptions,
|
|
1127
|
-
tsxImport,
|
|
1128
|
-
preloadImport
|
|
1129
|
-
].filter(Boolean).join(" ");
|
|
1123
|
+
const nodeOptions = [existingNodeOptions, preloadImport].filter(Boolean).join(" ");
|
|
1130
1124
|
const child = (0, node_child_process.spawn)(cmd, args, {
|
|
1131
1125
|
cwd,
|
|
1132
1126
|
stdio: "inherit",
|
|
@@ -6845,9 +6839,9 @@ const GEEKMIDAS_VERSIONS = {
|
|
|
6845
6839
|
"@geekmidas/audit": "~2.0.0",
|
|
6846
6840
|
"@geekmidas/auth": "~2.0.0",
|
|
6847
6841
|
"@geekmidas/cache": "~1.1.0",
|
|
6848
|
-
"@geekmidas/client": "~4.0.
|
|
6842
|
+
"@geekmidas/client": "~4.0.4",
|
|
6849
6843
|
"@geekmidas/cloud": "~1.0.0",
|
|
6850
|
-
"@geekmidas/constructs": "~3.0.
|
|
6844
|
+
"@geekmidas/constructs": "~3.0.5",
|
|
6851
6845
|
"@geekmidas/db": "~1.0.1",
|
|
6852
6846
|
"@geekmidas/emailkit": "~1.0.0",
|
|
6853
6847
|
"@geekmidas/envkit": "~1.0.4",
|
|
@@ -10740,7 +10734,7 @@ function generateWebAppFiles(options) {
|
|
|
10740
10734
|
private: true,
|
|
10741
10735
|
type: "module",
|
|
10742
10736
|
scripts: {
|
|
10743
|
-
dev: "gkm exec -- next dev --turbopack
|
|
10737
|
+
dev: "gkm exec -- next dev --turbopack",
|
|
10744
10738
|
build: "gkm exec -- next build",
|
|
10745
10739
|
start: "next start",
|
|
10746
10740
|
typecheck: "tsc --noEmit"
|