@shakil-dev/shakil-stack 2.0.0 ā 2.0.2
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/.github/workflows/publish.yml +14 -2
- package/bin/index.js +23 -1
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@ name: Publish to NPM
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
-
|
|
6
|
-
-
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
7
|
|
|
8
8
|
permissions:
|
|
9
9
|
contents: write
|
|
@@ -26,7 +26,19 @@ jobs:
|
|
|
26
26
|
- name: Install Dependencies
|
|
27
27
|
run: npm ci
|
|
28
28
|
|
|
29
|
+
- name: Set Git Identity
|
|
30
|
+
run: |
|
|
31
|
+
git config --global user.name "github-actions[bot]"
|
|
32
|
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
33
|
+
git add . # Ensure any changes like package-lock.json are staged
|
|
34
|
+
|
|
35
|
+
- name: Bump Version
|
|
36
|
+
run: npm version patch
|
|
37
|
+
|
|
29
38
|
- name: Publish to NPM
|
|
30
39
|
run: npm publish --access public
|
|
31
40
|
env:
|
|
32
41
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
42
|
+
|
|
43
|
+
- name: Push Version Change to GitHub
|
|
44
|
+
run: git push origin main --tags
|
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,22 @@ 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
|
+
console.log(chalk.green('ā
shadcn/ui initialized successfully!āØ'));
|
|
119
|
+
} catch (err) {
|
|
120
|
+
console.log(chalk.yellow('\nā ļø Warning: Failed to automate shadcn/ui init. You can run "npx shadcn@latest init" in the frontend folder.'));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
102
124
|
spinner.start(`š Finalizing root files and backend code...`);
|
|
103
125
|
|
|
104
126
|
// Root Files
|