@ardly/bunext 1.0.8 → 2.0.0

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 (4) hide show
  1. package/package.json +43 -25
  2. package/wrapper.js +8 -0
  3. package/README.md +0 -166
  4. package/cli.mjs +0 -126
package/package.json CHANGED
@@ -1,27 +1,45 @@
1
1
  {
2
- "name": "@ardly/bunext",
3
- "description": "CLI tool to create Next.js projects using the Bunext template",
4
- "author": "Ard Astroid <ardastroid@gmail.com>",
5
- "version": "1.0.8",
6
- "bin": {
7
- "create-bunext": "./cli.mjs"
8
- },
9
- "type": "module",
10
- "files": [
11
- "cli.mjs"
12
- ],
13
- "main": "cli.mjs",
14
- "engines": {
15
- "node": ">=20.0.0"
16
- },
17
- "keywords": [
18
- "next.js",
19
- "react",
20
- "typescript",
21
- "tailwindcss",
22
- "shadcn-ui",
23
- "bun",
24
- "template",
25
- "starter"
26
- ]
2
+ "name": "@ardly/bunext",
3
+ "description": "CLI tool to create Next.js 16 project using Bunext template (wrapper for create-bunext)",
4
+ "author": "Ard Astroid <ardastroid@gmail.com>",
5
+ "version": "2.0.0",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/ardzero/bunext.git",
10
+ "directory": "packages/bunext-wrapper"
11
+ },
12
+ "homepage": "https://bunext.ardastroid.com",
13
+ "bugs": {
14
+ "url": "https://github.com/ardzero/bunext/issues"
15
+ },
16
+ "bin": {
17
+ "bunext": "wrapper.js"
18
+ },
19
+ "type": "module",
20
+ "files": [
21
+ "wrapper.js",
22
+ "README.md"
23
+ ],
24
+ "main": "./wrapper.js",
25
+ "engines": {
26
+ "node": ">=20.0.0"
27
+ },
28
+ "keywords": [
29
+ "next.js",
30
+ "nextjs16",
31
+ "react",
32
+ "typescript",
33
+ "tailwindcss",
34
+ "shadcn-ui",
35
+ "bun",
36
+ "template",
37
+ "starter",
38
+ "cli",
39
+ "create-app",
40
+ "boilerplate"
41
+ ],
42
+ "dependencies": {
43
+ "create-bunext": "^0.1.0"
44
+ }
27
45
  }
