Skip to content

Commit

Permalink
fix: TS node16 from CJS usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jlp-craigmorten committed Jun 27, 2024
1 parent c450586 commit 3cc17ba
Show file tree
Hide file tree
Showing 3 changed files with 219 additions and 14 deletions.
26 changes: 18 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@guidepup/jest",
"version": "0.5.0",
"version": "0.5.1",
"description": "Virtual Screen Reader Jest Matchers",
"author": "Craig Morten <[email protected]>",
"license": "MIT",
Expand All @@ -18,29 +18,38 @@
"a11y",
"jest"
],
"main": "./lib/cjs/index.cjs",
"main": "./lib/cjs/index.js",
"types": "./lib/cjs/index.d.ts",
"module": "./lib/esm/index.legacy-esm.js",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./lib/esm/index.d.mts",
"import": "./lib/esm/index.mjs",
"require": "./lib/cjs/index.cjs",
"default": "./lib/cjs/index.cjs"
"import": {
"types": "./lib/esm/index.d.mts",
"default": "./lib/esm/index.mjs"
},
"require": {
"types": "./lib/cjs/index.d.ts",
"default": "./lib/cjs/index.cjs"
},
"default": {
"types": "./lib/cjs/index.d.ts",
"default": "./lib/cjs/index.cjs"
}
}
},
"sideEffects": true,
"scripts": {
"build": "yarn clean && yarn compile",
"ci": "yarn clean && yarn lint && yarn test:coverage && yarn build",
"ci": "yarn clean && yarn lint && yarn test:coverage && yarn build && yarn types:test",
"clean": "rimraf lib",
"compile": "tsup",
"lint": "eslint . --ext .ts --cache",
"lint:fix": "yarn lint --fix",
"prepublish": "yarn build",
"test": "jest",
"test:coverage": "yarn test --coverage",
"prepublish": "yarn build"
"types:test": "attw --pack"
},
"dependencies": {
"jest-snapshot": "^29.7.0"
Expand All @@ -50,6 +59,7 @@
"jest": ">=29"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.15.3",
"@guidepup/virtual-screen-reader": "^0.26.0",
"@types/jest": "^29.5.12",
"@types/node": "^20.14.8",
Expand Down
4 changes: 1 addition & 3 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineConfig, Options } from "tsup";

export default defineConfig((options) => {
const commonOptions: Partial<Options> = {
clean: true,
entry: {
index: "src/index.ts",
},
Expand All @@ -16,7 +17,6 @@ export default defineConfig((options) => {
format: ["esm"],
outExtension: () => ({ js: ".mjs" }),
dts: true,
clean: true,
outDir: "./lib/esm/",
},
// Support Webpack 4 by pointing `"module"` to a file with a `.js` extension
Expand All @@ -36,15 +36,13 @@ export default defineConfig((options) => {
format: ["cjs"],
outExtension: () => ({ js: ".cjs" }),
dts: true,
clean: true,
outDir: "./lib/cjs/",
},
// CJS old extension
{
...commonOptions,
format: ["cjs"],
outExtension: () => ({ js: ".js" }),
clean: true,
outDir: "./lib/cjs/",
},
] as Options[];
Expand Down
Loading

0 comments on commit 3cc17ba

Please sign in to comment.