@velastack/patterns 0.2.9 → 0.2.10
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 +8 -3
- package/dist/index.d.ts +26 -3
- package/dist/index.js +1598 -1581
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,12 +80,17 @@ argv only). Shared behaviour (the layout modifier, writing the env keys to `.env
|
|
|
80
80
|
|
|
81
81
|
### Plain forms
|
|
82
82
|
|
|
83
|
-
`generate-form` and `generate-form-remote` take `input.ui: "shadcn" | "plain"` (default `shadcn`). `plain` is for
|
|
83
|
+
`generate-form` and `generate-form-remote` take `input.ui: "shadcn" | "plain"` (default: the detected `features.ui`, then `shadcn`). `plain` is for
|
|
84
84
|
projects Vela did not create: native elements with no components and no classes, `data-field` / `data-invalid` /
|
|
85
85
|
`data-error` hooks for styling, `components: []`, and hand-written `aria-invalid` / `aria-describedby` in place
|
|
86
86
|
of what formsnap wires up. Two more keys say what else the project lacks: `flash: false` reports through
|
|
87
87
|
superforms' `message()` instead of `sveltekit-flash-message`, and `serverTests: false` skips `server.test.ts`.
|
|
88
|
-
The CLI detects
|
|
88
|
+
The CLI detects `features.ui` and the two keys; `--ui` sets `input.ui`, which wins over the feature.
|
|
89
|
+
|
|
90
|
+
Default routes follow `options.routeGroups` (`{ public, app }`, each a group directory name or `null`). The CLI
|
|
91
|
+
detects it, so a project without `(public)` gets `src/routes/<model>`; absent means the Vela layout. Only routes
|
|
92
|
+
resolved by `parseRoute` (form and scaffold generators and destroyers) follow it: `enable-*` patterns still write
|
|
93
|
+
into `(public)` / `(app)`.
|
|
89
94
|
|
|
90
95
|
Field markup that does not go through formsnap lives in `src/core/field/plain.ts`, split into a **binding**
|
|
91
96
|
(superforms stores, or a remote form's `.as()` / `.issues()`) and a **style** (shadcn `Input` plus tailwind
|
|
@@ -138,7 +143,7 @@ npm run test:integration -- integration/stacks.test.ts -t "teams" # one case
|
|
|
138
143
|
|
|
139
144
|
- `VELA_BIN=/path/to/vela` picks the CLI (default: `vela` on PATH).
|
|
140
145
|
- `INTEGRATION_KEEP=1` keeps generated projects; failed cases are always kept.
|
|
141
|
-
- `
|
|
146
|
+
- `vela test:server` runs after each checked step in projects that have it; `INTEGRATION_SERVER_TESTS=0` skips it for a faster local loop.
|
|
142
147
|
- `STRIPE_SECRET_KEY` + `STRIPE_PUBLISHABLE_KEY` enable the payments cases; they skip otherwise.
|
|
143
148
|
- Failures point at `.integration-tests/<suite>/<case>/.integration/` (`commands.log`, `steps.json`,
|
|
144
149
|
the raw svelte-check output). Expected failures live in `integration/known-failures.ts`, scoped per
|
package/dist/index.d.ts
CHANGED
|
@@ -1311,6 +1311,13 @@ declare interface Features {
|
|
|
1311
1311
|
* optional so the `requires` of older patterns need not mention it.
|
|
1312
1312
|
*/
|
|
1313
1313
|
workflows?: boolean;
|
|
1314
|
+
/**
|
|
1315
|
+
* The component kit the project has: `shadcn` is shadcn-svelte (a
|
|
1316
|
+
* `components.json` plus the package), `plain` is neither. Detected by the
|
|
1317
|
+
* caller; optional so the `requires` of patterns need not mention it, and
|
|
1318
|
+
* absent means `shadcn`, which is every project `vela create` makes.
|
|
1319
|
+
*/
|
|
1320
|
+
ui?: "shadcn" | "plain";
|
|
1314
1321
|
}
|
|
1315
1322
|
|
|
1316
1323
|
declare type FieldChange = {
|
|
@@ -1480,6 +1487,11 @@ export declare interface Options {
|
|
|
1480
1487
|
env: "runtime" | "preview";
|
|
1481
1488
|
root: string;
|
|
1482
1489
|
features: Features;
|
|
1490
|
+
/**
|
|
1491
|
+
* Where default routes go. Detected by the caller; absent means the vela
|
|
1492
|
+
* layout, `(public)` and `(app)`.
|
|
1493
|
+
*/
|
|
1494
|
+
routeGroups?: RouteGroups;
|
|
1483
1495
|
/**
|
|
1484
1496
|
* Reads the live collection schema. Required when `env` is `"runtime"`.
|
|
1485
1497
|
*
|
|
@@ -1494,15 +1506,15 @@ export declare interface Options {
|
|
|
1494
1506
|
* Conventional keys consumed by built-in patterns:
|
|
1495
1507
|
* - `route` (string): override the default SvelteKit route for generators that
|
|
1496
1508
|
* produce pages. Format: `(group)/segment[/segment]*` (route group required;
|
|
1497
|
-
* if omitted, the auth-aware default group
|
|
1498
|
-
* like `[team_id]` are recognized and threaded into generated href/redirect
|
|
1509
|
+
* if omitted, the auth-aware default group from `routeGroups` is
|
|
1510
|
+
* prepended). Dynamic segments like `[team_id]` are recognized and threaded into generated href/redirect
|
|
1499
1511
|
* expressions and test placeholders.
|
|
1500
1512
|
* - `destructive` (boolean): consent flag for destroy patterns to perform
|
|
1501
1513
|
* filesystem and collection deletions.
|
|
1502
1514
|
* - `variant` (string): selects an alternate template under `variants/`.
|
|
1503
1515
|
* - `ui` (`"shadcn" | "plain"`): markup the form generators emit. `plain` is
|
|
1504
1516
|
* native elements with no components or classes, for projects without
|
|
1505
|
-
* shadcn-svelte. Defaults to `shadcn`.
|
|
1517
|
+
* shadcn-svelte. Defaults to `features.ui`, then `shadcn`.
|
|
1506
1518
|
* - `flash` (boolean): whether the project has `sveltekit-flash-message`
|
|
1507
1519
|
* wired up. When false, form actions report through superforms'
|
|
1508
1520
|
* `message()` instead. Defaults to true.
|
|
@@ -2822,6 +2834,17 @@ declare interface Result {
|
|
|
2822
2834
|
uninstalls?: Package[];
|
|
2823
2835
|
}
|
|
2824
2836
|
|
|
2837
|
+
/**
|
|
2838
|
+
* The route groups a project has, as directory names under `src/routes`.
|
|
2839
|
+
* `null` means the project has no such group, so routes that would default
|
|
2840
|
+
* into it go directly under `src/routes` (a SvelteKit project vela did not
|
|
2841
|
+
* create).
|
|
2842
|
+
*/
|
|
2843
|
+
declare interface RouteGroups {
|
|
2844
|
+
public: string | null;
|
|
2845
|
+
app: string | null;
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2825
2848
|
export declare type Slug = PatternEntry["slug"];
|
|
2826
2849
|
|
|
2827
2850
|
/** Moves a project to another shadcn-svelte style, re-adding its registry components. */
|