@archetypeai/ds-cli 0.3.11 → 0.3.13

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.
@@ -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) {
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archetypeai/ds-cli",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "description": "Archetype AI Design System CLI Tool",
5
5
  "type": "module",
6
6
  "bin": {