@kunver/new 2.12.0 → 2.14.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.
Files changed (42) hide show
  1. package/README.MD +6 -3
  2. package/dist/index.js +2 -2
  3. package/dist/templates/wxt-solid/README.md +3 -0
  4. package/dist/templates/wxt-solid/_gitignore +26 -0
  5. package/dist/templates/wxt-solid/agents.md +76 -0
  6. package/dist/templates/wxt-solid/bun.lock +1045 -0
  7. package/dist/templates/wxt-solid/entrypoints/content/Content.tsx +7 -0
  8. package/dist/templates/wxt-solid/entrypoints/content/main.tsx +31 -0
  9. package/dist/templates/wxt-solid/entrypoints/options/App.tsx +8 -0
  10. package/dist/templates/wxt-solid/entrypoints/options/index.html +13 -0
  11. package/dist/templates/wxt-solid/entrypoints/options/main.tsx +6 -0
  12. package/dist/templates/wxt-solid/entrypoints/popup/App.tsx +7 -0
  13. package/dist/templates/wxt-solid/entrypoints/popup/index.html +13 -0
  14. package/dist/templates/wxt-solid/entrypoints/popup/main.tsx +6 -0
  15. package/dist/templates/wxt-solid/manager.cjs +69 -0
  16. package/dist/templates/wxt-solid/package.json +33 -0
  17. package/dist/templates/wxt-solid/public/icon/128.png +0 -0
  18. package/dist/templates/wxt-solid/public/icon/16.png +0 -0
  19. package/dist/templates/wxt-solid/public/icon/32.png +0 -0
  20. package/dist/templates/wxt-solid/public/icon/48.png +0 -0
  21. package/dist/templates/wxt-solid/public/icon/96.png +0 -0
  22. package/dist/templates/wxt-solid/tsconfig.json +7 -0
  23. package/dist/templates/wxt-solid/wxt.config.ts +18 -0
  24. package/dist/templates/wxt-svelte/agents.md +16 -2
  25. package/dist/templates/wxt-svelte/assets/tailwind.css +1 -0
  26. package/dist/templates/wxt-svelte/entrypoints/background.ts +3 -0
  27. package/dist/templates/wxt-svelte/package.json +1 -1
  28. package/dist/templates/wxt-svelte/wxt.config.ts +1 -2
  29. package/dist/templates/wxt-vanilla/agents.md +73 -0
  30. package/dist/templates/wxt-vanilla/package.json +2 -2
  31. package/dist/templates/wxt-vanilla/wxt.config.ts +1 -0
  32. package/package.json +42 -42
  33. /package/dist/templates/{wxt-svelte/src → wxt-solid}/assets/tailwind.css +0 -0
  34. /package/dist/templates/{wxt-svelte/src → wxt-solid}/entrypoints/background.ts +0 -0
  35. /package/dist/templates/wxt-svelte/{src/entrypoints → entrypoints}/content/App.svelte +0 -0
  36. /package/dist/templates/wxt-svelte/{src/entrypoints → entrypoints}/content/index.ts +0 -0
  37. /package/dist/templates/wxt-svelte/{src/entrypoints → entrypoints}/options/App.svelte +0 -0
  38. /package/dist/templates/wxt-svelte/{src/entrypoints → entrypoints}/options/index.html +0 -0
  39. /package/dist/templates/wxt-svelte/{src/entrypoints → entrypoints}/options/main.ts +0 -0
  40. /package/dist/templates/wxt-svelte/{src/entrypoints → entrypoints}/popup/App.svelte +0 -0
  41. /package/dist/templates/wxt-svelte/{src/entrypoints → entrypoints}/popup/index.html +0 -0
  42. /package/dist/templates/wxt-svelte/{src/entrypoints → entrypoints}/popup/main.ts +0 -0
