@kunver/new 3.2.0 → 3.3.1

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 (65) hide show
  1. package/README.MD +0 -2
  2. package/dist/index.js +11 -11
  3. package/dist/templates/cmake-cpp/README.md +32 -32
  4. package/dist/templates/cmake-cpp/agents.md +8 -8
  5. package/dist/templates/cmake-cpp/manager.ts +276 -276
  6. package/dist/templates/next-prisma/_prettierrc.json +12 -12
  7. package/dist/templates/next-prisma/manager.cjs +71 -71
  8. package/dist/templates/next-prisma/next.config.ts +7 -7
  9. package/dist/templates/next-prisma/postcss.config.mjs +5 -5
  10. package/dist/templates/react-ts-tw/README.md +1 -1
  11. package/dist/templates/react-ts-tw/_prettierrc.json +12 -12
  12. package/dist/templates/react-ts-tw/manager.cjs +71 -71
  13. package/dist/templates/react-ts-tw/src/index.css +1 -1
  14. package/dist/templates/react-ts-tw/src/main.tsx +10 -10
  15. package/dist/templates/react-ts-tw/tsconfig.json +4 -4
  16. package/dist/templates/react-ts-tw/vite.config.ts +8 -8
  17. package/dist/templates/wxt-solid/_prettierrc.json +11 -0
  18. package/dist/templates/wxt-solid/entrypoints/content/Content.tsx +7 -7
  19. package/dist/templates/wxt-solid/entrypoints/options/main.tsx +6 -6
  20. package/dist/templates/wxt-solid/entrypoints/popup/{App.tsx → Popup.tsx} +7 -7
  21. package/dist/templates/wxt-solid/entrypoints/popup/main.tsx +6 -6
  22. package/dist/templates/wxt-solid/manager.cjs +71 -71
  23. package/dist/templates/wxt-svelte/_prettierrc.json +11 -11
  24. package/dist/templates/wxt-svelte/entrypoints/content/index.ts +25 -25
  25. package/dist/templates/wxt-svelte/entrypoints/options/index.html +13 -13
  26. package/dist/templates/wxt-svelte/entrypoints/options/main.ts +9 -9
  27. package/dist/templates/wxt-svelte/entrypoints/popup/index.html +13 -13
  28. package/dist/templates/wxt-svelte/entrypoints/popup/main.ts +9 -9
  29. package/dist/templates/wxt-svelte/manager.cjs +71 -71
  30. package/dist/templates/wxt-vanilla/_prettierrc.json +11 -11
  31. package/dist/templates/wxt-vanilla/entrypoints/background.ts +3 -3
  32. package/dist/templates/wxt-vanilla/entrypoints/content.ts +6 -6
  33. package/dist/templates/wxt-vanilla/entrypoints/popup/main.ts +1 -1
  34. package/dist/templates/wxt-vanilla/manager.cjs +71 -71
  35. package/package.json +55 -55
  36. package/dist/templates/electron-svelte/README.md +0 -3
  37. package/dist/templates/electron-svelte/_gitignore +0 -6
  38. package/dist/templates/electron-svelte/_prettierignore +0 -6
  39. package/dist/templates/electron-svelte/_prettierrc.yaml +0 -13
  40. package/dist/templates/electron-svelte/build/entitlements.mac.plist +0 -12
  41. package/dist/templates/electron-svelte/build/icon.icns +0 -0
  42. package/dist/templates/electron-svelte/build/icon.ico +0 -0
  43. package/dist/templates/electron-svelte/build/icon.png +0 -0
  44. package/dist/templates/electron-svelte/bun.lock +0 -1154
  45. package/dist/templates/electron-svelte/electron-builder.yml +0 -44
  46. package/dist/templates/electron-svelte/electron.vite.config.ts +0 -15
  47. package/dist/templates/electron-svelte/manager.cjs +0 -71
  48. package/dist/templates/electron-svelte/package.json +0 -44
  49. package/dist/templates/electron-svelte/resources/icon.png +0 -0
  50. package/dist/templates/electron-svelte/src/main/index.ts +0 -62
  51. package/dist/templates/electron-svelte/src/preload/index.d.ts +0 -8
  52. package/dist/templates/electron-svelte/src/preload/index.ts +0 -22
  53. package/dist/templates/electron-svelte/src/renderer/index.html +0 -16
  54. package/dist/templates/electron-svelte/src/renderer/src/App.svelte +0 -8
  55. package/dist/templates/electron-svelte/src/renderer/src/assets/main.css +0 -1
  56. package/dist/templates/electron-svelte/src/renderer/src/env.d.ts +0 -2
  57. package/dist/templates/electron-svelte/src/renderer/src/main.ts +0 -11
  58. package/dist/templates/electron-svelte/svelte.config.mjs +0 -7
  59. package/dist/templates/electron-svelte/tsconfig.json +0 -4
  60. package/dist/templates/electron-svelte/tsconfig.node.json +0 -11
  61. package/dist/templates/electron-svelte/tsconfig.web.json +0 -17
  62. /package/dist/templates/wxt-solid/entrypoints/options/{App.tsx → Options.tsx} +0 -0
  63. /package/dist/templates/wxt-svelte/entrypoints/content/{App.svelte → Content.svelte} +0 -0
  64. /package/dist/templates/wxt-svelte/entrypoints/options/{App.svelte → Options.svelte} +0 -0
  65. /package/dist/templates/wxt-svelte/entrypoints/popup/{App.svelte → Popup.svelte} +0 -0
