@geekmidas/cli 10.0.0-alpha.30 → 10.0.0-alpha.31

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.mjs CHANGED
@@ -37,7 +37,7 @@ import { Subscriber } from "@geekmidas/constructs/subscribers";
37
37
  import { Topic } from "@geekmidas/constructs/topic";
38
38
  import { lookup } from "node:dns/promises";
39
39
  //#region package.json
40
- var version = "10.0.0-alpha.30";
40
+ var version = "10.0.0-alpha.31";
41
41
  //#endregion
42
42
  //#region src/auth/credentials.ts
43
43
  /**
@@ -8459,7 +8459,34 @@ gkm migrate database # apply one construct's
8459
8459
  - A deploy migrates before the new version goes live, so the old version runs
8460
8460
  against the new schema until it is replaced. Keep each migration compatible
8461
8461
  with the code before it: add a column in one release, stop using the old one,
8462
- drop it in a later release.`;
8462
+ drop it in a later release.
8463
+
8464
+ **Migrations hold schema, never data.** Tables, columns, constraints, indexes.
8465
+ No inserts, updates or deletes against the application's rows.
8466
+
8467
+ - **Data the code defines lives in the code.** A permission catalogue, the
8468
+ system roles, a list of statuses — if a constant in the source already says
8469
+ what they are, a table holding them is a copy, and a copy drifts. Keep the
8470
+ constant; store only what users create (a custom role, which permission keys
8471
+ it grants), checked against the constant in code.
8472
+ - **Define it once, typed, where every app can import it.** A catalogue in
8473
+ code belongs in a shared package (\`packages/models\`), declared \`as const\`
8474
+ so its keys are a union type. The API's guards, the web app's gates and a
8475
+ mobile app's gates then all name the same keys, and a typo — or a removed
8476
+ permission still checked somewhere — fails to compile instead of failing
8477
+ closed at runtime.
8478
+ - **A rule is not a row.** "Every user is a member", "a super admin has every
8479
+ permission" are logic. A row per user, or a grant per permission, is a
8480
+ snapshot of the rule that goes stale the moment the rule's inputs change.
8481
+ - **Nothing needs seeding to run.** If the app fails without some rows present,
8482
+ those rows are code in the wrong place. Sample and demo data comes from test
8483
+ factories — never a migration, never a deploy.
8484
+ - **A backfill is the one exception.** When a schema change needs existing rows
8485
+ transformed — a new non-null column filled from an old one — do it in the
8486
+ same migration, keyed on the rows it transforms. It never inserts rows that
8487
+ were not there.
8488
+ - **A test that only keeps two copies in step is the smell.** Delete a copy,
8489
+ and the test with it.`;
8463
8490
  }
8464
8491
  function queriesSection() {
8465
8492
  return `## Writing queries and relations
@@ -8716,26 +8743,26 @@ function loadPackageJson() {
8716
8743
  * Run: pnpm --filter @geekmidas/cli sync-versions
8717
8744
  */
8718
8745
  const GEEKMIDAS_VERSIONS = {
8719
- "@geekmidas/audit": "~10.0.0-alpha.30",
8720
- "@geekmidas/auth": "~10.0.0-alpha.30",
8721
- "@geekmidas/cache": "~10.0.0-alpha.30",
8722
- "@geekmidas/client": "~10.0.0-alpha.30",
8723
- "@geekmidas/cloud": "~10.0.0-alpha.30",
8724
- "@geekmidas/constructs": "~10.0.0-alpha.30",
8725
- "@geekmidas/db": "~10.0.0-alpha.30",
8726
- "@geekmidas/emailkit": "~10.0.0-alpha.30",
8727
- "@geekmidas/envkit": "~10.0.0-alpha.30",
8728
- "@geekmidas/errors": "~10.0.0-alpha.30",
8729
- "@geekmidas/events": "~10.0.0-alpha.30",
8730
- "@geekmidas/logger": "~10.0.0-alpha.30",
8731
- "@geekmidas/manifest": "~10.0.0-alpha.30",
8732
- "@geekmidas/rate-limit": "~10.0.0-alpha.30",
8733
- "@geekmidas/schema": "~10.0.0-alpha.30",
8734
- "@geekmidas/services": "~10.0.0-alpha.30",
8735
- "@geekmidas/storage": "~10.0.0-alpha.30",
8736
- "@geekmidas/studio": "~10.0.0-alpha.30",
8737
- "@geekmidas/telescope": "~10.0.0-alpha.30",
8738
- "@geekmidas/testkit": "~10.0.0-alpha.30",
8746
+ "@geekmidas/audit": "~10.0.0-alpha.31",
8747
+ "@geekmidas/auth": "~10.0.0-alpha.31",
8748
+ "@geekmidas/cache": "~10.0.0-alpha.31",
8749
+ "@geekmidas/client": "~10.0.0-alpha.31",
8750
+ "@geekmidas/cloud": "~10.0.0-alpha.31",
8751
+ "@geekmidas/constructs": "~10.0.0-alpha.31",
8752
+ "@geekmidas/db": "~10.0.0-alpha.31",
8753
+ "@geekmidas/emailkit": "~10.0.0-alpha.31",
8754
+ "@geekmidas/envkit": "~10.0.0-alpha.31",
8755
+ "@geekmidas/errors": "~10.0.0-alpha.31",
8756
+ "@geekmidas/events": "~10.0.0-alpha.31",
8757
+ "@geekmidas/logger": "~10.0.0-alpha.31",
8758
+ "@geekmidas/manifest": "~10.0.0-alpha.31",
8759
+ "@geekmidas/rate-limit": "~10.0.0-alpha.31",
8760
+ "@geekmidas/schema": "~10.0.0-alpha.31",
8761
+ "@geekmidas/services": "~10.0.0-alpha.31",
8762
+ "@geekmidas/storage": "~10.0.0-alpha.31",
8763
+ "@geekmidas/studio": "~10.0.0-alpha.31",
8764
+ "@geekmidas/telescope": "~10.0.0-alpha.31",
8765
+ "@geekmidas/testkit": "~10.0.0-alpha.31",
8739
8766
  "@geekmidas/cli": `~${loadPackageJson().version}`
8740
8767
  };
8741
8768
  //#endregion