Skip to content

Commit 09c232e

Browse files
committed
basic build
1 parent 5763655 commit 09c232e

File tree

5 files changed

+899
-17
lines changed

5 files changed

+899
-17
lines changed

package.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,21 @@
66
"name": "Lenz Weber-Tronic",
77
"email": "[email protected]"
88
},
9+
"type": "module",
910
"license": "MIT",
1011
"exports": {
11-
".": "./src/index.js"
12+
".": {
13+
"module-sync": "./dist/index.js",
14+
"module": "./dist/index.js",
15+
"import": "./dist/index.js",
16+
"require": "./dist/index.cjs"
17+
},
18+
"./jest": {
19+
"module-sync": "./dist/jest.js",
20+
"module": "./dist/jest.js",
21+
"import": "./dist/jest.js",
22+
"require": "./dist/jest.cjs"
23+
}
1224
},
1325
"dependencies": {
1426
"@testing-library/dom": "^10.4.0",
@@ -24,6 +36,7 @@
2436
"prettier": "^3.3.3",
2537
"react": "^18.3.1",
2638
"react-dom": "^18.3.1",
39+
"tsup": "^8.3.0",
2740
"typescript": "^5.6.2"
2841
},
2942
"peerDependencies": {
@@ -32,5 +45,8 @@
3245
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0",
3346
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0"
3447
},
48+
"scripts": {
49+
"build": "tsup"
50+
},
3551
"packageManager": "[email protected]"
3652
}

src/jest/ProfiledComponent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { MatcherFunction } from "expect";
2-
import { WaitForRenderTimeoutError } from "../profile/index.js";
2+
import { WaitForRenderTimeoutError } from "@testing-library/react-render-stream";
33
import type {
44
NextRenderOptions,
55
Profiler,
66
ProfiledComponent,
77
ProfiledHook,
8-
} from "../profile/index.js";
8+
} from "@testing-library/react-render-stream";
99

1010
export const toRerender: MatcherFunction<[options?: NextRenderOptions]> =
1111
async function (actual, options) {

tsconfig.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
],
1717
"esModuleInterop": true,
1818
"allowSyntheticDefaultImports": true,
19+
"paths": {
20+
"@testing-library/react-render-stream": [
21+
"./src/profile/index.ts"
22+
]
23+
}
1924
},
2025
"include": [
2126
"src"

tsup.config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { defineConfig } from "tsup";
2+
3+
export default defineConfig({
4+
entry: {
5+
index: "src/profile/index.ts",
6+
jest: "src/jest/index.ts",
7+
},
8+
splitting: false,
9+
sourcemap: true,
10+
clean: true,
11+
dts: true,
12+
format: ["cjs", "esm"],
13+
target: ["node20"],
14+
external: [/^@testing-library\/react-render-stream/],
15+
});

0 commit comments

Comments
 (0)