@svadmin/create 0.33.0 → 0.33.1
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/dist/index.js +26 -8
- package/guidance/AGENTS.md +23 -0
- package/guidance/DESIGN.md +39 -6
- package/package.json +1 -1
- package/scaffold-manifest.json +13 -2
- package/template/patches/@refinedev%2Fcore@5.0.12.patch +30 -0
- package/template/patches/bits-ui@2.19.0.patch +910 -0
- package/template/src/App.svelte +0 -1
- package/template/src/pages/Dashboard.svelte +16 -66
- package/template/src/resource-contracts.ts +20 -1
package/dist/index.js
CHANGED
|
@@ -5103,6 +5103,10 @@ function assertScaffoldManifest(candidate) {
|
|
|
5103
5103
|
assertStringRecord(candidate["scripts"], "scaffold manifest.scripts");
|
|
5104
5104
|
assertStringRecord(candidate["dependencies"], "scaffold manifest.dependencies");
|
|
5105
5105
|
assertStringRecord(candidate["devDependencies"], "scaffold manifest.devDependencies");
|
|
5106
|
+
for (const key of ["overrides", "patchedDependencies"]) {
|
|
5107
|
+
if (candidate[key] !== undefined)
|
|
5108
|
+
assertStringRecord(candidate[key], `scaffold manifest.${key}`);
|
|
5109
|
+
}
|
|
5106
5110
|
assertJsonObject(candidate["svadmin"], "scaffold manifest.svadmin");
|
|
5107
5111
|
assertDependencyPacks(candidate["svadmin"]["dependencyPacks"]);
|
|
5108
5112
|
assertSelectionMap(candidate["svadmin"]["dataProviders"], DATA_PROVIDER_CHOICES, "scaffold manifest.svadmin.dataProviders");
|
|
@@ -5145,7 +5149,9 @@ function createProjectPackageJson(scaffold, options) {
|
|
|
5145
5149
|
type: scaffold.type,
|
|
5146
5150
|
scripts: { ...scaffold.scripts },
|
|
5147
5151
|
dependencies,
|
|
5148
|
-
devDependencies: { ...scaffold.devDependencies }
|
|
5152
|
+
devDependencies: { ...scaffold.devDependencies },
|
|
5153
|
+
...scaffold.overrides ? { overrides: { ...scaffold.overrides } } : {},
|
|
5154
|
+
...scaffold.patchedDependencies ? { patchedDependencies: { ...scaffold.patchedDependencies } } : {}
|
|
5149
5155
|
};
|
|
5150
5156
|
}
|
|
5151
5157
|
|
|
@@ -7187,6 +7193,17 @@ var SCAFFOLD_MIGRATION_NOTES = [
|
|
|
7187
7193
|
var SCAFFOLD_UI_COMPONENTS = [
|
|
7188
7194
|
...[
|
|
7189
7195
|
"AdminApp",
|
|
7196
|
+
"ResourceOverview",
|
|
7197
|
+
"DashboardPage",
|
|
7198
|
+
"PageSection",
|
|
7199
|
+
"ContentPageShell",
|
|
7200
|
+
"ContentPageHeader",
|
|
7201
|
+
"SectionHeader",
|
|
7202
|
+
"WorkspaceLayout",
|
|
7203
|
+
"MetricBlock",
|
|
7204
|
+
"FilterToolbar",
|
|
7205
|
+
"SettingsGroup",
|
|
7206
|
+
"SettingsFieldRow",
|
|
7190
7207
|
"AutoTable",
|
|
7191
7208
|
"AutoForm",
|
|
7192
7209
|
"ShowPage",
|
|
@@ -8391,6 +8408,8 @@ ${import_picocolors4.default.bold("Scaffolding")} project in ${import_picocolors
|
|
|
8391
8408
|
const entries = fs5.readdirSync(src, { withFileTypes: true });
|
|
8392
8409
|
for (const entry of entries) {
|
|
8393
8410
|
const srcPath = path5.join(src, entry.name);
|
|
8411
|
+
if (srcPath === path5.join(templateDir, "src", "providers", "supabase.ts") && response.dataProvider !== "supabase" && response.authProvider !== "supabase")
|
|
8412
|
+
continue;
|
|
8394
8413
|
const destPath = path5.join(dest, entry.name === "_gitignore" ? ".gitignore" : entry.name);
|
|
8395
8414
|
if (entry.isDirectory()) {
|
|
8396
8415
|
copyDir(srcPath, destPath);
|
|
@@ -8457,24 +8476,23 @@ bun run dev
|
|
|
8457
8476
|
- **State**: TanStack Query v6
|
|
8458
8477
|
`);
|
|
8459
8478
|
console.log(import_picocolors4.default.green(" ✔") + " README.md generated");
|
|
8479
|
+
let dependenciesInstalled = false;
|
|
8460
8480
|
if (response.installDeps) {
|
|
8461
8481
|
console.log(`
|
|
8462
8482
|
${import_picocolors4.default.bold("Installing dependencies...")}
|
|
8463
8483
|
`);
|
|
8464
8484
|
const bunInstall = spawnSync("bun", ["install"], { cwd: projectDir, stdio: "inherit" });
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
console.log(import_picocolors4.default.yellow("\n ⚠ Auto-install failed. Run `bun install` or `npm install` manually."));
|
|
8469
|
-
}
|
|
8485
|
+
dependenciesInstalled = bunInstall.status === 0;
|
|
8486
|
+
if (!dependenciesInstalled) {
|
|
8487
|
+
console.log(import_picocolors4.default.yellow("\n ⚠ Auto-install failed. Run `bun install` manually; this template requires Bun to apply dependency patches."));
|
|
8470
8488
|
}
|
|
8471
8489
|
}
|
|
8472
8490
|
console.log();
|
|
8473
|
-
console.log(import_picocolors4.default.green(import_picocolors4.default.bold(" ✔ Project ready!")));
|
|
8491
|
+
console.log(import_picocolors4.default.green(import_picocolors4.default.bold(dependenciesInstalled ? " ✔ Project ready!" : " ✔ Project generated. Dependencies still need installation.")));
|
|
8474
8492
|
console.log();
|
|
8475
8493
|
console.log(" Next steps:");
|
|
8476
8494
|
console.log(` ${import_picocolors4.default.cyan(`cd ${response.projectName}`)}`);
|
|
8477
|
-
if (!
|
|
8495
|
+
if (!dependenciesInstalled) {
|
|
8478
8496
|
console.log(` ${import_picocolors4.default.cyan("bun install")}`);
|
|
8479
8497
|
}
|
|
8480
8498
|
console.log(` ${import_picocolors4.default.cyan("bun run dev")}`);
|
package/guidance/AGENTS.md
CHANGED
|
@@ -26,6 +26,29 @@ business code inside `src/features/<module>/` and expose it through the module's
|
|
|
26
26
|
|
|
27
27
|
## Required workflow
|
|
28
28
|
|
|
29
|
+
### Default-first page composition
|
|
30
|
+
|
|
31
|
+
- Start with `AdminApp`, a provider bundle, and schema-backed resources. Its
|
|
32
|
+
default layout is clean-flat; the default color is Stripe unless the user has
|
|
33
|
+
saved another selection. Keep explicit theme overrides only for intentional changes.
|
|
34
|
+
- Keep the built-in list/create/edit/show routes unless the business workflow
|
|
35
|
+
needs a different composition. Do not replace CRUD with static demo tables.
|
|
36
|
+
- Use `ResourceOverview` for a permission-aware resource entry page.
|
|
37
|
+
- Use `DashboardPage` with `metrics`, `actions`, `secondary`, and default snippets
|
|
38
|
+
for dashboards; use `PageSection`, `WorkspaceLayout`, `FilterToolbar`,
|
|
39
|
+
`SettingsGroup`, and `SettingsFieldRow` for other page compositions.
|
|
40
|
+
- Import components from `@svadmin/ui` and styles from `@svadmin/ui/app.css`.
|
|
41
|
+
Never import example files or copy example-only CSS into a consumer.
|
|
42
|
+
- Metrics must come from the application's provider. Do not manufacture totals,
|
|
43
|
+
success states, actions, or backend capabilities to fill a layout.
|
|
44
|
+
- Verify a generated application without resource-page overrides or custom CSS
|
|
45
|
+
before adding domain-specific presentation. Check list, create, edit, show,
|
|
46
|
+
validation, denied permissions, empty/error/loading states, and mobile layouts.
|
|
47
|
+
- Keep the generated Bun dependency overrides and `patches/` together. They
|
|
48
|
+
carry tested upstream declaration fixes; do not remove them or enable
|
|
49
|
+
`skipLibCheck` merely to silence dependency errors. Re-run `bun run check`
|
|
50
|
+
and `bun run build` after upgrading a patched dependency.
|
|
51
|
+
|
|
29
52
|
1. Name the page's single primary workflow and dominant next action.
|
|
30
53
|
2. Inventory every heading, description, notice, metric, badge, and data view.
|
|
31
54
|
3. Assign each fact and event to one primary UI surface.
|
package/guidance/DESIGN.md
CHANGED
|
@@ -141,12 +141,43 @@ The same contract is used at every delivery surface:
|
|
|
141
141
|
`clean-flat + stripe` refinement; host applications consume this stylesheet.
|
|
142
142
|
- `packages/core/src/theme.svelte.ts` owns the `stripe` color preset and mode
|
|
143
143
|
attributes; it must stay aligned with the CSS fallback values.
|
|
144
|
-
- `
|
|
145
|
-
|
|
144
|
+
- `AdminApp` supplies `clean-flat` as a fallback layout without taking over an
|
|
145
|
+
explicit theme owner. Core supplies the default Stripe color and preserves
|
|
146
|
+
saved user selections; `layoutPreset: 'default'` remains an explicit opt-out.
|
|
147
|
+
- `example/src/App.svelte` consumes these defaults without repeating theme
|
|
148
|
+
configuration. A bare `AdminApp` renders `ResourceOverview` on its home route.
|
|
149
|
+
- `DashboardPage`, `PageSection`, `WorkspaceLayout`, and the content components
|
|
150
|
+
own reusable page composition in the published UI package. Example modules
|
|
151
|
+
own business queries and decisions, not private replacements for these layouts.
|
|
146
152
|
- `packages/create-svadmin/template` starts new projects with the same theme
|
|
147
153
|
and guidance document, so generated apps do not drift from the example.
|
|
148
154
|
- `design/admin-ui/preview` renders the published package CSS and uses the same
|
|
149
155
|
Stripe preset for component and state review.
|
|
156
|
+
- `packages/flow` resolves explicit flow overrides first, then host semantic
|
|
157
|
+
tokens, then standalone Stripe-compatible fallback colors.
|
|
158
|
+
- `packages/editor`, `packages/surface`, and `packages/ai-elements` consume
|
|
159
|
+
complete CSS color tokens, not HSL channel tuples. Independent stylesheets
|
|
160
|
+
use motion-token fallbacks so they also work without the full UI package.
|
|
161
|
+
- `packages/lite` mirrors the palette with literal colors. Its legacy-browser
|
|
162
|
+
contract deliberately excludes custom properties and modern selectors;
|
|
163
|
+
visual alignment must not remove that compatibility.
|
|
164
|
+
|
|
165
|
+
Theme refinements must preserve component density, invalid and selected states.
|
|
166
|
+
Focus belongs to the active control, not every enclosing card. Search icons and
|
|
167
|
+
clear actions use logical positioning so the same layout works in RTL.
|
|
168
|
+
|
|
169
|
+
Settings pages use `ContentPageHeader` with one page-level `h1`. When embedded
|
|
170
|
+
inside another page, pass `headingLevel="h2"` and use `h3` for nested
|
|
171
|
+
`SettingsGroup` headings. `SettingsFieldRow.controlId` associates the visible
|
|
172
|
+
label with its native control; IDs must be unique per component instance.
|
|
173
|
+
Segmented settings expose their selected option with `aria-pressed`, retain
|
|
174
|
+
their value after reload, and normalize unsupported persisted values.
|
|
175
|
+
Invalid fields expose `aria-invalid` and associate the visible error through
|
|
176
|
+
`aria-describedby`; valid sibling fields stay neutral. Clearing an error also
|
|
177
|
+
removes its association. Verify label activation with two mounted instances,
|
|
178
|
+
not only matching label text. Provider-backed settings retain their disabled
|
|
179
|
+
state when no provider is configured; demo screenshots are not persistence
|
|
180
|
+
evidence.
|
|
150
181
|
|
|
151
182
|
Do not add page-local palettes or shadow values when a semantic token exists.
|
|
152
183
|
If a new reference suggests a different treatment, record its responsibility
|
|
@@ -247,8 +278,8 @@ glow. Dialogs and menus receive stronger depth because they are floating
|
|
|
247
278
|
layers. Dark mode keeps the same hierarchy with low-chroma surfaces.
|
|
248
279
|
|
|
249
280
|
- **Control Shadow**: `0 1px 2px rgb(15 23 42 / 0.04), 0 0 0 1px rgb(15 23 42 / 0.02)`
|
|
250
|
-
- **Surface Shadow**: `0
|
|
251
|
-
- **Surface Hover Shadow**: `0 4px
|
|
281
|
+
- **Surface Shadow**: `0 1px 3px rgb(15 23 42 / 0.04), 0 4px 8px rgb(15 23 42 / 0.04)`
|
|
282
|
+
- **Surface Hover Shadow**: `0 2px 4px rgb(15 23 42 / 0.06), 0 6px 12px rgb(15 23 42 / 0.06)`
|
|
252
283
|
- **Overlay Shadow**: `0 20px 52px rgb(15 23 42 / 0.18), 0 6px 16px rgb(15 23 42 / 0.1)`
|
|
253
284
|
|
|
254
285
|
## Shapes
|
|
@@ -270,8 +301,10 @@ Transitions provide clear state confirmation without delaying user action:
|
|
|
270
301
|
|
|
271
302
|
- **Timing**: Micro-transitions use 150ms–200ms with `ease-out`; never use
|
|
272
303
|
`ease-in-out` for routine controls.
|
|
273
|
-
- **Feedback**:
|
|
274
|
-
on press.
|
|
304
|
+
- **Feedback**: Enabled buttons may lift by 2px on fine-pointer hover and
|
|
305
|
+
depress to `scale(0.98)` on press. Neither transform runs with reduced
|
|
306
|
+
motion. Interactive cards change border and shadow only, without moving.
|
|
307
|
+
Disabled controls never lift or depress.
|
|
275
308
|
- **Focus Rings**: Operable controls declare `:focus-visible` with a 2px solid
|
|
276
309
|
ring and a 2px offset.
|
|
277
310
|
- **Accessibility**: All transitions and keyframe animations collapse to 0.01ms
|
package/package.json
CHANGED
package/scaffold-manifest.json
CHANGED
|
@@ -13,22 +13,33 @@
|
|
|
13
13
|
"@svadmin/core": "^0.57.0",
|
|
14
14
|
"@svadmin/app": "^0.2.0",
|
|
15
15
|
"@svadmin/ai-elements": "^0.10.2",
|
|
16
|
-
"@svadmin/ui": "^0.
|
|
16
|
+
"@svadmin/ui": "^0.78.0",
|
|
17
17
|
"@sinclair/typebox": "^0.34.52",
|
|
18
18
|
"@tanstack/svelte-query": "^6.1.48",
|
|
19
19
|
"@lucide/svelte": "^1.35.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
+
"@types/node": "^22.0.0",
|
|
23
|
+
"esbuild": "^0.28.2",
|
|
22
24
|
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
23
25
|
"svelte": "^5.56.10",
|
|
24
26
|
"svelte-check": "^4.7.6",
|
|
25
27
|
"typescript": "~6.0.3",
|
|
26
28
|
"vite": "^8.2.2"
|
|
27
29
|
},
|
|
30
|
+
"overrides": {
|
|
31
|
+
"bits-ui": "2.19.0",
|
|
32
|
+
"@refinedev/core": "5.0.12"
|
|
33
|
+
},
|
|
34
|
+
"patchedDependencies": {
|
|
35
|
+
"bits-ui@2.19.0": "patches/bits-ui@2.19.0.patch",
|
|
36
|
+
"@refinedev/core@5.0.12": "patches/@refinedev%2Fcore@5.0.12.patch"
|
|
37
|
+
},
|
|
28
38
|
"svadmin": {
|
|
29
39
|
"dependencyPacks": {
|
|
30
40
|
"refine-core": {
|
|
31
|
-
"@refinedev/core": "^5.0.12"
|
|
41
|
+
"@refinedev/core": "^5.0.12",
|
|
42
|
+
"graphql": "^16.8.0"
|
|
32
43
|
},
|
|
33
44
|
"simple-rest": {
|
|
34
45
|
"@svadmin/simple-rest": "^0.12.1",
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
diff --git a/dist/hooks/useKeys/index.d.cts b/dist/hooks/useKeys/index.d.cts
|
|
2
|
+
index 84d443c471dbcf0d4206dd7130703eec3be0b19d..bb4574fcee52c3f0588a18f78ec5d8a0e2059bf5 100644
|
|
3
|
+
--- a/dist/hooks/useKeys/index.d.cts
|
|
4
|
+
+++ b/dist/hooks/useKeys/index.d.cts
|
|
5
|
+
@@ -1,4 +1,4 @@
|
|
6
|
+
export declare const useKeys: () => {
|
|
7
|
+
- keys: () => import("@definitions/index").KeyBuilder;
|
|
8
|
+
+ keys: () => import("../../definitions/index").KeyBuilder;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
11
|
+
diff --git a/dist/hooks/useKeys/index.d.mts b/dist/hooks/useKeys/index.d.mts
|
|
12
|
+
index 84d443c471dbcf0d4206dd7130703eec3be0b19d..bb4574fcee52c3f0588a18f78ec5d8a0e2059bf5 100644
|
|
13
|
+
--- a/dist/hooks/useKeys/index.d.mts
|
|
14
|
+
+++ b/dist/hooks/useKeys/index.d.mts
|
|
15
|
+
@@ -1,4 +1,4 @@
|
|
16
|
+
export declare const useKeys: () => {
|
|
17
|
+
- keys: () => import("@definitions/index").KeyBuilder;
|
|
18
|
+
+ keys: () => import("../../definitions/index").KeyBuilder;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
21
|
+
diff --git a/dist/hooks/useKeys/index.d.ts b/dist/hooks/useKeys/index.d.ts
|
|
22
|
+
index 84d443c471dbcf0d4206dd7130703eec3be0b19d..bb4574fcee52c3f0588a18f78ec5d8a0e2059bf5 100644
|
|
23
|
+
--- a/dist/hooks/useKeys/index.d.ts
|
|
24
|
+
+++ b/dist/hooks/useKeys/index.d.ts
|
|
25
|
+
@@ -1,4 +1,4 @@
|
|
26
|
+
export declare const useKeys: () => {
|
|
27
|
+
- keys: () => import("@definitions/index").KeyBuilder;
|
|
28
|
+
+ keys: () => import("../../definitions/index").KeyBuilder;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|