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

Should not overwrite workspace:* when release ( pnpm workspace ) #48

Closed
7 of 9 tasks
zigang93 opened this issue Jun 14, 2024 · 5 comments
Closed
7 of 9 tasks

Should not overwrite workspace:* when release ( pnpm workspace ) #48

zigang93 opened this issue Jun 14, 2024 · 5 comments
Labels
bot: closed c: bug Something isn't working s: pending triage Pending Triage

Comments

@zigang93
Copy link

zigang93 commented Jun 14, 2024

Pre-Checks

Describe the bug

I wonder how to prevent overwrite workspace:*?

example:
package-a ( v1.0.0 )

app's package.json after release
"package-a": "workspace:*" to "package-a": "1.0.0"

Minimal reproduction code

No response

Additional Context

No response

Environment Info

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M1
    Memory: 41.81 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
    pnpm: 9.1.1 - ~/.nvm/versions/node/v20.9.0/bin/pnpm
    bun: 1.0.25 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 126.0.6478.61
    Safari: 17.5
  npmPackages:
    @anolilab/multi-semantic-release: ^1.1.3 => 1.1.3 
    @anolilab/semantic-release-pnpm: ^1.1.3 => 1.1.3

Which module system do you use?

  • CJS
  • ESM

Used Package Manager

pnpm

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@zigang93 zigang93 added c: bug Something isn't working s: pending triage Pending Triage labels Jun 14, 2024
Copy link
Contributor

It looks like this is your first issue. Welcome! 👋 One of the project maintainers will be with you as soon as possible. We appreciate your patience. To safeguard the health of the project, please take a moment to read our code of conduct.

@zigang93 zigang93 changed the title Should not overwrite workspace:* when release ( pnpm workspace ) Should not overwrite workspace:* when release ( pnpm workspace ) Jun 14, 2024
@prisis
Copy link
Member

prisis commented Jun 14, 2024

Hey @zigang93, this not really possible, the npm registry needs this version information to know how to handle npm packages dependencies.

One "maybe" working way would be that you could add a new step after semantic-release that rewrites the version that was add before the "semantic-release-git" do a push to your repo back.

Or you can use the pnpm overwrite in you root package.json to make this overwrite so this will work like the "workspace:*" in you packages

Example:

    "pnpm": {
        "overrides": {
            "@visulima/pail": "workspace:*",
        },
    },

ref qiwi/multi-semantic-release#95

@prisis prisis closed this as completed Jun 14, 2024
@zigang93
Copy link
Author

@prisis I don't care about npm register to publish, all my app/package is private. how can I just do some patch? can u help me which line of code to stop this behavior? I can use pnpm patch to do so

@prisis
Copy link
Member

prisis commented Jun 17, 2024

Hey :), it should be around this function

const bumpDependency = (scope, name, nextVersion) => {
// eslint-disable-next-line security/detect-object-injection
const currentVersion = scope[name];
if (!nextVersion || !currentVersion) {
return false;
}
// eslint-disable-next-line no-use-before-define
const resolvedVersion = resolveNextVersion(currentVersion, nextVersion, bumpStrategy, prefix);
if (currentVersion !== resolvedVersion) {
// eslint-disable-next-line no-param-reassign,security/detect-object-injection
scope[name] = resolvedVersion;
return true;
}
return false;
};

Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using our GitHub Discussions tab for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bot: closed c: bug Something isn't working s: pending triage Pending Triage
Projects
None yet
Development

No branches or pull requests

2 participants