From 3bc53c4e2937235181a8d3c857d39c7f21941ffa Mon Sep 17 00:00:00 2001 From: Paul Armstrong Date: Wed, 29 May 2019 12:37:03 +0200 Subject: [PATCH] [chore] remove typescript-definition-tester, use tsc directly --- .travis.yml | 1 + husky.config.js | 2 +- package.json | 10 +++--- src/__tests__/typescript.test.js | 9 ----- yarn.lock | 59 ++------------------------------ 5 files changed, 10 insertions(+), 71 deletions(-) delete mode 100644 src/__tests__/typescript.test.js diff --git a/.travis.yml b/.travis.yml index fe9128ca..3cadc6f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,6 @@ script: - npm run flow -- check - npm run test:ci - npm run build + - npm run tsc --noEmit src/__tests__/typescript/* after_success: - npm run test:coverage diff --git a/husky.config.js b/husky.config.js index 5ddd5d2f..df589aad 100644 --- a/husky.config.js +++ b/husky.config.js @@ -5,6 +5,6 @@ module.exports = { 'post-checkout': `if [[ $HUSKY_GIT_PARAMS =~ 1$ ]]; then ${runYarnLock}; fi`, 'post-merge': runYarnLock, 'post-rebase': 'yarn install', - 'pre-commit': 'yarn flow check && yarn lint-staged' + 'pre-commit': 'yarn typecheck && yarn lint-staged' } }; diff --git a/package.json b/package.json index 77790ad0..2326916c 100644 --- a/package.json +++ b/package.json @@ -29,11 +29,12 @@ "typings": "index.d.ts", "sideEffects": false, "scripts": { - "build": "npm run clean && npm-run-all --parallel build:*", + "build": "npm run clean && run-p build:*", "build:development": "NODE_ENV=development rollup -c", "build:production": "NODE_ENV=production rollup -c", "clean": "rimraf dist", "flow": "flow", + "flow:ci": "flow check", "lint": "yarn lint:cmd --fix", "lint:ci": "yarn lint:cmd", "lint:cmd": "eslint . --ext '.js,.json,.snap' --cache", @@ -42,7 +43,9 @@ "prepublishOnly": "npm run build", "test": "jest", "test:ci": "jest --ci", - "test:coverage": "npm run test -- --coverage && cat ./coverage/lcov.info | coveralls" + "test:coverage": "npm run test -- --coverage && cat ./coverage/lcov.info | coveralls", + "tsc:ci": "tsc --noEmit src/__tests__/typescript/*", + "typecheck": "run-p flow:ci tsc:ci" }, "author": "Paul Armstrong", "contributors": [ @@ -76,8 +79,7 @@ "rollup-plugin-babel": "^4.0.1", "rollup-plugin-filesize": "^6.1.0", "rollup-plugin-terser": "^5.0.0", - "typescript": "^3.4.5", - "typescript-definition-tester": "^0.0.6" + "typescript": "^3.4.5" }, "dependencies": {} } diff --git a/src/__tests__/typescript.test.js b/src/__tests__/typescript.test.js deleted file mode 100644 index caf24d36..00000000 --- a/src/__tests__/typescript.test.js +++ /dev/null @@ -1,9 +0,0 @@ -// eslint-env jest -import * as path from 'path'; -import { compileDirectory } from 'typescript-definition-tester'; - -describe('TypeScript definitions', () => { - test('compile against index.d.ts', (done) => { - compileDirectory(path.resolve(__dirname, 'typescript'), (fileName) => fileName.match(/\.ts$/), done); - }); -}); diff --git a/yarn.lock b/yarn.lock index e51c88e9..04b5fe4f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -918,10 +918,6 @@ assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" -assertion-error@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" - assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" @@ -1224,7 +1220,7 @@ boxen@^2.0.0: term-size "^1.2.0" widest-line "^2.0.0" -brace-expansion@^1.0.0, brace-expansion@^1.1.7: +brace-expansion@^1.1.7: version "1.1.8" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" dependencies: @@ -1781,13 +1777,6 @@ delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" -detect-indent@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-0.2.0.tgz#042914498979ac2d9f3c73e4ff3e6877d3bc92b6" - dependencies: - get-stdin "^0.1.0" - minimist "^0.1.0" - detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" @@ -1819,14 +1808,6 @@ domexception@^1.0.0: dependencies: webidl-conversions "^4.0.2" -dts-bundle@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/dts-bundle/-/dts-bundle-0.2.0.tgz#e165e494b00f81a3b6eb64385cbf6d1b486b7a99" - dependencies: - detect-indent "^0.2.0" - glob "^4.0.2" - mkdirp "^0.5.0" - duplexer@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" @@ -2432,10 +2413,6 @@ get-own-enumerable-property-symbols@^3.0.0: resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz#b877b49a5c16aefac3655f2ed2ea5b684df8d203" integrity sha512-CIJYJC4GGF06TakLg8z4GQKvDsx9EMspVxOYih7LerEL/WosUnFIww45CGfxfeKHqlg3twgUrYRT1O3WQqjGCg== -get-stdin@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-0.1.0.tgz#5998af24aafc802d15c82c685657eeb8b10d4a91" - get-stdin@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" @@ -2485,15 +2462,6 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob@^4.0.2: - version "4.5.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-4.5.3.tgz#c6cb73d3226c1efef04de3c56d012f03377ee15f" - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "^2.0.1" - once "^1.3.0" - glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" @@ -3744,10 +3712,6 @@ lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" -lodash@^3.6.0: - version "3.10.1" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" - lodash@^4.13.1, lodash@^4.14.0, lodash@^4.17.4: version "4.17.5" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" @@ -3922,12 +3886,6 @@ mimic-response@^1.0.0: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== -minimatch@^2.0.1: - version "2.0.10" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" - dependencies: - brace-expansion "^1.0.0" - minimatch@^3.0.0, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -3938,10 +3896,6 @@ minimist@0.0.8, minimist@~0.0.1: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.1.0.tgz#99df657a52574c21c9057497df742790b2b4c0de" - minimist@^1.1.1, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -3953,7 +3907,7 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: +"mkdirp@>=0.5 0", mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -5620,15 +5574,6 @@ type-fest@^0.4.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.4.1.tgz#8bdf77743385d8a4f13ba95f610f5ccd68c728f8" integrity sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw== -typescript-definition-tester@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typescript-definition-tester/-/typescript-definition-tester-0.0.6.tgz#097b02ac08ab9ebc2ca26b929273460130864dd9" - integrity sha512-DTUerqJ5DFtqkjggKCVVdYZGyXozqM+c+TKORm02ol3gwVcLOxeMkeBHKOBL/VnqeWWSnfoniw+AVDrl9lhVHw== - dependencies: - assertion-error "^1.0.1" - dts-bundle "^0.2.0" - lodash "^3.6.0" - typescript@^3.4.5: version "3.4.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.5.tgz#2d2618d10bb566572b8d7aad5180d84257d70a99"