@tsparticles/cli 1.10.0 → 1.12.0

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.
@@ -19,7 +19,7 @@ jobs:
19
19
  - uses: actions/setup-node@v3
20
20
  with:
21
21
  node-version: "16"
22
- - uses: pnpm/action-setup@v2.2.4
22
+ - uses: pnpm/action-setup@v2.4.0
23
23
  name: Install pnpm
24
24
  id: pnpm-install
25
25
  with:
@@ -56,7 +56,7 @@ jobs:
56
56
  - uses: actions/setup-node@v3
57
57
  with:
58
58
  node-version: "16"
59
- - uses: pnpm/action-setup@v2.2.4
59
+ - uses: pnpm/action-setup@v2.4.0
60
60
  name: Install pnpm
61
61
  id: pnpm-install
62
62
  with:
@@ -47,7 +47,7 @@ async function buildDistFiles(basePath) {
47
47
  else if (pkgInfo.peerDependencies) {
48
48
  libObj.peerDependencies = JSON.parse(JSON.stringify(pkgInfo.peerDependencies).replaceAll("workspace:", ""));
49
49
  }
50
- fs_extra_1.default.writeFileSync(libPackage, JSON.stringify(libObj, undefined, 2), "utf8");
50
+ fs_extra_1.default.writeFileSync(libPackage, `${JSON.stringify(libObj, undefined, 2)}\n`, "utf8");
51
51
  console.log(`package.dist.json updated successfully to version ${pkgInfo.version}`);
52
52
  const rootFilesToCopy = [
53
53
  "LICENSE",
@@ -26,7 +26,7 @@ async function updateIndexFile(destPath, name) {
26
26
  */
27
27
  async function updatePluginPackageFile(destPath, name, description, repoUrl) {
28
28
  const camelizedName = (0, string_utils_1.camelize)((0, string_utils_1.camelize)(name, "-"), " "), dashedName = (0, string_utils_1.dash)(camelizedName);
29
- (0, template_utils_1.updatePackageFile)(destPath, `"tsparticles-plugin-${dashedName}"`, description, `"tsparticles.plugin.${camelizedName}.min.js"`, repoUrl);
29
+ await (0, template_utils_1.updatePackageFile)(destPath, `"tsparticles-plugin-${dashedName}"`, description, `"tsparticles.plugin.${camelizedName}.min.js"`, repoUrl);
30
30
  }
31
31
  /**
32
32
  * Updates the plugin package dist file
@@ -59,7 +59,7 @@ async function updateReadmeFile(destPath, name, description, repoUrl) {
59
59
  * @param description - The description of the project
60
60
  */
61
61
  async function updatePluginWebpackFile(destPath, name, description) {
62
- await (0, template_utils_1.updateWebpackFile)(destPath, (0, string_utils_1.camelize)((0, string_utils_1.capitalize)((0, string_utils_1.capitalize)(name, "-"), " ")), `tsParticles ${description} Plugin`, "loadParticlesPlugin");
62
+ await (0, template_utils_1.updateWebpackFile)(destPath, (0, string_utils_1.camelize)((0, string_utils_1.capitalize)((0, string_utils_1.capitalize)(name, "-"), " ")), description, "loadParticlesPlugin");
63
63
  }
64
64
  /**
65
65
  * Creates the plugin project
@@ -46,7 +46,7 @@ async function updatePresetPackageFile(destPath, name, description, repoUrl) {
46
46
  */
47
47
  async function updatePresetPackageDistFile(destPath, name, description, repoUrl) {
48
48
  const camelizedName = (0, string_utils_1.camelize)((0, string_utils_1.camelize)(name, "-"), " "), dashedName = (0, string_utils_1.dash)(camelizedName);
49
- (0, template_utils_1.updatePackageDistFile)(destPath, `"tsparticles-preset-${dashedName}"`, description, `"tsparticles.preset.${camelizedName}.min.js"`, repoUrl);
49
+ await (0, template_utils_1.updatePackageDistFile)(destPath, `"tsparticles-preset-${dashedName}"`, description, `"tsparticles.preset.${camelizedName}.min.js"`, repoUrl);
50
50
  }
51
51
  /**
52
52
  * Updates the preset readme file
@@ -68,7 +68,7 @@ async function updateReadmeFile(destPath, name, description, repoUrl) {
68
68
  * @param description - The description of the project
69
69
  */
70
70
  async function updatePresetWebpackFile(destPath, name, description) {
71
- await (0, template_utils_1.updateWebpackFile)(destPath, (0, string_utils_1.camelize)((0, string_utils_1.capitalize)((0, string_utils_1.capitalize)(name, "-"), " ")), `tsParticles ${description} Preset`, "loadParticlesPreset");
71
+ await (0, template_utils_1.updateWebpackFile)(destPath, (0, string_utils_1.camelize)((0, string_utils_1.capitalize)((0, string_utils_1.capitalize)(name, "-"), " ")), description, "loadParticlesPreset");
72
72
  }
73
73
  /**
74
74
  * Creates the preset project
@@ -37,7 +37,7 @@ async function updateShapePackageFile(destPath, name, description, repoUrl) {
37
37
  */
38
38
  async function updateShapePackageDistFile(destPath, name, description, repoUrl) {
39
39
  const camelizedName = (0, string_utils_1.camelize)((0, string_utils_1.camelize)(name, "-"), " "), dashedName = (0, string_utils_1.dash)(camelizedName);
40
- (0, template_utils_1.updatePackageDistFile)(destPath, `"tsparticles-shape-${dashedName}"`, description, `"tsparticles.shape.${camelizedName}.min.js"`, repoUrl);
40
+ await (0, template_utils_1.updatePackageDistFile)(destPath, `"tsparticles-shape-${dashedName}"`, description, `"tsparticles.shape.${camelizedName}.min.js"`, repoUrl);
41
41
  }
42
42
  /**
43
43
  * Updates the shape readme file
@@ -59,7 +59,7 @@ async function updateReadmeFile(destPath, name, description, repoUrl) {
59
59
  * @param description - The description of the project
60
60
  */
61
61
  async function updateShapeWebpackFile(destPath, name, description) {
62
- await (0, template_utils_1.updateWebpackFile)(destPath, (0, string_utils_1.camelize)((0, string_utils_1.capitalize)((0, string_utils_1.capitalize)(name, "-"), " ")), `tsParticles ${description} Shape`, "loadParticlesShape");
62
+ await (0, template_utils_1.updateWebpackFile)(destPath, (0, string_utils_1.camelize)((0, string_utils_1.capitalize)((0, string_utils_1.capitalize)(name, "-"), " ")), description, "loadParticlesShape");
63
63
  }
64
64
  /**
65
65
  * Creates the shape project
@@ -41,7 +41,7 @@ exports.updatePackageDistFile = updatePackageDistFile;
41
41
  * @param fnName - The name of the function to load the template
42
42
  */
43
43
  async function updateWebpackFile(destPath, name, description, fnName) {
44
- const webpackPath = path_1.default.resolve(destPath, "webpack.config.js"), webpack = await fs_extra_1.default.readFile(webpackPath, "utf-8"), webpackDescriptionRegex = /tsParticles Empty Template/g, replacedDescriptionText = webpack.replace(webpackDescriptionRegex, description), webpackEntryRegex = /"template(\.bundle)?"/g, replacedNameText = replacedDescriptionText.replace(webpackEntryRegex, `"${name}$1"`), webpackFunctionNameRegex = /loadParticlesTemplate/g, replacedFunctionNameText = replacedNameText.replace(webpackFunctionNameRegex, fnName);
44
+ const webpackPath = path_1.default.resolve(destPath, "webpack.config.js"), webpack = await fs_extra_1.default.readFile(webpackPath, "utf-8"), webpackDescriptionRegex = /"Empty"/g, replacedDescriptionText = webpack.replace(webpackDescriptionRegex, `"${description}"`), webpackEntryRegex = /"empty"/g, replacedNameText = replacedDescriptionText.replace(webpackEntryRegex, `"${name}"`), webpackFunctionNameRegex = /loadParticlesTemplate/g, replacedFunctionNameText = replacedNameText.replace(webpackFunctionNameRegex, fnName);
45
45
  await fs_extra_1.default.writeFile(webpackPath, replacedFunctionNameText);
46
46
  }
47
47
  exports.updateWebpackFile = updateWebpackFile;
@@ -21,8 +21,8 @@ Once installed you need one more script to be included in your page (or you can
21
21
  from [jsDelivr](https://www.jsdelivr.com/package/npm/tsparticles-preset-template):
22
22
 
23
23
  ```html
24
- <script src="https://cdn.jsdelivr.net/npm/tsparticles@1/tsparticles.min.js"></script>
25
- <script src="https://cdn.jsdelivr.net/npm/tsparticles-preset-template@1/tsparticles.preset.template.min.js"></script>
24
+ <script src="https://cdn.jsdelivr.net/npm/tsparticles-engine@2/tsparticles.engine.min.js"></script>
25
+ <script src="https://cdn.jsdelivr.net/npm/tsparticles-preset-template/tsparticles.preset.template.min.js"></script>
26
26
  ```
27
27
 
28
28
  This script **MUST** be placed after the `tsParticles` one.
@@ -32,7 +32,7 @@ This script **MUST** be placed after the `tsParticles` one.
32
32
  A bundled script can also be used, this will include every needed plugin needed by the preset.
33
33
 
34
34
  ```html
35
- <script src="https://cdn.jsdelivr.net/npm/tsparticles-preset-template@1/tsparticles.preset.template.bundle.min.js"></script>
35
+ <script src="https://cdn.jsdelivr.net/npm/tsparticles-preset-template/tsparticles.preset.template.bundle.min.js"></script>
36
36
  ```
37
37
 
38
38
  ### Usage
@@ -72,6 +72,6 @@
72
72
  "module": "index.js",
73
73
  "types": "index.d.ts",
74
74
  "dependencies": {
75
- "tsparticles-engine": "^2.10.0"
75
+ "tsparticles-engine": "^2.12.0"
76
76
  }
77
77
  }
@@ -83,20 +83,20 @@
83
83
  "prettier": "@tsparticles/prettier-config",
84
84
  "devDependencies": {
85
85
  "@babel/core": "^7.22.9",
86
- "@tsparticles/cli": "1.10.0",
87
- "@tsparticles/eslint-config": "^1.18.0",
88
- "@tsparticles/prettier-config": "^1.11.0",
86
+ "@tsparticles/cli": "^1.12.0",
87
+ "@tsparticles/eslint-config": "^1.19.0",
88
+ "@tsparticles/prettier-config": "^1.12.0",
89
89
  "@tsparticles/tsconfig": "^1.14.0",
90
- "@tsparticles/webpack-plugin": "^1.22.0",
90
+ "@tsparticles/webpack-plugin": "^1.23.0",
91
91
  "@types/webpack-env": "^1.18.1",
92
- "@typescript-eslint/eslint-plugin": "^6.1.0",
93
- "@typescript-eslint/parser": "^6.1.0",
92
+ "@typescript-eslint/eslint-plugin": "^6.2.1",
93
+ "@typescript-eslint/parser": "^6.2.1",
94
94
  "babel-loader": "^9.1.3",
95
- "browserslist": "^4.21.9",
95
+ "browserslist": "^4.21.10",
96
96
  "copyfiles": "^2.4.1",
97
- "eslint": "^8.45.0",
98
- "eslint-config-prettier": "^8.8.0",
99
- "prettier": "^3.0.0",
97
+ "eslint": "^8.46.0",
98
+ "eslint-config-prettier": "^8.10.0",
99
+ "prettier": "^3.0.1",
100
100
  "rimraf": "^5.0.1",
101
101
  "terser-webpack-plugin": "^5.3.9",
102
102
  "typescript": "^5.1.6",
@@ -105,6 +105,6 @@
105
105
  "webpack-cli": "^5.1.4"
106
106
  },
107
107
  "dependencies": {
108
- "tsparticles-engine": "^2.11.0"
108
+ "tsparticles-engine": "^2.12.0"
109
109
  }
110
110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/cli",
3
- "version": "1.10.0",
3
+ "version": "1.12.0",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "tsparticles-cli": "dist/cli.js"
@@ -10,10 +10,10 @@
10
10
  },
11
11
  "prettier": "@tsparticles/prettier-config",
12
12
  "dependencies": {
13
- "@tsparticles/eslint-config": "^1.18.0",
14
- "@tsparticles/prettier-config": "^1.11.0",
13
+ "@tsparticles/eslint-config": "^1.19.0",
14
+ "@tsparticles/prettier-config": "^1.12.0",
15
15
  "@tsparticles/tsconfig": "^1.14.0",
16
- "@tsparticles/webpack-plugin": "^1.22.0",
16
+ "@tsparticles/webpack-plugin": "^1.23.0",
17
17
  "@typescript-eslint/eslint-plugin": "^6.1.0",
18
18
  "@typescript-eslint/parser": "^6.1.0",
19
19
  "commander": "^11.0.0",
@@ -14,7 +14,7 @@ const emptyProjectPkgPath = path.join(__dirname, "..", "files", "empty-project",
14
14
 
15
15
  const obj = JSON.parse(data);
16
16
 
17
- obj["devDependencies"]["@tsparticles/cli"] = pkg.version;
17
+ obj["devDependencies"]["@tsparticles/cli"] = `^${pkg.version}`;
18
18
 
19
19
  const result = JSON.stringify(obj, undefined, 2);
20
20
 
@@ -28,7 +28,7 @@ export async function buildDistFiles(basePath: string): Promise<boolean> {
28
28
  libObj.peerDependencies = JSON.parse(JSON.stringify(pkgInfo.peerDependencies).replaceAll("workspace:", ""));
29
29
  }
30
30
 
31
- fs.writeFileSync(libPackage, JSON.stringify(libObj, undefined, 2), "utf8");
31
+ fs.writeFileSync(libPackage, `${JSON.stringify(libObj, undefined, 2)}\n`, "utf8");
32
32
 
33
33
  console.log(`package.dist.json updated successfully to version ${pkgInfo.version}`);
34
34
 
@@ -45,7 +45,7 @@ async function updatePluginPackageFile(
45
45
  const camelizedName = camelize(camelize(name, "-"), " "),
46
46
  dashedName = dash(camelizedName);
47
47
 
48
- updatePackageFile(
48
+ await updatePackageFile(
49
49
  destPath,
50
50
  `"tsparticles-plugin-${dashedName}"`,
51
51
  description,
@@ -140,7 +140,7 @@ async function updatePluginWebpackFile(destPath: string, name: string, descripti
140
140
  await updateWebpackFile(
141
141
  destPath,
142
142
  camelize(capitalize(capitalize(name, "-"), " ")),
143
- `tsParticles ${description} Plugin`,
143
+ description,
144
144
  "loadParticlesPlugin",
145
145
  );
146
146
  }
@@ -85,7 +85,7 @@ async function updatePresetPackageDistFile(
85
85
  const camelizedName = camelize(camelize(name, "-"), " "),
86
86
  dashedName = dash(camelizedName);
87
87
 
88
- updatePackageDistFile(
88
+ await updatePackageDistFile(
89
89
  destPath,
90
90
  `"tsparticles-preset-${dashedName}"`,
91
91
  description,
@@ -155,7 +155,7 @@ async function updatePresetWebpackFile(destPath: string, name: string, descripti
155
155
  await updateWebpackFile(
156
156
  destPath,
157
157
  camelize(capitalize(capitalize(name, "-"), " ")),
158
- `tsParticles ${description} Preset`,
158
+ description,
159
159
  "loadParticlesPreset",
160
160
  );
161
161
  }
@@ -70,7 +70,7 @@ async function updateShapePackageDistFile(
70
70
  const camelizedName = camelize(camelize(name, "-"), " "),
71
71
  dashedName = dash(camelizedName);
72
72
 
73
- updatePackageDistFile(
73
+ await updatePackageDistFile(
74
74
  destPath,
75
75
  `"tsparticles-shape-${dashedName}"`,
76
76
  description,
@@ -137,7 +137,7 @@ async function updateShapeWebpackFile(destPath: string, name: string, descriptio
137
137
  await updateWebpackFile(
138
138
  destPath,
139
139
  camelize(capitalize(capitalize(name, "-"), " ")),
140
- `tsParticles ${description} Shape`,
140
+ description,
141
141
  "loadParticlesShape",
142
142
  );
143
143
  }
@@ -83,10 +83,10 @@ export async function updateWebpackFile(
83
83
  ): Promise<void> {
84
84
  const webpackPath = path.resolve(destPath, "webpack.config.js"),
85
85
  webpack = await fs.readFile(webpackPath, "utf-8"),
86
- webpackDescriptionRegex = /tsParticles Empty Template/g,
87
- replacedDescriptionText = webpack.replace(webpackDescriptionRegex, description),
88
- webpackEntryRegex = /"template(\.bundle)?"/g,
89
- replacedNameText = replacedDescriptionText.replace(webpackEntryRegex, `"${name}$1"`),
86
+ webpackDescriptionRegex = /"Empty"/g,
87
+ replacedDescriptionText = webpack.replace(webpackDescriptionRegex, `"${description}"`),
88
+ webpackEntryRegex = /"empty"/g,
89
+ replacedNameText = replacedDescriptionText.replace(webpackEntryRegex, `"${name}"`),
90
90
  webpackFunctionNameRegex = /loadParticlesTemplate/g,
91
91
  replacedFunctionNameText = replacedNameText.replace(webpackFunctionNameRegex, fnName);
92
92