diff --git a/change/@fluentui-react-text-00169b13-dac3-465c-b9c0-898b76a7c8b8.json b/change/@fluentui-react-text-00169b13-dac3-465c-b9c0-898b76a7c8b8.json new file mode 100644 index 00000000000000..a6899f9aa833e8 --- /dev/null +++ b/change/@fluentui-react-text-00169b13-dac3-465c-b9c0-898b76a7c8b8.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Migrate Text", + "packageName": "@fluentui/react-text", + "email": "andredias@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-text/.storybook/main.js b/packages/react-text/.storybook/main.js index 54cd5474023a58..18a60b265c2cfb 100644 --- a/packages/react-text/.storybook/main.js +++ b/packages/react-text/.storybook/main.js @@ -11,5 +11,4 @@ module.exports = /** @type {Omit/tsconfig.json', + tsConfig: '/tsconfig.spec.json', diagnostics: false, }, }, diff --git a/packages/react-text/package.json b/packages/react-text/package.json index 57bbbc4f5eafa1..5b405db1f27dae 100644 --- a/packages/react-text/package.json +++ b/packages/react-text/package.json @@ -21,8 +21,9 @@ "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/packages/react-text/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-text/src && yarn docs", + "storybook": "start-storybook", + "type-check": "tsc -b tsconfig.json" }, "devDependencies": { "@fluentui/babel-make-styles": "9.0.0-beta.3", diff --git a/packages/react-text/tsconfig.json b/packages/react-text/tsconfig.json index bcaad318d3d265..affceae1828ae1 100644 --- a/packages/react-text/tsconfig.json +++ b/packages/react-text/tsconfig.json @@ -1,24 +1,25 @@ { "extends": "../../tsconfig.base.json", - "include": ["src"], "compilerOptions": { "target": "ES2019", + "noEmit": true, "isolatedModules": true, - "module": "CommonJS", - "lib": ["ES2019", "dom"], - "outDir": "dist", - "jsx": "react", - "declaration": true, - "experimentalDecorators": true, "importHelpers": true, + "jsx": "react", "noUnusedLocals": true, - "preserveConstEnums": true, - "types": [ - "jest", - "custom-global", - "inline-style-expand-shorthand", - "@testing-library/jest-dom", - "storybook__addons" - ] - } + "preserveConstEnums": true + }, + "include": [], + "files": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + }, + { + "path": "./.storybook/tsconfig.json" + } + ] } diff --git a/packages/react-text/tsconfig.lib.json b/packages/react-text/tsconfig.lib.json new file mode 100644 index 00000000000000..b83999c31f8a32 --- /dev/null +++ b/packages/react-text/tsconfig.lib.json @@ -0,0 +1,20 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "lib": ["ES2019", "dom"], + "outDir": "dist", + "declaration": true, + "types": ["static-assets", "environment", "inline-style-expand-shorthand"] + }, + "exclude": [ + "./src/common/**", + "**/*.spec.ts", + "**/*.spec.tsx", + "**/*.test.ts", + "**/*.test.tsx", + "**/*.stories.ts", + "**/*.stories.tsx" + ], + "include": ["./src/**/*.ts", "./src/**/*.tsx"] +} diff --git a/packages/react-text/tsconfig.spec.json b/packages/react-text/tsconfig.spec.json new file mode 100644 index 00000000000000..511c49256fba56 --- /dev/null +++ b/packages/react-text/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "CommonJS", + "outDir": "dist", + "types": ["jest", "node", "inline-style-expand-shorthand", "@testing-library/jest-dom"] + }, + "include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"] +}