Skip to content

Commit 3cc17ba

Browse files
fix: TS node16 from CJS usage
1 parent c450586 commit 3cc17ba

File tree

3 files changed

+219
-14
lines changed

3 files changed

+219
-14
lines changed

package.json

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@guidepup/jest",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"description": "Virtual Screen Reader Jest Matchers",
55
"author": "Craig Morten <craig.morten@hotmail.co.uk>",
66
"license": "MIT",
@@ -18,29 +18,38 @@
1818
"a11y",
1919
"jest"
2020
],
21-
"main": "./lib/cjs/index.cjs",
21+
"main": "./lib/cjs/index.js",
2222
"types": "./lib/cjs/index.d.ts",
2323
"module": "./lib/esm/index.legacy-esm.js",
2424
"exports": {
2525
"./package.json": "./package.json",
2626
".": {
27-
"types": "./lib/esm/index.d.mts",
28-
"import": "./lib/esm/index.mjs",
29-
"require": "./lib/cjs/index.cjs",
30-
"default": "./lib/cjs/index.cjs"
27+
"import": {
28+
"types": "./lib/esm/index.d.mts",
29+
"default": "./lib/esm/index.mjs"
30+
},
31+
"require": {
32+
"types": "./lib/cjs/index.d.ts",
33+
"default": "./lib/cjs/index.cjs"
34+
},
35+
"default": {
36+
"types": "./lib/cjs/index.d.ts",
37+
"default": "./lib/cjs/index.cjs"
38+
}
3139
}
3240
},
3341
"sideEffects": true,
3442
"scripts": {
3543
"build": "yarn clean && yarn compile",
36-
"ci": "yarn clean && yarn lint && yarn test:coverage && yarn build",
44+
"ci": "yarn clean && yarn lint && yarn test:coverage && yarn build && yarn types:test",
3745
"clean": "rimraf lib",
3846
"compile": "tsup",
3947
"lint": "eslint . --ext .ts --cache",
4048
"lint:fix": "yarn lint --fix",
49+
"prepublish": "yarn build",
4150
"test": "jest",
4251
"test:coverage": "yarn test --coverage",
43-
"prepublish": "yarn build"
52+
"types:test": "attw --pack"
4453
},
4554
"dependencies": {
4655
"jest-snapshot": "^29.7.0"
@@ -50,6 +59,7 @@
5059
"jest": ">=29"
5160
},
5261
"devDependencies": {
62+
"@arethetypeswrong/cli": "^0.15.3",
5363
"@guidepup/virtual-screen-reader": "^0.26.0",
5464
"@types/jest": "^29.5.12",
5565
"@types/node": "^20.14.8",

tsup.config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { defineConfig, Options } from "tsup";
22

33
export default defineConfig((options) => {
44
const commonOptions: Partial<Options> = {
5+
clean: true,
56
entry: {
67
index: "src/index.ts",
78
},
@@ -16,7 +17,6 @@ export default defineConfig((options) => {
1617
format: ["esm"],
1718
outExtension: () => ({ js: ".mjs" }),
1819
dts: true,
19-
clean: true,
2020
outDir: "./lib/esm/",
2121
},
2222
// Support Webpack 4 by pointing `"module"` to a file with a `.js` extension
@@ -36,15 +36,13 @@ export default defineConfig((options) => {
3636
format: ["cjs"],
3737
outExtension: () => ({ js: ".cjs" }),
3838
dts: true,
39-
clean: true,
4039
outDir: "./lib/cjs/",
4140
},
4241
// CJS old extension
4342
{
4443
...commonOptions,
4544
format: ["cjs"],
4645
outExtension: () => ({ js: ".js" }),
47-
clean: true,
4846
outDir: "./lib/cjs/",
4947
},
5048
] as Options[];

0 commit comments

Comments
 (0)