@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.
- package/README.MD +0 -2
- package/dist/index.js +11 -11
- package/dist/templates/cmake-cpp/README.md +32 -32
- package/dist/templates/cmake-cpp/agents.md +8 -8
- package/dist/templates/cmake-cpp/manager.ts +276 -276
- package/dist/templates/next-prisma/_prettierrc.json +12 -12
- package/dist/templates/next-prisma/manager.cjs +71 -71
- package/dist/templates/next-prisma/next.config.ts +7 -7
- package/dist/templates/next-prisma/postcss.config.mjs +5 -5
- package/dist/templates/react-ts-tw/README.md +1 -1
- package/dist/templates/react-ts-tw/_prettierrc.json +12 -12
- package/dist/templates/react-ts-tw/manager.cjs +71 -71
- 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/tsconfig.json +4 -4
- package/dist/templates/react-ts-tw/vite.config.ts +8 -8
- package/dist/templates/wxt-solid/_prettierrc.json +11 -0
- package/dist/templates/wxt-solid/entrypoints/content/Content.tsx +7 -7
- package/dist/templates/wxt-solid/entrypoints/options/main.tsx +6 -6
- package/dist/templates/wxt-solid/entrypoints/popup/{App.tsx → Popup.tsx} +7 -7
- package/dist/templates/wxt-solid/entrypoints/popup/main.tsx +6 -6
- package/dist/templates/wxt-solid/manager.cjs +71 -71
- package/dist/templates/wxt-svelte/_prettierrc.json +11 -11
- package/dist/templates/wxt-svelte/entrypoints/content/index.ts +25 -25
- package/dist/templates/wxt-svelte/entrypoints/options/index.html +13 -13
- package/dist/templates/wxt-svelte/entrypoints/options/main.ts +9 -9
- package/dist/templates/wxt-svelte/entrypoints/popup/index.html +13 -13
- package/dist/templates/wxt-svelte/entrypoints/popup/main.ts +9 -9
- package/dist/templates/wxt-svelte/manager.cjs +71 -71
- package/dist/templates/wxt-vanilla/_prettierrc.json +11 -11
- 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/main.ts +1 -1
- package/dist/templates/wxt-vanilla/manager.cjs +71 -71
- package/package.json +55 -55
- package/dist/templates/electron-svelte/README.md +0 -3
- package/dist/templates/electron-svelte/_gitignore +0 -6
- package/dist/templates/electron-svelte/_prettierignore +0 -6
- package/dist/templates/electron-svelte/_prettierrc.yaml +0 -13
- 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 -71
- 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/wxt-solid/entrypoints/options/{App.tsx → Options.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,25 +1,25 @@
|
|
|
1
|
-
import { mount, unmount } from "svelte"
|
|
2
|
-
import
|
|
3
|
-
import "~/assets/tailwind.css"
|
|
4
|
-
|
|
5
|
-
export default defineContentScript({
|
|
6
|
-
matches: ["<all_urls>"],
|
|
7
|
-
|
|
8
|
-
cssInjectionMode: "ui",
|
|
9
|
-
|
|
10
|
-
async main(ctx) {
|
|
11
|
-
const ui = await createShadowRootUi(ctx, {
|
|
12
|
-
name: "ext-ui",
|
|
13
|
-
position: "inline",
|
|
14
|
-
anchor: "body",
|
|
15
|
-
onMount: container => {
|
|
16
|
-
return mount(
|
|
17
|
-
},
|
|
18
|
-
onRemove:
|
|
19
|
-
unmount(
|
|
20
|
-
},
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
ui.mount()
|
|
24
|
-
},
|
|
25
|
-
})
|
|
1
|
+
import { mount, unmount } from "svelte"
|
|
2
|
+
import Content from "./Content.svelte"
|
|
3
|
+
import "~/assets/tailwind.css"
|
|
4
|
+
|
|
5
|
+
export default defineContentScript({
|
|
6
|
+
matches: ["<all_urls>"],
|
|
7
|
+
|
|
8
|
+
cssInjectionMode: "ui",
|
|
9
|
+
|
|
10
|
+
async main(ctx) {
|
|
11
|
+
const ui = await createShadowRootUi(ctx, {
|
|
12
|
+
name: "ext-ui",
|
|
13
|
+
position: "inline",
|
|
14
|
+
anchor: "body",
|
|
15
|
+
onMount: container => {
|
|
16
|
+
return mount(Content, { target: container })
|
|
17
|
+
},
|
|
18
|
+
onRemove: content => {
|
|
19
|
+
unmount(content as any)
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
ui.mount()
|
|
24
|
+
},
|
|
25
|
+
})
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<meta name="manifest.open_in_tab" content="true" />
|
|
7
|
-
<title>Options</title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="app"></div>
|
|
11
|
-
<script type="module" src="./main.ts"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<meta name="manifest.open_in_tab" content="true" />
|
|
7
|
+
<title>Options</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="./main.ts"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { mount } from "svelte"
|
|
2
|
-
import
|
|
3
|
-
import "~/assets/tailwind.css"
|
|
4
|
-
|
|
5
|
-
const app = mount(
|
|
6
|
-
target: document.getElementById("app")!,
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
export default app
|
|
1
|
+
import { mount } from "svelte"
|
|
2
|
+
import Options from "./Options.svelte"
|
|
3
|
+
import "~/assets/tailwind.css"
|
|
4
|
+
|
|
5
|
+
const app = mount(Options, {
|
|
6
|
+
target: document.getElementById("app")!,
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
export default app
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>Popup</title>
|
|
7
|
-
<meta name="manifest.type" content="browser_action" />
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="app"></div>
|
|
11
|
-
<script type="module" src="./main.ts"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Popup</title>
|
|
7
|
+
<meta name="manifest.type" content="browser_action" />
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="./main.ts"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { mount } from "svelte"
|
|
2
|
-
import
|
|
3
|
-
import "~/assets/tailwind.css"
|
|
4
|
-
|
|
5
|
-
const app = mount(
|
|
6
|
-
target: document.getElementById("app")!,
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
export default app
|
|
1
|
+
import { mount } from "svelte"
|
|
2
|
+
import Popup from "./Popup.svelte"
|
|
3
|
+
import "~/assets/tailwind.css"
|
|
4
|
+
|
|
5
|
+
const app = mount(Popup, {
|
|
6
|
+
target: document.getElementById("app")!,
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
export default app
|
|
@@ -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
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default defineBackground(() => {
|
|
2
|
-
console.log("Hello background!", { id: browser.runtime.id })
|
|
3
|
-
})
|
|
1
|
+
export default defineBackground(() => {
|
|
2
|
+
console.log("Hello background!", { id: browser.runtime.id })
|
|
3
|
+
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export default defineContentScript({
|
|
2
|
-
matches: ["*://*.google.com/*"],
|
|
3
|
-
main() {
|
|
4
|
-
console.log("Hello content.")
|
|
5
|
-
},
|
|
6
|
-
})
|
|
1
|
+
export default defineContentScript({
|
|
2
|
+
matches: ["*://*.google.com/*"],
|
|
3
|
+
main() {
|
|
4
|
+
console.log("Hello content.")
|
|
5
|
+
},
|
|
6
|
+
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import "./style.css"
|
|
1
|
+
import "./style.css"
|
|
@@ -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)
|
package/package.json
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@kunver/new",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Opinionated project starter",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"kunver": "dist/index.js"
|
|
8
|
-
},
|
|
9
|
-
"main": "dist/index.js",
|
|
10
|
-
"files": [
|
|
11
|
-
"dist"
|
|
12
|
-
],
|
|
13
|
-
"publishConfig": {
|
|
14
|
-
"access": "public"
|
|
15
|
-
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "tsup",
|
|
18
|
-
"start": "bun dist/index.js",
|
|
19
|
-
"dev": "bun run build && bun run start",
|
|
20
|
-
"test": "vitest run",
|
|
21
|
-
"test:watch": "vitest",
|
|
22
|
-
"format": "bunx prettier --write .",
|
|
23
|
-
"prepublishOnly": "bun run build",
|
|
24
|
-
"local": "bun run build && bun link",
|
|
25
|
-
"manager": "bun manager.cjs bun",
|
|
26
|
-
"patch": "bun pm version patch && git push",
|
|
27
|
-
"minor": "bun pm version minor && git push",
|
|
28
|
-
"major": "bun pm version major && git push",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
},
|
|
33
|
-
"keywords": [
|
|
34
|
-
"project starter",
|
|
35
|
-
"cli",
|
|
36
|
-
"template",
|
|
37
|
-
"opinionated"
|
|
38
|
-
],
|
|
39
|
-
"author": "Burak Unver <burakhanunver@gmail.com> (https://kunver.dev)",
|
|
40
|
-
"license": "MIT",
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"@inquirer/prompts": "^7.10.1",
|
|
43
|
-
"chalk": "^5.6.2",
|
|
44
|
-
"execa": "^9.6.1",
|
|
45
|
-
"ora": "^8.2.0"
|
|
46
|
-
},
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"@types/bun": "^1.3.9",
|
|
49
|
-
"@types/node": "^24.11.0",
|
|
50
|
-
"prettier": "3.8.1",
|
|
51
|
-
"tsup": "^8.5.1",
|
|
52
|
-
"typescript": "^5.9.3",
|
|
53
|
-
"vitest": "^4.0.18"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@kunver/new",
|
|
3
|
+
"version": "3.3.1",
|
|
4
|
+
"description": "Opinionated project starter",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"kunver": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsup",
|
|
18
|
+
"start": "bun dist/index.js",
|
|
19
|
+
"dev": "bun run build && bun run start",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"test:watch": "vitest",
|
|
22
|
+
"format": "bunx prettier --write .",
|
|
23
|
+
"prepublishOnly": "bun run build",
|
|
24
|
+
"local": "bun run build && bun link",
|
|
25
|
+
"manager": "bun manager.cjs bun",
|
|
26
|
+
"patch": "bun pm version patch && git push",
|
|
27
|
+
"minor": "bun pm version minor && git push",
|
|
28
|
+
"major": "bun pm version major && git push",
|
|
29
|
+
"patch-publish": "bun run patch && bun run manager publish",
|
|
30
|
+
"minor-publish": "bun run minor && bun run manager publish",
|
|
31
|
+
"major-publish": "bun run major && bun run manager publish"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"project starter",
|
|
35
|
+
"cli",
|
|
36
|
+
"template",
|
|
37
|
+
"opinionated"
|
|
38
|
+
],
|
|
39
|
+
"author": "Burak Unver <burakhanunver@gmail.com> (https://kunver.dev)",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@inquirer/prompts": "^7.10.1",
|
|
43
|
+
"chalk": "^5.6.2",
|
|
44
|
+
"execa": "^9.6.1",
|
|
45
|
+
"ora": "^8.2.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/bun": "^1.3.9",
|
|
49
|
+
"@types/node": "^24.11.0",
|
|
50
|
+
"prettier": "3.8.1",
|
|
51
|
+
"tsup": "^8.5.1",
|
|
52
|
+
"typescript": "^5.9.3",
|
|
53
|
+
"vitest": "^4.0.18"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>com.apple.security.cs.allow-jit</key>
|
|
6
|
-
<true/>
|
|
7
|
-
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
|
8
|
-
<true/>
|
|
9
|
-
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
|
10
|
-
<true/>
|
|
11
|
-
</dict>
|
|
12
|
-
</plist>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|