Commit Graph

173 Commits

Author SHA1 Message Date
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
Haoqun Jiang
94f3ca0e91 fix: better pnpm check
1. separate project pnpm check and global pnpm check
2. rename hasPnpm to hasPnpm3OrLater
2019-04-11 16:38:49 +08:00
Haoqun Jiang
cb113971e2 feat: do not write undefined fields to config files (#3643)
closes #3058
2019-04-09 00:49:12 +08:00
robertkruis
a02ef3988f feat: support PNPM as a package manager (#1531)
Enables vue-cli to use PNPM (https://pnpm.js.org/) as package manager
2019-04-09 00:43:47 +08:00
Haoqun Jiang
6a750564a8 fix: should check yarn when no pacakage manager specified
(`shouldUseTaobao` is called without arguments in `getPackageVersion`)

fixes #3393
2019-01-31 14:40:13 +08:00
Haoqun Jiang
9c1e797ac6 feat: support dart-sass as default sass implementation (#3321) 2019-01-28 18:51:55 +08:00
musicq
5d1ab5fe9c refactor: check support package manager befor install (#3368) 2019-01-28 11:02:36 +08:00
Haoqun Jiang
108d8011b3 fix: fix injectImports when there's no pre-existing import declarations
closes #2925
2019-01-18 16:12:37 +08:00
Haoqun Jiang
ae2a9bc145 fix: fix typo 2018-12-04 20:51:57 +08:00
Haoqun Jiang
31ffcfe0ca feat: new release strategy (#3020)
## Summary
- Keep package minors in sync (`lerna publish --force-publish` when releasing a new minor)
- Patch on demand (`lerna publish` fixed mode)
- `eslint-config-*` packages are published manually

## Longer Description
1. We used to force publish every package till v3.1, this is due to the unbalanced update frequency among different plugins. In practice, some of them, like the pwa plugin, are quite stable and rarely need updating. So force publishing is overkill now.
2. We have switched to independent mode then, for two major benefits: 1) patching on demand and only on demand 2) eslint config packages needs a more aggressive update strategy in practice, due to the frequent breaking changes in the upstream packages. However, this also causes maintenance burden and confusion to end users. So it's far from ideal.
3. So now we choose to go back fixed versioning. By default lerna would skip untouched packages when publishing a new version. This might be confusing as we think. So to reduce the cognitive load, we still keep each package's minor field in sync.

## Implementation Detail

1. To selectively publish packages, we have to disable `useWorkspaces` in lerna so that these packages can be linked by yarn while being unrecognizable to lerna.
2. Due to an oversight in the old version checking code, version fields in `vue-cli-version-marker` needs to be exact versions, otherwise cli will throw on startup. So we have to publish `vue-cli-version-marker` manually after other package updates. This logic can be removed once all users have been upgrade to 3.2.0+ and we can then add it back to `packages` in `lerna.json`
3. We now use `~/.vuerc` to cache version check results. This also fixes #2956
2018-11-28 02:12:05 +08:00