rrd108 / vue-mess-detector

A static code analysis tool for detecting code smells and best practice violations in Vue.js and Nuxt.js projects
MIT License
226 stars 9 forks source link

Publish on jsr #7

Open rrd108 opened 5 months ago

rrd108 commented 5 months ago

https://jsr.io/@rrd/vue-mess-detector

rrd108 commented 1 month ago

@brenoepics can you look into this. I have tried quite a few variations but it always fails

brenoepics commented 1 month ago

Hi, what is wrong with this?

rrd108 commented 1 month ago

the jsr publish fails. I modified a lot but still fails with different errors.

For example: https://github.com/rrd108/vue-mess-detector/actions/runs/11221618034/job/31192321609

brenoepics commented 1 month ago

I fixed the action in a fork and managed to publish it, I've never used jsr, I don't know if I'm doing it wrong, but I believe that pnpm, npm... doesn't recognize @username/package as a command and tries to download it from npm central.

example

  1. publish to jsr
  2. npx jsr add @brenoepics/testing
  3. npx @brenoepics/testing analyze

Upon observing this, I thought about searching for jsr commands to see if there were any similar to a dlx, unfortunately, there aren't, I found an issue related to this. https://github.com/jsr-io/jsr/issues/157

rrd108 commented 1 month ago

https://jsr.io/docs/publishing-packages#publishing-from-github-actions

Here is the detailed info how to do this

brenoepics commented 1 month ago

publishing is easy, actually it was just missing the node setup step, but running bin commands seems not possible. working example:

name: JSR Publish

on:
  release:
    types: [ created ]

jobs:
  publish:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write # The OIDC ID token is used for authentication with JSR.
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: yarn

      - run: |
          yarn install
          npx jsr publish --allow-dirty
rrd108 commented 1 month ago

on the new release it did not detected the version number bump, so the publish did not happened.

brenoepics commented 1 month ago

The version bump was in the same commit as the tag/release? as far as I remember, there are 3 release events: (or 4 idk if synchronize is one of them)

  release:
    types: [created, edited, published]

if the bump tag is in the same commit, you might want the published one?

rrd108 commented 1 month ago

no, the bump comes after the tag release

rrd108 commented 1 month ago

As I see it works but we are one relaese behind on jsr

I think I should change the jsr.json update in my release script, but I am nt sure how