-
-
Notifications
You must be signed in to change notification settings - Fork 12
feat(config): add -c, --config option #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @PeterYinusa! Sorry for the delayed review, added a couple small suggestions.
This should also resolve #11 💖
Thanks for taking the time out to review the code, I've made the suggested changes |
🎉 This PR is included in version 2.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Converts this package to an ESM module. Kudos to [this guide](https://tsmx.net/convert-existing-nodejs-project-from-commonjs-to-esm/) and this issue: TypeStrong/ts-node#1997 In our organization, this is only possible for this package because it is not used anywhere else, and we rely on CommonJS extensively. Changes in detail: - Update `package.json` for ESM compatibility - Replace all `require()` with `import` statements - Add `.js` file extension to all file imports in TypeScript source files - Update TypeScript, ESLint, and Jest configs for ESM compatibility and recommended best practices - TypeScript (`tsconfig.json`) - Update the `module`/`moduleResolution` fields to `Node16`. - I chose `Node16` over `NodeNext`, as the behavior of `NodeNext` may change in the future. See [here](https://www.typescriptlang.org/docs/handbook/modules/reference.html#node16-nodenext) for details. - ESLint (`.eslintrc.cjs`) - `parseOptions.sourceType = 'module'` - Jest (`jest.config.cjs`) - Update the `moduleNameMapper` to strip the `.js` from local file imports. See [here](https://kulshekhar.github.io/ts-jest/docs/guides/esm-support/) for details. - Replace `ts-node` with `tsx`, which has better ESM compatibility. - Specifically, the former does not work with Node v20 at the moment: TypeStrong/ts-node#1997 - Update `jest-it-up` - This is so that we can use its `--config` option (thank you @PeterYinusa! rbardini/jest-it-up#12) to target our new `.cjs` config file.
Provide a custom jest config path