@archetypeai/ds-cli 0.3.7 → 0.3.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 +25 -67
- package/commands/create.js +5 -27
- package/commands/init.js +5 -27
- package/files/AGENTS.md +19 -3
- package/files/CLAUDE.md +21 -3
- package/files/rules/accessibility.md +49 -0
- package/files/rules/frontend-architecture.md +77 -0
- package/files/skills/apply-ds/SKILL.md +92 -80
- package/files/skills/apply-ds/scripts/audit.sh +169 -0
- package/files/skills/apply-ds/scripts/setup.sh +48 -166
- package/files/skills/create-dashboard/SKILL.md +12 -0
- package/files/skills/embedding-from-file/SKILL.md +415 -0
- package/files/skills/embedding-from-sensor/SKILL.md +406 -0
- package/files/skills/embedding-upload/SKILL.md +414 -0
- package/files/skills/fix-accessibility/SKILL.md +57 -9
- package/files/skills/newton-activity-monitor-lens-on-video/SKILL.md +817 -0
- package/files/skills/newton-camera-frame-analysis/SKILL.md +611 -0
- package/files/skills/newton-camera-frame-analysis/scripts/activity-monitor-frame.py +165 -0
- package/files/skills/newton-camera-frame-analysis/scripts/captures/logs/api_responses_20260206_105610.json +62 -0
- package/files/skills/newton-camera-frame-analysis/scripts/continuous_monitor.py +119 -0
- package/files/skills/newton-direct-query/SKILL.md +212 -0
- package/files/skills/newton-direct-query/scripts/direct_query.py +129 -0
- package/files/skills/newton-machine-state-from-file/SKILL.md +545 -0
- package/files/skills/newton-machine-state-from-sensor/SKILL.md +707 -0
- package/files/skills/newton-machine-state-upload/SKILL.md +986 -0
- package/lib/add-ds-ui-svelte.js +5 -2
- package/lib/scaffold-ds-svelte-project.js +25 -18
- package/package.json +13 -2
package/lib/add-ds-ui-svelte.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { execFile } from 'child_process';
|
|
2
|
+
import { promisify } from 'util';
|
|
2
3
|
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
|
3
4
|
import { join, dirname } from 'path';
|
|
4
5
|
import { fileURLToPath } from 'url';
|
|
@@ -6,6 +7,8 @@ import * as p from '@clack/prompts';
|
|
|
6
7
|
import { validateRegistryUrl } from './validate-url.js';
|
|
7
8
|
import { detectPm, getPm } from './use-package-manager.js';
|
|
8
9
|
|
|
10
|
+
const execFileAsync = promisify(execFile);
|
|
11
|
+
|
|
9
12
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
13
|
const REGISTRY_URL = process.env.REGISTRY_URL || 'https://design-system.archetypeai.workers.dev';
|
|
11
14
|
const ALL_COMPONENTS_URL = `${REGISTRY_URL}/r/all.json`;
|
|
@@ -53,7 +56,7 @@ export async function addDsUiSvelte() {
|
|
|
53
56
|
installSpinner.start('Installing components');
|
|
54
57
|
|
|
55
58
|
const [dlxCmd, ...dlxArgs] = pm.dlx.split(/\s+/);
|
|
56
|
-
|
|
59
|
+
await execFileAsync(
|
|
57
60
|
dlxCmd,
|
|
58
61
|
[...dlxArgs, 'shadcn-svelte@latest', 'add', ...componentUrls, '--yes', '--overwrite'],
|
|
59
62
|
{ stdio: 'pipe', cwd: projectDir }
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { execFile } from 'child_process';
|
|
2
|
+
import { promisify } from 'util';
|
|
2
3
|
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
3
4
|
import { join } from 'path';
|
|
4
5
|
import * as p from '@clack/prompts';
|
|
5
6
|
import { setupCursor, setupClaude } from './add-ds-config-codeagent.js';
|
|
6
7
|
|
|
8
|
+
const execFileAsync = promisify(execFile);
|
|
9
|
+
|
|
7
10
|
// run a command without a shell to prevent injection
|
|
8
|
-
function run(command, args, opts) {
|
|
9
|
-
|
|
11
|
+
async function run(command, args, opts) {
|
|
12
|
+
await execFileAsync(command, args, { stdio: 'pipe', ...opts });
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
// write a file
|
|
@@ -24,7 +27,7 @@ function splitCmd(cmdString) {
|
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
// run sveltekit create
|
|
27
|
-
export function runSvCreate(pm, name, targetDir) {
|
|
30
|
+
export async function runSvCreate(pm, name, targetDir) {
|
|
28
31
|
const [cmd, ...baseArgs] = splitCmd(pm.dlx);
|
|
29
32
|
const args = [
|
|
30
33
|
...baseArgs,
|
|
@@ -41,7 +44,7 @@ export function runSvCreate(pm, name, targetDir) {
|
|
|
41
44
|
const s = p.spinner();
|
|
42
45
|
s.start('Creating SvelteKit project');
|
|
43
46
|
try {
|
|
44
|
-
run(cmd, args, { cwd: targetDir });
|
|
47
|
+
await run(cmd, args, { cwd: targetDir });
|
|
45
48
|
s.stop('SvelteKit project created');
|
|
46
49
|
return true;
|
|
47
50
|
} catch (error) {
|
|
@@ -52,13 +55,13 @@ export function runSvCreate(pm, name, targetDir) {
|
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
// install design tokens
|
|
55
|
-
export function installTokens(pm, projectPath) {
|
|
58
|
+
export async function installTokens(pm, projectPath) {
|
|
56
59
|
const [cmd, ...baseArgs] = splitCmd(pm.install);
|
|
57
60
|
const args = [...baseArgs, '@archetypeai/ds-lib-tokens'];
|
|
58
61
|
const s = p.spinner();
|
|
59
62
|
s.start('Installing design tokens');
|
|
60
63
|
try {
|
|
61
|
-
run(cmd, args, { cwd: projectPath });
|
|
64
|
+
await run(cmd, args, { cwd: projectPath });
|
|
62
65
|
s.stop('Design tokens installed');
|
|
63
66
|
return true;
|
|
64
67
|
} catch (error) {
|
|
@@ -69,13 +72,13 @@ export function installTokens(pm, projectPath) {
|
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
// install internal fonts package
|
|
72
|
-
export function installFonts(pm, projectPath) {
|
|
75
|
+
export async function installFonts(pm, projectPath) {
|
|
73
76
|
const [cmd, ...baseArgs] = splitCmd(pm.install);
|
|
74
77
|
const args = [...baseArgs, '@archetypeai/ds-lib-fonts-internal'];
|
|
75
78
|
const s = p.spinner();
|
|
76
79
|
s.start('Installing internal fonts');
|
|
77
80
|
try {
|
|
78
|
-
run(cmd, args, { cwd: projectPath });
|
|
81
|
+
await run(cmd, args, { cwd: projectPath });
|
|
79
82
|
s.stop('Internal fonts installed');
|
|
80
83
|
return true;
|
|
81
84
|
} catch {
|
|
@@ -86,7 +89,7 @@ export function installFonts(pm, projectPath) {
|
|
|
86
89
|
}
|
|
87
90
|
|
|
88
91
|
// init shadcn-svelte
|
|
89
|
-
export function initShadcn(pm, projectPath) {
|
|
92
|
+
export async function initShadcn(pm, projectPath) {
|
|
90
93
|
const s = p.spinner();
|
|
91
94
|
s.start('Setting up shadcn-svelte');
|
|
92
95
|
try {
|
|
@@ -131,7 +134,7 @@ export function cn(...inputs) {
|
|
|
131
134
|
}
|
|
132
135
|
|
|
133
136
|
const [cmd, ...baseArgs] = splitCmd(pm.install);
|
|
134
|
-
run(cmd, [...baseArgs, 'clsx', 'tailwind-merge', 'tw-animate-css'], { cwd: projectPath });
|
|
137
|
+
await run(cmd, [...baseArgs, 'clsx', 'tailwind-merge', 'tw-animate-css'], { cwd: projectPath });
|
|
135
138
|
|
|
136
139
|
s.stop('shadcn-svelte ready');
|
|
137
140
|
return true;
|
|
@@ -158,13 +161,13 @@ export function configureCss(projectPath, includeFonts) {
|
|
|
158
161
|
}
|
|
159
162
|
|
|
160
163
|
// install Tailwind CSS v4
|
|
161
|
-
export function installTailwind(pm, projectPath) {
|
|
164
|
+
export async function installTailwind(pm, projectPath) {
|
|
162
165
|
const [cmd, ...baseArgs] = splitCmd(pm.install);
|
|
163
166
|
const args = [...baseArgs, 'tailwindcss@latest'];
|
|
164
167
|
const s = p.spinner();
|
|
165
168
|
s.start('Installing Tailwind CSS v4');
|
|
166
169
|
try {
|
|
167
|
-
run(cmd, args, { cwd: projectPath });
|
|
170
|
+
await run(cmd, args, { cwd: projectPath });
|
|
168
171
|
s.stop('Tailwind CSS installed');
|
|
169
172
|
return true;
|
|
170
173
|
} catch (error) {
|
|
@@ -206,18 +209,22 @@ export function prependCss(projectPath, includeFonts) {
|
|
|
206
209
|
}
|
|
207
210
|
|
|
208
211
|
// install components from shadcn-svelte registry
|
|
209
|
-
export function installComponents(pm, projectPath, componentUrls) {
|
|
212
|
+
export async function installComponents(pm, projectPath, componentUrls) {
|
|
210
213
|
const s = p.spinner();
|
|
211
214
|
s.start(`Installing ${componentUrls.length} components`);
|
|
212
215
|
try {
|
|
213
216
|
const urls = componentUrls.map((c) => c.url);
|
|
214
217
|
const [dlxCmd, ...dlxArgs] = splitCmd(pm.dlx);
|
|
215
|
-
run(
|
|
216
|
-
|
|
217
|
-
|
|
218
|
+
await run(
|
|
219
|
+
dlxCmd,
|
|
220
|
+
[...dlxArgs, 'shadcn-svelte@latest', 'add', ...urls, '--yes', '--overwrite'],
|
|
221
|
+
{
|
|
222
|
+
cwd: projectPath
|
|
223
|
+
}
|
|
224
|
+
);
|
|
218
225
|
|
|
219
226
|
const [installCmd, ...installArgs] = splitCmd(pm.install);
|
|
220
|
-
run(
|
|
227
|
+
await run(
|
|
221
228
|
installCmd,
|
|
222
229
|
[...installArgs, 'tailwind-variants', 'bits-ui', '@lucide/svelte', 'layerchart', 'paneforge'],
|
|
223
230
|
{ cwd: projectPath }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archetypeai/ds-cli",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Archetype AI Design System CLI",
|
|
3
|
+
"version": "0.3.10",
|
|
4
|
+
"description": "Archetype AI Design System CLI Tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"ds": "./bin.js"
|
|
@@ -30,5 +30,16 @@
|
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"registry": "https://registry.npmjs.org"
|
|
32
32
|
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"design-system",
|
|
35
|
+
"cli",
|
|
36
|
+
"sveltekit",
|
|
37
|
+
"tailwindcss",
|
|
38
|
+
"shadcn-svelte",
|
|
39
|
+
"scaffolding",
|
|
40
|
+
"components",
|
|
41
|
+
"archetypeai",
|
|
42
|
+
"physicalai"
|
|
43
|
+
],
|
|
33
44
|
"license": "MIT"
|
|
34
45
|
}
|