-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement(build-tools): Convert build-cli to ESM (#20972)
Updates the build-cli project to be ESM instead of CJS. For the oclif-related changes I followed this guide: https://oclif.io/docs/esm/#migrating-a-cjs-plugin-to-esm Summary of changes: - Ran ts2esm to add extensions to source file import statements. - Upgraded chalk, fs-extra, and node-fetch to more recent versions with better ESM support. - jssm's types aren't set up quite right for TypeScript to resolve them when using Node16/NodeNext module resolution, so I patched in support. I opened StoneCypher/fsl#1295 to discuss options for upstreaming the changes. - I've limited the patched files to package.json, rollup configs, and the two new rolled up declaration files. Critically, this means the patch has _no runtime changes_. The only changes are in the types and config files. This should make it almost impossible for there to have been runtime bugs introduced by these changes. - Updated the install build tools step in the CI workflows to use npm link to make flub globally available. I removed the hack shim we only used in CI. - Updated the syncpack config to account for new dependencies. - Regenerated the packlists. This should be done as a part of the build but it isn't yet so I updated them opportunistically. - Renamed the dangerfile to .cts so it's always CommonJS like it used to be. Seemed the safest approach. If we want it to be ESM we can make that change separately.
- Loading branch information
1 parent
d6ed4c6
commit 6a415d1
Showing
116 changed files
with
4,268 additions
and
765 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
{ | ||
"require": ["ts-node/register"], | ||
"watch-extensions": ["ts"], | ||
"watch-extensions": ["ts", "cts", "mts"], | ||
"recursive": true, | ||
"reporter": "spec", | ||
"timeout": 60000 | ||
"timeout": 60000, | ||
"node-option": ["loader=ts-node/esm"] | ||
} |
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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
#!/usr/bin/env ts-node | ||
#!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning | ||
/*! | ||
* Copyright (c) Microsoft Corporation and contributors. All rights reserved. | ||
* Licensed under the MIT License. | ||
*/ | ||
|
||
// eslint-disable-next-line node/shebang, unicorn/prefer-top-level-await | ||
(async () => { | ||
const oclif = await import("@oclif/core"); | ||
await oclif.execute({ development: true, dir: __dirname }); | ||
})(); | ||
import { execute } from "@oclif/core"; | ||
|
||
await execute({ development: true, dir: import.meta.url }); |
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.