From 1e0bb9794d87aa0f9fa4f702cae8a280b41a717c Mon Sep 17 00:00:00 2001 From: Armano Date: Thu, 6 Feb 2020 03:20:42 +0100 Subject: [PATCH 1/2] refactor(core): port core to typescript --- @commitlint/core/index.js | 4 ---- @commitlint/core/package.json | 4 +++- @commitlint/core/src/index.ts | 11 +++++++++++ @commitlint/core/tsconfig.json | 10 ++++++++++ tsconfig.json | 1 + 5 files changed, 25 insertions(+), 5 deletions(-) delete mode 100644 @commitlint/core/index.js create mode 100644 @commitlint/core/src/index.ts create mode 100644 @commitlint/core/tsconfig.json diff --git a/@commitlint/core/index.js b/@commitlint/core/index.js deleted file mode 100644 index c845835ba9..0000000000 --- a/@commitlint/core/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports.format = require('@commitlint/format'); -module.exports.load = require('@commitlint/load'); -module.exports.lint = require('@commitlint/lint'); -module.exports.read = require('@commitlint/read'); diff --git a/@commitlint/core/package.json b/@commitlint/core/package.json index bb45ed41a3..2757e0e7f8 100644 --- a/@commitlint/core/package.json +++ b/@commitlint/core/package.json @@ -2,8 +2,10 @@ "name": "@commitlint/core", "version": "8.3.5", "description": "Lint your commit messages", + "main": "lib/index.js", + "types": "lib/index.d.ts", "files": [ - "index.js" + "lib/" ], "scripts": { "deps": "dep-check", diff --git a/@commitlint/core/src/index.ts b/@commitlint/core/src/index.ts new file mode 100644 index 0000000000..2ca69e66be --- /dev/null +++ b/@commitlint/core/src/index.ts @@ -0,0 +1,11 @@ +import format from '@commitlint/format'; +import load from '@commitlint/load'; +import lint from '@commitlint/lint'; +import read from '@commitlint/read'; + +export = { + format, + load, + lint, + read +}; diff --git a/@commitlint/core/tsconfig.json b/@commitlint/core/tsconfig.json new file mode 100644 index 0000000000..9a17b91978 --- /dev/null +++ b/@commitlint/core/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "composite": true, + "rootDir": "./src", + "outDir": "./lib" + }, + "include": ["./src/**/*.ts"], + "exclude": ["./src/**/*.test.ts", "./lib/**/*"] +} diff --git a/tsconfig.json b/tsconfig.json index 314a1e218e..729adf3dbd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,5 +17,6 @@ { "path": "@commitlint/read" }, { "path": "@commitlint/rules" }, { "path": "@commitlint/lint" }, + { "path": "@commitlint/core" }, ] } From 5426867f931bf881fa5e08520f9966757f1e6b97 Mon Sep 17 00:00:00 2001 From: Armano Date: Thu, 6 Feb 2020 03:32:32 +0100 Subject: [PATCH 2/2] refactor(core): rename file and fix formatting --- @commitlint/core/package.json | 4 ++-- @commitlint/core/src/{index.ts => core.ts} | 0 @commitlint/core/tsconfig.json | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) rename @commitlint/core/src/{index.ts => core.ts} (100%) diff --git a/@commitlint/core/package.json b/@commitlint/core/package.json index 2757e0e7f8..f03b84c11f 100644 --- a/@commitlint/core/package.json +++ b/@commitlint/core/package.json @@ -2,8 +2,8 @@ "name": "@commitlint/core", "version": "8.3.5", "description": "Lint your commit messages", - "main": "lib/index.js", - "types": "lib/index.d.ts", + "main": "lib/core.js", + "types": "lib/core.d.ts", "files": [ "lib/" ], diff --git a/@commitlint/core/src/index.ts b/@commitlint/core/src/core.ts similarity index 100% rename from @commitlint/core/src/index.ts rename to @commitlint/core/src/core.ts diff --git a/@commitlint/core/tsconfig.json b/@commitlint/core/tsconfig.json index 9a17b91978..433a665f64 100644 --- a/@commitlint/core/tsconfig.json +++ b/@commitlint/core/tsconfig.json @@ -1,10 +1,10 @@ { - "extends": "../../tsconfig.shared.json", - "compilerOptions": { - "composite": true, - "rootDir": "./src", - "outDir": "./lib" - }, - "include": ["./src/**/*.ts"], + "extends": "../../tsconfig.shared.json", + "compilerOptions": { + "composite": true, + "rootDir": "./src", + "outDir": "./lib" + }, + "include": ["./src/**/*.ts"], "exclude": ["./src/**/*.test.ts", "./lib/**/*"] }