@the-meridian/cli 1.0.0 → 1.0.2
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/CHANGELOG.md +12 -0
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @the-meridian/cli
|
|
2
2
|
|
|
3
|
+
## 1.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5eb0d4f: Clarify punctuation in developer-facing messages.
|
|
8
|
+
|
|
9
|
+
## 1.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 628f7b4: Correct the `dev_database_limit_reached` hint. Development databases are now counted per collaborator, so the only way to hit that refusal is a plan with no development-database allowance at all. The hint no longer tells you to ask whoever owns the existing database to delete it, and points at the organization's plan instead.
|
|
14
|
+
|
|
3
15
|
## 1.0.0
|
|
4
16
|
|
|
5
17
|
### Major Changes
|
package/dist/index.js
CHANGED
|
@@ -452,8 +452,8 @@ function extractErrorCode(body) {
|
|
|
452
452
|
return record !== void 0 && typeof record.error === "string" ? record.error : void 0;
|
|
453
453
|
}
|
|
454
454
|
var HINTS_BY_ERROR_CODE = {
|
|
455
|
-
dev_database_limit_reached: "
|
|
456
|
-
dev_database_over_storage_limit: "Run `meridian db reset` to drop and recreate the schema
|
|
455
|
+
dev_database_limit_reached: "Your plan does not include a development database for you on this app. Every collaborator gets their own out of the plan's allowance, so upgrading the organization's plan in the Meridian dashboard is what unlocks it.",
|
|
456
|
+
dev_database_over_storage_limit: "Run `meridian db reset` to drop and recreate the schema. Reset and delete stay available while you're over the limit.",
|
|
457
457
|
FEATURE_NOT_ENTITLED: "Your organization's plan does not include managed development databases; upgrade it in the Meridian dashboard."
|
|
458
458
|
};
|
|
459
459
|
function hintForError(status, errorCode) {
|
|
@@ -465,7 +465,7 @@ function hintForError(status, errorCode) {
|
|
|
465
465
|
if (status === 403) return "You may not have access to this organization or app; check your Meridian membership.";
|
|
466
466
|
if (status === 404) return "Run `meridian link` to select a valid organization and app.";
|
|
467
467
|
if (status === 409) {
|
|
468
|
-
return "The development database is not ready yet. Wait for provisioning to finish, then try again
|
|
468
|
+
return "The development database is not ready yet. Wait for provisioning to finish, then try again. `meridian dev` polls for you.";
|
|
469
469
|
}
|
|
470
470
|
if (status === 422) return "Check the request for validation errors and try again.";
|
|
471
471
|
if (status === 429) return "You're being rate limited by the Meridian API; wait a moment and try again.";
|
|
@@ -720,7 +720,7 @@ function toDatabaseError(error2, info) {
|
|
|
720
720
|
if (code === "ER_ACCESS_DENIED_ERROR") {
|
|
721
721
|
return build(
|
|
722
722
|
`Access denied connecting to ${target} as "${info.user}".`,
|
|
723
|
-
"Database credentials are short-lived and rotate automatically
|
|
723
|
+
"Database credentials are short-lived and rotate automatically. Run `meridian dev` again to fetch fresh ones."
|
|
724
724
|
);
|
|
725
725
|
}
|
|
726
726
|
if (code === "ER_BAD_DB_ERROR") {
|
|
@@ -1508,7 +1508,7 @@ import {
|
|
|
1508
1508
|
} from "fs";
|
|
1509
1509
|
import { dirname as dirname3 } from "path";
|
|
1510
1510
|
var CREATED_ENV_MODE = 384;
|
|
1511
|
-
var MANAGED_HEADER = "# Managed by the Meridian CLI
|
|
1511
|
+
var MANAGED_HEADER = "# Managed by the Meridian CLI. DATABASE_URL is rewritten by `meridian dev`.";
|
|
1512
1512
|
var LINE_RE = /^([ \t]*)(export[ \t]+)?([A-Za-z_][A-Za-z0-9_]*)([ \t]*=[ \t]*)(.*)$/;
|
|
1513
1513
|
function splitLines(content) {
|
|
1514
1514
|
const lines = [];
|
|
@@ -1883,7 +1883,7 @@ function assertShadowDatasource(root) {
|
|
|
1883
1883
|
if (shadow !== null && shadow.kind === "env" && shadow.name === REQUIRED_SHADOW_URL_ENV) return;
|
|
1884
1884
|
const problem = shadow === null ? "declares no `shadowDatabaseUrl`" : shadow.kind === "literal" ? `hardcodes \`shadowDatabaseUrl = "${shadow.value}"\`` : `reads \`env("${shadow.name}")\` for its shadow database, but Meridian sets \`${REQUIRED_SHADOW_URL_ENV}\``;
|
|
1885
1885
|
throw new CliError(`\`${datasource.schemaPath}\` ${problem}.`, {
|
|
1886
|
-
hint: `\`prisma migrate dev\` diffs your migrations in a throwaway shadow database, and your dev user cannot create one
|
|
1886
|
+
hint: `\`prisma migrate dev\` diffs your migrations in a throwaway shadow database, and your dev user cannot create one, so Meridian provisions it for you and exports \`${REQUIRED_SHADOW_URL_ENV}\`. Add \`shadowDatabaseUrl = env("${REQUIRED_SHADOW_URL_ENV}")\` to the \`${datasource.name}\` datasource. ${BYPASS_HINT}`
|
|
1887
1887
|
});
|
|
1888
1888
|
}
|
|
1889
1889
|
var FOREIGN_DIALECT_DDL = /\b(?:CREATE\s+(?:UNIQUE\s+)?(?:TABLE|INDEX)|ALTER\s+TABLE|REFERENCES)\s+"/i;
|
|
@@ -1912,7 +1912,7 @@ function findForeignDialectMigration(root) {
|
|
|
1912
1912
|
return offender === void 0 ? null : relative(root, offender);
|
|
1913
1913
|
}
|
|
1914
1914
|
function foreignDialectExplanation(offender) {
|
|
1915
|
-
return `\`${offender}\` was generated for SQLite or Postgres
|
|
1915
|
+
return `\`${offender}\` was generated for SQLite or Postgres. It quotes identifiers with double quotes, which MySQL reads as string literals. Migration SQL is dialect-specific and cannot be replayed against MySQL. If this history has only ever run locally, delete \`prisma/migrations\` and re-run to regenerate it for MySQL; run \`meridian db reset\` first if an earlier attempt already failed, since Prisma records that failure in \`_prisma_migrations\` and will not continue while it is there.`;
|
|
1916
1916
|
}
|
|
1917
1917
|
function assertMigrationDialect(root) {
|
|
1918
1918
|
const offender = findForeignDialectMigration(root);
|
|
@@ -3910,7 +3910,7 @@ async function runMigration(session, deps, ctx) {
|
|
|
3910
3910
|
"Snapshotting the development database...",
|
|
3911
3911
|
() => deps.createSnapshot(session.connection, { dir, now: deps.now }),
|
|
3912
3912
|
{
|
|
3913
|
-
success: (result) => result.path === null ? "Development database is empty
|
|
3913
|
+
success: (result) => result.path === null ? "Development database is empty. Nothing to snapshot." : `Snapshot saved to ${style.path(result.path)} (${formatSize(result.bytes)}).`
|
|
3914
3914
|
}
|
|
3915
3915
|
);
|
|
3916
3916
|
}
|
|
@@ -3961,9 +3961,9 @@ async function runMigration(session, deps, ctx) {
|
|
|
3961
3961
|
status = "rolled_back";
|
|
3962
3962
|
rolledBack = true;
|
|
3963
3963
|
} catch {
|
|
3964
|
-
error("Automatic rollback failed. The development database may be in a partial state
|
|
3964
|
+
error("Automatic rollback failed. The development database may be in a partial state. Treat it as unsafe.");
|
|
3965
3965
|
if (snapshotPath === null) {
|
|
3966
|
-
hint("Recover by hand with `meridian db reset
|
|
3966
|
+
hint("Recover by hand with `meridian db reset`. The database was empty before this migration.");
|
|
3967
3967
|
} else {
|
|
3968
3968
|
detail(`Pre-migration snapshot: ${snapshotPath}`);
|
|
3969
3969
|
hint(
|