Skip to content

Commit

Permalink
react-text - Migrate converged packages to TS Solution style config (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
andrefcdias authored and Marion Le Pontois committed Jan 17, 2022
1 parent b6f26b7 commit 0b8df35
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Migrate Text",
"packageName": "@fluentui/react-text",
"email": "[email protected]",
"dependentChangeType": "patch"
}
1 change: 0 additions & 1 deletion packages/react-text/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ module.exports = /** @type {Omit<import('../../../.storybook/main'), 'typescript

return localConfig;
},
previewHead: rootMain.previewHead,
});
7 changes: 4 additions & 3 deletions packages/react-text/.storybook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
2 changes: 1 addition & 1 deletion packages/react-text/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsConfig: '<rootDir>/tsconfig.json',
tsConfig: '<rootDir>/tsconfig.spec.json',
diagnostics: false,
},
},
Expand Down
5 changes: 3 additions & 2 deletions packages/react-text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
33 changes: 17 additions & 16 deletions packages/react-text/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
20 changes: 20 additions & 0 deletions packages/react-text/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -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"]
}
9 changes: 9 additions & 0 deletions packages/react-text/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -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"]
}

0 comments on commit 0b8df35

Please sign in to comment.