-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add upgrade-examples app with v8 and v9 working together (#22226)
* add upgrade-examples app with v8 and v9 working together * fix version * remove changelog files
- Loading branch information
1 parent
3e9421d
commit 5cda30f
Showing
11 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": ["plugin:@fluentui/eslint-plugin/react--legacy"], | ||
"root": true, | ||
"rules": { | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/jsx-no-bind": "off", | ||
"deprecation/deprecation": "off", | ||
"import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const path = require('path'); | ||
const custom = require('@fluentui/scripts/storybook/webpack.config'); | ||
|
||
module.exports = { | ||
stories: ['../src/**/*.stories.tsx'], | ||
core: { | ||
builder: 'webpack5', | ||
}, | ||
babel: {}, | ||
typescript: { | ||
// disable react-docgen-typescript (totally not needed here, slows things down a lot) | ||
reactDocgen: false, | ||
}, | ||
webpackFinal: config => { | ||
return custom(config); | ||
}, | ||
addons: ['@storybook/addon-actions'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { preset, task } from '@fluentui/scripts'; | ||
|
||
preset(); | ||
|
||
task('build', 'build:node-lib').cached(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "@fluentui/upgrade-examples-v8-v9", | ||
"version": "1.0.0", | ||
"private": true, | ||
"description": "A collection of examples demonstrating how to upgrade from v8 to v9", | ||
"scripts": { | ||
"build": "just-scripts build", | ||
"build-storybook": "build-storybook -s ./public -o ./dist/storybook --docs", | ||
"chromatic": "npx [email protected] --project-token $CHROMATIC_PROJECT_TOKEN --exit-zero-on-changes --build-script-name build-storybook", | ||
"clean": "just-scripts clean", | ||
"code-style": "just-scripts code-style", | ||
"just": "just-scripts", | ||
"lint": "just-scripts lint", | ||
"start": "just-scripts dev:storybook" | ||
}, | ||
"devDependencies": { | ||
"@fluentui/eslint-plugin": "*" | ||
}, | ||
"dependencies": { | ||
"@fluentui/react": "^8.62.4", | ||
"@fluentui/scripts": "^1.0.0", | ||
"@fluentui/storybook": "^1.0.0", | ||
"@fluentui/react-components": "^9.0.0-rc.6", | ||
"react": "16.14.0", | ||
"react-dom": "16.14.0", | ||
"tslib": "^2.1.0" | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions
20
apps/upgrade-examples-v8-v9/src/stories/Button.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as React from 'react'; | ||
import { DefaultButton } from '@fluentui/react/lib/Button'; | ||
import { Button, webLightTheme, FluentProvider } from '@fluentui/react-components'; | ||
|
||
export default { | ||
title: 'Button', | ||
component: DefaultButton, | ||
}; | ||
|
||
export const v8 = () => <DefaultButton>Click me</DefaultButton>; | ||
export const v9 = () => ( | ||
<FluentProvider theme={webLightTheme}> | ||
<Button>No Click Me</Button> | ||
</FluentProvider> | ||
); | ||
export const Both = () => ( | ||
<FluentProvider theme={webLightTheme}> | ||
<DefaultButton>Click me</DefaultButton> <Button>No Click Me</Button> | ||
</FluentProvider> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"outDir": "lib", | ||
"module": "commonjs", | ||
"jsx": "react", | ||
"declaration": true, | ||
"sourceMap": true, | ||
"noEmit": true, | ||
"experimentalDecorators": true, | ||
"noUnusedLocals": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"strictNullChecks": true, | ||
"noImplicitAny": true, | ||
"moduleResolution": "node", | ||
"preserveConstEnums": true, | ||
"skipLibCheck": true, | ||
"types": ["webpack-env", "@storybook/react", "screener-storybook"] | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters