Skip to content

Commit 1d65619

Browse files
committed
build: simplify tsdown config and fix JS script imports
1 parent b0fda48 commit 1d65619

6 files changed

Lines changed: 402 additions & 25 deletions

File tree

benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from "node:fs";
22
import path from "node:path";
33
import { bench, do_not_optimize, run } from "mitata";
44
import prettier from "prettier";
5-
import javaPlugin from "../dist/index.js";
5+
import javaPlugin from "../dist/index.mjs";
66

77
const dir = "samples";
88
const files = fs

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
"repository": "https://github.com/jhipster/prettier-java",
77
"license": "Apache-2.0",
88
"type": "module",
9-
"main": "./dist/index.cjs",
10-
"module": "./dist/index.mjs",
119
"exports": {
1210
".": {
1311
"import": {
@@ -20,12 +18,13 @@
2018
}
2119
}
2220
},
21+
"main": "./dist/index.cjs",
22+
"module": "./dist/index.mjs",
2323
"files": [
2424
"dist"
2525
],
2626
"scripts": {
2727
"build": "tsdown && cp src/tree-sitter-java_orchard.wasm dist/",
28-
"build:watch": "tsdown --watch",
2928
"ci": "yarn build && yarn lint && yarn format:validate && yarn test",
3029
"clone-samples": "node scripts/clone-samples.js",
3130
"format:fix": "prettier --write \"**/*.@(js|json|ts)\"",
@@ -76,9 +75,9 @@
7675
"mocha": "^10.8.2",
7776
"prettier": "^3.0.0",
7877
"ts-node": "^10.9.2",
78+
"tsdown": "^0.21.4",
7979
"typescript": "^5.6.3",
80-
"typescript-eslint": "^8.57.0",
81-
"tsdown": "^0.19.0-beta.5"
80+
"typescript-eslint": "^8.57.0"
8281
},
8382
"peerDependencies": {
8483
"prettier": "^3.0.0"

scripts/update-test-output.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ const updateTestOutput = async () => {
6565
await prettier.__debug.formatDoc(
6666
await prettier.__debug.printToDoc(newExpectedText, {
6767
parser: "java",
68-
plugins: [path.resolve(__dirname, "../dist/index.js")]
68+
plugins: [path.resolve(__dirname, "../dist/index.mjs")]
6969
})
7070
)
7171
);
7272
}
7373
newExpectedText = await prettier.format(newExpectedText, {
7474
parser: "java",
75-
plugins: [path.resolve(__dirname, "../dist/index.js")],
75+
plugins: [path.resolve(__dirname, "../dist/index.mjs")],
7676
tabWidth: 2,
7777
endOfLine: "lf",
7878
...testOptions

tsdown.config.mts

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

tsdown.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { defineConfig } from "tsdown";
2+
3+
export default defineConfig({
4+
format: ["esm", "cjs"],
5+
dts: true
6+
});

0 commit comments

Comments
 (0)