Skip to content

Commit

Permalink
chore(react-storybook): migrate to new DX stage 1 (microsoft#19037)
Browse files Browse the repository at this point in the history
* chore(react-storybook): migrate to new DX stage 1
* chore: update codeowners for storybook packages
  • Loading branch information
Hotell authored and PeterDraex committed Aug 6, 2021
1 parent 3da1e25 commit d32571c
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ packages/react-focus/ @microsoft/cxe-red @khmakoto
packages/react-image/ @microsoft/cxe-prg
packages/react-text/ @microsoft/cxe-prg
packages/react-input/ @microsoft/cxe-red @ecraig12345
packages/react-storybook/ @microsoft/cxe-prg @ling1726 @layershifter
packages/storybook/ @microsoft/cxe-prg @ling1726 @layershifter
packages/react-storybook/ @microsoft/cxe-prg @microsoft/teams-prg
packages/storybook/ @microsoft/cxe-prg @microsoft/teams-prg
packages/react-link/ @microsoft/cxe-red @khmakoto
packages/react-slider/ @microsoft/cxe-red
packages/react-tabs/ @microsoft/cxe-red @behowell
Expand Down
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"@fluentui/react-positioning": { "tags": ["vNext"], "implicitDependencies": [] },
"@fluentui/react-provider": { "tags": ["vNext", "platform:web"], "implicitDependencies": [] },
"@fluentui/react-shared-contexts": { "tags": ["vNext", "platform:web"], "implicitDependencies": [] },
"@fluentui/react-storybook": { "implicitDependencies": [] },
"@fluentui/react-storybook": { "tags": ["vNext", "platform:web"], "implicitDependencies": [] },
"@fluentui/react-tabs": { "implicitDependencies": [] },
"@fluentui/react-tabster": { "tags": ["vNext", "platform:web"], "implicitDependencies": [] },
"@fluentui/react-text": { "tags": ["vNext", "platform:web"], "implicitDependencies": [] },
Expand Down
11 changes: 11 additions & 0 deletions packages/react-storybook/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const rootMain = require('../../../.storybook/main');

module.exports = /** @type {Pick<import('../../../.storybook/main').StorybookConfig,'addons'|'stories'|'webpackFinal'>} */ ({
stories: [...rootMain.stories, '../src/**/*.stories.mdx', '../src/**/*.stories.@(ts|tsx)'],
addons: [...rootMain.addons],
webpackFinal: (config, options) => {
const localConfig = { ...rootMain.webpackFinal(config, options) };

return localConfig;
},
});
7 changes: 7 additions & 0 deletions packages/react-storybook/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as rootPreview from '../../../.storybook/preview';

/** @type {typeof rootPreview.decorators} */
export const decorators = [...rootPreview.decorators];

/** @type {typeof rootPreview.parameters} */
export const parameters = { ...rootPreview.parameters };
9 changes: 9 additions & 0 deletions packages/react-storybook/.storybook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true
},
"exclude": ["../**/*.test.ts", "../**/*.test.js", "../**/*.test.tsx", "../**/*.test.jsx"],
"include": ["../src/**/*", "*.js"]
}
1 change: 1 addition & 0 deletions packages/react-storybook/config/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "@fluentui/scripts/api-extractor/api-extractor.common.json"
}
5 changes: 5 additions & 0 deletions packages/react-storybook/config/api-extractor.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "./api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist/<unscopedPackageName>/src/index.d.ts"
}
7 changes: 4 additions & 3 deletions packages/react-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
"code-style": "just-scripts code-style",
"just": "just-scripts",
"lint": "just-scripts lint",
"start": "just-scripts dev:storybook",
"start-test": "echo \"This is DEPRECATED instead use 'test --watch'\" && just-scripts jest-watch",
"start": "yarn storybook",
"test": "jest",
"update-snapshots": "echo \"This is DEPRECATED instead use 'test -u'\" && just-scripts jest -u"
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
"build:local": "tsc -p . --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output dist/react-storybook/src && yarn docs",
"storybook": "start-storybook"
},
"devDependencies": {
"@fluentui/eslint-plugin": "^1.3.2",
Expand Down
9 changes: 5 additions & 4 deletions packages/react-storybook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"target": "es5",
"target": "ES5",
"module": "CommonJS",
"lib": ["ES2015", "dom"],
"outDir": "dist",
"jsx": "react",
"declaration": true,
"experimentalDecorators": true,
"importHelpers": true,
"noUnusedLocals": true,
"preserveConstEnums": true,
"types": ["jest", "custom-global", "inline-style-expand-shorthand"]
},
"include": ["src"]
"types": ["jest", "custom-global", "inline-style-expand-shorthand", "storybook__addons"]
}
}
6 changes: 5 additions & 1 deletion workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@
"projectType": "library",
"sourceRoot": "packages/react-shared-contexts/src"
},
"@fluentui/react-storybook": { "root": "packages/react-storybook", "projectType": "library" },
"@fluentui/react-storybook": {
"root": "packages/react-storybook",
"projectType": "library",
"sourceRoot": "packages/react-storybook/src"
},
"@fluentui/react-tabs": { "root": "packages/react-tabs", "projectType": "library" },
"@fluentui/react-tabster": {
"root": "packages/react-tabster",
Expand Down

0 comments on commit d32571c

Please sign in to comment.