Skip to content

Running vue upgrade changes package.json structure #5577

Closed
@mcfarljw

Description

@mcfarljw

Version

4.4.4

Reproduction link

https://github.com/mcfarljw/vue-cli-upgrade-issue

Environment info

System:
    OS: macOS 10.15.5
    CPU: (20) x64 Intel(R) Xeon(R) W-2150B CPU @ 3.00GHz
  Binaries:
    Node: 12.16.3 - ~/.nvm/versions/node/v12.16.3/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v12.16.3/bin/npm
  Browsers:
    Chrome: 84.0.4147.45
    Edge: 83.0.478.45
    Firefox: 77.0.1
    Safari: 13.1.1
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0 
    @vue/babel-plugin-transform-vue-jsx:  1.1.2 
    @vue/babel-preset-app:  4.4.4 
    @vue/babel-preset-jsx:  1.1.2 
    @vue/babel-sugar-functional-vue:  1.1.2 
    @vue/babel-sugar-inject-h:  1.1.2 
    @vue/babel-sugar-v-model:  1.1.2 
    @vue/babel-sugar-v-on:  1.1.2 
    @vue/cli-overlay:  4.4.4 
    @vue/cli-plugin-babel: ^4.4.4 => 4.4.4 
    @vue/cli-plugin-e2e-cypress: ^4.4.4 => 4.4.4 
    @vue/cli-plugin-pwa: ^4.4.4 => 4.4.4 
    @vue/cli-plugin-router: ^4.4.4 => 4.4.4 
    @vue/cli-plugin-typescript: ^4.4.4 => 4.4.4 
    @vue/cli-plugin-unit-mocha: ^4.4.4 => 4.4.4 
    @vue/cli-plugin-vuex: ^4.4.4 => 4.4.4 
    @vue/cli-service: ^4.4.4 => 4.4.4 
    @vue/cli-shared-utils:  4.4.4 
    @vue/component-compiler-utils:  3.1.2 
    @vue/preload-webpack-plugin:  1.1.1 
    @vue/test-utils: ^1.0.3 => 1.0.3 
    @vue/web-component-wrapper:  1.2.0 
    typescript: ~3.9.3 => 3.9.5 
    vue: ^2.6.11 => 2.6.11 
    vue-class-component: ^7.2.3 => 7.2.3 
    vue-hot-reload-api:  2.3.4 
    vue-loader:  15.9.2 
    vue-property-decorator: ^8.4.2 => 8.4.2 
    vue-router: ^3.2.0 => 3.3.3 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.6.11 => 2.6.11 
    vue-template-es2015-compiler:  1.9.1 
    vuex: ^3.4.0 => 3.4.0 
  npmGlobalPackages:
    @vue/cli: 4.4.4

Steps to reproduce

  1. Run vue upgrade

What is expected?

Only the updated dependencies get altered in the package.json file. Everything not relating to the upgrade should not be touched.

What is actually happening?

Other things get moved around in the package.json file. In the provided github example the build property gets moved below devDependencies and the copy script gets moved to the end of the object.


I realize this isn't a major issue, but for people who have additional properties/scripts in their package.json file that have been organized in a specific way this produces unnecessary changes to that file each time an upgrade is performed. The workaround is to just not use the official vue upgrade utility and just manually update the dependencies.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions