@kunver/new 2.10.0 → 2.11.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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import J,{readFileSync,constants,promises}from'fs';import S,{dirname,join}from'path';import {input,select}from'@inquirer/prompts';import i from'chalk';import {access,mkdir,writeFile,readFile}from'fs/promises';import {spawn}from'child_process';import O from'ora';import {execa}from'execa';import {fileURLToPath}from'url';async function g(e){let{name:o,cwd:t=process.cwd()}=e,a=join(t,o);try{await access(a,constants.F_OK);}catch{await mkdir(a,{recursive:true});}let r=join(a,"main.ipynb");await writeFile(r,"");}var P=["react-ts-tw","next-ts-prisma","wxt...","electron-svelte","python-notebook","cpp-makefile"],M=["bun","pnpm","npm"],F=["no","windsurf","cursor","code"],E=["solid","svelte","vanilla"];async function m(e,o,t){switch(e){case "pnpm":return await R(o,t);case "bun":return await X(o,t);default:return false}}async function R(e,o){let t=O("Approving builds for "+i.blue(e)).start();try{return new Promise(a=>{let r=spawn("pnpm",["approve-builds"],{cwd:`${o}/${e}`,stdio:["pipe","inherit","inherit"],shell:!0});setTimeout(()=>{r.stdin?.write(`a
1
+ import J,{readFileSync,constants,promises}from'fs';import S,{dirname,join}from'path';import {input,select}from'@inquirer/prompts';import i from'chalk';import {access,mkdir,writeFile,readFile}from'fs/promises';import {spawn}from'child_process';import O from'ora';import {execa}from'execa';import {fileURLToPath}from'url';async function g(e){let{name:o,cwd:t=process.cwd()}=e,a=join(t,o);try{await access(a,constants.F_OK);}catch{await mkdir(a,{recursive:true});}let r=join(a,"main.ipynb");await writeFile(r,"");}var P=["react-ts-tw","next-ts-prisma","wxt...","electron-svelte","python-notebook","cpp-makefile"],M=["bun","pnpm","npm"],F=["antigravity","no","cursor","code"],E=["svelte","vanilla"];async function m(e,o,t){switch(e){case "pnpm":return await R(o,t);case "bun":return await X(o,t);default:return false}}async function R(e,o){let t=O("Approving builds for "+i.blue(e)).start();try{return new Promise(a=>{let r=spawn("pnpm",["approve-builds"],{cwd:`${o}/${e}`,stdio:["pipe","inherit","inherit"],shell:!0});setTimeout(()=>{r.stdin?.write(`a
2
2
  `),setTimeout(()=>{r.stdin?.write(`y
3
3
  `),r.stdin?.end();},1e3);},2e3),r.on("close",n=>{n===0?(t.succeed("Approved builds for "+i.blue(e)),a(!0)):(t.fail("Failed to approve builds for "+i.blue(e)),a(!1));}),r.on("error",n=>{t.fail("Failed to approve builds for "+i.blue(e)),console.error(n),a(!1);});})}catch(a){return t.fail("Failed to approve builds for "+i.blue(e)),console.error(a),false}}async function X(e,o){let t=`cd ${e} && bun pm trust --all`,a=O("Approving builds for "+i.blue(e)).start();try{return await execa(t,{shell:!0,cwd:o}),a.succeed("Approved builds for "+i.blue(e)),!0}catch{return a.fail("Failed to approve builds for "+i.blue(e)),false}}async function u(e,o,t){let a=`cd ${o} && ${e} install`;console.log("Installing dependencies with "+i.cyan(e)+`
4
4
  `);try{return await execa(a,{shell:!0,cwd:t,stdout:"inherit",stderr:"inherit"}),!0}catch{return false}}async function w(e,o){let t=O("Copying template folder...").start();try{await promises.cp(e,o,{recursive:!0});let a=S.join(o,"_gitignore"),r=S.join(o,".gitignore");try{await promises.rename(a,r);}catch{}return t.succeed("Copied template folder"),!0}catch{return t.fail("Failed to copy template folder"),false}}async function y(e,o,t){let a=join(t,o,"package.json"),r=await J.promises.readFile(a,"utf-8"),n=JSON.parse(r);e==="bun"?n.scripts.manager=`bun manager.cjs ${e}`:n.scripts.manager=`node manager.cjs ${e}`,await J.promises.writeFile(a,JSON.stringify(n,null,2));}async function b(e,o,t){console.log(i.white("Opening "+i.blue(e)+" in "+i.green(t)));try{return await execa(`${t} ${e}`,{shell:!0,cwd:o}),!0}catch(a){return console.error(i.red("Failed to open project in editor:"),a),false}}async function s(e){let{templateName:o,name:t,packageManager:a,cwd:r=process.cwd(),addManager:n=true,changeName:p=true,approveBuild:l=true,installDependency:A=true}=e,_=join(__dirname,"templates",o);try{if(!await w(_,join(r,t)))throw new Error("Failed to copy template folder");if(A&&!await u(a,t,r))throw new Error("Failed to install dependencies");return n&&await y(a,t,r),l&&await m(a,t,r),p&&await k(join(r,t),t),!0}catch(f){throw console.error("Error creating project:",f),f}}async function k(e,o){try{let t=join(e,"package.json"),a=await readFile(t,"utf-8"),r=JSON.parse(a);return r.name=o.toLowerCase().replace(/\s+/g,"-"),await writeFile(t,JSON.stringify(r,null,2)+`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kunver/new",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "description": "Opiniated project starter",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,3 +0,0 @@
1
- # WXT + SolidJS
2
-
3
- This template should help get you started developing with SolidJS in WXT.
@@ -1,26 +0,0 @@
1
- # Logs
2
- logs
3
- *.log
4
- npm-debug.log*
5
- yarn-debug.log*
6
- yarn-error.log*
7
- pnpm-debug.log*
8
- lerna-debug.log*
9
-
10
- node_modules
11
- .output
12
- stats.html
13
- stats-*.json
14
- .wxt
15
- web-ext.config.ts
16
-
17
- # Editor directories and files
18
- .vscode/*
19
- !.vscode/extensions.json
20
- .idea
21
- .DS_Store
22
- *.suo
23
- *.ntvs*
24
- *.njsproj
25
- *.sln
26
- *.sw?
@@ -1 +0,0 @@
1
- @import "tailwindcss";
@@ -1,3 +0,0 @@
1
- export default defineBackground(() => {
2
- console.log('Hello background!', { id: browser.runtime.id });
3
- });
@@ -1,6 +0,0 @@
1
- export default defineContentScript({
2
- matches: ['*://*.google.com/*'],
3
- main() {
4
- console.log('Hello content.');
5
- },
6
- });
@@ -1,11 +0,0 @@
1
- //import { createSignal } from "solid-js"
2
-
3
- function App() {
4
- return (
5
- <>
6
- <h1>WXT + Solid</h1>
7
- </>
8
- )
9
- }
10
-
11
- export default App
@@ -1,13 +0,0 @@
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>Solid Wxt</title>
7
- <meta name="manifest.type" content="browser_action" />
8
- </head>
9
- <body>
10
- <div id="root"></div>
11
- <script type="module" src="./main.tsx"></script>
12
- </body>
13
- </html>
@@ -1,5 +0,0 @@
1
- import { render } from "solid-js/web"
2
- import "~/assets/tailwind.css"
3
- import App from "./App"
4
-
5
- render(() => <App />, document.getElementById("root")!)
@@ -1,69 +0,0 @@
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(`Invalid or missing arguments. Usage: node manager.cjs <package-manager> <push|publish>\nValid package managers: ${validManagers.join(", ")}`)
66
- process.exit(1)
67
- }
68
-
69
- publishAndPushOperations(packageManagerArg, commandArg)
@@ -1,32 +0,0 @@
1
- {
2
- "name": "wxt-solid-starter",
3
- "description": "manifest.json description",
4
- "private": true,
5
- "version": "0.0.0",
6
- "type": "module",
7
- "scripts": {
8
- "dev": "wxt",
9
- "dev:firefox": "wxt -b firefox",
10
- "build": "wxt build",
11
- "build:firefox": "wxt build -b firefox",
12
- "zip": "wxt zip",
13
- "zip:firefox": "wxt zip -b firefox",
14
- "compile": "tsc --noEmit",
15
- "postinstall": "wxt prepare"
16
- },
17
- "dependencies": {
18
- "solid-js": "^1.9.9"
19
- },
20
- "devDependencies": {
21
- "@tailwindcss/vite": "^4.1.12",
22
- "tailwindcss": "^4.1.12",
23
- "@wxt-dev/module-solid": "^1.1.3",
24
- "typescript": "^5.9.2",
25
- "wxt": "^0.20.6"
26
- },
27
- "trustedDependencies": [
28
- "@tailwindcss/oxide",
29
- "esbuild",
30
- "spawn-sync"
31
- ]
32
- }
@@ -1,15 +0,0 @@
1
- <svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <g clip-path="url(#clip0_305_516)">
3
- <g clip-path="url(#clip1_305_516)">
4
- <path d="M49.0229 69.1875C54.1272 69.1875 58.265 65.0497 58.265 59.9454V50.7033H59.9454C65.0497 50.7033 69.1875 46.5655 69.1875 41.4612C69.1875 36.357 65.0497 32.2191 59.9454 32.2191H58.265V22.9771C58.265 17.8728 54.1272 13.735 49.0229 13.735H39.7809V12.0546C39.7809 6.95032 35.643 2.8125 30.5388 2.8125C25.4345 2.8125 21.2967 6.95032 21.2967 12.0546V13.735H12.0546C6.95032 13.735 2.8125 17.8728 2.8125 22.9771V32.2191H4.49288C9.59714 32.2191 13.735 36.357 13.735 41.4612C13.735 46.5655 9.59714 50.7033 4.49288 50.7033H2.8125V69.1875H21.2967V67.5071C21.2967 62.4029 25.4345 58.265 30.5388 58.265C35.643 58.265 39.7809 62.4029 39.7809 67.5071V69.1875H49.0229Z" stroke="#67D55E" stroke-width="5.625"/>
5
- </g>
6
- </g>
7
- <defs>
8
- <clipPath id="clip0_305_516">
9
- <rect width="72" height="72" fill="white"/>
10
- </clipPath>
11
- <clipPath id="clip1_305_516">
12
- <rect width="72" height="72" fill="white"/>
13
- </clipPath>
14
- </defs>
15
- </svg>
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "./.wxt/tsconfig.json",
3
- "compilerOptions": {
4
- "jsx": "preserve",
5
- "jsxImportSource": "solid-js"
6
- }
7
- }
@@ -1,13 +0,0 @@
1
- import { defineConfig } from 'wxt';
2
- import tailwindcss from '@tailwindcss/vite';
3
-
4
- // See https://wxt.dev/api/config.html
5
- export default defineConfig({
6
- modules: ['@wxt-dev/module-solid'],
7
- vite: () => ({
8
- plugins: [tailwindcss()],
9
- }),
10
- webExt: {
11
- disabled: true,
12
- },
13
- });