Commit Graph

182 Commits

Author SHA1 Message Date
Mike
74ca541e27 Improve package.json not found error  (#5238) 2020-03-07 00:23:08 +01:00
Cédric Exbrayat
5cb988cb27 fix(GeneratorAPI): remove warning when using extendPackage with prune (#5202)
Currently, if we use `api.extendPackage({foo: null}, {prune: true})` the dependency is removed but a warning is logged as the range is invalid:

```
 WARN  invalid version range for dependency "foo":

- null injected by generator "my-plugin"
```
2020-02-27 11:10:14 +08:00
Haoqun Jiang
51a4da7e9f fix: should infer package manager from config if there's no lockfile in the project (#5150)
* fix: should infer package manager from config if there's no lockfile in the project

* fixup! fix: should infer package manager from config if there's no lockfile in the project
2020-02-06 16:25:28 +08:00
Haoqun Jiang
f5f4de0aa3 feat(GeneratorAPI): allow passing options to api.extendPackage (#5149)
Currently, 3 options are implemented:

- options.prune (defaults to `false`) - Remove null or undefined
fields from the object after merging.
- options.merge (defaults to `true`) deep-merge nested fields, note
that dependency fields are always deep merged regardless of this option.
- options.warnIncompatibleVersions (defaults to `true`) Output warning
if two dependency version ranges don't intersect.

Closes #4779
2020-02-06 14:28:00 +08:00
Haoqun Jiang
e4410b8e8d fixup! fix: fix duplicate slash in metadata url 2020-02-05 14:45:10 +08:00
Haoqun Jiang
813680eced fix: should use the local version number if the cache falls behind 2020-02-05 14:39:52 +08:00
Haoqun Jiang
e1b8519183 fix: fix duplicate slash in metadata url 2020-02-05 14:31:22 +08:00
Haoqun Jiang
773f8a47e9 feat: lock minor versions when creating projects / adding plugins (#5134)
* feat: lock minor versions when creating projects / adding plugins

closes #5012

* refactor: also calculate latestMinor version

* feat: support add packages with tilde version range

* refactor: make the `runCommand` invocations more concise

* refactor: use the `getVersions` utility function to get latestMinor

* feat: when adding plugins, use tilde range by default

* fix: allow empty args
2020-02-04 16:26:32 +08:00
Haoqun Jiang
76c173693e fix: correctly catch errors of offline install 2020-02-01 14:41:14 +08:00
Haoqun Jiang
eeb1491c64 test: use offline install for test projects (for vue upgrade) 2020-02-01 14:26:53 +08:00
Haoqun Jiang
170e63ecfc test: don't check for taobao registry during tests 2020-02-01 14:10:11 +08:00
Haoqun Jiang
02a0e8a187 feat: vue upgrade monorepo support, --from option, and a new vue migrate --from command (#5091)
* refactor(migrator): rename `installed` to `baseVersion`

* feat: `vue upgrade --from` option and a new `vue migrate` command

* fix: fix support for `vuePlugins.resolveFrom` option

* chore: add a fixme comment

* fix: use loadModule instead of manually calculating the package.json path

This also fixes support for monorepo.
(TODO: tests)

* fix: treat `resolveFrom` as `context`, fixing edge cases

* fix: use read-pkg instead of loadModule, avoid messing up require cache

* fix: getInstalledVersion still requires `loadModule` to support monorepo
2020-01-28 16:32:35 +08:00
Haoqun Jiang
b049e999d7 refactor: use env variables to set registry for package managers (#5110)
also fixes compatibility with Yarn 2
2020-01-27 20:03:50 +08:00
Haoqun Jiang
97650b7ef9 refactor: extract the utility to detect changed files in git 2020-01-16 21:23:13 +08:00
Haoqun Jiang
d7cbe5f0f1 refactor: use a plain http request to get package metadata (#5045)
* refactor: use a plain http request to get package metadata

fixes #4895
fixes #4995

* chore: add link to the package metadata documentation
2020-01-13 19:25:38 +05:30
Pavan Kumar Sunkara
1c269d22f5 fix: extendPackage object values should be string (#5038) 2020-01-13 21:22:21 +08:00
Haoqun Jiang
f7b95acb9b fix: should download to different directories for different pre… (#4922)
fixes #4778
2019-12-12 21:08:09 +05:30
Haoqun Jiang
1a0b59142a refactor: use dependencies from @vue/cli-share-utils whenver possible 2019-11-29 15:41:18 +08:00
Haoqun Jiang
b7f83b45ce fix: support parser option for codemods, and enable ts parsing by default (#4883)
fixes #4861
2019-11-26 15:52:50 +08:00
Haoqun Jiang
2565c5d07e feat: support binary mirrors for taobao registry (#4767)
* feat: support binary mirrors for taobao registry

fixes issues like #4718

* fix: only install cypress 3, for now

* fix: do not override user defined `CYPRESS_INSTALL_BINARY` env
2019-11-01 23:39:56 +08:00
Haoqun Jiang
964fad5968 fix: should tolerate cli version check error (#4741)
* fix: should tolerate cli version check error

* fix: add the error message after the DEBUG indicator
2019-10-22 19:08:32 +08:00
Haoqun Jiang
5d2c8da754 refactor: replace --disturl option with NODEJS_ORG_MIRROR env variable
for better compatibility with pnpm 4 (which does not allow the
`--disturl` option)
2019-10-16 13:18:14 +08:00
B4rtware
badf63d7f0 fix: add pnpm v4 support (#4677)
* fix: add pnpm v4 support

in pnpm v4 the option '--loglevel' is no longer available instead '--reporter' is used.

* refactor: remove 'v' from PNPM constants for linting

* refactor: rename variable

* fix: typo in _hasPnpm4orLater

Co-Authored-By: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>

* refactor: reduce the amount of duplicate code for pnpm version check

* refactor: remove return-assignment

* refactor: add explicit return value instead of using array access

Co-Authored-By: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>

* fix: remove return value from checkPnpmVersion

* fix: pnpmVersion variable

* refactor: cache pnpm version number

* refactor: fix function name and revert api break

* fix: function call correction

* refactor: export hasPnpmVersionOrLater and use this in favor of hasPnpm4OrLater

* refactor: move cache getter into getPnpmVersion

* refactor: add comment

* refactor: remove comment
2019-10-16 13:15:58 +08:00
Maël Nison
3aa513ace5 Add a variant for config get registry (#4530)
* Update shouldUseTaobao.js

* Fixes linting
2019-10-11 22:01:07 +02:00
Phan An
81d0245dd6 chore: better upgrade messages (#3926)
* chore: better upgrade messages

* feat: try to find the right command to update
2019-10-11 15:34:22 +08:00
Yingya Zhang
8869a01d48 feat: support custom package manager (#4621)
Closes #4483

* feat: support custom package manager

* feat: refine warning msg for unknown package manager

* feat: refine blank lines

* feat: refine warning msg for unknown package manager

* feat: refine warning msg for unknown package manager
2019-09-30 14:01:43 +08:00
Haoqun Jiang
ed2b888782 Revert "feat: allow custom packageManager other than npm/yarn/p… (#4632)
This reverts commit e0f846984a.
2019-09-30 14:00:31 +08:00
Yingya Zhang
e0f846984a feat: allow custom packageManager other than npm/yarn/pnpm (#4620)
Closes #4483
2019-09-30 13:59:21 +08:00
Cédric Exbrayat
cd91c0f650 docs: remove run for yarn commands in readme (#4551) 2019-09-08 01:47:20 +08:00
Haoqun Jiang
e585fc3881 fix: sortObject should not introduce formerly non-existent fields 2019-09-04 01:17:28 +08:00
Cédric Exbrayat
267aa67cf6 fix: remove the nonexistent test command from generated README (#4525)
Closes #4478
2019-09-03 00:31:11 +08:00
Haoqun Jiang
7384c6292e chore: skip confirmIfGitDirty in API MODE (for now) 2019-08-08 10:40:48 +08:00
Haoqun Jiang
29b93834f8 refactor: extract Upgrader to a standalone file for easier testing 2019-08-04 22:29:33 +08:00
Haoqun Jiang
c76d2e691d style: add a "no-shadow" linter rule (#4385)
It has become a common source of mistakes.
For example, during PR #4363 I've referred to the wrong `options`
several times due to the variable shadowing.
2019-08-02 18:24:52 +08:00
Haoqun Jiang
45cad0c7e3 fix: when executing multiple actions, only check git status once (#4332) 2019-07-22 22:19:10 +08:00
Haoqun Jiang
debc3f19b2 fix: fix latest version check when current version is a prerelease (#4295) 2019-07-16 23:31:00 +08:00
Haoqun Jiang
44325fa16e chore: fix prompt message 2019-07-15 21:49:30 +08:00
Haoqun Jiang
4af27247cc refactor: unify package manager related logic (#4256) 2019-07-13 00:29:39 +08:00
Haoqun Jiang
7fc0f842e8 feat!: confirm for uncommitted changes before add/invoke/upgrade (#4275) 2019-07-12 20:04:08 +08:00
Pavan Kumar Sunkara
246ae678cb feat!: make router a separate plugin (#4196)
* refactor: move router to its own plugin

* refactor: rename routerHistoryMode option to historyMode

* test: add @vue/cli-plugin-router tests

* feat: change src/router.js for most common use cases

* fix: fix cli-ui tests

* docs: Remove router root option from docs

* fix: add support for legacy router option
2019-07-05 23:21:29 +08:00
Haoqun Jiang
867c6eaf2c feat!: redesigns vue upgrade, supports code migration (#4090) 2019-07-02 16:23:34 +08:00
Haoqun Jiang
273d05fe08 style: fix lint errors 2019-06-28 22:15:09 +08:00
James George
934746da7f chore: minor refactor (#4205)
eliminate redundancy
2019-06-28 21:58:34 +08:00
Haoqun Jiang
af25ef75ce feat: make injectImports & injectRootOptions work for .vue files (#4168)
closes #1702
2019-06-21 17:20:53 +08:00
Haoqun Jiang
8283f46d0b fix: fix config merging during vue invoke in Node.js v12 (#4148)
The root cause here is the same as #4095
The failing `loadModule` call will return `undefined` for a js config
read operation, which later caused config being overwritten.
2019-06-15 13:23:05 +08:00
Haoqun Jiang
2e417b01d2 refactor: replace recast with jscodeshift for injectImportsAndOptions (#4003)
fixes #3309
2019-05-17 14:58:31 +08:00
Haoqun Jiang
f4e6c33044 chore!: default to dart sass for sass option of cssPreprocessor (#3921)
BREAKING CHANGE:
Preset generated before v3.4.0 may contain a `"cssPreprocessor": "sass"`
field. It now means dart-sass rather than node-sass.

`rootOptions.cssPreprocessor === 'sass'` now also means dart sass.
May affect those generator plugins who depends on this field
2019-04-30 23:33:37 +08:00
Haoqun Jiang
208a99728c fix: revert javascript-stringify to 1.x 2019-04-30 19:22:21 +08:00
Haoqun Jiang
a6fb9af614 fix: javascript-stringify v2 has changed its exports 2019-04-30 18:23:08 +08:00
Haoqun Jiang
6740ca363d fix: should add --shamefully-flatten for pnpm install 2019-04-11 16:38:59 +08:00