fenge 0.2.0 → 0.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # fenge
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a3b985c: refactor: rename `Builder` methods to be camel case
8
+ - 8b468ec: refactor: remove `append` property for Builder. user can use append method
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies [d832aad]
13
+ - Updated dependencies [6c64129]
14
+ - Updated dependencies [692d3e8]
15
+ - Updated dependencies [561ecc5]
16
+ - Updated dependencies [9cde584]
17
+ - Updated dependencies [a3b985c]
18
+ - Updated dependencies [b26463e]
19
+ - Updated dependencies [16bf9a1]
20
+ - Updated dependencies [8b468ec]
21
+ - Updated dependencies [778a198]
22
+ - Updated dependencies [9b1f20a]
23
+ - Updated dependencies [4056ab2]
24
+ - Updated dependencies [e36c13c]
25
+ - @fenge/eslint-config@0.5.0
26
+ - prettier-ignore@0.2.0
27
+ - @fenge/tsconfig@0.2.0
28
+
29
+ ## 0.2.1
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [1957781]
34
+ - @fenge/eslint-config@0.4.1
35
+
3
36
  ## 0.2.0
4
37
 
5
38
  ### Minor Changes
package/README.md CHANGED
@@ -233,26 +233,31 @@ export default {
233
233
  },
234
234
  lint: async () => {
235
235
  // See https://www.npmjs.com/package/@fenge/eslint-config for eslint-config detail usage
236
- const Builder = (await import("fenge/eslint-config")).Builder;
237
- return new Builder()
238
- .enablePackagejson({
239
- pick: ["packagejson/top-types"], // only these rules will work for package.json files
240
- })
241
- .enableJavascript({
242
- omit: ["no-var"], // these rules will not work for js files
243
- })
244
- .enableTypescript({
236
+ const { Builder } = await import("fenge/eslint-config");
237
+ return (
238
+ new Builder()
239
+ .enablePackageJson({
240
+ pick: ["packagejson/top-types"], // only these rules will work for package.json files
241
+ })
242
+ .enableJavaScript({
243
+ omit: ["no-var"], // these rules will not work for js files
244
+ })
245
+ .enableTypeScript()
245
246
  // apply additional rules or override the built-in rules for ts files
246
- append: {
247
- "@typescript-eslint/no-explicit-any": "error",
248
- "@typescript-eslint/consistent-type-assertions": [
249
- "error",
250
- { assertionStyle: "never" },
251
- ],
252
- "@typescript-eslint/no-non-null-assertion": "error",
253
- },
254
- })
255
- .toConfig();
247
+ .append({
248
+ name: "strictest",
249
+ files: ["**/*.{ts,cts,mts,tsx}"],
250
+ rules: {
251
+ "@typescript-eslint/no-explicit-any": "error",
252
+ "@typescript-eslint/consistent-type-assertions": [
253
+ "error",
254
+ { assertionStyle: "never" },
255
+ ],
256
+ "@typescript-eslint/no-non-null-assertion": "error",
257
+ },
258
+ })
259
+ .toConfig()
260
+ );
256
261
  },
257
262
  };
258
263
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fenge",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "A CLI tool for code quality",
5
5
  "keywords": [
6
6
  "cli",
@@ -44,18 +44,18 @@
44
44
  },
45
45
  "bin": "./src/bin/fenge.cli.js",
46
46
  "dependencies": {
47
- "chalk": "5.3.0",
48
47
  "commander": "12.1.0",
49
48
  "eslint": "8.57.1",
50
49
  "lilconfig": "3.1.3",
51
50
  "lint-staged": "15.2.11",
52
51
  "ora": "8.1.1",
53
52
  "prettier": "3.4.2",
54
- "@fenge/eslint-config": "0.4.0",
53
+ "yoctocolors": "2.1.1",
54
+ "@fenge/eslint-config": "0.5.0",
55
55
  "@fenge/prettier-config": "0.1.3",
56
- "@fenge/tsconfig": "0.1.1",
56
+ "@fenge/tsconfig": "0.2.0",
57
57
  "@fenge/types": "0.2.0",
58
- "prettier-ignore": "0.1.4"
58
+ "prettier-ignore": "0.2.0"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/node": "22.9.1"
package/src/utils.js CHANGED
@@ -6,9 +6,9 @@ import { createRequire } from "node:module";
6
6
  import path from "node:path";
7
7
  import process from "node:process";
8
8
  import { fileURLToPath } from "node:url";
9
- import chalk from "chalk";
10
9
  import { lilconfig } from "lilconfig";
11
10
  import ora from "ora";
11
+ import colors from "yoctocolors";
12
12
 
13
13
  /**
14
14
  * @param {string} filepath
@@ -81,7 +81,7 @@ export function execAsync(command, { topic, dryRun, env }) {
81
81
  return reject(new Error("cmd not found"));
82
82
  }
83
83
  if (dryRun) {
84
- process.stdout.write(`${chalk.green(cmd)} ${args.join(" ")};\n\n`);
84
+ process.stdout.write(`${colors.green(cmd)} ${args.join(" ")};\n\n`);
85
85
  return resolve(0);
86
86
  }
87
87
 
@@ -104,7 +104,7 @@ export function execAsync(command, { topic, dryRun, env }) {
104
104
  });
105
105
  cp.on("error", (err) => {
106
106
  spinner.fail(
107
- `${topic} got error in ${chalk.yellow(getSpentTime(startTime))}`,
107
+ `${topic} got error in ${colors.yellow(getSpentTime(startTime))}`,
108
108
  );
109
109
  resolve(getExitCode(err));
110
110
  });
@@ -113,11 +113,11 @@ export function execAsync(command, { topic, dryRun, env }) {
113
113
  const exitCode = getExitCode({ code, signal });
114
114
  if (exitCode === 0) {
115
115
  spinner.succeed(
116
- `${topic} succeeded in ${chalk.yellow(getSpentTime(startTime))}`,
116
+ `${topic} succeeded in ${colors.yellow(getSpentTime(startTime))}`,
117
117
  );
118
118
  } else {
119
119
  spinner.fail(
120
- `${topic} failed in ${chalk.yellow(getSpentTime(startTime))}`,
120
+ `${topic} failed in ${colors.yellow(getSpentTime(startTime))}`,
121
121
  );
122
122
  }
123
123
  resolve(exitCode);