diff --git a/change/@fluentui-react-card-488d7703-3af0-4620-9ec4-7013ae43dfc6.json b/change/@fluentui-react-card-488d7703-3af0-4620-9ec4-7013ae43dfc6.json new file mode 100644 index 00000000000000..e86b64e77c3eb0 --- /dev/null +++ b/change/@fluentui-react-card-488d7703-3af0-4620-9ec4-7013ae43dfc6.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Migrate Card", + "packageName": "@fluentui/react-card", + "email": "andredias@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-card/.storybook/main.js b/packages/react-card/.storybook/main.js index 54cd5474023a58..18a60b265c2cfb 100644 --- a/packages/react-card/.storybook/main.js +++ b/packages/react-card/.storybook/main.js @@ -11,5 +11,4 @@ module.exports = /** @type {Omit/tsconfig.json', + tsConfig: '/tsconfig.spec.json', diagnostics: false, }, }, diff --git a/packages/react-card/package.json b/packages/react-card/package.json index d64f33831c075b..4e695f1744598b 100644 --- a/packages/react-card/package.json +++ b/packages/react-card/package.json @@ -22,8 +22,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-card/src && yarn docs", - "storybook": "start-storybook -s assets" + "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-card/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-card/src/stories/CardAction.stories.tsx b/packages/react-card/src/stories/CardAction.stories.tsx index d9898eadb479df..29f297c641d476 100644 --- a/packages/react-card/src/stories/CardAction.stories.tsx +++ b/packages/react-card/src/stories/CardAction.stories.tsx @@ -1,9 +1,7 @@ import * as React from 'react'; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore + import { Body, Caption } from '@fluentui/react-text'; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore + import { Button } from '@fluentui/react-button'; import { Open16Regular, MoreVertical20Regular } from '@fluentui/react-icons'; import { Card, CardFooter, CardHeader, CardPreview } from '../index'; // codesandbox-dependency: @fluentui/react-card ^9.0.0-beta diff --git a/packages/react-card/src/stories/CardDefault.stories.tsx b/packages/react-card/src/stories/CardDefault.stories.tsx index 40d3a28241f297..8fd1342a00d8ab 100644 --- a/packages/react-card/src/stories/CardDefault.stories.tsx +++ b/packages/react-card/src/stories/CardDefault.stories.tsx @@ -1,9 +1,7 @@ import * as React from 'react'; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore + import { Body, Caption } from '@fluentui/react-text'; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore + import { Button } from '@fluentui/react-button'; import { ArrowReply16Regular, Share16Regular } from '@fluentui/react-icons'; import { Card, CardFooter, CardHeader, CardPreview } from '../index'; // codesandbox-dependency: @fluentui/react-card ^9.0.0-beta diff --git a/packages/react-card/src/stories/CardGrid.stories.tsx b/packages/react-card/src/stories/CardGrid.stories.tsx index 990bb35c7c5dbd..b8b30d90d9d526 100644 --- a/packages/react-card/src/stories/CardGrid.stories.tsx +++ b/packages/react-card/src/stories/CardGrid.stories.tsx @@ -1,9 +1,7 @@ import * as React from 'react'; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore + import { Body, Caption } from '@fluentui/react-text'; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore + import { Button } from '@fluentui/react-button'; import { MoreHorizontal16Regular } from '@fluentui/react-icons'; import { Card, CardHeader, CardPreview } from '../index'; // codesandbox-dependency: @fluentui/react-card ^9.0.0-beta diff --git a/packages/react-card/tsconfig.json b/packages/react-card/tsconfig.json index 1cc2ebf050fa40..affceae1828ae1 100644 --- a/packages/react-card/tsconfig.json +++ b/packages/react-card/tsconfig.json @@ -1,18 +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", "storybook__addons"] - } + "preserveConstEnums": true + }, + "include": [], + "files": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + }, + { + "path": "./.storybook/tsconfig.json" + } + ] } diff --git a/packages/react-card/tsconfig.lib.json b/packages/react-card/tsconfig.lib.json new file mode 100644 index 00000000000000..b83999c31f8a32 --- /dev/null +++ b/packages/react-card/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-card/tsconfig.spec.json b/packages/react-card/tsconfig.spec.json new file mode 100644 index 00000000000000..28fa5226de4204 --- /dev/null +++ b/packages/react-card/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"] +}