diff --git a/code/frameworks/nextjs/template/cli/js/Configure.mdx b/code/frameworks/nextjs/template/cli/js/Configure.mdx new file mode 100644 index 000000000000..48ad8507160f --- /dev/null +++ b/code/frameworks/nextjs/template/cli/js/Configure.mdx @@ -0,0 +1,309 @@ +import { Meta } from '@storybook/blocks'; +import Image from 'next/image'; + +import Accessibility from "./assets/accessibility.svg"; +import Checkmark from "./assets/checkmark.svg"; +import Document from "./assets/document.svg"; +import Typography from "./assets/typography.svg"; +import Github from "./assets/github.svg"; +import Discord from "./assets/discord.svg"; +import Youtube from "./assets/youtube.svg"; +import Chromatic from "./assets/chromatic.svg"; +import Figma from "./assets/figma.svg"; +import Tutorials from "./assets/tutorials.svg"; +import Styling from "./assets/styling.jpg"; +import Context from "./assets/context.jpg"; +import Assets from "./assets/assets.jpg"; + + + +# Configure your project + +Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community. + +
+
+ A wall of logos representing different styling technologies +
+

Add styling and CSS

+

+ Like with web applications, there are many ways to include CSS within + Storybook. Learn more about setting up styling within Storybook. +

+ Read more on how to set up styling +
+
+
+ An abstraction representing the composition of data for a component +
+

Provide context and mocking

+

+ Often when a story doesn't render, it's because your component is + expecting a specific environment or context (like a theme provider) to + be available. Learn more about solving these issues by providing context + and mocking to Storybook. +

+ Read more on how to set up context +
+
+
+ A representation of typography and image assets +
+

Load assets and resources

+

+ To link static files (like fonts) to your projects and stories, use the + `staticDirs` configuration option to specify folders to load when + starting Storybook. +

+ Read more on how to load assets +
+
+
+ +# Do more with Storybook + +Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs. + +
+ +
+
+
+ +

Autodocs

+

+ Auto-generate living, interactive reference documentation from your + components and stories. +

+ Learn more +
+
+ +

Testing

+

+ Use stories to test a component in all its variations, no matter how + complex. +

+ Learn more +
+
+ +

Publish to Chromatic

+

+ Publish your Storybook to review and collaborate with your entire team. +

+ Learn more +
+
+ +

Figma Plugin

+

+ Embed your stories into Figma to cross-reference the design and live + implementation in one place. +

+ Learn more +
+
+ +

Accessibility

+

Automatically test your components for a11y issues as you develop.

+ Learn more +
+
+ +

Theming

+

Theme Storybook's UI to personalize it to your project.

