Skip to content

Commit

Permalink
fix: remove nullish operator to support Storybook v6
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Nov 9, 2023
1 parent 266ab6a commit 74c830a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
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

0 comments on commit 74c830a

Please sign in to comment.