Skip to content

Commit

Permalink
migrate to bun
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbrinkman committed Nov 21, 2024
1 parent c3f1061 commit a2d2d0c
Show file tree
Hide file tree
Showing 53 changed files with 87 additions and 8,789 deletions.
10 changes: 2 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# Yarn #
# Node #
########
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

node_modules
# Cache #
#########
.cache
Expand Down
894 changes: 0 additions & 894 deletions .yarn/releases/yarn-4.3.0.cjs

This file was deleted.

Empty file removed .yarn/versions/02acf2ae.yml
Empty file.
Empty file removed .yarn/versions/215e0b9e.yml
Empty file.
Empty file removed .yarn/versions/9535566a.yml
Empty file.
1 change: 0 additions & 1 deletion .yarnrc.yml

This file was deleted.

30 changes: 19 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Removed

- Removed non esm builds

## [1.1.0] - 2023-09-30

### Added
Expand All @@ -23,7 +29,7 @@ too difficult.
This is a rough overview of the next three sections.

- The old static dag data structure has been upgraded to a dynamic graph
structure. This includes a lof of changes:
structure. This includes a lof of changes:
- `Graph` and `GraphNode` aren't iterable, you must call `.nodes()` to get an
iterator.
- `Graph#nodes()` no longer has traversal order. To get someting similar to "before"
Expand Down Expand Up @@ -147,10 +153,11 @@ This is a rough overview of the next three sections.
### Changed

- Some exported operator interface names were renamed to include their type of operator in the name, e.g. `SimplexOperator` was renamed to `SimplexLayeringOperator`.
This is to prevent future name conflicts and standardize the exported intreface as some operators already required the name change.
This is to prevent future name conflicts and standardize the exported intreface as some operators already required the name change.
- `zherebko` now functions similarly to `sugiyama` in that it handles a node size and includes that padding, rather than pushing coordinates right to 0,0.

### Removed

- In order to reduce bundle size, methods no longer return custom fluent iterables that allow mapping an reducing.
You'll need to import a fluent iterable library of choice (e.g. [`lfi`](https://www.npmjs.com/package/lfi)).

Expand Down Expand Up @@ -189,10 +196,11 @@ Most of the breaking changes are in the backend, so if you've only been using th
- The definition of Dag changed from being a union of `DagNode` and `DagRoot`, to just being a subset of `DagNode` without the local node operations.
This is arguably a cleaner api, but will change the behavior of things like conditional types.
- The definition of `TwolayerOperator` must now support going bottom to top.
- Layout* (e.g. `LayoutDagNode`) has been completely isolated, so it's impossible to create dags manually without implementing the interface yourself.
- Layout\* (e.g. `LayoutDagNode`) has been completely isolated, so it's impossible to create dags manually without implementing the interface yourself.
The purpose is to enforce that dags remain dags, and most operators can be do by clever application of the construction methods (see `sugify`).

### Removed

- The arquint layout was removed.
The removal makes me sad, but with the drastic rearchitecture of the library, supporting the arquint layout was too difficult.
If possible, I would like to bring it back.
Expand Down Expand Up @@ -226,19 +234,19 @@ Most of the breaking changes are in the backend, so if you've only been using th
### Changed

- The type parameters for the `SugiyamaOperator` were changed to only contain the operators.
This only matters if you referenced an operator with its types attached (e.g. `layout: SugiyamaOperator<NodeType, ...> = ...`). All of the individual attribute modifier functions retained their generic signatures.
- The typing for most operators changed to more easily allow adding new typed
attributes later on. `sugiyama` went from being typed like
`sugiyama<NodeType, LayeringType, DecrossType, ...>` to
`sugiyama<NodeType, { layering: LayeringType, decross: DecrosType, ... }>`.
To update, you'll need to change these declarations.
This only matters if you referenced an operator with its types attached (e.g. `layout: SugiyamaOperator<NodeType, ...> = ...`). All of the individual attribute modifier functions retained their generic signatures.
- The typing for most operators changed to more easily allow adding new typed
attributes later on. `sugiyama` went from being typed like
`sugiyama<NodeType, LayeringType, DecrossType, ...>` to
`sugiyama<NodeType, { layering: LayeringType, decross: DecrosType, ... }>`.
To update, you'll need to change these declarations.

## [0.5.0] - 2020-11-17

### Changed

- The sugiyama layout was entirely rewritten. Instead of defaulting to fitting
nodes into [0, 1] in x and y, it now features a `nodeSize` accessor. Nodes
nodes into [0, 1] in x and y, it now features a `nodeSize` accessor. Nodes
are spaced out to respect their nodeSizes, along x coordinates this is exact,
the y coordinates will respect the max height in each layer. As a result of
the this change, there is no longer a separation accessor, as the role of
Expand All @@ -247,7 +255,7 @@ Most of the breaking changes are in the backend, so if you've only been using th
script), it now return an object with the dag, as well as the width and
height of the final dag, including "padding" for node sizes. The default size
of dummy nodes is [0, 0]. To get back to almost the old behavior, you can
still specify a `size`. This will rescale everything, but still keep the
still specify a `size`. This will rescale everything, but still keep the
outside padding.

