@shakil-dev/shakil-stack 2.0.1 ā 2.0.3
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/bin/index.js +31 -1
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -44,6 +44,12 @@ const initProject = async (name) => {
|
|
|
44
44
|
choices: ['pnpm', 'npm', 'yarn'],
|
|
45
45
|
default: 'pnpm',
|
|
46
46
|
},
|
|
47
|
+
{
|
|
48
|
+
type: 'confirm',
|
|
49
|
+
name: 'useShadcn',
|
|
50
|
+
message: 'Would you like to use shadcn/ui for components?',
|
|
51
|
+
default: true,
|
|
52
|
+
},
|
|
47
53
|
{
|
|
48
54
|
type: 'confirm',
|
|
49
55
|
name: 'installDeps',
|
|
@@ -52,7 +58,7 @@ const initProject = async (name) => {
|
|
|
52
58
|
},
|
|
53
59
|
]);
|
|
54
60
|
|
|
55
|
-
const { projectName, packageManager, installDeps } = answers;
|
|
61
|
+
const { projectName, packageManager, installDeps, useShadcn } = answers;
|
|
56
62
|
const projectPath = path.resolve(process.cwd(), projectName);
|
|
57
63
|
|
|
58
64
|
if (fs.existsSync(projectPath)) {
|
|
@@ -99,6 +105,30 @@ const initProject = async (name) => {
|
|
|
99
105
|
await fs.ensureDir(path.join(projectPath, 'frontend', 'src', folder));
|
|
100
106
|
}
|
|
101
107
|
|
|
108
|
+
// Shadcn/UI initialization
|
|
109
|
+
if (useShadcn) {
|
|
110
|
+
console.log(chalk.cyan('\nšØ Setting up shadcn/ui...'));
|
|
111
|
+
try {
|
|
112
|
+
// Using non-interactive init with default settings
|
|
113
|
+
// -d flag uses default options: TypeScript, Tailwind, Lucide Icons, Slate color, css variables
|
|
114
|
+
execSync(`npx shadcn@latest init -d`, {
|
|
115
|
+
cwd: path.join(projectPath, 'frontend'),
|
|
116
|
+
stdio: 'inherit'
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
console.log(chalk.cyan('š¦ Adding common shadcn/ui components...'));
|
|
120
|
+
const commonComponents = ['button', 'card', 'input', 'label', 'textarea', 'dialog', 'dropdown-menu', 'table', 'tabs', 'checkbox'];
|
|
121
|
+
execSync(`npx shadcn@latest add ${commonComponents.join(' ')} -y`, {
|
|
122
|
+
cwd: path.join(projectPath, 'frontend'),
|
|
123
|
+
stdio: 'inherit'
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
console.log(chalk.green('ā
shadcn/ui and common components initialized successfully!āØ'));
|
|
127
|
+
} catch (err) {
|
|
128
|
+
console.log(chalk.yellow('\nā ļø Warning: Failed to automate shadcn/ui init. You can run "npx shadcn@latest init" in the frontend folder.'));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
102
132
|
spinner.start(`š Finalizing root files and backend code...`);
|
|
103
133
|
|
|
104
134
|
// Root Files
|