@kunver/new 2.3.1 → 2.3.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/dist/index.js +2 -2
- package/dist/templates/react-ts-tw/README.md +1 -1
- package/dist/templates/react-ts-tw/index.html +1 -1
- package/dist/templates/react-ts-tw/package.json +3 -4
- package/package.json +15 -15
- package/dist/templates/react-ts-tw/push.sh +0 -30
- /package/{README.MD → README.md} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import oe from"fs";import ne from"path";import{input as ie,select as T}from"@inquirer/prompts";import p from"chalk";import z,{join as M}from"path";import{fileURLToPath as N}from"url";import{execa as C}from"execa";import w from"chalk";import D from"ora";async function c(e,r,a){let t;switch(e){case"pnpm":t=`cd ${r} && pnpm install`;break;case"npm":t=`cd ${r} && npm install`;break;case"bun":t=`cd ${r} && bun install`;break;default:t=`cd ${r} && pnpm install`}let o=D("Installing dependencies with "+w.blue(e)).start();try{return await C(t,{shell:!0,cwd:a}),o.succeed("Installed dependencies for "+w.blue(r)),!0}catch{return o.fail("Failed to install dependencies for "+w.blue(r)),!1}}import{promises as R}from"fs";import W from"ora";async function l(e,r){let a=W("Copying template folder...").start();try{return await R.cp(e,r,{recursive:!0}),a.succeed("Copied template folder"),!0}catch{return a.fail("Failed to copy template folder"),!1}}import{spawn as J}from"child_process";import x from"ora";import i from"chalk";import{execa as L}from"execa";async function y(e,r,a){switch(e){case"pnpm":return await d(r,a);case"bun":return await f(r,a);default:return!1}}async function d(e,r){let a=x("Approving builds for "+i.blue(e)).start();try{return new Promise(t=>{let o=J("pnpm",["approve-builds"],{cwd:`${r}/${e}`,stdio:["pipe","inherit","inherit"],shell:!0});setTimeout(()=>{o.stdin?.write(`a
|
|
2
2
|
`),setTimeout(()=>{o.stdin?.write(`y
|
|
3
|
-
`),o.stdin?.end()},1e3)},2e3),o.on("close",n=>{n===0?(a.succeed("Approved builds for "+i.blue(e)),t(!0)):(a.fail("Failed to approve builds for "+i.blue(e)),t(!1))}),o.on("error",n=>{a.fail("Failed to approve builds for "+i.blue(e)),console.error(n),t(!1)})})}catch(t){return a.fail("Failed to approve builds for "+i.blue(e)),console.error(t),!1}}async function
|
|
3
|
+
`),o.stdin?.end()},1e3)},2e3),o.on("close",n=>{n===0?(a.succeed("Approved builds for "+i.blue(e)),t(!0)):(a.fail("Failed to approve builds for "+i.blue(e)),t(!1))}),o.on("error",n=>{a.fail("Failed to approve builds for "+i.blue(e)),console.error(n),t(!1)})})}catch(t){return a.fail("Failed to approve builds for "+i.blue(e)),console.error(t),!1}}async function f(e,r){let a=`cd ${e} && bun pm trust --all`,t=x("Approving builds for "+i.blue(e)).start();try{return await L(a,{shell:!0,cwd:r}),t.succeed("Approved builds for "+i.blue(e)),!0}catch{return t.fail("Failed to approve builds for "+i.blue(e)),!1}}import{join as U}from"path";import j from"fs";async function s(e,r,a){let t=U(a,r,"package.json"),o=JSON.parse(j.readFileSync(t,"utf-8"));e==="bun"?o.scripts.manager=`bun manager.cjs ${e}`:o.scripts.manager=`node manager.cjs ${e}`,j.writeFileSync(t,JSON.stringify(o,null,2))}var X=N(import.meta.url),q=z.dirname(X);async function v(e){let{name:r,packageManager:a,cwd:t=process.cwd()}=e,o=M(q,"templates","react-ts-tw");try{if(!await l(o,M(t,r)))throw new Error("Failed to copy template folder");if(!await c(a,r,t))throw new Error("Failed to install dependencies");return await s(a,r,t),a==="pnpm"?await d(r,t):a==="bun"&&await f(r,t),!0}catch(n){throw console.error("Error creating React project:",n),n}}import G,{join as P}from"path";import{fileURLToPath as H}from"url";var K=H(import.meta.url),Q=G.dirname(K);async function F(e){let{name:r,packageManager:a,cwd:t=process.cwd()}=e,o=P(Q,"templates","next-prisma");try{if(!await l(o,P(t,r)))throw new Error("Failed to copy template folder");if(!await c(a,r,t))throw new Error("Failed to install dependencies");return await s(a,r,t),a==="pnpm"?await d(r,t):a==="bun"&&await f(r,t),!0}catch(n){throw console.error("Error creating Next project:",n),n}}import V,{join as u}from"path";import{fileURLToPath as Y}from"url";import Z from"chalk";import{select as ee}from"@inquirer/prompts";var te=["react - !not ready","vue - !not ready","svelte","vanilla"],re=Y(import.meta.url),b=V.dirname(re);async function S(e){let{name:r,packageManager:a,cwd:t=process.cwd(),selectedFramework:o}=e;try{let n=o||await ee({message:Z.bold.magenta("Select a framework for WXT"),choices:te,default:"svelte"}),m=u(b,"templates","wxt-svelte");switch(n){case"svelte":m=u(b,"templates","wxt-svelte");break;case"vanilla":m=u(b,"templates","wxt-vanilla");break;default:break}await l(m,u(t,r))&&(await s(a,r,t),await c(a,r,t),await y(a,r,t),await s(a,r,t))}catch(n){console.error(n)}}import{join as E}from"path";import h from"fs";async function I(e){let{name:r,cwd:a=process.cwd()}=e,t=E(a,r);h.existsSync(t)||h.mkdirSync(t);let o=E(t,"main.ipynb");h.writeFileSync(o,"")}import{execa as ae}from"execa";import g from"chalk";async function O(e,r,a){console.log(g.white("Opening "+g.blue(e)+" in "+g.green(a)));try{return await ae(`${a} ${e}`,{shell:!0,cwd:r}),!0}catch(t){return console.error(g.red("Failed to open project in editor:"),t),!1}}var _=["react-ts-tw","next-ts-prisma","wxt","python-notebook","cpp-makefile"],$=["bun","pnpm","npm"];async function k(e){switch(e.projectType){case"react-ts-tw":await v({name:e.name,packageManager:e.packageManager});break;case"next-ts-prisma":await F({name:e.name,packageManager:e.packageManager});break;case"wxt":await S({name:e.name,packageManager:e.packageManager});break;case"python-notebook":await I({name:e.name});break;default:console.log("Project Type Not Implemented",e.projectType);break}e.openInEditor!=="no"&&await O(e.name,process.cwd(),e.openInEditor)}var pe=await ie({message:p.bold.blue("Enter a project name"),default:p.gray("my-project"),validate:e=>!e||e.trim().length<2?p.red("Project name must be at least 2 characters"):/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e)?oe.existsSync(ne.resolve(process.cwd(),e))?p.red("A folder with that name already exists"):!0:p.red("Only lowercase letters, numbers, and single hyphens allowed. No spaces or special characters.")}),A=await T({message:p.bold.yellow("Select a project type"),default:"react-ts-tw",choices:_}),B;A!=="python-notebook"&&(B=await T({message:p.bold.green("Select a package manager"),choices:$,default:"bun"}));var se=await T({message:p.bold.cyan("Open in editor?"),choices:["no","windsurf","cursor","code"],default:"no"}),ce={projectType:A,packageManager:B,name:pe,openInEditor:se};await k(ce);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
#
|
|
1
|
+
# React + TypeScript + TailwindCSS
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>
|
|
7
|
+
<title>React + TypeScript + TailwindCSS</title>
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<div id="root"></div>
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "react-ts-tw",
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"dev": "vite",
|
|
7
|
+
"dev": "bunx --bun vite",
|
|
8
8
|
"build": "tsc -b && vite build",
|
|
9
|
-
"preview": "vite preview"
|
|
10
|
-
"manager": "node manager.js"
|
|
9
|
+
"preview": "vite preview"
|
|
11
10
|
},
|
|
12
11
|
"dependencies": {
|
|
13
12
|
"@tailwindcss/vite": "^4.1.11",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kunver/new",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "Opiniated project starter",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,26 +13,26 @@
|
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsup",
|
|
18
|
+
"start": "bun dist/index.js",
|
|
19
|
+
"prepublishOnly": "bun run build",
|
|
20
|
+
"local": "bun link",
|
|
21
|
+
"manager": "bun manager.cjs bun"
|
|
22
|
+
},
|
|
16
23
|
"keywords": [],
|
|
17
24
|
"author": "Burak Unver <burakhanunver@gmail.com> (https://kunver.dev)",
|
|
18
25
|
"license": "MIT",
|
|
19
26
|
"dependencies": {
|
|
20
|
-
"@inquirer/prompts": "^7.
|
|
21
|
-
"
|
|
22
|
-
"chalk": "^5.4.1",
|
|
27
|
+
"@inquirer/prompts": "^7.8.3",
|
|
28
|
+
"chalk": "^5.6.0",
|
|
23
29
|
"execa": "^9.6.0",
|
|
24
|
-
"fs-extra": "^11.3.0",
|
|
25
30
|
"ora": "^8.2.0"
|
|
26
31
|
},
|
|
27
32
|
"devDependencies": {
|
|
28
|
-
"@types/
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
"scripts": {
|
|
33
|
-
"build": "tsup",
|
|
34
|
-
"start": "pnpm run build && node dist/index.js",
|
|
35
|
-
"local": "pnpm link --global",
|
|
36
|
-
"manager": "node manager.cjs pnpm"
|
|
33
|
+
"@types/bun": "^1.2.20",
|
|
34
|
+
"@types/node": "^24.3.0",
|
|
35
|
+
"tsup": "^8.5.0",
|
|
36
|
+
"typescript": "^5.9.2"
|
|
37
37
|
}
|
|
38
|
-
}
|
|
38
|
+
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
#!/bin/bash
|
|
3
|
-
|
|
4
|
-
# Exit immediately if a command fails
|
|
5
|
-
set -e
|
|
6
|
-
|
|
7
|
-
# Switch to the main branch
|
|
8
|
-
git checkout main
|
|
9
|
-
|
|
10
|
-
# Merge the dev branch into main
|
|
11
|
-
git merge dev
|
|
12
|
-
if [ $? -ne 0 ]; then
|
|
13
|
-
echo "❌ Merge conflict occurred. Please resolve it manually."
|
|
14
|
-
exit 1
|
|
15
|
-
fi
|
|
16
|
-
|
|
17
|
-
# Push changes to GitHub
|
|
18
|
-
git push origin main
|
|
19
|
-
if [ $? -ne 0 ]; then
|
|
20
|
-
echo "❌ Failed to push changes to GitHub. Please check your network connection and permissions."
|
|
21
|
-
exit 1
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
echo "✅ Successfully merged 'dev' into 'main' and pushed to GitHub!"
|
|
25
|
-
|
|
26
|
-
git checkout dev
|
|
27
|
-
if [ $? -ne 0 ]; then
|
|
28
|
-
echo "❌ Failed to switch back to the 'dev' branch."
|
|
29
|
-
exit 1
|
|
30
|
-
fi
|
/package/{README.MD → README.md}
RENAMED
|
File without changes
|