Skip to content

Commit

Permalink
poc: storybook build
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranayub committed Nov 9, 2023
1 parent b07d20f commit f4d7291
Show file tree
Hide file tree
Showing 6 changed files with 3,255 additions and 54 deletions.
2 changes: 2 additions & 0 deletions site/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

/static/examples
19 changes: 19 additions & 0 deletions site/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Config } from '@docusaurus/types';
import { Options as ClassicPresetOptions, ThemeConfig as ClassicPresetThemeConfig } from '@docusaurus/preset-classic';
import { ReflectionKind } from 'typedoc';
import { sync as readUpSync } from 'read-pkg-up';
import { buildStaticStandalone } from '@storybook/core-server';
import { cache } from '@storybook/core-common';
import path from 'path';
import webpack from 'webpack';
import { themes } from 'prism-react-renderer';
Expand Down Expand Up @@ -76,6 +79,21 @@ const config: Config = {
themes: ['@docusaurus/theme-live-codeblock'],

plugins: [
async function storybookPlugin(context, options) {
return {
name: 'storybook-plugin',
async loadContent() {
await buildStaticStandalone({
configDir: path.join(__dirname, '..', '.storybook'),
outputDir: path.join(__dirname, 'static', 'examples'),
ignorePreview: false,
configType: 'PRODUCTION',
cache,
packageJson: readUpSync({ cwd: __dirname }).packageJson
});
}
};
},
async function excaliburPlugin(context, options) {
return {
name: 'excalibur-plugin',
Expand Down Expand Up @@ -151,6 +169,7 @@ const config: Config = {
label: 'Learn'
},
{ to: '/api', label: 'API', position: 'left' },
{ href: '/examples', label: 'Examples', position: 'left' },
{ to: '/blog', label: 'Blog', position: 'left' },
{
href: 'https://github.com/excaliburjs/Excalibur',
Expand Down
Loading

0 comments on commit f4d7291

Please sign in to comment.