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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing does not replace workspace:* version #246

Open
emmenko opened this issue Dec 20, 2022 · 8 comments
Open

Publishing does not replace workspace:* version #246

emmenko opened this issue Dec 20, 2022 · 8 comments

Comments

@emmenko
Copy link
Contributor

emmenko commented Dec 20, 2022

Hi 馃憢

I started using the workspace: protocol in one of my repos but noticed that when publishing the version didn't get replaced, ending up with a broken release.

image

Is this a known issue? Is there anything that I'm missing that I need to configure?

Thanks


I'm using Yarn v3.

My github action is configured like this:

- name: Creating release pull request or publishing release to npm registry
  id: changesets
  # uses: changesets/action@v1.3.0
  uses: dotansimha/changesets-action@v1.3.3
  with:
    publish: yarn changeset publish
    version: yarn changeset:version-and-format
    commit: 'ci(changesets): version packages'
    createGithubReleases: aggregate
    githubReleaseName: v${{ steps.release_version.outputs.VALUE }}
    githubTagName: v${{ steps.release_version.outputs.VALUE }}
  env:
    GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
    SKIP_POSTINSTALL_DEV_SETUP: true

My Changesets config is configured like this.

@trivikr
Copy link
Contributor

trivikr commented Jan 30, 2023

Looks like this issue was reported earlier, but no response:

@Andarist
Copy link
Member

This is being fixed by changesets/changesets#674 - unfortunately, I couldn't find time to finish that work.

@mkurapov
Copy link

@emmenko does it work if you replace "package": "workspace:*" with the actual version of the workspace dependency, ie: "package": "workspace:1.0.0"? Changesets should end up bumping the workspace dependency version automatically when running changeset version, e.g. "package": "workspace:1.0.1"

@adesso-os
Copy link

When you specify the actual version number, then that version number is pulled during installation and placed into node_modules. Usually, developers don't want that. They want the actual project from the other workspace linked into NM. That is what workspace:* provides, but then changesets breaks.

@mkurapov
Copy link

@adesso-os

then that version number is pulled during installation and placed into node_modules

This is true for "package": "1.0.0", which will install from the registry, but it should still be linked locally if using the workspace protocol (while specifying a specific version), eg. "package": "workspace:1.0.0". (unless I'm misunderstanding here)

@unional
Copy link

unional commented Jun 4, 2023

workspace:^

@arthurfiorette
Copy link

Hey folks! I could get everything working fine by using this custom release script:

"ci:publish": "pnpm publish -r --access public && changeset tag",

In case someone actually wants to see it in action:

https://github.com/kitajs/kitajs/blob/e96dc95033e58c9a3a49ab8246ebc085b83a937b/.github/workflows/main.yml#L59
https://github.com/kitajs/kitajs/blob/e96dc95033e58c9a3a49ab8246ebc085b83a937b/package.json#L21

workspace:^, dependencies, scoped packages and github releases are working 馃檹.

@arthurfiorette
Copy link

Appearently the above does not works uses the correct dist-tag when publishing...

image

As you can see, the version 4.0.0-next.0 wasn't published with the next tag. That's not a problem as you can change this manually with the npm dist-tag add @kitajs/html@4.0.0-next.0 next and npm dist-tag add @kitajs/html@3.1.2 latest commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants