Skip to content

Commit

Permalink
Merge pull request #64 from sakibul-islam/dev-indicator
Browse files Browse the repository at this point in the history
 Show development mode indicator in browser
  • Loading branch information
guocaoyi authored Dec 20, 2023
2 parents 83181c7 + 0b403c9 commit eaa3903
Show file tree
Hide file tree
Showing 34 changed files with 82 additions and 20 deletions.
1 change: 1 addition & 0 deletions template-alpine-js/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-alpine-js",
"displayName": "Alpine.js Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
8 changes: 5 additions & 3 deletions template-alpine-js/src/manifest.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json'

const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand All @@ -19,13 +21,13 @@ export default defineManifest({
options_page: 'options.html',
devtools_page: 'devtools.html',
background: {
service_worker: 'src/background/index.ts',
service_worker: 'src/background/index.js',
type: 'module',
},
content_scripts: [
{
matches: ['http://*/*', 'https://*/*'],
js: ['src/contentScript/index.ts'],
js: ['src/contentScript/index.js'],
},
],
side_panel: {
Expand Down
1 change: 1 addition & 0 deletions template-alpine-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-alpine-ts",
"displayName": "Alpine.ts Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
5 changes: 4 additions & 1 deletion template-alpine-ts/src/manifest.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json'

//@ts-ignore
const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
1 change: 1 addition & 0 deletions template-inferno-js/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-inferno-js",
"displayName": "Inferno.js Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
4 changes: 3 additions & 1 deletion template-inferno-js/src/manifest.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json'

const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
1 change: 1 addition & 0 deletions template-inferno-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-inferno-ts",
"displayName": "Inferno.ts Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
5 changes: 4 additions & 1 deletion template-inferno-ts/src/manifest.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json'

//@ts-ignore
const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
1 change: 1 addition & 0 deletions template-lit-js/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-lit-js",
"displayName": "Lit.js Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
4 changes: 3 additions & 1 deletion template-lit-js/src/manifest.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json'

const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
1 change: 1 addition & 0 deletions template-lit-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-lit-ts",
"displayName": "Lit.ts Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
6 changes: 5 additions & 1 deletion template-lit-ts/src/manifest.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { defineManifest } from '@crxjs/vite-plugin'
//@ts-ignore
import packageData from '../package.json'

//@ts-ignore
const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
1 change: 1 addition & 0 deletions template-preact-js/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-preact-js",
"displayName": "Preact.js Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
4 changes: 3 additions & 1 deletion template-preact-js/src/manifest.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json' assert { type: 'json' }

const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
1 change: 1 addition & 0 deletions template-preact-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-preact-ts",
"displayName": "Preact.ts Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
5 changes: 4 additions & 1 deletion template-preact-ts/src/manifest.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json'

//@ts-ignore
const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
4 changes: 3 additions & 1 deletion template-react-js/src/manifest.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json' assert { type: 'json' }

const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
5 changes: 4 additions & 1 deletion template-react-ts/src/manifest.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json'

//@ts-ignore
const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
1 change: 1 addition & 0 deletions template-solid-js/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-solod-js",
"displayName": "Solid.js Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
4 changes: 3 additions & 1 deletion template-solid-js/src/manifest.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json'

const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
1 change: 1 addition & 0 deletions template-solid-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-solid-ts",
"displayName": "Solid.ts Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
5 changes: 4 additions & 1 deletion template-solid-ts/src/manifest.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json'

//@ts-ignore
const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
1 change: 1 addition & 0 deletions template-svelte-js/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-svelte-js",
"displayName": "Svelte.js Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
4 changes: 3 additions & 1 deletion template-svelte-js/src/manifest.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json'

const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
1 change: 1 addition & 0 deletions template-svelte-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-svelte-ts",
"displayName": "Svelte.ts Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
5 changes: 4 additions & 1 deletion template-svelte-ts/src/manifest.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json'

//@ts-ignore
const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
1 change: 1 addition & 0 deletions template-vanilla-js/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-vanilla-js",
"displayName": "Vanilla.js Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
4 changes: 3 additions & 1 deletion template-vanilla-js/src/manifest.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json'

const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
1 change: 1 addition & 0 deletions template-vanilla-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-vanilla-ts",
"displayName": "Vanilla.ts Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
5 changes: 4 additions & 1 deletion template-vanilla-ts/src/manifest.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json'

//@ts-ignore
const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
1 change: 1 addition & 0 deletions template-vue-js/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-vue-js",
"displayName": "Vue.js Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
4 changes: 3 additions & 1 deletion template-vue-js/src/manifest.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json' assert { type: 'json' }

const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down
1 change: 1 addition & 0 deletions template-vue-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chrome-extension-vue-ts",
"displayName": "Vue.ts Chrome Extension",
"version": "0.0.0",
"author": "",
"description": "",
Expand Down
5 changes: 4 additions & 1 deletion template-vue-ts/src/manifest.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { defineManifest } from '@crxjs/vite-plugin'
import packageData from '../package.json'

//@ts-ignore
const isDev = process.env.NODE_ENV == 'development'

export default defineManifest({
name: packageData.name,
name: `${packageData.displayName || packageData.name}${isDev ? ` ➡️ Dev` : ''}`,
description: packageData.description,
version: packageData.version,
manifest_version: 3,
Expand Down

0 comments on commit eaa3903

Please sign in to comment.