Skip to content

Community migration helper: vuex-module-decorators → plain Vuex modules #421

@maxxborer

Description

@maxxborer

Hi there,

It looks like this project hasn’t received updates in a few years. As a result, teams that still depend on vuex-module-decorators face friction when upgrading to modern Vuex versions (and then on pinia).

To help with this, I created an automated migration script that transforms modules using vuex-module-decorators into plain Vuex 4 modules. This script handles:

  • removal of vuex-module-decorators imports
  • conversion of class-based modules (@Module, decorators) into standard Vuex object form
  • rewriting this.* references in actions/getters/mutations to Vuex context style
  • cleanup of ts-ignore comments and helper functions
  • other necessary transforms for a smoother migration

Here’s the script:
https://gist.github.com/maxxborer/f04d8f9d6d03a1e364fdfd3407485d31

Feel free to link to it from the README or issue template so others can benefit from a path off this deprecated package.

This is a one-off solution that I won't be supporting. If anyone wants to create and maintain something like a CLI based on it, I'd be happy to help (you can just link to the original Gist to make me happy, but it's not required).

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions