Skip to content

build: sync jsr.jsonc version with package.json#674

Open
antongolub wants to merge 1 commit intoeemeli:mainfrom
antongolub-forks:jsr-v-sync
Open

build: sync jsr.jsonc version with package.json#674
antongolub wants to merge 1 commit intoeemeli:mainfrom
antongolub-forks:jsr-v-sync

Conversation

@antongolub
Copy link

closes #672

Copy link
Owner

@eemeli eemeli left a comment

Choose a reason for hiding this comment

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

This looks great; I'd not considered this approach to ensuring that the JSR version is kept up to date.

If/as it makes sense to update the jsr.jsonc "version" value like this, the in-repo value of the jsr.jsonc "version" to be set to something that was clearly not the current version, and easier to search/replace for.

- uses: actions/checkout@v4
- name: Sync version to jsr.jsonc
run: |
node -e "
Copy link
Owner

Choose a reason for hiding this comment

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

Using ' single quotes outside and " double quotes inside would be clearer, and help ensure that ` or $ characters aren't assigned a bash meaning.

Comment on lines +27 to +28
/(\"version\"\s*:\s*\")([^\"]+)(\")/,
\`$1\${pkgVersion}$3\`
Copy link
Owner

Choose a reason for hiding this comment

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

A lookbehind assertion would simplify things here.

Suggested change
/(\"version\"\s*:\s*\")([^\"]+)(\")/,
\`$1\${pkgVersion}$3\`
/(?<="version"\s*:\s*")[^\"]+/,
pkgVersion

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.

bug: JSR channel is out of sync with npm

2 participants