Skip to content

Commit

Permalink
build: updated for tsParticles v3
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobruni committed Dec 29, 2023
1 parent c2eb273 commit defb7e6
Show file tree
Hide file tree
Showing 10 changed files with 3,588 additions and 1,762 deletions.
58 changes: 29 additions & 29 deletions apps/solid/package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{
"name": "solid-particles-demo",
"version": "2.9.3",
"private": true,
"devDependencies": {
"@types/jest": "^29.2.4",
"@types/node": "^18.11.17",
"browserslist": "^4.21.5",
"component-register": "^0.7.0",
"solid-js": "^1.6.6",
"solid-particles": "^2.9.3",
"solid-scripts": "^0.0.61",
"tsparticles": "^2.9.3",
"tsparticles-demo-configs": "^2.9.3",
"tsparticles-engine": "^2.9.3",
"typescript": "^5.0.0"
},
"scripts": {
"start": "solid-scripts start",
"build": "env NODE_OPTIONS=--openssl-legacy-provider solid-scripts build",
"build:ci": "env NODE_OPTIONS=--openssl-legacy-provider solid-scripts build",
"test": "solid-scripts test"
},
"browserslist": [
"Chrome 74",
"Firefox 63",
"Safari 11",
"Edge 17",
"Node 10"
]
"name": "@tsparticles/solid-demo",
"version": "2.9.3",
"private": true,
"devDependencies": {
"@types/jest": "^29.5.11",
"@types/node": "^20.10.5",
"browserslist": "^4.22.2",
"component-register": "^0.8.3",
"solid-js": "^1.8.7",
"@tsparticles/solid": "workspace:^",
"solid-scripts": "^0.0.61",
"tsparticles": "^3.0.3",
"@tsparticles/configs": "^3.0.3",
"@tsparticles/engine": "^3.0.3",
"typescript": "^5.0.0"
},
"scripts": {
"start": "env NODE_OPTIONS=--openssl-legacy-provider solid-scripts start",
"build": "env NODE_OPTIONS=--openssl-legacy-provider solid-scripts build",
"build:ci": "env NODE_OPTIONS=--openssl-legacy-provider solid-scripts build",
"test": "solid-scripts test"
},
"browserslist": [
"Chrome 74",
"Firefox 63",
"Safari 11",
"Edge 17",
"Node 10"
]
}
27 changes: 19 additions & 8 deletions apps/solid/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
import logo from './logo.svg';
import './App.css';
import Particles from "solid-particles";
import type { Engine } from "tsparticles-engine";
import { loadFull } from "tsparticles";
import { basic } from "tsparticles-demo-configs";

async function particlesInit(engine: Engine): Promise<void> {
await loadFull(engine);
}
import configs from "@tsparticles/configs";
import { createEffect, createSignal } from "solid-js";
import Particles, { initParticlesEngine } from "@tsparticles/solid";
import { Engine } from "@tsparticles/engine";

