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

chore(react-slider): properly apply nx migrate-converged-pkg to adhere to new dx setup #19517

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "revert(react-button): remove vNext components used in SB from devDeps that are stale",
"packageName": "@fluentui/react-button",
"email": "[email protected]",
"dependentChangeType": "none"
}
1 change: 0 additions & 1 deletion packages/react-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"storybook": "start-storybook"
},
"devDependencies": {
"@fluentui/react-menu": "^9.0.0-alpha.68",
"@fluentui/a11y-testing": "^0.1.0",
"@fluentui/babel-make-styles": "^9.0.0-alpha.40",
"@fluentui/eslint-plugin": "^1.4.1",
Expand Down
7 changes: 5 additions & 2 deletions packages/react-button/src/MenuButton.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import * as React from 'react';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
/* eslint-disable @typescript-eslint/ban-ts-comment */
// @ts-ignore
import { Menu, MenuItem, MenuList, MenuTrigger } from '@fluentui/react-menu';
// @ts-ignore
import type { MenuProps } from '@fluentui/react-menu';
/* eslint-enable @typescript-eslint/ban-ts-comment */

import { MenuButton } from './MenuButton';
import { Playground } from './Playground.stories';
import { buttonBaseProps } from './buttonBaseProps.stories';
import type { MenuProps } from '@fluentui/react-menu';
import type { MenuButtonProps } from './MenuButton';
import type { PlaygroundProps } from './Playground.types.stories';

Expand Down
3 changes: 3 additions & 0 deletions packages/react-slider/.babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["module:@fluentui/babel-make-styles", "annotate-pure-calls", "@babel/transform-react-pure-annotations"]
}
5 changes: 4 additions & 1 deletion packages/react-slider/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
const rootMain = require('../../../.storybook/main');

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

// add your own webpack tweaks if needed

return localConfig;
},
});
4 changes: 4 additions & 0 deletions packages/react-slider/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,3 +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 };
12 changes: 7 additions & 5 deletions packages/react-slider/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": "just-scripts jest-watch",
"test": "just-scripts test",
"update-snapshots": "just-scripts jest -u"
"start": "yarn storybook",
"test": "jest",
"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-slider/src && yarn docs",
"storybook": "start-storybook"
},
"devDependencies": {
"@fluentui/eslint-plugin": "^1.4.1",
Expand All @@ -37,7 +38,8 @@
"enzyme-adapter-react-16": "^1.15.0",
"react": "16.8.6",
"react-dom": "16.8.6",
"react-test-renderer": "^16.3.0"
"react-test-renderer": "^16.3.0",
"@fluentui/babel-make-styles": "^9.0.0-alpha.40"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This dependency should go on line 28 to maintain alphabetical order.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that this was added by migration generator not manually.

in general any kind of formatting/ordering should be handled by tooling automatically. for example nx already does this for tsconfig.base.json/nx.json/workspace.json -> we will implement those later on for our particular extended needs

ty!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
"dependencies": {
"@fluentui/react-make-styles": "^9.0.0-alpha.59",
Expand Down
7 changes: 3 additions & 4 deletions packages/react-slider/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
"extends": "../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"target": "ES5",
"target": "ES2019",
"module": "CommonJS",
"lib": ["es5", "dom"],
"lib": ["ES2019", "dom"],
"outDir": "dist",
"jsx": "react",
"declaration": true,
"experimentalDecorators": true,
"importHelpers": true,
"noUnusedLocals": true,
"preserveConstEnums": true,
"types": ["jest", "custom-global", "inline-style-expand-shorthand"],
"isolatedModules": true
"types": ["jest", "custom-global", "inline-style-expand-shorthand", "storybook__addons"]
}
}