kintone-migrator 0.34.6 → 0.35.1

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
@@ -131,16 +131,23 @@ apps:
131
131
  | `guestSpaceId` | No | Guest space ID |
132
132
  | `dependsOn` | No | List of app names this app depends on |
133
133
 
134
- Multi-app CLI options (available on all commands):
134
+ Multi-app CLI options (available on every command except `init`):
135
135
 
136
136
  | CLI Argument | Description |
137
137
  |---|---|
138
138
  | `--app <name>` | Target a specific app by name |
139
- | `--all` | Run all apps in dependency order |
139
+ | `--all` | Run all apps in dependency order (not supported by `<domain> push` / `<domain> pull` — see below) |
140
140
  | `--config`, `-c` | Config file path (default: `kintone-migrator.yaml`) |
141
141
 
142
142
  Apps are executed in topological order based on `dependsOn`. Circular dependencies are detected and reported as errors. `--all` stops on first failure (fail-fast).
143
143
 
144
+ The per-domain `push` / `pull` commands (`schema push`, `customize push`, `customize pull`, `view pull`, ...) only run one app at a time: they accept `--app <name>` but reject `--all` with a validation error. To run every app, use the top-level aggregate `push` / `pull` commands, which cover every domain across every app in dependency order:
145
+
146
+ ```bash
147
+ kintone-migrator push --all --yes # every domain, every app
148
+ kintone-migrator pull --all # every domain, every app
149
+ ```
150
+
144
151
  Configuration merge priority (high to low): CLI arguments > environment variables > app-level settings > top-level settings.
145
152
 
146
153
  #### File Path Resolution in Multi-App Mode
@@ -183,7 +190,7 @@ Commands are organized into domain groups:
183
190
  | `schema` | `override` | Overwrite entire form from schema |
184
191
  | `schema` | `capture` | _Deprecated — use `schema pull`._ Save current form schema to file |
185
192
  | `schema` | `validate` | Validate schema file locally |
186
- | `schema` | `dump` | Dump raw field/layout JSON (for debugging) |
193
+ | `schema` | `dump` | Dump raw field/layout JSON (debugging / preview-vs-published check) |
187
194
  | `seed` | `push` | Upsert seed data records (plain upsert; no 3-way merge) |
188
195
  | `seed` | `apply` | _Deprecated alias for `seed push`._ |
189
196
  | `seed` | `capture` | Capture records from kintone app |
@@ -214,7 +221,9 @@ Commands are organized into domain groups:
214
221
 
215
222
  > **Deprecation notice:** the `apply`/`capture`/`migrate` commands above are deprecated in favor of their per-domain `push`/`pull` successors and will be removed in a future major version. The top-level `apply`/`capture` aggregate commands are likewise superseded by the top-level `push`/`pull` aggregate commands (which run every domain at once), not by any single `<domain> push`/`<domain> pull`. `push` writes to kintone (with a drift guard; use `--force` for the legacy overwrite behavior) and `pull` reads from kintone (with 3-way merge; `--force` for legacy overwrite). `seed` is out of scope for 3-way merge, so it has `seed push` but no `seed pull` — keep using `seed capture` to read records.
216
223
 
