mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-29 00:09:47 -05:00
chore: Merge branch 'dev'
This commit is contained in:
@@ -1,4 +1,90 @@
|
||||
|
||||
## 4.3.1 (2020-04-07)
|
||||
|
||||
#### :bug: Bug Fix
|
||||
* `@vue/cli-plugin-eslint`
|
||||
* [#5363](https://github.com/vuejs/vue-cli/pull/5363) fix(eslint-migrator): fix local eslint major version detection ([@sodatea](https://github.com/sodatea))
|
||||
* `@vue/cli`
|
||||
* [#5360](https://github.com/vuejs/vue-cli/pull/5360) fix: run migrator in a separator process, fix require cache issues during upgrade ([@sodatea](https://github.com/sodatea))
|
||||
|
||||
#### Committers: 1
|
||||
- Haoqun Jiang ([@sodatea](https://github.com/sodatea))
|
||||
|
||||
|
||||
|
||||
## 4.3.0 (2020-04-01)
|
||||
|
||||
#### :rocket: New Features
|
||||
* `@vue/cli-plugin-unit-mocha`
|
||||
* [#5294](https://github.com/vuejs/vue-cli/pull/5294) feat(service): Allow mocha unit tests debugger to be bound to a specified IP and port ([@darrylkuhn](https://github.com/darrylkuhn))
|
||||
* `@vue/babel-preset-app`
|
||||
* [#5322](https://github.com/vuejs/vue-cli/pull/5322) feat: enable `bugfixes` option for babel by default ([@sodatea](https://github.com/sodatea))
|
||||
* `@vue/cli-service`
|
||||
* [#5293](https://github.com/vuejs/vue-cli/pull/5293) support vue.config.cjs ([@simon300000](https://github.com/simon300000))
|
||||
* [#3886](https://github.com/vuejs/vue-cli/pull/3886) feat: wc entry accepts multiple file patterns splited by ',' ([@manico](https://github.com/manico))
|
||||
* `@vue/cli`
|
||||
* [#5212](https://github.com/vuejs/vue-cli/pull/5212) feat(vue-cli): Choosing to save as a preset tells you where it is saved ([@jaireina](https://github.com/jaireina))
|
||||
* `@vue/cli-plugin-typescript`
|
||||
* [#5170](https://github.com/vuejs/vue-cli/pull/5170) feat: use @vue/compiler-sfc as a compiler for TS if available ([@cexbrayat](https://github.com/cexbrayat))
|
||||
* `@vue/cli-plugin-eslint`, `@vue/cli-service-global`, `@vue/cli-ui-addon-widgets`
|
||||
* [#5241](https://github.com/vuejs/vue-cli/pull/5241) feat: ease the default `no-console` severity to `warn` ([@sodatea](https://github.com/sodatea))
|
||||
* `@vue/cli-service`, `@vue/cli-ui-addon-webpack`, `@vue/cli-ui-addon-widgets`, `@vue/cli-ui`
|
||||
* [#5233](https://github.com/vuejs/vue-cli/pull/5233) feat: add "not dead" to the default browserslist query ([@sodatea](https://github.com/sodatea))
|
||||
* `@vue/cli-plugin-router`
|
||||
* [#4805](https://github.com/vuejs/vue-cli/pull/4805) types(router): added router array type for Array RouteConfig ([@manuelojeda](https://github.com/manuelojeda))
|
||||
|
||||
#### :bug: Bug Fix
|
||||
* `@vue/cli-shared-utils`
|
||||
* [#5315](https://github.com/vuejs/vue-cli/pull/5315) fix: avoid process hanging when trying to get Chrome version ([@sodatea](https://github.com/sodatea))
|
||||
* [#5264](https://github.com/vuejs/vue-cli/pull/5264) fix false positive of `hasProjectNpm` ([@sodatea](https://github.com/sodatea))
|
||||
* `@vue/cli-ui`
|
||||
* [#5290](https://github.com/vuejs/vue-cli/pull/5290) fix(cli-ui): build task defaults should respect outputDir option from config file (Closes [#2639](https://github.com/vuejs/vue-cli/issues/2639)) ([@LinusBorg](https://github.com/LinusBorg))
|
||||
* `@vue/cli-service`
|
||||
* [#5320](https://github.com/vuejs/vue-cli/pull/5320) fix: spawn scripts with node, fix modern mode with Yarn 2 (Berry) ([@sodatea](https://github.com/sodatea))
|
||||
* [#5247](https://github.com/vuejs/vue-cli/pull/5247) fix(target-lib): fix dynamic public path in a dynamic chunk in Firefox ([@sodatea](https://github.com/sodatea))
|
||||
* `@vue/cli-plugin-pwa`
|
||||
* [#5087](https://github.com/vuejs/vue-cli/pull/5087) feat(pwa): Check for null or undefined in iconPaths ([@janispritzkau](https://github.com/janispritzkau))
|
||||
* `@vue/cli-plugin-eslint`
|
||||
* [#5242](https://github.com/vuejs/vue-cli/pull/5242) fix: fix severity config in ui ([@sodatea](https://github.com/sodatea))
|
||||
* `@vue/babel-preset-app`
|
||||
* [#5236](https://github.com/vuejs/vue-cli/pull/5236) fix(babel-preset-app): avoid corejs warning when useBuiltIns is false ([@LeBenLeBen](https://github.com/LeBenLeBen))
|
||||
|
||||
#### :memo: Documentation
|
||||
* [#5243](https://github.com/vuejs/vue-cli/pull/5243) docs: add warning on client side environment variables ([@sodatea](https://github.com/sodatea))
|
||||
* [#5231](https://github.com/vuejs/vue-cli/pull/5231) Update plugin-dev.md ([@yeyan1996](https://github.com/yeyan1996))
|
||||
|
||||
#### :house: Internal
|
||||
* `@vue/cli-service-global`
|
||||
* [#5319](https://github.com/vuejs/vue-cli/pull/5319) chore(cli-service-global): remove direct dependency on `@vue/babel-preset-app` ([@sodatea](https://github.com/sodatea))
|
||||
* `@vue/cli-service`
|
||||
* [#5305](https://github.com/vuejs/vue-cli/pull/5305) refactor: simplify config loading by skipping `fs.existsSync` check ([@sodatea](https://github.com/sodatea))
|
||||
* `@vue/cli`
|
||||
* [#5228](https://github.com/vuejs/vue-cli/pull/5228) test: e2e test case for command suggestion logic ([@jamesgeorge007](https://github.com/jamesgeorge007))
|
||||
* [#5238](https://github.com/vuejs/vue-cli/pull/5238) Improve package.json not found error ([@barbeque](https://github.com/barbeque))
|
||||
|
||||
#### :hammer: Underlying Tools
|
||||
* `@vue/cli-plugin-eslint`
|
||||
* [#5273](https://github.com/vuejs/vue-cli/pull/5273) chore(eslint): bump minimum required eslint-loader version to support ESLint 6 ([@megos](https://github.com/megos))
|
||||
|
||||
#### Committers: 15
|
||||
- Benoît Burgener ([@LeBenLeBen](https://github.com/LeBenLeBen))
|
||||
- Cédric Exbrayat ([@cexbrayat](https://github.com/cexbrayat))
|
||||
- Darryl Kuhn ([@darrylkuhn](https://github.com/darrylkuhn))
|
||||
- George Tsiolis ([@gtsiolis](https://github.com/gtsiolis))
|
||||
- Haoqun Jiang ([@sodatea](https://github.com/sodatea))
|
||||
- Jadranko Dragoje ([@manico](https://github.com/manico))
|
||||
- Jair Reina ([@jaireina](https://github.com/jaireina))
|
||||
- James George ([@jamesgeorge007](https://github.com/jamesgeorge007))
|
||||
- Janis Pritzkau ([@janispritzkau](https://github.com/janispritzkau))
|
||||
- Manuel Ojeda ([@manuelojeda](https://github.com/manuelojeda))
|
||||
- Mike ([@barbeque](https://github.com/barbeque))
|
||||
- Thorsten Lünborg ([@LinusBorg](https://github.com/LinusBorg))
|
||||
- megos ([@megos](https://github.com/megos))
|
||||
- simon3000 ([@simon300000](https://github.com/simon300000))
|
||||
- 夜宴 ([@yeyan1996](https://github.com/yeyan1996))
|
||||
|
||||
|
||||
|
||||
## 4.2.3 (2020-02-27)
|
||||
|
||||
#### :bug: Bug Fix
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
--max-warnings specify number of warnings to make build failed (default: Infinity)
|
||||
```
|
||||
|
||||
Lints and fixes files. If no specific files are given, it lints all files in `src` and `test`.
|
||||
Lints and fixes files. If no specific files are given, it lints all files in `src` and `tests`.
|
||||
|
||||
Other [ESLint CLI options](https://eslint.org/docs/user-guide/command-line-interface#options) are also supported.
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"packages": [
|
||||
"packages/@vue/babel-preset-app",
|
||||
"packages/@vue/cli*",
|
||||
|
||||
+18
-18
@@ -44,47 +44,47 @@
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.4",
|
||||
"@babel/core": "^7.9.0",
|
||||
"@vue/eslint-config-airbnb": "^5.0.2",
|
||||
"@vue/eslint-config-prettier": "^6.0.0",
|
||||
"@vue/eslint-config-standard": "^5.1.0",
|
||||
"@vue/eslint-config-typescript": "^5.0.1",
|
||||
"@vuepress/plugin-pwa": "^1.3.0",
|
||||
"@vuepress/theme-vue": "^1.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "^2.18.0",
|
||||
"@typescript-eslint/parser": "^2.18.0",
|
||||
"@vue/eslint-config-standard": "^5.1.2",
|
||||
"@vue/eslint-config-typescript": "^5.0.2",
|
||||
"@vuepress/plugin-pwa": "^1.4.0",
|
||||
"@vuepress/theme-vue": "^1.4.0",
|
||||
"@typescript-eslint/eslint-plugin": "^2.26.0",
|
||||
"@typescript-eslint/parser": "^2.26.0",
|
||||
"babel-core": "7.0.0-bridge.0",
|
||||
"babel-eslint": "^10.0.3",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"babel-jest": "^24.9.0",
|
||||
"chromedriver": "^80.0.0",
|
||||
"chromedriver": "^80.0.1",
|
||||
"debug": "^4.1.0",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-import": "^2.20.1",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"eslint-plugin-graphql": "^3.1.0",
|
||||
"eslint-plugin-node": "^11.0.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-prettier": "^3.1.1",
|
||||
"eslint-plugin-promise": "^4.2.1",
|
||||
"eslint-plugin-standard": "^4.0.0",
|
||||
"eslint-plugin-vue": "^6.1.2",
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
"eslint-plugin-vue-libs": "^4.0.0",
|
||||
"execa": "^1.0.0",
|
||||
"geckodriver": "^1.19.1",
|
||||
"globby": "^9.2.0",
|
||||
"graphql": "^14.6.0",
|
||||
"http-server": "^0.12.1",
|
||||
"inquirer": "^6.3.1",
|
||||
"inquirer": "^7.1.0",
|
||||
"jest": "^24.9.0",
|
||||
"lerna": "^3.19.0",
|
||||
"lerna-changelog": "^0.8.3",
|
||||
"lint-staged": "^9.5.0",
|
||||
"memfs": "^3.0.4",
|
||||
"minimist": "^1.2.0",
|
||||
"memfs": "^3.1.2",
|
||||
"minimist": "^1.2.5",
|
||||
"prettier": ">= 1.13.0",
|
||||
"request": "^2.87.0",
|
||||
"request": "^2.88.2",
|
||||
"request-promise-native": "^1.0.8",
|
||||
"rimraf": "^3.0.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"semver": "^6.1.0",
|
||||
"typescript": "~3.7.5",
|
||||
"typescript": "~3.8.3",
|
||||
"vuepress": "^1.3.0",
|
||||
"webpack": "^4.0.0",
|
||||
"yorkie": "^2.0.0"
|
||||
|
||||
@@ -59,6 +59,7 @@ module.exports = (context, options = {}) => {
|
||||
debug = false,
|
||||
useBuiltIns = 'usage',
|
||||
modules = false,
|
||||
bugfixes = true,
|
||||
targets: rawTargets,
|
||||
spec,
|
||||
ignoreBrowserslistConfig = !!process.env.VUE_CLI_MODERN_BUILD,
|
||||
@@ -137,7 +138,8 @@ module.exports = (context, options = {}) => {
|
||||
}
|
||||
|
||||
const envOptions = {
|
||||
corejs: 3,
|
||||
bugfixes,
|
||||
corejs: useBuiltIns ? 3 : false,
|
||||
spec,
|
||||
loose,
|
||||
debug,
|
||||
@@ -204,7 +206,7 @@ module.exports = (context, options = {}) => {
|
||||
presets: [
|
||||
[require('@babel/preset-env'), {
|
||||
useBuiltIns,
|
||||
corejs: 3
|
||||
corejs: useBuiltIns ? 3 : false
|
||||
}]
|
||||
]
|
||||
}]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/babel-preset-app",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "babel-preset-app for vue-cli",
|
||||
"main": "index.js",
|
||||
"publishConfig": {
|
||||
@@ -22,16 +22,16 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/babel-preset-app#readme",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.8.4",
|
||||
"@babel/helper-compilation-targets": "^7.8.4",
|
||||
"@babel/core": "^7.9.0",
|
||||
"@babel/helper-compilation-targets": "^7.8.7",
|
||||
"@babel/helper-module-imports": "^7.8.3",
|
||||
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
||||
"@babel/plugin-proposal-decorators": "^7.8.3",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||
"@babel/plugin-syntax-jsx": "^7.8.3",
|
||||
"@babel/plugin-transform-runtime": "^7.8.3",
|
||||
"@babel/preset-env": "^7.8.4",
|
||||
"@babel/runtime": "^7.8.4",
|
||||
"@babel/plugin-transform-runtime": "^7.9.0",
|
||||
"@babel/preset-env": "^7.9.0",
|
||||
"@babel/runtime": "^7.9.2",
|
||||
"@vue/babel-preset-jsx": "^1.1.2",
|
||||
"babel-plugin-dynamic-import-node": "^2.3.0",
|
||||
"core-js": "^3.6.4",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-init",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "init addon for vue-cli",
|
||||
"main": "index.js",
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-overlay",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "error overlay & dev server middleware for vue-cli",
|
||||
"main": "dist/client.js",
|
||||
"files": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-babel",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "babel plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -20,10 +20,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-babel#readme",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.8.4",
|
||||
"@vue/babel-preset-app": "^4.2.3",
|
||||
"@vue/cli-shared-utils": "^4.2.3",
|
||||
"babel-loader": "^8.0.6",
|
||||
"@babel/core": "^7.9.0",
|
||||
"@vue/babel-preset-app": "^4.3.1",
|
||||
"@vue/cli-shared-utils": "^4.3.1",
|
||||
"babel-loader": "^8.1.0",
|
||||
"cache-loader": "^4.1.0",
|
||||
"thread-loader": "^2.1.3",
|
||||
"webpack": "^4.0.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-e2e-cypress",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "e2e-cypress plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -23,9 +23,9 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/cli-shared-utils": "^4.2.3",
|
||||
"@vue/cli-shared-utils": "^4.3.1",
|
||||
"cypress": "^3.8.3",
|
||||
"eslint-plugin-cypress": "^2.8.1"
|
||||
"eslint-plugin-cypress": "^2.10.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vue/cli-service": "^3.0.0 || ^4.0.0-0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-e2e-nightwatch",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "e2e-nightwatch plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -23,12 +23,12 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/cli-shared-utils": "^4.2.3",
|
||||
"@vue/cli-shared-utils": "^4.3.1",
|
||||
"deepmerge": "^4.2.2",
|
||||
"nightwatch": "^1.3.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chromedriver": "^80.0.0",
|
||||
"chromedriver": "^80.0.1",
|
||||
"geckodriver": "^1.19.1",
|
||||
"selenium-server": "^3.141.59"
|
||||
},
|
||||
|
||||
@@ -84,7 +84,7 @@ describe('getEslintPrompts', () => {
|
||||
extends: 'plugin:vue/recommended',
|
||||
rules: {
|
||||
'vue/lorem': ['error', ['asd']], // custom setting
|
||||
'vue/ipsum': 'warning'
|
||||
'vue/ipsum': 'warn'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -146,7 +146,7 @@ describe('getEslintPrompts', () => {
|
||||
})
|
||||
|
||||
it('sets value on prompt item, if the rule was set in project\'s eslint config', () => {
|
||||
expect(prompts[1].value).toBe('"warning"')
|
||||
expect(prompts[1].value).toBe('"warn"')
|
||||
expect(prompts[2].value).toBe('["error",["asd"]]')
|
||||
})
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
const DEPS_MAP = {
|
||||
base: {
|
||||
eslint: '^6.7.2',
|
||||
'eslint-plugin-vue': '^6.1.2'
|
||||
'eslint-plugin-vue': '^6.2.2'
|
||||
},
|
||||
airbnb: {
|
||||
'@vue/eslint-config-airbnb': '^5.0.2',
|
||||
'eslint-plugin-import': '^2.20.1'
|
||||
'eslint-plugin-import': '^2.20.2'
|
||||
},
|
||||
prettier: {
|
||||
'@vue/eslint-config-prettier': '^6.0.0',
|
||||
@@ -13,16 +13,16 @@ const DEPS_MAP = {
|
||||
prettier: '^1.19.1'
|
||||
},
|
||||
standard: {
|
||||
'@vue/eslint-config-standard': '^5.1.0',
|
||||
'eslint-plugin-import': '^2.20.1',
|
||||
'eslint-plugin-node': '^11.0.0',
|
||||
'@vue/eslint-config-standard': '^5.1.2',
|
||||
'eslint-plugin-import': '^2.20.2',
|
||||
'eslint-plugin-node': '^11.1.0',
|
||||
'eslint-plugin-promise': '^4.2.1',
|
||||
'eslint-plugin-standard': '^4.0.0'
|
||||
},
|
||||
typescript: {
|
||||
'@vue/eslint-config-typescript': '^5.0.1',
|
||||
'@typescript-eslint/eslint-plugin': '^2.18.0',
|
||||
'@typescript-eslint/parser': '^2.18.0'
|
||||
'@vue/eslint-config-typescript': '^5.0.2',
|
||||
'@typescript-eslint/eslint-plugin': '^2.26.0',
|
||||
'@typescript-eslint/parser': '^2.26.0'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ exports.getDeps = function (api, preset) {
|
||||
|
||||
if (api.hasPlugin('babel') && !api.hasPlugin('typescript')) {
|
||||
Object.assign(deps, {
|
||||
'babel-eslint': '^10.0.3'
|
||||
'babel-eslint': '^10.1.0'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ exports.config = (api, preset) => {
|
||||
ecmaVersion: 2020
|
||||
},
|
||||
rules: {
|
||||
'no-console': makeJSOnlyValue(`process.env.NODE_ENV === 'production' ? 'error' : 'off'`),
|
||||
'no-debugger': makeJSOnlyValue(`process.env.NODE_ENV === 'production' ? 'error' : 'off'`)
|
||||
'no-console': makeJSOnlyValue(`process.env.NODE_ENV === 'production' ? 'warn' : 'off'`),
|
||||
'no-debugger': makeJSOnlyValue(`process.env.NODE_ENV === 'production' ? 'warn' : 'off'`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,11 @@ module.exports = async (api) => {
|
||||
}
|
||||
|
||||
const localESLintMajor = semver.major(
|
||||
semver.maxSatisfying(
|
||||
['4.99.0', '5.99.0', '6.99.0'],
|
||||
localESLintRange
|
||||
)
|
||||
semver.maxSatisfying(['4.99.0', '5.99.0', '6.99.0'], localESLintRange) ||
|
||||
// in case the user does not specify a typical caret range;
|
||||
// it is used as **fallback** because the user may have not previously
|
||||
// installed eslint yet, such as in the case that they are from v3.0.x
|
||||
require('eslint/package.json').version
|
||||
)
|
||||
|
||||
if (localESLintMajor === 6) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-eslint",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "eslint plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -23,10 +23,10 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/cli-shared-utils": "^4.2.3",
|
||||
"eslint-loader": "^2.1.2",
|
||||
"@vue/cli-shared-utils": "^4.3.1",
|
||||
"eslint-loader": "^2.2.1",
|
||||
"globby": "^9.2.0",
|
||||
"inquirer": "^6.3.1",
|
||||
"inquirer": "^7.1.0",
|
||||
"webpack": "^4.0.0",
|
||||
"yorkie": "^2.0.0"
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@ const CATEGORIES = [
|
||||
const DEFAULT_CATEGORY = 'essential'
|
||||
const RULE_SETTING_OFF = 'off'
|
||||
const RULE_SETTING_ERROR = 'error'
|
||||
const RULE_SETTING_WARNING = 'warning'
|
||||
const RULE_SETTING_WARNING = 'warn'
|
||||
const RULE_SETTINGS = [RULE_SETTING_OFF, RULE_SETTING_ERROR, RULE_SETTING_WARNING]
|
||||
|
||||
const defaultChoices = [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module.exports = api => {
|
||||
api.extendPackage({
|
||||
dependencies: {
|
||||
'register-service-worker': '^1.6.2'
|
||||
'register-service-worker': '^1.7.1'
|
||||
}
|
||||
})
|
||||
api.injectImports(api.entryFile, `import './registerServiceWorker'`)
|
||||
|
||||
@@ -81,22 +81,26 @@ module.exports = class HtmlPwaPlugin {
|
||||
|
||||
const assetsVersionStr = assetsVersion ? `?v=${assetsVersion}` : ''
|
||||
|
||||
data.head.push(
|
||||
// Favicons
|
||||
makeTag('link', {
|
||||
// Favicons
|
||||
if (iconPaths.favicon32 != null) {
|
||||
data.head.push(makeTag('link', {
|
||||
rel: 'icon',
|
||||
type: 'image/png',
|
||||
sizes: '32x32',
|
||||
href: getTagHref(publicPath, iconPaths.favicon32, assetsVersionStr)
|
||||
}),
|
||||
makeTag('link', {
|
||||
}))
|
||||
}
|
||||
if (iconPaths.favicon16 != null) {
|
||||
data.head.push(makeTag('link', {
|
||||
rel: 'icon',
|
||||
type: 'image/png',
|
||||
sizes: '16x16',
|
||||
href: getTagHref(publicPath, iconPaths.favicon16, assetsVersionStr)
|
||||
}),
|
||||
}))
|
||||
}
|
||||
|
||||
// Add to home screen for Android and modern mobile browsers
|
||||
// Add to home screen for Android and modern mobile browsers
|
||||
data.head.push(
|
||||
makeTag('link', manifestCrossorigin
|
||||
? {
|
||||
rel: 'manifest',
|
||||
@@ -111,9 +115,11 @@ module.exports = class HtmlPwaPlugin {
|
||||
makeTag('meta', {
|
||||
name: 'theme-color',
|
||||
content: themeColor
|
||||
}),
|
||||
})
|
||||
)
|
||||
|
||||
// Add to home screen for Safari on iOS
|
||||
// Add to home screen for Safari on iOS
|
||||
data.head.push(
|
||||
makeTag('meta', {
|
||||
name: 'apple-mobile-web-app-capable',
|
||||
content: appleMobileWebAppCapable
|
||||
@@ -125,22 +131,30 @@ module.exports = class HtmlPwaPlugin {
|
||||
makeTag('meta', {
|
||||
name: 'apple-mobile-web-app-title',
|
||||
content: name
|
||||
}),
|
||||
makeTag('link', {
|
||||
})
|
||||
)
|
||||
if (iconPaths.appleTouchIcon != null) {
|
||||
data.head.push(makeTag('link', {
|
||||
rel: 'apple-touch-icon',
|
||||
href: getTagHref(publicPath, iconPaths.appleTouchIcon, assetsVersionStr)
|
||||
}),
|
||||
makeTag('link', {
|
||||
}))
|
||||
}
|
||||
if (iconPaths.maskIcon != null) {
|
||||
data.head.push(makeTag('link', {
|
||||
rel: 'mask-icon',
|
||||
href: getTagHref(publicPath, iconPaths.maskIcon, assetsVersionStr),
|
||||
color: themeColor
|
||||
}),
|
||||
}))
|
||||
}
|
||||
|
||||
// Add to home screen for Windows
|
||||
makeTag('meta', {
|
||||
// Add to home screen for Windows
|
||||
if (iconPaths.msTileImage != null) {
|
||||
data.head.push(makeTag('meta', {
|
||||
name: 'msapplication-TileImage',
|
||||
content: getTagHref(publicPath, iconPaths.msTileImage, assetsVersionStr)
|
||||
}),
|
||||
}))
|
||||
}
|
||||
data.head.push(
|
||||
makeTag('meta', {
|
||||
name: 'msapplication-TileColor',
|
||||
content: msTileColor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-pwa",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "pwa plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -23,12 +23,12 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/cli-shared-utils": "^4.2.3",
|
||||
"@vue/cli-shared-utils": "^4.3.1",
|
||||
"webpack": "^4.0.0",
|
||||
"workbox-webpack-plugin": "^4.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"register-service-worker": "^1.6.2"
|
||||
"register-service-worker": "^1.7.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vue/cli-service": "^3.0.0 || ^4.0.0-0"
|
||||
|
||||
@@ -4,13 +4,14 @@ module.exports = (api, options = {}) => {
|
||||
|
||||
api.extendPackage({
|
||||
dependencies: {
|
||||
'vue-router': '^3.1.5'
|
||||
'vue-router': '^3.1.6'
|
||||
}
|
||||
})
|
||||
|
||||
api.render('./template', {
|
||||
historyMode: options.historyMode,
|
||||
doesCompile: api.hasPlugin('babel') || api.hasPlugin('typescript')
|
||||
doesCompile: api.hasPlugin('babel') || api.hasPlugin('typescript'),
|
||||
hasTypeScript: api.hasPlugin('typescript')
|
||||
})
|
||||
|
||||
if (api.invoking) {
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
import Vue from 'vue'
|
||||
<%_ if (hasTypeScript) { _%>
|
||||
import VueRouter, { RouteConfig } from 'vue-router'
|
||||
<%_ } else { _%>
|
||||
import VueRouter from 'vue-router'
|
||||
<%_ } _%>
|
||||
import Home from '../views/Home.vue'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
const routes = [
|
||||
<%_ if (hasTypeScript) { _%>
|
||||
const routes: Array<RouteConfig> = [
|
||||
<%_ } else { _%>
|
||||
const routes = [
|
||||
<%_ } _%>
|
||||
{
|
||||
path: '/',
|
||||
name: 'Home',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-router",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "router plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -23,10 +23,10 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/cli-shared-utils": "^4.2.3"
|
||||
"@vue/cli-shared-utils": "^4.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-test-utils": "^4.2.3"
|
||||
"@vue/cli-test-utils": "^4.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vue/cli-service": "^3.0.0 || ^4.0.0-0"
|
||||
|
||||
@@ -77,12 +77,24 @@ module.exports = (api, projectOptions) => {
|
||||
})
|
||||
|
||||
if (!process.env.VUE_CLI_TEST) {
|
||||
// try to load `@vue/compiler-sfc` if the project is using Vue 3.
|
||||
// if it is not available, it uses `vue-template-compiler`
|
||||
let compiler = '@vue/compiler-sfc'
|
||||
try {
|
||||
require.resolve(compiler)
|
||||
// use a shim as @vue/compiler-sfc does not offer the `parseComponent` function
|
||||
// but a `parse` function
|
||||
// the shim only delegates to the parse function
|
||||
compiler = '@vue/cli-plugin-typescript/vue-compiler-sfc-shim'
|
||||
} catch (e) {
|
||||
compiler = 'vue-template-compiler'
|
||||
}
|
||||
// this plugin does not play well with jest + cypress setup (tsPluginE2e.spec.js) somehow
|
||||
// so temporarily disabled for vue-cli tests
|
||||
config
|
||||
.plugin('fork-ts-checker')
|
||||
.use(require('fork-ts-checker-webpack-plugin'), [{
|
||||
vue: true,
|
||||
vue: { enabled: true, compiler },
|
||||
tslint: projectOptions.lintOnSave !== false && fs.existsSync(api.resolve('tslint.json')),
|
||||
formatter: 'codeframe',
|
||||
// https://github.com/TypeStrong/ts-loader#happypackmode-boolean-defaultfalse
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-typescript",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "typescript plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -24,12 +24,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/webpack-env": "^1.15.1",
|
||||
"@vue/cli-shared-utils": "^4.2.3",
|
||||
"@vue/cli-shared-utils": "^4.3.1",
|
||||
"cache-loader": "^4.1.0",
|
||||
"fork-ts-checker-webpack-plugin": "^1.5.1",
|
||||
"fork-ts-checker-webpack-plugin": "^3.1.1",
|
||||
"globby": "^9.2.0",
|
||||
"thread-loader": "^2.1.3",
|
||||
"ts-loader": "^6.2.1",
|
||||
"ts-loader": "^6.2.2",
|
||||
"tslint": "^5.20.1",
|
||||
"webpack": "^4.0.0",
|
||||
"yorkie": "^2.0.0"
|
||||
@@ -39,11 +39,11 @@
|
||||
"typescript": ">=2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/chai": "^4.2.8",
|
||||
"@types/chai": "^4.2.11",
|
||||
"@types/jest": "^24.0.19",
|
||||
"@types/mocha": "^5.2.6",
|
||||
"typescript": "~3.7.5",
|
||||
"vue-class-component": "^7.2.2",
|
||||
"vue-property-decorator": "^8.3.0"
|
||||
"typescript": "~3.8.3",
|
||||
"vue-class-component": "^7.2.3",
|
||||
"vue-property-decorator": "^8.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
const compilerSFC = require('@vue/compiler-sfc')
|
||||
|
||||
module.exports = {
|
||||
parseComponent (content, options) {
|
||||
return compilerSFC.parse(content, options)
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-unit-jest",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "unit-jest plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -23,10 +23,10 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.8.4",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.8.3",
|
||||
"@babel/core": "^7.9.0",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.9.0",
|
||||
"@types/jest": "^24.0.19",
|
||||
"@vue/cli-shared-utils": "^4.2.3",
|
||||
"@vue/cli-shared-utils": "^4.3.1",
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
"babel-jest": "^24.9.0",
|
||||
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
|
||||
|
||||
@@ -44,7 +44,7 @@ const applyTS = module.exports.applyTS = (api, invoking) => {
|
||||
api.extendPackage({
|
||||
devDependencies: {
|
||||
'@types/mocha': '^5.2.4',
|
||||
'@types/chai': '^4.2.8'
|
||||
'@types/chai': '^4.2.11'
|
||||
}
|
||||
})
|
||||
// inject mocha/chai types to tsconfig.json
|
||||
|
||||
@@ -37,8 +37,9 @@ module.exports = api => {
|
||||
`https://sysgears.github.io/mochapack/docs/installation/cli-usage.html`
|
||||
)
|
||||
}, (args, rawArgv) => {
|
||||
const inspectPos = rawArgv.indexOf('--inspect-brk')
|
||||
let nodeArgs = []
|
||||
|
||||
const inspectPos = rawArgv.findIndex(arg => arg.startsWith('--inspect-brk'))
|
||||
if (inspectPos !== -1) {
|
||||
nodeArgs = rawArgv.splice(inspectPos, inspectPos + 1)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-unit-mocha",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "mocha unit testing plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-unit-mocha#readme",
|
||||
"dependencies": {
|
||||
"@vue/cli-shared-utils": "^4.2.3",
|
||||
"@vue/cli-shared-utils": "^4.3.1",
|
||||
"jsdom": "^15.2.1",
|
||||
"jsdom-global": "^3.0.2",
|
||||
"mocha": "^6.2.2",
|
||||
|
||||
@@ -4,7 +4,7 @@ module.exports = (api, options = {}) => {
|
||||
|
||||
api.extendPackage({
|
||||
dependencies: {
|
||||
vuex: '^3.1.2'
|
||||
vuex: '^3.1.3'
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-vuex",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "Vuex plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -23,7 +23,7 @@
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-test-utils": "^4.2.3"
|
||||
"@vue/cli-test-utils": "^4.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vue/cli-service": "^3.0.0 || ^4.0.0-0"
|
||||
|
||||
@@ -59,7 +59,7 @@ module.exports = function createConfigPlugin (context, entry, asLib) {
|
||||
.add(entry)
|
||||
|
||||
const babelOptions = {
|
||||
presets: [require.resolve('@vue/babel-preset-app')]
|
||||
presets: [require.resolve('@vue/cli-plugin-babel/preset')]
|
||||
}
|
||||
|
||||
// set inline babel options
|
||||
@@ -114,8 +114,8 @@ module.exports = function createConfigPlugin (context, entry, asLib) {
|
||||
parser: 'babel-eslint'
|
||||
},
|
||||
rules: {
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
|
||||
}
|
||||
}
|
||||
}))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-service-global",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "vue-cli-service global addon for vue-cli",
|
||||
"main": "index.js",
|
||||
"publishConfig": {
|
||||
@@ -22,17 +22,16 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-service-global#readme",
|
||||
"dependencies": {
|
||||
"@vue/babel-preset-app": "^4.2.3",
|
||||
"@vue/cli-plugin-babel": "^4.2.3",
|
||||
"@vue/cli-plugin-eslint": "^4.2.3",
|
||||
"@vue/cli-service": "^4.2.3",
|
||||
"babel-eslint": "^10.0.3",
|
||||
"@vue/cli-plugin-babel": "^4.3.1",
|
||||
"@vue/cli-plugin-eslint": "^4.3.1",
|
||||
"@vue/cli-service": "^4.3.1",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"chalk": "^3.0.0",
|
||||
"core-js": "^3.6.4",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-plugin-vue": "^5.2.2",
|
||||
"regenerator-runtime": "^0.13.3",
|
||||
"resolve": "^1.15.0",
|
||||
"regenerator-runtime": "^0.13.5",
|
||||
"resolve": "^1.15.1",
|
||||
"vue": "^2.6.11",
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
jest.mock('fs')
|
||||
jest.mock('/vue.config.js', () => ({ lintOnSave: false }), { virtual: true })
|
||||
jest.mock('vue-cli-plugin-foo', () => () => {}, { virtual: true })
|
||||
|
||||
const fs = require('fs')
|
||||
@@ -61,8 +60,8 @@ test('env loading for custom mode', () => {
|
||||
test('loading plugins from package.json', () => {
|
||||
mockPkg({
|
||||
devDependencies: {
|
||||
'bar': '^1.0.0',
|
||||
'@vue/cli-plugin-babel': '^4.2.0',
|
||||
bar: '^1.0.0',
|
||||
'@vue/cli-plugin-babel': '^4.3.0',
|
||||
'vue-cli-plugin-foo': '^1.0.0'
|
||||
}
|
||||
})
|
||||
@@ -125,23 +124,18 @@ test('keep publicPath when empty', () => {
|
||||
})
|
||||
|
||||
test('load project options from vue.config.js', () => {
|
||||
process.env.VUE_CLI_SERVICE_CONFIG_PATH = `/vue.config.js`
|
||||
fs.writeFileSync('/vue.config.js', `module.exports = { lintOnSave: false }`)
|
||||
jest.mock(path.resolve('/', 'vue.config.js'), () => ({ lintOnSave: false }), { virtual: true })
|
||||
mockPkg({
|
||||
vue: {
|
||||
lintOnSave: 'default'
|
||||
}
|
||||
})
|
||||
const service = createMockService()
|
||||
fs.unlinkSync('/vue.config.js')
|
||||
delete process.env.VUE_CLI_SERVICE_CONFIG_PATH
|
||||
// vue.config.js has higher priority
|
||||
expect(service.projectOptions.lintOnSave).toBe(false)
|
||||
})
|
||||
|
||||
test('load project options from vue.config.js', () => {
|
||||
process.env.VUE_CLI_SERVICE_CONFIG_PATH = `/vue.config.js`
|
||||
fs.writeFileSync('/vue.config.js', '') // only to ensure fs.existsSync returns true
|
||||
test('load project options from vue.config.js as a function', () => {
|
||||
jest.mock('/vue.config.js', () => function () { return { lintOnSave: false } }, { virtual: true })
|
||||
mockPkg({
|
||||
vue: {
|
||||
@@ -149,8 +143,6 @@ test('load project options from vue.config.js', () => {
|
||||
}
|
||||
})
|
||||
const service = createMockService()
|
||||
fs.unlinkSync('/vue.config.js')
|
||||
delete process.env.VUE_CLI_SERVICE_CONFIG_PATH
|
||||
// vue.config.js has higher priority
|
||||
expect(service.projectOptions.lintOnSave).toBe(false)
|
||||
})
|
||||
@@ -191,7 +183,7 @@ test('api: --skip-plugins', () => {
|
||||
id: 'test-command',
|
||||
apply: api => {
|
||||
api.registerCommand('foo', _args => {
|
||||
return
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
const { join } = require('path')
|
||||
const Service = require('../lib/Service')
|
||||
|
||||
const mockDir = join(__dirname, 'mockESM')
|
||||
const configPath = join(mockDir, 'vue.config.cjs')
|
||||
|
||||
const createService = () => {
|
||||
const service = new Service(mockDir, {
|
||||
plugins: [],
|
||||
useBuiltIn: false
|
||||
})
|
||||
service.init()
|
||||
return service
|
||||
}
|
||||
|
||||
// vue.config.cjs has higher priority
|
||||
|
||||
test('load project options from package.json', async () => {
|
||||
const service = createService()
|
||||
expect(service.projectOptions.lintOnSave).toBe('default')
|
||||
})
|
||||
|
||||
test('load project options from vue.config.cjs', async () => {
|
||||
jest.mock(configPath, () => ({ lintOnSave: true }), { virtual: true })
|
||||
const service = createService()
|
||||
expect(service.projectOptions.lintOnSave).toBe(true)
|
||||
})
|
||||
|
||||
test('load project options from vue.config.cjs as a function', async () => {
|
||||
jest.mock(configPath, () => function () { return { lintOnSave: true } }, { virtual: true })
|
||||
const service = createService()
|
||||
expect(service.projectOptions.lintOnSave).toBe(true)
|
||||
})
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"type": "module",
|
||||
"vue": {
|
||||
"lintOnSave": "default"
|
||||
}
|
||||
}
|
||||
@@ -16,14 +16,15 @@ module.exports = (api, options) => {
|
||||
},
|
||||
browserslist: [
|
||||
'> 1%',
|
||||
'last 2 versions'
|
||||
'last 2 versions',
|
||||
'not dead'
|
||||
]
|
||||
})
|
||||
|
||||
if (options.cssPreprocessor) {
|
||||
const deps = {
|
||||
sass: {
|
||||
sass: '^1.25.0',
|
||||
sass: '^1.26.3',
|
||||
'sass-loader': '^8.0.2'
|
||||
},
|
||||
'node-sass': {
|
||||
@@ -31,7 +32,7 @@ module.exports = (api, options) => {
|
||||
'sass-loader': '^8.0.2'
|
||||
},
|
||||
'dart-sass': {
|
||||
sass: '^1.25.0',
|
||||
sass: '^1.26.3',
|
||||
'sass-loader': '^8.0.2'
|
||||
},
|
||||
less: {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const debug = require('debug')
|
||||
const merge = require('webpack-merge')
|
||||
@@ -11,6 +10,22 @@ const { chalk, warn, error, isPlugin, resolvePluginId, loadModule, resolvePkg }
|
||||
|
||||
const { defaults, validate } = require('./options')
|
||||
|
||||
const loadConfig = configPath => {
|
||||
let fileConfig = require(configPath)
|
||||
|
||||
if (typeof fileConfig === 'function') {
|
||||
fileConfig = fileConfig()
|
||||
}
|
||||
|
||||
if (!fileConfig || typeof fileConfig !== 'object') {
|
||||
error(
|
||||
`Error loading ${chalk.bold('vue.config.js')}: should export an object or a function that returns object.`
|
||||
)
|
||||
fileConfig = null
|
||||
}
|
||||
return fileConfig
|
||||
}
|
||||
|
||||
module.exports = class Service {
|
||||
constructor (context, { plugins, pkg, inlineOptions, useBuiltIn } = {}) {
|
||||
process.VUE_CLI_SERVICE = this
|
||||
@@ -300,31 +315,43 @@ module.exports = class Service {
|
||||
|
||||
loadUserOptions () {
|
||||
// vue.config.js
|
||||
// vue.config.cjs
|
||||
let fileConfig, pkgConfig, resolved, resolvedFrom
|
||||
const esm = this.pkg.type && this.pkg.type === 'module'
|
||||
const jsConfigPath = path.resolve(this.context, 'vue.config.js')
|
||||
const cjsConfigPath = path.resolve(this.context, 'vue.config.cjs')
|
||||
const configPath = (
|
||||
process.env.VUE_CLI_SERVICE_CONFIG_PATH ||
|
||||
path.resolve(this.context, 'vue.config.js')
|
||||
jsConfigPath
|
||||
)
|
||||
if (fs.existsSync(configPath)) {
|
||||
try {
|
||||
fileConfig = require(configPath)
|
||||
|
||||
if (typeof fileConfig === 'function') {
|
||||
fileConfig = fileConfig()
|
||||
try {
|
||||
fileConfig = loadConfig(configPath)
|
||||
} catch (e) {
|
||||
if (e.code !== 'MODULE_NOT_FOUND') {
|
||||
if (e.code === 'ERR_REQUIRE_ESM') {
|
||||
warn(`Rename ${chalk.bold('vue.config.js')} to ${chalk.bold('vue.config.cjs')} when ECMAScript modules is enabled`)
|
||||
}
|
||||
|
||||
if (!fileConfig || typeof fileConfig !== 'object') {
|
||||
error(
|
||||
`Error loading ${chalk.bold('vue.config.js')}: should export an object or a function that returns object.`
|
||||
)
|
||||
fileConfig = null
|
||||
}
|
||||
} catch (e) {
|
||||
error(`Error loading ${chalk.bold('vue.config.js')}:`)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
// vue.config.js not found, esm enabled, no env set
|
||||
if (!fileConfig && esm && !process.env.VUE_CLI_SERVICE_CONFIG_PATH) {
|
||||
try {
|
||||
fileConfig = loadConfig(cjsConfigPath)
|
||||
} catch (e) {
|
||||
if (e.code !== 'MODULE_NOT_FOUND') {
|
||||
error(`Error loading ${chalk.bold('vue.config.cjs')}:`)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
if (fileConfig) {
|
||||
warn(`ECMAScript modules is detected, config loaded from ${chalk.bold('vue.config.cjs')}`)
|
||||
}
|
||||
}
|
||||
|
||||
// package.vue
|
||||
pkgConfig = this.pkg.vue
|
||||
if (pkgConfig && typeof pkgConfig !== 'object') {
|
||||
|
||||
@@ -62,7 +62,7 @@ module.exports = (api, options) => {
|
||||
// spawn sub-process of self for modern build
|
||||
const { execa } = require('@vue/cli-shared-utils')
|
||||
const cliBin = require('path').resolve(__dirname, '../../../bin/vue-cli-service.js')
|
||||
await execa(cliBin, ['build', ...rawArgs], {
|
||||
await execa('node', [cliBin, 'build', ...rawArgs], {
|
||||
stdio: 'inherit',
|
||||
env: {
|
||||
VUE_CLI_MODERN_BUILD: true
|
||||
|
||||
@@ -15,7 +15,7 @@ module.exports = (api, { target, entry, name, 'inline-vue': inlineVue }) => {
|
||||
const isAsync = /async/.test(target)
|
||||
|
||||
// generate dynamic entry based on glob files
|
||||
const resolvedFiles = require('globby').sync([entry], { cwd: api.resolve('.') })
|
||||
const resolvedFiles = require('globby').sync(entry.split(','), { cwd: api.resolve('.') })
|
||||
|
||||
if (!resolvedFiles.length) {
|
||||
abort(`entry pattern "${entry}" did not match any files.`)
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
// This file is imported into lib/wc client bundles.
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
var currentScript = window.document.currentScript
|
||||
if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {
|
||||
require('current-script-polyfill')
|
||||
var getCurrentScript = require('@soda/get-current-script')
|
||||
currentScript = getCurrentScript()
|
||||
|
||||
// for backward compatibility, because previously we directly included the polyfill
|
||||
if (!('currentScript' in document)) {
|
||||
Object.defineProperty(document, 'currentScript', { get: getCurrentScript })
|
||||
}
|
||||
}
|
||||
|
||||
var i
|
||||
if ((i = window.document.currentScript) && (i = i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) {
|
||||
__webpack_public_path__ = i[1] // eslint-disable-line
|
||||
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
|
||||
if (src) {
|
||||
__webpack_public_path__ = src[1] // eslint-disable-line
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-service",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "local service for vue-cli projects",
|
||||
"main": "lib/Service.js",
|
||||
"typings": "types/index.d.ts",
|
||||
@@ -25,27 +25,27 @@
|
||||
"dependencies": {
|
||||
"@intervolga/optimize-cssnano-plugin": "^1.0.5",
|
||||
"@soda/friendly-errors-webpack-plugin": "^1.7.1",
|
||||
"@vue/cli-overlay": "^4.2.3",
|
||||
"@vue/cli-plugin-router": "^4.2.3",
|
||||
"@vue/cli-plugin-vuex": "^4.2.3",
|
||||
"@vue/cli-shared-utils": "^4.2.3",
|
||||
"@soda/get-current-script": "^1.0.0",
|
||||
"@vue/cli-overlay": "^4.3.1",
|
||||
"@vue/cli-plugin-router": "^4.3.1",
|
||||
"@vue/cli-plugin-vuex": "^4.3.1",
|
||||
"@vue/cli-shared-utils": "^4.3.1",
|
||||
"@vue/component-compiler-utils": "^3.0.2",
|
||||
"@vue/preload-webpack-plugin": "^1.1.0",
|
||||
"@vue/web-component-wrapper": "^1.2.0",
|
||||
"acorn": "^7.1.0",
|
||||
"acorn-walk": "^7.0.0",
|
||||
"acorn-walk": "^7.1.1",
|
||||
"address": "^1.1.2",
|
||||
"autoprefixer": "^9.7.4",
|
||||
"browserslist": "^4.8.6",
|
||||
"autoprefixer": "^9.7.5",
|
||||
"browserslist": "^4.11.1",
|
||||
"cache-loader": "^4.1.0",
|
||||
"case-sensitive-paths-webpack-plugin": "^2.3.0",
|
||||
"cli-highlight": "^2.1.4",
|
||||
"clipboardy": "^2.1.0",
|
||||
"clipboardy": "^2.3.0",
|
||||
"cliui": "^6.0.0",
|
||||
"copy-webpack-plugin": "^5.1.1",
|
||||
"css-loader": "^3.4.2",
|
||||
"cssnano": "^4.1.10",
|
||||
"current-script-polyfill": "^1.0.0",
|
||||
"debug": "^4.1.1",
|
||||
"default-gateway": "^5.0.5",
|
||||
"dotenv": "^8.2.0",
|
||||
@@ -60,20 +60,20 @@
|
||||
"lodash.mapvalues": "^4.6.0",
|
||||
"lodash.transform": "^4.6.0",
|
||||
"mini-css-extract-plugin": "^0.9.0",
|
||||
"minimist": "^1.2.0",
|
||||
"pnp-webpack-plugin": "^1.6.0",
|
||||
"minimist": "^1.2.5",
|
||||
"pnp-webpack-plugin": "^1.6.4",
|
||||
"portfinder": "^1.0.25",
|
||||
"postcss-loader": "^3.0.0",
|
||||
"ssri": "^7.1.0",
|
||||
"terser-webpack-plugin": "^2.3.4",
|
||||
"terser-webpack-plugin": "^2.3.5",
|
||||
"thread-loader": "^2.1.3",
|
||||
"url-loader": "^2.2.0",
|
||||
"vue-loader": "^15.8.3",
|
||||
"vue-loader": "^15.9.1",
|
||||
"vue-style-loader": "^4.1.2",
|
||||
"webpack": "^4.0.0",
|
||||
"webpack-bundle-analyzer": "^3.6.0",
|
||||
"webpack-chain": "^6.3.1",
|
||||
"webpack-dev-server": "^3.10.2",
|
||||
"webpack-bundle-analyzer": "^3.6.1",
|
||||
"webpack-chain": "^6.4.0",
|
||||
"webpack-dev-server": "^3.10.3",
|
||||
"webpack-merge": "^4.2.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@@ -101,12 +101,12 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"fibers": ">= 3.1.1 <5.0.0",
|
||||
"sass": "^1.25.0",
|
||||
"sass": "^1.26.3",
|
||||
"sass-loader": "^8.0.2",
|
||||
"vue": "^2.6.11",
|
||||
"vue-router": "^3.1.5",
|
||||
"vue-router": "^3.1.6",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"vuex": "^3.1.2"
|
||||
"vuex": "^3.1.3"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
||||
@@ -19,3 +19,10 @@
|
||||
exports.chalk = require('chalk')
|
||||
exports.execa = require('execa')
|
||||
exports.semver = require('semver')
|
||||
|
||||
Object.defineProperty(exports, 'installedBrowsers', {
|
||||
enumerable: true,
|
||||
get () {
|
||||
return exports.getInstalledBrowsers()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -136,7 +136,7 @@ const _npmProjects = new LRU({
|
||||
})
|
||||
exports.hasProjectNpm = (cwd) => {
|
||||
if (_npmProjects.has(cwd)) {
|
||||
return true
|
||||
return _npmProjects.get(cwd)
|
||||
}
|
||||
|
||||
const lockFile = path.join(cwd, 'package-lock.json')
|
||||
@@ -156,7 +156,8 @@ let hasCheckedBrowsers = false
|
||||
function tryRun (cmd) {
|
||||
try {
|
||||
return execSync(cmd, {
|
||||
stdio: [0, 'pipe', 'ignore']
|
||||
stdio: [0, 'pipe', 'ignore'],
|
||||
timeout: 10000
|
||||
}).toString().trim()
|
||||
} catch (e) {
|
||||
return ''
|
||||
@@ -177,44 +178,41 @@ function getMacAppVersion (bundleIdentifier) {
|
||||
}
|
||||
}
|
||||
|
||||
Object.defineProperty(exports, 'installedBrowsers', {
|
||||
enumerable: true,
|
||||
get () {
|
||||
if (hasCheckedBrowsers) {
|
||||
return browsers
|
||||
}
|
||||
hasCheckedBrowsers = true
|
||||
|
||||
if (exports.isLinux) {
|
||||
browsers.chrome = getLinuxAppVersion('google-chrome')
|
||||
browsers.firefox = getLinuxAppVersion('firefox')
|
||||
} else if (exports.isMacintosh) {
|
||||
browsers.chrome = getMacAppVersion('com.google.Chrome')
|
||||
browsers.firefox = getMacAppVersion('org.mozilla.firefox')
|
||||
} else if (exports.isWindows) {
|
||||
// get chrome stable version
|
||||
// https://stackoverflow.com/a/51773107/2302258
|
||||
const chromeQueryResult = tryRun(
|
||||
'reg query "HKLM\\Software\\Google\\Update\\Clients\\{8A69D345-D564-463c-AFF1-A69D9E530F96}" /v pv /reg:32'
|
||||
) || tryRun(
|
||||
'reg query "HKCU\\Software\\Google\\Update\\Clients\\{8A69D345-D564-463c-AFF1-A69D9E530F96}" /v pv /reg:32'
|
||||
)
|
||||
if (chromeQueryResult) {
|
||||
const matched = chromeQueryResult.match(/REG_SZ\s+(\S*)$/)
|
||||
browsers.chrome = matched && matched[1]
|
||||
}
|
||||
|
||||
// get firefox version
|
||||
// https://community.spiceworks.com/topic/111518-how-to-determine-version-of-installed-firefox-in-windows-batchscript
|
||||
const ffQueryResult = tryRun(
|
||||
'reg query "HKLM\\Software\\Mozilla\\Mozilla Firefox" /v CurrentVersion'
|
||||
)
|
||||
if (ffQueryResult) {
|
||||
const matched = ffQueryResult.match(/REG_SZ\s+(\S*)$/)
|
||||
browsers.firefox = matched && matched[1]
|
||||
}
|
||||
}
|
||||
|
||||
exports.getInstalledBrowsers = () => {
|
||||
if (hasCheckedBrowsers) {
|
||||
return browsers
|
||||
}
|
||||
})
|
||||
hasCheckedBrowsers = true
|
||||
|
||||
if (exports.isLinux) {
|
||||
browsers.chrome = getLinuxAppVersion('google-chrome')
|
||||
browsers.firefox = getLinuxAppVersion('firefox')
|
||||
} else if (exports.isMacintosh) {
|
||||
browsers.chrome = getMacAppVersion('com.google.Chrome')
|
||||
browsers.firefox = getMacAppVersion('org.mozilla.firefox')
|
||||
} else if (exports.isWindows) {
|
||||
// get chrome stable version
|
||||
// https://stackoverflow.com/a/51773107/2302258
|
||||
const chromeQueryResult = tryRun(
|
||||
'reg query "HKLM\\Software\\Google\\Update\\Clients\\{8A69D345-D564-463c-AFF1-A69D9E530F96}" /v pv /reg:32'
|
||||
) || tryRun(
|
||||
'reg query "HKCU\\Software\\Google\\Update\\Clients\\{8A69D345-D564-463c-AFF1-A69D9E530F96}" /v pv /reg:32'
|
||||
)
|
||||
if (chromeQueryResult) {
|
||||
const matched = chromeQueryResult.match(/REG_SZ\s+(\S*)$/)
|
||||
browsers.chrome = matched && matched[1]
|
||||
}
|
||||
|
||||
// get firefox version
|
||||
// https://community.spiceworks.com/topic/111518-how-to-determine-version-of-installed-firefox-in-windows-batchscript
|
||||
const ffQueryResult = tryRun(
|
||||
'reg query "HKLM\\Software\\Mozilla\\Mozilla Firefox" /v CurrentVersion'
|
||||
)
|
||||
if (ffQueryResult) {
|
||||
const matched = ffQueryResult.match(/REG_SZ\s+(\S*)$/)
|
||||
browsers.firefox = matched && matched[1]
|
||||
}
|
||||
}
|
||||
|
||||
return browsers
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-shared-utils",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "shared utilities for vue-cli packages",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -29,7 +29,7 @@
|
||||
"open": "^6.3.0",
|
||||
"ora": "^3.4.0",
|
||||
"read-pkg": "^5.1.1",
|
||||
"request": "^2.87.0",
|
||||
"request": "^2.88.2",
|
||||
"request-promise-native": "^1.0.8",
|
||||
"semver": "^6.1.0",
|
||||
"strip-ansi": "^6.0.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-test-utils",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "test utilities for vue-cli packages",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-ui-addon-webpack",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue-cli.git",
|
||||
@@ -18,26 +18,27 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^4.2.3",
|
||||
"@vue/cli-plugin-eslint": "^4.2.3",
|
||||
"@vue/cli-service": "^4.2.3",
|
||||
"@vue/eslint-config-standard": "^5.1.0",
|
||||
"@vue/cli-plugin-babel": "^4.3.1",
|
||||
"@vue/cli-plugin-eslint": "^4.3.1",
|
||||
"@vue/cli-service": "^4.3.1",
|
||||
"@vue/eslint-config-standard": "^5.1.2",
|
||||
"core-js": "^3.6.4",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-import": "^2.20.1",
|
||||
"eslint-plugin-node": "^11.0.0",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^4.2.1",
|
||||
"eslint-plugin-standard": "^4.0.0",
|
||||
"eslint-plugin-vue": "^6.1.2",
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
"stylus": "^0.54.7",
|
||||
"stylus-loader": "^3.0.2",
|
||||
"vue-progress-path": "^0.0.2",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"vuex": "^3.1.2"
|
||||
"vuex": "^3.1.3"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions"
|
||||
"last 2 versions",
|
||||
"not dead"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
> 1%
|
||||
last 2 versions
|
||||
not dead
|
||||
|
||||
@@ -8,8 +8,8 @@ module.exports = {
|
||||
'@vue/standard'
|
||||
],
|
||||
rules: {
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
|
||||
},
|
||||
parserOptions: {
|
||||
parser: 'babel-eslint'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-ui-addon-widgets",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue-cli.git",
|
||||
@@ -18,17 +18,17 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^4.2.3",
|
||||
"@vue/cli-plugin-eslint": "^4.2.3",
|
||||
"@vue/cli-service": "^4.2.3",
|
||||
"@vue/eslint-config-standard": "^5.1.0",
|
||||
"@vue/cli-plugin-babel": "^4.3.1",
|
||||
"@vue/cli-plugin-eslint": "^4.3.1",
|
||||
"@vue/cli-service": "^4.3.1",
|
||||
"@vue/eslint-config-standard": "^5.1.2",
|
||||
"core-js": "^3.6.4",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-import": "^2.20.1",
|
||||
"eslint-plugin-node": "^11.0.0",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^4.2.1",
|
||||
"eslint-plugin-standard": "^4.0.0",
|
||||
"eslint-plugin-vue": "^6.1.2",
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
"stylus": "^0.54.7",
|
||||
"stylus-loader": "^3.0.2",
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
|
||||
@@ -299,7 +299,7 @@
|
||||
"bare": "Scaffold project without beginner instructions",
|
||||
"git-title": "Git repository",
|
||||
"git": "Initialize git repository (recommended)",
|
||||
"git-commit-message": "Initial commit message (optional)"
|
||||
"git-commit-message": "Overwrite commit message (optional)"
|
||||
}
|
||||
},
|
||||
"buttons": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-ui",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue-cli.git",
|
||||
@@ -35,8 +35,8 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@akryum/winattr": "^3.0.0",
|
||||
"@vue/cli-shared-utils": "^4.2.3",
|
||||
"apollo-server-express": "^2.9.6",
|
||||
"@vue/cli-shared-utils": "^4.3.1",
|
||||
"apollo-server-express": "^2.11.0",
|
||||
"clone": "^2.1.1",
|
||||
"deepmerge": "^4.2.2",
|
||||
"express": "^4.17.1",
|
||||
@@ -46,7 +46,7 @@
|
||||
"globby": "^9.2.0",
|
||||
"graphql": "^14.6.0",
|
||||
"graphql-subscriptions": "^1.1.0",
|
||||
"graphql-tag": "^2.9.2",
|
||||
"graphql-tag": "^2.10.3",
|
||||
"graphql-type-json": "^0.3.1",
|
||||
"javascript-stringify": "^1.6.0",
|
||||
"js-yaml": "^3.13.1",
|
||||
@@ -58,48 +58,48 @@
|
||||
"parse-git-config": "^2.0.2",
|
||||
"portfinder": "^1.0.25",
|
||||
"prismjs": "^1.19.0",
|
||||
"rss-parser": "^3.7.4",
|
||||
"rss-parser": "^3.7.6",
|
||||
"shortid": "^2.2.15",
|
||||
"typescript": "~3.7.5",
|
||||
"typescript": "~3.8.3",
|
||||
"vue-cli-plugin-apollo": "^0.21.3",
|
||||
"watch": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^4.2.3",
|
||||
"@vue/cli-plugin-e2e-cypress": "^4.2.3",
|
||||
"@vue/cli-plugin-eslint": "^4.2.3",
|
||||
"@vue/cli-service": "^4.2.3",
|
||||
"@vue/eslint-config-standard": "^5.1.0",
|
||||
"@vue/cli-plugin-babel": "^4.3.1",
|
||||
"@vue/cli-plugin-e2e-cypress": "^4.3.1",
|
||||
"@vue/cli-plugin-eslint": "^4.3.1",
|
||||
"@vue/cli-service": "^4.3.1",
|
||||
"@vue/eslint-config-standard": "^5.1.2",
|
||||
"@vue/ui": "^0.9.2",
|
||||
"ansi_up": "^3.0.0",
|
||||
"apollo-client": "^2.6.0",
|
||||
"apollo-link": "^1.0.0",
|
||||
"babel-eslint": "^10.0.3",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"core-js": "^3.6.4",
|
||||
"cross-env": "^6.0.3",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-graphql": "^3.1.0",
|
||||
"eslint-plugin-import": "^2.20.1",
|
||||
"eslint-plugin-node": "^11.0.0",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^4.2.1",
|
||||
"eslint-plugin-standard": "^4.0.0",
|
||||
"eslint-plugin-vue": "^6.1.2",
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
"lint-staged": "^9.5.0",
|
||||
"lodash.debounce": "^4.0.8",
|
||||
"portal-vue": "^1.3.0",
|
||||
"rimraf": "^3.0.1",
|
||||
"start-server-and-test": "^1.10.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"start-server-and-test": "^1.10.11",
|
||||
"stylus": "^0.54.5",
|
||||
"stylus-loader": "^3.0.1",
|
||||
"subscriptions-transport-ws": "^0.9.6",
|
||||
"vue": "^2.6.11",
|
||||
"vue-apollo": "^3.0.3",
|
||||
"vue-color": "^2.4.6",
|
||||
"vue-i18n": "^8.15.1",
|
||||
"vue-color": "^2.7.1",
|
||||
"vue-i18n": "^8.16.0",
|
||||
"vue-instantsearch": "^1.5.1",
|
||||
"vue-meta": "^1.6.0",
|
||||
"vue-observe-visibility": "^0.4.6",
|
||||
"vue-router": "^3.1.5",
|
||||
"vue-router": "^3.1.6",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"vue-timeago": "^5.1.2",
|
||||
"vue-virtual-scroller": "^1.0.0-rc.2",
|
||||
@@ -107,7 +107,8 @@
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions"
|
||||
"last 2 versions",
|
||||
"not dead"
|
||||
],
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -279,7 +279,7 @@ module.exports = api => {
|
||||
{
|
||||
name: 'dest',
|
||||
type: 'input',
|
||||
default: 'dist',
|
||||
default: '',
|
||||
description: 'org.vue.vue-webpack.tasks.build.dest'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
const path = require('path')
|
||||
const execa = require('execa')
|
||||
|
||||
const CLI_PATH = path.resolve(__dirname, '..', 'bin', 'vue.js')
|
||||
|
||||
const runAsync = async args => await execa(CLI_PATH, args)
|
||||
|
||||
test('suggests matching command', async () => {
|
||||
const { stdout } = await runAsync(['confgi'])
|
||||
expect(stdout).toContain('Did you mean config?')
|
||||
})
|
||||
@@ -21,7 +21,8 @@ const {
|
||||
saveOptions,
|
||||
loadOptions,
|
||||
savePreset,
|
||||
validatePreset
|
||||
validatePreset,
|
||||
rcPath
|
||||
} = require('./options')
|
||||
|
||||
const {
|
||||
@@ -309,8 +310,9 @@ module.exports = class Creator extends EventEmitter {
|
||||
validatePreset(preset)
|
||||
|
||||
// save preset
|
||||
if (answers.save && answers.saveName) {
|
||||
savePreset(answers.saveName, preset)
|
||||
if (answers.save && answers.saveName && savePreset(answers.saveName, preset)) {
|
||||
log()
|
||||
log(`🎉 Preset ${chalk.yellow(answers.saveName)} saved in ${chalk.yellow(rcPath)}`)
|
||||
}
|
||||
|
||||
debug('vue-cli:preset')(preset)
|
||||
|
||||
@@ -2,6 +2,7 @@ const fs = require('fs')
|
||||
const path = require('path')
|
||||
const {
|
||||
chalk,
|
||||
execa,
|
||||
semver,
|
||||
|
||||
log,
|
||||
@@ -12,19 +13,17 @@ const {
|
||||
isPlugin,
|
||||
resolvePluginId,
|
||||
|
||||
loadModule
|
||||
loadModule,
|
||||
resolveModule
|
||||
} = require('@vue/cli-shared-utils')
|
||||
|
||||
const tryGetNewerRange = require('./util/tryGetNewerRange')
|
||||
const getPkg = require('./util/getPkg')
|
||||
const PackageManager = require('./util/ProjectPackageManager')
|
||||
|
||||
const { runMigrator } = require('./migrate')
|
||||
|
||||
function clearRequireCache () {
|
||||
Object.keys(require.cache).forEach(key => delete require.cache[key])
|
||||
}
|
||||
|
||||
module.exports = class Upgrader {
|
||||
constructor (context = process.cwd()) {
|
||||
this.context = context
|
||||
@@ -108,28 +107,39 @@ module.exports = class Upgrader {
|
||||
|
||||
log(`Upgrading ${packageName} from ${installed} to ${targetVersion}`)
|
||||
await this.pm.upgrade(`${packageName}@~${targetVersion}`)
|
||||
// as the dependencies have now changed, the require cache must be invalidated
|
||||
// otherwise it may affect the behavior of the migrator
|
||||
clearRequireCache()
|
||||
|
||||
// The cached `pkg` field won't automatically update after running `this.pm.upgrade`.
|
||||
// Also, `npm install pkg@~version` won't replace the original `"pkg": "^version"` field.
|
||||
// So we have to manually update `this.pkg` and write to the file system in `runMigrator`
|
||||
this.pkg[depEntry][packageName] = `~${targetVersion}`
|
||||
const noop = () => {}
|
||||
|
||||
const pluginMigrator =
|
||||
loadModule(`${packageName}/migrator`, this.context) || noop
|
||||
const resolvedPluginMigrator =
|
||||
resolveModule(`${packageName}/migrator`, this.context)
|
||||
|
||||
await runMigrator(
|
||||
this.context,
|
||||
{
|
||||
id: packageName,
|
||||
apply: pluginMigrator,
|
||||
baseVersion: installed
|
||||
},
|
||||
this.pkg
|
||||
)
|
||||
if (resolvedPluginMigrator) {
|
||||
// for unit tests, need to run migrator in the same process for mocks to work
|
||||
// TODO: fix the tests and remove this special case
|
||||
if (process.env.VUE_CLI_TEST) {
|
||||
clearRequireCache()
|
||||
await require('./migrate').runMigrator(
|
||||
this.context,
|
||||
{
|
||||
id: packageName,
|
||||
apply: loadModule(`${packageName}/migrator`, this.context),
|
||||
baseVersion: installed
|
||||
},
|
||||
this.pkg
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
const cliBin = path.resolve(__dirname, '../bin/vue.js')
|
||||
// Run migrator in a separate process to avoid all kinds of require cache issues
|
||||
await execa('node', [cliBin, 'migrate', packageName, '--from', installed], {
|
||||
cwd: this.context,
|
||||
stdio: 'inherit'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async getUpgradable (includeNext) {
|
||||
|
||||
@@ -94,6 +94,7 @@ exports.saveOptions = toSave => {
|
||||
cachedOptions = options
|
||||
try {
|
||||
fs.writeFileSync(rcPath, JSON.stringify(options, null, 2))
|
||||
return true
|
||||
} catch (e) {
|
||||
error(
|
||||
`Error saving preferences: ` +
|
||||
@@ -106,5 +107,5 @@ exports.saveOptions = toSave => {
|
||||
exports.savePreset = (name, preset) => {
|
||||
const presets = cloneDeep(exports.loadOptions().presets || {})
|
||||
presets[name] = preset
|
||||
exports.saveOptions({ presets })
|
||||
return exports.saveOptions({ presets })
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ function getPackageJson (projectPath) {
|
||||
try {
|
||||
packageJson = fs.readFileSync(packagePath, 'utf-8')
|
||||
} catch (err) {
|
||||
throw new Error(`${packagePath} not exist`)
|
||||
throw new Error(`The package.json file at '${packagePath}' does not exist`)
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "Command line interface for rapid Vue.js development",
|
||||
"bin": {
|
||||
"vue": "bin/vue.js"
|
||||
@@ -24,32 +24,32 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/cli-shared-utils": "^4.2.3",
|
||||
"@vue/cli-ui": "^4.2.3",
|
||||
"@vue/cli-ui-addon-webpack": "^4.2.3",
|
||||
"@vue/cli-ui-addon-widgets": "^4.2.3",
|
||||
"@vue/cli-shared-utils": "^4.3.1",
|
||||
"@vue/cli-ui": "^4.3.1",
|
||||
"@vue/cli-ui-addon-webpack": "^4.3.1",
|
||||
"@vue/cli-ui-addon-widgets": "^4.3.1",
|
||||
"boxen": "^4.1.0",
|
||||
"cmd-shim": "^3.0.3",
|
||||
"commander": "^2.20.0",
|
||||
"debug": "^4.1.0",
|
||||
"deepmerge": "^4.2.2",
|
||||
"download-git-repo": "^1.0.2",
|
||||
"download-git-repo": "^3.0.2",
|
||||
"ejs": "^2.7.1",
|
||||
"envinfo": "^7.5.0",
|
||||
"fs-extra": "^7.0.1",
|
||||
"globby": "^9.2.0",
|
||||
"import-global": "^0.1.0",
|
||||
"inquirer": "^6.3.1",
|
||||
"isbinaryfile": "^4.0.0",
|
||||
"inquirer": "^7.1.0",
|
||||
"isbinaryfile": "^4.0.5",
|
||||
"javascript-stringify": "^1.6.0",
|
||||
"js-yaml": "^3.13.1",
|
||||
"jscodeshift": "^0.7.0",
|
||||
"leven": "^3.1.0",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"lru-cache": "^5.1.1",
|
||||
"minimist": "^1.2.0",
|
||||
"recast": "^0.18.1",
|
||||
"resolve": "^1.15.0",
|
||||
"minimist": "^1.2.5",
|
||||
"recast": "^0.18.8",
|
||||
"resolve": "^1.15.1",
|
||||
"shortid": "^2.2.15",
|
||||
"slash": "^3.0.0",
|
||||
"validate-npm-package-name": "^3.0.0",
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "vue-cli-version-marker",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"description": "version marker for @vue/cli",
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"main": "package.json",
|
||||
"devDependencies": {
|
||||
"@vue/cli": "^4.2.3"
|
||||
"@vue/cli": "^4.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user