@abinnovision/prettier-config 1.1.0 → 2.0.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,35 +1,41 @@
1
1
  # Changelog
2
2
 
3
- ## [1.1.0](https://github.com/abinnovision/js-commons/compare/prettier-config-v1.0.2...prettier-config-v1.1.0) (2023-04-21)
3
+ ## [2.0.0](https://github.com/abinnovision/js-commons/compare/prettier-config-v1.1.0...prettier-config-v2.0.0) (2023-11-03)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
4
7
 
8
+ * will drop support for legacy eslint configs
5
9
 
6
10
  ### Features
7
11
 
8
- * add shared prettier config ([fc08209](https://github.com/abinnovision/js-commons/commit/fc082096c0d1553d0bb64cf67d4b1ef3f39e91f3))
12
+ * migrate to eslint flat config ([#93](https://github.com/abinnovision/js-commons/issues/93)) ([7568ba1](https://github.com/abinnovision/js-commons/commit/7568ba1782f912357e18619ab3e4e56a0c738a1c))
13
+
14
+ ## [1.1.0](https://github.com/abinnovision/js-commons/compare/prettier-config-v1.0.2...prettier-config-v1.1.0) (2023-04-21)
15
+
16
+ ### Features
9
17
 
18
+ - add shared prettier config ([fc08209](https://github.com/abinnovision/js-commons/commit/fc082096c0d1553d0bb64cf67d4b1ef3f39e91f3))
10
19
 
11
20
  ### Bug Fixes
12
21
 
13
- * add correct license to all packages ([af7343d](https://github.com/abinnovision/js-commons/commit/af7343dbdb93329a0321a369f81e9b37da9068fa))
14
- * emit declarations ([616f817](https://github.com/abinnovision/js-commons/commit/616f817ca7701e160325e1e81d633df345244cc3))
22
+ - add correct license to all packages ([af7343d](https://github.com/abinnovision/js-commons/commit/af7343dbdb93329a0321a369f81e9b37da9068fa))
23
+ - emit declarations ([616f817](https://github.com/abinnovision/js-commons/commit/616f817ca7701e160325e1e81d633df345244cc3))
15
24
 
16
25
  ## [1.0.2](https://github.com/abinnovision/js-commons/compare/prettier-config-v1.0.1...prettier-config-v1.0.2) (2023-04-21)
17
26
 
18
-
19
27
  ### Bug Fixes
20
28
 
21
- * emit declarations ([616f817](https://github.com/abinnovision/js-commons/commit/616f817ca7701e160325e1e81d633df345244cc3))
29
+ - emit declarations ([616f817](https://github.com/abinnovision/js-commons/commit/616f817ca7701e160325e1e81d633df345244cc3))
22
30
 
23
31
  ## [1.0.1](https://github.com/abinnovision/js-commons/compare/prettier-config-v1.0.0...prettier-config-v1.0.1) (2023-04-21)
24
32
 
25
-
26
33
  ### Bug Fixes
27
34
 
28
- * add correct license to all packages ([af7343d](https://github.com/abinnovision/js-commons/commit/af7343dbdb93329a0321a369f81e9b37da9068fa))
35
+ - add correct license to all packages ([af7343d](https://github.com/abinnovision/js-commons/commit/af7343dbdb93329a0321a369f81e9b37da9068fa))
29
36
 
30
37
  ## 1.0.0 (2023-02-24)
31
38
 
32
-
33
39
  ### Features
34
40
 
35
- * add shared prettier config ([fc08209](https://github.com/abinnovision/js-commons/commit/fc082096c0d1553d0bb64cf67d4b1ef3f39e91f3))
41
+ - add shared prettier config ([fc08209](https://github.com/abinnovision/js-commons/commit/fc082096c0d1553d0bb64cf67d4b1ef3f39e91f3))
package/README.md CHANGED
@@ -7,8 +7,7 @@ is compatible with most editors.
7
7
  ## Installation
8
8
 
9
9
  ```shell
10
- yarn add --dev \
11
- @abinnovision/prettier-config
10
+ yarn add --dev @abinnovision/prettier-config
12
11
  ```
13
12
 
14
13
  ## EditorConfig
@@ -29,9 +28,9 @@ with the one defined in this project.
29
28
  ```json5
30
29
  {
31
30
  // ...
32
- "scripts": {
31
+ scripts: {
33
32
  // ...
34
- "postinstall": "sync-editorconfig"
33
+ postinstall: "sync-editorconfig",
35
34
  },
36
35
  // ...
37
36
  }
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
+ // If the importer is in node compatibility mode or this is not an ESM
19
+ // file that has been converted to a CommonJS file using a Babel-
20
+ // compatible transform (i.e. "__esModule" has not been set), then set
21
+ // "default" to the CommonJS "module.exports" for node compatibility.
22
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
23
+ mod
24
+ ));
25
+
26
+ // src/bin/sync-editorconfig.ts
27
+ var fs = __toESM(require("fs/promises"));
28
+ var path = __toESM(require("path"));
29
+ var process = __toESM(require("process"));
30
+ var DISABLE_ENV_VAR = "DISABLE_SYNC_EDITORCONFIG";
31
+ (async function() {
32
+ if ([true, "true"].includes(process.env[DISABLE_ENV_VAR] ?? false)) {
33
+ return;
34
+ }
35
+ await fs.copyFile(
36
+ path.resolve(__dirname, "../../assets/.editorconfig"),
37
+ path.resolve(process.cwd(), ".editorconfig")
38
+ );
39
+ })();
@@ -0,0 +1,5 @@
1
+ import { Config } from 'prettier';
2
+
3
+ declare const config: Config;
4
+
5
+ export { config as default };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
- import type { Config } from "prettier";
1
+ import { Config } from 'prettier';
2
+
2
3
  declare const config: Config;
3
- export = config;
4
+
5
+ export { config as default };
package/dist/index.js CHANGED
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
+
3
+ // src/index.ts
2
4
  var config = {
3
- printWidth: 80,
4
- useTabs: true,
5
- tabWidth: 2,
6
- semi: true,
7
- trailingComma: "es5",
8
- bracketSpacing: true,
9
- arrowParens: "always",
10
- endOfLine: "lf",
5
+ printWidth: 80,
6
+ useTabs: true,
7
+ tabWidth: 2,
8
+ semi: true,
9
+ trailingComma: "es5",
10
+ bracketSpacing: true,
11
+ arrowParens: "always",
12
+ endOfLine: "lf"
11
13
  };
12
14
  module.exports = config;
package/dist/index.mjs ADDED
@@ -0,0 +1,22 @@
1
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2
+ var __commonJS = (cb, mod) => function __require() {
3
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
4
+ };
5
+
6
+ // src/index.ts
7
+ var require_src = __commonJS({
8
+ "src/index.ts"(exports, module) {
9
+ var config = {
10
+ printWidth: 80,
11
+ useTabs: true,
12
+ tabWidth: 2,
13
+ semi: true,
14
+ trailingComma: "es5",
15
+ bracketSpacing: true,
16
+ arrowParens: "always",
17
+ endOfLine: "lf"
18
+ };
19
+ module.exports = config;
20
+ }
21
+ });
22
+ export default require_src();
package/package.json CHANGED
@@ -1,31 +1,60 @@
1
1
  {
2
2
  "name": "@abinnovision/prettier-config",
3
- "packageManager": "yarn@3.4.1",
4
- "version": "1.1.0",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
3
+ "version": "2.0.0",
4
+ "repository": {
5
+ "url": "https://github.com/abinnovision/js-commons"
6
+ },
7
7
  "license": "Apache-2.0",
8
8
  "author": {
9
- "name": "AB INNOVISION UG (limited liability)",
9
+ "name": "AB INNOVISION GmbH",
10
10
  "email": "info@abinnovision.com",
11
11
  "url": "https://abinnovision.com/"
12
12
  },
13
- "repository": {
14
- "url": "https://github.com/abinnovision/js-commons"
13
+ "exports": {
14
+ ".": {
15
+ "import": "./dist/index.mjs",
16
+ "require": "./dist/index.js",
17
+ "types": "./dist/index.d.ts"
18
+ }
19
+ },
20
+ "main": "./dist/index.js",
21
+ "module": "./dist/index.mjs",
22
+ "types": "./dist/index.d.ts",
23
+ "bin": {
24
+ "sync-editorconfig": "./dist/bin/sync-editorconfig.js"
15
25
  },
16
26
  "files": [
17
27
  "dist/",
18
28
  "assets/"
19
29
  ],
20
- "bin": {
21
- "sync-editorconfig": "./dist/sync-editorconfig.js"
22
- },
23
30
  "scripts": {
24
- "build": "tsc"
31
+ "build": "tsup src/index.ts --dts --format esm,cjs --clean && tsup src/bin/* --format cjs --clean -d dist/bin",
32
+ "format:check": "prettier --check 'src/**/*.{ts,js}' '**/*.{md,json,json5,yaml,yml}'",
33
+ "format:fix": "prettier --write 'src/**/*.{ts,js}' '**/*.{md,json,json5,yaml,yml}'",
34
+ "lint:check": "eslint 'src/**/*.{ts,js}'",
35
+ "lint:fix": "eslint --fix 'src/**/*.{ts,js}'"
25
36
  },
37
+ "lint-staged": {
38
+ "src/**/*.{ts,js}": [
39
+ "prettier --write",
40
+ "eslint --fix"
41
+ ],
42
+ "{**/*,*}.{md,json,json5,yaml,yml}": [
43
+ "prettier --write"
44
+ ]
45
+ },
46
+ "prettier": "./dist/index.js",
26
47
  "devDependencies": {
27
- "@types/node": "^18.14.1",
28
- "@types/prettier": "^2.7.2",
29
- "typescript": "^4.9.5"
30
- }
48
+ "@types/node": "^20.8.10",
49
+ "@types/prettier": "^3.0.0",
50
+ "eslint": "^8.52.0",
51
+ "globals": "^13.23.0",
52
+ "prettier": "^3.0.3",
53
+ "tsup": "^7.2.0",
54
+ "typescript": "^5.2.2"
55
+ },
56
+ "peerDependencies": {
57
+ "prettier": "^2.4.0 || ^3.0.0"
58
+ },
59
+ "packageManager": "yarn@3.4.1"
31
60
  }
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
- return new (P || (P = Promise))(function (resolve, reject) {
6
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
- step((generator = generator.apply(thisArg, _arguments || [])).next());
10
- });
11
- };
12
- var __generator = (this && this.__generator) || function (thisArg, body) {
13
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
14
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
15
- function verb(n) { return function (v) { return step([n, v]); }; }
16
- function step(op) {
17
- if (f) throw new TypeError("Generator is already executing.");
18
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
19
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
20
- if (y = 0, t) op = [op[0] & 2, t.value];
21
- switch (op[0]) {
22
- case 0: case 1: t = op; break;
23
- case 4: _.label++; return { value: op[1], done: false };
24
- case 5: _.label++; y = op[1]; op = [0]; continue;
25
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
26
- default:
27
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
28
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
29
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
30
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
31
- if (t[2]) _.ops.pop();
32
- _.trys.pop(); continue;
33
- }
34
- op = body.call(thisArg, _);
35
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
36
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
37
- }
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- var fs = require("fs/promises");
41
- var path = require("path");
42
- var process = require("process");
43
- var DISABLE_ENV_VAR = "DISABLE_SYNC_EDITORCONFIG";
44
- (function () {
45
- var _a;
46
- return __awaiter(this, void 0, void 0, function () {
47
- return __generator(this, function (_b) {
48
- switch (_b.label) {
49
- case 0:
50
- if ([true, "true"].includes((_a = process.env[DISABLE_ENV_VAR]) !== null && _a !== void 0 ? _a : false)) {
51
- return [2];
52
- }
53
- return [4, fs.copyFile(path.resolve(__dirname, "../assets/.editorconfig"), path.resolve(process.cwd(), ".editorconfig"))];
54
- case 1:
55
- _b.sent();
56
- return [2];
57
- }
58
- });
59
- });
60
- })();