From 3b16c98f86bb354b7a463f05f017d27947523180 Mon Sep 17 00:00:00 2001 From: Matthew Schroeter Date: Fri, 21 Jul 2023 22:42:42 -0500 Subject: [PATCH 1/4] added .idea to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a03155daa..1591b216c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ dist/ # misc .DS_Store *.pem +.idea # debug npm-debug.log* From ea81a487ed829226c20b997b762e4c9ea267d0f4 Mon Sep 17 00:00:00 2001 From: Matthew Schroeter Date: Fri, 21 Jul 2023 22:45:18 -0500 Subject: [PATCH 2/4] defined __VUE_OPTIONS_API__ and __VUE_PROD_DEVTOOLS__ in the static vue3 template to eliminate console warning --- cli/plasmo/templates/static/vue3/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cli/plasmo/templates/static/vue3/index.ts b/cli/plasmo/templates/static/vue3/index.ts index f42f46934..a95b78ebe 100644 --- a/cli/plasmo/templates/static/vue3/index.ts +++ b/cli/plasmo/templates/static/vue3/index.ts @@ -3,6 +3,13 @@ import { createApp } from "vue" import * as Component from "__plasmo_import_module__" +__VUE_OPTIONS_API__ = true +if(process.env.NODE_ENV !== 'production') { + __VUE_PROD_DEVTOOLS__ = true +} else { + __VUE_PROD_DEVTOOLS__ = false +} + document.addEventListener("DOMContentLoaded", () => { const app = createApp(Component.default) Component.default.prepare?.(app) From 9e3d3d5cbb58998f7655e7ed6f023b655a6de95a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=E2=9D=A4=EF=B8=8F=20=E2=98=AE=EF=B8=8F=20=E2=9C=8B?= <6723574+louisgv@users.noreply.github.com> Date: Mon, 24 Jul 2023 01:12:16 -0700 Subject: [PATCH 3/4] move to common helper --- cli/create-plasmo/package.json | 2 +- cli/plasmo/package.json | 2 +- cli/plasmo/templates/static/common/vue.ts | 5 +++++ .../templates/static/vue3/content-script-ui-mount.ts | 2 ++ cli/plasmo/templates/static/vue3/index.ts | 9 ++------- 5 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 cli/plasmo/templates/static/common/vue.ts diff --git a/cli/create-plasmo/package.json b/cli/create-plasmo/package.json index fe40077fa..502817889 100644 --- a/cli/create-plasmo/package.json +++ b/cli/create-plasmo/package.json @@ -1,6 +1,6 @@ { "name": "create-plasmo", - "version": "0.81.1", + "version": "0.82.0", "description": "Create Plasmo Framework Browser Extension", "main": "dist/index.js", "bin": "bin/index.mjs", diff --git a/cli/plasmo/package.json b/cli/plasmo/package.json index 57ef237fb..1574885d0 100644 --- a/cli/plasmo/package.json +++ b/cli/plasmo/package.json @@ -1,6 +1,6 @@ { "name": "plasmo", - "version": "0.81.1", + "version": "0.82.0", "description": "The Plasmo Framework CLI", "publishConfig": { "types": "dist/type.d.ts" diff --git a/cli/plasmo/templates/static/common/vue.ts b/cli/plasmo/templates/static/common/vue.ts new file mode 100644 index 000000000..81530b1d2 --- /dev/null +++ b/cli/plasmo/templates/static/common/vue.ts @@ -0,0 +1,5 @@ +if (process.env.NODE_ENV !== "production") { + globalThis.__VUE_OPTIONS_API__ = true +} else { + globalThis.__VUE_OPTIONS_API__ = false +} diff --git a/cli/plasmo/templates/static/vue3/content-script-ui-mount.ts b/cli/plasmo/templates/static/vue3/content-script-ui-mount.ts index ef2c0a301..064b548bf 100644 --- a/cli/plasmo/templates/static/vue3/content-script-ui-mount.ts +++ b/cli/plasmo/templates/static/vue3/content-script-ui-mount.ts @@ -12,6 +12,8 @@ import type { PlasmoCSUIHTMLContainer } from "~type" +import "@plasmo-static-common/vue" + // @ts-ignore import RawMount from "__plasmo_mount_content_script__" // @ts-ignore diff --git a/cli/plasmo/templates/static/vue3/index.ts b/cli/plasmo/templates/static/vue3/index.ts index a95b78ebe..62ce7e1b2 100644 --- a/cli/plasmo/templates/static/vue3/index.ts +++ b/cli/plasmo/templates/static/vue3/index.ts @@ -1,14 +1,9 @@ -// @ts-nocheck import { createApp } from "vue" +// @ts-ignore import * as Component from "__plasmo_import_module__" -__VUE_OPTIONS_API__ = true -if(process.env.NODE_ENV !== 'production') { - __VUE_PROD_DEVTOOLS__ = true -} else { - __VUE_PROD_DEVTOOLS__ = false -} +import "@plasmo-static-common/vue" document.addEventListener("DOMContentLoaded", () => { const app = createApp(Component.default) From f8f665c7e470bcdf2ac012389251bc418db145d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=E2=9D=A4=EF=B8=8F=20=E2=98=AE=EF=B8=8F=20=E2=9C=8B?= <6723574+louisgv@users.noreply.github.com> Date: Mon, 24 Jul 2023 01:15:57 -0700 Subject: [PATCH 4/4] fix flag --- cli/plasmo/templates/static/common/vue.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cli/plasmo/templates/static/common/vue.ts b/cli/plasmo/templates/static/common/vue.ts index 81530b1d2..05b462810 100644 --- a/cli/plasmo/templates/static/common/vue.ts +++ b/cli/plasmo/templates/static/common/vue.ts @@ -1,5 +1,2 @@ -if (process.env.NODE_ENV !== "production") { - globalThis.__VUE_OPTIONS_API__ = true -} else { - globalThis.__VUE_OPTIONS_API__ = false -} +globalThis.__VUE_OPTIONS_API__ = true +globalThis.__VUE_PROD_DEVTOOLS__ = process.env.NODE_ENV !== "production"