From 5b4de3a411ede58c00517cf72fbab5bd5acfb882 Mon Sep 17 00:00:00 2001 From: Joey Pereira Date: Sun, 20 Aug 2023 19:12:07 -0400 Subject: [PATCH 1/9] fix: use event syntax for particlesLoaded --- .../vue3-alt/src/components/Particles.vue | 83 ++++++++---------- components/vue3/src/components/Particles.vue | 84 +++++++++---------- pnpm-lock.yaml | 11 ++- 3 files changed, 82 insertions(+), 96 deletions(-) diff --git a/components/vue3-alt/src/components/Particles.vue b/components/vue3-alt/src/components/Particles.vue index 79aba52..cb5c6d2 100644 --- a/components/vue3-alt/src/components/Particles.vue +++ b/components/vue3-alt/src/components/Particles.vue @@ -2,65 +2,56 @@
- diff --git a/components/vue3/src/components/Particles.vue b/components/vue3/src/components/Particles.vue index 79aba52..cc162ba 100644 --- a/components/vue3/src/components/Particles.vue +++ b/components/vue3/src/components/Particles.vue @@ -2,65 +2,57 @@
- diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c57ee7a..4ebd933 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,9 +1,5 @@ lockfileVersion: '6.0' -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - importers: .: @@ -77,6 +73,9 @@ importers: tsparticles: specifier: ^2.12.0 version: 2.12.0 + tsparticles-engine: + specifier: ^2.12.0 + version: 2.12.0 typescript: specifier: ^5.1.6 version: 5.1.6 @@ -11059,3 +11058,7 @@ packages: compress-commons: 4.1.1 readable-stream: 3.6.2 dev: false + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false From 4a93b5d1346ee7e88d625afbc5aa785340dd371c Mon Sep 17 00:00:00 2001 From: Joey Pereira Date: Sun, 20 Aug 2023 19:13:26 -0400 Subject: [PATCH 2/9] fix(example): clean up Nuxt example & fix type-checking --- apps/nuxt3/.npmrc | 1 + apps/nuxt3/app.vue | 89 +++++++++++++++-------------- apps/nuxt3/nuxt.config.ts | 9 +-- apps/nuxt3/package.json | 1 + apps/nuxt3/shim-vue3-particles.d.ts | 1 - 5 files changed, 48 insertions(+), 53 deletions(-) create mode 100644 apps/nuxt3/.npmrc delete mode 100644 apps/nuxt3/shim-vue3-particles.d.ts diff --git a/apps/nuxt3/.npmrc b/apps/nuxt3/.npmrc new file mode 100644 index 0000000..bf2e764 --- /dev/null +++ b/apps/nuxt3/.npmrc @@ -0,0 +1 @@ +shamefully-hoist=true diff --git a/apps/nuxt3/app.vue b/apps/nuxt3/app.vue index 3f108b5..b6c214b 100644 --- a/apps/nuxt3/app.vue +++ b/apps/nuxt3/app.vue @@ -1,55 +1,56 @@ - diff --git a/apps/nuxt3/nuxt.config.ts b/apps/nuxt3/nuxt.config.ts index 558c151..14c3980 100644 --- a/apps/nuxt3/nuxt.config.ts +++ b/apps/nuxt3/nuxt.config.ts @@ -1,11 +1,4 @@ import { defineNuxtConfig } from 'nuxt/config' // https://v3.nuxtjs.org/api/configuration/nuxt.config -export default defineNuxtConfig({ - plugins: [ - { - src: '~/plugins/vue3-particles.ts', - mode: 'client', - }, - ], -}) +export default defineNuxtConfig({}) diff --git a/apps/nuxt3/package.json b/apps/nuxt3/package.json index eb5949d..676d17f 100644 --- a/apps/nuxt3/package.json +++ b/apps/nuxt3/package.json @@ -35,6 +35,7 @@ "nuxt": "^3.6.5", "prettier": "^3.0.1", "tsparticles": "^2.12.0", + "tsparticles-engine": "^2.12.0", "typescript": "^5.1.6", "vue": "^3.3.4", "vue3-particles": "workspace:^", diff --git a/apps/nuxt3/shim-vue3-particles.d.ts b/apps/nuxt3/shim-vue3-particles.d.ts deleted file mode 100644 index 39840a4..0000000 --- a/apps/nuxt3/shim-vue3-particles.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module 'vue3-particles' From 7064feb638a503a0bb158c49d0a76d16142bede2 Mon Sep 17 00:00:00 2001 From: Joey Pereira Date: Sun, 20 Aug 2023 19:13:47 -0400 Subject: [PATCH 3/9] fix(example): clean up Vite example and remove dead code --- apps/vue3/src/App.vue | 115 ++++++++---------- apps/vue3/src/components/HelloWorld.vue | 40 ------ apps/vue3/src/components/TheWelcome.vue | 91 -------------- apps/vue3/src/components/WelcomeItem.vue | 86 ------------- .../src/components/icons/IconCommunity.vue | 12 -- .../components/icons/IconDocumentation.vue | 12 -- .../src/components/icons/IconEcosystem.vue | 12 -- .../vue3/src/components/icons/IconSupport.vue | 12 -- .../vue3/src/components/icons/IconTooling.vue | 19 --- apps/vue3/src/main.ts | 3 +- apps/vue3/src/router/index.ts | 23 ---- apps/vue3/src/views/AboutView.vue | 15 --- apps/vue3/src/views/HomeView.vue | 44 ------- 13 files changed, 51 insertions(+), 433 deletions(-) delete mode 100644 apps/vue3/src/components/HelloWorld.vue delete mode 100644 apps/vue3/src/components/TheWelcome.vue delete mode 100644 apps/vue3/src/components/WelcomeItem.vue delete mode 100644 apps/vue3/src/components/icons/IconCommunity.vue delete mode 100644 apps/vue3/src/components/icons/IconDocumentation.vue delete mode 100644 apps/vue3/src/components/icons/IconEcosystem.vue delete mode 100644 apps/vue3/src/components/icons/IconSupport.vue delete mode 100644 apps/vue3/src/components/icons/IconTooling.vue delete mode 100644 apps/vue3/src/router/index.ts delete mode 100644 apps/vue3/src/views/AboutView.vue delete mode 100644 apps/vue3/src/views/HomeView.vue diff --git a/apps/vue3/src/App.vue b/apps/vue3/src/App.vue index 02efd0a..015eaef 100644 --- a/apps/vue3/src/App.vue +++ b/apps/vue3/src/App.vue @@ -3,104 +3,89 @@ import type { Container, Engine } from "tsparticles-engine"; import { loadFull } from "tsparticles"; import configs from "tsparticles-demo-configs"; -import HelloWorld from "./components/HelloWorld.vue"; -import TheWelcome from "./components/TheWelcome.vue"; - const options = configs.basic; const particlesInit = async (engine: Engine) => { - await loadFull(engine); + await loadFull(engine); - console.log(engine); + console.log(engine); }; const particlesLoaded = async (container: Container) => { - console.log(container); + console.log(container); }; diff --git a/apps/vue3/src/components/HelloWorld.vue b/apps/vue3/src/components/HelloWorld.vue deleted file mode 100644 index e67e9e6..0000000 --- a/apps/vue3/src/components/HelloWorld.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/apps/vue3/src/components/TheWelcome.vue b/apps/vue3/src/components/TheWelcome.vue deleted file mode 100644 index 35c3b0f..0000000 --- a/apps/vue3/src/components/TheWelcome.vue +++ /dev/null @@ -1,91 +0,0 @@ - - - diff --git a/apps/vue3/src/components/WelcomeItem.vue b/apps/vue3/src/components/WelcomeItem.vue deleted file mode 100644 index 6cff194..0000000 --- a/apps/vue3/src/components/WelcomeItem.vue +++ /dev/null @@ -1,86 +0,0 @@ - - - diff --git a/apps/vue3/src/components/icons/IconCommunity.vue b/apps/vue3/src/components/icons/IconCommunity.vue deleted file mode 100644 index ea8ddef..0000000 --- a/apps/vue3/src/components/icons/IconCommunity.vue +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/apps/vue3/src/components/icons/IconDocumentation.vue b/apps/vue3/src/components/icons/IconDocumentation.vue deleted file mode 100644 index 63a8534..0000000 --- a/apps/vue3/src/components/icons/IconDocumentation.vue +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/apps/vue3/src/components/icons/IconEcosystem.vue b/apps/vue3/src/components/icons/IconEcosystem.vue deleted file mode 100644 index 385a202..0000000 --- a/apps/vue3/src/components/icons/IconEcosystem.vue +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/apps/vue3/src/components/icons/IconSupport.vue b/apps/vue3/src/components/icons/IconSupport.vue deleted file mode 100644 index 7db961e..0000000 --- a/apps/vue3/src/components/icons/IconSupport.vue +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/apps/vue3/src/components/icons/IconTooling.vue b/apps/vue3/src/components/icons/IconTooling.vue deleted file mode 100644 index 660598d..0000000 --- a/apps/vue3/src/components/icons/IconTooling.vue +++ /dev/null @@ -1,19 +0,0 @@ - - diff --git a/apps/vue3/src/main.ts b/apps/vue3/src/main.ts index 8ba15d4..6947b40 100644 --- a/apps/vue3/src/main.ts +++ b/apps/vue3/src/main.ts @@ -1,12 +1,11 @@ import { createApp } from "vue"; import Particles from "vue3-particles"; import App from "./App.vue"; -import router from "./router"; import "./assets/main.css"; const app = createApp(App); -app.use(router).use(Particles); +app.use(Particles); app.mount("#app"); diff --git a/apps/vue3/src/router/index.ts b/apps/vue3/src/router/index.ts deleted file mode 100644 index 35612dc..0000000 --- a/apps/vue3/src/router/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { createRouter, createWebHistory } from "vue-router"; -import HomeView from "../views/HomeView.vue"; - -const router = createRouter({ - history: createWebHistory(import.meta.env.BASE_URL), - routes: [ - { - path: "/", - name: "home", - component: HomeView, - }, - { - path: "/about", - name: "about", - // route level code-splitting - // this generates a separate chunk (About.[hash].js) for this route - // which is lazy-loaded when the route is visited. - component: () => import("../views/AboutView.vue"), - }, - ], -}); - -export default router; diff --git a/apps/vue3/src/views/AboutView.vue b/apps/vue3/src/views/AboutView.vue deleted file mode 100644 index 756ad2a..0000000 --- a/apps/vue3/src/views/AboutView.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/apps/vue3/src/views/HomeView.vue b/apps/vue3/src/views/HomeView.vue deleted file mode 100644 index 3a90b0c..0000000 --- a/apps/vue3/src/views/HomeView.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - - From 17ff54ecb331ac260892fb5a559dd1d34ef3fc92 Mon Sep 17 00:00:00 2001 From: Joey Pereira Date: Sun, 20 Aug 2023 22:03:33 -0400 Subject: [PATCH 4/9] fix(example): use proper types --- apps/nuxt3/app.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/nuxt3/app.vue b/apps/nuxt3/app.vue index b6c214b..1743421 100644 --- a/apps/nuxt3/app.vue +++ b/apps/nuxt3/app.vue @@ -11,8 +11,7 @@ From a89474a7c67ba8e6429c38499b7f4b8621280a87 Mon Sep 17 00:00:00 2001 From: Joey Pereira Date: Mon, 21 Aug 2023 03:15:11 -0400 Subject: [PATCH 8/9] fix(example): remove console#log --- apps/nuxt3/app.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/nuxt3/app.vue b/apps/nuxt3/app.vue index e72adf5..97d1a46 100644 --- a/apps/nuxt3/app.vue +++ b/apps/nuxt3/app.vue @@ -40,7 +40,6 @@ const options: ISourceOptions = { const particlesInit = async (engine) => { await loadFull(engine) - console.log(engine) } const particlesLoaded = (container: Container) => { From e537e3ae2fb2fbc101f6ef18f2f5dec518407f34 Mon Sep 17 00:00:00 2001 From: Joey Pereira Date: Mon, 21 Aug 2023 03:19:02 -0400 Subject: [PATCH 9/9] fix(example): remove console#log --- apps/vue3/src/App.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/vue3/src/App.vue b/apps/vue3/src/App.vue index 015eaef..3cb041e 100644 --- a/apps/vue3/src/App.vue +++ b/apps/vue3/src/App.vue @@ -7,8 +7,6 @@ const options = configs.basic; const particlesInit = async (engine: Engine) => { await loadFull(engine); - - console.log(engine); }; const particlesLoaded = async (container: Container) => {