package/wrapper.js ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from "module";
3
+ import { pathToFileURL } from "url";
4
+
5
+ const require = createRequire(import.meta.url);
6
+ const cliPath = require.resolve("create-bunext/dist/cli.js");
7
+
8
+ await import(pathToFileURL(cliPath).href);
package/README.md DELETED
@@ -1,166 +0,0 @@
1
- # Bunext
2
-
3
- A Next.js 15 app with Tailwind CSS template. [Live deployment](https://bunext.ardastroid.com/)
4
- Repo: [Github Repo](https://github.com/DarkidOP/Bunext)
5
-
6
- ### to create a bootstrap project
7
-
8
- ```bash
9
- bunx @ardly/bunext@1.0.8 my-project
10
- ```
11
-
12
- or
13
-
14
- ```bash
15
- bunx @ardly/bunext@latest my-project
16
- ```
17
-
18
- ```bash
19
- npx @ardly/bunext@1.0.8 my-project
20
- ```
21
-
22
- you can specify `-vs` or `--cursor` flags to auto open the project in vscode or cursor respectively after installation.
23
-
24
- ## Usage (run locally)
25
-
26
- > required `bun` or `nodejs` installed and make sure they're up to date
27
-
28
- Go to the `root` folder where `package.json` exists.
29
-
30
- ```bash
31
- bun install
32
- ```
33
-
34
- ```bash
35
- npm install
36
- ```
37
-
38
- ### Then
39
-
40
- ```bash
41
- bun --bun run dev
42
- ```
43
-
44
- ```bash
45
- bun run dev
46
- ```
47
-
48
- ```bash
49
- npm run dev
50
- ```
51
-
52
- ## Features
53
-
54
- - Next.js 15 App Directory
55
- - Tailwind CSS
56
- - [Shadcn](https://ui.shadcn.com/) components
57
- - Custom util components like `share modal, multi-select(no library), Img, Icons, etc`
58
- - CustomFont Optimization using [Next font](https://nextjs.org/docs/pages/building-your-application/optimizing/fonts)
59
- - Icons using [lucide-react](https://lucide.dev/)
60
- - Next theme provider (dark and light mode)
61
- - Url stage management using [nuqs](https://nuqs.47ng.com/)
62
- - Tailwind css only animations using [tailwindcss-motion](https://docs.rombo.co/tailwind)
63
- - Feature flags
64
- - Metadata generator for SEO (including apple-touch-icon)
65
- - [zod](https://zod.dev/) validation
66
- - Per Link page transition (without any library)
67
- - Custom Image components with lazy loading and auto generated placeholder (worsk with or without `next/image`)
68
- - [Prettier](https://prettier.io/) for formatting with tailwind plugin configured
69
- - [Fluid Tailwind](https://fluid.tw/) for easier responsive design (disabled by default, to enable go to `tailwind.config.ts` and uncomment the fluid plugin variables, Note: the `min-*` and `max-*` variants don't work while using fluid-tailwind)
70
- - Utilities like `qrCode gen, string shortner, uniqueCode gen, img placeholder, email validation, hashing etc`
71
-
72
- ## Config
73
-
74
- - for generating colors use [realtime-colors](https://www.realtimecolors.com/) shadcn template and pase it on `src/styles/globals.css`
75
- - add fonts on `src/styles/tailwind/fonts.ts`
76
- - to configure feature flags got to `src/lib/config/featureflags.ts`
77
- - to configure Metadata got to `src/lib/data/siteData.ts`
78
- - advance Metadata config in `src/lib/config/siteConfig.ts`
79
- - for base styles (scrollbar style, selection highlighting etc) go to `src/styles/tailwind/base.ts`
80
-
81
- ## Roadmap
82
-
83
- - [x] add next themes
84
- - [x] feature flags
85
- - [x] add sample responsive nav
86
- - [ ] add sample footer
87
- - [ ] add sample server actions
88
- - [ ] add syntax highlighting for code blocks
89
- - [ ] add a branch with animation features using motion
90
- - [ ] add a feature full branch with drizzle orm, analytics, auth
91
-
92
- ### Multi-select sample code
93
-
94
- ```tsx
95
- "use client";
96
- import React, { useState } from "react";
97
- import { MultiSelect } from "@/components/ui/multi-select";
98
-
99
- const catsList = [
100
- { value: "persian", label: "Persian Cat" },
101
- { value: "siamese", label: "Siamese Cat" },
102
- { value: "maine-coon", label: "Maine Coon" },
103
- { value: "ragdoll", label: "Ragdoll" },
104
- { value: "bengal", label: "Bengal Cat" },
105
- ];
106
-
107
- function Home() {
108
- const [selectedCats, setSelectedCats] = useState<string[]>([
109
- "persian",
110
- "siamese",
111
- ]);
112
-
113
- return (
114
- <div className="max-w-xl p-4">
115
- <h1 className="mb-4 text-2xl font-bold">Multi-Select Component</h1>
116
- <MultiSelect
117
- options={catsList}
118
- onValueChange={setSelectedCats}
119
- defaultValue={selectedCats}
120
- placeholder="Select cats"
121
- variant="inverted"
122
- animation={2}
123
- maxCount={3}
124
- />
125
- <div className="mt-4">
126
- <h2 className="text-xl font-semibold">Selected Cats:</h2>
127
- <ul className="list-inside list-disc">
128
- {selectedCats.map((cat) => (
129
- <li key={cat}>{cat}</li>
130
- ))}
131
- </ul>
132
- </div>
133
- </div>
134
- );
135
- }
136
- ```
137
-
138
- <!-- ### [Conventions](./CONVENTION.md) -->
139
-
140
- ## Socials
141
-
142
- - Website: [ardastroid.com](https://ardastroid.com)
143
- - Email: [hello@ardastroid.com](mailto:hello@ardastroid.com)
144
- - GitHub: [@ardastroid](hhttps://github.com/DarkidOP)
145
-
146
- ## License
147
-
148
- Copyright (c) 2024 Ard Astroid / Farhan Ashhab Nur
149
-
150
- Permission is hereby granted, free of charge, to any person obtaining a copy
151
- of this software and associated documentation files (the "Software"), to deal
152
- in the Software without restriction, including without limitation the rights
153
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
154
- copies of the Software, and to permit persons to whom the Software is
155
- furnished to do so, subject to the following conditions:
156
-
157
- The above copyright notice and this permission notice shall be included in all
158
- copies or substantial portions of the Software.
159
-
160
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
161
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
162
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
163
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
164
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
165
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
166
- SOFTWARE.
package/cli.mjs DELETED
@@ -1,126 +0,0 @@
1
- import { execSync } from "child_process";
2
- import readline from "readline";
3
-
4
- const runCommand = (command) => {
5
- try {
6
- execSync(`${command}`, { stdio: "inherit" });
7
- } catch (error) {
8
- console.error(`Failed to run command: ${command}`, error);
9
- return false;
10
- }
11
- return true;
12
- };
13
-
14
- const rl = readline.createInterface({
15
- input: process.stdin,
16
- output: process.stdout,
17
- });
18
-
19
- let repoName = process.argv[2];
20
- const args = process.argv.slice(2);
21
- const useVSCode = args.includes("--vs");
22
- const useCursor = args.includes("--cursor");
23
-
24
- const validateRepoName = (name) => {
25
- const validNameRegex = /^[a-z0-9-]+$/;
26
- return validNameRegex.test(name);
27
- };
28
-
29
- const promptForValidRepoName = (callback) => {
30
- rl.question(
31
- "Please enter a name for your project (lowercase letters, numbers and hyphens only): ",
32
- (answer) => {
33
- if (validateRepoName(answer)) {
34
- repoName = answer;
35
- callback();
36
- } else {
37
- console.error(
38
- "Invalid project name. Please use only lowercase letters, numbers and hyphens."
39
- );
40
- promptForValidRepoName(callback);
41
- }
42
- }
43
- );
44
- };
45
-
46
- if (!repoName || repoName.startsWith("--")) {
47
- promptForValidRepoName(initializeProject);
48
- } else if (!validateRepoName(repoName)) {
49
- console.error(
50
- "Invalid project name. Please use only lowercase letters, numbers and hyphens."
51
- );
52
- promptForValidRepoName(initializeProject);
53
- } else {
54
- initializeProject();
55
- }
56
-
57
- function initializeProject() {
58
- const gitCheckout = `git clone --depth 1 https://github.com/DarkidOP/Bunext.git ${repoName}`;
59
- const removeGit = `cd ${repoName} && rm -rf .git`;
60
- const initGit = `cd ${repoName} && git init && git add . && git commit -m "Initial commit"`;
61
- const openVSCode = `cd ${repoName} && code .`;
62
- const openCursor = `cd ${repoName} && cursor .`;
63
-
64
- // Determine package manager based on how script was executed
65
- let packageManager = "npm";
66
- if (process.env.npm_execpath?.includes("pnpm")) {
67
- packageManager = "pnpm";
68
- } else if (process.env.npm_execpath?.includes("yarn")) {
69
- packageManager = "yarn";
70
- } else if (process.argv[1].includes("bunx")) {
71
- packageManager = "bun";
72
- }
73
-
74
- const installDeps = `cd ${repoName} && ${packageManager}${
75
- packageManager === "npm" ? " install --legacy-peer-deps" : " install"
76
- }`;
77
-
78
- console.log(`Creating project template in ./${repoName}`);
79
- const checkedOut = runCommand(gitCheckout);
80
- if (!checkedOut) {
81
- console.error(
82
- 'Failed to clone template repository "https://github.com/DarkidOP/Bunext.git"'
83
- );
84
- process.exit(1);
85
- }
86
-
87
- console.log("Removing Git history...");
88
- const removedGit = runCommand(removeGit);
89
- if (!removedGit) {
90
- console.error("Failed to remove Git history");
91
- process.exit(1);
92
- }
93
-
94
- console.log("Installing dependencies...");
95
- const installedDeps = runCommand(installDeps);
96
- if (!installedDeps) {
97
- console.error("Failed to install dependencies");
98
- process.exit(1);
99
- }
100
-
101
- rl.question(
102
- "Would you like to initialize a new git repository? (y/n) ",
103
- (answer) => {
104
- if (answer.toLowerCase() === "y" || answer.toLowerCase() === "yes") {
105
- console.log("Initializing Git repository...");
106
- const initializedGit = runCommand(initGit);
107
- if (!initializedGit) {
108
- console.error("Failed to initialize Git repository");
109
- process.exit(1);
110
- }
111
- console.log("Git repository initialized successfully!");
112
- }
113
-
114
- if (useVSCode) {
115
- console.log("Opening in Visual Studio Code...");
116
- runCommand(openVSCode);
117
- } else if (useCursor) {
118
- console.log("Opening in Cursor...");
119
- runCommand(openCursor);
120
- }
121
-
122
- console.log("\nHappy coding! 🎉");
123
- rl.close();
124
- }
125
- );
126
- }