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

Add workflows that publish to JSR #19

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Add workflows that publish to JSR #19

wants to merge 14 commits into from

Conversation

taras
Copy link
Member

@taras taras commented Oct 4, 2024

Motivation

We want our packages to be available from JSR and other repositories.

Approach

Configure to publish each public workspace to JSR using the a GitHub Workflow

@@ -1,4 +1,4 @@
import { run, sleep, spawn, type Task } from "effection";
import { run, sleep, spawn, type Task } from "npm:effection@3.0.3";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we hard code to effection v3.0.3 in the import map, shouldn't this just be "effection"?

@@ -11,7 +11,7 @@ import {
spawn,
type Task,
useScope,
} from "effection";
} from "npm:effection@3.0.3";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. We updated the import map, but then we aren't using it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the import map because scopes can only be defined in root - it was needed to specify effection dependency for the files imported from the effection website. I'm thinking that I should publish those dependencies from the effection website to JSR instead. What do you think?

@cowboyd
Copy link
Member

cowboyd commented Oct 5, 2024

@taras How is "when to publish" handled? In our other repos, we look for the appearance of a tag matching a pattern. Does JSR automatically handle idempotent publishes? I.e. if you publish twice with the same version number, it's just a no-op?

@taras
Copy link
Member Author

taras commented Oct 5, 2024

Does JSR automatically handle idempotent publishes?

Yes, it does. It's a no-op for already published versions.

@cowboyd
Copy link
Member

cowboyd commented Oct 6, 2024

Is it worth tagging each module? Or is the idea that we're a little more fast and loose.

@taras
Copy link
Member Author

taras commented Oct 6, 2024

Is it worth tagging each module?

can we tag individual modules?

@cowboyd
Copy link
Member

cowboyd commented Oct 6, 2024

Is it worth tagging each module?

can we tag individual modules?

We could if we wanted to, and since we'll be releasing different versions of different modules, it would be nice to have a task-buffer-v3.0.3 so that if you want to get to that particular point version, it's very easy to find.

Copy link
Member

@cowboyd cowboyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to publish on tag pushes, not main, right? I.e. cache-v1.0.0

@cowboyd
Copy link
Member

cowboyd commented Nov 24, 2024

Also, we need to replicate to npm somehow. That's going to be critical to providing access to the ecosystem. We don't have to do it in this PR, but we should figure out how it's going to work.

@taras
Copy link
Member Author

taras commented Nov 25, 2024

Might be able to use this to publish to NPM https://github.com/ryoppippi/mirror-jsr-to-npm

GitHub
a tool designed to mirror packages from JSR to NPM - ryoppippi/mirror-jsr-to-npm

@cowboyd
Copy link
Member

cowboyd commented Nov 25, 2024

Might be able to use this to publish to NPM https://github.com/ryoppippi/mirror-jsr-to-npm

GitHub**GitHub - ryoppippi/mirror-jsr-to-npm: a tool designed to mirror packages from JSR to NPM**a tool designed to mirror packages from JSR to NPM - ryoppippi/mirror-jsr-to-npm

This looks like almost exactly what we need. It has a tag publish, then to jsr, then to npm.

One thing though is that for node shims we may still need to have a DNT step....

GitHub
a tool designed to mirror packages from JSR to NPM - ryoppippi/mirror-jsr-to-npm

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

Successfully merging this pull request may close these issues.

2 participants