kintone-migrator 0.19.0 → 0.20.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
@@ -217,22 +217,29 @@ All commands support `--app <name>` and `--all` for [multi-app mode](#multi-app-
217
217
  Initializes a project from a kintone space. Fetches all apps in the specified space, generates a `kintone-migrator.yaml` config file with `files` object format, and captures all domain configurations for each app.
218
218
 
219
219
  ```bash
220
- kintone-migrator init <spaceId>
221
- kintone-migrator init <spaceId> --yes # Skip confirmation prompts
220
+ kintone-migrator init --space-id 1
221
+ kintone-migrator init -s 1 --yes # Skip confirmation prompts
222
+ kintone-migrator init -s 1 --dry-run # Preview without writing files
223
+ kintone-migrator init -s 1 -o ./myproject # Output to a specific directory
222
224
  ```
223
225
 
224
226
  | Option | Description |
225
227
  |---|---|
226
- | `<spaceId>` | kintone space ID (required argument) |
228
+ | `--space-id`, `-s` | kintone space ID (required, must be numeric) |
227
229
  | `--domain`, `-d` | kintone domain |
228
230
  | `--api-token`, `-t` | API token |
229
231
  | `--username`, `-u` | Username |
230
232
  | `--password`, `-p` | Password |
231
233
  | `--guest-space-id`, `-g` | Guest space ID |
232
- | `--output`, `-o` | Output config file path (default: `kintone-migrator.yaml`) |
234
+ | `--output`, `-o` | Output directory |
233
235
  | `--yes`, `-y` | Skip confirmation prompts |
236
+ | `--dry-run`, `-n` | Preview what would be created without writing any files |
234
237
 
235
- The generated config uses the `files` object format with all domain file paths pre-configured. For each app, schema, view, settings, notification, report, action, process, field-acl, app-acl, record-acl, admin-notes, and plugin configurations are captured.
238
+ The generated config uses the `files` object format with all domain file paths pre-configured. For each app, schema, seed, customize, view, settings, notification, report, action, process, field-acl, app-acl, record-acl, admin-notes, and plugin configurations are captured.
239
+
240
+ App names in the generated config are resolved with the following priority: app code > app name > `app-{appId}`. Duplicate names are automatically suffixed (e.g., `-2`, `-3`). File paths follow the `<appName>/<domain>.yaml` convention (e.g., `customer/schema.yaml`).
241
+
242
+ Authentication settings are intentionally omitted from the generated config to avoid committing credentials to version control. Set `KINTONE_API_TOKEN` or `KINTONE_USERNAME` + `KINTONE_PASSWORD` environment variables, or add `auth` to the config file manually.
236
243
 
237
244
  ### `schema` -- Form Schema Management
238
245
 
package/dist/index.mjs CHANGED
@@ -1783,20 +1783,20 @@ function resolveSingleApp(config, appName) {
1783
1783
  function buildAppFilePaths(appName, baseDir) {
1784
1784
  const prefix = (path) => baseDir ? join(baseDir, path) : path;
1785
1785
  return {
1786
- schema: prefix(`schemas/${appName}.yaml`),
1787
- seed: prefix(`seeds/${appName}.yaml`),
1788
- customize: prefix(`customize/${appName}.yaml`),
1789
- view: prefix(`view/${appName}.yaml`),
1790
- settings: prefix(`settings/${appName}.yaml`),
1791
- notification: prefix(`notification/${appName}.yaml`),
1792
- report: prefix(`report/${appName}.yaml`),
1793
- action: prefix(`action/${appName}.yaml`),
1794
- process: prefix(`process/${appName}.yaml`),
1795
- fieldAcl: prefix(`field-acl/${appName}.yaml`),
1796
- appAcl: prefix(`app-acl/${appName}.yaml`),
1797
- recordAcl: prefix(`record-acl/${appName}.yaml`),
1798
- adminNotes: prefix(`admin-notes/${appName}.yaml`),
1799
- plugin: prefix(`plugin/${appName}.yaml`)
1786
+ schema: prefix(`${appName}/schema.yaml`),
1787
+ seed: prefix(`${appName}/seed.yaml`),
1788
+ customize: prefix(`${appName}/customize.yaml`),
1789
+ view: prefix(`${appName}/view.yaml`),
1790
+ settings: prefix(`${appName}/settings.yaml`),
1791
+ notification: prefix(`${appName}/notification.yaml`),
1792
+ report: prefix(`${appName}/report.yaml`),
1793
+ action: prefix(`${appName}/action.yaml`),
1794
+ process: prefix(`${appName}/process.yaml`),
1795
+ fieldAcl: prefix(`${appName}/field-acl.yaml`),
1796
+ appAcl: prefix(`${appName}/app-acl.yaml`),
1797
+ recordAcl: prefix(`${appName}/record-acl.yaml`),
1798
+ adminNotes: prefix(`${appName}/admin-notes.yaml`),
1799
+ plugin: prefix(`${appName}/plugin.yaml`)
1800
1800
  };
1801
1801
  }
1802
1802