forked from guocaoyi/create-chrome-ext
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(temp):add alpine, @types/chrome for definition
- Loading branch information
Showing
44 changed files
with
502 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!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 Extensioin + Alpine + JS + Vite App - Options</title> | ||
</head> | ||
<body> | ||
<h1 x-data="{ message: 'I ❤️ Alpine' }" x-text="message"></h1> | ||
<script type="module" src="/src/options/index.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "chrome-extension-alpine-js", | ||
"version": "0.0.0", | ||
"author": "", | ||
"description": "", | ||
"type": "module", | ||
"license": "MIT", | ||
"keywords": [ | ||
"chrome-extension", | ||
"alpine", | ||
"alpinejs", | ||
"vite", | ||
"create-chrome-ext" | ||
], | ||
"engines": { | ||
"node": ">=14.18.0" | ||
}, | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"alpinejs": "^3.10.2" | ||
}, | ||
"devDependencies": { | ||
"@types/chrome": "0.0.193", | ||
"@crxjs/vite-plugin": "^1.0.12", | ||
"vite": "^2.9.13" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!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 Extensioin + Alpine + JS + Vite App - Popup</title> | ||
</head> | ||
<body> | ||
<h1 x-data="{ message: 'I ❤️ Alpine' }" x-text="message"></h1> | ||
<script type="module" src="/src/popup/index.js"></script> | ||
</body> | ||
</html> |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
console.info('chrome-ext template-alpine-js background script') | ||
|
||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
console.info('chrome-ext template-alpine-js content script') | ||
|
||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { defineManifest } from '@crxjs/vite-plugin' | ||
|
||
export default defineManifest({ | ||
name: 'create-chrome-ext', | ||
description: '', | ||
version: '0.0.0', | ||
manifest_version: 3, | ||
icons: { | ||
16: 'img/logo-16.png', | ||
32: 'img/logo-34.png', | ||
48: 'img/logo-48.png', | ||
128: 'img/logo-128.png', | ||
}, | ||
action: { | ||
default_popup: 'popup.html', | ||
default_icon: 'img/logo-48.png', | ||
}, | ||
options_page: 'options.html', | ||
background: { | ||
service_worker: 'src/background/index.js', | ||
type: 'module', | ||
}, | ||
content_scripts: [ | ||
{ | ||
matches: ['http://*/*', 'https://*/*'], | ||
js: ['src/content/index.js'], | ||
}, | ||
], | ||
web_accessible_resources: [ | ||
{ | ||
resources: ['img/logo-16.png', 'img/logo-34.png', 'img/logo-48.png', 'img/logo-128.png'], | ||
matches: [], | ||
}, | ||
], | ||
permissions: [], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
:root { | ||
font-family: Inter, Avenir, Helvetica, Arial, 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%; | ||
} | ||
|
||
@media (prefers-color-scheme: light) { | ||
:root { | ||
color: #213547; | ||
background-color: #ffffff; | ||
} | ||
a:hover { | ||
color: #747bff; | ||
} | ||
} | ||
|
||
body { | ||
min-width: 20rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Alpine from 'alpinejs' | ||
|
||
import './index.css' | ||
|
||
window.Alpine = Alpine | ||
|
||
Alpine.start() | ||
|
||
Alpine.data('dropdown', () => ({ | ||
open: false, | ||
|
||
toggle() { | ||
this.open = !this.open | ||
}, | ||
})) | ||
|
||
console.info('option index.js loaded') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
:root { | ||
font-family: Inter, Avenir, Helvetica, Arial, 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%; | ||
} | ||
|
||
@media (prefers-color-scheme: light) { | ||
:root { | ||
color: #213547; | ||
background-color: #ffffff; | ||
} | ||
a:hover { | ||
color: #747bff; | ||
} | ||
} | ||
|
||
body { | ||
min-width: 20rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Alpine from 'alpinejs' | ||
|
||
import './index.css' | ||
|
||
window.Alpine = Alpine | ||
|
||
Alpine.start() | ||
|
||
Alpine.data('dropdown', () => ({ | ||
open: false, | ||
|
||
toggle() { | ||
this.open = !this.open | ||
}, | ||
})) | ||
|
||
console.info('popup index.js loaded') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { defineConfig } from 'vite' | ||
import { crx } from '@crxjs/vite-plugin' | ||
|
||
import manifest from './src/manifest.js' | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig(({ mode }) => { | ||
return { | ||
build: { | ||
emptyOutDir: true, | ||
outDir: 'build', | ||
rollupOptions: { | ||
output: { | ||
chunkFileNames: 'assets/chunk-[hash].js', | ||
}, | ||
}, | ||
}, | ||
|
||
plugins: [crx({ manifest })], | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!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 Extensioin + Alpine + TS + Vite App - Options</title> | ||
</head> | ||
<body> | ||
<h1 x-data="{ message: 'I ❤️ Alpine' }" x-text="message"></h1> | ||
<script type="module" src="/src/options/index.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "chrome-extension-alpine-ts", | ||
"version": "0.0.0", | ||
"author": "", | ||
"description": "", | ||
"type": "module", | ||
"license": "MIT", | ||
"keywords": [ | ||
"chrome-extension", | ||
"alpine", | ||
"alpinejs", | ||
"vite", | ||
"create-chrome-ext" | ||
], | ||
"engines": { | ||
"node": ">=14.18.0" | ||
}, | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"alpinejs": "^3.10.2" | ||
}, | ||
"devDependencies": { | ||
"@types/chrome": "0.0.193", | ||
"@crxjs/vite-plugin": "^1.0.12", | ||
"typescript": "^4.6.4", | ||
"vite": "^2.9.13" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!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 Extensioin + Alpine + TS + Vite App - Popup</title> | ||
</head> | ||
<body> | ||
<h1 x-data="{ message: 'I ❤️ Alpine' }" x-text="message"></h1> | ||
<script type="module" src="/src/popup/index.ts"></script> | ||
</body> | ||
</html> |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.