Skip to content

Commit

Permalink
update actions (#69)
Browse files Browse the repository at this point in the history
* update actions

* remove eslint matcher

* rename job to test
  • Loading branch information
mbostock authored Jun 3, 2024
1 parent 720eb23 commit 03d890d
Show file tree
Hide file tree
Showing 12 changed files with 410 additions and 418 deletions.
7 changes: 0 additions & 7 deletions .eslintrc.json

This file was deleted.

18 changes: 0 additions & 18 deletions .github/eslint.json

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/node.js.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish

on:
workflow_dispatch: {}
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- run: yarn --frozen-lockfile
- run: yarn test
- run: yarn lint
- run: yarn build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- run: yarn --frozen-lockfile
- run: yarn test
- run: yarn lint
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*.sublime-workspace
.DS_Store
dist/
node_modules
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2010-2022 Mike Bostock
Copyright 2010-2024 Mike Bostock

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
Expand Down
12 changes: 12 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import js from "@eslint/js";
import globals from "globals";

export default [
js.configs.recommended,
{
files: ["test/**/*"],
languageOptions: {
globals: globals.mocha
}
}
];
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@
"d3-array": "2 - 3"
},
"devDependencies": {
"eslint": "8",
"mocha": "10",
"rollup": "3",
"rollup-plugin-terser": "7"
"@rollup/plugin-terser": "^0.4.4",
"eslint": "^9.4.0",
"globals": "^15.3.0",
"mocha": "^10.4.0",
"rollup": "^4.18.0"
},
"scripts": {
"test": "TZ=America/Los_Angeles mocha 'test/**/*-test.js' && eslint src test",
"prepublishOnly": "rm -rf dist && yarn test && rollup -c",
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd -"
"lint": "eslint src test",
"build": "rm -rf dist && rollup -c"
},
"engines": {
"node": ">=12"
Expand Down
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {readFileSync} from "fs";
import {terser} from "rollup-plugin-terser";
import meta from "./package.json" assert {type: "json"};
import terser from "@rollup/plugin-terser";
import meta from "./package.json" with {type: "json"};

// Extract copyrights from the LICENSE.
const copyright = readFileSync("./LICENSE", "utf-8")
Expand Down
10 changes: 0 additions & 10 deletions test/.eslintrc.json

This file was deleted.

Loading

0 comments on commit 03d890d

Please sign in to comment.