@geekmidas/cli 0.39.0 → 0.40.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-DQIuE3Kn.mjs → bundler-Db83tLti.mjs} +2 -2
- package/dist/{bundler-DQIuE3Kn.mjs.map → bundler-Db83tLti.mjs.map} +1 -1
- package/dist/{bundler-CyHg1v_T.cjs → bundler-DsXfFSCU.cjs} +2 -2
- package/dist/{bundler-CyHg1v_T.cjs.map → bundler-DsXfFSCU.cjs.map} +1 -1
- package/dist/{config-BC5n1a2D.mjs → config-C0b0jdmU.mjs} +2 -2
- package/dist/{config-BC5n1a2D.mjs.map → config-C0b0jdmU.mjs.map} +1 -1
- package/dist/{config-BAE9LFC1.cjs → config-xVZsRjN7.cjs} +2 -2
- package/dist/{config-BAE9LFC1.cjs.map → config-xVZsRjN7.cjs.map} +1 -1
- package/dist/config.cjs +2 -2
- package/dist/config.d.cts +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +2 -2
- package/dist/dokploy-api-Bdmk5ImW.cjs +3 -0
- package/dist/{dokploy-api-C5czOZoc.cjs → dokploy-api-BdxOMH_V.cjs} +43 -1
- package/dist/{dokploy-api-C5czOZoc.cjs.map → dokploy-api-BdxOMH_V.cjs.map} +1 -1
- package/dist/{dokploy-api-B9qR2Yn1.mjs → dokploy-api-DWsqNjwP.mjs} +43 -1
- package/dist/{dokploy-api-B9qR2Yn1.mjs.map → dokploy-api-DWsqNjwP.mjs.map} +1 -1
- package/dist/dokploy-api-tZSZaHd9.mjs +3 -0
- package/dist/{encryption-JtMsiGNp.mjs → encryption-BC4MAODn.mjs} +1 -1
- package/dist/{encryption-JtMsiGNp.mjs.map → encryption-BC4MAODn.mjs.map} +1 -1
- package/dist/encryption-Biq0EZ4m.cjs +4 -0
- package/dist/encryption-CQXBZGkt.mjs +3 -0
- package/dist/{encryption-BAz0xQ1Q.cjs → encryption-DaCB_NmS.cjs} +13 -3
- package/dist/{encryption-BAz0xQ1Q.cjs.map → encryption-DaCB_NmS.cjs.map} +1 -1
- package/dist/{index-C7TkoYmt.d.mts → index-CXa3odEw.d.mts} +68 -7
- package/dist/index-CXa3odEw.d.mts.map +1 -0
- package/dist/{index-CpchsC9w.d.cts → index-E8Nu2Rxl.d.cts} +67 -6
- package/dist/index-E8Nu2Rxl.d.cts.map +1 -0
- package/dist/index.cjs +674 -122
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +653 -101
- package/dist/index.mjs.map +1 -1
- package/dist/{openapi-CjYeF-Tg.mjs → openapi-D3pA6FfZ.mjs} +2 -2
- package/dist/{openapi-CjYeF-Tg.mjs.map → openapi-D3pA6FfZ.mjs.map} +1 -1
- package/dist/{openapi-a-e3Y8WA.cjs → openapi-DhcCtKzM.cjs} +2 -2
- package/dist/{openapi-a-e3Y8WA.cjs.map → openapi-DhcCtKzM.cjs.map} +1 -1
- package/dist/{openapi-react-query-DvNpdDpM.cjs → openapi-react-query-C_MxpBgF.cjs} +1 -1
- package/dist/{openapi-react-query-DvNpdDpM.cjs.map → openapi-react-query-C_MxpBgF.cjs.map} +1 -1
- package/dist/{openapi-react-query-5rSortLH.mjs → openapi-react-query-ZoP9DPbY.mjs} +1 -1
- package/dist/{openapi-react-query-5rSortLH.mjs.map → openapi-react-query-ZoP9DPbY.mjs.map} +1 -1
- package/dist/openapi-react-query.cjs +1 -1
- package/dist/openapi-react-query.mjs +1 -1
- package/dist/openapi.cjs +3 -3
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.mjs +3 -3
- package/dist/{types-K2uQJ-FO.d.mts → types-BtGL-8QS.d.mts} +1 -1
- package/dist/{types-K2uQJ-FO.d.mts.map → types-BtGL-8QS.d.mts.map} +1 -1
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.d.cts +2 -2
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +1 -1
- package/dist/{workspace-My0A4IRO.cjs → workspace-BDAhr6Kb.cjs} +33 -4
- package/dist/{workspace-My0A4IRO.cjs.map → workspace-BDAhr6Kb.cjs.map} +1 -1
- package/dist/{workspace-DFJ3sWfY.mjs → workspace-D_6ZCaR_.mjs} +33 -4
- package/dist/{workspace-DFJ3sWfY.mjs.map → workspace-D_6ZCaR_.mjs.map} +1 -1
- package/package.json +5 -5
- package/src/deploy/__tests__/domain.spec.ts +231 -0
- package/src/deploy/__tests__/secrets.spec.ts +300 -0
- package/src/deploy/__tests__/sniffer.spec.ts +221 -0
- package/src/deploy/docker.ts +40 -11
- package/src/deploy/dokploy-api.ts +99 -0
- package/src/deploy/domain.ts +125 -0
- package/src/deploy/index.ts +366 -148
- package/src/deploy/secrets.ts +182 -0
- package/src/deploy/sniffer.ts +180 -0
- package/src/dev/index.ts +11 -0
- package/src/docker/index.ts +17 -2
- package/src/docker/templates.ts +171 -1
- package/src/init/versions.ts +2 -2
- package/src/workspace/index.ts +2 -0
- package/src/workspace/schema.ts +32 -6
- package/src/workspace/types.ts +64 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/dokploy-api-B0w17y4_.mjs +0 -3
- package/dist/dokploy-api-BnGeUqN4.cjs +0 -3
- package/dist/index-C7TkoYmt.d.mts.map +0 -1
- package/dist/index-CpchsC9w.d.cts.map +0 -1
package/src/workspace/schema.ts
CHANGED
|
@@ -57,6 +57,26 @@ const ClientConfigSchema = z.object({
|
|
|
57
57
|
*/
|
|
58
58
|
const AuthProviderSchema = z.enum(['better-auth']);
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Backend framework schema for non-gkm apps.
|
|
62
|
+
*/
|
|
63
|
+
const BackendFrameworkSchema = z.enum([
|
|
64
|
+
'hono',
|
|
65
|
+
'better-auth',
|
|
66
|
+
'express',
|
|
67
|
+
'fastify',
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Frontend framework schema.
|
|
72
|
+
*/
|
|
73
|
+
const FrontendFrameworkSchema = z.enum(['nextjs', 'remix', 'vite']);
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Combined framework schema (backend or frontend).
|
|
77
|
+
*/
|
|
78
|
+
const FrameworkSchema = z.union([BackendFrameworkSchema, FrontendFrameworkSchema]);
|
|
79
|
+
|
|
60
80
|
/**
|
|
61
81
|
* Deploy target schema.
|
|
62
82
|
* Currently only 'dokploy' is supported.
|
|
@@ -205,8 +225,11 @@ const AppConfigSchema = z
|
|
|
205
225
|
runtime: z.enum(['node', 'bun']).optional(),
|
|
206
226
|
env: z.union([z.string(), z.array(z.string())]).optional(),
|
|
207
227
|
|
|
208
|
-
//
|
|
209
|
-
|
|
228
|
+
// Entry point for non-gkm apps (used by dev and docker build)
|
|
229
|
+
entry: z.string().optional(),
|
|
230
|
+
|
|
231
|
+
// Framework (backend or frontend)
|
|
232
|
+
framework: FrameworkSchema.optional(),
|
|
210
233
|
client: ClientConfigSchema.optional(),
|
|
211
234
|
|
|
212
235
|
// Auth-specific
|
|
@@ -215,14 +238,17 @@ const AppConfigSchema = z
|
|
|
215
238
|
// Note: routes is optional for backend apps - some backends like auth servers don't use routes
|
|
216
239
|
.refine(
|
|
217
240
|
(data) => {
|
|
218
|
-
// Frontend apps must have framework
|
|
219
|
-
if (data.type === 'frontend'
|
|
220
|
-
|
|
241
|
+
// Frontend apps must have a frontend framework
|
|
242
|
+
if (data.type === 'frontend') {
|
|
243
|
+
const frontendFrameworks = ['nextjs', 'remix', 'vite'];
|
|
244
|
+
if (!data.framework || !frontendFrameworks.includes(data.framework)) {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
221
247
|
}
|
|
222
248
|
return true;
|
|
223
249
|
},
|
|
224
250
|
{
|
|
225
|
-
message: 'Frontend apps must have framework
|
|
251
|
+
message: 'Frontend apps must have a valid frontend framework (nextjs, remix, vite)',
|
|
226
252
|
path: ['framework'],
|
|
227
253
|
},
|
|
228
254
|
)
|
package/src/workspace/types.ts
CHANGED
|
@@ -16,6 +16,16 @@ import type {
|
|
|
16
16
|
*/
|
|
17
17
|
export type DeployTarget = 'dokploy' | 'vercel' | 'cloudflare';
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Backend framework types for apps that don't use gkm routes.
|
|
21
|
+
*/
|
|
22
|
+
export type BackendFramework = 'hono' | 'better-auth' | 'express' | 'fastify';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Frontend framework types.
|
|
26
|
+
*/
|
|
27
|
+
export type FrontendFramework = 'nextjs' | 'remix' | 'vite';
|
|
28
|
+
|
|
19
29
|
/**
|
|
20
30
|
* Service image configuration for custom Docker images.
|
|
21
31
|
*/
|
|
@@ -51,6 +61,20 @@ export interface ServicesConfig {
|
|
|
51
61
|
mail?: boolean | MailServiceConfig;
|
|
52
62
|
}
|
|
53
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Stage-based domain configuration.
|
|
66
|
+
* Maps deployment stages to base domains.
|
|
67
|
+
* @example { development: 'dev.myapp.com', production: 'myapp.com' }
|
|
68
|
+
*/
|
|
69
|
+
export type DokployDomainsConfig = Record<string, string>;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Per-app domain override configuration.
|
|
73
|
+
* Can be a single domain string or stage-specific domains.
|
|
74
|
+
* @example 'api.custom.com' or { production: 'api.custom.com', staging: 'api.staging.com' }
|
|
75
|
+
*/
|
|
76
|
+
export type AppDomainConfig = string | Record<string, string>;
|
|
77
|
+
|
|
54
78
|
/**
|
|
55
79
|
* Dokploy workspace deployment configuration.
|
|
56
80
|
*/
|
|
@@ -63,6 +87,13 @@ export interface DokployWorkspaceConfig {
|
|
|
63
87
|
registry?: string;
|
|
64
88
|
/** Registry ID in Dokploy */
|
|
65
89
|
registryId?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Stage-based domain configuration.
|
|
92
|
+
* The main frontend app gets the base domain.
|
|
93
|
+
* Other apps get {appName}.{baseDomain} by default.
|
|
94
|
+
* @example { development: 'dev.myapp.com', production: 'myapp.com' }
|
|
95
|
+
*/
|
|
96
|
+
domains?: DokployDomainsConfig;
|
|
66
97
|
}
|
|
67
98
|
|
|
68
99
|
/**
|
|
@@ -163,11 +194,34 @@ interface AppConfigBase {
|
|
|
163
194
|
/** Environment file(s) to load */
|
|
164
195
|
env?: string | string[];
|
|
165
196
|
|
|
197
|
+
// Entry point for non-gkm apps
|
|
198
|
+
/**
|
|
199
|
+
* Entry file path for apps that don't use gkm routes.
|
|
200
|
+
* Used by both `gkm dev` (runs with tsx) and Docker builds (bundles with tsdown).
|
|
201
|
+
* @example './src/index.ts'
|
|
202
|
+
*/
|
|
203
|
+
entry?: string;
|
|
204
|
+
|
|
166
205
|
// Frontend-specific
|
|
167
|
-
/**
|
|
168
|
-
framework?:
|
|
206
|
+
/** Framework for the app (frontend or backend without gkm routes) */
|
|
207
|
+
framework?: BackendFramework | FrontendFramework;
|
|
169
208
|
/** Client generation configuration */
|
|
170
209
|
client?: ClientConfig;
|
|
210
|
+
|
|
211
|
+
// Deployment
|
|
212
|
+
/**
|
|
213
|
+
* Override domain for this app (per-stage or single value).
|
|
214
|
+
* @example 'api.custom.com' or { production: 'api.custom.com', staging: 'api.staging.com' }
|
|
215
|
+
*/
|
|
216
|
+
domain?: AppDomainConfig;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Required environment variables for entry-based apps.
|
|
220
|
+
* Use this instead of envParser for apps that don't use gkm routes.
|
|
221
|
+
* The deploy command uses this to filter which secrets to embed.
|
|
222
|
+
* @example ['DATABASE_URL', 'BETTER_AUTH_SECRET']
|
|
223
|
+
*/
|
|
224
|
+
requiredEnv?: string[];
|
|
171
225
|
}
|
|
172
226
|
|
|
173
227
|
/**
|
|
@@ -294,6 +348,14 @@ export interface NormalizedAppConfig extends Omit<AppConfigBase, 'type'> {
|
|
|
294
348
|
dependencies: string[];
|
|
295
349
|
/** Resolved deploy target (app.deploy > deploy.default > 'dokploy') */
|
|
296
350
|
resolvedDeployTarget: DeployTarget;
|
|
351
|
+
/** Entry file path for non-gkm apps */
|
|
352
|
+
entry?: string;
|
|
353
|
+
/** Framework for the app */
|
|
354
|
+
framework?: BackendFramework | FrontendFramework;
|
|
355
|
+
/** Override domain for this app */
|
|
356
|
+
domain?: AppDomainConfig;
|
|
357
|
+
/** Required environment variables for entry-based apps */
|
|
358
|
+
requiredEnv?: string[];
|
|
297
359
|
}
|
|
298
360
|
|
|
299
361
|
/**
|