@astralkit/cli 3.0.0 → 3.0.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/package.json +1 -1
- package/src/commands/init.js +6 -22
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -44,30 +44,13 @@ async function initCommand(options) {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
//
|
|
47
|
+
// Auto-detect framework silently — no prompt needed during init.
|
|
48
|
+
// Framework selection happens during `add` if auto-detection is wrong.
|
|
48
49
|
let framework = options.framework;
|
|
49
50
|
if (!framework) {
|
|
50
|
-
|
|
51
|
-
console.log(chalk.gray(`Detected framework: ${detected}`));
|
|
52
|
-
|
|
53
|
-
const { confirmed } = await inquirer.prompt([{
|
|
54
|
-
type: 'list',
|
|
55
|
-
name: 'confirmed',
|
|
56
|
-
message: 'Which framework are you using?',
|
|
57
|
-
choices: [
|
|
58
|
-
{ name: `${detected} (detected)`, value: detected },
|
|
59
|
-
{ name: 'HTML + Tailwind', value: 'html' },
|
|
60
|
-
{ name: 'React', value: 'react' },
|
|
61
|
-
{ name: 'Next.js', value: 'nextjs' },
|
|
62
|
-
].filter((c, i) => {
|
|
63
|
-
// Remove duplicate if detected matches a named option
|
|
64
|
-
if (i === 0) return true;
|
|
65
|
-
return c.value !== detected;
|
|
66
|
-
}),
|
|
67
|
-
default: detected,
|
|
68
|
-
}]);
|
|
69
|
-
framework = confirmed;
|
|
51
|
+
framework = detectFramework();
|
|
70
52
|
}
|
|
53
|
+
console.log(chalk.gray(` Framework: ${framework}`));
|
|
71
54
|
|
|
72
55
|
// Component directory
|
|
73
56
|
const componentDir = options.dir || 'src/components/ui';
|
|
@@ -75,7 +58,8 @@ async function initCommand(options) {
|
|
|
75
58
|
// ─── Step 1: Install astralkit design token package ─────
|
|
76
59
|
// Fetched from AstralKit API (not npm) to keep tokens private.
|
|
77
60
|
// Written to node_modules/astralkit/ so imports resolve normally.
|
|
78
|
-
|
|
61
|
+
// ALL frameworks need this — HTML uses @import "astralkit/theme", React/Next.js use import { cn }.
|
|
62
|
+
{
|
|
79
63
|
if (!isAstralkitInstalled()) {
|
|
80
64
|
const spinner = ora('Installing astralkit design tokens...').start();
|
|
81
65
|
try {
|