MVP array config item vals#843
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
varlock-website | 44f694e | Commit Preview URL Branch Preview URL |
Jun 26 2026, 03:30 PM |
|
The changes in this PR will be included in the next version bump.
|
commit: |
| - `separator` (string) — split string input (e.g. `","` for comma-separated `.env` values) | ||
| - `allowEmpty` (boolean) — allow `[]` (default: false) | ||
|
|
||
| Named options not listed above are forwarded to the element type (e.g. `normalize=true` on `array(email, …)`). |
| **Element type** — first positional argument: a type name (`string`, `email`, …) or a nested call for types with positional args (`enum(dev, staging, prod)`). | ||
|
|
||
| **Array options:** | ||
| - `minLength` / `maxLength` — element count bounds |
There was a problem hiding this comment.
probable want an isLength too to match our string type
| **Array options:** | ||
| - `minLength` / `maxLength` — element count bounds | ||
| - `unique` (boolean) — reject duplicate elements | ||
| - `separator` (string) — split string input (e.g. `","` for comma-separated `.env` values) |
There was a problem hiding this comment.
Both in terms of input and output, we may need some options around quotes and brackets.
For example, all these seem like reasonable inputs - a,b,c, [a,b,c], ["a", "b", "c"]
All of them could be parsed and the type-safe output will be fine, but the its not clear how we'd serialzie it back to a string for the basic env var. Also probably want to enable/disable basic splitting
Id assume default is that splitting by comma is fine, and no quotes needed, since if youre using an env var today to pass in a list, its probably just a,b,c
| env-spec-language: minor | ||
| --- | ||
|
|
||
| Add `@type=array(...)` for list-valued config items with per-element validation, array literal values, JSON and comma-separated input, and `T[]` type generation. |
There was a problem hiding this comment.
My debate internally had been whether to do wrap the type in array() or to split it into a new decorator --
@type=string(startsWith=abc) @arrayType(minLength=2)
Obviously wrapping is a bit more correct, but since our type stuff doesnt actually use normal function calls like the rest of the system I thought it might be cleaner. Also do we want to support nested arrays?
Im not set on it, but curious what you think.
Also - we may as well support object (record/dictionary) too with this work? I dont think arbitrary shaped objects like we had in dmno, but just setting the value type, and optionally the key type.
dictionary(uuid, keyType=string(isLength=2), minKeyCount=2)


No description provided.