kintone-migrator 0.13.0 → 0.14.0

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.
Files changed (3) hide show
  1. package/README.md +94 -6
  2. package/dist/index.mjs +3631 -2659
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -63,7 +63,7 @@ SCHEMA_FILE_PATH=schema.yaml
63
63
 
64
64
  ### Multi-App Project Config
65
65
 
66
- For managing multiple apps, create a project config file (`kintone-migrator.yaml`):
66
+ For managing multiple apps, create a project config file (`kintone-migrator.yaml`). You can generate one automatically with `kintone-migrator init`.
67
67
 
68
68
  ```yaml
69
69
  domain: example.cybozu.com
@@ -73,11 +73,36 @@ auth:
73
73
  apps:
74
74
  customer:
75
75
  appId: "10"
76
- schemaFile: schemas/customer.yaml
77
- seedFile: seeds/customer.yaml
76
+ files:
77
+ schema: schemas/customer.yaml
78
+ seed: seeds/customer.yaml
79
+ view: view/customer.yaml
80
+ settings: settings/customer.yaml
81
+ notification: notification/customer.yaml
82
+ report: report/customer.yaml
83
+ action: action/customer.yaml
84
+ process: process/customer.yaml
85
+ fieldAcl: field-acl/customer.yaml
86
+ appAcl: app-acl/customer.yaml
87
+ recordAcl: record-acl/customer.yaml
88
+ adminNotes: admin-notes/customer.yaml
89
+ plugin: plugin/customer.yaml
78
90
  order:
79
91
  appId: "20"
80
- schemaFile: schemas/order.yaml
92
+ files:
93
+ schema: schemas/order.yaml
94
+ seed: seeds/order.yaml
95
+ view: view/order.yaml
96
+ settings: settings/order.yaml
97
+ notification: notification/order.yaml
98
+ report: report/order.yaml
99
+ action: action/order.yaml
100
+ process: process/order.yaml
101
+ fieldAcl: field-acl/order.yaml
102
+ appAcl: app-acl/order.yaml
103
+ recordAcl: record-acl/order.yaml
104
+ adminNotes: admin-notes/order.yaml
105
+ plugin: plugin/order.yaml
81
106
  dependsOn:
82
107
  - customer
83
108
  ```
@@ -85,8 +110,22 @@ apps:
85
110
  | Field | Required | Description |
86
111
  |---|---|---|
87
112
  | `appId` | Yes | kintone app ID |
88
- | `schemaFile` | No | Schema file path (default: `schemas/<appName>.yaml`) |
89
- | `seedFile` | No | Seed file path (default: `seeds/<appName>.yaml`) |
113
+ | `files.schema` | No | Schema file path (default: `schemas/<appName>.yaml`) |
114
+ | `files.seed` | No | Seed file path (default: `seeds/<appName>.yaml`) |
115
+ | `files.customize` | No | Customization file path (default: `customize/<appName>.yaml`) |
116
+ | `files.fieldAcl` | No | Field ACL file path (default: `field-acl/<appName>.yaml`) |
117
+ | `files.view` | No | View file path (default: `view/<appName>.yaml`) |
118
+ | `files.appAcl` | No | App ACL file path (default: `app-acl/<appName>.yaml`) |
119
+ | `files.recordAcl` | No | Record ACL file path (default: `record-acl/<appName>.yaml`) |
120
+ | `files.process` | No | Process management file path (default: `process/<appName>.yaml`) |
121
+ | `files.settings` | No | General settings file path (default: `settings/<appName>.yaml`) |
122
+ | `files.notification` | No | Notification file path (default: `notification/<appName>.yaml`) |
123
+ | `files.report` | No | Report file path (default: `report/<appName>.yaml`) |
124
+ | `files.action` | No | Action file path (default: `action/<appName>.yaml`) |
125
+ | `files.adminNotes` | No | Admin notes file path (default: `admin-notes/<appName>.yaml`) |
126
+ | `files.plugin` | No | Plugin file path (default: `plugin/<appName>.yaml`) |
127
+
128
+ > **Note:** Flat field format (`schemaFile`, `seedFile`, etc.) is deprecated. Use the `files` object instead. Flat fields are still supported for backward compatibility but may be removed in a future version.
90
129
  | `domain` | No | Override top-level domain |
