-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add rollup config * Sort dependencies in package.json * Clean output folder before build * Use relative paths for entries * Convert cjs to esm if needed * Add extensions to lodash imports To support node16 resolution * Ignore coverage for vitest and jest-globals
- Loading branch information
Showing
7 changed files
with
100 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,59 @@ | |
"name": "@testing-library/jest-dom", | ||
"version": "0.0.0-semantically-released", | ||
"description": "Custom jest matchers to test the state of the DOM", | ||
"main": "dist/index.js", | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/esm/index.js", | ||
"exports": { | ||
".": { | ||
"require": { | ||
"types": "./types/index.d.ts", | ||
"default": "./dist/index.js" | ||
}, | ||
"import": { | ||
"types": "./types/index.d.ts", | ||
"default": "./dist/index.mjs" | ||
} | ||
}, | ||
"./jest-globals": { | ||
"require": { | ||
"types": "./types/jest-globals.d.ts", | ||
"default": "./dist/jest-globals.js" | ||
}, | ||
"import": { | ||
"types": "./types/jest-globals.d.ts", | ||
"default": "./dist/jest-globals.mjs" | ||
} | ||
}, | ||
"./matchers": { | ||
"require": { | ||
"types": "./types/matchers.d.ts", | ||
"default": "./dist/matchers.js" | ||
}, | ||
"import": { | ||
"types": "./types/matchers.d.ts", | ||
"default": "./dist/matchers.mjs" | ||
} | ||
}, | ||
"./vitest": { | ||
"require": { | ||
"types": "./types/vitest.d.ts", | ||
"default": "./dist/vitest.js" | ||
}, | ||
"import": { | ||
"types": "./types/vitest.d.ts", | ||
"default": "./dist/vitest.mjs" | ||
} | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"types": "types/index.d.ts", | ||
"engines": { | ||
"node": ">=14", | ||
"npm": ">=6", | ||
"yarn": ">=1" | ||
}, | ||
"scripts": { | ||
"build": "kcd-scripts build", | ||
"build": "rollup -c", | ||
"format": "kcd-scripts format", | ||
"lint": "kcd-scripts lint", | ||
"setup": "npm install && npm run validate -s", | ||
|
@@ -36,25 +80,28 @@ | |
"author": "Ernesto Garcia <[email protected]> (http://gnapse.github.io)", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@adobe/css-tools": "^4.0.1", | ||
"@babel/runtime": "^7.9.2", | ||
"aria-query": "^5.0.0", | ||
"chalk": "^3.0.0", | ||
"@adobe/css-tools": "^4.0.1", | ||
"css.escape": "^1.5.1", | ||
"dom-accessibility-api": "^0.5.6", | ||
"lodash": "^4.17.15", | ||
"redent": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"@jest/globals": "^29.6.2", | ||
"@rollup/plugin-commonjs": "^25.0.4", | ||
"expect": "^29.6.2", | ||
"jest-environment-jsdom-sixteen": "^1.0.3", | ||
"jest-watch-select-projects": "^2.0.0", | ||
"jsdom": "^16.2.1", | ||
"kcd-scripts": "^14.0.0", | ||
"pretty-format": "^25.1.0", | ||
"vitest": "^0.34.1", | ||
"typescript": "^5.1.6" | ||
"rollup": "^3.28.1", | ||
"rollup-plugin-delete": "^2.0.0", | ||
"typescript": "^5.1.6", | ||
"vitest": "^0.34.1" | ||
}, | ||
"peerDependencies": { | ||
"@jest/globals": ">= 28", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const del = require('rollup-plugin-delete') | ||
const commonjs = require('@rollup/plugin-commonjs') | ||
|
||
const entries = [ | ||
'./src/index.js', | ||
'./src/jest-globals.js', | ||
'./src/matchers.js', | ||
'./src/vitest.js', | ||
] | ||
|
||
module.exports = [ | ||
{ | ||
input: entries, | ||
output: [ | ||
{ | ||
dir: 'dist', | ||
entryFileNames: '[name].mjs', | ||
chunkFileNames: '[name]-[hash].mjs', | ||
format: 'esm', | ||
}, | ||
{ | ||
dir: 'dist', | ||
entryFileNames: '[name].js', | ||
chunkFileNames: '[name]-[hash].js', | ||
format: 'cjs', | ||
}, | ||
], | ||
external: id => | ||
!id.startsWith('\0') && !id.startsWith('.') && !id.startsWith('/'), | ||
plugins: [del({targets: 'dist/*'}), commonjs()], | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* istanbul ignore file */ | ||
|
||
import globals from '@jest/globals' | ||
import * as extensions from './matchers' | ||
|
||
globals.expect.extend(extensions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* istanbul ignore file */ | ||
|
||
import {expect} from 'vitest' | ||
import * as extensions from './matchers' | ||
|
||
expect.extend(extensions) |