@django-stack/cli 0.5.0 → 0.7.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/bin.js +2161 -515
- package/dist/index.d.ts +54 -7
- package/dist/index.js +1 -1
- package/dist/{scaffold-DbgGYEsc.js → production-DBpWWx6i.js} +471 -103
- package/package.json +1 -1
- package/templates/backend/config/studio.py +9 -0
- package/templates/backend/content/admin.py +16 -2
- package/templates/backend/entrypoint.sh +5 -1
- package/templates/backend/pyproject.toml +2 -2
- package/templates/base/AGENTS.md +2 -1
- package/templates/base/Caddyfile +14 -1
- package/templates/base/README.md +18 -4
- package/templates/base/compose.yaml +57 -9
- package/templates/base/env.example +37 -4
- package/templates/frontend-astro/astro.config.mjs +13 -6
- package/templates/frontend-astro/package.json +1 -1
- package/templates/frontend-astro/src/layouts/Base.astro +3 -0
- package/templates/frontend-next/package.json +3 -3
- package/templates/frontend-next/src/app/layout.tsx +9 -0
- package/templates/frontend-next/src/proxy.ts +6 -0
- package/templates/frontend-nuxt/nuxt.config.ts +12 -6
- package/templates/frontend-nuxt/package.json +2 -2
- package/templates/frontend-nuxt/server/routes/_content/layout.get.ts +6 -1
- package/templates/frontend-nuxt/src/layouts/default.vue +3 -0
- package/templates/frontend-sveltekit/package.json +2 -2
- package/templates/frontend-sveltekit/src/routes/+layout.server.ts +2 -0
- package/templates/frontend-sveltekit/src/routes/+layout.svelte +3 -0
- package/templates/frontend-sveltekit/vite.config.ts +11 -3
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ interface ProductionOptions {
|
|
|
18
18
|
domain: string;
|
|
19
19
|
/** The SMTP server for outgoing mail. */
|
|
20
20
|
emailUrl?: string;
|
|
21
|
+
/** Where uploads go: `s3` asks for the S3 settings (the `media` stack option). */
|
|
22
|
+
media?: string;
|
|
21
23
|
}
|
|
22
24
|
interface ProductionEnv {
|
|
23
25
|
text: string;
|
|
@@ -37,6 +39,7 @@ export declare const STACK_OPTIONS: readonly [{
|
|
|
37
39
|
readonly flag: "--frontend";
|
|
38
40
|
readonly message: "Frontend";
|
|
39
41
|
readonly description: "The frontend framework";
|
|
42
|
+
readonly bits: 4;
|
|
40
43
|
readonly values: readonly [{
|
|
41
44
|
readonly value: "astro";
|
|
42
45
|
readonly label: "Astro";
|
|
@@ -73,6 +76,7 @@ export declare const STACK_OPTIONS: readonly [{
|
|
|
73
76
|
readonly flag: "--postgres";
|
|
74
77
|
readonly message: "Postgres version";
|
|
75
78
|
readonly description: "The bundled Postgres version";
|
|
79
|
+
readonly bits: 2;
|
|
76
80
|
readonly values: readonly [{
|
|
77
81
|
readonly value: "stable";
|
|
78
82
|
readonly label: "Stable";
|
|
@@ -89,11 +93,12 @@ export declare const STACK_OPTIONS: readonly [{
|
|
|
89
93
|
readonly flag: "--analytics";
|
|
90
94
|
readonly message: "Analytics";
|
|
91
95
|
readonly description: "Page analytics";
|
|
96
|
+
readonly bits: 2;
|
|
92
97
|
readonly values: readonly [{
|
|
93
98
|
readonly value: "umami";
|
|
94
99
|
readonly label: "Umami";
|
|
95
100
|
readonly hint: "built in, private, no cookies";
|
|
96
|
-
readonly generated:
|
|
101
|
+
readonly generated: true;
|
|
97
102
|
}, {
|
|
98
103
|
readonly value: "off";
|
|
99
104
|
readonly label: "Off";
|
|
@@ -104,41 +109,51 @@ export declare const STACK_OPTIONS: readonly [{
|
|
|
104
109
|
readonly flag: "--tasks";
|
|
105
110
|
readonly message: "Background tasks";
|
|
106
111
|
readonly description: "The task queue";
|
|
112
|
+
readonly bits: 2;
|
|
107
113
|
readonly values: readonly [{
|
|
108
114
|
readonly value: "huey";
|
|
109
115
|
readonly label: "Huey";
|
|
110
|
-
readonly hint: "a worker container
|
|
116
|
+
readonly hint: "a worker container, the queue where the cache is";
|
|
111
117
|
readonly generated: true;
|
|
112
118
|
}, {
|
|
113
119
|
readonly value: "off";
|
|
114
120
|
readonly label: "Off";
|
|
115
|
-
readonly
|
|
121
|
+
readonly hint: "tasks run in the request, no daily backups";
|
|
122
|
+
readonly generated: true;
|
|
123
|
+
}, {
|
|
124
|
+
readonly value: "huey-valkey";
|
|
125
|
+
readonly label: "Huey on Valkey";
|
|
126
|
+
readonly hint: "the queue in Valkey";
|
|
127
|
+
readonly generated: true;
|
|
116
128
|
}];
|
|
117
129
|
}, {
|
|
118
130
|
readonly key: "cache";
|
|
119
131
|
readonly flag: "--cache";
|
|
120
132
|
readonly message: "Cache";
|
|
121
133
|
readonly description: "The cache backend";
|
|
134
|
+
readonly bits: 3;
|
|
122
135
|
readonly values: readonly [{
|
|
123
136
|
readonly value: "database";
|
|
124
137
|
readonly label: "Database";
|
|
125
138
|
readonly hint: "a Postgres table, nothing extra to run";
|
|
126
|
-
readonly generated:
|
|
139
|
+
readonly generated: true;
|
|
127
140
|
}, {
|
|
128
141
|
readonly value: "valkey";
|
|
129
142
|
readonly label: "Valkey";
|
|
130
143
|
readonly hint: "in memory, Redis-compatible";
|
|
131
|
-
readonly generated:
|
|
144
|
+
readonly generated: true;
|
|
132
145
|
}, {
|
|
133
146
|
readonly value: "off";
|
|
134
147
|
readonly label: "Off";
|
|
135
|
-
readonly
|
|
148
|
+
readonly hint: "a cache per process";
|
|
149
|
+
readonly generated: true;
|
|
136
150
|
}];
|
|
137
151
|
}, {
|
|
138
152
|
readonly key: "notifications";
|
|
139
153
|
readonly flag: "--notifications";
|
|
140
154
|
readonly message: "Notifications";
|
|
141
155
|
readonly description: "Notifications in the admin and by email";
|
|
156
|
+
readonly bits: 2;
|
|
142
157
|
readonly values: readonly [{
|
|
143
158
|
readonly value: "on";
|
|
144
159
|
readonly label: "On";
|
|
@@ -154,6 +169,7 @@ export declare const STACK_OPTIONS: readonly [{
|
|
|
154
169
|
readonly flag: "--captcha";
|
|
155
170
|
readonly message: "Captcha";
|
|
156
171
|
readonly description: "The built-in captcha for forms";
|
|
172
|
+
readonly bits: 2;
|
|
157
173
|
readonly values: readonly [{
|
|
158
174
|
readonly value: "on";
|
|
159
175
|
readonly label: "On";
|
|
@@ -169,6 +185,7 @@ export declare const STACK_OPTIONS: readonly [{
|
|
|
169
185
|
readonly flag: "--storage";
|
|
170
186
|
readonly message: "Uploads in development";
|
|
171
187
|
readonly description: "Where uploads go in development";
|
|
188
|
+
readonly bits: 2;
|
|
172
189
|
readonly values: readonly [{
|
|
173
190
|
readonly value: "local";
|
|
174
191
|
readonly label: "Local files";
|
|
@@ -185,6 +202,7 @@ export declare const STACK_OPTIONS: readonly [{
|
|
|
185
202
|
readonly flag: "--package-manager";
|
|
186
203
|
readonly message: "Package manager";
|
|
187
204
|
readonly description: "The frontend's package manager";
|
|
205
|
+
readonly bits: 3;
|
|
188
206
|
readonly values: readonly [{
|
|
189
207
|
readonly value: "pnpm";
|
|
190
208
|
readonly label: "pnpm";
|
|
@@ -198,12 +216,29 @@ export declare const STACK_OPTIONS: readonly [{
|
|
|
198
216
|
readonly label: "Bun";
|
|
199
217
|
readonly generated: false;
|
|
200
218
|
}];
|
|
219
|
+
}, {
|
|
220
|
+
readonly key: "media";
|
|
221
|
+
readonly flag: "--media";
|
|
222
|
+
readonly message: "Uploads in production";
|
|
223
|
+
readonly description: "Where uploads go in production";
|
|
224
|
+
readonly bits: 2;
|
|
225
|
+
readonly values: readonly [{
|
|
226
|
+
readonly value: "server";
|
|
227
|
+
readonly label: "On the server";
|
|
228
|
+
readonly hint: "a Docker volume, backed up with the database";
|
|
229
|
+
readonly generated: true;
|
|
230
|
+
}, {
|
|
231
|
+
readonly value: "s3";
|
|
232
|
+
readonly label: "S3";
|
|
233
|
+
readonly hint: "any S3-compatible service; credentials later";
|
|
234
|
+
readonly generated: true;
|
|
235
|
+
}];
|
|
201
236
|
}];
|
|
202
237
|
type Options = (typeof STACK_OPTIONS)[number];
|
|
203
238
|
type StackKey = Options["key"];
|
|
204
239
|
type Stack = { [O in Options as O["key"]]: O["values"][number]["value"]; };
|
|
205
240
|
export declare const DEFAULT_STACK: Stack;
|
|
206
|
-
/** A preset code for a stack:
|
|
241
|
+
/** A preset code for a stack: always six characters, such as `b8Kq2x`. */
|
|
207
242
|
export declare function encodePreset(stack: Stack): string;
|
|
208
243
|
/** The stack of a preset code. Throws with a one-line reason for a bad code. */
|
|
209
244
|
export declare function decodePreset(code: string): Stack;
|
|
@@ -235,10 +270,18 @@ interface ScaffoldOptions {
|
|
|
235
270
|
databaseUrl?: string;
|
|
236
271
|
/** Store uploads in the local S3 service in development, like S3 in production. */
|
|
237
272
|
localS3?: boolean;
|
|
273
|
+
/** Page analytics with the bundled Umami (the `analytics` profile). */
|
|
274
|
+
analytics?: boolean;
|
|
275
|
+
/** The cache backend; the database by default. */
|
|
276
|
+
cache?: Stack["cache"];
|
|
277
|
+
/** The task queue; Huey where the cache is by default. */
|
|
278
|
+
tasks?: Stack["tasks"];
|
|
238
279
|
/** A DjangoStack monorepo to take the packages from instead of the registries (for development). */
|
|
239
280
|
link?: string;
|
|
240
281
|
/** The time zone of the backend, such as Europe/Amsterdam. UTC by default. */
|
|
241
282
|
timeZone?: string;
|
|
283
|
+
/** The development ports by `.env` variable, such as SITE_PORT; the usual ones when not set. */
|
|
284
|
+
ports?: Record<string, number>;
|
|
242
285
|
/** The preset code of the stack, saved in package.json for `config`. */
|
|
243
286
|
preset?: string;
|
|
244
287
|
/** Where the templates are; the ones in the package by default. */
|
|
@@ -250,6 +293,10 @@ interface ScaffoldResult {
|
|
|
250
293
|
adminPassword: string;
|
|
251
294
|
files: number;
|
|
252
295
|
}
|
|
296
|
+
/** The `.env` values of a cache and a task queue: CACHE_URL, TASKS_URL and TASK_WORKERS. */
|
|
297
|
+
export declare function cacheEnv(stack: Pick<Stack, "cache" | "tasks">): Record<string, string>;
|
|
298
|
+
/** Whether `.env` values use the Valkey service (the `valkey` profile). */
|
|
299
|
+
export declare function usesValkey(env: Record<string, string | undefined>): boolean;
|
|
253
300
|
/** A valid project name from a directory name: `My Site` becomes `my-site`. */
|
|
254
301
|
export declare function toProjectName(value: string): string;
|
|
255
302
|
export declare function validateProjectName(value: string): string | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { y as DEFAULT_STACK, i as FRONTENDS, b as NAMED_PRESETS, S as STACK_OPTIONS, v as VERSION, o as cacheEnv, w as decodePreset, T as encodePreset, k as generateProjectSecrets, A as generateSecret, l as normalizeDatabaseUrl, V as parseEnv, E as pendingChoices, n as productionEnv, D as resolvePreset, I as runDoctor, d as scaffold, U as setEnvValues, p as toProjectName, h as usesValkey, r as validateDomain, g as validateProjectName } from "./production-DBpWWx6i.js";
|