+ Learn more +
+
+
+ +# Explore and Connect + +Connect with our community on Discord or start contributing directly on Github. You might also be interesting in watching some videos on Youtube explaining how to take full advantage of Storybook. + +
+ +
+
+ + + Discord + + + + Github + + + + Youtube + + + + Tutorials + +
+
+ + diff --git a/code/frameworks/nextjs/template/cli/js/Introduction.mdx b/code/frameworks/nextjs/template/cli/js/Introduction.mdx deleted file mode 100644 index 7055076a5273..000000000000 --- a/code/frameworks/nextjs/template/cli/js/Introduction.mdx +++ /dev/null @@ -1,230 +0,0 @@ -import { Meta } from '@storybook/blocks'; -import Image from 'next/image'; - -import Code from './assets/code-brackets.svg'; -import Colors from './assets/colors.svg'; -import Comments from './assets/comments.svg'; -import Direction from './assets/direction.svg'; -import Flow from './assets/flow.svg'; -import Plugin from './assets/plugin.svg'; -import Repo from './assets/repo.svg'; -import StackAlt from './assets/stackalt.svg'; - - - - - -# Welcome to Storybook - -Storybook helps you build UI components in isolation from your app's business logic, data, and context. -That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA. - -Browse example stories now by navigating to them in the sidebar. -View their code in the `stories` directory to learn how they work. -We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages. - -
Configure
- -
- -
- plugin -
- - Presets for popular tools - Easy setup for TypeScript, SCSS and more. - -
- -
- Build -
- - Build configuration - How to customize webpack and Babel - -
- -
- colors -
- - Styling - How to load and configure CSS libraries - -
- -
- flow -
- - Data - Providers and mocking for data libraries - -
-
- -
Learn
- -
- -
- repo -
- - Storybook documentation - Configure, customize, and extend - -
- -
- direction -
- - In-depth guides - Best practices from leading teams - -
- -
- code -
- - GitHub project - View the source and add issues - -
- -
- comments -
- - Discord chat - Chat with maintainers and the community - -
-
- -
- TipEdit the Markdown in stories/Introduction.mdx -
diff --git a/code/frameworks/nextjs/template/cli/ts-3-8/Configure.mdx b/code/frameworks/nextjs/template/cli/ts-3-8/Configure.mdx new file mode 100644 index 000000000000..48ad8507160f --- /dev/null +++ b/code/frameworks/nextjs/template/cli/ts-3-8/Configure.mdx @@ -0,0 +1,309 @@ +import { Meta } from '@storybook/blocks'; +import Image from 'next/image'; + +import Accessibility from "./assets/accessibility.svg"; +import Checkmark from "./assets/checkmark.svg"; +import Document from "./assets/document.svg"; +import Typography from "./assets/typography.svg"; +import Github from "./assets/github.svg"; +import Discord from "./assets/discord.svg"; +import Youtube from "./assets/youtube.svg"; +import Chromatic from "./assets/chromatic.svg"; +import Figma from "./assets/figma.svg"; +import Tutorials from "./assets/tutorials.svg"; +import Styling from "./assets/styling.jpg"; +import Context from "./assets/context.jpg"; +import Assets from "./assets/assets.jpg"; + + + +# Configure your project + +Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community. + +
+
+ A wall of logos representing different styling technologies +
+

Add styling and CSS

+

+ Like with web applications, there are many ways to include CSS within + Storybook. Learn more about setting up styling within Storybook. +

+ Read more on how to set up styling +
+
+
+ An abstraction representing the composition of data for a component +
+

Provide context and mocking

+

+ Often when a story doesn't render, it's because your component is + expecting a specific environment or context (like a theme provider) to + be available. Learn more about solving these issues by providing context + and mocking to Storybook. +

+ Read more on how to set up context +
+
+
+ A representation of typography and image assets +
+

Load assets and resources

+

+ To link static files (like fonts) to your projects and stories, use the + `staticDirs` configuration option to specify folders to load when + starting Storybook. +

+ Read more on how to load assets +
+
+
+ +# Do more with Storybook + +Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs. + +
+ +
+
+
+ +

Autodocs

+

+ Auto-generate living, interactive reference documentation from your + components and stories. +

+ Learn more +
+
+ +

Testing

+

+ Use stories to test a component in all its variations, no matter how + complex. +

+ Learn more +
+
+ +

Publish to Chromatic

+

+ Publish your Storybook to review and collaborate with your entire team. +

+ Learn more +
+
+ +

Figma Plugin

+

+ Embed your stories into Figma to cross-reference the design and live + implementation in one place. +

+ Learn more +
+
+ +

Accessibility

+

Automatically test your components for a11y issues as you develop.

+ Learn more +
+
+ +

Theming

+

Theme Storybook's UI to personalize it to your project.

+ Learn more +
+
+
+ +# Explore and Connect + +Connect with our community on Discord or start contributing directly on Github. You might also be interesting in watching some videos on Youtube explaining how to take full advantage of Storybook. + +
+ +
+
+ + + Discord + + + + Github + + + + Youtube + + + + Tutorials + +
+
+ + diff --git a/code/frameworks/nextjs/template/cli/ts-3-8/Introduction.mdx b/code/frameworks/nextjs/template/cli/ts-3-8/Introduction.mdx deleted file mode 100644 index 2418db1e8772..000000000000 --- a/code/frameworks/nextjs/template/cli/ts-3-8/Introduction.mdx +++ /dev/null @@ -1,230 +0,0 @@ -import { Meta } from '@storybook/blocks'; -import Image from 'next/image'; - -import Code from './assets/code-brackets.svg'; -import Colors from './assets/colors.svg'; -import Comments from './assets/comments.svg'; -import Direction from './assets/direction.svg'; -import Flow from './assets/flow.svg'; -import Plugin from './assets/plugin.svg'; -import Repo from './assets/repo.svg'; -import StackAlt from './assets/stackalt.svg'; - - - - - -# Welcome to Storybook - -Storybook helps you build UI components in isolation from your app's business logic, data, and context. -That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA. - -Browse example stories now by navigating to them in the sidebar. -View their code in the `stories` directory to learn how they work. -We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages. - -
Configure
- -
- -
- plugin -
- - Presets for popular tools - Easy setup for TypeScript, SCSS and more. - -
- -
- Build -
- - Build configuration - How to customize webpack and Babel - -
- -
- colors -
- - Styling - How to load and configure CSS libraries - -
- -
- flow -
- - Data - Providers and mocking for data libraries - -
-
- -
Learn
- -
- -
- repo -
- - Storybook documentation - Configure, customize, and extend - -
- -
- direction -
- - In-depth guides - Best practices from leading teams - -
- -
- code -
- - GitHub project - View the source and add issues - -
- -
- comments -
- - Discord chat - Chat with maintainers and the community - -
-
- -
- TipEdit the Markdown in stories/Introduction.mdx -
diff --git a/code/frameworks/nextjs/template/cli/ts-4-9/Configure.mdx b/code/frameworks/nextjs/template/cli/ts-4-9/Configure.mdx new file mode 100644 index 000000000000..48ad8507160f --- /dev/null +++ b/code/frameworks/nextjs/template/cli/ts-4-9/Configure.mdx @@ -0,0 +1,309 @@ +import { Meta } from '@storybook/blocks'; +import Image from 'next/image'; + +import Accessibility from "./assets/accessibility.svg"; +import Checkmark from "./assets/checkmark.svg"; +import Document from "./assets/document.svg"; +import Typography from "./assets/typography.svg"; +import Github from "./assets/github.svg"; +import Discord from "./assets/discord.svg"; +import Youtube from "./assets/youtube.svg"; +import Chromatic from "./assets/chromatic.svg"; +import Figma from "./assets/figma.svg"; +import Tutorials from "./assets/tutorials.svg"; +import Styling from "./assets/styling.jpg"; +import Context from "./assets/context.jpg"; +import Assets from "./assets/assets.jpg"; + + + +# Configure your project + +Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community. + +
+
+ A wall of logos representing different styling technologies +
+

Add styling and CSS

+

+ Like with web applications, there are many ways to include CSS within + Storybook. Learn more about setting up styling within Storybook. +

+ Read more on how to set up styling +
+
+
+ An abstraction representing the composition of data for a component +
+

Provide context and mocking

+

+ Often when a story doesn't render, it's because your component is + expecting a specific environment or context (like a theme provider) to + be available. Learn more about solving these issues by providing context + and mocking to Storybook. +

+ Read more on how to set up context +
+
+
+ A representation of typography and image assets +
+

Load assets and resources

+

+ To link static files (like fonts) to your projects and stories, use the + `staticDirs` configuration option to specify folders to load when + starting Storybook. +

+ Read more on how to load assets +
+
+
+ +# Do more with Storybook + +Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs. + +
+ +
+
+
+ +

Autodocs

+

+ Auto-generate living, interactive reference documentation from your + components and stories. +

+ Learn more +
+
+ +

Testing

+

+ Use stories to test a component in all its variations, no matter how + complex. +

+ Learn more +
+
+ +

Publish to Chromatic

+

+ Publish your Storybook to review and collaborate with your entire team. +

+ Learn more +
+
+ +

Figma Plugin

+

+ Embed your stories into Figma to cross-reference the design and live + implementation in one place. +

+ Learn more +
+
+ +

Accessibility

+

Automatically test your components for a11y issues as you develop.

+ Learn more +
+
+ +

Theming

+

Theme Storybook's UI to personalize it to your project.

