diff --git a/packages/react-slider/.babelrc.json b/packages/react-slider/.babelrc.json new file mode 100644 index 00000000000000..b51a5457ced106 --- /dev/null +++ b/packages/react-slider/.babelrc.json @@ -0,0 +1,3 @@ +{ + "plugins": ["module:@fluentui/babel-make-styles", "annotate-pure-calls", "@babel/transform-react-pure-annotations"] +} diff --git a/packages/react-slider/.storybook/main.js b/packages/react-slider/.storybook/main.js index f47245f2d07f01..18a60b265c2cfb 100644 --- a/packages/react-slider/.storybook/main.js +++ b/packages/react-slider/.storybook/main.js @@ -1,11 +1,14 @@ const rootMain = require('../../../.storybook/main'); -module.exports = /** @type {Pick} */ ({ +module.exports = /** @type {Omit} */ ({ + ...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; }, }); diff --git a/packages/react-slider/.storybook/preview.js b/packages/react-slider/.storybook/preview.js index b52409294c3304..10fd98d02c9454 100644 --- a/packages/react-slider/.storybook/preview.js +++ b/packages/react-slider/.storybook/preview.js @@ -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 }; diff --git a/packages/react-slider/package.json b/packages/react-slider/package.json index c9cdd078d9f19e..a527d8b99a51ee 100644 --- a/packages/react-slider/package.json +++ b/packages/react-slider/package.json @@ -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", @@ -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": "*" }, "dependencies": { "@fluentui/react-make-styles": "^9.0.0-alpha.59", diff --git a/packages/react-slider/tsconfig.json b/packages/react-slider/tsconfig.json index 851c909e1eadf8..6bf6c152b13983 100644 --- a/packages/react-slider/tsconfig.json +++ b/packages/react-slider/tsconfig.json @@ -2,9 +2,9 @@ "extends": "../../tsconfig.base.json", "include": ["src"], "compilerOptions": { - "target": "ES5", + "target": "ES2020", "module": "CommonJS", - "lib": ["es5", "dom"], + "lib": ["ES2020", "dom"], "outDir": "dist", "jsx": "react", "declaration": true, @@ -12,7 +12,6 @@ "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"] } }