create-strata 2.2.44 → 2.2.45
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/cli.js +17 -15
- package/dist/templates/package.json +3 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -171,6 +171,9 @@ function selectedDockerServices(layers) {
|
|
|
171
171
|
}
|
|
172
172
|
return selected;
|
|
173
173
|
}
|
|
174
|
+
function dockerComposeUpCommand(layers) {
|
|
175
|
+
return selectedDockerServices(layers).includes("adminer") ? "docker compose --profile debug up -d" : "docker compose up -d";
|
|
176
|
+
}
|
|
174
177
|
function reconcileDocker(layers) {
|
|
175
178
|
const selected = selectedDockerServices(layers);
|
|
176
179
|
return {
|
|
@@ -1110,12 +1113,11 @@ async function promptDockerLayer(prompter, layers) {
|
|
|
1110
1113
|
if (mode === "local") {
|
|
1111
1114
|
return dockerLayerForNeeded(layers, false);
|
|
1112
1115
|
}
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
services[name] = await prompter.confirm(`Docker Compose for ${DOCKER_SERVICE_LABELS[name]}?`, true);
|
|
1116
|
+
const services = mode === "docker" ? dockerLayerForNeeded(layers, true).services : emptyDockerServices();
|
|
1117
|
+
if (mode === "mix") {
|
|
1118
|
+
for (const name of needed) {
|
|
1119
|
+
services[name] = await prompter.confirm(`Docker Compose for ${DOCKER_SERVICE_LABELS[name]}?`, true);
|
|
1120
|
+
}
|
|
1119
1121
|
}
|
|
1120
1122
|
const databaseService = dockerDatabaseService(layers.database);
|
|
1121
1123
|
if (databaseService && services[databaseService]) {
|
|
@@ -3226,9 +3228,9 @@ function renderPackageJson(projectName, options = {}) {
|
|
|
3226
3228
|
"@getstrata/cli": "workspace:*",
|
|
3227
3229
|
"@getstrata/core": "workspace:*"
|
|
3228
3230
|
} : {
|
|
3229
|
-
"@getstrata/bootstrap": "^2.2.
|
|
3230
|
-
"@getstrata/cli": "^2.2.
|
|
3231
|
-
"@getstrata/core": "^2.2.
|
|
3231
|
+
"@getstrata/bootstrap": "^2.2.45",
|
|
3232
|
+
"@getstrata/cli": "^2.2.45",
|
|
3233
|
+
"@getstrata/core": "^2.2.45"
|
|
3232
3234
|
};
|
|
3233
3235
|
coreDeps.eta = "^4.6.0";
|
|
3234
3236
|
if (options.layers?.database === "mysql") {
|
|
@@ -3298,7 +3300,7 @@ function localEnvVars(services) {
|
|
|
3298
3300
|
}
|
|
3299
3301
|
return [...new Set(vars)];
|
|
3300
3302
|
}
|
|
3301
|
-
function renderSupportingToolsReadme(layers) {
|
|
3303
|
+
function renderSupportingToolsReadme(projectName, layers) {
|
|
3302
3304
|
const needed = neededDockerServices(layers);
|
|
3303
3305
|
if (needed.length === 0) {
|
|
3304
3306
|
return "";
|
|
@@ -3309,14 +3311,14 @@ function renderSupportingToolsReadme(layers) {
|
|
|
3309
3311
|
const lines = ["## Supporting tools", ""];
|
|
3310
3312
|
if (dockerOn.length > 0) {
|
|
3311
3313
|
const names = dockerOn.map((name) => DOCKER_SERVICE_LABELS[name]).join(", ");
|
|
3312
|
-
lines.push(`Docker Compose includes ${names}.`, "", "```bash",
|
|
3314
|
+
lines.push(`Docker Compose includes ${names}.`, "", "```bash", dockerComposeUpCommand(layers), "```", "");
|
|
3313
3315
|
if (dockerSet.has("adminer")) {
|
|
3314
3316
|
const mysql = layers.database === "mysql";
|
|
3315
3317
|
const system = mysql ? "MySQL" : "PostgreSQL";
|
|
3316
3318
|
const server = mysql ? "mysql" : "postgres";
|
|
3317
3319
|
const username = mysql ? "root" : "postgres";
|
|
3318
3320
|
const password = mysql ? GENERATED_MYSQL_ROOT_PASSWORD : GENERATED_POSTGRES_SUPERUSER_PASSWORD;
|
|
3319
|
-
lines.push(`Adminer: http://localhost:8080 (${system}, server \`${server}\`, username \`${username}\`, password \`${password}\`).`, "");
|
|
3321
|
+
lines.push(`Adminer: http://localhost:8080 (${system}, server \`${server}\`, username \`${username}\`, password \`${password}\`, database \`${appDatabaseName(projectName)}\`).`, "", "Adminer is optional development tooling in the `debug` profile; plain `docker compose up -d` does not start Adminer. Use the profile command above to start it with the database.", "");
|
|
3320
3322
|
if (!mysql) {
|
|
3321
3323
|
lines.push("Adminer uses the Compose `postgres` superuser, which skips FORCE RLS. Application traffic should use `strata_app`.", "");
|
|
3322
3324
|
}
|
|
@@ -3484,7 +3486,7 @@ function renderReadme(projectName, layers, options = {}) {
|
|
|
3484
3486
|
const docker = renderDockerCompose(projectName, layers);
|
|
3485
3487
|
const next = [`cd ${projectName}`, "cp .env.example .env"];
|
|
3486
3488
|
if (docker) {
|
|
3487
|
-
next.push(
|
|
3489
|
+
next.push(dockerComposeUpCommand(layers));
|
|
3488
3490
|
}
|
|
3489
3491
|
next.push("bun install");
|
|
3490
3492
|
if (needsFrontendBuild(layers.frontend)) {
|
|
@@ -3527,7 +3529,7 @@ ${layers.queue === "redis" ? "Redis jobs need `bun run queue:work` in another te
|
|
|
3527
3529
|
|
|
3528
3530
|
`}For durable events, add listeners in \`src/outbox/registry.ts\`, apply \`bun run db:migrate\`, then run \`bun run outbox:work\` in another terminal. Apps that do not publish durable events do not need this worker. Durable cache invalidation also needs the outbox worker when explicitly configured. Use the same application environment, database, Redis URL and \`APP_KEY_PREFIX\` for HTTP and its workers. An idle worker is normal; startup output confirms entry into polling, not dependency health. Stop HTTP and workers before resetting the development database.
|
|
3529
3531
|
|
|
3530
|
-
${renderSupportingToolsReadme(layers)}${layers.auth !== "headers" ? `
|
|
3532
|
+
${renderSupportingToolsReadme(projectName, layers)}${layers.auth !== "headers" ? `
|
|
3531
3533
|
For the first production admin, apply migrations and run \`bunx strata auth:provision-admin --email operator@example.test --name "Initial Operator" --password-stdin${layers.tenancy !== "none" ? " --tenant 1" : ""} < /run/secrets/initial_admin_password\` before admitting traffic. Supply your own private secret-manager-mounted file, not a demo password. Passwords require at least 16 characters and at most 72 UTF-8 bytes. Tenant-enabled applications require an existing tenant ID; this command does not create tenants. It refuses existing admins/accounts, records a transactional one-time claim, and does not mark email verified or enroll MFA. Additional admins and recovery remain explicit application administration. The command does not migrate or seed automatically.
|
|
3532
3534
|
|
|
3533
3535
|
Optional development demo accounts: run \`bun run db:seed:demo\` explicitly after migrations. This command refuses production and staging. It creates these accounts with password \`StrataDemo!ChangeMe\`:
|
|
@@ -6017,7 +6019,7 @@ Next steps:`);
|
|
|
6017
6019
|
console.log(` cd ${cdTarget}`);
|
|
6018
6020
|
console.log(" cp .env.example .env");
|
|
6019
6021
|
if (compose) {
|
|
6020
|
-
console.log(
|
|
6022
|
+
console.log(` ${dockerComposeUpCommand(layers)}`);
|
|
6021
6023
|
}
|
|
6022
6024
|
if (dockerOn.includes("adminer")) {
|
|
6023
6025
|
console.log(" Adminer: http://localhost:8080");
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"check": "tsc --noEmit"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@getstrata/bootstrap": "^2.2.
|
|
16
|
-
"@getstrata/cli": "^2.2.
|
|
17
|
-
"@getstrata/core": "^2.2.
|
|
15
|
+
"@getstrata/bootstrap": "^2.2.45",
|
|
16
|
+
"@getstrata/cli": "^2.2.45",
|
|
17
|
+
"@getstrata/core": "^2.2.45",
|
|
18
18
|
"eta": "^4.6.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|