@archetypeai/ds-cli 0.3.27 → 0.3.32
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
package/commands/init.js
CHANGED
package/lib/add-ds-lib-tokens.js
CHANGED
package/lib/add-ds-ui-svelte.js
CHANGED
|
@@ -192,7 +192,7 @@ export async function addDsUiSvelte(args) {
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
// configure CSS imports in layout.css
|
|
195
|
-
prependCss(projectDir
|
|
195
|
+
prependCss(projectDir);
|
|
196
196
|
|
|
197
197
|
const installSpinner = p.spinner();
|
|
198
198
|
installSpinner.start('Installing components');
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { existsSync, readdirSync, copyFileSync, mkdirSync } from 'fs';
|
|
2
2
|
import { join, resolve } from 'path';
|
|
3
3
|
|
|
4
|
+
// strip surrounding quotes that some terminals (VS Code, Cursor) add on drag-and-drop
|
|
5
|
+
function sanitizePath(p) {
|
|
6
|
+
const trimmed = p.trim();
|
|
7
|
+
if (
|
|
8
|
+
(trimmed.startsWith("'") && trimmed.endsWith("'")) ||
|
|
9
|
+
(trimmed.startsWith('"') && trimmed.endsWith('"'))
|
|
10
|
+
) {
|
|
11
|
+
return trimmed.slice(1, -1);
|
|
12
|
+
}
|
|
13
|
+
return trimmed;
|
|
14
|
+
}
|
|
15
|
+
|
|
4
16
|
// all 15 required font files
|
|
5
17
|
export const REQUIRED_FONTS = [
|
|
6
18
|
// PP Neue Montreal Sans (.ttf)
|
|
@@ -24,7 +36,7 @@ export const REQUIRED_FONTS = [
|
|
|
24
36
|
|
|
25
37
|
// validate that a directory contains all required font files
|
|
26
38
|
export function validateFontsPath(fontsPath) {
|
|
27
|
-
const resolved = resolve(fontsPath);
|
|
39
|
+
const resolved = resolve(sanitizePath(fontsPath));
|
|
28
40
|
|
|
29
41
|
if (!existsSync(resolved)) {
|
|
30
42
|
return { valid: false, missing: REQUIRED_FONTS, error: `Path does not exist: ${resolved}` };
|
|
@@ -51,7 +63,7 @@ export function validateFontsPath(fontsPath) {
|
|
|
51
63
|
|
|
52
64
|
// copy required font files to <project>/static/fonts/
|
|
53
65
|
export function copyFontsToStatic(fontsPath, projectPath) {
|
|
54
|
-
const src = resolve(fontsPath);
|
|
66
|
+
const src = resolve(sanitizePath(fontsPath));
|
|
55
67
|
const dest = join(projectPath, 'static', 'fonts');
|
|
56
68
|
mkdirSync(dest, { recursive: true });
|
|
57
69
|
|
|
@@ -143,11 +143,9 @@ export function cn(...inputs) {
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
// configure CSS
|
|
146
|
-
export function configureCss(projectPath
|
|
146
|
+
export function configureCss(projectPath) {
|
|
147
147
|
let css = '';
|
|
148
|
-
|
|
149
|
-
css += '@import "@archetypeai/ds-lib-tokens/fonts.css";\n';
|
|
150
|
-
}
|
|
148
|
+
css += '@import "@archetypeai/ds-lib-tokens/fonts.css";\n';
|
|
151
149
|
css += '@import "@archetypeai/ds-lib-tokens/theme.css";\n';
|
|
152
150
|
css += '@import "tailwindcss";\n';
|
|
153
151
|
css += '@import "tw-animate-css";\n';
|
|
@@ -175,7 +173,7 @@ export async function installTailwind(pm, projectPath) {
|
|
|
175
173
|
}
|
|
176
174
|
|
|
177
175
|
// prepend CSS imports to existing layout.css
|
|
178
|
-
export function prependCss(projectPath
|
|
176
|
+
export function prependCss(projectPath) {
|
|
179
177
|
const cssPath = join(projectPath, 'src/routes/layout.css');
|
|
180
178
|
|
|
181
179
|
let existing = '';
|
|
@@ -190,9 +188,7 @@ export function prependCss(projectPath, includeFonts) {
|
|
|
190
188
|
}
|
|
191
189
|
|
|
192
190
|
let imports = '';
|
|
193
|
-
|
|
194
|
-
imports += '@import "@archetypeai/ds-lib-tokens/fonts.css";\n';
|
|
195
|
-
}
|
|
191
|
+
imports += '@import "@archetypeai/ds-lib-tokens/fonts.css";\n';
|
|
196
192
|
imports += '@import "@archetypeai/ds-lib-tokens/theme.css";\n';
|
|
197
193
|
imports += '@import "tailwindcss";\n';
|
|
198
194
|
imports += '@import "tw-animate-css";\n';
|