Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace npm version with a custom implementation #13488

Closed
pomek opened this issue Feb 16, 2023 · 1 comment
Closed

Replace npm version with a custom implementation #13488

pomek opened this issue Feb 16, 2023 · 1 comment
Assignees
Labels
package:dev squad:devops Issue to be handled by the Devops team. type:task This issue reports a chore (non-production change) and other types of "todos".

Comments

@pomek
Copy link
Member

pomek commented Feb 16, 2023

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.
@pomek pomek added type:task This issue reports a chore (non-production change) and other types of "todos". squad:devops Issue to be handled by the Devops team. package:dev labels Feb 16, 2023
@pomek
Copy link
Member Author

pomek commented Feb 22, 2023

Related issue: npm/cli#4588.

It turns out that adding the --no-workspaces-update flag resolves the issue.

@pomek pomek self-assigned this Feb 22, 2023
@CKEditorBot CKEditorBot added the status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. label Feb 22, 2023
@CKEditorBot CKEditorBot removed the status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. label Feb 22, 2023
@CKEditorBot CKEditorBot added this to the iteration 61 milestone Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:dev squad:devops Issue to be handled by the Devops team. type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
Development

No branches or pull requests

2 participants