From d3e75dfadf7ca261dcffeb03a75da3fa2dc61c18 Mon Sep 17 00:00:00 2001 From: Matteo Bruni <176620+matteobruni@users.noreply.github.com> Date: Thu, 21 Dec 2023 16:58:32 +0100 Subject: [PATCH] feat: working for making it work and updating for v3, still not ready --- apps/vue2/package.json | 42 +- apps/vue2/src/App.vue | 8 +- apps/vue2/src/main.ts | 12 +- apps/vue2/src/shims-vue.d.ts | 2 +- apps/vue3/package.json | 32 +- apps/vue3/src/App.vue | 14 +- apps/vue3/src/main.ts | 16 +- components/vue/package.json | 24 +- .../{Particles.vue => vue-particles.vue} | 0 components/vue/src/index.ts | 14 +- pnpm-lock.yaml | 4453 ++++++++++++----- 11 files changed, 3427 insertions(+), 1190 deletions(-) rename components/vue/src/components/{Particles.vue => vue-particles.vue} (100%) diff --git a/apps/vue2/package.json b/apps/vue2/package.json index 6c2eb4c..1db29fe 100644 --- a/apps/vue2/package.json +++ b/apps/vue2/package.json @@ -21,41 +21,41 @@ "url": "https://github.com/tsparticles/vue2/issues" }, "dependencies": { - "@tsparticles/configs": "^3.0.0-beta.2", - "@tsparticles/engine": "^3.0.0-beta.2", + "@tsparticles/configs": "^3.0.2", + "@tsparticles/engine": "^3.0.2", "@tsparticles/vue": "workspace:^", - "tsparticles": "^3.0.0-beta.2", - "vue": "^2.7.14", + "tsparticles": "^3.0.2", + "vue": "^2.7.15", "vue-class-component": "^7.2.6", "vue-property-decorator": "^9.1.2" }, "devDependencies": { - "@babel/core": "^7.22.19", + "@babel/core": "^7.23.5", "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/plugin-proposal-decorators": "^7.22.15", - "@rollup/plugin-json": "^6.0.0", - "@rollup/plugin-node-resolve": "^15.2.1", - "@rollup/plugin-replace": "^5.0.2", - "@typescript-eslint/eslint-plugin": "^6.7.0", - "@typescript-eslint/parser": "^6.7.0", + "@babel/plugin-proposal-decorators": "^7.23.5", + "@rollup/plugin-json": "^6.0.1", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-replace": "^5.0.5", + "@typescript-eslint/eslint-plugin": "^6.13.2", + "@typescript-eslint/parser": "^6.13.2", "@vue/cli-plugin-babel": "^5.0.8", "@vue/cli-plugin-typescript": "^5.0.8", "@vue/cli-service": "^5.0.8", - "babel-loader": "^8.3.0", - "eslint": "^8.49.0", - "eslint-config-prettier": "^9.0.0", - "fork-ts-checker-webpack-plugin": "^8.0.0", - "postcss": "^8.4.29", - "prettier": "^3.0.3", - "rollup": "^2.79.1", + "babel-loader": "^9.1.3", + "eslint": "^8.55.0", + "eslint-config-prettier": "^9.1.0", + "fork-ts-checker-webpack-plugin": "^9.0.2", + "postcss": "^8.4.32", + "prettier": "^3.1.0", + "rollup": "^4.7.0", "rollup-plugin-terser": "^7.0.2", "rollup-plugin-typescript": "^1.0.1", - "rollup-plugin-typescript2": "^0.35.0", + "rollup-plugin-typescript2": "^0.36.0", "rollup-plugin-vue": "^5.1.9", "tslib": "^2.6.2", - "typescript": "^5.2.2", + "typescript": "^5.3.3", "vue-loader": "^15.10.2", - "vue-template-compiler": "^2.7.14", + "vue-template-compiler": "^2.7.15", "webpack": "^4.46.0" } } diff --git a/apps/vue2/src/App.vue b/apps/vue2/src/App.vue index 916a02d..97960dd 100644 --- a/apps/vue2/src/App.vue +++ b/apps/vue2/src/App.vue @@ -1,22 +1,16 @@ diff --git a/apps/vue2/src/main.ts b/apps/vue2/src/main.ts index ae5486f..ee82d0c 100644 --- a/apps/vue2/src/main.ts +++ b/apps/vue2/src/main.ts @@ -1,12 +1,20 @@ import Vue from 'vue' import App from './App.vue' import Particles from "@tsparticles/vue"; +import { loadFull } from "tsparticles"; +import type { Engine } from '@tsparticles/engine'; Vue.config.productionTip = false -Vue.use(Particles); +Vue.use(Particles, { + init: async (engine: Engine) => { + // you can initialize the tsParticles instance (main) + // here, adding custom shapes or presets + await loadFull(engine); + } +}); new Vue({ - render: h => h(App), + render: h => h(App), }).$mount('#app') diff --git a/apps/vue2/src/shims-vue.d.ts b/apps/vue2/src/shims-vue.d.ts index 8948fea..1a39a56 100644 --- a/apps/vue2/src/shims-vue.d.ts +++ b/apps/vue2/src/shims-vue.d.ts @@ -3,4 +3,4 @@ declare module '*.vue' { export default Vue } -declare module "@tsparticles/vue"; \ No newline at end of file +declare module "@tsparticles/vue"; diff --git a/apps/vue3/package.json b/apps/vue3/package.json index f65b5e6..afb30c5 100644 --- a/apps/vue3/package.json +++ b/apps/vue3/package.json @@ -12,29 +12,29 @@ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore" }, "dependencies": { - "@tsparticles/configs": "^3.0.0-beta.2", - "@tsparticles/engine": "^3.0.0-beta.2", + "@tsparticles/configs": "^3.0.2", + "@tsparticles/engine": "^3.0.2", "@tsparticles/vue": "workspace:^", - "tsparticles": "^3.0.0-beta.2", - "vue": "^3.3.4", - "vue-router": "^4.2.4" + "tsparticles": "^3.0.2", + "vue": "^3.3.11", + "vue-router": "^4.2.5" }, "devDependencies": { - "@rushstack/eslint-patch": "^1.3.2", - "@tsconfig/node18": "^18.2.0", - "@types/node": "^20.4.7", - "@vitejs/plugin-vue": "^4.2.3", - "@vitejs/plugin-vue-jsx": "^3.0.1", + "@rushstack/eslint-patch": "^1.6.0", + "@tsconfig/node18": "^18.2.2", + "@types/node": "^20.10.4", + "@vitejs/plugin-vue": "^4.5.2", + "@vitejs/plugin-vue-jsx": "^3.1.0", "@vue/eslint-config-prettier": "^8.0.0", "@vue/eslint-config-typescript": "^12.0.0", "@vue/tsconfig": "^0.4.0", - "eslint": "^8.46.0", - "eslint-plugin-vue": "^9.16.1", + "eslint": "^8.55.0", + "eslint-plugin-vue": "^9.19.2", "minimatch": "^9.0.3", "npm-run-all": "^4.1.5", - "prettier": "^3.0.1", - "typescript": "^5.1.6", - "vite": "^4.4.8", - "vue-tsc": "^1.8.8" + "prettier": "^3.1.0", + "typescript": "^5.3.3", + "vite": "^5.0.7", + "vue-tsc": "^1.8.25" } } diff --git a/apps/vue3/src/App.vue b/apps/vue3/src/App.vue index f41cde4..aff5d6d 100644 --- a/apps/vue3/src/App.vue +++ b/apps/vue3/src/App.vue @@ -1,14 +1,9 @@