Skip to content

Commit a13ebb9

Browse files
authored
upgrades (#148)
* upgrades * add publish.yml * update links
1 parent f3cb310 commit a13ebb9

37 files changed

+1082
-944
lines changed

.eslintrc.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/eslint.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/node.js.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish
2+
3+
on:
4+
workflow_dispatch: {}
5+
release:
6+
types: [published]
7+
8+
permissions:
9+
id-token: write
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
- uses: actions/setup-node@v6
18+
with:
19+
node-version: 24
20+
registry-url: 'https://registry.npmjs.org'
21+
cache: yarn
22+
- run: yarn --frozen-lockfile
23+
- run: yarn test
24+
- run: yarn lint
25+
- run: npm publish

.github/workflows/test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v6
14+
- uses: actions/setup-node@v6
15+
with:
16+
node-version: 24
17+
cache: yarn
18+
- run: yarn --frozen-lockfile
19+
- run: yarn test
20+
- run: yarn lint

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2010-2021 Mike Bostock
1+
Copyright 2010-2026 Mike Bostock
22

33
Permission to use, copy, modify, and/or distribute this software for any purpose
44
with or without fee is hereby granted, provided that the above copyright notice

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ This module formats numbers for human consumption, with a consistent output allo
77
## Resources
88

99
- [Documentation](https://d3js.org/d3-format)
10-
- [Examples](https://observablehq.com/collection/@d3/d3-format)
10+
- [Examples](https://observablehq.com/@d3/d3-format)
1111
- [Releases](https://github.com/d3/d3-format/releases)
1212
- [Getting help](https://d3js.org/community)

eslint.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import {defineConfig} from "eslint/config";
4+
5+
export default defineConfig([
6+
{files: ["**/*.{js,ts,jsx,tsx}"], plugins: {js}, extends: ["js/recommended"]},
7+
{files: ["**/*.{js,ts,jsx,tsx}"], languageOptions: {globals: globals.browser}}
8+
]);

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,16 @@
3939
"./src/defaultLocale.js"
4040
],
4141
"devDependencies": {
42-
"eslint": "8",
43-
"mocha": "9",
44-
"rollup": "2",
45-
"rollup-plugin-terser": "7"
42+
"@rollup/plugin-terser": "^0.4.4",
43+
"eslint": "^9.39.2",
44+
"globals": "^17.0.0",
45+
"rollup": "^4.55.1",
46+
"vitest": "^4.0.17"
4647
},
4748
"scripts": {
48-
"test": "mocha 'test/**/*-test.js' && eslint src test",
49-
"prepublishOnly": "rm -rf dist && yarn test && rollup -c",
50-
"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 -"
49+
"test": "vitest",
50+
"lint": "eslint src test",
51+
"prepublishOnly": "rm -rf dist && rollup -c"
5152
},
5253
"engines": {
5354
"node": ">=12"

rollup.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {readFileSync} from "fs";
2-
import {terser} from "rollup-plugin-terser";
3-
import * as meta from "./package.json";
1+
import {readFileSync} from "node:fs";
2+
import terser from "@rollup/plugin-terser";
3+
import meta from "./package.json" with {type: "json"};
44

55
// Extract copyrights from the LICENSE.
66
const copyright = readFileSync("./LICENSE", "utf-8")

0 commit comments

Comments
 (0)