@archetypeai/ds-cli 0.3.12 → 0.3.14
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/commands/create.js
CHANGED
|
@@ -5,6 +5,7 @@ import { getPm, pmNames, isPmInstalled } from '../lib/use-package-manager.js';
|
|
|
5
5
|
import { fetchComponents } from '../lib/use-shadcn-svelte-registry.js';
|
|
6
6
|
import {
|
|
7
7
|
runSvCreate,
|
|
8
|
+
patchSvelteConfig,
|
|
8
9
|
installTokens,
|
|
9
10
|
initShadcn,
|
|
10
11
|
configureCss,
|
|
@@ -164,6 +165,9 @@ export async function create(args) {
|
|
|
164
165
|
process.exit(1);
|
|
165
166
|
}
|
|
166
167
|
|
|
168
|
+
// remove dynamicCompileOptions that breaks runes in node_modules
|
|
169
|
+
patchSvelteConfig(projectPath);
|
|
170
|
+
|
|
167
171
|
// install packages
|
|
168
172
|
const tokensOk = await installTokens(pm, projectPath);
|
|
169
173
|
if (!tokensOk) {
|
package/commands/init.js
CHANGED
|
@@ -5,6 +5,7 @@ import { getPm, pmNames, isPmInstalled, detectPm } from '../lib/use-package-mana
|
|
|
5
5
|
import { fetchComponents } from '../lib/use-shadcn-svelte-registry.js';
|
|
6
6
|
import {
|
|
7
7
|
installTailwind,
|
|
8
|
+
patchSvelteConfig,
|
|
8
9
|
installTokens,
|
|
9
10
|
initShadcn,
|
|
10
11
|
prependCss,
|
|
@@ -78,6 +79,9 @@ export async function init(args) {
|
|
|
78
79
|
p.log.warn('No svelte.config found. This command is designed for SvelteKit projects.');
|
|
79
80
|
}
|
|
80
81
|
|
|
82
|
+
// remove dynamicCompileOptions that breaks runes in node_modules
|
|
83
|
+
patchSvelteConfig(projectPath);
|
|
84
|
+
|
|
81
85
|
// detect package manager
|
|
82
86
|
let pmName = flags.pm;
|
|
83
87
|
if (!pmName) {
|
|
@@ -38,7 +38,7 @@ Unless the user explicitly asks for a different layout:
|
|
|
38
38
|
|
|
39
39
|
## Menubar
|
|
40
40
|
|
|
41
|
-
Use the `Menubar` pattern. It renders a branded `<header>` with the Archetype AI Logo on the left and a partner logo placeholder. Pass action content as children.
|
|
41
|
+
Use the `Menubar` pattern. It renders a branded `<header>` with the Archetype AI Logo on the left and a partner logo placeholder. Pass action content as children. The Menubar includes a built-in dark mode toggle on the far right that detects system preference and defaults to dark. To disable it, pass `darkToggle={false}`.
|
|
42
42
|
|
|
43
43
|
**Every dashboard Menubar must include a "Send Report" button.** Additional actions can be appended alongside it.
|
|
44
44
|
|
|
@@ -54,6 +54,23 @@ export async function runSvCreate(pm, name, targetDir) {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
// remove dynamicCompileOptions from svelte.config.js
|
|
58
|
+
// sv create generates a block that disables runes for node_modules,
|
|
59
|
+
// which breaks third-party Svelte 5 packages using $props() (e.g. @lucide/svelte)
|
|
60
|
+
export function patchSvelteConfig(projectPath) {
|
|
61
|
+
const configPath = join(projectPath, 'svelte.config.js');
|
|
62
|
+
if (!existsSync(configPath)) return;
|
|
63
|
+
|
|
64
|
+
let content = readFileSync(configPath, 'utf-8');
|
|
65
|
+
const patched = content.replace(
|
|
66
|
+
/,?\s*vitePlugin:\s*\{[\s\S]*?dynamicCompileOptions[\s\S]*?\n\t\}/,
|
|
67
|
+
''
|
|
68
|
+
);
|
|
69
|
+
if (patched !== content) {
|
|
70
|
+
writeFileSync(configPath, patched);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
57
74
|
// install design tokens
|
|
58
75
|
export async function installTokens(pm, projectPath) {
|
|
59
76
|
const [cmd, ...baseArgs] = splitCmd(pm.install);
|