You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 12de718
Browse filesBrowse the repository at this point in the historyBrowse files
feat!: v2 parameter settings with nested paths (2.0.0) (#25)
* feat!: v2 parameter settings with nested paths
BREAKING CHANGE: parameter settings were reworked.
- Parameter settings accept typed nested paths ('envFiles[*].contents[*].value')
for nested type, isSensitive, isEqual and key settings. Paths autocomplete
via ConfigPath<T> and are validated against the schema.
- `type` is the value type only. Stateful parameters use
`{ stateful: new X(), order }` instead of `{ type: 'stateful', definition }`.
Removed the unused 'setting' type and isEqual/isElementEqual string presets
(use `type`/`itemType`, or the exported ParameterEquals helpers).
- New `key` setting for arrays of objects drives stateless filtering so a
changed element is a modify.
- Settings are normalized once into ParsedParameterSetting (stateful defaults
merged), removing stateful/array special cases from plan filtering.
- Array/object types are inferred from the schema; object parameters are
filtered to the declared keys in stateless mode and to the state keys on
destroy.
- Plan parameter changes report `sensitivePaths` for nested sensitive values
(isSensitive stays true for older CLIs).
- Zod: schemas convert in input mode (defaults are optional, nested objects
stay closed) and refinements run during validation.
- Add findUndescribedFields() for enforcing schema descriptions.
- Update @codifycli/schemas to ^1.6.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016QnBk3sUmv1d5R8H5giHe1
* fix: typed paths for loose objects and array filter typing
- ConfigPath includes named keys of objects that also have an index signature
(z.looseObject, interfaces extending StringIndexedObject) alongside `.*`.
- filterInStatelessMode keeps `any[]` parameter types so existing filter
functions stay contextually typed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016QnBk3sUmv1d5R8H5giHe1
---------
Co-authored-by: Claude <noreply@anthropic.com>
Keys are top level parameter names or typed paths into the config (`a[*]` = every array element,
285
+
`a.*` = every record value). Typos in paths fail to compile and paths are validated against the schema at runtime.
286
+
287
+
| Setting | Where | Description |
288
+
|---|---|---|
289
+
|`type`| any |`string`, `number`, `boolean`, `directory`, `version`, `array`, `object`, `any`. Picks the equality (and for `directory`/`string`/`boolean` the input transformation). `array`/`object` are inferred from the schema. |
290
+
|`isSensitive`| any | Mask in the plan and gate imports. On a nested path only those values are sensitive. |
291
+
|`isEqual`| any | Custom equality. `ParameterEquals.<type>` exposes the built in ones. |
292
+
|`itemType`, `isElementEqual`| arrays | Element type / element equality. Arrays are compared ignoring order. |
293
+
|`key`| arrays of objects | Field(s) identifying an element. Drives stateless filtering, so a changed element is a modify. |
294
+
|`filterInStatelessMode`| arrays, objects | Defaults to true: arrays keep matching elements, objects keep the desired keys. Function or `false` to customize. |
295
+
|`default`, `transformation`, `canModify`, `setting`| top level | Default value, bi-directional input transformation, modify instead of recreate, exclude from the plan. |
296
+
|`stateful`, `order`| top level | Attach a `StatefulParameter`/`ArrayStatefulParameter` and its apply order. Its own `getSettings()` provides defaults. |
297
+
298
+
Nested settings affect equality, element identity and sensitivity. Defaults, transformations, `canModify` and
299
+
stateful parameters stay on top level parameters.
300
+
301
+
### Zod schemas
302
+
303
+
-`.describe()` / `.meta({ title, description, examples, deprecated })` must come **after** checks like `.min()`:
304
+
Zod drops metadata when a check is chained after it. `findUndescribedFields(jsonSchema)` reports undocumented
305
+
fields (including ones lost this way) so build scripts can enforce documentation.
306
+
- Fields with `.default()` are optional for users (the schema is converted in input mode).
307
+
-`.refine()` / `.superRefine()` are run during validation in addition to the JSON schema checks.
308
+
309
+
### Migrating from 1.x
310
+
311
+
| 1.x | 2.x |
312
+
|---|---|
313
+
|`{ type: 'stateful', definition: new X(), order: 1 }`|`{ stateful: new X(), order: 1 }`|
Copy file name to clipboardExpand all lines: package.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@codifycli/plugin-core",
3
-
"version": "1.3.0",
3
+
"version": "2.0.0",
4
4
"description": "TypeScript library for building Codify plugins to manage system resources (applications, CLI tools, settings) through infrastructure-as-code",
0 commit comments