From 9ca3d83355d41f9620023ffaa675d9c52b72324b Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Sun, 8 Apr 2018 21:05:32 +0200 Subject: [PATCH] chore: update babel conf peer environment --- .babelrc | 22 +++++++++++++++++++++- Dockerfile | 2 +- package.json | 5 +++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.babelrc b/.babelrc index b173772a2..7222de515 100644 --- a/.babelrc +++ b/.babelrc @@ -26,7 +26,19 @@ ] }, "test": { - "presets": [ "es2015-node4", "stage-2", "stage-3", "flow", "react"], + "presets": [["env", { + "targets": { + "node": "6.10" + } + }], "flow", "react"], + "plugins": [ + "transform-class-properties", + "transform-object-rest-spread" + ] + }, + "testE2E": { + /** for an issue on puppeteer env we need to use es2015-node4 **/ + "presets": [ "es2015-node4", "flow"], "plugins": [ "transform-class-properties", "transform-object-rest-spread" @@ -44,6 +56,14 @@ "transform-class-properties" ] }, + "registry-docker": { + "presets": [ + ["env", { + "targets": { + "node": "9" + } + }], "flow"] + }, "development": { "presets": ["flow"], "plugins": ["flow-runtime"] diff --git a/Dockerfile b/Dockerfile index 3dde6d32a..79cad134a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN npm config set registry http://registry.npmjs.org/ && \ yarn global add -s flow-bin@0.52.0 && \ yarn install --production=false && \ yarn run lint && \ - yarn run code:build && \ + yarn run code:docker-build && \ yarn run build:webui && \ yarn run test:unit -- --silent true --coverage false --bail && \ yarn cache clean && \ diff --git a/package.json b/package.json index 1b28cc0a0..6850fdba4 100644 --- a/package.json +++ b/package.json @@ -149,10 +149,10 @@ "flow": "flow", "pretest": "npm run code:build", "test": "cross-env NODE_ENV=test BABEL_ENV=test TZ=UTC jest --maxWorkers 2", - "test:e2e": "cross-env BABEL_ENV=registry jest --config ./jest.e2e.config.js --maxWorkers 2", - "test:all": "npm run test && npm run test:e2e", "test:unit": "cross-env NODE_ENV=test BABEL_ENV=test TZ=UTC jest '(/test/unit.*\\.spec|/test/webui/.*\\.spec)\\.js' --maxWorkers 2", "test:func": "cross-env NODE_ENV=test BABEL_ENV=test jest '(/test/functional.*\\.func)\\.js' --maxWorkers 2", + "test:e2e": "cross-env BABEL_ENV=testE2E jest --config ./jest.e2e.config.js --maxWorkers 2", + "test:all": "npm run test && npm run test:e2e", "pre:ci": "npm run lint && npm run build:webui", "commitmsg": "commitlint -e $GIT_PARAMS", "coverage:publish": "codecov", @@ -160,6 +160,7 @@ "lint:css": "stylelint 'src/**/*.scss' --syntax scss", "dev:start": "cross-env BABEL_ENV=registry babel-node src/lib/cli", "code:build": "cross-env BABEL_ENV=registry babel src/ --out-dir build/ --ignore src/webui/ --copy-files", + "code:docker-build": "cross-env BABEL_ENV=registry-docker babel src/ --out-dir build/ --ignore src/webui/ --copy-files", "pre:webpack": "rimraf static/*", "dev:webui": "cross-env BABEL_ENV=ui babel-node tools/dev.server.js", "build:webui": "npm run pre:webpack && BABEL_ENV=ui webpack --config tools/webpack.prod.config.babel.js",