function App() {
const [ init, setInit ] = createSignal<boolean>(false);

createEffect(() => {
if (init()) {
return;
}

initParticlesEngine(async (engine: Engine) => {
await loadFull(engine);
}).then(() => {
setInit(true);
})
});

return (
<div class="App">
<header class="App-header">
Expand All @@ -26,7 +37,7 @@ function App() {
Learn Solid
</a>
</header>
<Particles id="tsparticles" options={basic} init={particlesInit}/>
{init() && <Particles id="tsparticles" options={configs.basic}/>}
</div>
);
}
Expand Down
237 changes: 120 additions & 117 deletions components/solid/package.json
Original file line number Diff line number Diff line change
@@ -1,85 +1,85 @@
{
"name": "solid-particles",
"version": "2.9.3",
"description": "Official tsParticles Solid Component - Easily create highly customizable particle, confetti and fireworks animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Riot.js.",
"main": "dist/particles.js",
"scripts": {
"build": "pnpm run prettify:src && pnpm run lint && webpack --mode production && pnpm run prettify:readme",
"build:ci": "pnpm run prettify:ci:src && pnpm run lint:ci && webpack --mode production && pnpm run prettify:ci:readme",
"build:debug": "pnpm run prettify:src && pnpm run lint && webpack && pnpm run prettify:readme",
"check": "tsc",
"lint": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
"lint:ci": "eslint src --ext .js,.jsx,.ts,.tsx",
"prettify:ci:src": "prettier --check ./src/*",
"prettify:ci:readme": "prettier --check ./README.md",
"prettify:src": "prettier --write ./src/*",
"prettify:readme": "prettier --write ./README.md",
"prepack": "pnpm run build"
},
"bugs": {
"url": "https://github.com/tsparticles/solid/issues"
},
"repository": {
"url": "https://github.com/tsparticles/solid",
"directory": "components/solid",
"type": "git"
},
"keywords": [
"front-end",
"frontend",
"tsparticles",
"particles.js",
"particlesjs",
"particles",
"particle",
"canvas",
"jsparticles",
"xparticles",
"particles-js",
"particles-bg",
"particles-bg-vue",
"particles-ts",
"particles.ts",
"react-particles-js",
"react-particles.js",
"react-particles",
"react",
"reactjs",
"vue-particles",
"ngx-particles",
"angular-particles",
"particleground",
"vue",
"vuejs",
"preact",
"preactjs",
"jquery",
"angularjs",
"angular",
"typescript",
"javascript",
"animation",
"web",
"html5",
"web-design",
"webdesign",
"css",
"html",
"css3",
"animated",
"background",
"confetti",
"canvas",
"fireworks",
"fireworks-js",
"confetti-js",
"confettijs",
"fireworksjs",
"canvas-confetti"
],
"author": "Matteo Bruni <[email protected]>",
"license": "MIT",
"homepage": "https://particles.js.org",
"name": "@tsparticles/solid",
"version": "2.9.3",
"description": "Official tsParticles Solid Component - Easily create highly customizable particle, confetti and fireworks animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Riot.js.",
"main": "dist/particles.js",
"scripts": {
"build": "pnpm run prettify:src && pnpm run lint && webpack --mode production && pnpm run prettify:readme",
"build:ci": "pnpm run prettify:ci:src && pnpm run lint:ci && webpack --mode production && pnpm run prettify:ci:readme",
"build:debug": "pnpm run prettify:src && pnpm run lint && webpack && pnpm run prettify:readme",
"check": "tsc",
"lint": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
"lint:ci": "eslint src --ext .js,.jsx,.ts,.tsx",
"prettify:ci:src": "prettier --check ./src/*",
"prettify:ci:readme": "prettier --check ./README.md",
"prettify:src": "prettier --write ./src/*",
"prettify:readme": "prettier --write ./README.md",
"prepack": "pnpm run build"
},
"bugs": {
"url": "https://github.com/tsparticles/solid/issues"
},
"repository": {
"url": "https://github.com/tsparticles/solid",
"directory": "components/solid",
"type": "git"
},
"keywords": [
"front-end",
"frontend",
"tsparticles",
"particles.js",
"particlesjs",
"particles",
"particle",
"canvas",
"jsparticles",
"xparticles",
"particles-js",
"particles-bg",
"particles-bg-vue",
"particles-ts",
"particles.ts",
"react-particles-js",
"react-particles.js",
"react-particles",
"react",
"reactjs",
"vue-particles",
"ngx-particles",
"angular-particles",
"particleground",
"vue",
"vuejs",
"preact",
"preactjs",
"jquery",
"angularjs",
"angular",
"typescript",
"javascript",
"animation",
"web",
"html5",
"web-design",
"webdesign",
"css",
"html",
"css3",
"animated",
"background",
"confetti",
"canvas",
"fireworks",
"fireworks-js",
"confetti-js",
"confettijs",
"fireworksjs",
"canvas-confetti"
],
"author": "Matteo Bruni <[email protected]>",
"license": "MIT",
"homepage": "https://particles.js.org",
"funding": [
{
"type": "github",
Expand All @@ -94,40 +94,43 @@
"url": "https://www.buymeacoffee.com/matteobruni"
}
],
"prettier": "@tsparticles/prettier-config",
"peerDependencies": {
"solid-js": ">=1.0.0"
},
"dependencies": {
"fast-deep-equal": "^3.1.3",
"solid-js": "^1.6.6",
"tsparticles-engine": "^2.9.3"
},
"devDependencies": {
"@babel/core": "^7.20.7",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"@babel/runtime": "^7.20.7",
"@tsparticles/prettier-config": "^1.6.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"babel-loader": "^9.1.0",
"babel-preset-solid": "^1.6.6",
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.7.3",
"eslint": "^8.32.0",
"eslint-config-prettier": "^9.0.0",
"html-webpack-plugin": "^5.5.0",
"node-sass": "^9.0.0",
"prettier": "^3.0.0",
"sass-loader": "^13.2.0",
"source-map-loader": "^4.0.1",
"style-loader": "^3.3.1",
"typescript": "^5.0.0",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1"
}
"prettier": "@tsparticles/prettier-config",
"publishConfig": {
"access": "public"
},
"peerDependencies": {
"solid-js": ">=1.0.0"
},
"dependencies": {
"fast-deep-equal": "^3.1.3",
"solid-js": "^1.8.7",
"@tsparticles/engine": "^3.0.3"
},
"devDependencies": {
"@babel/core": "^7.23.6",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-runtime": "^7.23.6",
"@babel/preset-env": "^7.23.6",
"@babel/preset-typescript": "^7.23.3",
"@babel/runtime": "^7.23.6",
"@tsparticles/prettier-config": "^2.0.1",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"babel-loader": "^9.1.3",
"babel-preset-solid": "^1.8.6",
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.8.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.0.0",
"html-webpack-plugin": "^5.6.0",
"node-sass": "^9.0.0",
"prettier": "^3.0.0",
"sass-loader": "^13.3.3",
"source-map-loader": "^4.0.2",
"style-loader": "^3.3.3",
"typescript": "^5.0.0",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
}
}
3 changes: 1 addition & 2 deletions components/solid/src/IParticlesProps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Container, ISourceOptions, Engine } from "tsparticles-engine";
import type { Container, ISourceOptions } from "@tsparticles/engine";
import { JSX } from "solid-js";

export interface IParticlesProps {
Expand All @@ -12,6 +12,5 @@ export interface IParticlesProps {
className?: string;
canvasClassName?: string;
container?: { current: Container };
init?: (engine: Engine) => Promise<void>;
loaded?: (container: Container) => Promise<void>;
}
Loading

0 comments on commit defb7e6

Please sign in to comment.