-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from guocaoyi/feat/v0.8
merge(0.8.1): merge feat/v0.8 to origin main
- Loading branch information
Showing
28 changed files
with
358 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ pnpm-lock.yaml | |
build | ||
types | ||
index.js | ||
!**/index.js | ||
|
||
# ignore ide settings | ||
.idea | ||
|
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,3 @@ | ||
#!/usr/bin/env node | ||
|
||
import './index.js' |
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,36 @@ | ||
{ | ||
"name": "chrome-extension-stencil-js", | ||
"version": "0.0.0", | ||
"author": "", | ||
"description": "", | ||
"type": "module", | ||
"license": "MIT", | ||
"keywords": [ | ||
"chrome-extension", | ||
"stencil", | ||
"vite", | ||
"create-chrome-ext" | ||
], | ||
"engines": { | ||
"node": ">=14.18.0" | ||
}, | ||
"scripts": { | ||
"s:build": "stencil build", | ||
"s:start": "stencil build --dev --watch --serve", | ||
"s:test": "stencil test --spec --e2e", | ||
"s:test.watch": "stencil test --spec --e2e --watchAll", | ||
"s:generate": "stencil generate", | ||
"dev": "vite", | ||
"build": "vite build", | ||
"build.client": "vite build --outDir server/public", | ||
"preview": "vite preview", | ||
"fmt": "prettier --write '**/*.{jsx,js,json,css,md}'" | ||
}, | ||
"devDependencies": { | ||
"@crxjs/vite-plugin": "^1.0.12", | ||
"@stencil/core": "2.13.0", | ||
"express": "4.17.2", | ||
"prettier": "^2.7.1", | ||
"vite": "^2.9.13" | ||
} | ||
} |
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-stencil-js background script') | ||
|
||
export {} |
33 changes: 33 additions & 0 deletions
33
template-stencil-js/src/components/app-options/app-options.css
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,33 @@ | ||
main { | ||
text-align: center; | ||
padding: 1em; | ||
margin: 0 auto; | ||
} | ||
|
||
h3 { | ||
color: #673ab8; | ||
text-transform: uppercase; | ||
font-size: 1.5rem; | ||
font-weight: 200; | ||
line-height: 1.2rem; | ||
margin: 2rem auto; | ||
} | ||
|
||
h6 { | ||
font-size: 0.5rem; | ||
color: #333333; | ||
margin: 0.5rem; | ||
} | ||
|
||
a { | ||
font-size: 0.5rem; | ||
margin: 0.5rem; | ||
color: #cccccc; | ||
text-decoration: none; | ||
} | ||
|
||
@media (min-width: 480px) { | ||
h3 { | ||
max-width: none; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
template-stencil-js/src/components/app-options/app-options.jsx
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,25 @@ | ||
import { Component, Prop, h } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'app-options', | ||
styleUrl: 'app-options.css', | ||
}) | ||
export class AppOptions { | ||
@Prop() crx: string = '' | ||
|
||
render() { | ||
return ( | ||
<main> | ||
<h3>Options Page!</h3> | ||
|
||
<h6>v 0.0.0</h6> | ||
|
||
<a href="https://www.npmjs.com/package/create-chrome-ext" target="_blank"> | ||
Power by {this.crx} | ||
</a> | ||
</main> | ||
) | ||
} | ||
} | ||
|
||
export default AppOptions |
33 changes: 33 additions & 0 deletions
33
template-stencil-js/src/components/app-popup/app-popup.css
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,33 @@ | ||
main { | ||
text-align: center; | ||
padding: 1em; | ||
margin: 0 auto; | ||
} | ||
|
||
h3 { | ||
color: #673ab8; | ||
text-transform: uppercase; | ||
font-size: 1.5rem; | ||
font-weight: 200; | ||
line-height: 1.2rem; | ||
margin: 2rem auto; | ||
} | ||
|
||
h6 { | ||
font-size: 0.5rem; | ||
color: #333333; | ||
margin: 0.5rem; | ||
} | ||
|
||
a { | ||
font-size: 0.5rem; | ||
margin: 0.5rem; | ||
color: #cccccc; | ||
text-decoration: none; | ||
} | ||
|
||
@media (min-width: 480px) { | ||
h3 { | ||
max-width: none; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
template-stencil-js/src/components/app-popup/app-popup.jsx
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,25 @@ | ||
import { Component, Prop, h } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'app-popup', | ||
styleUrl: 'app-popup.css', | ||
}) | ||
export class AppPopup { | ||
@Prop() crx: string = '' | ||
|
||
render() { | ||
return ( | ||
<main> | ||
<h3>Popup Page!</h3> | ||
|
||
<h6>v 0.0.0</h6> | ||
|
||
<a href="https://www.npmjs.com/package/create-chrome-ext" target="_blank"> | ||
Power by {this.crx} | ||
</a> | ||
</main> | ||
) | ||
} | ||
} | ||
|
||
export default AppPopup |
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-stencil-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,45 @@ | ||
/* | ||
Global App CSS | ||
---------------------- | ||
Use this file for styles that should be applied to all components. | ||
For example, "font-family" within the "body" selector is a CSS property | ||
most apps will want applied to all components. | ||
Any global CSS variables should also be applied here. | ||
*/ | ||
|
||
: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%; | ||
} | ||
|
||
@media (prefers-color-scheme: light) { | ||
:root { | ||
color: #213547; | ||
background-color: #ffffff; | ||
} | ||
a:hover { | ||
color: #747bff; | ||
} | ||
} | ||
|
||
body { | ||
min-width: 20rem; | ||
margin: 0px; | ||
padding: 0px; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, | ||
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; | ||
} |
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,7 @@ | ||
export default async () => { | ||
/** | ||
* The code to be executed should be placed within a default function that is | ||
* exported by the global script. Ensure all of the code in the global script | ||
* is wrapped in the function() that is exported. | ||
*/ | ||
}; |
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,2 @@ | ||
export { Components, JSX } from './components'; | ||
import '@stencil-community/router'; |
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,18 @@ | ||
<!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 + Stencil + JS + Vite App - Options</title> | ||
|
||
<script type="module" src="/build/app.esm.js"></script> | ||
<script nomodule src="/build/app.js"></script> | ||
<link href="/build/app.css" rel="stylesheet" /> | ||
|
||
<link rel="manifest" href="/manifest.json" /> | ||
</head> | ||
<body> | ||
<comp-options crx="create-chrome-ext"></comp-options> | ||
</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,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/icon/logo.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Chrome Extensioin + Popup + JS + Vite App - Popup</title> | ||
|
||
<script type="module" src="/build/app.esm.js"></script> | ||
<script nomodule src="/build/app.js"></script> | ||
<link href="/build/app.css" rel="stylesheet" /> | ||
|
||
<link rel="manifest" href="/manifest.json" /> | ||
</head> | ||
<body> | ||
<comp-popup crx="create-chrome-ext"></comp-popup> | ||
<script type="module" src="/src/popup/index.jsx"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.