@abinnovision/prettier-config 2.1.4 → 2.2.0-beta.1

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,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.1.5](https://github.com/abinnovision/js-commons/compare/prettier-config-v2.1.4...prettier-config-v2.1.5) (2025-11-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * trigger synthetic patch release for all packages ([0a42ee3](https://github.com/abinnovision/js-commons/commit/0a42ee36601f88ff232a41a8682266543849b3c6))
9
+
3
10
  ## [2.1.4](https://github.com/abinnovision/js-commons/compare/prettier-config-v2.1.3...prettier-config-v2.1.4) (2025-11-08)
4
11
 
5
12
 
package/README.md CHANGED
@@ -1,37 +1,41 @@
1
1
  # @abinnovision/prettier-config
2
2
 
3
- Prettier config for all types of projects. The config mostly inherits the
4
- default Prettier config. This additionally comes with a `.editorconfig`, which
5
- is compatible with most editors.
3
+ Shared Prettier config with an opinionated `.editorconfig`.
6
4
 
7
5
  ## Installation
8
6
 
9
7
  ```shell
10
- yarn add --dev @abinnovision/prettier-config
8
+ yarn add --dev @abinnovision/prettier-config prettier
11
9
  ```
12
10
 
13
- ## EditorConfig
11
+ ## Usage
14
12
 
15
- The EditorConfig is a small file in the root directory of your project called
16
- `.editorconfig`. It defines various code style options for the project. This
17
- packages comes with an opinionated version of this file.
13
+ Reference the config in your `package.json`:
18
14
 
19
- To synchronize the `.editorconfig` file from this package use the following:
15
+ ```json
16
+ {
17
+ "prettier": "@abinnovision/prettier-config"
18
+ }
19
+ ```
20
+
21
+ ## EditorConfig
22
+
23
+ Sync the bundled `.editorconfig` into your project:
20
24
 
21
25
  ```shell
22
26
  yarn sync-editorconfig
23
27
  ```
24
28
 
25
- Optionally, you can put it into your `postinstall` hook to always keep in sync
26
- with the one defined in this project.
29
+ Optionally add it to your `postinstall` hook to keep it in sync automatically:
27
30
 
28
31
  ```json5
29
32
  {
30
- // ...
31
33
  scripts: {
32
- // ...
33
34
  postinstall: "sync-editorconfig",
34
35
  },
35
- // ...
36
36
  }
37
37
  ```
38
+
39
+ ## License
40
+
41
+ Apache-2.0
@@ -0,0 +1,23 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ exports.__toESM = __toESM;
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
3
+ let fs_promises = require("fs/promises");
4
+ fs_promises = require_runtime.__toESM(fs_promises);
5
+ let path = require("path");
6
+ path = require_runtime.__toESM(path);
7
+ let process = require("process");
8
+ process = require_runtime.__toESM(process);
9
+ //#region src/bin/sync-editorconfig.ts
10
+ const DISABLE_ENV_VAR = "DISABLE_SYNC_EDITORCONFIG";
11
+ (async function() {
12
+ if ([true, "true"].includes(process.env[DISABLE_ENV_VAR] ?? false)) return;
13
+ await fs_promises.copyFile(path.resolve(__dirname, "../../assets/.editorconfig"), path.resolve(process.cwd(), ".editorconfig"));
14
+ })();
15
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import * as fs from "fs/promises";
3
+ import * as path from "path";
4
+ import * as process from "process";
5
+ //#region src/bin/sync-editorconfig.ts
6
+ const DISABLE_ENV_VAR = "DISABLE_SYNC_EDITORCONFIG";
7
+ (async function() {
8
+ if ([true, "true"].includes(process.env[DISABLE_ENV_VAR] ?? false)) return;
9
+ await fs.copyFile(path.resolve(__dirname, "../../assets/.editorconfig"), path.resolve(process.cwd(), ".editorconfig"));
10
+ })();
11
+ //#endregion
12
+ export {};
package/dist/index.cjs ADDED
@@ -0,0 +1,20 @@
1
+ //#region src/index.ts
2
+ const config = {
3
+ printWidth: 80,
4
+ useTabs: true,
5
+ tabWidth: 2,
6
+ semi: true,
7
+ trailingComma: "all",
8
+ bracketSpacing: true,
9
+ arrowParens: "always",
10
+ endOfLine: "lf",
11
+ overrides: [{
12
+ files: ["pnpm-lock.yaml"],
13
+ options: { requirePragma: true }
14
+ }, {
15
+ files: ["*.md"],
16
+ options: { useTabs: false }
17
+ }]
18
+ };
19
+ //#endregion
20
+ module.exports = config;
@@ -0,0 +1,5 @@
1
+ import { Config } from "prettier";
2
+
3
+ //#region src/index.d.ts
4
+ declare const config: Config;
5
+ export = config;
@@ -0,0 +1,6 @@
1
+ import { Config } from "prettier";
2
+
3
+ //#region src/index.d.ts
4
+ declare const config: Config;
5
+ //#endregion
6
+ export { config as default };
package/dist/index.mjs ADDED
@@ -0,0 +1,20 @@
1
+ //#region src/index.ts
2
+ const config = {
3
+ printWidth: 80,
4
+ useTabs: true,
5
+ tabWidth: 2,
6
+ semi: true,
7
+ trailingComma: "all",
8
+ bracketSpacing: true,
9
+ arrowParens: "always",
10
+ endOfLine: "lf",
11
+ overrides: [{
12
+ files: ["pnpm-lock.yaml"],
13
+ options: { requirePragma: true }
14
+ }, {
15
+ files: ["*.md"],
16
+ options: { useTabs: false }
17
+ }]
18
+ };
19
+ //#endregion
20
+ export { config as default };
package/package.json CHANGED
@@ -1,12 +1,6 @@
1
1
  {
2
2
  "name": "@abinnovision/prettier-config",
3
- "version": "2.1.4",
4
- "publishConfig": {
5
- "npm": true,
6
- "ghpr": true,
7
- "npmAccess": "public"
8
- },
9
- "type": "module",
3
+ "version": "2.2.0-beta.1",
10
4
  "repository": {
11
5
  "url": "https://github.com/abinnovision/js-commons"
12
6
  },
@@ -16,8 +10,21 @@
16
10
  "email": "info@abigroup.io",
17
11
  "url": "https://abigroup.io/"
18
12
  },
19
- "main": "./dist/index.js",
20
- "types": "./dist/index.d.ts",
13
+ "type": "module",
14
+ "exports": {
15
+ ".": {
16
+ "import": {
17
+ "types": "./dist/index.d.mts",
18
+ "default": "./dist/index.mjs"
19
+ },
20
+ "require": {
21
+ "types": "./dist/index.d.cts",
22
+ "default": "./dist/index.cjs"
23
+ }
24
+ }
25
+ },
26
+ "main": "./dist/index.cjs",
27
+ "types": "./dist/index.d.cts",
21
28
  "bin": {
22
29
  "sync-editorconfig": "./dist/bin/sync-editorconfig.cjs"
23
30
  },
@@ -26,7 +33,7 @@
26
33
  "assets/"
27
34
  ],
