Skip to content

Replace npm version with a custom implementation #13488

@pomek

Description

@pomek

Provide a description of the task

❓ Why

  • At some point, npm changed its behavior of the npm version command.
  • Before, it just upgraded a package version in package.json.
  • Now, it also checks if its dependencies are correctly defined.
  • Usually, I need to downgrade npm to 8.5.5 to release packages using CKEditor 5 release tools.
  • Let's drop the usage of npm version to avoid issues.

💡 What

  • The npm version command is executed for each package that will be released.
  • npm version executes set of commands.
     graph LR;
         A[npm preversion] --> B;
         B(bump version) --> C;
         C[npm version] --> D[npm postversion];
    
    Loading
    • preversion, version and postversion can be specified as npm scripts.
    • The bump version task is a default behavior and cannot be modified.
  • Let's drop the execution of npm version. Instead, we implement custom flow of running npm scripts for the backward compatibility:
    • Check if preversion exists. If so, execute its script.
    • Update a version in a package.json.
    • Check if version exists. If so, execute its script.
    • Check if postversion exists. If so, execute its script.
  • We decided to use npm version and change the flow. First, we need to bump the package version, then, its dependencies.

Metadata

Metadata

Assignees

Labels

package:devsquad:platformIssue to be handled by the Platform team.type:taskThis issue reports a chore (non-production change) and other types of "todos".

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions