-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- delete "type: module" from package.json (this broke CJS typescript consumers) - give up on "fix-cjs" approach, and switch to tsup-produced bundles. - ensure CJS is "index.CJS", and ESM is "index.MJS" to avoid ambiguity - switch from "api-extractor" back to tsc for typings - DRY up jest-specific tsconfigs - run jest in both cjs and esm modes - tweak integration tests to use package exports instead of relative paths - run awash in regret that I didn't just support CJS. ESM is far too painful for no performance or ergonomic benefit, and supporting only ESM is a huge middle finger to people still "stuck" on CJS.
- Loading branch information
Showing
22 changed files
with
1,182 additions
and
126 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
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,33 @@ | ||
// @ts-check | ||
|
||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
|
||
const config = { | ||
displayName: "@photostructure/fs-metadata (CJS)", | ||
testEnvironment: "jest-environment-node", | ||
roots: ["<rootDir>/src"], | ||
coverageProvider: "v8", | ||
moduleNameMapper: { | ||
"^(\\.{1,2}/.*)\\.js$": "$1", | ||
}, | ||
transform: { | ||
"^.+\\.(c)?ts$": [ | ||
"ts-jest", | ||
{ | ||
useESM: false, | ||
tsconfig: "tsconfig.jest-cjs.json", | ||
}, | ||
], | ||
}, | ||
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"], | ||
collectCoverage: false, | ||
verbose: true, | ||
silent: false, | ||
randomize: true, | ||
setupFilesAfterEnv: [ | ||
"jest-extended/all", | ||
"<rootDir>/src/test-utils/jest-matchers.ts", | ||
], | ||
}; | ||
|
||
module.exports = config; |
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
Oops, something went wrong.