@tsparticles/cli 2.0.0-beta.7 → 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
|
|
85
|
+
* @param _ci -
|
|
86
86
|
* @returns true if the prettify package.dist.json process was successful
|
|
87
87
|
*/
|
|
88
|
-
async function prettifyPackageDistJson(basePath,
|
|
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
|
-
|
|
98
|
-
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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) {
|
|
@@ -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.
|
|
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
|
@@ -94,10 +94,10 @@ export async function prettifyPackageJson(basePath: string, ci: boolean): Promis
|
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* @param basePath -
|
|
97
|
-
* @param
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
120
|
+
} else {*/
|
|
121
|
+
const formatted = await prettier.format(contents, options);
|
|
120
122
|
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
+
await fs.writeFile("package.dist.json", formatted, "utf8");
|
|
124
|
+
//}
|
|
123
125
|
|
|
124
126
|
res = true;
|
|
125
127
|
} catch (e) {
|