28
35
  "scripts": {
29
- "build": "tsup src/index.ts --dts --format esm --clean && tsup src/bin/* --format cjs --clean -d dist/bin",
36
+ "build": "tsdown",
30
37
  "format:check": "prettier --check 'src/**/*.{ts,js}' '**/*.{md,json,json5,yaml,yml}'",
31
38
  "format:fix": "prettier --write 'src/**/*.{ts,js}' '**/*.{md,json,json5,yaml,yml}'",
32
39
  "lint:check": "eslint 'src/**/*.{ts,js}'",
@@ -41,16 +48,22 @@
41
48
  "prettier --write"
42
49
  ]
43
50
  },
44
- "prettier": "./dist/index.js",
51
+ "prettier": "./dist/index.mjs",
45
52
  "devDependencies": {
53
+ "@internal/tsconfig": "^1.0.0",
46
54
  "@types/node": "^22.12.0",
47
55
  "@types/prettier": "^3.0.0",
48
- "eslint": "^9.39.1",
56
+ "eslint": "^10.0.0",
49
57
  "prettier": "^3.4.2",
50
- "tsup": "^8.3.6",
58
+ "tsdown": "^0.21.3",
51
59
  "typescript": "^5.9.3"
52
60
  },
53
61
  "peerDependencies": {
54
62
  "prettier": "^2.4.0 || ^3.0.0"
63
+ },
64
+ "publishConfig": {
65
+ "ghpr": true,
66
+ "npm": true,
67
+ "npmAccess": "public"
55
68
  }
56
69
  }