+ Learn more +
+
+
+ +# Explore and Connect + +Connect with our community on Discord or start contributing directly on Github. You might also be interesting in watching some videos on Youtube explaining how to take full advantage of Storybook. + +
+ +
+
+ + + Discord + + + + Github + + + + Youtube + + + + Tutorials + +
+
+ + diff --git a/code/frameworks/nextjs/template/cli/ts-4-9/Introduction.mdx b/code/frameworks/nextjs/template/cli/ts-4-9/Introduction.mdx deleted file mode 100644 index 7055076a5273..000000000000 --- a/code/frameworks/nextjs/template/cli/ts-4-9/Introduction.mdx +++ /dev/null @@ -1,230 +0,0 @@ -import { Meta } from '@storybook/blocks'; -import Image from 'next/image'; - -import Code from './assets/code-brackets.svg'; -import Colors from './assets/colors.svg'; -import Comments from './assets/comments.svg'; -import Direction from './assets/direction.svg'; -import Flow from './assets/flow.svg'; -import Plugin from './assets/plugin.svg'; -import Repo from './assets/repo.svg'; -import StackAlt from './assets/stackalt.svg'; - - - - - -# Welcome to Storybook - -Storybook helps you build UI components in isolation from your app's business logic, data, and context. -That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA. - -Browse example stories now by navigating to them in the sidebar. -View their code in the `stories` directory to learn how they work. -We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages. - -
Configure
- -
- -
- plugin -
- - Presets for popular tools - Easy setup for TypeScript, SCSS and more. - -
- -
- Build -
- - Build configuration - How to customize webpack and Babel - -
- -
- colors -
- - Styling - How to load and configure CSS libraries - -
- -
- flow -
- - Data - Providers and mocking for data libraries - -
-
- -
Learn
- -
- -
- repo -
- - Storybook documentation - Configure, customize, and extend - -
- -
- direction -
- - In-depth guides - Best practices from leading teams - -
- -
- code -
- - GitHub project - View the source and add issues - -
- -
- comments -
- - Discord chat - Chat with maintainers and the community - -
-
- -
- TipEdit the Markdown in stories/Introduction.mdx -
diff --git a/code/frameworks/nextjs/template/stories/Image.stories.jsx b/code/frameworks/nextjs/template/stories/Image.stories.jsx index bf3808282a6f..7248b28dc9f2 100644 --- a/code/frameworks/nextjs/template/stories/Image.stories.jsx +++ b/code/frameworks/nextjs/template/stories/Image.stories.jsx @@ -1,13 +1,13 @@ import React from 'react'; import Image from 'next/image'; -import StackAlt from '../../assets/colors.svg'; +import Accessibility from '../../assets/accessibility.svg'; export default { component: Image, args: { - src: StackAlt, - alt: 'Stack Alt', + src: Accessibility, + alt: 'Accessibility', }, }; diff --git a/code/frameworks/nextjs/template/stories_nextjs-12-js/ImageFuture.stories.jsx b/code/frameworks/nextjs/template/stories_nextjs-12-js/ImageFuture.stories.jsx index 3c65960d585d..a2d642b6ece9 100644 --- a/code/frameworks/nextjs/template/stories_nextjs-12-js/ImageFuture.stories.jsx +++ b/code/frameworks/nextjs/template/stories_nextjs-12-js/ImageFuture.stories.jsx @@ -1,13 +1,13 @@ import React from 'react'; import Image from 'next/future/image'; -import StackAlt from '../../assets/colors.svg'; +import Accessibility from '../../assets/accessibility.svg'; export default { component: Image, args: { - src: StackAlt, - alt: 'Stack Alt', + src: Accessibility, + alt: 'Accessibility', }, }; diff --git a/code/lib/cli/rendererAssets/common/Configure.mdx b/code/lib/cli/rendererAssets/common/Configure.mdx new file mode 100644 index 000000000000..38f5a7502b49 --- /dev/null +++ b/code/lib/cli/rendererAssets/common/Configure.mdx @@ -0,0 +1,311 @@ +import { Meta } from "@storybook/blocks"; + +import Accessibility from "./assets/accessibility.svg"; +import Checkmark from "./assets/checkmark.svg"; +import Document from "./assets/document.svg"; +import Typography from "./assets/typography.svg"; +import Github from "./assets/github.svg"; +import Discord from "./assets/discord.svg"; +import Youtube from "./assets/youtube.svg"; +import Chromatic from "./assets/chromatic.svg"; +import Figma from "./assets/figma.svg"; +import Tutorials from "./assets/tutorials.svg"; +import Styling from "./assets/styling.jpg"; +import Context from "./assets/context.jpg"; +import Assets from "./assets/assets.jpg"; + + + +# Configure your project + +Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community. + +
+
+ A wall of logos representing different styling technologies +
+

