Правильный способ использовать последние Babel и Jest в CLI-проекте Vue или Quasar - PullRequest
0 голосов
/ 02 января 2019

Необходимо использовать Babel 7 и Jest вместе с CLI Vue / Quasar.

В чате квазар-диссонанса мне сказали, что Jest требуется Babel 7 beta 54. Документация по Jest отсутствует и запутывает окружающих babel.7 поддержки, так что я пошел с рекомендацией в разногласия и получил его отлично работает, но я получаю много предупреждений во время "установки npm".

Когда я Google для этих предупреждений, я могу только найти людей, которые создалиgithub обращается с просьбой о помощи в репозитории Jest, Babel, Quasar и Vue CLI, а люди говорят им: «Это всего лишь предупреждения, а не ошибки», а проблемы закрываются: никто не решает и не объясняет проблему.

Может кто-нибудь объяснить, как заставить Babel 7 и Jest работать с CLI Quasar / Vue без предупреждений, или объяснить, почему отображаются предупреждающие сообщения?

ПРИМЕЧАНИЕ. Тексты предупреждающих сообщений на самом деле неверны.У меня есть версии, запрашиваемые для установки.

ПРИМЕЧАНИЕ. Я пытался установить 7.0.0-beta.50 и все промежуточные версии, как в devDependencies, так и в зависимостях, но безрезультатно.Предупреждения.

Если это поможет, я использую Windows 10, хотя коллеги-разработчики сказали, что они получают те же предупреждения на Mac и Linux.

Предупреждающие сообщения, которые появляются при вводе"npm install" со следующим package.json:

npm WARN @babel/plugin-proposal-class-properties@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-class-properties@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-import-meta@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/preset-stage-3@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-async-generator-functions@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-json-strings@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-object-rest-spread@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-optional-catch-binding@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-unicode-property-regex@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-async-generators@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-dynamic-import@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-json-strings@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-object-rest-spread@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-optional-catch-binding@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.

package.json:

{
  "name": "test",
  "version": "1.0.0",
  "dependencies": {
    "@babel/core": "^7.1.2",
    "@babel/runtime": "^7.1.2",
    "debug": "^4.1.0",
    "es6-iterator": "^2.0.3",
    "gsap": "^2.0.2",
    "lodash.get": "^4.4.2",
    "socket.io-client": "^2.1.1",
    "vue-i18n": "^7.3.3",
    "vue-json-pretty": "^1.4.1",
    "perfect-scrollbar-vue2": "^1.2.0",
    "vuelidate": "^0.7.4",
    "vuex": "^3.0.1"
  },
  "devDependencies": {
    "@babel/plugin-proposal-decorators": "7.1.2",
    "@babel/plugin-proposal-export-namespace-from": "7.0.0",
    "@babel/plugin-proposal-function-sent": "7.1.0",
    "@babel/plugin-proposal-numeric-separator": "7.0.0",
    "@babel/plugin-proposal-object-rest-spread": "7.0.0",
    "@babel/plugin-proposal-throw-expressions": "7.0.0",
    "@babel/plugin-syntax-dynamic-import": "7.0.0",
    "@babel/plugin-transform-runtime": "7.1.0",
    "@babel/preset-env": "7.1.0",
    "@babel/preset-stage-2": "7.0.0",
    "@babel/types": "7.1.3",
    "@storybook/addon-actions": "^4.0.9",
    "@storybook/addon-links": "^4.0.9",
    "@storybook/addons": "^4.0.9",
    "@storybook/vue": "^4.0.9",
    "@vue/cli-plugin-unit-jest": "^3.0.5",
    "@vue/test-utils": "^1.0.0-beta.26",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "^8.2.1",
    "babel-jest": "^23.6.0",
    "babel-loader": "^8.0.4",
    "babel-preset-vue": "^2.0.2",
    "eslint": "^4.18.2",
    "eslint-config-standard": "^11.0.0",
    "eslint-friendly-formatter": "^4.0.1",
    "eslint-loader": "^2.0.0",
    "eslint-plugin-import": "^2.9.0",
    "eslint-plugin-node": "^6.0.1",
    "eslint-plugin-promise": "^3.7.0",
    "eslint-plugin-standard": "^3.0.1",
    "eslint-plugin-vue": "^4.3.0",
    "eslint-plugin-vue-a11y": "0.0.28",
    "fse": "^4.0.1",
    "jest": "^23.6.0",
    "lighthouse": "^3.0.3",
    "mocha": "^5.2.0",
    "node-fetch": "^2.2.0",
    "pug": "^2.0.3",
    "pug-plain-loader": "^1.0.0",
    "quasar-cli": "^0.17.22",
    "request-promise": "^4.2.2",
    "socket.io-mock": "^1.2.3",
    "strip-ansi": "=3.0.1",
    "vue-jest": "^3.0.1",
    "wallaby-vue-compiler": "^1.0.3"
  },
  "engines": {
    "node": ">= 8.9.0",
    "npm": ">= 5.6.0"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 10"
  ]
}
...