@ardly/bunext 1.0.1 → 1.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.
Files changed (2) hide show
  1. package/bin/cli.mjs +65 -41
  2. package/package.json +13 -1
package/bin/cli.mjs CHANGED
@@ -13,55 +13,79 @@ const runCommand = (command) => {
13
13
  return true
14
14
  }
15
15
 
16
- const repoName = process.argv[2]
17
- const gitCheckout = `git clone --depth 1 https://github.com/DarkidOP/Bunext.git ${repoName}`
18
- const installDeps = `cd ${repoName} && bun install`
19
- const removeGit = `rm -rf .git`
20
- const initGit = `git init && git add . && git commit -m "Initial commit"`
21
-
22
16
  const rl = readline.createInterface({
23
17
  input: process.stdin,
24
18
  output: process.stdout,
25
19
  })
26
20
 
27
- console.log(`Creating project template in ./${repoName}`)
28
- const checkedOut = runCommand(gitCheckout)
29
- if (!checkedOut) {
30
- console.error(
31
- 'Failed to clone template repository "https://github.com/DarkidOP/Bunext.git"'
32
- )
33
- process.exit(1)
34
- }
21
+ let repoName = process.argv[2]
22
+ const args = process.argv.slice(2)
23
+ const useVSCode = args.includes('--vs')
24
+ const useCursor = args.includes('--cursor')
35
25
 
36
- console.log('Removing Git history...')
37
- const removedGit = runCommand(removeGit)
38
- if (!removedGit) {
39
- console.error('Failed to remove Git history')
40
- process.exit(1)
26
+ if (!repoName || repoName.startsWith('--')) {
27
+ rl.question('Please enter a name for your project: ', (answer) => {
28
+ repoName = answer
29
+ initializeProject()
30
+ })
31
+ } else {
32
+ initializeProject()
41
33
  }
42
34
 
43
- console.log('Installing dependencies...')
44
- const installedDeps = runCommand(installDeps)
45
- if (!installedDeps) {
46
- console.error('Failed to install dependencies')
47
- process.exit(1)
48
- }
35
+ function initializeProject() {
36
+ const gitCheckout = `git clone --depth 1 https://github.com/DarkidOP/Bunext.git ${repoName}`
37
+ const installDeps = `cd ${repoName} && bun install`
38
+ const removeGit = `cd ${repoName} && rm -rf .git`
39
+ const initGit = `cd ${repoName} && git init && git add . && git commit -m "Initial commit"`
40
+ const openVSCode = `cd ${repoName} && code .`
41
+ const openCursor = `cd ${repoName} && cursor .`
49
42
 
50
- // Add Git initialization prompt
51
- rl.question(
52
- 'Would you like to initialize a new git repository? (y/n) ',
53
- (answer) => {
54
- if (answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes') {
55
- console.log('Initializing Git repository...')
56
- const initializedGit = runCommand(initGit)
57
- if (!initializedGit) {
58
- console.error('Failed to initialize Git repository')
59
- process.exit(1)
60
- }
61
- console.log('Git repository initialized successfully!')
62
- }
43
+ console.log(`Creating project template in ./${repoName}`)
44
+ const checkedOut = runCommand(gitCheckout)
45
+ if (!checkedOut) {
46
+ console.error(
47
+ 'Failed to clone template repository "https://github.com/DarkidOP/Bunext.git"'
48
+ )
49
+ process.exit(1)
50
+ }
51
+
52
+ console.log('Removing Git history...')
53
+ const removedGit = runCommand(removeGit)
54
+ if (!removedGit) {
55
+ console.error('Failed to remove Git history')
56
+ process.exit(1)
57
+ }
63
58
 
64
- console.log('\nHappy coding! 🎉')
65
- rl.close()
59
+ console.log('Installing dependencies...')
60
+ const installedDeps = runCommand(installDeps)
61
+ if (!installedDeps) {
62
+ console.error('Failed to install dependencies')
63
+ process.exit(1)
66
64
  }
67
- )
65
+
66
+ rl.question(
67
+ 'Would you like to initialize a new git repository? (y/n) ',
68
+ (answer) => {
69
+ if (answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes') {
70
+ console.log('Initializing Git repository...')
71
+ const initializedGit = runCommand(initGit)
72
+ if (!initializedGit) {
73
+ console.error('Failed to initialize Git repository')
74
+ process.exit(1)
75
+ }
76
+ console.log('Git repository initialized successfully!')
77
+ }
78
+
79
+ if (useVSCode) {
80
+ console.log('Opening in Visual Studio Code...')
81
+ runCommand(openVSCode)
82
+ } else if (useCursor) {
83
+ console.log('Opening in Cursor...')
84
+ runCommand(openCursor)
85
+ }
86
+
87
+ console.log('\nHappy coding! 🎉')
88
+ rl.close()
89
+ }
90
+ )
91
+ }
package/package.json CHANGED
@@ -2,8 +2,18 @@
2
2
  "name": "@ardly/bunext",
3
3
  "description": "Bunext - A Next.js 15 template with Tailwind CSS, shadcn ui and Bun with some utilities built in",
4
4
  "author": "Ard Astroid <ardastroid@gmail.com>",
5
- "version": "1.0.1",
5
+ "version": "1.0.3",
6
6
  "bin": "./bin/cli.mjs",
7
+ "keywords": [
8
+ "next.js",
9
+ "react",
10
+ "typescript",
11
+ "tailwindcss",
12
+ "shadcn-ui",
13
+ "bun",
14
+ "template",
15
+ "starter"
16
+ ],
7
17
  "scripts": {
8
18
  "dev": "next dev --turbopack",
9
19
  "build": "next build",
@@ -53,6 +63,8 @@
53
63
  "typescript": "^5.7.2"
54
64
  },
55
65
  "overrides": {
66
+ "react": "19.0.0",
67
+ "react-dom": "19.0.0",
56
68
  "@types/react": "19.0.1",
57
69
  "@types/react-dom": "19.0.2"
58
70
  }