217
- All commands support `--app <name>` and `--all` for [multi-app mode](#multi-app-project-config). Commands that modify data (`schema push`, `schema override`, `seed push --clean`, `customize push`) support `--yes` / `-y` to skip confirmation prompts.
224
+ Every command except `init` supports `--app <name>` for [multi-app mode](#multi-app-project-config). `--all` is supported by the `apply` / `capture` / `diff` / `migrate` commands, `seed push`, and the top-level aggregate `push` / `pull`, but **not** by the per-domain `push` / `pull` commands (`schema push`, `schema pull`, `customize push`, `customize pull`, `view push`, ...) — those reject `--all` with a validation error. Run the top-level `push` / `pull` with `--all` to cover every app instead.
225
+
226
+ Commands that modify data (`schema push`, `schema override`, `seed push --clean`, `customize push`) support `--yes` / `-y` to skip confirmation prompts.
218
227
 
219
228
  ### `init` -- Project Initialization
220
229
 
@@ -249,13 +258,28 @@ Authentication settings are intentionally omitted from the generated config to a
249
258
 
250
259
  #### `schema diff`
251
260
 
252
- Detects differences between the schema file and the current kintone form.
261
+ Detects differences between the schema file and the current kintone form. The output states which form generation the comparison used.
253
262
 
254
263
  ```bash
255
264
  kintone-migrator schema diff
256
265
  kintone-migrator schema diff --app customer
266
+ kintone-migrator schema diff --published
257
267
  ```
258
268
 
269
+ | Option | Description |
270
+ |---|---|
271
+ | `--published` | Compare against the published (deployed) form instead of the preview (unpublished) one. |
272
+
273
+ Without `--published` the comparison is 3-way against the preview form: with a base snapshot it distinguishes local changes, remote drift, and conflicts.
274
+
275
+ With `--published` the comparison is 2-way against the deployed form. The base snapshot is not used, so drift and conflicts are not detected -- "no changes" means only that the schema file matches what is currently published.
276
+
277
+ This is the check to run after a deploy: if `schema diff --published` reports no changes, the schema file's contents are live on the published form.
278
+
279
+ `--published` requires the app to have been deployed at least once. On an app that has never been deployed, the read fails with an error that identifies it as a published read and points at the likely cause. With `--all`, a single failing app stops the whole run (fail-fast) and the remaining apps are skipped.
280
+
281
+ `--published` is accepted only by `schema dump` and `schema diff`. `schema pull`, `schema push`, `schema capture`, `schema migrate`, and `schema override` always target the preview generation, and passing `--published` to them is silently ignored.
282
+
259
283
  #### `schema migrate`
260
284
 
261
285
  > **Deprecated.** Use `schema push` (drift-guarded) or `schema push --force` (legacy overwrite) instead. `schema migrate` keeps working but will be removed in a future major version.
@@ -305,12 +329,53 @@ kintone-migrator schema validate -f my-schema.yaml
305
329
 
306
330
  #### `schema dump`
307
331
 
308
- Dumps raw kintone field definitions and layout as JSON. Outputs `fields.json` and `layout.json` (prefixed with app name in multi-app mode).
332
+ Dumps raw kintone field definitions and layout as JSON. Outputs `fields.json` and `layout.json` (prefixed with app name in multi-app mode), or their `published-` counterparts with `--published`, so both generations can be dumped side by side and compared.
309
333
 
310
334
  ```bash
311
335
  kintone-migrator schema dump
336
+ kintone-migrator schema dump --published
312
337
  ```
313
338
 
339
+ | Option | Description |
340
+ |---|---|
341
+ | `--published` | Dump the published (deployed) form instead of the preview (unpublished) one. |
342
+
343
+ With `--published` the output file names are prefixed with `published-`, so the two generations never overwrite each other: `published-fields.json` / `published-layout.json` (in multi-app mode, `<appName>-published-fields.json` / `<appName>-published-layout.json`).
344
+
345
+ `--published` requires the app to have been deployed at least once. On an app that has never been deployed, the dump fails with an error that identifies it as a published read and points at the likely cause, and no file is written. With `--all`, a single failing app stops the whole run (fail-fast) and the remaining apps are skipped.
346
+
347
+ `--published` is accepted only by `schema dump` and `schema diff`. `schema pull`, `schema push`, `schema capture`, `schema migrate`, and `schema override` always target the preview generation, and passing `--published` to them is silently ignored.
348
+
349
+ Because the two dumps sit side by side, you can compare the preview form definition with the published one before pushing your own changes:
350
+
351
+ ```bash
352
+ kintone-migrator schema dump # fields.json / layout.json (preview)
353
+ kintone-migrator schema dump --published # published-fields.json / published-layout.json
354
+
355
+ # revision can differ between generations, so exclude it from the comparison
356
+ diff -I '"revision"' fields.json published-fields.json
357
+ diff -I '"revision"' layout.json published-layout.json
358
+ ```
359
+
360
+ In a multi-app project (a `kintone-migrator.yaml` is present), add `--app <name>` to both dumps -- with none of `--app`, `--all`, or `--app-id` the command only lists the available apps and writes no files. With `--app <name>` the output file names are prefixed with the app name (`--app-id` bypasses the project config and keeps the unprefixed names):
361
+
362
+ ```bash
363
+ kintone-migrator schema dump --app customer # customer-fields.json / customer-layout.json
364
+ kintone-migrator schema dump --app customer --published # customer-published-fields.json / customer-published-layout.json
365
+
366
+ diff -I '"revision"' customer-fields.json customer-published-fields.json
367
+ diff -I '"revision"' customer-layout.json customer-published-layout.json
368
+ ```
369
+
370
+ The `-I '"revision"'` exclusion is needed because `dump` saves the kintone response as-is: both `fields.json` and `layout.json` carry a top-level `revision`, and its value can differ between the preview and published generations even when the form contents are identical. If the comparison reports differences other than `revision` -- for example the same fields serialized in a different key order -- normalize both files before comparing:
371
+
372
+ ```bash
373
+ diff <(jq -S 'del(.revision)' fields.json) <(jq -S 'del(.revision)' published-fields.json)
374
+ diff <(jq -S 'del(.revision)' layout.json) <(jq -S 'del(.revision)' published-layout.json)
375
+ ```
376
+
377
+ No differences means the form definition in preview matches the one that is published. It does not mean that a deploy is safe in general: deploying publishes **all** pending preview settings for the app -- views, notifications, process management, the various permission settings, plugins, general settings -- while this check covers the form definition only. Someone else's undeployed work in those other areas would still go live.
378
+
314
379
  ### `seed` -- Seed Data Management
315
380
 
316
381
  #### `seed push`
@@ -344,6 +409,8 @@ kintone-migrator seed capture --key-field customer_code
344
409
 
345
410
  ### `customize` -- JS/CSS Customization
346
411
 
412
+ > **Note:** `customize push` / `customize pull` handle one app per run — they accept `--app <name>` but reject `--all`. To apply customizations to every app at once, use the top-level aggregate `push` / `pull` (`kintone-migrator push --all --yes`), which runs every domain for every app in dependency order. The deprecated `customize apply` / `customize capture` still accept `--all`.
413
+
347
414
  #### `customize apply`
348
415
 
349
416
  > **Deprecated.** Use `customize push` instead (and `customize pull` in place of `customize capture`). The legacy commands keep working but will be removed in a future major version.