@django-stack/cli 0.6.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/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,6 +93,7 @@ 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";
@@ -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 with Valkey";
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 generated: false;
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: false;
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: false;
144
+ readonly generated: true;
132
145
  }, {
133
146
  readonly value: "off";
134
147
  readonly label: "Off";
135
- readonly generated: false;
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: the version, then one character per option, trailing defaults left out. */
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;
@@ -237,10 +272,16 @@ interface ScaffoldOptions {
237
272
  localS3?: boolean;
238
273
  /** Page analytics with the bundled Umami (the `analytics` profile). */
239
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"];
240
279
  /** A DjangoStack monorepo to take the packages from instead of the registries (for development). */
241
280
  link?: string;
242
281
  /** The time zone of the backend, such as Europe/Amsterdam. UTC by default. */
243
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>;
244
285
  /** The preset code of the stack, saved in package.json for `config`. */
245
286
  preset?: string;
246
287
  /** Where the templates are; the ones in the package by default. */
@@ -252,6 +293,10 @@ interface ScaffoldResult {
252
293
  adminPassword: string;
253
294
  files: number;
254
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;
255
300
  /** A valid project name from a directory name: `My Site` becomes `my-site`. */
256
301
  export declare function toProjectName(value: string): string;
257
302
  export declare function validateProjectName(value: string): string | undefined;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { h as DEFAULT_STACK, r as FRONTENDS, g as NAMED_PRESETS, _ as STACK_OPTIONS, m as VERSION, y as decodePreset, b as encodePreset, w as generateProjectSecrets, T as generateSecret, o as normalizeDatabaseUrl, O as parseEnv, x as pendingChoices, t as productionEnv, S as resolvePreset, E as runDoctor, c as scaffold, k as setEnvValues, u as toProjectName, n as validateDomain, f as validateProjectName } from "./production-DIj9yRcg.js";
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";