Skip to content

Commit

Permalink
fix(alpine):temp can not run
Browse files Browse the repository at this point in the history
  • Loading branch information
guocaoyi committed Oct 8, 2023
1 parent 8f319eb commit 094459a
Show file tree
Hide file tree
Showing 20 changed files with 119 additions and 159 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Summary

## 0.8.8 [2023.10.08]

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

## 0.8.7 [2023.10.03]

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>
18 changes: 5 additions & 13 deletions template-alpine-js/sidepanel.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,18 @@
<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 2.0 - SidePanel</title>
<link rel="stylesheet" href="/common.css" />
<title>Chrome Extension + Alpine + JS + Vite App - Side Panel</title>
</head>
<body>
<main>
<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"
x-data="{ crx: '' }"
x-text="crx"
x-init="() => {
crx = 'Power by create-chrome-ext';
}"
>
<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/sidepanel/index.ts"></script>
<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()
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.

15 changes: 0 additions & 15 deletions template-alpine-js/src/sidepanel/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>
22 changes: 8 additions & 14 deletions template-alpine-ts/sidepanel.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,20 @@
<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 - Popup</title>
<link rel="stylesheet" href="/common.css" />
<title>Chrome Extension + Alpine + TS + Vite App - Side Panel</title>
</head>
<body>
<main>
<h3>Popup Page!</h3>
<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="{ crx: '' }"
x-text="crx"
x-init="() => {
crx = 'Power by create-chrome-ext';
}"
>
<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/sidepanel/index.ts"></script>
<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()
5 changes: 0 additions & 5 deletions template-alpine-ts/src/options/index.ts

This file was deleted.

5 changes: 0 additions & 5 deletions template-alpine-ts/src/popup/index.ts

This file was deleted.

Loading

0 comments on commit 094459a

Please sign in to comment.