create-strata 2.2.58 → 2.2.60
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 +14 -7
- package/dist/templates/package.json +3 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4074,6 +4074,10 @@ Until \`frontend/dist\` exists, \`${layers.spaPrefix}\` answers 503. Use \`bun r
|
|
|
4074
4074
|
The app uses the database named in \`DATABASE_URL\` and creates it on first migrate when the connection user may. Set \`APP_DATABASE_URL\` only when migrations and the app should target a different database than \`DATABASE_URL\`.${usesComposePostgres(layers) ? ` \`.env.example\` points \`DATABASE_URL\` at \`${GENERATED_POSTGRES_APP_ROLE}\` (\`NOSUPERUSER\` \`NOBYPASSRLS\`), including \`--no-docker\`. \`db/ensure-postgres-app-role.sql\` is repeatable on an existing volume; Compose init still runs on first empty volume. The \`postgres\` superuser is for CREATE ROLE / GRANT / migrate and Adminer.` : ""}
|
|
4075
4075
|
`}
|
|
4076
4076
|
${renderOpenApiReadme()}
|
|
4077
|
+
## Migration status
|
|
4078
|
+
|
|
4079
|
+
Run \`bun run src/db/status.ts\` to inspect existing migration history. Status does not initialize missing history or repair runtime grants; missing history/read access fails with the database error. Initialize a new database with the explicit migrate command first. Migrate, fresh and rollback remain administrative mutations.${layers.database === "postgres" ? " Status needs only CONNECT, schema USAGE and SELECT on framework_migrations through its configured migration connection; it does not need schema CREATE or grant authority. The generated status call opts out of the migration helper's privilege repair, while mutation callers retain that repair." : ""} Package upgrades do not rewrite these generated application files.
|
|
4080
|
+
|
|
4077
4081
|
## Deploy
|
|
4078
4082
|
|
|
4079
4083
|
Bun >=1.4.4 is required. \`.bun-version\` and Docker stages pin the tested 1.4.4 runtime; upgrade pins deliberately and rerun checks before deployment. Runtime and TypeScript requirements use >=1.4.4, accepting future 1.4.x patches; the bun-types override keeps transitive shims above the same minimum. Refresh and commit root/frontend lockfiles when upgrading. Updating framework packages does not rewrite an existing app Dockerfile, runtime pin or manifest.
|
|
@@ -4484,9 +4488,9 @@ function renderPackageJson(projectName, options = {}) {
|
|
|
4484
4488
|
"@getstrata/cli": "workspace:*",
|
|
4485
4489
|
"@getstrata/core": "workspace:*"
|
|
4486
4490
|
} : {
|
|
4487
|
-
"@getstrata/bootstrap": "^2.2.
|
|
4488
|
-
"@getstrata/cli": "^2.2.
|
|
4489
|
-
"@getstrata/core": "^2.2.
|
|
4491
|
+
"@getstrata/bootstrap": "^2.2.60",
|
|
4492
|
+
"@getstrata/cli": "^2.2.60",
|
|
4493
|
+
"@getstrata/core": "^2.2.60"
|
|
4490
4494
|
};
|
|
4491
4495
|
coreDeps.eta = "^4.6.0";
|
|
4492
4496
|
if (options.layers?.database === "mysql") {
|
|
@@ -4809,6 +4813,7 @@ export async function loadStarterMigrations() {
|
|
|
4809
4813
|
|
|
4810
4814
|
export async function withMigrationDatabase<T>(
|
|
4811
4815
|
fn: (db: MigrationDatabase) => Promise<T>,
|
|
4816
|
+
options: { grantRuntimePrivileges?: boolean } = {},
|
|
4812
4817
|
): Promise<T> {
|
|
4813
4818
|
const runtimeUrl = process.env.DATABASE_URL ?? "";
|
|
4814
4819
|
const admin = await openPostgresAdminConnection({
|
|
@@ -4817,9 +4822,11 @@ export async function withMigrationDatabase<T>(
|
|
|
4817
4822
|
});
|
|
4818
4823
|
try {
|
|
4819
4824
|
const result = await fn(admin);
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4825
|
+
if (options.grantRuntimePrivileges !== false) {
|
|
4826
|
+
await grantPostgresAppRolePrivileges(admin, {
|
|
4827
|
+
database: postgresDatabaseNameFromUrl(runtimeUrl),
|
|
4828
|
+
});
|
|
4829
|
+
}
|
|
4823
4830
|
return result;
|
|
4824
4831
|
} finally {
|
|
4825
4832
|
await admin.close?.();
|
|
@@ -5022,7 +5029,7 @@ import { loadStarterMigrations, withMigrationDatabase } from "./migrationRuntime
|
|
|
5022
5029
|
export async function status() {
|
|
5023
5030
|
${ensureCall(layers, false)} const rows = await withMigrationDatabase(async (db) => {
|
|
5024
5031
|
return getMigrationStatus(db, await loadStarterMigrations());
|
|
5025
|
-
});
|
|
5032
|
+
}${layers.database === "postgres" ? ", { grantRuntimePrivileges: false }" : ""});
|
|
5026
5033
|
console.log("Migrations:");
|
|
5027
5034
|
for (const row of rows) {
|
|
5028
5035
|
const batch = row.batch == null ? "" : \` (batch \${row.batch})\`;
|
|
@@ -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.60",
|
|
16
|
+
"@getstrata/cli": "^2.2.60",
|
|
17
|
+
"@getstrata/core": "^2.2.60",
|
|
18
18
|
"eta": "^4.6.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|