Skip to content

Commit

Permalink
Merge pull request #49 from guocaoyi/feat/side-panel-2
Browse files Browse the repository at this point in the history
feat(sidepanel): alpine \ vanilla \ preact \ svelte \ solid \ inferno \ lit
  • Loading branch information
guocaoyi committed Oct 8, 2023
2 parents 6022011 + 094459a commit 13b8808
Show file tree
Hide file tree
Showing 100 changed files with 1,444 additions and 200 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ types
!.gitignore
!.editorconfig
!.vscode
!template-*/src/*.js
!template-*/src/*.js

# build
template-*/package
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ Summary
5. version timestamp follow the yyyy.MM.dd format
```

## 0.8.8 [2023.10.08]

- feat: support side panel for chrome extension(alpine \ vanilla \ preact \ svelte \ solid \ inferno \ lit)

## 0.8.7 [2023.10.03]

- feat: support side panel for chrome extension(react \ vue)
- merge: merge pull requests

## 0.8.4 [2023.03.23]

- merge: merge pull requests
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-chrome-ext",
"version": "0.8.7",
"version": "0.8.8",
"type": "module",
"description": "Scaffolding your chrome extension, multiple boilerplates supported!",
"author": "yalda",
Expand Down
16 changes: 3 additions & 13 deletions template-alpine-js/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,15 @@
<link rel="icon" href="/icons/logo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Chrome Extension + Alpine + JS + Vite App - Options</title>
<link rel="stylesheet" href="/common.css" />
</head>
<body>
<main>
<main x-data>
<h3>Options Page!</h3>

<h6>v 0.0.0</h6>

<a
href="https://www.npmjs.com/package/create-chrome-ext"
target="_blank"
x-data="{ crx: '' }"
x-text="crx"
x-init="() => {
crx = 'Power by create-chrome-ext';
}"
>
</a>
<a href="https://www.npmjs.com/package/create-chrome-ext" target="_blank"></a>
</main>
<script type="module" src="/src/options/index.js"></script>
<!-- <script type="module" src="/src/main.ts"></script> -->
</body>
</html>
4 changes: 2 additions & 2 deletions template-alpine-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"preview": "vite preview"
},
"dependencies": {
"alpinejs": "^3.10.2"
"alpinejs": "^3.13.1"
},
"devDependencies": {
"@crxjs/vite-plugin": "^2.0.0-beta.19",
"vite": "^2.9.13"
"vite": "^4.4.11"
}
}
16 changes: 3 additions & 13 deletions template-alpine-js/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,15 @@
<link rel="icon" href="/icons/logo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Chrome Extension + Alpine + JS + Vite App - Popup</title>
<link rel="stylesheet" href="/common.css" />
</head>
<body>
<main>
<main x-data>
<h3>Popup Page!</h3>

<h6>v 0.0.0</h6>

<a
href="https://www.npmjs.com/package/create-chrome-ext"
target="_blank"
x-data="{ crx: '' }"
x-text="crx"
x-init="() => {
crx = 'Power by create-chrome-ext';
}"
>
</a>
<a href="https://www.npmjs.com/package/create-chrome-ext" target="_blank"></a>
</main>
<script type="module" src="/src/popup/index.js"></script>
<!-- <script type="module" src="/src/main.ts"></script> -->
</body>
</html>
21 changes: 21 additions & 0 deletions template-alpine-js/sidepanel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/icons/logo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Chrome Extension + Alpine + JS + Vite App - Side Panel</title>
</head>
<body>
<main x-data>
<h3>Side Panel Page!</h3>

<h6>v 0.0.0</h6>

<a href="https://www.npmjs.com/package/create-chrome-ext" target="_blank">
Power by <span x-text="$store.shop.crx"></span>
</a>
</main>
<script type="module" src="/src/main.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
:root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
'Open Sans', 'Helvetica Neue', sans-serif;
font-size: 16px;
line-height: 24px;
font-weight: 400;
Expand All @@ -19,11 +20,6 @@ body {
min-width: 20rem;
}

:root {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
'Open Sans', 'Helvetica Neue', sans-serif;
}

main {
text-align: center;
padding: 1em;
Expand Down
10 changes: 10 additions & 0 deletions template-alpine-js/src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Alpine from 'alpinejs'
import './main.css'

window.Alpine = Alpine

Alpine.store('shop', {
crx: 'create-chrome-ext',
})

Alpine.start()
5 changes: 4 additions & 1 deletion template-alpine-js/src/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ export default defineManifest({
js: ['src/content/index.js'],
},
],
side_panel: {
default_path: 'sidepanel.html',
},
web_accessible_resources: [
{
resources: ['img/logo-16.png', 'img/logo-34.png', 'img/logo-48.png', 'img/logo-128.png'],
matches: [],
},
],
permissions: [],
permissions: ['sidePanel'],
})
21 changes: 0 additions & 21 deletions template-alpine-js/src/options/index.js

This file was deleted.

15 changes: 0 additions & 15 deletions template-alpine-js/src/popup/index.js

This file was deleted.

16 changes: 3 additions & 13 deletions template-alpine-ts/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,15 @@
<link rel="icon" href="/icons/logo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Chrome Extension + Alpine + TS + Vite App - Options</title>
<link rel="stylesheet" href="/common.css" />
</head>
<body>
<main>
<main x-data>
<h3>Options Page!</h3>

<h6>v 0.0.0</h6>

<a
href="https://www.npmjs.com/package/create-chrome-ext"
target="_blank"
x-data="{ crx: '' }"
x-text="crx"
x-init="() => {
crx = 'Power by create-chrome-ext';
}"
>
</a>
<a href="https://www.npmjs.com/package/create-chrome-ext" target="_blank"></a>
</main>
<script type="module" src="/src/options/index.ts"></script>
<!-- <script type="module" src="/src/main.ts"></script> -->
</body>
</html>
9 changes: 5 additions & 4 deletions template-alpine-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
"preview": "vite preview"
},
"dependencies": {
"alpinejs": "^3.10.2"
"alpinejs": "^3.13.1"
},
"devDependencies": {
"@crxjs/vite-plugin": "^2.0.0-beta.19",
"@types/chrome": "^0.0.236",
"typescript": "^4.6.4",
"vite": "^2.9.13"
"@types/alpinejs": "^3.13.2",
"@types/chrome": "^0.0.246",
"typescript": "^5.2.2",
"vite": "^3.2.7"
}
}
16 changes: 3 additions & 13 deletions template-alpine-ts/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,15 @@
<link rel="icon" href="/icons/logo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Chrome Extension + Alpine + TS + Vite App - Popup</title>
<link rel="stylesheet" href="/common.css" />
</head>
<body>
<main>
<main x-data>
<h3>Popup Page!</h3>

<h6>v 0.0.0</h6>

<a
href="https://www.npmjs.com/package/create-chrome-ext"
target="_blank"
x-data="{ crx: '' }"
x-text="crx"
x-init="() => {
crx = 'Power by create-chrome-ext';
}"
>
</a>
<a href="https://www.npmjs.com/package/create-chrome-ext" target="_blank"></a>
</main>
<script type="module" src="/src/popup/index.ts"></script>
<!-- <script type="module" src="/src/main.ts"></script> -->
</body>
</html>
23 changes: 23 additions & 0 deletions template-alpine-ts/sidepanel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/icons/logo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Chrome Extension + Alpine + TS + Vite App - Side Panel</title>
</head>
<body>
<main x-data>
<h3>Side Panel Page!</h3>

<div x-data="{ username: 'calebporzio' }">Username: <strong x-text="username"></strong></div>

<h6>v 0.0.0</h6>

<a href="https://www.npmjs.com/package/create-chrome-ext" target="_blank" x-data>
Power by <span :x-text="$store.shop.crx"></span>
</a>
</main>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
55 changes: 55 additions & 0 deletions template-alpine-ts/src/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
:root {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
'Open Sans', 'Helvetica Neue', sans-serif;
font-size: 16px;
line-height: 24px;
font-weight: 400;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}

body {
min-width: 20rem;
}

main {
text-align: center;
padding: 1em;
margin: 0 auto;
}

h3 {
color: #3999b1;
text-transform: uppercase;
font-size: 1.5rem;
font-weight: 200;
line-height: 1.2rem;
margin: 2rem auto;
}

h6 {
font-size: 0.5rem;
color: #cccccc;
margin: 0.5rem;
}

a {
font-size: 0.5rem;
margin: 0.5rem;
color: #cccccc;
text-decoration: none;
}

@media (min-width: 480px) {
h3 {
max-width: none;
}
}
18 changes: 18 additions & 0 deletions template-alpine-ts/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Alpine from 'alpinejs'
import './main.css'

import type { Alpine as AlpineType } from 'alpinejs'

declare global {
interface Window {
Alpine: AlpineType
}
}

window.Alpine = Alpine

Alpine.store('shop', {
crx: 'create-chrome-ext',
})

Alpine.start()
Loading

0 comments on commit 13b8808

Please sign in to comment.