Skip to content
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
7 changes: 0 additions & 7 deletions .eslintrc.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]

permissions:
id-token: write
contents: read

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
with:
version: 10
- uses: actions/setup-node@v7
with:
node-version: 24
cache: pnpm
- run: pnpm install
- run: pnpm run test
- run: pnpm run lint
- run: npm publish
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test

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

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
with:
version: 10
- uses: actions/setup-node@v7
with:
node-version: 24
cache: pnpm
- run: pnpm install
- run: pnpm run test
- run: pnpm run lint
4 changes: 0 additions & 4 deletions .npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2013-2021 Mike Bostock
Copyright 2013-2026 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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This module contains the quaternion & versor functions. For a directly usable pa
In Node:

```js
const versor = require("versor");
import versor from "versor";

// interpolate angles (slerp), see https://observablehq.com/@d3/world-tour
versor.interpolate(rotation0, rotation1); // function of (t)
Expand Down Expand Up @@ -52,11 +52,11 @@ versor.rotation(q01); // [90, 0, 90]

```

If you use npm, `npm install versor`. You can also download the [latest release on GitHub](https://github.com/d3/versor/releases/latest). For vanilla HTML in modern browsers, import versor from Skypack:
If you use npm, `npm install versor`. You can also download the [latest release on GitHub](https://github.com/d3/versor/releases/latest). For vanilla HTML in modern browsers, import versor from esm.sh:

```html
<script type="module">
import versor from "https://cdn.skypack.dev/versor@0.2";
import versor from "https://esm.sh/versor@0.2";
const t = versor([90,0,0]);
</script>
```
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";
import {defineConfig} from "eslint/config";

export default defineConfig([
{ignores: ["dist/"]},
{files: ["**/*.{js,ts}"], plugins: {js}, extends: ["js/recommended"]},
{files: ["src/**/*.{js,ts}"], languageOptions: {globals: globals.browser}},
{files: ["test/**/*.js"], languageOptions: {globals: globals.node}},
{languageOptions: {ecmaVersion: 2019, sourceType: "module"}},
{files: ["rollup.config.js"], languageOptions: {ecmaVersion: 2026}}
]);
37 changes: 22 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "versor",
"version": "0.2.0",
"version": "0.2.1",
"description": "Versor",
"homepage": "https://github.com/Fil/versor",
"homepage": "https://github.com/d3/versor",
"repository": {
"type": "git",
"url": "https://github.com/Fil/versor.git"
"url": "https://github.com/d3/versor.git"
},
"keywords": [
"d3",
Expand All @@ -19,27 +19,34 @@
"url": "https://github.com/mbostock"
},
"type": "module",
"module": "src/index.js",
"main": "src/index.js",
"files": [
"dist/**/*.js",
"dist/**/*.mjs"
],
"module": "dist/versor.mjs",
"main": "dist/versor.mjs",
"jsdelivr": "dist/versor.min.js",
"unpkg": "dist/versor.min.js",
"exports": {
"umd": "./dist/versor.min.js",
"default": "./src/index.js"
"default": "./dist/versor.mjs"
},
"dependencies": {},
"sideEffects": false,
"devDependencies": {
"eslint": "7",
"mocha": "8",
"rollup": "2",
"rollup-plugin-terser": "5"
"@eslint/js": "^10.0.1",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-terser": "^1.0.2",
"eslint": "^10.14.0",
"globals": "^17.14.0",
"rollup": "^4.67.4",
"vitest": "^5.1.0"
},
"scripts": {
"test": "mocha 'test/**/*-test.js' && eslint src test",
"prepublishOnly": "rm -rf dist && yarn test && rollup -c"
"test": "vitest",
"lint": "eslint",
"prepublishOnly": "rm -rf dist && rollup -c"
},
"engines": {
"node": ">=12"
},
"jsnext:main": "src/index.js"
}
}
Loading