91
130
  | `auth` | No | Override top-level authentication |
92
131
  | `guestSpaceId` | No | Guest space ID |
@@ -104,12 +143,39 @@ Apps are executed in topological order based on `dependsOn`. Circular dependenci
104
143
 
105
144
  Configuration merge priority (high to low): CLI arguments > environment variables > app-level settings > top-level settings.
106
145
 
146
+ #### File Path Resolution in Multi-App Mode
147
+
148
+ In multi-app mode, each command resolves its config file path using a convention-based default (`<domain>/<appName>.yaml`). CLI arguments and environment variables take precedence if specified.
149
+
150
+ | Command Group | Multi-App Default Path | Single-App Default Path |
151
+ |---|---|---|
152
+ | `schema` | `schemas/<appName>.yaml` | `schema.yaml` |
153
+ | `seed` | `seeds/<appName>.yaml` | `seed.yaml` |
154
+ | `customize` | `customize/<appName>.yaml` | `customize.yaml` |
155
+ | `field-acl` | `field-acl/<appName>.yaml` | `field-acl.yaml` |
156
+ | `view` | `view/<appName>.yaml` | `views.yaml` |
157
+ | `app-acl` | `app-acl/<appName>.yaml` | `app-acl.yaml` |
158
+ | `record-acl` | `record-acl/<appName>.yaml` | `record-acl.yaml` |
159
+ | `process` | `process/<appName>.yaml` | `process.yaml` |
160
+ | `settings` | `settings/<appName>.yaml` | `settings.yaml` |
161
+ | `notification` | `notification/<appName>.yaml` | `notification.yaml` |
162
+ | `report` | `report/<appName>.yaml` | `reports.yaml` |
163
+ | `action` | `action/<appName>.yaml` | `actions.yaml` |
164
+ | `admin-notes` | `admin-notes/<appName>.yaml` | `admin-notes.yaml` |
165
+ | `plugin` | `plugin/<appName>.yaml` | `plugins.yaml` |
166
+
167
+ All file paths can be explicitly overridden per app in the project config. If not specified, the convention-based default path is used.
168
+
107
169
  For details, see [Project Config Specification](./spec/projectConfig.md).
108
170
 
109
171
  ## Commands
110
172
 
111
173
  Commands are organized into domain groups:
112
174
 
175
+ | Command | Description |
176
+ |---|---|
177
+ | `init` | Initialize a project from a kintone space |
178
+
113
179
  | Group | Subcommand | Description |
114
180
  |---|---|---|
115
181
  | `schema` | `diff` | Show differences between schema file and kintone form |
@@ -146,6 +212,28 @@ Commands are organized into domain groups:
146
212
 
147
213
  All commands support `--app <name>` and `--all` for [multi-app mode](#multi-app-project-config). Commands that modify data (`schema migrate`, `schema override`, `seed apply --clean`, `customize apply`) support `--yes` / `-y` to skip confirmation prompts.
148
214
 
215
+ ### `init` -- Project Initialization
216
+
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
+
219
+ ```bash
220
+ kintone-migrator init <spaceId>
221
+ kintone-migrator init <spaceId> --yes # Skip confirmation prompts
222
+ ```
223
+
224
+ | Option | Description |
225
+ |---|---|
226
+ | `<spaceId>` | kintone space ID (required argument) |
227
+ | `--domain`, `-d` | kintone domain |
228
+ | `--api-token`, `-t` | API token |
229
+ | `--username`, `-u` | Username |
230
+ | `--password`, `-p` | Password |
231
+ | `--guest-space-id`, `-g` | Guest space ID |
232
+ | `--output`, `-o` | Output config file path (default: `kintone-migrator.yaml`) |
233
+ | `--yes`, `-y` | Skip confirmation prompts |
234
+
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.
236
+
149
237
  ### `schema` -- Form Schema Management
150
238
 
151
239
  #### `schema diff`