From 2b8d46105e2d31fc1d19b5ba7fdf728dfe1ec1f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Connor=20B=C3=A4r?= Date: Sun, 10 Nov 2019 10:19:39 -0300 Subject: [PATCH] chore(scripts): simplify yarn scripts --- .travis.yml | 7 ++++--- package.json | 41 +++++++++++++++++++---------------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5521bbd48c..e5240eb9e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,10 +20,11 @@ jobs: # Run tests in parallel - stage: test script: yarn check:licenses - - script: yarn test:lint-js - - script: yarn test:unit --runInBand + - script: yarn check:security + - script: yarn test:lint + - script: yarn test:unit:ci # Upload coverage reports to Codecov - after_success: yarn coverage:upload -t ${CODECOV_TOKEN} + after_success: yarn coverage-upload -t ${CODECOV_TOKEN} - stage: publish script: skip # Publish package to NPM diff --git a/package.json b/package.json index 075629c60f..8d7368d1a6 100644 --- a/package.json +++ b/package.json @@ -11,34 +11,31 @@ ], "scripts": { "commit": "git-cz", - "fix": "yarn fix:eslint", - "fix:eslint": "foundry run eslint --fix --quiet src/**/**/*.js", - "test": "yarn test:lint-js && yarn test:unit", - "test:lint-js": "foundry run eslint --cache --quiet \"src/**/*.js\"", - "test:lint-js:watch": "onchange \"src/**/*.js\" -- yarn test:lint-js", - "test:unit": "jest --coverage --silent", - "test:unit:watch": "yarn test:unit:output --watch", - "test:unit:output": "jest --json --outputFile=jest-test-results.json", + "start": "start-storybook -p 6006 -s .storybook/public", "create-component": "foundry run plop component", "static-styles": "cross-env BABEL_ENV=static babel-node ./scripts/static-styles/cli.js", - "prestart": "yarn test:unit:output", - "start": "start-storybook -p 6006 -s .storybook/public", - "build": "yarn build:storybook && yarn build:stylesheets", + "build": "rm -rf lib && yarn build:cjs && yarn build:es", + "build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir lib --ignore *.spec.js,*.story.js,*.docs.mdx", + "build:es": "cross-env BABEL_ENV=es babel src --out-dir lib/es --ignore *.spec.js,*.story.js,*.docs.mdx", + "build:docs": "yarn build:storybook && yarn build:stylesheets", "prebuild:storybook": "yarn test:unit:output", "build:storybook": "build-storybook -c .storybook -o dist -s .storybook/public", "build:stylesheets": "mkdir -p dist/static && yarn static-styles --global --filePath=./dist/static/circuit-ui-v1.css", - "build:js": "yarn clean:js && yarn build:js:cjs && yarn build:js:es", - "build:js:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir lib --ignore *.spec.js,*.story.js,*.docs.mdx", - "build:js:es": "cross-env BABEL_ENV=es babel src --out-dir lib/es --ignore *.spec.js,*.story.js,*.docs.mdx", - "clean:js": "rimraf lib", - "predeploy": "rm -rf ./dist && yarn build && cp ./src/CNAME ./dist/CNAME", - "deploy": "gh-pages -d dist", - "prerelease": "yarn build:js", - "release": "semantic-release", - "coverage:upload": "codecov", - "prepublishOnly": "yarn build:js", + "test": "yarn test:lint && yarn test:unit", + "test:lint": "foundry run eslint --cache --quiet \"src/**/*.js\"", + "test:lint:fix": "yarn test:lint --fix", + "test:lint:watch": "onchange \"src/**/*.js\" -- yarn test:lint", + "test:unit": "jest --silent", + "test:unit:watch": "jest --watch", + "test:unit:output": "jest --json --outputFile=jest-test-results.json", + "test:unit:ci": "jest --coverage --runInBand", "check:security": "audit-ci --critical", - "check:licenses": "license-checker --production --summary --failOn=GPLv3" + "check:licenses": "license-checker --production --summary --failOn=GPLv3", + "coverage-upload": "codecov", + "predeploy": "rm -rf ./dist && yarn build:docs && cp ./src/CNAME ./dist/CNAME", + "deploy": "gh-pages -d dist", + "prepublishOnly": "yarn build", + "release": "semantic-release" }, "config": { "commitizen": {