@geekmidas/cli 0.40.0 → 0.42.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/dist/{bundler-DsXfFSCU.cjs → bundler-BB-kETMd.cjs} +19 -48
- package/dist/bundler-BB-kETMd.cjs.map +1 -0
- package/dist/{bundler-Db83tLti.mjs → bundler-DGry2vaR.mjs} +21 -50
- package/dist/bundler-DGry2vaR.mjs.map +1 -0
- package/dist/index.cjs +34 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +34 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/build/bundler.ts +27 -79
- package/src/docker/index.ts +7 -3
- package/src/docker/templates.ts +16 -0
- package/src/init/generators/models.ts +1 -3
- package/src/init/generators/monorepo.ts +4 -0
- package/src/init/generators/package.ts +4 -7
- package/src/init/templates/api.ts +6 -4
- package/dist/bundler-Db83tLti.mjs.map +0 -1
- package/dist/bundler-DsXfFSCU.cjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -28,7 +28,7 @@ import prompts from "prompts";
|
|
|
28
28
|
|
|
29
29
|
//#region package.json
|
|
30
30
|
var name = "@geekmidas/cli";
|
|
31
|
-
var version = "0.
|
|
31
|
+
var version = "0.41.0";
|
|
32
32
|
var description = "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs";
|
|
33
33
|
var private$1 = false;
|
|
34
34
|
var type = "module";
|
|
@@ -2121,7 +2121,7 @@ async function buildForProvider(provider, context, rootOutputDir, endpointGenera
|
|
|
2121
2121
|
let masterKey;
|
|
2122
2122
|
if (context.production?.bundle && !skipBundle) {
|
|
2123
2123
|
logger$6.log(`\n📦 Bundling production server...`);
|
|
2124
|
-
const { bundleServer } = await import("./bundler-
|
|
2124
|
+
const { bundleServer } = await import("./bundler-DGry2vaR.mjs");
|
|
2125
2125
|
const allConstructs = [
|
|
2126
2126
|
...endpoints.map((e) => e.construct),
|
|
2127
2127
|
...functions.map((f) => f.construct),
|
|
@@ -3078,6 +3078,13 @@ ${publicUrlEnvDeclarations}
|
|
|
3078
3078
|
# Copy pruned source
|
|
3079
3079
|
COPY --from=pruner /app/out/full/ ./
|
|
3080
3080
|
|
|
3081
|
+
# Copy workspace root configs for turbo builds (turbo prune doesn't include root configs)
|
|
3082
|
+
# Using wildcard to make it optional for single-app projects
|
|
3083
|
+
COPY --from=pruner /app/tsconfig.* ./
|
|
3084
|
+
|
|
3085
|
+
# Ensure public directory exists (may be empty for scaffolded projects)
|
|
3086
|
+
RUN mkdir -p ${appPath}/public
|
|
3087
|
+
|
|
3081
3088
|
# Set Next.js to produce standalone output
|
|
3082
3089
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
3083
3090
|
|
|
@@ -3172,6 +3179,11 @@ ARG GKM_CREDENTIALS_IV=""
|
|
|
3172
3179
|
# Copy pruned source
|
|
3173
3180
|
COPY --from=pruner /app/out/full/ ./
|
|
3174
3181
|
|
|
3182
|
+
# Copy workspace root configs for turbo builds (turbo prune doesn't include root configs)
|
|
3183
|
+
# Using wildcard to make it optional for single-app projects
|
|
3184
|
+
COPY --from=pruner /app/gkm.config.* ./
|
|
3185
|
+
COPY --from=pruner /app/tsconfig.* ./
|
|
3186
|
+
|
|
3175
3187
|
# Write encrypted credentials for gkm build to embed
|
|
3176
3188
|
RUN if [ -n "$GKM_ENCRYPTED_CREDENTIALS" ]; then \
|
|
3177
3189
|
mkdir -p ${appPath}/.gkm && \
|
|
@@ -3263,6 +3275,10 @@ ARG GKM_CREDENTIALS_IV=""
|
|
|
3263
3275
|
# Copy pruned source
|
|
3264
3276
|
COPY --from=pruner /app/out/full/ ./
|
|
3265
3277
|
|
|
3278
|
+
# Copy workspace root configs for turbo builds (turbo prune doesn't include root configs)
|
|
3279
|
+
# Using wildcard to make it optional for single-app projects
|
|
3280
|
+
COPY --from=pruner /app/tsconfig.* ./
|
|
3281
|
+
|
|
3266
3282
|
# Write encrypted credentials for tsdown to embed via define
|
|
3267
3283
|
RUN if [ -n "$GKM_ENCRYPTED_CREDENTIALS" ]; then \
|
|
3268
3284
|
mkdir -p ${appPath}/.gkm && \
|
|
@@ -3473,7 +3489,10 @@ async function pushDockerImage(imageName, options) {
|
|
|
3473
3489
|
*/
|
|
3474
3490
|
function getAppPackageName(appPath) {
|
|
3475
3491
|
try {
|
|
3476
|
-
const
|
|
3492
|
+
const pkgPath = join(appPath, "package.json");
|
|
3493
|
+
if (!existsSync(pkgPath)) return void 0;
|
|
3494
|
+
const content = readFileSync(pkgPath, "utf-8");
|
|
3495
|
+
const pkg$1 = JSON.parse(content);
|
|
3477
3496
|
return pkg$1.name;
|
|
3478
3497
|
} catch {
|
|
3479
3498
|
return void 0;
|
|
@@ -5818,7 +5837,7 @@ function generateModelsPackage(options) {
|
|
|
5818
5837
|
type: "module",
|
|
5819
5838
|
exports: { "./*": "./src/*.ts" },
|
|
5820
5839
|
scripts: { typecheck: "tsc --noEmit" },
|
|
5821
|
-
dependencies: {
|
|
5840
|
+
dependencies: {},
|
|
5822
5841
|
devDependencies: { typescript: "~5.8.2" }
|
|
5823
5842
|
};
|
|
5824
5843
|
const tsConfig = {
|
|
@@ -5958,9 +5977,11 @@ function generateMonorepoFiles(options, _template) {
|
|
|
5958
5977
|
"fmt:check": "biome format .",
|
|
5959
5978
|
...options.deployTarget === "dokploy" ? { deploy: "gkm deploy --provider dokploy --stage production" } : {}
|
|
5960
5979
|
},
|
|
5980
|
+
dependencies: { zod: "~4.1.0" },
|
|
5961
5981
|
devDependencies: {
|
|
5962
5982
|
"@biomejs/biome": "~2.3.0",
|
|
5963
5983
|
"@geekmidas/cli": GEEKMIDAS_VERSIONS["@geekmidas/cli"],
|
|
5984
|
+
esbuild: "~0.27.0",
|
|
5964
5985
|
turbo: "~2.3.0",
|
|
5965
5986
|
typescript: "~5.8.2",
|
|
5966
5987
|
vitest: "~4.0.0"
|
|
@@ -6283,12 +6304,14 @@ const apiTemplate = {
|
|
|
6283
6304
|
"@geekmidas/auth": GEEKMIDAS_VERSIONS["@geekmidas/auth"],
|
|
6284
6305
|
"@hono/node-server": "~1.14.1",
|
|
6285
6306
|
hono: "~4.8.2",
|
|
6286
|
-
pino: "~9.6.0"
|
|
6307
|
+
pino: "~9.6.0",
|
|
6308
|
+
zod: "~4.1.0"
|
|
6287
6309
|
},
|
|
6288
6310
|
devDependencies: {
|
|
6289
6311
|
"@biomejs/biome": "~2.3.0",
|
|
6290
6312
|
"@geekmidas/cli": GEEKMIDAS_VERSIONS["@geekmidas/cli"],
|
|
6291
6313
|
"@types/node": "~22.0.0",
|
|
6314
|
+
esbuild: "~0.27.0",
|
|
6292
6315
|
tsx: "~4.20.0",
|
|
6293
6316
|
turbo: "~2.3.0",
|
|
6294
6317
|
typescript: "~5.8.2",
|
|
@@ -6371,8 +6394,8 @@ export const listUsersEndpoint = e
|
|
|
6371
6394
|
.output(ListUsersResponseSchema)
|
|
6372
6395
|
.handle(async () => ({
|
|
6373
6396
|
users: [
|
|
6374
|
-
{ id: '
|
|
6375
|
-
{ id: '
|
|
6397
|
+
{ id: '550e8400-e29b-41d4-a716-446655440001', name: 'Alice' },
|
|
6398
|
+
{ id: '550e8400-e29b-41d4-a716-446655440002', name: 'Bob' },
|
|
6376
6399
|
],
|
|
6377
6400
|
}));
|
|
6378
6401
|
` : `import { e } from '@geekmidas/constructs/endpoints';
|
|
@@ -6399,12 +6422,12 @@ export const listUsersEndpoint = e
|
|
|
6399
6422
|
{
|
|
6400
6423
|
path: getRoutePath("users/get.ts"),
|
|
6401
6424
|
content: modelsImport ? `import { e } from '@geekmidas/constructs/endpoints';
|
|
6402
|
-
import {
|
|
6425
|
+
import { IdSchema } from '${modelsImport}/common';
|
|
6403
6426
|
import { UserResponseSchema } from '${modelsImport}/user';
|
|
6404
6427
|
|
|
6405
6428
|
export const getUserEndpoint = e
|
|
6406
6429
|
.get('/users/:id')
|
|
6407
|
-
.params(
|
|
6430
|
+
.params({ id: IdSchema })
|
|
6408
6431
|
.output(UserResponseSchema)
|
|
6409
6432
|
.handle(async ({ params }) => ({
|
|
6410
6433
|
id: params.id,
|
|
@@ -7145,15 +7168,15 @@ function generatePackageJson(options, template) {
|
|
|
7145
7168
|
dependencies$1.pg = "~8.16.0";
|
|
7146
7169
|
devDependencies$1["@types/pg"] = "~8.15.0";
|
|
7147
7170
|
}
|
|
7148
|
-
dependencies$1.zod = "~4.1.0";
|
|
7149
7171
|
if (monorepo) {
|
|
7150
7172
|
delete devDependencies$1["@biomejs/biome"];
|
|
7151
7173
|
delete devDependencies$1.turbo;
|
|
7174
|
+
delete devDependencies$1.esbuild;
|
|
7175
|
+
delete dependencies$1.zod;
|
|
7152
7176
|
delete scripts$1.lint;
|
|
7153
7177
|
delete scripts$1.fmt;
|
|
7154
7178
|
delete scripts$1["fmt:check"];
|
|
7155
7179
|
dependencies$1[`@${name$1}/models`] = "workspace:*";
|
|
7156
|
-
delete dependencies$1.zod;
|
|
7157
7180
|
}
|
|
7158
7181
|
const sortObject = (obj) => Object.fromEntries(Object.entries(obj).sort(([a], [b]) => a.localeCompare(b)));
|
|
7159
7182
|
let packageName = name$1;
|