@kunver/new 3.1.1 → 3.3.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.
- package/README.MD +26 -18
- package/dist/index.js +16 -10
- package/dist/templates/cmake-cpp/.clang-format +1 -0
- package/dist/templates/cmake-cpp/CMakeLists.txt +14 -0
- package/dist/templates/cmake-cpp/README.md +32 -0
- package/dist/templates/cmake-cpp/_clang-format +1 -0
- package/dist/templates/cmake-cpp/_gitignore +9 -0
- package/dist/templates/cmake-cpp/agents.md +8 -0
- package/dist/templates/{make-cpp → cmake-cpp}/include/example.hpp +1 -1
- package/dist/templates/cmake-cpp/manager.ts +276 -0
- package/dist/templates/{make-cpp → cmake-cpp}/src/main.cpp +1 -1
- package/dist/templates/electron-svelte/.vscode/launch.json +39 -39
- package/dist/templates/electron-svelte/.vscode/settings.json +15 -15
- package/dist/templates/next-prisma/README.md +11 -11
- package/dist/templates/next-prisma/_prettierrc.json +12 -0
- package/dist/templates/next-prisma/app/globals.css +1 -1
- package/dist/templates/next-prisma/app/layout.tsx +21 -21
- package/dist/templates/next-prisma/app/page.tsx +7 -7
- package/dist/templates/next-prisma/lib/prisma.ts +11 -11
- package/dist/templates/next-prisma/manager.cjs +71 -69
- package/dist/templates/next-prisma/next.config.ts +7 -7
- package/dist/templates/next-prisma/package.json +33 -33
- package/dist/templates/next-prisma/postcss.config.mjs +5 -5
- package/dist/templates/next-prisma/tsconfig.json +27 -27
- package/dist/templates/react-ts-tw/README.md +1 -1
- package/dist/templates/react-ts-tw/_prettierrc.json +12 -0
- package/dist/templates/react-ts-tw/index.html +13 -13
- package/dist/templates/react-ts-tw/manager.cjs +71 -69
- package/dist/templates/react-ts-tw/package.json +30 -30
- package/dist/templates/react-ts-tw/src/App.tsx +9 -9
- package/dist/templates/react-ts-tw/src/index.css +1 -1
- package/dist/templates/react-ts-tw/src/main.tsx +10 -10
- package/dist/templates/react-ts-tw/src/vite-env.d.ts +1 -1
- package/dist/templates/react-ts-tw/tsconfig.app.json +27 -27
- package/dist/templates/react-ts-tw/tsconfig.json +4 -7
- package/dist/templates/react-ts-tw/tsconfig.node.json +25 -25
- package/dist/templates/react-ts-tw/vite.config.ts +8 -8
- package/dist/templates/wxt-solid/README.md +3 -3
- package/dist/templates/wxt-solid/_prettierrc.json +11 -0
- package/dist/templates/wxt-solid/agents.md +76 -76
- package/dist/templates/wxt-solid/assets/tailwind.css +1 -1
- package/dist/templates/wxt-solid/entrypoints/background.ts +3 -3
- package/dist/templates/wxt-solid/entrypoints/content/Content.tsx +7 -7
- package/dist/templates/wxt-solid/entrypoints/content/main.tsx +31 -31
- package/dist/templates/wxt-solid/entrypoints/options/{App.tsx → Options.tsx} +0 -1
- package/dist/templates/wxt-solid/entrypoints/options/index.html +13 -13
- package/dist/templates/wxt-solid/entrypoints/options/main.tsx +2 -2
- package/dist/templates/wxt-solid/entrypoints/popup/index.html +13 -13
- package/dist/templates/wxt-solid/entrypoints/popup/main.tsx +2 -2
- package/dist/templates/wxt-solid/manager.cjs +71 -69
- package/dist/templates/wxt-solid/package.json +33 -33
- package/dist/templates/wxt-solid/tsconfig.json +7 -7
- package/dist/templates/wxt-solid/wxt.config.ts +18 -18
- package/dist/templates/wxt-svelte/.vscode/extensions.json +3 -3
- package/dist/templates/wxt-svelte/README.md +3 -3
- package/dist/templates/wxt-svelte/_prettierrc.json +11 -0
- package/dist/templates/wxt-svelte/agents.md +77 -77
- package/dist/templates/wxt-svelte/assets/tailwind.css +1 -1
- package/dist/templates/wxt-svelte/entrypoints/background.ts +3 -3
- package/dist/templates/wxt-svelte/entrypoints/content/index.ts +4 -4
- package/dist/templates/wxt-svelte/entrypoints/options/index.html +13 -13
- package/dist/templates/wxt-svelte/entrypoints/options/main.ts +2 -2
- package/dist/templates/wxt-svelte/entrypoints/popup/index.html +13 -13
- package/dist/templates/wxt-svelte/entrypoints/popup/main.ts +2 -2
- package/dist/templates/wxt-svelte/manager.cjs +71 -69
- package/dist/templates/wxt-svelte/package.json +36 -36
- package/dist/templates/wxt-svelte/tsconfig.json +6 -6
- package/dist/templates/wxt-svelte/wxt-env.d.ts +1 -1
- package/dist/templates/wxt-svelte/wxt.config.ts +18 -18
- package/dist/templates/wxt-vanilla/README.md +3 -3
- package/dist/templates/wxt-vanilla/_prettierrc.json +11 -0
- package/dist/templates/wxt-vanilla/agents.md +73 -73
- package/dist/templates/wxt-vanilla/entrypoints/background.ts +3 -3
- package/dist/templates/wxt-vanilla/entrypoints/content.ts +6 -6
- package/dist/templates/wxt-vanilla/entrypoints/popup/index.html +13 -13
- package/dist/templates/wxt-vanilla/entrypoints/popup/main.ts +1 -1
- package/dist/templates/wxt-vanilla/manager.cjs +71 -69
- package/dist/templates/wxt-vanilla/package.json +25 -25
- package/dist/templates/wxt-vanilla/tsconfig.json +3 -3
- package/dist/templates/wxt-vanilla/wxt.config.ts +13 -13
- package/package.json +18 -5
- package/dist/templates/electron-svelte/README.md +0 -3
- package/dist/templates/electron-svelte/_gitignore +0 -6
- package/dist/templates/electron-svelte/build/entitlements.mac.plist +0 -12
- package/dist/templates/electron-svelte/build/icon.icns +0 -0
- package/dist/templates/electron-svelte/build/icon.ico +0 -0
- package/dist/templates/electron-svelte/build/icon.png +0 -0
- package/dist/templates/electron-svelte/bun.lock +0 -1154
- package/dist/templates/electron-svelte/electron-builder.yml +0 -44
- package/dist/templates/electron-svelte/electron.vite.config.ts +0 -15
- package/dist/templates/electron-svelte/manager.cjs +0 -69
- package/dist/templates/electron-svelte/package.json +0 -44
- package/dist/templates/electron-svelte/resources/icon.png +0 -0
- package/dist/templates/electron-svelte/src/main/index.ts +0 -62
- package/dist/templates/electron-svelte/src/preload/index.d.ts +0 -8
- package/dist/templates/electron-svelte/src/preload/index.ts +0 -22
- package/dist/templates/electron-svelte/src/renderer/index.html +0 -16
- package/dist/templates/electron-svelte/src/renderer/src/App.svelte +0 -8
- package/dist/templates/electron-svelte/src/renderer/src/assets/main.css +0 -1
- package/dist/templates/electron-svelte/src/renderer/src/env.d.ts +0 -2
- package/dist/templates/electron-svelte/src/renderer/src/main.ts +0 -11
- package/dist/templates/electron-svelte/svelte.config.mjs +0 -7
- package/dist/templates/electron-svelte/tsconfig.json +0 -4
- package/dist/templates/electron-svelte/tsconfig.node.json +0 -11
- package/dist/templates/electron-svelte/tsconfig.web.json +0 -17
- package/dist/templates/make-cpp/Makefile +0 -44
- package/dist/templates/make-cpp/README.md +0 -15
- /package/dist/templates/{make-cpp → cmake-cpp}/src/example.cpp +0 -0
- /package/dist/templates/wxt-solid/entrypoints/popup/{App.tsx → Popup.tsx} +0 -0
- /package/dist/templates/wxt-svelte/entrypoints/content/{App.svelte → Content.svelte} +0 -0
- /package/dist/templates/wxt-svelte/entrypoints/options/{App.svelte → Options.svelte} +0 -0
- /package/dist/templates/wxt-svelte/entrypoints/popup/{App.svelte → Popup.svelte} +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import type { Metadata } from "next"
|
|
2
|
-
import { Geist } from "next/font/google"
|
|
3
|
-
import "./globals.css"
|
|
4
|
-
|
|
5
|
-
const geistSans = Geist({
|
|
6
|
-
variable: "--font-geist-sans",
|
|
7
|
-
subsets: ["latin"],
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
export const metadata: Metadata = {
|
|
11
|
-
title: "Create Next App",
|
|
12
|
-
description: "Generated by create next app",
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
16
|
-
return (
|
|
17
|
-
<html lang="en">
|
|
18
|
-
<body className={`${geistSans.variable} antialiased`}>{children}</body>
|
|
19
|
-
</html>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
1
|
+
import type { Metadata } from "next"
|
|
2
|
+
import { Geist } from "next/font/google"
|
|
3
|
+
import "./globals.css"
|
|
4
|
+
|
|
5
|
+
const geistSans = Geist({
|
|
6
|
+
variable: "--font-geist-sans",
|
|
7
|
+
subsets: ["latin"],
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export const metadata: Metadata = {
|
|
11
|
+
title: "Create Next App",
|
|
12
|
+
description: "Generated by create next app",
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
16
|
+
return (
|
|
17
|
+
<html lang="en">
|
|
18
|
+
<body className={`${geistSans.variable} antialiased`}>{children}</body>
|
|
19
|
+
</html>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export default function Home() {
|
|
2
|
-
return (
|
|
3
|
-
<div>
|
|
4
|
-
<h1 className="text-3xl font-bold underline">Hello world!</h1>
|
|
5
|
-
</div>
|
|
6
|
-
)
|
|
7
|
-
}
|
|
1
|
+
export default function Home() {
|
|
2
|
+
return (
|
|
3
|
+
<div>
|
|
4
|
+
<h1 className="text-3xl font-bold underline">Hello world!</h1>
|
|
5
|
+
</div>
|
|
6
|
+
)
|
|
7
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { PrismaClient } from "@prisma/client"
|
|
2
|
-
|
|
3
|
-
const globalForPrisma = globalThis as unknown as {
|
|
4
|
-
prisma: PrismaClient | undefined
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const prisma = globalForPrisma.prisma ?? new PrismaClient()
|
|
8
|
-
|
|
9
|
-
if (process.env.NODE_ENV !== "production") {
|
|
10
|
-
globalForPrisma.prisma = prisma
|
|
11
|
-
}
|
|
1
|
+
import { PrismaClient } from "@prisma/client"
|
|
2
|
+
|
|
3
|
+
const globalForPrisma = globalThis as unknown as {
|
|
4
|
+
prisma: PrismaClient | undefined
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const prisma = globalForPrisma.prisma ?? new PrismaClient()
|
|
8
|
+
|
|
9
|
+
if (process.env.NODE_ENV !== "production") {
|
|
10
|
+
globalForPrisma.prisma = prisma
|
|
11
|
+
}
|
|
@@ -1,69 +1,71 @@
|
|
|
1
|
-
const { exec } = require("child_process")
|
|
2
|
-
|
|
3
|
-
function runCommand(command) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async function publishAndPushOperations(packageManager, command) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const packageManagerArg = process.argv[2]
|
|
59
|
-
const commandArg = process.argv[3]
|
|
60
|
-
|
|
61
|
-
const validManagers = ["pnpm", "npm", "yarn", "bun"]
|
|
62
|
-
const validCommands = ["push", "publish"]
|
|
63
|
-
|
|
64
|
-
if (!validManagers.includes(packageManagerArg) || !validCommands.includes(commandArg)) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
1
|
+
const { exec } = require("child_process")
|
|
2
|
+
|
|
3
|
+
function runCommand(command) {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
exec(command, { shell: true }, (error, stdout, stderr) => {
|
|
6
|
+
if (error) {
|
|
7
|
+
console.log(`❌ Error occurred: ${error.message}`)
|
|
8
|
+
if (stderr) {
|
|
9
|
+
console.log(`Standard Error: ${stderr.trim()}`)
|
|
10
|
+
}
|
|
11
|
+
return resolve(false)
|
|
12
|
+
}
|
|
13
|
+
if (stdout) {
|
|
14
|
+
console.log(stdout.trim())
|
|
15
|
+
}
|
|
16
|
+
resolve(true)
|
|
17
|
+
})
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async function publishAndPushOperations(packageManager, command) {
|
|
22
|
+
console.log("Switching to main branch...")
|
|
23
|
+
if (!(await runCommand("git checkout main"))) {
|
|
24
|
+
process.exit(1)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
console.log("Merging dev branch into main...")
|
|
28
|
+
if (!(await runCommand("git merge dev"))) {
|
|
29
|
+
console.log("❌ Merge conflict occurred. Please resolve it manually.")
|
|
30
|
+
process.exit(1)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
console.log("Pushing changes to GitHub...")
|
|
34
|
+
if (!(await runCommand("git push origin main"))) {
|
|
35
|
+
console.log("❌ Failed to push changes to GitHub. Please check your network connection and permissions.")
|
|
36
|
+
process.exit(1)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
console.log("✅ Successfully merged 'dev' into 'main' and pushed to GitHub!")
|
|
40
|
+
|
|
41
|
+
if (command === "publish") {
|
|
42
|
+
console.log(`Publishing package (${packageManager} publish)...`)
|
|
43
|
+
if (!(await runCommand(`${packageManager} publish`))) {
|
|
44
|
+
console.log(`❌ ${packageManager} publish command failed.`)
|
|
45
|
+
process.exit(1)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
console.log("Switching back to dev branch...")
|
|
50
|
+
if (!(await runCommand("git checkout dev"))) {
|
|
51
|
+
console.log("❌ Failed to switch back to the 'dev' branch.")
|
|
52
|
+
process.exit(1)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
console.log("✅ All operations completed.")
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const packageManagerArg = process.argv[2]
|
|
59
|
+
const commandArg = process.argv[3]
|
|
60
|
+
|
|
61
|
+
const validManagers = ["pnpm", "npm", "yarn", "bun"]
|
|
62
|
+
const validCommands = ["push", "publish"]
|
|
63
|
+
|
|
64
|
+
if (!validManagers.includes(packageManagerArg) || !validCommands.includes(commandArg)) {
|
|
65
|
+
console.log(
|
|
66
|
+
`Invalid or missing arguments. Usage: node manager.cjs <package-manager> <push|publish>\nValid package managers: ${validManagers.join(", ")}`,
|
|
67
|
+
)
|
|
68
|
+
process.exit(1)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
publishAndPushOperations(packageManagerArg, commandArg)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { NextConfig } from "next"
|
|
2
|
-
|
|
3
|
-
const nextConfig: NextConfig = {
|
|
4
|
-
/* config options here */
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export default nextConfig
|
|
1
|
+
import type { NextConfig } from "next"
|
|
2
|
+
|
|
3
|
+
const nextConfig: NextConfig = {
|
|
4
|
+
/* config options here */
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default nextConfig
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "next1",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"dev": "next dev --turbopack",
|
|
7
|
-
"build": "next build",
|
|
8
|
-
"start": "next start",
|
|
9
|
-
"lint": "next lint"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@prisma/client": "^6.12.0",
|
|
13
|
-
"next": "15.4.2",
|
|
14
|
-
"prisma": "^6.12.0",
|
|
15
|
-
"react": "19.1.0",
|
|
16
|
-
"react-dom": "19.1.0"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"typescript": "^5",
|
|
20
|
-
"@types/node": "^20",
|
|
21
|
-
"@types/react": "^19",
|
|
22
|
-
"@types/react-dom": "^19",
|
|
23
|
-
"@tailwindcss/postcss": "^4",
|
|
24
|
-
"tailwindcss": "^4"
|
|
25
|
-
},
|
|
26
|
-
"trustedDependencies": [
|
|
27
|
-
"@prisma/client",
|
|
28
|
-
"@prisma/engines",
|
|
29
|
-
"@tailwindcss/oxide",
|
|
30
|
-
"prisma",
|
|
31
|
-
"sharp"
|
|
32
|
-
]
|
|
33
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "next1",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev --turbopack",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"lint": "next lint"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@prisma/client": "^6.12.0",
|
|
13
|
+
"next": "15.4.2",
|
|
14
|
+
"prisma": "^6.12.0",
|
|
15
|
+
"react": "19.1.0",
|
|
16
|
+
"react-dom": "19.1.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"typescript": "^5",
|
|
20
|
+
"@types/node": "^20",
|
|
21
|
+
"@types/react": "^19",
|
|
22
|
+
"@types/react-dom": "^19",
|
|
23
|
+
"@tailwindcss/postcss": "^4",
|
|
24
|
+
"tailwindcss": "^4"
|
|
25
|
+
},
|
|
26
|
+
"trustedDependencies": [
|
|
27
|
+
"@prisma/client",
|
|
28
|
+
"@prisma/engines",
|
|
29
|
+
"@tailwindcss/oxide",
|
|
30
|
+
"prisma",
|
|
31
|
+
"sharp"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const config = {
|
|
2
|
-
plugins: ["@tailwindcss/postcss"],
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export default config
|
|
1
|
+
const config = {
|
|
2
|
+
plugins: ["@tailwindcss/postcss"],
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export default config
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2017",
|
|
4
|
-
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"skipLibCheck": true,
|
|
7
|
-
"strict": true,
|
|
8
|
-
"noEmit": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"module": "esnext",
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"isolatedModules": true,
|
|
14
|
-
"jsx": "preserve",
|
|
15
|
-
"incremental": true,
|
|
16
|
-
"plugins": [
|
|
17
|
-
{
|
|
18
|
-
"name": "next"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"paths": {
|
|
22
|
-
"@/*": ["./*"]
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
26
|
-
"exclude": ["node_modules"]
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"jsx": "preserve",
|
|
15
|
+
"incremental": true,
|
|
16
|
+
"plugins": [
|
|
17
|
+
{
|
|
18
|
+
"name": "next"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"paths": {
|
|
22
|
+
"@/*": ["./*"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
26
|
+
"exclude": ["node_modules"]
|
|
27
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
# React + TypeScript + TailwindCSS
|
|
1
|
+
# React + TypeScript + TailwindCSS
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"semi": false,
|
|
3
|
+
"trailingComma": "all",
|
|
4
|
+
"singleQuote": false,
|
|
5
|
+
"printWidth": 120,
|
|
6
|
+
"tabWidth": 2,
|
|
7
|
+
"useTabs": false,
|
|
8
|
+
"jsxSingleQuote": false,
|
|
9
|
+
"jsxBracketSameLine": false,
|
|
10
|
+
"arrowParens": "avoid",
|
|
11
|
+
"plugins": ["prettier-plugin-tailwindcss"]
|
|
12
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>React + TypeScript + TailwindCSS</title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="root"></div>
|
|
11
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>React + TypeScript + TailwindCSS</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -1,69 +1,71 @@
|
|
|
1
|
-
const { exec } = require("child_process")
|
|
2
|
-
|
|
3
|
-
function runCommand(command) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async function publishAndPushOperations(packageManager, command) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const packageManagerArg = process.argv[2]
|
|
59
|
-
const commandArg = process.argv[3]
|
|
60
|
-
|
|
61
|
-
const validManagers = ["pnpm", "npm", "yarn", "bun"]
|
|
62
|
-
const validCommands = ["push", "publish"]
|
|
63
|
-
|
|
64
|
-
if (!validManagers.includes(packageManagerArg) || !validCommands.includes(commandArg)) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
1
|
+
const { exec } = require("child_process")
|
|
2
|
+
|
|
3
|
+
function runCommand(command) {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
exec(command, { shell: true }, (error, stdout, stderr) => {
|
|
6
|
+
if (error) {
|
|
7
|
+
console.log(`❌ Error occurred: ${error.message}`)
|
|
8
|
+
if (stderr) {
|
|
9
|
+
console.log(`Standard Error: ${stderr.trim()}`)
|
|
10
|
+
}
|
|
11
|
+
return resolve(false)
|
|
12
|
+
}
|
|
13
|
+
if (stdout) {
|
|
14
|
+
console.log(stdout.trim())
|
|
15
|
+
}
|
|
16
|
+
resolve(true)
|
|
17
|
+
})
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async function publishAndPushOperations(packageManager, command) {
|
|
22
|
+
console.log("Switching to main branch...")
|
|
23
|
+
if (!(await runCommand("git checkout main"))) {
|
|
24
|
+
process.exit(1)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
console.log("Merging dev branch into main...")
|
|
28
|
+
if (!(await runCommand("git merge dev"))) {
|
|
29
|
+
console.log("❌ Merge conflict occurred. Please resolve it manually.")
|
|
30
|
+
process.exit(1)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
console.log("Pushing changes to GitHub...")
|
|
34
|
+
if (!(await runCommand("git push origin main"))) {
|
|
35
|
+
console.log("❌ Failed to push changes to GitHub. Please check your network connection and permissions.")
|
|
36
|
+
process.exit(1)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
console.log("✅ Successfully merged 'dev' into 'main' and pushed to GitHub!")
|
|
40
|
+
|
|
41
|
+
if (command === "publish") {
|
|
42
|
+
console.log(`Publishing package (${packageManager} publish)...`)
|
|
43
|
+
if (!(await runCommand(`${packageManager} publish`))) {
|
|
44
|
+
console.log(`❌ ${packageManager} publish command failed.`)
|
|
45
|
+
process.exit(1)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
console.log("Switching back to dev branch...")
|
|
50
|
+
if (!(await runCommand("git checkout dev"))) {
|
|
51
|
+
console.log("❌ Failed to switch back to the 'dev' branch.")
|
|
52
|
+
process.exit(1)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
console.log("✅ All operations completed.")
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const packageManagerArg = process.argv[2]
|
|
59
|
+
const commandArg = process.argv[3]
|
|
60
|
+
|
|
61
|
+
const validManagers = ["pnpm", "npm", "yarn", "bun"]
|
|
62
|
+
const validCommands = ["push", "publish"]
|
|
63
|
+
|
|
64
|
+
if (!validManagers.includes(packageManagerArg) || !validCommands.includes(commandArg)) {
|
|
65
|
+
console.log(
|
|
66
|
+
`Invalid or missing arguments. Usage: node manager.cjs <package-manager> <push|publish>\nValid package managers: ${validManagers.join(", ")}`,
|
|
67
|
+
)
|
|
68
|
+
process.exit(1)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
publishAndPushOperations(packageManagerArg, commandArg)
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-ts-tw",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "bunx --bun vite",
|
|
8
|
-
"build": "tsc -b && vite build",
|
|
9
|
-
"preview": "vite preview"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@tailwindcss/vite": "^4.1.11",
|
|
13
|
-
"react": "^19.1.0",
|
|
14
|
-
"react-dom": "^19.1.0",
|
|
15
|
-
"tailwindcss": "^4.1.11"
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@types/react": "^19.1.8",
|
|
19
|
-
"@types/react-dom": "^19.1.6",
|
|
20
|
-
"@vitejs/plugin-react-swc": "^3.10.2",
|
|
21
|
-
"prettier": "^3.6.2",
|
|
22
|
-
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
23
|
-
"typescript": "~5.8.3",
|
|
24
|
-
"vite": "^7.0.4"
|
|
25
|
-
},
|
|
26
|
-
"trustedDependencies": [
|
|
27
|
-
"@swc/core",
|
|
28
|
-
"@tailwindcss/oxide"
|
|
29
|
-
]
|
|
30
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "react-ts-tw",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "bunx --bun vite",
|
|
8
|
+
"build": "tsc -b && vite build",
|
|
9
|
+
"preview": "vite preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@tailwindcss/vite": "^4.1.11",
|
|
13
|
+
"react": "^19.1.0",
|
|
14
|
+
"react-dom": "^19.1.0",
|
|
15
|
+
"tailwindcss": "^4.1.11"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/react": "^19.1.8",
|
|
19
|
+
"@types/react-dom": "^19.1.6",
|
|
20
|
+
"@vitejs/plugin-react-swc": "^3.10.2",
|
|
21
|
+
"prettier": "^3.6.2",
|
|
22
|
+
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
23
|
+
"typescript": "~5.8.3",
|
|
24
|
+
"vite": "^7.0.4"
|
|
25
|
+
},
|
|
26
|
+
"trustedDependencies": [
|
|
27
|
+
"@swc/core",
|
|
28
|
+
"@tailwindcss/oxide"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function App() {
|
|
2
|
-
return (
|
|
3
|
-
<>
|
|
4
|
-
<h1 className="text-3xl font-bold underline">Hello</h1>
|
|
5
|
-
</>
|
|
6
|
-
)
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export default App
|
|
1
|
+
function App() {
|
|
2
|
+
return (
|
|
3
|
+
<>
|
|
4
|
+
<h1 className="text-3xl font-bold underline">Hello</h1>
|
|
5
|
+
</>
|
|
6
|
+
)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default App
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "tailwindcss";
|
|
1
|
+
@import "tailwindcss";
|