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

fix: remove nullish operator to support Storybook v6 #2873

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/dnb-eufemia/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const config = {
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-transform-nullish-coalescing-operator',
],
sourceMaps: true,
comments: false,
Expand Down
1 change: 1 addition & 0 deletions packages/dnb-eufemia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/plugin-syntax-typescript": "7.22.5",
"@babel/plugin-transform-modules-commonjs": "7.22.5",
"@babel/plugin-transform-nullish-coalescing-operator": "7.23.3",
"@babel/plugin-transform-react-constant-elements": "7.22.5",
"@babel/plugin-transform-runtime": "7.22.5",
"@babel/preset-env": "7.22.5",
Expand Down
11 changes: 11 additions & 0 deletions packages/dnb-eufemia/scripts/postbuild/__tests__/postbuild.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,17 @@ describe('babel build', () => {
path.resolve(packpath.self(), `build${stage}/components/Input.js`)
)
).toBe(true)

{
const content = fs.readFileSync(
path.resolve(
packpath.self(),
`build${stage}/components/card/Card.js`
),
'utf-8'
)
expect(content).not.toContain('??')
}
})
})

Expand Down
13 changes: 13 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1985,6 +1985,18 @@ __metadata:
languageName: node
linkType: hard

"@babel/plugin-transform-nullish-coalescing-operator@npm:7.23.3":
version: 7.23.3
resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.23.3"
dependencies:
"@babel/helper-plugin-utils": "npm:^7.22.5"
"@babel/plugin-syntax-nullish-coalescing-operator": "npm:^7.8.3"
peerDependencies:
"@babel/core": ^7.0.0-0
checksum: ea844a12a3ae5647d6d2ae0685fde48ae53e724ef9ce5d9fbf36e8f1ff0107f76a5349ef34c2a06984b3836c001748caf9701afb172bd7ba71a5dff79e16b434
languageName: node
linkType: hard

"@babel/plugin-transform-nullish-coalescing-operator@npm:^7.22.11":
version: 7.22.11
resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.22.11"
Expand Down Expand Up @@ -2995,6 +3007,7 @@ __metadata:
"@babel/plugin-syntax-dynamic-import": "npm:7.8.3"
"@babel/plugin-syntax-typescript": "npm:7.22.5"
"@babel/plugin-transform-modules-commonjs": "npm:7.22.5"
"@babel/plugin-transform-nullish-coalescing-operator": "npm:7.23.3"
"@babel/plugin-transform-react-constant-elements": "npm:7.22.5"
"@babel/plugin-transform-runtime": "npm:7.22.5"
"@babel/preset-env": "npm:7.22.5"
Expand Down
Loading