Skip to content
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

Use ES module exports #4454

Merged
merged 21 commits into from
Sep 11, 2017
Merged

Use ES module exports #4454

merged 21 commits into from
Sep 11, 2017

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Sep 9, 2017

Summary
This converts most of the commonjs usage into ESM exports.
I took care to not change to default export for entrypoints, meaning that those importing individual modules can still use require without issue.

Might consider adding no-commonjs lint rule (https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-commonjs.md), but there are still lots of places we have to use CJS?

Test plan
./jest

@codecov-io
Copy link

Codecov Report

Merging #4454 into master will increase coverage by 0.11%.
The diff coverage is 64.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4454      +/-   ##
==========================================
+ Coverage   56.74%   56.86%   +0.11%     
==========================================
  Files         189      186       -3     
  Lines        6485     6294     -191     
  Branches        3        3              
==========================================
- Hits         3680     3579     -101     
+ Misses       2804     2714      -90     
  Partials        1        1
Impacted Files Coverage Δ
...kages/jest-circus/src/format_node_assert_errors.js 0% <ø> (ø) ⬆️
...ackages/jest-haste-map/src/lib/extract_requires.js 100% <ø> (ø) ⬆️
...ckages/jest-cli/src/reporters/coverage_reporter.js 54.45% <ø> (-0.45%) ⬇️
packages/jest-util/src/null_console.js 0% <ø> (ø) ⬆️
packages/jest-cli/src/pattern_prompt.js 100% <ø> (ø) ⬆️
packages/jest-config/src/set_from_argv.js 95% <ø> (-0.24%) ⬇️
packages/jest-cli/src/test_scheduler.js 16.94% <ø> (-0.7%) ⬇️
packages/jest-runtime/src/should_instrument.js 58.82% <ø> (-4.34%) ⬇️
packages/jest-cli/src/search_source.js 69.84% <ø> (-0.48%) ⬇️
...es/jest-cli/src/lib/handle_deprecation_warnings.js 0% <ø> (ø) ⬆️
... and 169 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 215e1d4...c8ab63e. Read the comment docs.

@cpojer cpojer merged commit 9c429cd into jestjs:master Sep 11, 2017
@cpojer
Copy link
Member

cpojer commented Sep 11, 2017

Woah, nice work @SimenB. Thank you for your continued efforts to modernize the codebase.

@SimenB SimenB deleted the export branch September 11, 2017 01:56
tabrindle pushed a commit to tabrindle/jest that referenced this pull request Oct 2, 2017
* Use ESM exports in jest-config

* Use ESM exports in eslint-plugin-jest

* Use ESM exports in jest-changed-files

* Use ESM exports in jest-circus

* Use ESM exports in jest-diff

* Use ESM exports in jest-editor-support

* Use ESM exports in jest-haste-map

* Use ESM exports in jest-jasmine2

* Use ESM exports in jest-message-util

* Use ESM exports in jest-regex-util

* Use ESM exports in jest-repl

* Use ESM exports in jest-resolve

* Use ESM exports in jest-runner

* Use ESM exports in jest-runtime

* Use ESM exports in jest-snapshot

* Use ESM exports in jest-test-typescript-parser

* Use ESM exports in jest-util

* Use ESM exports in jest-validate

* Fix flow errors

* Activate eslint plugin to enforce correct ESM usage

* Use ESM exports in jest-cli
tabrindle pushed a commit to tabrindle/jest that referenced this pull request Oct 11, 2017
* Use ESM exports in jest-config

* Use ESM exports in eslint-plugin-jest

* Use ESM exports in jest-changed-files

* Use ESM exports in jest-circus

* Use ESM exports in jest-diff

* Use ESM exports in jest-editor-support

* Use ESM exports in jest-haste-map

* Use ESM exports in jest-jasmine2

* Use ESM exports in jest-message-util

* Use ESM exports in jest-regex-util

* Use ESM exports in jest-repl

* Use ESM exports in jest-resolve

* Use ESM exports in jest-runner

* Use ESM exports in jest-runtime

* Use ESM exports in jest-snapshot

* Use ESM exports in jest-test-typescript-parser

* Use ESM exports in jest-util

* Use ESM exports in jest-validate

* Fix flow errors

* Activate eslint plugin to enforce correct ESM usage

* Use ESM exports in jest-cli
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants