Skip to content

Commit 86e676f

Browse files
authored
Merge pull request #511 from VirtualLiveLab/build-with-tsdown
build: use tsdown
2 parents 5aa3769 + f4f35dd commit 86e676f

13 files changed

Lines changed: 584 additions & 1199 deletions

File tree

.changeset/late-clocks-chew.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@virtual-live-lab/eslint-config": patch
3+
"@virtual-live-lab/prettier-config": patch
4+
"@virtual-live-lab/stylelint-config": patch
5+
---
6+
7+
build: use tsdown

packages/eslint-config/build.config.ts

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

packages/eslint-config/package.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,28 @@
33
"version": "2.2.22",
44
"description": "ESLint configuration for Virtual Live Lab",
55
"type": "module",
6-
"module": "./dist/index.mjs",
6+
"main": "./dist/index.js",
7+
"module": "./dist/index.js",
78
"types": "./dist/index.d.ts",
89
"exports": {
910
".": {
10-
"import": "./dist/index.mjs",
11-
"types": "./dist/index.d.ts"
11+
"types": "./dist/index.d.ts",
12+
"import": "./dist/index.js"
1213
},
1314
"./addons/*": {
14-
"import": "./dist/addons/*.mjs",
15-
"types": "./dist/addons/*.d.ts"
15+
"types": "./dist/addons/*.d.ts",
16+
"import": "./dist/addons/*.js"
1617
},
1718
"./presets/*": {
18-
"import": "./dist/presets/*.mjs",
19-
"types": "./dist/presets/*.d.ts"
19+
"types": "./dist/presets/*.d.ts",
20+
"import": "./dist/presets/*.js"
2021
}
2122
},
2223
"files": [
2324
"dist"
2425
],
2526
"scripts": {
26-
"build": "unbuild",
27+
"build": "tsdown",
2728
"inspect": "eslint --inspect-config"
2829
},
2930
"engines": {
@@ -61,8 +62,10 @@
6162
"@types/node": "catalog:",
6263
"@virtual-live-lab/tsconfig": "workspace:*",
6364
"eslint": "9.28.0",
65+
"publint": "catalog:",
66+
"tsdown": "catalog:",
6467
"typescript": "catalog:",
65-
"unbuild": "catalog:",
68+
"unplugin-unused": "catalog:",
6669
"vitest": "catalog:"
6770
},
6871
"license": "MIT",
@@ -76,7 +79,7 @@
7679
"homepage": "https://github.com/VirtualLiveLab/js-config/tree/main/#readme",
7780
"repository": {
7881
"type": "git",
79-
"url": "https://github.com/VirtualLiveLab/js-config.git",
82+
"url": "git+https://github.com/VirtualLiveLab/js-config.git",
8083
"directory": "packages/eslint-config"
8184
},
8285
"bugs": {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { defineConfig } from "tsdown";
2+
3+
export default defineConfig({
4+
clean: true,
5+
dts: true,
6+
entry: ["./src/index.ts", "./src/addons/**/*.ts", "./src/presets/**/*.ts"],
7+
format: "esm",
8+
minify: "dce-only",
9+
nodeProtocol: true,
10+
outDir: "dist",
11+
publint: true,
12+
unused: true,
13+
});

packages/prettier-config/build.config.ts

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

packages/prettier-config/package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,24 @@
33
"version": "2.0.19",
44
"description": "Prettier configuration for Virtual Live Lab",
55
"type": "module",
6-
"module": "./dist/index.mjs",
6+
"main": "./dist/index.js",
7+
"module": "./dist/index.js",
78
"types": "./dist/index.d.ts",
89
"exports": {
910
".": {
10-
"import": "./dist/index.mjs",
11-
"types": "./dist/index.d.ts"
11+
"types": "./dist/index.d.ts",
12+
"import": "./dist/index.js"
1213
},
1314
"./astro": {
14-
"import": "./dist/astro.mjs",
15-
"types": "./dist/astro.d.ts"
15+
"types": "./dist/astro.d.ts",
16+
"import": "./dist/astro.js"
1617
}
1718
},
1819
"files": [
1920
"dist"
2021
],
2122
"scripts": {
22-
"build": "unbuild"
23+
"build": "tsdown"
2324
},
2425
"peerDependencies": {
2526
"prettier": "^3.0.0",
@@ -39,8 +40,10 @@
3940
"@virtual-live-lab/tsconfig": "workspace:*",
4041
"prettier": "3.5.3",
4142
"prettier-plugin-astro": "0.14.1",
43+
"publint": "catalog:",
44+
"tsdown": "catalog:",
4245
"typescript": "catalog:",
43-
"unbuild": "catalog:",
46+
"unplugin-unused": "catalog:",
4447
"vitest": "catalog:"
4548
},
4649
"license": "MIT",

packages/prettier-config/test/snapshot.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe("Test Prettier config with snapshot", () => {
55
describe("normal preset", () => {
66
it("matches snapshot", async () => {
77
const options = await prettier.resolveConfig("index.ts", {
8-
config: `${import.meta.dirname}/../dist/index.mjs`,
8+
config: `${import.meta.dirname}/../dist/index.js`,
99
});
1010

1111
expect(options).toMatchSnapshot();
@@ -15,15 +15,15 @@ describe("Test Prettier config with snapshot", () => {
1515
describe("astro preset", () => {
1616
it("matches snapshot with normal file", async () => {
1717
const options = await prettier.resolveConfig("index.ts", {
18-
config: `${import.meta.dirname}/../dist/astro.mjs`,
18+
config: `${import.meta.dirname}/../dist/astro.js`,
1919
});
2020

2121
expect(options).toMatchSnapshot();
2222
});
2323

2424
it("matches snapshot with astro file", async () => {
2525
const options = await prettier.resolveConfig("index.astro", {
26-
config: `${import.meta.dirname}/../dist/astro.mjs`,
26+
config: `${import.meta.dirname}/../dist/astro.js`,
2727
});
2828

2929
expect(options).toMatchSnapshot();
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { defineConfig } from "tsdown";
2+
3+
export default defineConfig({
4+
clean: true,
5+
dts: true,
6+
entry: ["./src/index.ts", "./src/astro.ts"],
7+
format: "esm",
8+
minify: "dce-only",
9+
nodeProtocol: true,
10+
outDir: "dist",
11+
publint: true,
12+
unused: true,
13+
});

packages/stylelint-config/build.config.ts

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

packages/stylelint-config/package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@
33
"version": "3.0.5",
44
"description": "Stylelint configuration for Virtual Live Lab",
55
"type": "module",
6-
"main": "./dist/index.mjs",
7-
"module": "./dist/index.mjs",
6+
"main": "./dist/index.js",
7+
"module": "./dist/index.js",
88
"types": "./dist/index.d.ts",
99
"exports": {
1010
".": {
11-
"import": "./dist/index.mjs",
12-
"types": "./dist/index.d.ts"
11+
"types": "./dist/index.d.ts",
12+
"import": "./dist/index.js"
1313
},
1414
"./scss": {
15-
"import": "./dist/scss.mjs",
16-
"types": "./dist/scss.d.ts"
15+
"types": "./dist/scss.d.ts",
16+
"import": "./dist/scss.js"
1717
},
1818
"./astro": {
19-
"import": "./dist/astro.mjs",
20-
"types": "./dist/astro.d.ts"
19+
"types": "./dist/astro.d.ts",
20+
"import": "./dist/astro.js"
2121
}
2222
},
2323
"files": [
2424
"dist"
2525
],
2626
"scripts": {
27-
"build": "unbuild"
27+
"build": "tsdown"
2828
},
2929
"peerDependencies": {
3030
"postcss-html": "^1.0.0",
@@ -46,9 +46,11 @@
4646
"@virtual-live-lab/eslint-config": "workspace:*",
4747
"@virtual-live-lab/tsconfig": "workspace:*",
4848
"postcss-html": "1.8.0",
49+
"publint": "catalog:",
4950
"stylelint": "16.20.0",
51+
"tsdown": "catalog:",
5052
"typescript": "catalog:",
51-
"unbuild": "catalog:",
53+
"unplugin-unused": "catalog:",
5254
"vitest": "catalog:"
5355
},
5456
"license": "MIT",

0 commit comments

Comments
 (0)