Skip to content

Commit 13b8808

Browse files
authored
Merge pull request #49 from guocaoyi/feat/side-panel-2
feat(sidepanel): alpine \ vanilla \ preact \ svelte \ solid \ inferno \ lit
2 parents 6022011 + 094459a commit 13b8808

File tree

100 files changed

+1444
-200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1444
-200
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@ types
2525
!.gitignore
2626
!.editorconfig
2727
!.vscode
28-
!template-*/src/*.js
28+
!template-*/src/*.js
29+
30+
# build
31+
template-*/package

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ Summary
99
5. version timestamp follow the yyyy.MM.dd format
1010
```
1111

12+
## 0.8.8 [2023.10.08]
13+
14+
- feat: support side panel for chrome extension(alpine \ vanilla \ preact \ svelte \ solid \ inferno \ lit)
15+
16+
## 0.8.7 [2023.10.03]
17+
18+
- feat: support side panel for chrome extension(react \ vue)
19+
- merge: merge pull requests
20+
1221
## 0.8.4 [2023.03.23]
1322

1423
- merge: merge pull requests

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-chrome-ext",
3-
"version": "0.8.7",
3+
"version": "0.8.8",
44
"type": "module",
55
"description": "Scaffolding your chrome extension, multiple boilerplates supported!",
66
"author": "yalda",

template-alpine-js/options.html

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,15 @@
55
<link rel="icon" href="/icons/logo.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Chrome Extension + Alpine + JS + Vite App - Options</title>
8-
<link rel="stylesheet" href="/common.css" />
98
</head>
109
<body>
11-
<main>
10+
<main x-data>
1211
<h3>Options Page!</h3>
1312

1413
<h6>v 0.0.0</h6>
1514

16-
<a
17-
href="https://www.npmjs.com/package/create-chrome-ext"
18-
target="_blank"
19-
x-data="{ crx: '' }"
20-
x-text="crx"
21-
x-init="() => {
22-
crx = 'Power by create-chrome-ext';
23-
}"
24-
>
25-
</a>
15+
<a href="https://www.npmjs.com/package/create-chrome-ext" target="_blank"></a>
2616
</main>
27-
<script type="module" src="/src/options/index.js"></script>
17+
<!-- <script type="module" src="/src/main.ts"></script> -->
2818
</body>
2919
</html>

template-alpine-js/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
"preview": "vite preview"
2222
},
2323
"dependencies": {
24-
"alpinejs": "^3.10.2"
24+
"alpinejs": "^3.13.1"
2525
},
2626
"devDependencies": {
2727
"@crxjs/vite-plugin": "^2.0.0-beta.19",
28-
"vite": "^2.9.13"
28+
"vite": "^4.4.11"
2929
}
3030
}

template-alpine-js/popup.html

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,15 @@
55
<link rel="icon" href="/icons/logo.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Chrome Extension + Alpine + JS + Vite App - Popup</title>
8-
<link rel="stylesheet" href="/common.css" />
98
</head>
109
<body>
11-
<main>
10+
<main x-data>
1211
<h3>Popup Page!</h3>
1312

1413
<h6>v 0.0.0</h6>
1514

16-
<a
17-
href="https://www.npmjs.com/package/create-chrome-ext"
18-
target="_blank"
19-
x-data="{ crx: '' }"
20-
x-text="crx"
21-
x-init="() => {
22-
crx = 'Power by create-chrome-ext';
23-
}"
24-
>
25-
</a>
15+
<a href="https://www.npmjs.com/package/create-chrome-ext" target="_blank"></a>
2616
</main>
27-
<script type="module" src="/src/popup/index.js"></script>
17+
<!-- <script type="module" src="/src/main.ts"></script> -->
2818
</body>
2919
</html>

template-alpine-js/sidepanel.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/icons/logo.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Chrome Extension + Alpine + JS + Vite App - Side Panel</title>
8+
</head>
9+
<body>
10+
<main x-data>
11+
<h3>Side Panel Page!</h3>
12+
13+
<h6>v 0.0.0</h6>
14+
15+
<a href="https://www.npmjs.com/package/create-chrome-ext" target="_blank">
16+
Power by <span x-text="$store.shop.crx"></span>
17+
</a>
18+
</main>
19+
<script type="module" src="/src/main.js"></script>
20+
</body>
21+
</html>

template-alpine-ts/public/common.css renamed to template-alpine-js/src/main.css

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
:root {
2-
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
2+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
3+
'Open Sans', 'Helvetica Neue', sans-serif;
34
font-size: 16px;
45
line-height: 24px;
56
font-weight: 400;
@@ -19,11 +20,6 @@ body {
1920
min-width: 20rem;
2021
}
2122

22-
:root {
23-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
24-
'Open Sans', 'Helvetica Neue', sans-serif;
25-
}
26-
2723
main {
2824
text-align: center;
2925
padding: 1em;

template-alpine-js/src/main.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Alpine from 'alpinejs'
2+
import './main.css'
3+
4+
window.Alpine = Alpine
5+
6+
Alpine.store('shop', {
7+
crx: 'create-chrome-ext',
8+
})
9+
10+
Alpine.start()

template-alpine-js/src/manifest.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ export default defineManifest({
2626
js: ['src/content/index.js'],
2727
},
2828
],
29+
side_panel: {
30+
default_path: 'sidepanel.html',
31+
},
2932
web_accessible_resources: [
3033
{
3134
resources: ['img/logo-16.png', 'img/logo-34.png', 'img/logo-48.png', 'img/logo-128.png'],
3235
matches: [],
3336
},
3437
],
35-
permissions: [],
38+
permissions: ['sidePanel'],
3639
})

0 commit comments

Comments
 (0)