@@ -0,0 +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
+ }
@@ -0,0 +1,31 @@
1
+ // 1. Import the style
2
+ import "~/assets/tailwind.css"
3
+ import { render } from "solid-js/web"
4
+ import Content from "./Content"
5
+
6
+ export default defineContentScript({
7
+ matches: ["<all_urls>"],
8
+ // 2. Set cssInjectionMode
9
+ cssInjectionMode: "ui",
10
+
11
+ async main(ctx) {
12
+ // 3. Define your UI
13
+ const ui = await createShadowRootUi(ctx, {
14
+ name: "example-ui",
15
+ position: "inline",
16
+ anchor: "body",
17
+ onMount: container => {
18
+ // Render your app to the UI container
19
+ const unmount = render(() => <Content />, container)
20
+ return unmount
21
+ },
22
+ onRemove: unmount => {
23
+ // Unmount the app when the UI is removed
24
+ unmount?.()
25
+ },
26
+ })
27
+
28
+ // 4. Mount the UI
29
+ ui.mount()
30
+ },
31
+ })
@@ -0,0 +1,8 @@
1
+ export default function App() {
2
+ return (
3
+ <main>
4
+ <h1>Options</h1>
5
+ </main>
6
+ )
7
+ }
8
+
@@ -0,0 +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>Options</title>
7
+ <meta name="manifest.open_in_tab" content="true" />
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="./main.tsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +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")!)
@@ -0,0 +1,7 @@
1
+ export default function App() {
2
+ return (
3
+ <main>
4
+ <h1>WXT + Solid</h1>
5
+ </main>
6
+ )
7
+ }
@@ -0,0 +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>Default Popup Title</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>
@@ -0,0 +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")!)
@@ -0,0 +1,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(`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)
@@ -0,0 +1,33 @@
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:all": "bun --parallel zip zip:firefox",
14
+ "zip:firefox": "wxt zip -b firefox",
15
+ "compile": "tsc --noEmit",
16
+ "postinstall": "wxt prepare",
17
+ "resize": "bunx @kunver/resize",
18
+ "manager": "bun manager.cjs bun"
19
+ },
20
+ "dependencies": {
21
+ "solid-js": "^1.9.11"
22
+ },
23
+ "devDependencies": {
24
+ "tailwindcss": "^4.2.1",
25
+ "@tailwindcss/vite": "^4.2.1",
26
+ "@wxt-dev/module-solid": "^1.1.4",
27
+ "typescript": "^5.9.3",
28
+ "wxt": "^0.20.18"
29
+ },
30
+ "trustedDependencies": [
31
+ "spawn-sync"
32
+ ]
33
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "./.wxt/tsconfig.json",
3
+ "compilerOptions": {
4
+ "jsx": "preserve",
5
+ "jsxImportSource": "solid-js"
6
+ }
7
+ }
@@ -0,0 +1,18 @@
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
+ manifest: {
7
+ name: "wxt-solid-starter",
8
+ description: "manifest.json description",
9
+ //permissions: ["storage"],
10
+ },
11
+ modules: ["@wxt-dev/module-solid"],
12
+ vite: () => ({
13
+ plugins: [tailwindcss()],
14
+ }),
15
+ webExt: {
16
+ disabled: true,
17
+ },
18
+ })
@@ -1,5 +1,5 @@
1
1
  - This is a Web Extension Project
2
- - Goal : Create timestamps and chapters for youtube video using AI
2
+ - Goal : <goal>
3
3
 
4
4
  - This project uses wxt framework for development. wxt is a extension development framework.
5
5
  - website to framework is : https://wxt.dev/
@@ -22,7 +22,7 @@ WXT Modules added to your project can modify your manifest
22
22
  Hooks defined in your project can modify your manifest
23
23
  Your extension's manifest.json will be output to .output/{target}/manifest.json when running wxt build.
24
24
 
25
- - this extension should work on youtube/watch\* urls
25
+ - this extension should work <url>
26
26
  - this project uses svelte 5 for frontend.
27
27
  - this extension aims manifest v3
28
28
  - this project uses tailwindcss v4 for styling.
@@ -41,12 +41,26 @@ Your extension's manifest.json will be output to .output/{target}/manifest.json
41
41
  - Please check project if I already defined a store
42
42
  - use "local:" prefix when storing data locally
43
43
 
44
+ ## Storage
45
+
46
+ - When we need storage we should use WXT Storage, you should import it from "#imports".
47
+ - Please check project if I already defined a store
48
+ - use "local:" prefix when storing data locally
49
+
44
50
  ```ts
45
51
  // utils/storage.ts
46
52
  import { storage } from "#imports"
47
53
  const showChangelogOnUpdate = storage.defineItem<boolean>("local:showChangelogOnUpdate", {
48
54
  fallback: true,
49
55
  })
56
+
57
+ // usage
58
+ await showChangelogOnUpdate.getValue()
59
+ await showChangelogOnUpdate.setValue(false)
60
+ await showChangelogOnUpdate.removeValue()
61
+ const unwatch = showChangelogOnUpdate.watch(newValue => {
62
+ // ...
63
+ })
50
64
  ```
51
65
 
52
66
  ## i18n usage
@@ -0,0 +1 @@
1
+ @import "tailwindcss";
@@ -0,0 +1,3 @@
1
+ export default defineBackground(() => {
2
+ console.log("Hello background!", { id: browser.runtime.id })
3
+ })
@@ -9,12 +9,12 @@
9
9
  "dev:firefox": "wxt -b firefox",
10
10
  "build": "wxt build",
11
11
  "build:firefox": "wxt build -b firefox",
12
- "resize": "bunx @kunver/resize",
13
12
  "zip": "wxt zip",
14
13
  "zip:all": "bun --parallel zip zip:firefox",
15
14
  "zip:firefox": "wxt zip -b firefox",
16
15
  "check": "svelte-check --tsconfig ./tsconfig.json",
17
16
  "postinstall": "wxt prepare",
17
+ "resize": "bunx @kunver/resize",
18
18
  "manager": "bun manager.cjs bun"
19
19
  },
20
20
  "devDependencies": {
@@ -3,11 +3,10 @@ import tailwindcss from "@tailwindcss/vite"
3
3
 
4
4
  // See https://wxt.dev/api/config.html
5
5
  export default defineConfig({
6
- srcDir: "src",
7
6
  manifest: {
8
7
  name: "wxt-svelte-starter",
9
8
  description: "manifest.json description",
10
- permission: [],
9
+ //permissions: ["storage"],
11
10
  },
12
11
  modules: ["@wxt-dev/module-svelte"],
13
12
  vite: () => ({
@@ -0,0 +1,73 @@
1
+ - This is a Web Extension Project
2
+ - Goal : <goal>
3
+
4
+ - This project uses wxt framework for development. wxt is a extension development framework.
5
+ - website to framework is : https://wxt.dev/
6
+ - you can find docs on these websites :
7
+
8
+ 1. https://wxt.dev//knowledge/docs.txt
9
+ 2. https://wxt.dev//knowledge/api-reference.txt
10
+
11
+ - use browser super global whenever you want to use chrome global. wxt uses browser global for development
12
+ for example:
13
+ browser.runtime.getURL() instead of chrome.runtime.getURL()
14
+
15
+ ## Manifest :
16
+
17
+ In WXT, there is no manifest.json file in your source code. Instead, WXT generates the manifest from multiple sources:
18
+
19
+ Global options defined in wxt.config.ts file
20
+ Entrypoint-specific options defined in your entrypoints
21
+ WXT Modules added to your project can modify your manifest
22
+ Hooks defined in your project can modify your manifest
23
+ Your extension's manifest.json will be output to .output/{target}/manifest.json when running wxt build.
24
+
25
+ - this extension aims manifest v3
26
+ - this project uses typescript for development.
27
+ - this project uses prettier for code formatting.
28
+ - this project uses vite.
29
+ - this project uses bun package manager, not npm.
30
+ - I should have a .prettierrc.json file in the root directory. please also follow rules on that.
31
+
32
+ - entrypoints are in src/entrypoints directory
33
+
34
+ ## Storage
35
+
36
+ - When we need storage we should use WXT Storage, you should import it from "#imports".
37
+ - Please check project if I already defined a store
38
+ - use "local:" prefix when storing data locally
39
+
40
+ ## Storage
41
+
42
+ - When we need storage we should use WXT Storage, you should import it from "#imports".
43
+ - Please check project if I already defined a store
44
+ - use "local:" prefix when storing data locally
45
+
46
+ ```ts
47
+ // utils/storage.ts
48
+ import { storage } from "#imports"
49
+ const showChangelogOnUpdate = storage.defineItem<boolean>("local:showChangelogOnUpdate", {
50
+ fallback: true,
51
+ })
52
+
53
+ // usage
54
+ await showChangelogOnUpdate.getValue()
55
+ await showChangelogOnUpdate.setValue(false)
56
+ await showChangelogOnUpdate.removeValue()
57
+ const unwatch = showChangelogOnUpdate.watch(newValue => {
58
+ // ...
59
+ })
60
+ ```
61
+
62
+ ## i18n usage
63
+
64
+ - when needed, use @wxt-dev/i18n, and import from "#i18n"
65
+ - translations will be in <srcDir>/locales/ directory, and will be yml files.
66
+
67
+ - usage example
68
+
69
+ ```ts
70
+ import { i18n } from "#i18n"
71
+
72
+ i18n.t("helloWorld") // "Hello world!"
73
+ ```
@@ -8,13 +8,13 @@
8
8
  "dev": "wxt",
9
9
  "dev:firefox": "wxt -b firefox",
10
10
  "build": "wxt build",
11
- "resize":"bunx @kunver/resize",
12
11
  "build:firefox": "wxt build -b firefox",
13
12
  "zip": "wxt zip",
14
- "zip:all": "concurrently \"bunx wxt zip -b firefox\" \"bunx wxt zip -b chrome\" \"bunx wxt zip -b edge\"",
13
+ "zip:all": "bun --parallel zip zip:firefox",
15
14
  "zip:firefox": "wxt zip -b firefox",
16
15
  "compile": "tsc --noEmit",
17
16
  "postinstall": "wxt prepare",
17
+ "resize": "bunx @kunver/resize",
18
18
  "manager": "bun manager.cjs bun"
19
19
  },
20
20
  "devDependencies": {
@@ -5,6 +5,7 @@ export default defineConfig({
5
5
  manifest: {
6
6
  name: "wxt-vanilla-starter",
7
7
  description: "manifest.json description",
8
+ //permissions: ["storage"],
8
9
  },
9
10
  webExt: {
10
11
  disabled: true,
package/package.json CHANGED
@@ -1,42 +1,42 @@
1
- {
2
- "name": "@kunver/new",
3
- "version": "2.12.0",
4
- "description": "Opiniated 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 src/index.ts",
20
- "prepublishOnly": "bun run build",
21
- "local": "bun run build && bun link",
22
- "manager": "bun manager.cjs bun",
23
- "patch": "bun pm version patch && git push",
24
- "minor": "bun pm version minor && git push",
25
- "major": "bun pm version major && git push"
26
- },
27
- "keywords": [],
28
- "author": "Burak Unver <burakhanunver@gmail.com> (https://kunver.dev)",
29
- "license": "MIT",
30
- "dependencies": {
31
- "@inquirer/prompts": "^7.8.4",
32
- "chalk": "^5.6.0",
33
- "execa": "^9.6.0",
34
- "ora": "^8.2.0"
35
- },
36
- "devDependencies": {
37
- "@types/bun": "^1.2.21",
38
- "@types/node": "^24.3.0",
39
- "tsup": "^8.5.0",
40
- "typescript": "^5.9.2"
41
- }
42
- }
1
+ {
2
+ "name": "@kunver/new",
3
+ "version": "2.14.0",
4
+ "description": "Opiniated 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 src/index.ts",
20
+ "prepublishOnly": "bun run build",
21
+ "local": "bun run build && bun link",
22
+ "manager": "bun manager.cjs bun",
23
+ "patch": "bun pm version patch && git push",
24
+ "minor": "bun pm version minor && git push",
25
+ "major": "bun pm version major && git push"
26
+ },
27
+ "keywords": [],
28
+ "author": "Burak Unver <burakhanunver@gmail.com> (https://kunver.dev)",
29
+ "license": "MIT",
30
+ "dependencies": {
31
+ "@inquirer/prompts": "^7.8.4",
32
+ "chalk": "^5.6.0",
33
+ "execa": "^9.6.0",
34
+ "ora": "^8.2.0"
35
+ },
36
+ "devDependencies": {
37
+ "@types/bun": "^1.2.21",
38
+ "@types/node": "^24.3.0",
39
+ "tsup": "^8.5.0",
40
+ "typescript": "^5.9.2"
41
+ }
42
+ }