Skip to content
Open
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
25 changes: 11 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
name: "Publish Package"
name: Publish Package to npmjs

on:
release:
types: [published]

jobs:
release:
name: publish
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org

- name: Publish to npm
run: npm publish --access public
node-version: "22.x"
registry-url: "https://registry.npmjs.org"
- run: npm publish --force --provenance --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
37 changes: 29 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"test": "npm-run-all build test:copy-css test:run",
"test:copy-css": "postcss dist/charts.min.css --use postcss-pseudo-element-colons --no-map --output tests/playwright/charts.min.css",
"test:snapshots": "playwright test --update-snapshots --trace off",
"test:run": "playwright test -c tests/playwright.config.ts"
"test:run": "playwright test -c tests/playwright.config.ts",
"prepublishOnly": "node prepublish"
},
"repository": {
"type": "git",
Expand All @@ -44,6 +45,7 @@
},
"devDependencies": {
"@playwright/test": "^1.37.1",
"@types/node": "^22.18.6",
"autoprefixer": "^10.4.14",
"browserslist-config-baseline": "^0.4.0",
"cssnano": "^6.0.1",
Expand Down
6 changes: 6 additions & 0 deletions prepublish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { writeFileSync } from 'node:fs';
import _pkg from './package.json' with { type: 'json' };

const { browserslist, ...pkg } = _pkg;

writeFileSync('./package.json', JSON.stringify(pkg, null, ' ') + '\n');