-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28972 from storybookjs/norbert/babel-dedup-core
Core: De-duplicate babel use in core
- Loading branch information
Showing
42 changed files
with
320 additions
and
290 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,3 +57,4 @@ code/.nx/cache | |
code/.vite-inspect | ||
.nx/cache | ||
!**/fixtures/**/yarn.lock | ||
code/core/report |
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,3 +1,4 @@ | ||
*.mdx | ||
|
||
/.nx/cache | ||
/.nx/cache | ||
core/report |
13 changes: 13 additions & 0 deletions
13
code/.yarn/patches/@types-babel__traverse-npm-7.20.6-fac4243243.patch
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* This entry is to ensure we use a single version of Babel across the codebase. This is to prevent | ||
* issues with multiple versions of Babel being used in the same project. It also prevents us from | ||
* bundling babel multiple times in the final bundles. | ||
*/ | ||
import { transformSync } from '@babel/core'; | ||
import * as core from '@babel/core'; | ||
// @ts-expect-error File is not yet exposed, see https://github.com/babel/babel/issues/11350#issuecomment-644118606 | ||
import { File } from '@babel/core'; | ||
import bg from '@babel/generator'; | ||
import * as parser from '@babel/parser'; | ||
import bt from '@babel/traverse'; | ||
import * as types from '@babel/types'; | ||
import * as recast from 'recast'; | ||
|
||
export * from './babelParse'; | ||
|
||
// @ts-expect-error (needed due to it's use of `exports.default`) | ||
const traverse = (bt.default || bt) as typeof bt; | ||
// @ts-expect-error (needed due to it's use of `exports.default`) | ||
const generate = (bg.default || bg) as typeof bg; | ||
|
||
const BabelFileClass = File as any; | ||
|
||
export { | ||
// main | ||
core, | ||
generate, | ||
traverse, | ||
types, | ||
parser, | ||
transformSync, | ||
BabelFileClass, | ||
|
||
// other | ||
recast, | ||
}; | ||
|
||
export type { BabelFile, NodePath } from '@babel/core'; | ||
export type { GeneratorOptions } from '@babel/generator'; | ||
export type { Options as RecastOptions } from 'recast'; |
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.