@tsparticles/cli 3.0.11 → 3.0.13

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.
@@ -18,7 +18,7 @@ jobs:
18
18
  fetch-depth: 0
19
19
  - uses: actions/setup-node@v4
20
20
  with:
21
- node-version: "22"
21
+ node-version: "24"
22
22
  - uses: pnpm/action-setup@v4
23
23
  name: Install pnpm
24
24
  id: pnpm-install
@@ -56,7 +56,7 @@ jobs:
56
56
  fetch-depth: 0
57
57
  - uses: actions/setup-node@v4
58
58
  with:
59
- node-version: "22"
59
+ node-version: "24"
60
60
  - uses: pnpm/action-setup@v3
61
61
  name: Install pnpm
62
62
  id: pnpm-install
@@ -11,12 +11,12 @@ export async function buildDistFiles(basePath) {
11
11
  try {
12
12
  const pkgInfo = JSON.parse((await fs.readFile(path.join(basePath, "package.json"))).toString()), libPackage = path.join(basePath, "package.dist.json"), distPath = path.join(basePath, pkgInfo.publishConfig?.directory ?? "dist");
13
13
  const data = await fs.readFile(libPackage), text = data.toString(), libObj = JSON.parse(text);
14
- libObj.version = pkgInfo.version;
14
+ libObj["version"] = pkgInfo.version;
15
15
  if (pkgInfo.dependencies) {
16
- libObj.dependencies = JSON.parse(JSON.stringify(pkgInfo.dependencies).replaceAll("workspace:", ""));
16
+ libObj["dependencies"] = JSON.parse(JSON.stringify(pkgInfo.dependencies).replaceAll("workspace:", ""));
17
17
  }
18
18
  else if (pkgInfo.peerDependencies) {
19
- libObj.peerDependencies = JSON.parse(JSON.stringify(pkgInfo.peerDependencies).replaceAll("workspace:", ""));
19
+ libObj["peerDependencies"] = JSON.parse(JSON.stringify(pkgInfo.peerDependencies).replaceAll("workspace:", ""));
20
20
  }
21
21
  const jsonIndent = 2;
22
22
  await fs.writeFile(libPackage, `${JSON.stringify(libObj, undefined, jsonIndent)}\n`, "utf8");
@@ -19,6 +19,7 @@ async function readConfig(basePath, file) {
19
19
  const data = await fs.readFile(path.join(basePath, file));
20
20
  return data.toString();
21
21
  }
22
+ return undefined;
22
23
  }
23
24
  /**
24
25
  * @param basePath -
@@ -12,7 +12,8 @@ buildCommand.option("-p, --prettify", "Prettify the source files", false);
12
12
  buildCommand.option("-t, --tsc", "Build the library using TypeScript", false);
13
13
  buildCommand.argument("[path]", `Path to the project root folder, default is "src"`, "src");
14
14
  buildCommand.action(async (argPath) => {
15
- const opts = buildCommand.opts(), ci = !!opts.ci, all = !!opts.all || (!opts.bundle && !opts.clean && !opts.dist && !opts.lint && !opts.prettify && !opts.tsc), doBundle = all || !!opts.bundle, circularDeps = all || !!opts.circularDeps, clean = all || !!opts.clean, distfiles = all || !!opts.dist, doLint = all || !!opts.lint, prettier = all || !!opts.prettify, tsc = all || !!opts.tsc;
15
+ const opts = buildCommand.opts(), ci = !!opts["ci"], all = !!opts["all"] ||
16
+ (!opts["bundle"] && !opts["clean"] && !opts["dist"] && !opts["lint"] && !opts["prettify"] && !opts["tsc"]), doBundle = all || !!opts["bundle"], circularDeps = all || !!opts["circularDeps"], clean = all || !!opts["clean"], distfiles = all || !!opts["dist"], doLint = all || !!opts["lint"], prettier = all || !!opts["prettify"], tsc = all || !!opts["tsc"];
16
17
  const basePath = process.cwd(), { getDistStats } = await import("./build-diststats.js"), oldStats = await getDistStats(basePath);
17
18
  if (clean) {
18
19
  const { clearDist } = await import("./build-clear.js");
@@ -29,6 +29,6 @@ export function camelize(str, ...splits) {
29
29
  * @returns the dashed string
30
30
  */
31
31
  export function dash(str) {
32
- const index = 0, dashed = str.replace(/([A-Z])/g, g => `-${g[index].toLowerCase()}`), startPos = 1;
32
+ const index = 0, dashed = str.replace(/([A-Z])/g, g => `-${g[index]?.toLowerCase() ?? ""}`), startPos = 1;
33
33
  return dashed.startsWith("-") ? dashed.substring(startPos) : dashed;
34
34
  }
@@ -1,5 +1,5 @@
1
- import tsParticlesESLintConfig from "@tsparticles/eslint-config";
2
1
  import { defineConfig } from "eslint/config";
2
+ import tsParticlesESLintConfig from "@tsparticles/eslint-config";
3
3
 
4
4
  export default defineConfig([
5
5
  tsParticlesESLintConfig,
@@ -83,25 +83,25 @@
83
83
  "types": "dist/types/index.d.ts",
84
84
  "prettier": "@tsparticles/prettier-config",
85
85
  "devDependencies": {
86
- "@babel/core": "^7.28.3",
87
- "@tsparticles/cli": "^3.0.11",
88
- "@tsparticles/eslint-config": "^3.0.5",
89
- "@tsparticles/prettier-config": "^3.0.1",
90
- "@tsparticles/tsconfig": "^3.0.5",
91
- "@tsparticles/webpack-plugin": "^3.0.5",
86
+ "@babel/core": "^7.28.5",
87
+ "@tsparticles/cli": "^3.0.13",
88
+ "@tsparticles/eslint-config": "^3.0.6",
89
+ "@tsparticles/prettier-config": "^3.0.6",
90
+ "@tsparticles/tsconfig": "^3.0.6",
91
+ "@tsparticles/webpack-plugin": "^3.0.6",
92
92
  "@types/webpack-env": "^1.18.8",
93
93
  "babel-loader": "^10.0.0",
94
- "browserslist": "^4.25.4",
94
+ "browserslist": "^4.28.1",
95
95
  "copyfiles": "^2.4.1",
96
- "eslint": "^9.34.0",
96
+ "eslint": "^9.39.2",
97
97
  "eslint-config-prettier": "^10.1.8",
98
- "prettier": "^3.6.2",
99
- "rimraf": "^6.0.1",
100
- "terser-webpack-plugin": "^5.3.14",
101
- "typescript": "^5.9.2",
102
- "typescript-eslint": "^8.41.0",
103
- "webpack": "^5.101.3",
104
- "webpack-bundle-analyzer": "^4.10.2",
98
+ "prettier": "^3.7.4",
99
+ "rimraf": "^6.1.2",
100
+ "terser-webpack-plugin": "^5.3.16",
101
+ "typescript": "^5.9.3",
102
+ "typescript-eslint": "^8.50.0",
103
+ "webpack": "^5.104.1",
104
+ "webpack-bundle-analyzer": "^5.1.0",
105
105
  "webpack-cli": "^6.0.1"
106
106
  },
107
107
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/cli",
3
- "version": "3.0.11",
3
+ "version": "3.0.13",
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.6",
15
- "@tsparticles/prettier-config": "^3.0.6",
16
- "@tsparticles/tsconfig": "^3.0.6",
17
- "@tsparticles/webpack-plugin": "^3.0.6",
14
+ "@tsparticles/eslint-config": "^3.0.7",
15
+ "@tsparticles/prettier-config": "^3.0.7",
16
+ "@tsparticles/tsconfig": "^3.0.8",
17
+ "@tsparticles/webpack-plugin": "^3.0.7",
18
18
  "commander": "^14.0.2",
19
19
  "eslint": "^9.39.2",
20
20
  "eslint-config-prettier": "^10.1.8",
@@ -27,16 +27,16 @@
27
27
  "madge": "^8.0.0",
28
28
  "path-scurry": "^2.0.1",
29
29
  "prettier": "^3.7.4",
30
- "prettier-plugin-multiline-arrays": "4.1.1",
30
+ "prettier-plugin-multiline-arrays": "^4.1.3",
31
31
  "prompts": "^2.4.2",
32
32
  "rimraf": "^6.1.2",
33
33
  "typescript": "^5.9.3",
34
- "typescript-eslint": "^8.50.0",
34
+ "typescript-eslint": "^8.51.0",
35
35
  "webpack": "^5.104.1"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@babel/core": "^7.28.5",
39
- "@tsparticles/cli": "^3.0.10",
39
+ "@tsparticles/cli": "^3.0.13",
40
40
  "@tsparticles/engine": "^3.9.1",
41
41
  "@types/eslint": "^9.6.1",
42
42
  "@types/estree": "^1.0.8",
@@ -25,12 +25,14 @@ export async function buildDistFiles(basePath: string): Promise<boolean> {
25
25
  text = data.toString(),
26
26
  libObj = JSON.parse(text) as Record<string, unknown>;
27
27
 
28
- libObj.version = pkgInfo.version;
28
+ libObj["version"] = pkgInfo.version;
29
29
 
30
30
  if (pkgInfo.dependencies) {
31
- libObj.dependencies = JSON.parse(JSON.stringify(pkgInfo.dependencies).replaceAll("workspace:", ""));
31
+ libObj["dependencies"] = JSON.parse(JSON.stringify(pkgInfo.dependencies).replaceAll("workspace:", ""));
32
32
  } else if (pkgInfo.peerDependencies) {
33
- libObj.peerDependencies = JSON.parse(JSON.stringify(pkgInfo.peerDependencies).replaceAll("workspace:", ""));
33
+ libObj["peerDependencies"] = JSON.parse(
34
+ JSON.stringify(pkgInfo.peerDependencies).replaceAll("workspace:", ""),
35
+ );
34
36
  }
35
37
 
36
38
  const jsonIndent = 2;
@@ -27,7 +27,8 @@ export async function lint(ci: boolean): Promise<boolean> {
27
27
  const messages = errors.map(t =>
28
28
  t.messages
29
29
  .map(m => `${t.filePath} (${m.line.toString()},${m.column.toString()}): ${m.message}`)
30
- .join("\n"));
30
+ .join("\n"),
31
+ );
31
32
 
32
33
  throw new Error(messages.join("\n"));
33
34
  }
@@ -22,6 +22,8 @@ async function readConfig(basePath: string, file: string): Promise<string | unde
22
22
 
23
23
  return data.toString();
24
24
  }
25
+
26
+ return undefined;
25
27
  }
26
28
 
27
29
  /**
@@ -24,15 +24,17 @@ buildCommand.option("-t, --tsc", "Build the library using TypeScript", false);
24
24
  buildCommand.argument("[path]", `Path to the project root folder, default is "src"`, "src");
25
25
  buildCommand.action(async (argPath: string) => {
26
26
  const opts = buildCommand.opts(),
27
- ci = !!opts.ci,
28
- all = !!opts.all || (!opts.bundle && !opts.clean && !opts.dist && !opts.lint && !opts.prettify && !opts.tsc),
29
- doBundle = all || !!opts.bundle,
30
- circularDeps = all || !!opts.circularDeps,
31
- clean = all || !!opts.clean,
32
- distfiles = all || !!opts.dist,
33
- doLint = all || !!opts.lint,
34
- prettier = all || !!opts.prettify,
35
- tsc = all || !!opts.tsc;
27
+ ci = !!opts["ci"],
28
+ all =
29
+ !!opts["all"] ||
30
+ (!opts["bundle"] && !opts["clean"] && !opts["dist"] && !opts["lint"] && !opts["prettify"] && !opts["tsc"]),
31
+ doBundle = all || !!opts["bundle"],
32
+ circularDeps = all || !!opts["circularDeps"],
33
+ clean = all || !!opts["clean"],
34
+ distfiles = all || !!opts["dist"],
35
+ doLint = all || !!opts["lint"],
36
+ prettier = all || !!opts["prettify"],
37
+ tsc = all || !!opts["tsc"];
36
38
 
37
39
  const basePath = process.cwd(),
38
40
  { getDistStats } = await import("./build-diststats.js"),
package/src/tsconfig.json CHANGED
@@ -97,24 +97,24 @@
97
97
  /* Ensure that casing is correct in imports. */
98
98
 
99
99
  /* Type Checking */
100
- "strict": true
100
+ "strict": true,
101
101
  /* Enable all strict type-checking options. */
102
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
103
- // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
104
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
105
- // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
106
- // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
107
- // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
108
- // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
109
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
110
- // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
111
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
112
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
113
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
114
- // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
115
- // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
116
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
117
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
102
+ "noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
103
+ "strictNullChecks": true /* When type checking, take into account 'null' and 'undefined'. */,
104
+ "strictFunctionTypes": true /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */,
105
+ "strictBindCallApply": true /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */,
106
+ "strictPropertyInitialization": true /* Check for class properties that are declared but not set in the constructor. */,
107
+ "noImplicitThis": true /* Enable error reporting when 'this' is given the type 'any'. */,
108
+ "useUnknownInCatchVariables": true /* Default catch clause variables as 'unknown' instead of 'any'. */,
109
+ "alwaysStrict": true /* Ensure 'use strict' is always emitted. */,
110
+ "noUnusedLocals": true /* Enable error reporting when local variables aren't read. */,
111
+ "noUnusedParameters": true /* Raise an error when a function parameter isn't read. */,
112
+ "exactOptionalPropertyTypes": true /* Interpret optional property types as written, rather than adding 'undefined'. */,
113
+ "noImplicitReturns": true /* Enable error reporting for codepaths that do not explicitly return in a function. */,
114
+ "noFallthroughCasesInSwitch": true /* Enable error reporting for fallthrough cases in switch statements. */,
115
+ "noUncheckedIndexedAccess": true /* Add 'undefined' to a type when accessed using an index. */,
116
+ "noImplicitOverride": true /* Ensure overriding members in derived classes are marked with an override modifier. */,
117
+ "noPropertyAccessFromIndexSignature": true /* Enforces using indexed accessors for keys declared using an indexed type. */
118
118
  // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
119
119
  // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
120
120
 
@@ -34,7 +34,7 @@ export function camelize(str: string, ...splits: string[]): string {
34
34
  */
35
35
  export function dash(str: string): string {
36
36
  const index = 0,
37
- dashed = str.replace(/([A-Z])/g, g => `-${g[index].toLowerCase()}`),
37
+ dashed = str.replace(/([A-Z])/g, g => `-${g[index]?.toLowerCase() ?? ""}`),
38
38
  startPos = 1;
39
39
 
40
40
  return dashed.startsWith("-") ? dashed.substring(startPos) : dashed;
package/vitest.config.ts CHANGED
@@ -5,7 +5,7 @@ export default defineConfig({
5
5
  globals: true,
6
6
  environment: "node",
7
7
  include: ["tests/**/*.test.ts"],
8
- testTimeout: 60000
8
+ testTimeout: 5 * 60 * 1000
9
9
  }
10
10
  });
11
11