@tsparticles/cli 2.0.0-beta.6 → 2.0.0-beta.8

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.
@@ -82,10 +82,10 @@ async function prettifyPackageJson(basePath, ci) {
82
82
  exports.prettifyPackageJson = prettifyPackageJson;
83
83
  /**
84
84
  * @param basePath -
85
- * @param ci -
85
+ * @param _ci -
86
86
  * @returns true if the prettify package.dist.json process was successful
87
87
  */
88
- async function prettifyPackageDistJson(basePath, ci) {
88
+ async function prettifyPackageDistJson(basePath, _ci) {
89
89
  console.log("Prettier - started on package.dist.json");
90
90
  let res;
91
91
  try {
@@ -94,15 +94,15 @@ async function prettifyPackageDistJson(basePath, ci) {
94
94
  options.printWidth = 120;
95
95
  options.endOfLine = "lf";
96
96
  options.parser = "json";
97
- if (ci) {
98
- if (!(await prettier_1.default.check(contents, options))) {
97
+ // TODO: disabled this check until "prettier-plugin-multiline-arrays" package is compatible with Prettier 3.0.0
98
+ /*if (ci) {
99
+ if (!(await prettier.check(contents, options))) {
99
100
  throw new Error(`package.dist.json is not formatted correctly`);
100
101
  }
101
- }
102
- else {
103
- const formatted = await prettier_1.default.format(contents, options);
104
- await fs_extra_1.default.writeFile("package.dist.json", formatted, "utf8");
105
- }
102
+ } else {*/
103
+ const formatted = await prettier_1.default.format(contents, options);
104
+ await fs_extra_1.default.writeFile("package.dist.json", formatted, "utf8");
105
+ //}
106
106
  res = true;
107
107
  }
108
108
  catch (e) {
@@ -17,7 +17,7 @@ const path_1 = __importDefault(require("path"));
17
17
  const buildCommand = new commander_1.Command("build");
18
18
  exports.buildCommand = buildCommand;
19
19
  buildCommand.description("Build the tsParticles library using TypeScript");
20
- buildCommand.option("-a, --all", "Do all build steps (default if no flags are specified) (same as -b -c -d -l -p -t)", true);
20
+ buildCommand.option("-a, --all", "Do all build steps (default if no flags are specified) (same as -b -c -d -l -p -t)", false);
21
21
  buildCommand.option("-b, --bundle", "Bundle the library using Webpack", false);
22
22
  buildCommand.option("-c, --clean", "Clean the dist folder", false);
23
23
  buildCommand.option("--ci", "Do all build steps for CI, no fixing files, only checking if they are formatted correctly", false);
@@ -27,7 +27,7 @@ buildCommand.option("-p, --prettify", "Prettify the source files", false);
27
27
  buildCommand.option("-t, --tsc", "Build the library using TypeScript", false);
28
28
  buildCommand.argument("[path]", `Path to the project root folder, default is "src"`, "src");
29
29
  buildCommand.action(async (argPath) => {
30
- const opts = buildCommand.opts(), ci = !!opts.ci, all = !!opts.all, doBundle = all || !!opts.bundle, clean = all || !!opts.clean, distfiles = all || !!opts.dist, doLint = all || !!opts.lint, prettier = all || !!opts.prettify, tsc = all || !!opts.tsc;
30
+ 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, clean = all || !!opts.clean, distfiles = all || !!opts.dist, doLint = all || !!opts.lint, prettier = all || !!opts.prettify, tsc = all || !!opts.tsc;
31
31
  const basePath = process.cwd(), oldStats = await (0, build_diststats_1.getDistStats)(basePath);
32
32
  if (clean) {
33
33
  await (0, build_clear_1.clearDist)(basePath);
@@ -83,7 +83,7 @@
83
83
  "prettier": "@tsparticles/prettier-config",
84
84
  "devDependencies": {
85
85
  "@babel/core": "^7.22.9",
86
- "@tsparticles/cli": "^2.0.0-beta.6",
86
+ "@tsparticles/cli": "^2.0.0-beta.8",
87
87
  "@tsparticles/eslint-config": "^1.19.0",
88
88
  "@tsparticles/prettier-config": "^1.12.0",
89
89
  "@tsparticles/tsconfig": "^1.14.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/cli",
3
- "version": "2.0.0-beta.6",
3
+ "version": "2.0.0-beta.8",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "tsparticles-cli": "dist/cli.js"
@@ -94,10 +94,10 @@ export async function prettifyPackageJson(basePath: string, ci: boolean): Promis
94
94
 
95
95
  /**
96
96
  * @param basePath -
97
- * @param ci -
97
+ * @param _ci -
98
98
  * @returns true if the prettify package.dist.json process was successful
99
99
  */
100
- export async function prettifyPackageDistJson(basePath: string, ci: boolean): Promise<boolean> {
100
+ export async function prettifyPackageDistJson(basePath: string, _ci: boolean): Promise<boolean> {
101
101
  console.log("Prettier - started on package.dist.json");
102
102
 
103
103
  let res: boolean;
@@ -111,15 +111,17 @@ export async function prettifyPackageDistJson(basePath: string, ci: boolean): Pr
111
111
  options.endOfLine = "lf";
112
112
  options.parser = "json";
113
113
 
114
- if (ci) {
114
+ // TODO: disabled this check until "prettier-plugin-multiline-arrays" package is compatible with Prettier 3.0.0
115
+
116
+ /*if (ci) {
115
117
  if (!(await prettier.check(contents, options))) {
116
118
  throw new Error(`package.dist.json is not formatted correctly`);
117
119
  }
118
- } else {
119
- const formatted = await prettier.format(contents, options);
120
+ } else {*/
121
+ const formatted = await prettier.format(contents, options);
120
122
 
121
- await fs.writeFile("package.dist.json", formatted, "utf8");
122
- }
123
+ await fs.writeFile("package.dist.json", formatted, "utf8");
124
+ //}
123
125
 
124
126
  res = true;
125
127
  } catch (e) {
@@ -15,7 +15,7 @@ buildCommand.description("Build the tsParticles library using TypeScript");
15
15
  buildCommand.option(
16
16
  "-a, --all",
17
17
  "Do all build steps (default if no flags are specified) (same as -b -c -d -l -p -t)",
18
- true,
18
+ false,
19
19
  );
20
20
  buildCommand.option("-b, --bundle", "Bundle the library using Webpack", false);
21
21
  buildCommand.option("-c, --clean", "Clean the dist folder", false);
@@ -33,7 +33,7 @@ buildCommand.argument("[path]", `Path to the project root folder, default is "sr
33
33
  buildCommand.action(async (argPath: string) => {
34
34
  const opts = buildCommand.opts(),
35
35
  ci = !!opts.ci,
36
- all = !!opts.all,
36
+ all = !!opts.all || (!opts.bundle && !opts.clean && !opts.dist && !opts.lint && !opts.prettify && !opts.tsc),
37
37
  doBundle = all || !!opts.bundle,
38
38
  clean = all || !!opts.clean,
39
39
  distfiles = all || !!opts.dist,