Skip to content

Commit b7fbe14

Browse files
authored
Bundle with tsdown (#307)
1 parent 677ff0d commit b7fbe14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+791
-305
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
coverage/
2-
lib/
2+
dist/
33
node_modules/
44
.vscode/settings.json
55
**/.yarn/*

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ export default tseslint.config(
5353
"simple-import-sort/exports": "error",
5454
},
5555
},
56-
{ ignores: ["lib/", ".yarn/"] },
56+
{ ignores: ["dist/", ".yarn/"] },
5757
);

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
"yaml"
88
],
99
"type": "module",
10-
"types": "lib/index.d.ts",
1110
"exports": {
12-
".": "./lib/index.js",
11+
".": {
12+
"types": "./dist/index.d.mts",
13+
"default": "./dist/index.mjs"
14+
},
1315
"./*": "./*"
1416
},
1517
"repository": "prettier/yaml-unist-parser",
@@ -30,8 +32,7 @@
3032
"fix:eslint": "yarn lint:eslint --fix",
3133
"fix:prettier": "prettier . --write",
3234
"test": "vitest",
33-
"prebuild": "rm -rf ./lib",
34-
"build": "tsc -p ./tsconfig.build.json",
35+
"build": "tsdown --unbundle",
3536
"release": "yarn build && standard-version"
3637
},
3738
"dependencies": {
@@ -50,6 +51,7 @@
5051
"patch-package": "8.0.1",
5152
"prettier": "3.6.2",
5253
"standard-version": "9.5.0",
54+
"tsdown": "0.17.0-beta.6",
5355
"typescript": "5.9.3",
5456
"typescript-eslint": "8.47.0",
5557
"vitest": "4.0.12",
@@ -59,7 +61,7 @@
5961
"node": ">= 14"
6062
},
6163
"files": [
62-
"/lib/**/*"
64+
"/dist"
6365
],
6466
"packageManager": "yarn@4.11.0"
6567
}

src/attach.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { testCases, type TestCaseSingle } from "./helpers.js";
2-
import { type Comment, type Root } from "./types.js";
1+
import { testCases, type TestCaseSingle } from "./helpers.ts";
2+
import { type Comment, type Root } from "./types.ts";
33

44
// example from http://nodeca.github.io/js-yaml/
55
const jsYamlExample = `

src/attach.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import type {
77
Root,
88
TrailingCommentAttachable,
99
YamlUnistNode,
10-
} from "./types.js";
11-
import { defineParents } from "./utils/define-parents.js";
12-
import { getPointText } from "./utils/get-point-text.js";
10+
} from "./types.ts";
11+
import { defineParents } from "./utils/define-parents.ts";
12+
import { getPointText } from "./utils/get-point-text.ts";
1313

1414
interface NodeTable {
1515
[line: number]: {

src/factories/block-folded.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type BlockFolded, type BlockValue } from "../types.js";
1+
import { type BlockFolded, type BlockValue } from "../types.ts";
22

33
export function createBlockFolded(blockValue: BlockValue): BlockFolded {
44
return {

src/factories/block-literal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type BlockLiteral, type BlockValue } from "../types.js";
1+
import { type BlockLiteral, type BlockValue } from "../types.ts";
22

33
export function createBlockLiteral(blockValue: BlockValue): BlockLiteral {
44
return {

src/factories/block-value.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import {
33
type Comment,
44
type Content,
55
type Position,
6-
} from "../types.js";
7-
import { createLeadingCommentAttachable } from "./leading-comment-attachable.js";
8-
import { createNode } from "./node.js";
6+
} from "../types.ts";
7+
import { createLeadingCommentAttachable } from "./leading-comment-attachable.ts";
8+
import { createNode } from "./node.ts";
99

1010
export function createBlockValue(
1111
position: Position,

src/factories/comment-attachable.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { type CommentAttachable } from "../types.js";
2-
import { createLeadingCommentAttachable } from "./leading-comment-attachable.js";
3-
import { createTrailingCommentAttachable } from "./trailing-comment-attachable.js";
1+
import { type CommentAttachable } from "../types.ts";
2+
import { createLeadingCommentAttachable } from "./leading-comment-attachable.ts";
3+
import { createTrailingCommentAttachable } from "./trailing-comment-attachable.ts";
44

55
export function createCommentAttachable(): CommentAttachable {
66
return {

src/factories/comment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { type Position } from "../types.js";
2-
import { createNode } from "./node.js";
1+
import { type Position } from "../types.ts";
2+
import { createNode } from "./node.ts";
33

44
export function createComment(position: Position, value: string) {
55
return {

0 commit comments

Comments
 (0)