## [0.4.0] - 2020-09-17
Expand Down
13 changes: 0 additions & 13 deletions babel.config.json

This file was deleted.

Binary file added bun.lockb
Binary file not shown.
79 changes: 0 additions & 79 deletions bundle.mjs

This file was deleted.

75 changes: 0 additions & 75 deletions bundle.test.ts

This file was deleted.

72 changes: 23 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,23 @@
"email": "[email protected]"
},
"license": "MIT",
"module": "bundle/d3-dag.esm.min.js",
"types": "dist/index.d.ts",
"main": "bundle/d3-dag.cjs.min.js",
"unpkg": "bundle/d3-dag.iife.min.js",
"type": "module",
"module": "dist/d3-dag.esm.min.js",
"files": [
"/bundle/*.js",
"/dist/**/*.js",
"/dist/**/*.d.ts"
],
"scripts": {
"fmt": "pnpify prettier --write --cache '{src,test-d}/**/*.ts' '*.json' 'examples/*.json' bundle.test.ts bundle.mjs flow.mjs eslint.config.mjs",
"lint:ts": "pnpify tsc",
"lint:es": "eslint --cache src/**/*.ts",
"fmt": "prettier --write --cache '{src,test-d}/**/*.ts' '*.json' 'examples/*.json' flow.mjs eslint.config.mjs",
"lint:ts": "tsc",
"lint:es": "eslint --cache 'src/**/*.ts'",
"lint:doc": "typedoc --emit none",
"lint": "yarn lint:ts && yarn lint:doc && yarn lint:es",
"build:ts": "tsc -p tsconfig.build.json",
"build:flow": "node flow.mjs --cache",
"build:bundle": "rm -rf bundle && node bundle.mjs",
"build": "yarn build:ts && yarn build:bundle",
"test:jest": "jest src",
"test:cov": "yarn test:jest --coverage",
"test:bundle": "yarn build:bundle && jest bundle.test.ts",
"test": "yarn test:cov && yarn test:bundle",
"prepack": "jest --clear-cache && rm -rf dist bundle && yarn lint && yarn test && yarn build",
"lint": "bun lint:ts && bun lint:doc && bun lint:es",
"export:ts": "tsc -p tsconfig.build.json",
"export:flow": "bun flow.mjs --cache",
"export:bundle": "bun build src/index.ts --minify --outfile dist/d3-dag.esm.min.js -e child_process",
"export": "bun export:ts && bun export:bundle",
"prepack": "bun lint && bun test --coverage && bun export",
"doc": "typedoc",
"doc:watch": "typedoc --watch"
},
Expand All @@ -51,46 +45,26 @@
"stringify-object": "^5.0.0"
},
"devDependencies": {
"@babel/core": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@babel/types": "^7.24.7",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.5.0",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.15.0",
"@types/d3-array": "^3.2.1",
"@types/eslint__js": "^8.42.3",
"@types/jest": "^29.5.12",
"@types/node": "^20.14.6",
"@types/stringify-object": "^4.0.5",
"@yarnpkg/pnpify": "^4.1.0",
"babel-jest": "^29.7.0",
"chalk": "^5.3.0",
"esbuild": "^0.21.5",
"esbuild-plugin-ignore": "^1.1.1",
"eslint": "^9.5.0",
"eslint-plugin-jest": "^28.6.0",
"eslint": "^9.15.0",
"eslint-plugin-spellcheck": "^0.0.20",
"eslint-plugin-tsdoc": "^0.3.0",
"flowgen": "^1.21.0",
"glob": "^10.4.2",
"globals": "^15.6.0",
"jest": "^29.7.0",
"prettier": "^3.3.2",
"prettier-plugin-organize-imports": "^3.2.4",
"read-package-json": "^7.0.1",
"typedoc": "^0.25.13",
"typescript": "^5.4.5",
"typescript-eslint": "^7.13.1"
"glob": "^11.0.0",
"prettier": "^3.3.3",
"prettier-plugin-organize-imports": "^4.1.0",
"typedoc": "^0.26.11",
"typescript": "~5.6.3",
"typescript-eslint": "^8.15.0",
"@types/bun": "^1.1.13"
},
"prettier": {
"plugins": [
"prettier-plugin-organize-imports"
]
},
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!(d3-array|internmap|stringify-object|is-regexp|is-obj|get-own-enumerable-keys)/)"
]
},
"packageManager": "[email protected]"
}
}
1 change: 1 addition & 0 deletions src/collections.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { expect, test } from "bun:test";
import { setIntersect, setMultimapDelete, setPop } from "./collections";

test("setPop()", () => {
Expand Down
1 change: 1 addition & 0 deletions src/graph/connect.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { expect, test } from "bun:test";
import { MutGraph } from ".";
import { entries, map, slice } from "../iters";
import { canonical } from "../sugiyama/test-utils";
Expand Down
1 change: 1 addition & 0 deletions src/graph/hierarchy.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { expect, test } from "bun:test";
import { MutGraph } from ".";
import { map } from "../iters";
import { graphHierarchy } from "./hierarchy";
Expand Down
Loading

0 comments on commit a2d2d0c

Please sign in to comment.