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

feat: JSR package #271

Merged
merged 5 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,17 @@ jobs:
run: npm install eslint@${{ matrix.eslint }}
- name: Test
run: npm run test
jsr_test:
name: Verify JSR Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install Packages
run: npm install
- name: Run --dry-run
run: |
npm run build
npm run test:jsr
9 changes: 8 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,20 @@ jobs:
node-version: lts/*
registry-url: https://registry.npmjs.org
if: ${{ steps.release.outputs.release_created }}
- run: |
- name: Publish to npm
run: |
npm install
npm run build --if-present
npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
- name: Publish to JSR
run: |
npm run build --if-present
npx jsr publish
if: ${{ steps.release.outputs.release_created }}

- run: 'npx @humanwhocodes/tweet "eslint/markdown v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released: ${{ steps.release.outputs.html_url }}"'
if: ${{ steps.release.outputs.release_created }}
env:
Expand Down
16 changes: 16 additions & 0 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "@eslint/markdown",
"version": "6.0.0",
"exports": "./dist/esm/index.js",
"publish": {
"include": [
"dist/esm/index.js",
"dist/esm/index.d.ts",
"dist/esm/types.ts",
nzakas marked this conversation as resolved.
Show resolved Hide resolved
nzakas marked this conversation as resolved.
Show resolved Hide resolved
"dist/esm/types.d.ts",
"README.md",
"jsr.json",
"LICENSE"
]
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"build:rules": "node tools/build-rules.js",
"build": "npm run build:rules && rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json",
"prepare": "node ./npm-prepare.cjs && npm run build",
"test": "c8 mocha \"tests/**/*.test.js\" --timeout 30000"
"test": "c8 mocha \"tests/**/*.test.js\" --timeout 30000",
"test:jsr": "npx jsr@latest publish --dry-run"
},
"devDependencies": {
"@eslint/core": "^0.3.0",
Expand Down
10 changes: 9 additions & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
"release-type": "node",
"pull-request-title-pattern": "chore: release ${version} 🚀",
"include-component-in-tag": false,
"extra-files": ["src/index.js", "src/processor.js"]
"extra-files": [
"src/index.js",
"src/processor.js",
{
"type": "json",
"path": "jsr.json",
"jsonpath": "$.version"
}
]
}
}
}