ts-grm-migrate 0.1.0-alpha.4 → 0.1.0-alpha.5

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/README.md CHANGED
@@ -35,6 +35,14 @@ npm install -D ts-grm-migrate@next
35
35
  - `@next` follows prereleases. Pin an exact version when reproducibility matters, for example `ts-grm-migrate@0.1.0-alpha.0`.
36
36
  - Run the installed CLI with `npx tgm`, or use `tgm` / `ts-grm-migrate` through your package manager.
37
37
 
38
+ In a workspace with non-hoisted dependencies (for example a Bun installation), npm's workspace lookup may miss the child's local CLI or select a different version installed at the root. From the child project, use:
39
+
40
+ ```bash
41
+ npx --workspaces=false tgm dev --create-only -n init
42
+ ```
43
+
44
+ This keeps npm's lookup in the current project. If npm reports `No versions available for tgm`, it has failed to locate the local executable and is looking for a package named `tgm`; the package to install is `ts-grm-migrate`. Check that `node_modules/.bin/tgm` resolves to an existing `dist/bin.mjs`, and reinstall dependencies with the project's package manager if the link is broken. The CLI cannot repair npm's command resolution because it has not started yet. [npm exec workspace behavior](https://docs.npmjs.com/cli/npm-exec/).
45
+
38
46
  ## Quick start
39
47
 
40
48
  > **Your project must use ESM.** Set `"type": "module"` in `package.json`. The ts-grm model registry is a module-level singleton; the migration tool and your models must share the same ESM instance. CommonJS models may register with a separate instance and be invisible to the migration tool.
@@ -213,7 +221,7 @@ You can also run `tests/server-integration.test.ts` against dedicated instances
213
221
  | `tgm resolve --applied <id>` | Mark SQL already executed manually as applied |
214
222
  | `tgm resolve --rolled-back <id>` | Mark an attempt as rolled back so it becomes pending again |
215
223
 
216
- Options: `--create-only` generates without applying (`dev` only); `--config <path>` selects a configuration file; `-n` / `--name <name>` names a migration; `--force` skips destructive-change confirmation; `--detail` shows execution steps, SQL, and locks; `--lang <en|zh-CN>` selects the language for this command; `-h` shows help.
224
+ Options: `--dry-run` previews SQL without applying it (`push` only); `--create-only` generates without applying (`dev` only); `--config <path>` selects a configuration file; `-n` / `--name <name>` names a migration; `--force` skips destructive-change confirmation; `--detail` shows execution steps, SQL, and locks; `--lang <en|zh-CN>` selects the language for this command; `-h` shows help.
217
225
 
218
226
  Normal commands report the target, migration count or ID, and result. `status` intentionally lists migrations because it is an inspection command. For example, `tgm deploy` may print `Applied 2 migrations to postgres/app/public.` The SQL shown with `--detail` may contain business data: take care when saving or sharing logs. Diagnostic events do not print connection passwords.
219
227
 
@@ -245,7 +253,7 @@ export const SYS_USER = model("SysUser", "id", class {
245
253
  - **Independent indexes and comments are not managed by models:** custom migration indexes are preserved while their columns remain. Explicit programmatic schemas may manage indexes; removing a unique index is flagged as destructive.
246
254
  - **Migration files are readable SQL:** `<migrationsDir>/<timestamp>_<name>.sql` can be edited before application. **Do not edit an applied migration.** `deploy` rejects a changed checksum; make a new migration instead.
247
255
  - **Destructive changes require confirmation:** dropping tables or columns, changing column types, and explicit unique-index removal prompt during model synchronization; non-interactive synchronization requires `--force`. `deploy` applies reviewed SQL files without confirmation.
248
- - **Post-migration checks:** `dev`, `deploy`, and `push` reread the schema and warn about remaining differences while retaining a successful execution exit code. `check` returns 1 for differences, including CHECK constraints whose equivalence cannot be proven. For example:
256
+ - **Post-migration checks:** `dev` and `deploy` reread the schema and warn about remaining differences. `push` returns 1 if differences remain after synchronization; cancellation also returns 1. `check` returns 1 for differences, including CHECK constraints whose equivalence cannot be proven. For example:
249
257
 
250
258
  ```text
251
259
  Warning: postgres/app/public differs from the model:
@@ -13,3 +13,9 @@ The `TableDef`, `ColumnDef`, and constraint type declarations in `src/vendor/ts-
13
13
  - [Full Apache-2.0 license](LICENSES/Apache-2.0.txt)
14
14
 
15
15
  The published package keeps `@ts-grm/core` and `@ts-grm/sql` as external peer dependencies; it does not bundle upstream implementations. Database drivers are external dependencies with their own licenses.
16
+
17
+ ## proper-lockfile
18
+
19
+ Atomic renewable local leases use the external MIT-licensed `proper-lockfile` package. Its dependencies retain their own licenses in their distributed packages.
20
+
21
+ - @see https://github.com/moxystudio/node-proper-lockfile
package/dist/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { W as formatError, n as run, r as messages, t as parseArgs, y as MigrationAbortedError } from "./cli-vcn3DTDJ.mjs";
2
+ import { K as formatError, n as run, r as messages, t as parseArgs, y as MigrationAbortedError } from "./cli-Cfr6e9vX.mjs";
3
3
  //#region src/bin.ts
4
4
  async function main() {
5
5
  const argv = process.argv.slice(2);