From f472b7b8b893b2b076bc47da294d308cb956f1b6 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Wed, 24 Nov 2021 09:18:08 +0100 Subject: [PATCH] chore: run migration for @fluentui/react-make-styles (#20728) * chore: run migration for @fluentui/react-make-styles * Change files * add configs --- ...-bb29a443-6d63-44da-b0ac-a49004304a0b.json | 7 +++++ packages/react-make-styles/.npmignore | 1 - packages/react-make-styles/.storybook/main.js | 6 ++-- .../react-make-styles/.storybook/preview.js | 4 +++ .../.storybook/tsconfig.json | 7 +++-- .../config/api-extractor.local.json | 2 +- packages/react-make-styles/jest.config.js | 2 +- packages/react-make-styles/package.json | 5 ++-- packages/react-make-styles/tsconfig.json | 29 ++++++++++++------- packages/react-make-styles/tsconfig.lib.json | 12 ++++++++ packages/react-make-styles/tsconfig.spec.json | 9 ++++++ 11 files changed, 63 insertions(+), 21 deletions(-) create mode 100644 change/@fluentui-react-make-styles-bb29a443-6d63-44da-b0ac-a49004304a0b.json create mode 100644 packages/react-make-styles/tsconfig.lib.json create mode 100644 packages/react-make-styles/tsconfig.spec.json diff --git a/change/@fluentui-react-make-styles-bb29a443-6d63-44da-b0ac-a49004304a0b.json b/change/@fluentui-react-make-styles-bb29a443-6d63-44da-b0ac-a49004304a0b.json new file mode 100644 index 0000000000000..58df003c98b1c --- /dev/null +++ b/change/@fluentui-react-make-styles-bb29a443-6d63-44da-b0ac-a49004304a0b.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "update tooling configs", + "packageName": "@fluentui/react-make-styles", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/packages/react-make-styles/.npmignore b/packages/react-make-styles/.npmignore index fa2d3a7f5111c..e719afb921bc9 100644 --- a/packages/react-make-styles/.npmignore +++ b/packages/react-make-styles/.npmignore @@ -1,4 +1,3 @@ -.cache/ .storybook/ .vscode/ bundle-size/ diff --git a/packages/react-make-styles/.storybook/main.js b/packages/react-make-styles/.storybook/main.js index ec377d98606fa..18a60b265c2cf 100644 --- a/packages/react-make-styles/.storybook/main.js +++ b/packages/react-make-styles/.storybook/main.js @@ -1,12 +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; }, - previewHead: rootMain.previewHead, }); diff --git a/packages/react-make-styles/.storybook/preview.js b/packages/react-make-styles/.storybook/preview.js index b52409294c330..10fd98d02c945 100644 --- a/packages/react-make-styles/.storybook/preview.js +++ b/packages/react-make-styles/.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-make-styles/.storybook/tsconfig.json b/packages/react-make-styles/.storybook/tsconfig.json index 3bd9adcd2ee05..29aa16f2f178f 100644 --- a/packages/react-make-styles/.storybook/tsconfig.json +++ b/packages/react-make-styles/.storybook/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "outDir": "", "allowJs": true, - "checkJs": true + "checkJs": true, + "types": ["static-assets", "environment", "inline-style-expand-shorthand", "storybook__addons"] }, - "exclude": ["../**/*.test.ts", "../**/*.test.js", "../**/*.test.tsx", "../**/*.test.jsx"], - "include": ["../src/**/*", "*.js"] + "include": ["../src/**/*.stories.ts", "../src/**/*.stories.tsx", "*.js"] } diff --git a/packages/react-make-styles/config/api-extractor.local.json b/packages/react-make-styles/config/api-extractor.local.json index c2ea401c1c368..7974a129e8a33 100644 --- a/packages/react-make-styles/config/api-extractor.local.json +++ b/packages/react-make-styles/config/api-extractor.local.json @@ -1,5 +1,5 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "extends": "./api-extractor.json", - "mainEntryPointFilePath": "/dist//src/index.d.ts" + "mainEntryPointFilePath": "/dist/packages//src/index.d.ts" } diff --git a/packages/react-make-styles/jest.config.js b/packages/react-make-styles/jest.config.js index 2ecd2f796375d..6686ee6bf8b94 100644 --- a/packages/react-make-styles/jest.config.js +++ b/packages/react-make-styles/jest.config.js @@ -8,7 +8,7 @@ module.exports = { preset: '../../jest.preset.js', globals: { 'ts-jest': { - tsConfig: '/tsconfig.json', + tsConfig: '/tsconfig.spec.json', diagnostics: false, }, }, diff --git a/packages/react-make-styles/package.json b/packages/react-make-styles/package.json index 56db91bc755d7..82f2cec6e5948 100644 --- a/packages/react-make-styles/package.json +++ b/packages/react-make-styles/package.json @@ -21,8 +21,9 @@ "test": "jest", "start": "yarn storybook", "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-make-styles/src && yarn docs", - "storybook": "start-storybook" + "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-make-styles/src && yarn docs", + "storybook": "start-storybook", + "type-check": "tsc -b tsconfig.json" }, "devDependencies": { "@fluentui/eslint-plugin": "*", diff --git a/packages/react-make-styles/tsconfig.json b/packages/react-make-styles/tsconfig.json index d0ba217d5e49b..affceae1828ae 100644 --- a/packages/react-make-styles/tsconfig.json +++ b/packages/react-make-styles/tsconfig.json @@ -1,18 +1,25 @@ { "extends": "../../tsconfig.base.json", - "include": ["src"], "compilerOptions": { "target": "ES2019", - "module": "CommonJS", - "lib": ["ES2019", "DOM"], - "outDir": "dist", - "jsx": "react", - "declaration": true, - "experimentalDecorators": true, + "noEmit": true, + "isolatedModules": true, "importHelpers": true, + "jsx": "react", "noUnusedLocals": true, - "preserveConstEnums": true, - "types": ["jest", "custom-global", "inline-style-expand-shorthand"], - "isolatedModules": true - } + "preserveConstEnums": true + }, + "include": [], + "files": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + }, + { + "path": "./.storybook/tsconfig.json" + } + ] } diff --git a/packages/react-make-styles/tsconfig.lib.json b/packages/react-make-styles/tsconfig.lib.json new file mode 100644 index 0000000000000..51f5726b71c68 --- /dev/null +++ b/packages/react-make-styles/tsconfig.lib.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "lib": ["ES2019", "dom"], + "outDir": "dist", + "declaration": true, + "types": ["static-assets", "environment", "inline-style-expand-shorthand"] + }, + "exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.stories.ts", "**/*.stories.tsx"], + "include": ["./src/**/*.ts", "./src/**/*.tsx"] +} diff --git a/packages/react-make-styles/tsconfig.spec.json b/packages/react-make-styles/tsconfig.spec.json new file mode 100644 index 0000000000000..28fa5226de420 --- /dev/null +++ b/packages/react-make-styles/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "CommonJS", + "outDir": "dist", + "types": ["jest", "node", "inline-style-expand-shorthand"] + }, + "include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"] +}