@ardly/bunext 1.0.7 → 1.0.9

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 (5) hide show
  1. package/package.json +43 -25
  2. package/wrapper.js +8 -0
  3. package/LICENSE +0 -21
  4. package/README.md +0 -138
  5. 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.7",
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": "1.0.9",
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-bunestro/dist/cli.js");
7
+
8
+ await import(pathToFileURL(cliPath).href);
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Ard Astroid / Farhan Ashhab Nur
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/README.md DELETED
@@ -1,138 +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
- npx @darkid/create-bunext my-project
10
- ```
11
-
12
- you can specify `-vs` or `--cursor` flags to auto open the project in vscode or cursor respectively after installation.
13
-
14
- ## Usage (run locally)
15
-
16
- > required `bun` or `nodejs` installed and make sure they're up to date
17
-
18
- Go to the `root` folder where `package.json` exists.
19
-
20
- ```bash
21
- bun install
22
- ```
23
-
24
- ```bash
25
- npm install
26
- ```
27
-
28
- ### Then
29
-
30
- ```bash
31
- bun --bun run dev
32
- ```
33
-
34
- ```bash
35
- bun run dev
36
- ```
37
-
38
- ```bash
39
- npm run dev
40
- ```
41
-
42
- ## Features
43
-
44
- - Next.js 15 App Directory
45
- - Tailwind CSS
46
- - [Shadcn](https://ui.shadcn.com/) components
47
- - Custom util components like `share modal, multi-select(no library), Img, Icons, etc`
48
- - CustomFont Optimization using [Next font](https://nextjs.org/docs/pages/building-your-application/optimizing/fonts)
49
- - Icons using [lucide-react](https://lucide.dev/)
50
- - Next theme provider (dark and light mode)
51
- - Url stage management using [nuqs](https://nuqs.47ng.com/)
52
- - Tailwind css only animations using [tailwindcss-motion](https://docs.rombo.co/tailwind)
53
- - Feature flags
54
- - Metadata generator for SEO (including apple-touch-icon)
55
- - [zod](https://zod.dev/) validation
56
- - Per Link page transition (without any library)
57
- - Custom Image components with lazy loading and auto generated placeholder (worsk with or without `next/image`)
58
- - [Prettier](https://prettier.io/) for formatting with tailwind plugin configured
59
- - [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)
60
- - Utilities like `qrCode gen, string shortner, uniqueCode gen, img placeholder, email validation, hashing etc`
61
-
62
- ## Config
63
-
64
- - for generating colors use [realtime-colors](https://www.realtimecolors.com/) shadcn template and pase it on `src/styles/globals.css`
65
- - add fonts on `src/styles/tailwind/fonts.ts`
66
- - to configure feature flags got to `src/lib/config/featureflags.ts`
67
- - to configure Metadata got to `src/lib/data/siteData.ts`
68
- - advance Metadata config in `src/lib/config/siteConfig.ts`
69
- - for base styles (scrollbar style, selection highlighting etc) go to `src/styles/tailwind/base.ts`
70
-
71
- ## Roadmap
72
-
73
- - [x] add next themes
74
- - [x] feature flags
75
- - [x] add sample responsive nav
76
- - [ ] add sample footer
77
- - [ ] add sample server actions
78
- - [ ] add syntax highlighting for code blocks
79
- - [ ] add a branch with animation features using motion
80
- - [ ] add a feature full branch with drizzle orm, analytics, auth
81
-
82
- ### Multi-select sample code
83
-
84
- ```tsx
85
- "use client";
86
- import React, { useState } from "react";
87
- import { MultiSelect } from "@/components/ui/multi-select";
88
-
89
- const catsList = [
90
- { value: "persian", label: "Persian Cat" },
91
- { value: "siamese", label: "Siamese Cat" },
92
- { value: "maine-coon", label: "Maine Coon" },
93
- { value: "ragdoll", label: "Ragdoll" },
94
- { value: "bengal", label: "Bengal Cat" },
95
- ];
96
-
97
- function Home() {
98
- const [selectedCats, setSelectedCats] = useState<string[]>([
99
- "persian",
100
- "siamese",
101
- ]);
102
-
103
- return (
104
- <div className="max-w-xl p-4">
105
- <h1 className="mb-4 text-2xl font-bold">Multi-Select Component</h1>
106
- <MultiSelect
107
- options={catsList}
108
- onValueChange={setSelectedCats}
109
- defaultValue={selectedCats}
110
- placeholder="Select cats"
111
- variant="inverted"
112
- animation={2}
113
- maxCount={3}
114
- />
115
- <div className="mt-4">
116
- <h2 className="text-xl font-semibold">Selected Cats:</h2>
117
- <ul className="list-inside list-disc">
118
- {selectedCats.map((cat) => (
119
- <li key={cat}>{cat}</li>
120
- ))}
121
- </ul>
122
- </div>
123
- </div>
124
- );
125
- }
126
- ```
127
-
128
- <!-- ### [Conventions](./CONVENTION.md) -->
129
-
130
- ## Socials
131
-
132
- - Website: [ardastroid.com](https://ardastroid.com)
133
- - Email: [hello@ardastroid.com](mailto:hello@ardastroid.com)
134
- - GitHub: [@ardastroid](hhttps://github.com/DarkidOP)
135
-
136
- ## License
137
-
138
- Licensed under the [MIT license](./LICENSE).
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
- }