Add styling and CSS

+

+ Like with web applications, there are many ways to include CSS within + Storybook. Learn more about setting up styling within Storybook. +

+ + Read more on how to set up styling + + +
+
+
+ An abstraction representing the composition of data for a component +
+

Provide context and mocking

+

+ Often when a story doesn't render, it's because your component is + expecting a specific environment or context (like a theme provider) to + be available. Learn more about solving these issues by providing context + and mocking to Storybook. +

+ Read more on how to set up context +
+
+
+ A representation of typography and image assets +
+

Load assets and resources

+

+ To link static files (like fonts) to your projects and stories, use the + `staticDirs` configuration option to specify folders to load when + starting Storybook. +

+ Read more on how to load assets +
+
+
+ +# Do more with Storybook + +Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs. + +
+ +
+
+
+ +

Autodocs

+

+ Auto-generate living, interactive reference documentation from your + components and stories. +

+ Learn more +
+
+ +

Testing

+

+ Use stories to test a component in all its variations, no matter how + complex. +

+ Learn more +
+
+ +

Publish to Chromatic

+

+ Publish your Storybook to review and collaborate with your entire team. +

+ Learn more +
+
+ +

Figma Plugin

+

+ Embed your stories into Figma to cross-reference the design and live + implementation in one place. +

+ Learn more +
+
+ +

Accessibility

+

Automatically test your components for a11y issues as you develop.

+ Learn more +
+
+ +

Theming

+

Theme Storybook's UI to personalize it to your project.

