Skip to content

Commit

Permalink
Move to official Storybook 7 release (#1147)
Browse files Browse the repository at this point in the history
# Pull Request

## 🤨 Rationale

Right after I submitted the upgrade to a release candidate of Storybook
7 in #1134, I noticed they [released the official
7.0.0](https://github.com/storybookjs/storybook/releases). Adopting the
latest patch addresses some of the issues in #1146.

## 👩‍💻 Implementation

1. Update to latest non-RC build in package.json and regenerate
package-lock.json
2. Regenerate one patch file since the file it was patching has a new
name
3. Add another patch file since they introduced another instance of
storybookjs/storybook#21820
4. Move off deprecated API for specifying `sourceTransform` as described
in [migration
guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#source-block)
5. Delete `storybook-declarations.ts` since this bug was closed
storybookjs/storybook#21887

## 🧪 Testing

Explored Storybook.

## ✅ Checklist

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.
  • Loading branch information
jattasNI committed Apr 12, 2023
1 parent c982176 commit 25071e6
Show file tree
Hide file tree
Showing 8 changed files with 1,687 additions and 1,611 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Move to official Storybook 7 release",
"packageName": "@ni/nimble-components",
"email": "jattasNI@users.noreply.github.com",
"dependentChangeType": "none"
}
3,224 changes: 1,642 additions & 1,582 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion packages/nimble-components/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export const parameters = {
expanded: true
},
docs: {
transformSource
source: {
transform: transformSource
}
}
};

Expand Down
24 changes: 12 additions & 12 deletions packages/nimble-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,18 @@
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.1",
"@rollup/plugin-terser": "^0.4.0",
"@storybook/addon-a11y": "^7.0.0-rc.8",
"@storybook/addon-actions": "^7.0.0-rc.8",
"@storybook/addon-docs": "^7.0.0-rc.8",
"@storybook/addon-essentials": "^7.0.0-rc.8",
"@storybook/addon-interactions": "^7.0.0-rc.8",
"@storybook/addon-links": "^7.0.0-rc.8",
"@storybook/addons": "^7.0.0-rc.8",
"@storybook/cli": "^7.0.0-rc.8",
"@storybook/addon-a11y": "^7.0.4",
"@storybook/addon-actions": "^7.0.4",
"@storybook/addon-docs": "^7.0.4",
"@storybook/addon-essentials": "^7.0.4",
"@storybook/addon-interactions": "^7.0.4",
"@storybook/addon-links": "^7.0.4",
"@storybook/addons": "^7.0.4",
"@storybook/cli": "^7.0.4",
"@storybook/csf": "0.0.2-next.10",
"@storybook/html": "^7.0.0-rc.8",
"@storybook/html-webpack5": "^7.0.0-rc.8",
"@storybook/theming": "^7.0.0-rc.8",
"@storybook/html": "^7.0.4",
"@storybook/html-webpack5": "^7.0.4",
"@storybook/theming": "^7.0.4",
"@types/jasmine": "^4.3.1",
"@types/webpack-env": "^1.15.2",
"babel-loader": "^ 9.1.2",
Expand Down Expand Up @@ -126,7 +126,7 @@
"remark-gfm": "^3.0.1",
"rollup": "^3.10.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"storybook": "^7.0.0-rc.8",
"storybook": "^7.0.4",
"ts-loader": "^9.2.5",
"typescript": "~4.7.4",
"webpack": "^5.75.0",
Expand Down

This file was deleted.

10 changes: 10 additions & 0 deletions patches/@storybook+addon-actions+7.0.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff --git a/node_modules/@storybook/addon-actions/dist/decorator.d.ts b/node_modules/@storybook/addon-actions/dist/decorator.d.ts
index 0497cfe..3b84204 100644
--- a/node_modules/@storybook/addon-actions/dist/decorator.d.ts
+++ b/node_modules/@storybook/addon-actions/dist/decorator.d.ts
@@ -1,4 +1,4 @@
-import * as lib_preview_api_dist_storybook_channel_mock_a19cd233 from 'lib/preview-api/dist/storybook-channel-mock-a19cd233';
+import * as lib_preview_api_dist_storybook_channel_mock_a19cd233 from '@storybook/preview-api/dist/storybook-channel-mock-a19cd233';

declare const withActions: lib_preview_api_dist_storybook_channel_mock_a19cd233.M;

13 changes: 0 additions & 13 deletions patches/@storybook+html+7.0.0-rc.8.patch

This file was deleted.

13 changes: 13 additions & 0 deletions patches/@storybook+html+7.0.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/@storybook/html/dist/types-ccac9448.d.ts b/node_modules/@storybook/html/dist/types-ccac9448.d.ts
index a973f71..558cacb 100644
--- a/node_modules/@storybook/html/dist/types-ccac9448.d.ts
+++ b/node_modules/@storybook/html/dist/types-ccac9448.d.ts
@@ -1,6 +1,6 @@
import { PartialStoryFn, ArgsStoryFn, RenderContext, WebRenderer, StoryContext as StoryContext$1 } from '@storybook/types';
-import * as lib_docs_tools_dist from 'lib/docs-tools/dist';
-import * as lib_types_dist from 'lib/types/dist';
+import * as lib_docs_tools_dist from '@storybook/docs-tools/dist';
+import * as lib_types_dist from '@storybook/types/dist';

declare function sourceDecorator(storyFn: PartialStoryFn<HtmlRenderer>, context: StoryContext): StoryFnHtmlReturnType;

0 comments on commit 25071e6

Please sign in to comment.