bank20baht-cli 0.4.1 → 0.5.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.
package/README.md CHANGED
@@ -126,8 +126,8 @@ Field DSL — comma-separated `key:type[:modifier…]`:
126
126
  | Part | Values |
127
127
  | ---------- | -------------------------------------------------------------------------------------------------------------- |
128
128
  | `key` | `[a-z][a-z0-9_]*`; the label is derived (`due_date` → "Due Date") |
129
- | `type` | `text` `textarea` `number` `email` `password` `dropdown` `multiselect` `checkbox` `radio` `toggle` `date` `file` |
130
- | modifiers | `required` · `options=a\|b\|c` · `min=N` · `max=N` · `flag=NAME` |
129
+ | `type` | `text` `textarea` `markdown` `number` `email` `password` `dropdown` `multiselect` `checkbox` `radio` `toggle` `date` `file` `rating` `range` `reference` |
130
+ | modifiers | `required` · `options=a\|b\|c` · `min=N` · `max=N` · `step=N` · `ref=LOOKUP` · `flag=NAME` |
131
131
 
132
132
  Invalid DSL (unknown type, empty options, non-numeric `min`) fails before anything is
133
133
  written.
@@ -5,7 +5,7 @@ import { parseSchema } from 'bank20baht-validator';
5
5
  * --fields "title:text:required,priority:dropdown:options=low|medium|high,qty:number"
6
6
  *
7
7
  * field = key ':' type (':' modifier)*
8
- * mods = 'required' | 'options=a|b|c' | 'min=N' | 'max=N' | 'flag=NAME'
8
+ * mods = 'required' | 'options=a|b|c' | 'min=N' | 'max=N' | 'step=N' | 'ref=LOOKUP' | 'flag=NAME'
9
9
  *
10
10
  * The result is engine-validated (parseSchema) BEFORE any file is written —
11
11
  * an invalid spec exits 1 with zero files (the P1 guarantee, kept).
@@ -13,6 +13,7 @@ import { parseSchema } from 'bank20baht-validator';
13
13
  const FIELD_TYPES = new Set([
14
14
  'text',
15
15
  'textarea',
16
+ 'markdown',
16
17
  'number',
17
18
  'email',
18
19
  'password',
@@ -23,6 +24,9 @@ const FIELD_TYPES = new Set([
23
24
  'toggle',
24
25
  'date',
25
26
  'file',
27
+ 'rating',
28
+ 'range',
29
+ 'reference',
26
30
  ]);
27
31
  const KEY_PATTERN = /^[a-z][a-z0-9_]*$/;
28
32
  const titleCase = (key) => key
@@ -60,6 +64,10 @@ function applyModifier(field, mod, part) {
60
64
  field.min = parseNumberMod('min', mod.slice(4), part);
61
65
  else if (mod.startsWith('max='))
62
66
  field.max = parseNumberMod('max', mod.slice(4), part);
67
+ else if (mod.startsWith('step='))
68
+ field.step = parseNumberMod('step', mod.slice(5), part);
69
+ else if (mod.startsWith('ref='))
70
+ field.reference = mod.slice(4);
63
71
  else if (mod.startsWith('flag='))
64
72
  field.flag = mod.slice(5);
65
73
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bank20baht-cli",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "description": "Scaffold bun workspaces (bahtui new) and DDD monorepos (React + Elysia + Eden, bahtui create) plus bahtui generators.",
6
6
  "license": "MIT",
@@ -44,7 +44,7 @@
44
44
  "test:coverage": "vitest run --coverage"
45
45
  },
46
46
  "dependencies": {
47
- "bank20baht-validator": "^0.5.0"
47
+ "bank20baht-validator": "^0.6.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/node": "^22",