@@ -1,71 +1,71 @@
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
+ 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,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 +1 @@
1
- # React + TypeScript + TailwindCSS
1
+ # React + TypeScript + TailwindCSS
@@ -1,12 +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
+ {
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,71 +1,71 @@
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
+ 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 +1 @@
1
- @import "tailwindcss";
1
+ @import "tailwindcss";
@@ -1,10 +1,10 @@
1
- import { StrictMode } from "react"
2
- import { createRoot } from "react-dom/client"
3
- import "./index.css"
4
- import App from "./App.tsx"
5
-
6
- createRoot(document.getElementById("root")!).render(
7
- <StrictMode>
8
- <App />
9
- </StrictMode>,
10
- )
1
+ import { StrictMode } from "react"
2
+ import { createRoot } from "react-dom/client"
3
+ import "./index.css"
4
+ import App from "./App.tsx"
5
+
6
+ createRoot(document.getElementById("root")!).render(
7
+ <StrictMode>
8
+ <App />
9
+ </StrictMode>,
10
+ )
@@ -1,4 +1,4 @@
1
- {
2
- "files": [],
3
- "references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }]
4
- }
1
+ {
2
+ "files": [],
3
+ "references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }]
4
+ }
@@ -1,8 +1,8 @@
1
- import tailwindcss from "@tailwindcss/vite"
2
- import { defineConfig } from "vite"
3
- import react from "@vitejs/plugin-react-swc"
4
-
5
- // https://vite.dev/config/
6
- export default defineConfig({
7
- plugins: [react(), tailwindcss()],
8
- })
1
+ import tailwindcss from "@tailwindcss/vite"
2
+ import { defineConfig } from "vite"
3
+ import react from "@vitejs/plugin-react-swc"
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react(), tailwindcss()],
8
+ })
@@ -0,0 +1,11 @@
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
+ }
@@ -1,7 +1,7 @@
1
- export default function Content() {
2
- return (
3
- <div style={{ padding: "20px", "font-family": "sans-serif" }}>
4
- <h1>Hello, Content!</h1>
5
- </div>
6
- )
7
- }
1
+ export default function Content() {
2
+ return (
3
+ <div style={{ padding: "20px", "font-family": "sans-serif" }}>
4
+ <h1>Hello, Content!</h1>
5
+ </div>
6
+ )
7
+ }
@@ -1,6 +1,6 @@
1
- import { render } from "solid-js/web"
2
- import "~/assets/tailwind.css"
3
-
4
- import App from "./App"
5
-
6
- render(() => <App />, document.getElementById("root")!)
1
+ import { render } from "solid-js/web"
2
+ import "~/assets/tailwind.css"
3
+
4
+ import Options from "./Options"
5
+
6
+ render(() => <Options />, document.getElementById("root")!)
@@ -1,7 +1,7 @@
1
- export default function App() {
2
- return (
3
- <main>
4
- <h1>WXT + Solid</h1>
5
- </main>
6
- )
7
- }
1
+ export default function App() {
2
+ return (
3
+ <main>
4
+ <h1>WXT + Solid</h1>
5
+ </main>
6
+ )
7
+ }
@@ -1,6 +1,6 @@
1
- import { render } from "solid-js/web"
2
- import "~/assets/tailwind.css"
3
-
4
- import App from "./App"
5
-
6
- render(() => <App />, document.getElementById("root")!)
1
+ import { render } from "solid-js/web"
2
+ import "~/assets/tailwind.css"
3
+
4
+ import Popup from "./Popup"
5
+
6
+ render(() => <Popup />, document.getElementById("root")!)
@@ -1,71 +1,71 @@
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
+ 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,11 +1,11 @@
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
- }
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
+ }