Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement docsite for contrib packages #244

Merged
merged 14 commits into from
Oct 22, 2024
File renamed without changes.
8 changes: 4 additions & 4 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import type { Preview } from '@storybook/react';
import { FluentProvider, webLightTheme } from '@fluentui/react-components';

// TODO: import components and styles from the Fluent Storybook Addon when it is published
import { FluentDocsContainer } from './components/FluentDocsContainer';
import { FluentDocsPage } from './components/FluentDocsPage';
import './docs-root.css';
import './docs-root-v9.css';
import { FluentDocsContainer } from './copied-from-fluentui-core/components/FluentDocsContainer';
import { FluentDocsPage } from './copied-from-fluentui-core/components/FluentDocsPage';
import './copied-from-fluentui-core/docs-root.css';
import './copied-from-fluentui-core/docs-root-v9.css';

const preview: Preview = {
decorators: [
Expand Down
4 changes: 2 additions & 2 deletions apps/docsite/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"jsx": "react-jsx",
"allowJs": false,
Expand All @@ -12,6 +13,5 @@
{
"path": "./.storybook/tsconfig.base.json"
}
],
"extends": "../../tsconfig.base.json"
]
}
1 change: 1 addition & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"inputs": [
"default",
"^production",
"{workspaceRoot}/.storybook/**",
"{projectRoot}/.storybook/**/*",
"{projectRoot}/tsconfig.storybook.json"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { StorybookConfig } from '@storybook/react-webpack5';

// eslint-disable-next-line @nx/enforce-module-boundaries
import rootConfig from '../../../.storybook/main';
import rootConfig from '<%= rootOffset %>/.storybook/main';

const config: StorybookConfig = {
...rootConfig,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Preview } from '@storybook/react';

// eslint-disable-next-line @nx/enforce-module-boundaries
import rootPreview from '../../../.storybook/preview';
import rootPreview from '<%= rootOffset %>/.storybook/preview';

const preview: Preview = {
...rootPreview,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
, "outDir": ""
},
"files": [
"../../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../../node_modules/@nx/react/typings/image.d.ts"
"<%= rootOffset %>/node_modules/@nx/react/typings/styled-jsx.d.ts",
"<%= rootOffset %>/node_modules/@nx/react/typings/cssmodule.d.ts",
"<%= rootOffset %>/node_modules/@nx/react/typings/image.d.ts"
],
"exclude": ["../**/*.spec.ts" , "../**/*.spec.js", "../**/*.spec.tsx", "../**/*.spec.jsx"],
"include": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
readProjectConfiguration,
updateJson,
ProjectConfiguration,
offsetFromRoot,
} from '@nx/devkit';
import { configurationGenerator } from '@nx/storybook';
import * as path from 'path';
Expand Down Expand Up @@ -41,7 +42,10 @@ export default async function (
});

// add our boilerplate
generateFiles(tree, path.join(__dirname, 'files'), projectRoot, options);
generateFiles(tree, path.join(__dirname, 'files'), projectRoot, {
...offsetFromRoot,
rootOffset: [offsetFromRoot(projectRoot), '..'].join(''),
});
updateSolutionTsConfig(tree, { project });

await formatFiles(tree);
Expand Down
3 changes: 2 additions & 1 deletion packages/react-tree-grid/.storybook/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"../stories/**/*.stories.tsx",
"../stories/**/*.stories.mdx",
"*.ts",
"*.js"
"*.js",
"../stories/VariantB.stories.tsx"
]
}