storybookjs / aem

Adobe Experience Manager Storybook app with events, knobs, docs, addons, and more
https://storybook-aem.netlify.com/
MIT License
33 stars 24 forks source link

feat Use non-alpha storybook 6.* #154

Open davidrmckinnon opened 3 years ago

davidrmckinnon commented 3 years ago

storybook/aem currently uses storybook v6.0.0-alpha.2

It would be preferable to use the latest v6.* release (https://github.com/storybookjs/storybook/releases/tag/v6.3.4) storybook-aem-154-upgrade-available

This is not a trivial task, however, and requires a more comprehensive update to dependencies.

Not surprisingly, just updating @storybook/core in app/aem results in errors when running yarn build

@storybook/aem-cli: src/cmds/content/contentFromStories.ts(14,31): error TS2339: Property 'ok' does not exist on type 'void | Response'.
@storybook/aem-cli:   Property 'ok' does not exist on type 'void'.
@storybook/aem-cli: src/cmds/content/contentFromStories.ts(15,46): error TS2339: Property 'json' does not exist on type 'void | Response'.
@storybook/aem-cli:   Property 'json' does not exist on type 'void'.
@storybook/aem-cli: src/cmds/content/contentFromStories.ts(27,32): error TS2339: Property 'status' does not exist on type 'void | Response'.
@storybook/aem-cli:   Property 'status' does not exist on type 'void'.
@storybook/aem-cli: src/utils/createPage.ts(10,22): error TS2339: Property 'ok' does not exist on type 'void | Response'.
@storybook/aem-cli:   Property 'ok' does not exist on type 'void'.
@storybook/aem-cli: src/utils/createPageJCRContent.ts(17,22): error TS2339: Property 'ok' does not exist on type 'void | Response'.
@storybook/aem-cli:   Property 'ok' does not exist on type 'void'.
@storybook/aem-cli: src/utils/createStories.ts(47,31): error TS2339: Property 'ok' does not exist on type 'void | Response'.
@storybook/aem-cli:   Property 'ok' does not exist on type 'void'.
@storybook/aem: src/client/preview/index.ts(23,19): error TS2345: Argument of type '({ storyFn, selectedKind, selectedStory, showMain, showError, forceRender, }: RenderMainArgs) => Promise<void>' is not assignable to parameter of type 'RenderStoryFunction'.
@storybook/aem:   Types of parameters '__0' and 'context' are incompatible.
@storybook/aem:     Type 'RenderContext' is missing the following properties from type 'RenderMainArgs': selectedKind, selectedStory
@storybook/aem: src/client/preview/index.ts(31,86): error TS2556: Expected 3-4 arguments, but got 1 or more.
@storybook/aem: src/client/preview/index.ts(32,14): error TS2322: Type '(decorator: DecoratorFunction<unknown>) => void' is not assignable to type '(decorator: DecoratorFunction<StoryFnAemReturnType>) => StoryApi<StoryFnAemReturnType>'.
@storybook/aem:   Types of parameters 'decorator' and 'decorator' are incompatible.
@storybook/aem:     Types of parameters 'fn' and 'fn' are incompatible.
@storybook/aem:       Type 'PartialStoryFn<unknown>' is not assignable to type 'StoryFn<StoryFnAemReturnType>'.
@storybook/aem:         Types of parameters 'p' and 'p' are incompatible.
@storybook/aem:           Type 'StoryContext' is not assignable to type 'Partial<StoryContext>'.
@storybook/aem:             The types of 'hooks.currentContext' are incompatible between these types.
@storybook/aem:               Type 'import("/Users/dmckinnon/Documents/GitHub/aem/node_modules/@storybook/addons/dist/types").StoryContext' is not assignable to type 'import("/Users/dmckinnon/Documents/GitHub/aem/node_modules/@storybook/core-client/node_modules/@storybook/addons/dist/ts3.9/types").StoryContext'.
@storybook/aem:                 Type 'StoryContext' is missing the following properties from type '{ [key: string]: any; parameters: Parameters; args: Args; argTypes: ArgTypes; globals: Args; hooks?: HooksContext; viewMode?: ViewMode; originalStoryFn?: ArgsStoryFn<...>; }': args, argTypes, globals
@storybook/aem: src/client/preview/index.ts(33,14): error TS2322: Type '(parameters: Parameters) => void' is not assignable to type '(parameter: Parameters) => StoryApi<StoryFnAemReturnType>'.
@storybook/aem:   Type 'void' is not assignable to type 'StoryApi<StoryFnAemReturnType>'.

Which results in a broken build

ERROR in /aem/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/clientlibs/site/css.txt (/aem/app/aem/dist/server/aem-clientlib-txt-loader.js!/aem/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/clientlibs/site/css.txt)
Module not found: Error: Can't resolve 'less-loader' in '/aem/examples/aem-kitchen-sink'
 @ /aem/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/clientlibs/site/css.txt (/aem/app/aem/dist/server/aem-clientlib-txt-loader.js!/aem/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/clientlibs/site/css.txt) 1:0-158
 @ /aem/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image sync !/aem/app/aem/dist/server/aem-clientlib-txt-loader.js (^|\/)(js|css).txt$
 @ /aem/aem-sb-js-core-components/src/jcr_root/apps/core/wcm/components/image/v2/image/.content.xml
 @ /aem/aem-sb-js-core-components/components.js
 @ /aem/aem-sb-js-core-components/index.js
 @ ./.storybook/preview.js
 @ ./.storybook/preview.js-generated-config-entry.js
 @ multi /aem/node_modules/@storybook/core-client/dist/esm/globals/polyfills.js /aem/node_modules/@storybook/core-client/dist/esm/globals/globals.js ./.storybook/storybook-init-framework-entry.js /aem/node_modules/@storybook/addon-docs/dist/frameworks/common/config.js-generated-other-entry.js /aem/node_modules/@storybook/addon-knobs/dist/preset/addDecorator.js-generated-other-entry.js ./.storybook/preview.js-generated-config-entry.js ./.storybook/generated-stories-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined