Skip to content

Commit

Permalink
Merge pull request #53 from guocaoyi/feat/0.9.0
Browse files Browse the repository at this point in the history
feat(svelte):out of box functions, countor \ newtab timer \ events
  • Loading branch information
guocaoyi committed Oct 14, 2023
2 parents fa0566d + 07ec13a commit 27b1a04
Show file tree
Hide file tree
Showing 47 changed files with 795 additions and 241 deletions.
7 changes: 3 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ Summary

## 0.9.0 [xxxx.xx.xx]

- fix: vue framework vite @3 error (issue #51)
- feat: depen version update, <vite@4.x>
- feat: support devtool panel
- doc: update README.md
- doc: i18n, supprt French \ Deutsch \ Русский \ 日本語 \ Indonesian
- feat: support devtools \ sidepanel \ newtab override
- feat: out of box functions, countor \ newtab timer \ events
- doc: update README.md & i18n (French \ 한국어 \ Indonesian \ Русский \ Deutsch \ 日本語)

## 0.8.9 [2023.10.09]

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

> Scaffolding your chrome extension, multiple boilerplates supported!
- 🚀 Lightning Fast HMR(use [Vite4](https://vitejs.dev))
- 🥡 Out of Box
- 🌈 Multiple Frontend Framework Supported ([React](https://reactjs.org) · [Vue](https://vuejs.org) · [Svelte](https://svelte.dev) · [Preact](https://preactjs.com) · [Solid](https://www.solidjs.com) · [Alpine](https://alpinejs.dev) · [Lit](https://lit.dev) · [Inferno](https://www.infernojs.org) · [Stencil](https://stenciljs.com) · [Vanilla](http://vanilla-js.com))
- 🚀 Lightning Fast HMR(use [Vite@latest](https://vitejs.dev))
- 🌈 Multiple Framework Supported ([React](https://reactjs.org) · [Vue](https://vuejs.org) · [Svelte](https://svelte.dev) · [Preact](https://preactjs.com) · [Solid](https://www.solidjs.com) · [Alpine](https://alpinejs.dev) · [Lit](https://lit.dev) · [Inferno](https://www.infernojs.org) · [Stencil](https://stenciljs.com) · [Vanilla](http://vanilla-js.com))
- 🥢 Multiple Language Supported ([JavaScript](https://www.javascript.com/) · [TypeScript](https://www.typescriptlang.org/))
- 🧶 Optimized Builds (Background \ Content \ Popup \ Options \ SidePanel \ DevtoolsPanel)
- 🥡 Out of Box (Background \ Content \ Popup \ Options \ SidePanel \ DevTools \ NewTab)
- 🧶 Optimized Builds

[English](./README.md) · [简体中文](./docs/README.zh-CN.md) · [French](./docs/README.fr-FR.md) · [한국어](./docs/README.ko-KR.md) · [Indonesian](./docs/README.id-ID.md) · [Русский](./docs/README.ja-JP.md) · [Deutsch](./docs/README.de-DE.md) · [日本語](./docs/README.ja-JP.md) (Translation support by ChatGPT)
[English](./README.md) · [简体中文](./docs/README.zh-CN.md) · [French](./docs/README.fr-FR.md) · [한국어](./docs/README.ko-KR.md) · [Indonesian](./docs/README.id-ID.md) · [Русский](./docs/README.ru-RU.md) · [Deutsch](./docs/README.de-DE.md) · [日本語](./docs/README.ja-JP.md) (Translated by ChatGPT)

## Installing

Expand Down
8 changes: 4 additions & 4 deletions docs/README.de-DE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
> Strukturieren Sie Ihre Chrome-Erweiterung, mit Unterstützung mehrerer Boilerplates!
- 🚀 Blitzschnelle HMR (Verwendung von [Vite4](https://vitejs.dev))
- 🥡 Sofort einsatzbereit
- 🌈 Unterstützung mehrerer Frontend-Frameworks ([React](https://reactjs.org) · [Vue](https://vuejs.org) · [Svelte](https://svelte.dev) · [Preact](https://preactjs.com) · [Solid](https://www.solidjs.com) · [Alpine](https://alpinejs.dev) · [Lit](https://lit.dev) · [Inferno](https://www.infernojs.org) · [Stencil](https://stenciljs.com) · [Vanilla](http://vanilla-js.com))
- 🌈 Unterstützung mehrerer Frameworks ([React](https://reactjs.org) · [Vue](https://vuejs.org) · [Svelte](https://svelte.dev) · [Preact](https://preactjs.com) · [Solid](https://www.solidjs.com) · [Alpine](https://alpinejs.dev) · [Lit](https://lit.dev) · [Inferno](https://www.infernojs.org) · [Stencil](https://stenciljs.com) · [Vanilla](http://vanilla-js.com))
- 🥢 Unterstützung mehrerer Sprachen ([JavaScript](https://www.javascript.com/) · [TypeScript](https://www.typescriptlang.org/))
- 🧶 Optimierte Builds (Hintergrund · Inhalt · Popup · Optionen · Seitenleiste · Devtools-Panel)
- 🥡 Sofort einsatzbereit (Background \ Content \ Popup \ Options \ SidePanel \ DevTools \ NewTab)
- 🧶 Optimierte Builds

[English](./README.md) · [简体中文](./docs/README.zh-CN.md) · [French](./docs/README.fr-FR.md) · [Deutsch](./docs/README.de-DE.md) · [Русский](./docs/README.ja-JP.md) · [日本語](./docs/README.ja-JP.md)
[English](../README.md) · [简体中文](./README.zh-CN.md) · [French](./README.fr-FR.md) · [한국어](./README.ko-KR.md) · [Indonesian](./README.id-ID.md) · [Русский](./README.ru-RU.md) · [Deutsch](./README.de-DE.md) · [日本語](./README.ja-JP.md) (Translated by ChatGPT)

## Installation

Expand Down
4 changes: 2 additions & 2 deletions docs/README.fr-FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
- 🚀 Mise à jour rapide avec HMR (utilisation de [Vite4](https://vitejs.dev))
- 🥡 Prêt à l'emploi
- 🌈 Prise en charge de plusieurs frameworks frontend ([React](https://reactjs.org) · [Vue](https://vuejs.org) · [Svelte](https://svelte.dev) · [Preact](https://preactjs.com) · [Solid](https://www.solidjs.com) · [Alpine](https://alpinejs.dev) · [Lit](https://lit.dev) · [Inferno](https://www.infernojs.org) · [Stencil](https://stenciljs.com) · [Vanilla](http://vanilla-js.com))
- 🌈 Prise en charge de plusieurs frameworks ([React](https://reactjs.org) · [Vue](https://vuejs.org) · [Svelte](https://svelte.dev) · [Preact](https://preactjs.com) · [Solid](https://www.solidjs.com) · [Alpine](https://alpinejs.dev) · [Lit](https://lit.dev) · [Inferno](https://www.infernojs.org) · [Stencil](https://stenciljs.com) · [Vanilla](http://vanilla-js.com))
- 🥢 Prise en charge de plusieurs langages ([JavaScript](https://www.javascript.com/) · [TypeScript](https://www.typescriptlang.org/))
- 🧶 Création optimisée

[English](./README.md) · [简体中文](./docs/README.zh-CN.md) · [French](./docs/README.fr-FR.md) · [Deutsch](./docs/README.de-DE.md) · [Русский](./docs/README.ja-JP.md) · [日本語](./docs/README.ja-JP.md)
[English](../README.md) · [简体中文](./README.zh-CN.md) · [French](./README.fr-FR.md) · [한국어](./README.ko-KR.md) · [Indonesian](./README.id-ID.md) · [Русский](./README.ru-RU.md) · [Deutsch](./README.de-DE.md) · [日本語](./README.ja-JP.md) (Translated by ChatGPT)

## Installation

Expand Down
10 changes: 5 additions & 5 deletions docs/README.id-ID.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Buat Ekstensi Chrome (.crx)

![Pratinjau crx](./docs/crx-preview.png)
![Pratinjau crx](/docs/img/crx-preview.png)
[![Status OSCS](https://www.oscs1024.com/platform/badge/guocaoyi/create-chrome-ext.svg?size=small)](https://www.oscs1024.com/project/guocaoyi/create-chrome-ext?ref=badge_small)
[![npm](https://img.shields.io/npm/v/create-chrome-ext?logo=npm)](https://www.npmjs.com/package/create-chrome-ext)
[![Unduh npm](https://img.shields.io/npm/dw/create-chrome-ext)](https://www.npmjs.com/package/create-chrome-ext)
Expand All @@ -15,7 +15,7 @@
- 🥢 Mendukung Berbagai Bahasa ([JavaScript](https://www.javascript.com/) · [TypeScript](https://www.typescriptlang.org/))
- 🧶 Pembangunan Teroptimasi (Latar Belakang · Konten · Popup · Opsi · Panel Sisi · Panel Devtools)

[English](./README.md) · [简体中文](./docs/README.zh-CN.md) · [French](./docs/README.fr-FR.md) · [Deutsch](./docs/README.de-DE.md) · [Русский](./docs/README.ja-JP.md) · [日本語](./docs/README.ja-JP.md)
[English](../README.md) · [简体中文](./README.zh-CN.md) · [French](./README.fr-FR.md) · [한국어](./README.ko-KR.md) · [Indonesian](./README.id-ID.md) · [Русский](./README.ru-RU.md) · [Deutsch](./README.de-DE.md) · [日本語](./README.ja-JP.md) (Translated by ChatGPT)

## Instalasi

Expand Down Expand Up @@ -65,6 +65,6 @@ Anda juga dapat membuat proyek dengan perintah baris `crx`, jalankan:

## Pratinjau

![crx-berjalan](./docs/crx-run.png)
![crx-pasang](./docs/crx-install.png)
![crx-bangun](./docs/crx-build.png)
![crx-berjalan](/docs/img/crx-run.png)
![crx-pasang](/docs/img/crx-install.png)
![crx-bangun](/docs/img/crx-build.png)
2 changes: 1 addition & 1 deletion docs/README.ja-JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- 🥢 複数の言語をサポート([JavaScript](https://www.javascript.com/) · [TypeScript](https://www.typescriptlang.org/)
- 🧶 最適化されたビルド

[English](./README.md) · [简体中文](./docs/README.zh-CN.md) · [French](./docs/README.fr-FR.md) · [Deutsch](./docs/README.de-DE.md) · [Русский](./docs/README.ja-JP.md) · [日本語](./docs/README.ja-JP.md)
[English](../README.md) · [简体中文](./README.zh-CN.md) · [French](./README.fr-FR.md) · [한국어](./README.ko-KR.md) · [Indonesian](./README.id-ID.md) · [Русский](./README.ru-RU.md) · [Deutsch](./README.de-DE.md) · [日本語](./README.ja-JP.md) (Translated by ChatGPT)

## インストール

Expand Down
2 changes: 1 addition & 1 deletion docs/README.ko-KR.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- 🥢 다양한 언어 지원 ([JavaScript](https://www.javascript.com/) · [TypeScript](https://www.typescriptlang.org/))
- 🧶 최적화된 빌드 (백그라운드 · 컨텐츠 · 팝업 · 옵션 · 사이드패널 · 개발도구 패널)

[EN](./README.md) · [简体中文](./docs/README.zh-CN.md) · [French](./docs/README.fr-FR.md) · [Deutsch](./docs/README.de-DE.md) · [日本語](./docs/README.ja-JP.md)
[English](../README.md) · [简体中文](./README.zh-CN.md) · [French](./README.fr-FR.md) · [한국어](./README.ko-KR.md) · [Indonesian](./README.id-ID.md) · [Русский](./README.ru-RU.md) · [Deutsch](./README.de-DE.md) · [日本語](./README.ja-JP.md) (Translated by ChatGPT)

## 설치

Expand Down
2 changes: 1 addition & 1 deletion docs/README.ru-RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- 🥢 Поддержка нескольких языков ([JavaScript](https://www.javascript.com/) · [TypeScript](https://www.typescriptlang.org/))
- 🧶 Оптимизированные сборки (Фон · Контент · Всплывающее окно · Опции · Боковая панель · Панель инструментов разработчика)

[English](./README.md) · [简体中文](./docs/README.zh-CN.md) · [French](./docs/README.fr-FR.md) · [Deutsch](./docs/README.de-DE.md) · [Русский](./docs/README.ru-RU.md) · [日本語](./docs/README.ja-JP.md)
[English](../README.md) · [简体中文](./README.zh-CN.md) · [French](./README.fr-FR.md) · [한국어](./README.ko-KR.md) · [Indonesian](./README.id-ID.md) · [Русский](./README.ru-RU.md) · [Deutsch](./README.de-DE.md) · [日本語](./README.ja-JP.md) (Translated by ChatGPT)

## Установка

Expand Down
2 changes: 1 addition & 1 deletion docs/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- 🌈 多种前端框架支持([React](https://reactjs.org) · [Vue](https://vuejs.org) · [Svelte](https://svelte.dev) · [Preact](https://preactjs.com) · [Solid](https://www.solidjs.com) · [Alpine](https://alpinejs.dev) · [Lit](https://lit.dev) · [Inferno](https://www.infernojs.org) · [Stencil](https://stenciljs.com) · [Vanilla](http://vanilla-js.com)
- 🥢 多语言支持([JavaScript](https://www.javascript.com/) · [TypeScript](https://www.typescriptlang.org/)

[English](./README.md) · [简体中文](./docs/README.zh-CN.md) · [French](./docs/README.fr-FR.md) · [Deutsch](./docs/README.de-DE.md) · [Русский](./docs/README.ja-JP.md) · [日本語](./docs/README.ja-JP.md)
[English](../README.md) · [简体中文](./README.zh-CN.md) · [French](./README.fr-FR.md) · [한국어](./README.ko-KR.md) · [Indonesian](./README.id-ID.md) · [Русский](./README.ru-RU.md) · [Deutsch](./README.de-DE.md) · [日本語](./README.ja-JP.md) (Translated by ChatGPT)

## 安装

Expand Down
14 changes: 14 additions & 0 deletions template-svelte-js/devtools.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!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 + Svelte + JS + Vite</title>
</head>

<body>
<div id="app"></div>
<script type="module" src="./src/devtools/index.js"></script>
</body>
</html>
14 changes: 14 additions & 0 deletions template-svelte-js/newtab.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!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 + Svelte + JS + Vite</title>
</head>

<body>
<div id="app"></div>
<script type="module" src="./src/newtab/index.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion template-svelte-js/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<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 + Svelte + JS + Vite App - Options</title>
<title>Chrome Extension + Svelte + JS + Vite</title>
</head>
<body>
<div id="app"></div>
Expand Down
2 changes: 1 addition & 1 deletion template-svelte-js/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" href="/icon/logo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Chrome Extension + Svelte + JS + Vite App - Popup</title>
<title>Chrome Extension + Svelte + JS + Vite</title>
</head>
<body>
<div id="app"></div>
Expand Down
4 changes: 2 additions & 2 deletions template-svelte-js/sidepanel.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/icon/logo.ico" />
<link rel="icon" href="/icons/logo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Chrome Extension + Svelte + JS + Vite App - Sidepanel</title>
<title>Chrome Extension + Svelte + JS + Vite</title>
</head>
<body>
<div id="app"></div>
Expand Down
8 changes: 6 additions & 2 deletions template-svelte-js/src/background/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
console.info('chrome-ext template-svelte-js background script')
console.log('background is running')

export {}
chrome.runtime.onMessage.addListener((request) => {
if (request.type === 'COUNT') {
console.log('background has received a message from popup, and count is ', request?.count)
}
})
3 changes: 0 additions & 3 deletions template-svelte-js/src/content/index.js

This file was deleted.

1 change: 1 addition & 0 deletions template-svelte-js/src/contentScript/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.info('contentScript is running')
56 changes: 56 additions & 0 deletions template-svelte-js/src/devtools/DevTools.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<script>
const link = 'https://github.com/guocaoyi/create-chrome-ext'
</script>

<main>
<h3>DevTools Page</h3>

<a href={link} target="_blank">generated by create-chrome-ext</a>
</main>

<style>
:global(:root) {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
color-scheme: light dark;
background-color: #242424;
}
@media (prefers-color-scheme: light) {
:global(:root) {
background-color: #fafafa;
}
a:hover {
color: #ff3e00;
}
}
:global(body) {
min-width: 20rem;
margin: 0;
}
main {
text-align: center;
padding: 1em;
margin: 0 auto;
}
h3 {
color: #ff3e00;
text-transform: uppercase;
font-size: 1.5rem;
font-weight: 200;
line-height: 1.2rem;
margin: 2rem auto;
}
a {
font-size: 0.5rem;
margin: 0.5rem;
color: #cccccc;
text-decoration: none;
}
</style>
12 changes: 11 additions & 1 deletion template-svelte-js/src/devtools/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
export {}
import App from './DevTools.svelte'

const app = new App({
target: document.getElementById('app'),
})

chrome.devtools.panels.create('SvelteCrx', '', '../../devtools.html', function () {
console.log('devtools panel create')
})

export default app
15 changes: 10 additions & 5 deletions template-svelte-js/src/manifest.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json'

export default defineManifest({
name: 'create-chrome-ext',
description: '',
version: '0.0.0',
name: packageData.name,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
icons: {
16: 'img/logo-16.png',
Expand All @@ -16,14 +17,15 @@ export default defineManifest({
default_icon: 'img/logo-48.png',
},
options_page: 'options.html',
devtools_page: 'devtools.html',
background: {
service_worker: 'src/background/index.js',
type: 'module',
},
content_scripts: [
{
matches: ['http://*/*', 'https://*/*'],
js: ['src/content/index.js'],
js: ['src/contentScript/index.js'],
},
],
side_panel: {
Expand All @@ -35,5 +37,8 @@ export default defineManifest({
matches: [],
},
],
permissions: ['sidePanel'],
permissions: ['sidePanel', 'storage'],
chrome_url_overrides: {
newtab: 'newtab.html',
},
})
Loading

0 comments on commit 27b1a04

Please sign in to comment.