@tsparticles/cli 3.0.4 → 3.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,11 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import { buildCommand } from "./build/build.js";
3
3
  import { createCommand } from "./create/create.js";
4
- import pkgInfo from "../package.json" assert { type: "json" };
4
+ import { fileURLToPath } from "url";
5
+ import fs from "fs-extra";
6
+ import path from "path";
5
7
  import { program } from "commander";
8
+ const __filename = fileURLToPath(import.meta.url), __dirname = path.dirname(__filename), rootPkgPath = path.join(__dirname, "package.json"), pkg = (await fs.readJson(rootPkgPath));
6
9
  program.name("tsparticles-cli");
7
10
  program.description("tsParticles CLI");
8
- program.version(pkgInfo.version, "-v, --version", "output the current version");
11
+ program.version(pkg.version, "-v, --version", "output the current version");
9
12
  program.addCommand(buildCommand);
10
13
  program.addCommand(createCommand);
11
14
  program.parse(process.argv);
package/eslint.config.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import path from "path";
2
2
  import {fileURLToPath} from "url";
3
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
4
-
5
3
  import {defineConfig} from "eslint/config";
6
4
  import tsParticlesESLintConfig from "@tsparticles/eslint-config";
7
5
 
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
+
8
8
  export default defineConfig([
9
9
  tsParticlesESLintConfig,
10
10
  {
@@ -84,14 +84,12 @@
84
84
  "prettier": "@tsparticles/prettier-config",
85
85
  "devDependencies": {
86
86
  "@babel/core": "^7.28.3",
87
- "@tsparticles/cli": "^3.0.4",
88
- "@tsparticles/eslint-config": "^3.0.3",
87
+ "@tsparticles/cli": "^3.0.6",
88
+ "@tsparticles/eslint-config": "^3.0.5",
89
89
  "@tsparticles/prettier-config": "^3.0.1",
90
- "@tsparticles/tsconfig": "^3.0.1",
91
- "@tsparticles/webpack-plugin": "^3.0.3",
90
+ "@tsparticles/tsconfig": "^3.0.5",
91
+ "@tsparticles/webpack-plugin": "^3.0.5",
92
92
  "@types/webpack-env": "^1.18.8",
93
- "@typescript-eslint/eslint-plugin": "^8.41.0",
94
- "@typescript-eslint/parser": "^8.41.0",
95
93
  "babel-loader": "^10.0.0",
96
94
  "browserslist": "^4.25.4",
97
95
  "copyfiles": "^2.4.1",
@@ -101,6 +99,7 @@
101
99
  "rimraf": "^6.0.1",
102
100
  "terser-webpack-plugin": "^5.3.14",
103
101
  "typescript": "^5.9.2",
102
+ "typescript-eslint": "^8.41.0",
104
103
  "webpack": "^5.101.3",
105
104
  "webpack-bundle-analyzer": "^4.10.2",
106
105
  "webpack-cli": "^6.0.1"
@@ -1,11 +1,16 @@
1
1
  import {loadParticlesTemplate} from "@tsparticles/webpack-plugin";
2
- import {fileURLToPath} from 'url';
3
- import path from 'path';
4
- import fs from 'fs';
2
+ import {fileURLToPath} from "url";
3
+ import fs from "fs-extra";
4
+ import path from "path";
5
5
 
6
6
  const __filename = fileURLToPath(import.meta.url),
7
7
  __dirname = path.dirname(__filename),
8
- pkg = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8')),
9
- version = pkg.version;
8
+ rootPkgPath = path.join(__dirname, "package.json"),
9
+ pkg = await fs.readJson(rootPkgPath);
10
10
 
11
- export default loadParticlesTemplate({moduleName: "empty", templateName: "Empty", version, dir: __dirname});
11
+ export default loadParticlesTemplate({
12
+ moduleName: "empty",
13
+ templateName: "Empty",
14
+ version: pkg.version,
15
+ dir: __dirname
16
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/cli",
3
- "version": "3.0.4",
3
+ "version": "3.0.6",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,10 +11,10 @@
11
11
  },
12
12
  "prettier": "@tsparticles/prettier-config",
13
13
  "dependencies": {
14
- "@tsparticles/eslint-config": "^3.0.3",
14
+ "@tsparticles/eslint-config": "^3.0.5",
15
15
  "@tsparticles/prettier-config": "^3.0.1",
16
- "@tsparticles/tsconfig": "^3.0.1",
17
- "@tsparticles/webpack-plugin": "^3.0.3",
16
+ "@tsparticles/tsconfig": "^3.0.5",
17
+ "@tsparticles/webpack-plugin": "^3.0.5",
18
18
  "commander": "^14.0.0",
19
19
  "eslint": "^9.34.0",
20
20
  "eslint-config-prettier": "^10.1.8",
package/src/cli.ts CHANGED
@@ -1,12 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import { buildCommand } from "./build/build.js";
3
3
  import { createCommand } from "./create/create.js";
4
- import pkgInfo from "../package.json" assert { type: "json" };
4
+ import { fileURLToPath } from "url";
5
+ import fs from "fs-extra";
6
+ import path from "path";
5
7
  import { program } from "commander";
6
8
 
9
+ const __filename = fileURLToPath(import.meta.url),
10
+ __dirname = path.dirname(__filename),
11
+ rootPkgPath = path.join(__dirname, "package.json"),
12
+ pkg = (await fs.readJson(rootPkgPath)) as { version: string };
13
+
7
14
  program.name("tsparticles-cli");
8
15
  program.description("tsParticles CLI");
9
- program.version(pkgInfo.version, "-v, --version", "output the current version");
16
+ program.version(pkg.version, "-v, --version", "output the current version");
10
17
  program.addCommand(buildCommand);
11
18
  program.addCommand(createCommand);
12
19
  program.parse(process.argv);
package/src/tsconfig.json CHANGED
@@ -13,7 +13,19 @@
13
13
  /* Language and Environment */
14
14
  "target": "ESNext",
15
15
  /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
16
- "lib": ["ESNext", "ES2022", "ES2021", "ES2020", "ES2019", "ES2018", "ES2017", "ES2016", "ES2015"],
16
+ "lib": [
17
+ "ESNext",
18
+ "ES2024",
19
+ "ES2023",
20
+ "ES2022",
21
+ "ES2021",
22
+ "ES2020",
23
+ "ES2019",
24
+ "ES2018",
25
+ "ES2017",
26
+ "ES2016",
27
+ "ES2015"
28
+ ],
17
29
  /* Specify a set of bundled library declaration files that describe the target runtime environment. */
18
30
  // "jsx": "preserve", /* Specify what JSX code is generated. */
19
31
  // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
@@ -27,11 +39,11 @@
27
39
  // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
28
40
 
29
41
  /* Modules */
30
- "module": "ESNext",
42
+ "module": "NodeNext",
31
43
  /* Specify what module code is generated. */
32
44
  "rootDir": ".",
33
45
  /* Specify the root folder within your source files. */
34
- "moduleResolution": "node",
46
+ "moduleResolution": "NodeNext",
35
47
  /* Specify how TypeScript looks up a file from a given module specifier. */
36
48
  // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
37
49
  // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "target": "ES2021",
4
- "module": "commonjs",
5
- "lib": ["ESNext", "ES2022", "ES2021", "ES2020", "ES2019", "ES2018", "ES2017", "ES2016", "ES2015", "DOM"],
4
+ "module": "NodeNext",
5
+ "lib": ["ESNext", "ES2024", "ES2023", "ES2022", "ES2021", "ES2020", "ES2019", "ES2018", "ES2017", "ES2016", "ES2015", "DOM"],
6
6
  "types": ["jsdom", "vitest", "node"],
7
7
  "allowJs": true,
8
8
  "rootDir": ".",
@@ -14,7 +14,7 @@
14
14
  "strictNullChecks": true,
15
15
  "alwaysStrict": true,
16
16
  "noFallthroughCasesInSwitch": true,
17
- "moduleResolution": "node",
17
+ "moduleResolution": "NodeNext",
18
18
  "allowSyntheticDefaultImports": true,
19
19
  "esModuleInterop": true,
20
20
  "experimentalDecorators": true,