From f126268b62ef50394feb7335ea5975c28c3667f4 Mon Sep 17 00:00:00 2001 From: Kyle Welch Date: Wed, 9 May 2018 09:24:15 -0500 Subject: [PATCH] chore(scripts): Scripts Clean Up (#26) simplify scripts and move to jest-runner-tsc * update travis to pass ci flag * clean up scripts section * remove static check script * add ci to build script * add tsc jest runner * updated jest-runner-tsc to latest * remove ci from build * added type-check script fixes #25 --- .travis.yml | 2 +- jest-tsc.config.js | 7 +++++++ package.json | 16 +++++++--------- yarn.lock | 27 +++++++++++++++++++++++++-- 4 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 jest-tsc.config.js diff --git a/.travis.yml b/.travis.yml index 9879d46..bfc759a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,5 +9,5 @@ cache: yarn # Run the the validate script # Temporarily also run the build script to make sure it works # (will move this to the release step once that's implemented) -script: yarn run validate && yarn run build +script: yarn run validate --ci && yarn run build diff --git a/jest-tsc.config.js b/jest-tsc.config.js new file mode 100644 index 0000000..415ed86 --- /dev/null +++ b/jest-tsc.config.js @@ -0,0 +1,7 @@ +const baseConfig = require('./jest-base.config.js'); + +module.exports = Object.assign({}, baseConfig, { + runner: 'jest-runner-tsc', + displayName: 'tsc', + testMatch: ['/src/**/*.(ts|js)'], +}); diff --git a/package.json b/package.json index 7a4b206..341d59f 100644 --- a/package.json +++ b/package.json @@ -26,9 +26,6 @@ "homepage": "https://github.com/eventbrite/eventbrite-sdk-javascript#readme", "license": "MIT", "scripts": { - "check:size": "bundlesize", - "precheck:size": "yarn gulp build:dist:min", - "check:static": "npm-run-all --parallel lint tsc", "format": "prettier-eslint --write", "lint": "jest --config=jest-lint.config.js", "precommit": "lint-staged", @@ -36,12 +33,11 @@ "build": "npm-run-all build:targets gen:declarations", "build:targets": "gulp build", "prebuild:targets": "rm -rf dist && rm -rf lib", - "tsc": "tsc", + "postbuild": "bundlesize", + "start": "jest --watch", "test": "jest --config=jest-test.config.js", - "test:ci": "yarn test --ci", - "test:watch": "yarn test --watch", - "validate": "npm-run-all --parallel check:static check:size test:ci", - "validate:watch": "jest --watch" + "type-check": "jest --config=jest-tsc.config.js", + "validate": "jest" }, "lint-staged": { "*.{ts,js}": [ @@ -83,6 +79,7 @@ "husky": "^0.14.3", "jest": "^22.4.0", "jest-runner-eslint": "^0.4.0", + "jest-runner-tsc": "^1.2.0", "lint-staged": "^6.1.0", "node": "^8.9.2", "npm-run-all": "^4.1.2", @@ -108,7 +105,8 @@ "jest": { "projects": [ "jest-test.config.js", - "jest-lint.config.js" + "jest-lint.config.js", + "jest-tsc.config.js" ] } } diff --git a/yarn.lock b/yarn.lock index f190efd..d077a67 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,6 +17,14 @@ optionalDependencies: chokidar "^1.6.1" +"@babel/code-frame@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.35.tgz#04eeb6dca7efef8f65776a4c214157303b85ad51" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + "@babel/code-frame@7.0.0-beta.40", "@babel/code-frame@^7.0.0-beta.35": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.40.tgz#37e2b0cf7c56026b4b21d3927cadf81adec32ac6" @@ -1695,7 +1703,7 @@ end-of-stream@~0.1.5: dependencies: once "~1.3.0" -errno@^0.1.4: +errno@^0.1.4, errno@~0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" dependencies: @@ -3545,6 +3553,15 @@ jest-runner-eslint@^0.4.0: throat "4.1.0" worker-farm "1.5.0" +jest-runner-tsc@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/jest-runner-tsc/-/jest-runner-tsc-1.2.0.tgz#f15f299eb61b216ed5c1ba2014d2fbf0f75655a3" + dependencies: + "@babel/code-frame" "7.0.0-beta.35" + pify "^3.0.0" + throat "^4.1.0" + worker-farm "^1.5.2" + jest-runner@^22.4.0: version "22.4.0" resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-22.4.0.tgz#2509b82834ab4aa7e984ff464626397c556177a7" @@ -6082,7 +6099,7 @@ textextensions@~1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/textextensions/-/textextensions-1.0.2.tgz#65486393ee1f2bb039a60cbba05b0b68bd9501d2" -throat@4.1.0, throat@^4.0.0: +throat@4.1.0, throat@^4.0.0, throat@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" @@ -6487,6 +6504,12 @@ worker-farm@1.5.0: errno "^0.1.4" xtend "^4.0.1" +worker-farm@^1.5.2: + version "1.6.0" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.6.0.tgz#aecc405976fab5a95526180846f0dba288f3a4a0" + dependencies: + errno "~0.1.7" + wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"