Skip to content

Commit

Permalink
chore: change bundler to tsdown (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamchanii authored Dec 9, 2024
1 parent c3ee144 commit e566043
Show file tree
Hide file tree
Showing 6 changed files with 879 additions and 135 deletions.
5 changes: 5 additions & 0 deletions .changeset/soft-ads-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"graplix": patch
---

Change bundler to tsdown
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"require": "./dist/index.cjs",
"import": "./dist/index.js",
"default": "./dist/index.js"
}
},
"main": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"main": "./dist/index.js",
"types": "./dist/index.d.mts",
"files": [
"dist",
"src",
"README.md"
],
"scripts": {
"build": "nanobundle build",
"clean": "nanobundle clean",
"build": "tsdown",
"format": "biome check --fix",
"release": "changeset publish",
"test": "vitest run ./src",
Expand All @@ -41,7 +41,7 @@
"dataloader": "^2.2.2",
"graphology": "^0.25.4",
"graphology-types": "^0.24.7",
"nanobundle": "^2.1.0",
"tsdown": "^0.4.1",
"typescript": "^5.5.4",
"vitest": "^2.0.4"
},
Expand Down
2 changes: 1 addition & 1 deletion src/utils/assignGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function assignGraph<
>(
a: DirectedGraph<NodeAttributes, EdgeAttributes>,
b: DirectedGraph<NodeAttributes, EdgeAttributes>,
) {
): void {
b.forEachNode((node, attrs) => {
try {
a.addNode(node, attrs);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/isEqual.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function isEqual<T>(identify: (t: T) => string, a: T, b: T) {
export function isEqual<T>(identify: (t: T) => string, a: T, b: T): boolean {
const aid = identify(a);
const bid = identify(b);

Expand Down
12 changes: 12 additions & 0 deletions tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from "tsdown";

export default defineConfig({
entry: "./src/index.ts",
outDir: "./dist",
dts: {
transformer: "typescript",
autoAddExts: true,
},
format: ["esm", "cjs"],
clean: true,
});
Loading

0 comments on commit e566043

Please sign in to comment.