+ Learn more +
+
+
+ +# Explore and Connect + +Connect with our community on Discord or start contributing directly on Github. You might also be interesting in watching some videos on Youtube explaining how to take full advantage of Storybook. + +
+ +
+
+ + + Discord + + + + Github + + + + Youtube + + + + Tutorials + +
+
+ + diff --git a/code/lib/cli/rendererAssets/common/Introduction.mdx b/code/lib/cli/rendererAssets/common/Introduction.mdx deleted file mode 100644 index ff7fc71fbf8a..000000000000 --- a/code/lib/cli/rendererAssets/common/Introduction.mdx +++ /dev/null @@ -1,213 +0,0 @@ -import { Meta } from '@storybook/blocks'; -import Code from './assets/code-brackets.svg'; -import Colors from './assets/colors.svg'; -import Comments from './assets/comments.svg'; -import Direction from './assets/direction.svg'; -import Flow from './assets/flow.svg'; -import Plugin from './assets/plugin.svg'; -import Repo from './assets/repo.svg'; -import StackAlt from './assets/stackalt.svg'; - - - - - -# Welcome to Storybook - -Storybook helps you build UI components in isolation from your app's business logic, data, and context. -That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA. - -Browse example stories now by navigating to them in the sidebar. -View their code in the `stories` directory to learn how they work. -We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages. - -
Configure
- -
- - plugin - - Presets for popular tools - Easy setup for TypeScript, SCSS and more. - - - - Build - - Build configuration - How to customize webpack and Babel - - - - colors - - Styling - How to load and configure CSS libraries - - - - flow - - Data - Providers and mocking for data libraries - - -
- -
Learn
- -
- - repo - - Storybook documentation - Configure, customize, and extend - - - - direction - - In-depth guides - Best practices from leading teams - - - - code - - GitHub project - View the source and add issues - - - - comments - - Discord chat - Chat with maintainers and the community - - -
- -
- TipEdit the Markdown in{' '} - stories/Introduction.stories.mdx -
diff --git a/code/lib/cli/rendererAssets/common/assets/accessibility.svg b/code/lib/cli/rendererAssets/common/assets/accessibility.svg new file mode 100644 index 000000000000..00efad3d0b7e --- /dev/null +++ b/code/lib/cli/rendererAssets/common/assets/accessibility.svg @@ -0,0 +1,5 @@ + + Accessibility + + + diff --git a/code/lib/cli/rendererAssets/common/assets/assets.jpg b/code/lib/cli/rendererAssets/common/assets/assets.jpg new file mode 100644 index 000000000000..5390e31ec915 Binary files /dev/null and b/code/lib/cli/rendererAssets/common/assets/assets.jpg differ diff --git a/code/lib/cli/rendererAssets/common/assets/checkmark.svg b/code/lib/cli/rendererAssets/common/assets/checkmark.svg new file mode 100644 index 000000000000..b1de90119d58 --- /dev/null +++ b/code/lib/cli/rendererAssets/common/assets/checkmark.svg @@ -0,0 +1,5 @@ + + Checkmark + + + diff --git a/code/lib/cli/rendererAssets/common/assets/chromatic.svg b/code/lib/cli/rendererAssets/common/assets/chromatic.svg new file mode 100644 index 000000000000..80060821a939 --- /dev/null +++ b/code/lib/cli/rendererAssets/common/assets/chromatic.svg @@ -0,0 +1,5 @@ + + Chromatic logo + + + diff --git a/code/lib/cli/rendererAssets/common/assets/code-brackets.svg b/code/lib/cli/rendererAssets/common/assets/code-brackets.svg deleted file mode 100644 index 73de94776001..000000000000 --- a/code/lib/cli/rendererAssets/common/assets/code-brackets.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/code-brackets \ No newline at end of file diff --git a/code/lib/cli/rendererAssets/common/assets/colors.svg b/code/lib/cli/rendererAssets/common/assets/colors.svg deleted file mode 100644 index 17d58d516e14..000000000000 --- a/code/lib/cli/rendererAssets/common/assets/colors.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/colors \ No newline at end of file diff --git a/code/lib/cli/rendererAssets/common/assets/comments.svg b/code/lib/cli/rendererAssets/common/assets/comments.svg deleted file mode 100644 index 6493a139f523..000000000000 --- a/code/lib/cli/rendererAssets/common/assets/comments.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/comments \ No newline at end of file diff --git a/code/lib/cli/rendererAssets/common/assets/context.jpg b/code/lib/cli/rendererAssets/common/assets/context.jpg new file mode 100644 index 000000000000..763d0d871c85 Binary files /dev/null and b/code/lib/cli/rendererAssets/common/assets/context.jpg differ diff --git a/code/lib/cli/rendererAssets/common/assets/direction.svg b/code/lib/cli/rendererAssets/common/assets/direction.svg deleted file mode 100644 index 65676ac27229..000000000000 --- a/code/lib/cli/rendererAssets/common/assets/direction.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/direction \ No newline at end of file diff --git a/code/lib/cli/rendererAssets/common/assets/discord.svg b/code/lib/cli/rendererAssets/common/assets/discord.svg new file mode 100644 index 000000000000..5ab7196249e7 --- /dev/null +++ b/code/lib/cli/rendererAssets/common/assets/discord.svg @@ -0,0 +1,12 @@ + + Discord logo + + + + + + + + + + \ No newline at end of file diff --git a/code/lib/cli/rendererAssets/common/assets/document.svg b/code/lib/cli/rendererAssets/common/assets/document.svg new file mode 100644 index 000000000000..8e6e57986966 --- /dev/null +++ b/code/lib/cli/rendererAssets/common/assets/document.svg @@ -0,0 +1,11 @@ + + Document + + + + + + + + + diff --git a/code/lib/cli/rendererAssets/common/assets/figma.svg b/code/lib/cli/rendererAssets/common/assets/figma.svg new file mode 100644 index 000000000000..0fccef023d3f --- /dev/null +++ b/code/lib/cli/rendererAssets/common/assets/figma.svg @@ -0,0 +1,11 @@ + + Figma logo + + + + + + + + + \ No newline at end of file diff --git a/code/lib/cli/rendererAssets/common/assets/flow.svg b/code/lib/cli/rendererAssets/common/assets/flow.svg deleted file mode 100644 index 8ac27db403c2..000000000000 --- a/code/lib/cli/rendererAssets/common/assets/flow.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/flow \ No newline at end of file diff --git a/code/lib/cli/rendererAssets/common/assets/github.svg b/code/lib/cli/rendererAssets/common/assets/github.svg new file mode 100644 index 000000000000..7360edd5c731 --- /dev/null +++ b/code/lib/cli/rendererAssets/common/assets/github.svg @@ -0,0 +1,4 @@ + + Github logo + + \ No newline at end of file diff --git a/code/lib/cli/rendererAssets/common/assets/plugin.svg b/code/lib/cli/rendererAssets/common/assets/plugin.svg deleted file mode 100644 index 29e5c690c0a2..000000000000 --- a/code/lib/cli/rendererAssets/common/assets/plugin.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/plugin \ No newline at end of file diff --git a/code/lib/cli/rendererAssets/common/assets/repo.svg b/code/lib/cli/rendererAssets/common/assets/repo.svg deleted file mode 100644 index f386ee902c1f..000000000000 --- a/code/lib/cli/rendererAssets/common/assets/repo.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/repo \ No newline at end of file diff --git a/code/lib/cli/rendererAssets/common/assets/stackalt.svg b/code/lib/cli/rendererAssets/common/assets/stackalt.svg deleted file mode 100644 index 9b7ad2743506..000000000000 --- a/code/lib/cli/rendererAssets/common/assets/stackalt.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/stackalt \ No newline at end of file diff --git a/code/lib/cli/rendererAssets/common/assets/styling.jpg b/code/lib/cli/rendererAssets/common/assets/styling.jpg new file mode 100644 index 000000000000..0f6b37a4c8d4 Binary files /dev/null and b/code/lib/cli/rendererAssets/common/assets/styling.jpg differ diff --git a/code/lib/cli/rendererAssets/common/assets/tutorials.svg b/code/lib/cli/rendererAssets/common/assets/tutorials.svg new file mode 100644 index 000000000000..bd08af920bd9 --- /dev/null +++ b/code/lib/cli/rendererAssets/common/assets/tutorials.svg @@ -0,0 +1,8 @@ + + Tutorials + + + + + + \ No newline at end of file diff --git a/code/lib/cli/rendererAssets/common/assets/typography.svg b/code/lib/cli/rendererAssets/common/assets/typography.svg new file mode 100644 index 000000000000..f2a18909b68b --- /dev/null +++ b/code/lib/cli/rendererAssets/common/assets/typography.svg @@ -0,0 +1,4 @@ + + Typography + + diff --git a/code/lib/cli/rendererAssets/common/assets/youtube.svg b/code/lib/cli/rendererAssets/common/assets/youtube.svg new file mode 100644 index 000000000000..ab37d73a062e --- /dev/null +++ b/code/lib/cli/rendererAssets/common/assets/youtube.svg @@ -0,0 +1,5 @@ + + Youtube logo + + + \ No newline at end of file diff --git a/code/lib/cli/src/helpers.ts b/code/lib/cli/src/helpers.ts index c86abe299bf2..b72e625ad716 100644 --- a/code/lib/cli/src/helpers.ts +++ b/code/lib/cli/src/helpers.ts @@ -1,8 +1,8 @@ /* eslint-disable no-param-reassign */ -import path, { join } from 'path'; +import chalk from 'chalk'; import fs from 'fs'; import fse from 'fs-extra'; -import chalk from 'chalk'; +import path, { join } from 'path'; import { satisfies } from 'semver'; import stripJsonComments from 'strip-json-comments'; @@ -186,6 +186,24 @@ type CopyTemplateFilesOptions = { destination?: string; }; +const frameworkToRenderer: Record = { + angular: 'angular', + ember: 'ember', + html: 'html', + nextjs: 'react', + preact: 'preact', + qwik: 'qwik', + react: 'react', + 'react-native': 'react', + server: 'react', + solid: 'solid', + svelte: 'svelte', + sveltekit: 'svelte', + vue: 'vue', + vue3: 'vue', + 'web-components': 'web-components', +}; + export async function copyTemplateFiles({ packageManager, renderer, @@ -246,6 +264,23 @@ export async function copyTemplateFiles({ }); } await fse.copy(await templatePath(), destinationPath, { overwrite: true }); + + if (includeCommonAssets) { + const rendererType = frameworkToRenderer[renderer] || 'react'; + await adjustTemplate(join(destinationPath, 'Configure.mdx'), { renderer: rendererType }); + } +} + +export async function adjustTemplate(templatePath: string, templateData: Record) { + // for now, we're just doing a simple string replace + // in the future we might replace this with a proper templating engine + let template = await fse.readFile(templatePath, 'utf8'); + + Object.keys(templateData).forEach((key) => { + template = template.replaceAll(`{{${key}}}`, `${templateData[key]}`); + }); + + await fse.writeFile(templatePath, template); } // Given a package.json, finds any official storybook package within it