diff --git a/change/@fluentui-react-slider-e5eb2b9f-5c8e-43d2-b31a-39b735608627.json b/change/@fluentui-react-slider-e5eb2b9f-5c8e-43d2-b31a-39b735608627.json new file mode 100644 index 0000000000000..06fe35717abaf --- /dev/null +++ b/change/@fluentui-react-slider-e5eb2b9f-5c8e-43d2-b31a-39b735608627.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "Migrate package to use solution tsconfigs", + "packageName": "@fluentui/react-slider", + "email": "andredias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/packages/react-slider/.npmignore b/packages/react-slider/.npmignore index fa2d3a7f5111c..e719afb921bc9 100644 --- a/packages/react-slider/.npmignore +++ b/packages/react-slider/.npmignore @@ -1,4 +1,3 @@ -.cache/ .storybook/ .vscode/ bundle-size/ diff --git a/packages/react-slider/.storybook/main.js b/packages/react-slider/.storybook/main.js index 54cd5474023a5..18a60b265c2cf 100644 --- a/packages/react-slider/.storybook/main.js +++ b/packages/react-slider/.storybook/main.js @@ -11,5 +11,4 @@ module.exports = /** @type {Omit/dist//src/index.d.ts" + "mainEntryPointFilePath": "/dist/packages//src/index.d.ts" } diff --git a/packages/react-slider/jest.config.js b/packages/react-slider/jest.config.js index 73519a99124a4..a8e22f421206e 100644 --- a/packages/react-slider/jest.config.js +++ b/packages/react-slider/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-slider/package.json b/packages/react-slider/package.json index 693dc799e8f14..9d195a9a6b323 100644 --- a/packages/react-slider/package.json +++ b/packages/react-slider/package.json @@ -19,10 +19,11 @@ "just": "just-scripts", "lint": "just-scripts lint", "start": "yarn storybook", - "test": "jest", + "test": "jest --passWithNoTests", "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" + "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-slider/src && yarn docs", + "storybook": "start-storybook", + "type-check": "tsc -b tsconfig.json" }, "devDependencies": { "@fluentui/eslint-plugin": "*", diff --git a/packages/react-slider/tsconfig.json b/packages/react-slider/tsconfig.json index 534e2b72108bd..affceae1828ae 100644 --- a/packages/react-slider/tsconfig.json +++ b/packages/react-slider/tsconfig.json @@ -1,17 +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", "storybook__addons"] - } + "preserveConstEnums": true + }, + "include": [], + "files": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + }, + { + "path": "./.storybook/tsconfig.json" + } + ] } diff --git a/packages/react-slider/tsconfig.lib.json b/packages/react-slider/tsconfig.lib.json new file mode 100644 index 0000000000000..b83999c31f8a3 --- /dev/null +++ b/packages/react-slider/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-slider/tsconfig.spec.json b/packages/react-slider/tsconfig.spec.json new file mode 100644 index 0000000000000..28fa5226de420 --- /dev/null +++ b/packages/react-slider/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"] +}