-
Notifications
You must be signed in to change notification settings - Fork 84
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
[ENG-4579][scripts] convert to ESM #1192
Conversation
ENG-4579 Convert eas-cli to esm
Screenshot 2022-04-07 at 15.26.32.png We can't convert a bunch of deps in eas-cli because it's not an ESM. It seems that it should be possible to convert eas-cli now https://github.com/typhonjs-oclif-scratch/test-cli-modern/tree/main/src |
Size Change: +669 B (0%) Total Size: 25.1 MB
|
Codecov Report
@@ Coverage Diff @@
## main #1192 +/- ##
==========================================
+ Coverage 51.33% 51.43% +0.11%
==========================================
Files 373 373
Lines 13329 13358 +29
Branches 2739 2752 +13
==========================================
+ Hits 6841 6870 +29
Misses 5974 5974
Partials 514 514
Continue to review full report at Codecov.
|
scripts/src/changelogEntry.ts
Outdated
import { readAndParseChangelogAsync, writeChangelogAsync } from './changelog/file.js'; | ||
import * as markdown from './markdown.js'; | ||
|
||
const nullthrows = nullthrowsModule.default; |
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.
if w need a workaround like this for such a simple package I would prefer to remove it entirely and just add and utll with the same name
scripts/src/markdown.ts
Outdated
@@ -1,6 +1,6 @@ | |||
// this is mostly copy-pasted from https://github.com/expo/expo/blob/master/tools/src/Markdown.ts | |||
|
|||
import { unescape } from 'lodash'; | |||
import _ from 'lodash'; |
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.
import _ from 'lodash'; | |
import unescape from 'lodash/unescape'; |
is this not supported with esm?
Checklist
/changelog-entry [breaking-change|new-feature|bug-fix|chore] [message]
and CHANGELOG.md will be updated automatically.Why
The first part of the effort to convert EAS CLI to ESM.
This PR converts the
scripts
package to ESM.How
Mostly based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
.js
.scripts
as ESM.scripts
work only with node>=14.16
.node:
protocol to standard lib imports.scripts/build
to .gitignore.typecheck
script so we can have some tests in CI.Test Plan
scripts
to verify they work fine.