From a4450bb96ed6768a5c6b5ae26791fef4e1abafbe Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Thu, 25 Nov 2021 09:56:58 +0100 Subject: [PATCH] chore: run migration for @fluentui/babel-make-styles (#20744) * chore: run migration for @fluentui/babel-make-styles * Change files * Apply suggestions from code review Co-authored-by: Martin Hochel * fix fmt * restore change in jest config Co-authored-by: Martin Hochel --- ...-491f40e8-ca6d-43b6-8cc0-7c4d75f0b5ab.json | 7 +++++ packages/babel-make-styles/.npmignore | 1 - .../config/api-extractor.local.json | 2 +- packages/babel-make-styles/jest.config.js | 2 +- packages/babel-make-styles/package.json | 4 +-- packages/babel-make-styles/tsconfig.json | 27 +++++++++++-------- packages/babel-make-styles/tsconfig.lib.json | 13 +++++++++ packages/babel-make-styles/tsconfig.spec.json | 6 +++-- 8 files changed, 44 insertions(+), 18 deletions(-) create mode 100644 change/@fluentui-babel-make-styles-491f40e8-ca6d-43b6-8cc0-7c4d75f0b5ab.json create mode 100644 packages/babel-make-styles/tsconfig.lib.json diff --git a/change/@fluentui-babel-make-styles-491f40e8-ca6d-43b6-8cc0-7c4d75f0b5ab.json b/change/@fluentui-babel-make-styles-491f40e8-ca6d-43b6-8cc0-7c4d75f0b5ab.json new file mode 100644 index 0000000000000..979e62bc26e40 --- /dev/null +++ b/change/@fluentui-babel-make-styles-491f40e8-ca6d-43b6-8cc0-7c4d75f0b5ab.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "update tooling configs", + "packageName": "@fluentui/babel-make-styles", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/packages/babel-make-styles/.npmignore b/packages/babel-make-styles/.npmignore index fa2d3a7f5111c..e719afb921bc9 100644 --- a/packages/babel-make-styles/.npmignore +++ b/packages/babel-make-styles/.npmignore @@ -1,4 +1,3 @@ -.cache/ .storybook/ .vscode/ bundle-size/ diff --git a/packages/babel-make-styles/config/api-extractor.local.json b/packages/babel-make-styles/config/api-extractor.local.json index c2ea401c1c368..7974a129e8a33 100644 --- a/packages/babel-make-styles/config/api-extractor.local.json +++ b/packages/babel-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/babel-make-styles/jest.config.js b/packages/babel-make-styles/jest.config.js index 9b76ead3bc4a5..3944224a3e61d 100644 --- a/packages/babel-make-styles/jest.config.js +++ b/packages/babel-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/babel-make-styles/package.json b/packages/babel-make-styles/package.json index 377b7e3cde77b..7486d6f0e8f4b 100644 --- a/packages/babel-make-styles/package.json +++ b/packages/babel-make-styles/package.json @@ -16,8 +16,8 @@ "lint": "just-scripts lint", "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/babel-make-styles/src && yarn docs", - "type-check": "tsc -p ./tsconfig.spec.json" + "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/babel-make-styles/src && yarn docs", + "type-check": "tsc -b tsconfig.json" }, "devDependencies": { "@fluentui/eslint-plugin": "*", diff --git a/packages/babel-make-styles/tsconfig.json b/packages/babel-make-styles/tsconfig.json index f8876269793eb..8dff38e64b031 100644 --- a/packages/babel-make-styles/tsconfig.json +++ b/packages/babel-make-styles/tsconfig.json @@ -1,17 +1,22 @@ { "extends": "../../tsconfig.base.json", - "include": ["src"], "compilerOptions": { - "target": "ES2015", - "module": "CommonJS", - "lib": ["ES2017", "DOM"], - "outDir": "dist", - "jsx": "react", - "declaration": true, - "experimentalDecorators": true, + "target": "ES2019", + "noEmit": true, + "isolatedModules": true, "importHelpers": true, + "jsx": "react", "noUnusedLocals": true, - "preserveConstEnums": true, - "types": ["jest", "custom-global", "inline-style-expand-shorthand", "node"] - } + "preserveConstEnums": true + }, + "include": [], + "files": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] } diff --git a/packages/babel-make-styles/tsconfig.lib.json b/packages/babel-make-styles/tsconfig.lib.json new file mode 100644 index 0000000000000..b54df8cc55e29 --- /dev/null +++ b/packages/babel-make-styles/tsconfig.lib.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "lib": ["DOM", "ES2019"], + "outDir": "dist", + "declaration": true, + "types": ["static-assets", "environment", "inline-style-expand-shorthand"], + "module": "CommonJS" + }, + "exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx"], + "include": ["./src/**/*.ts", "./src/**/*.tsx"] +} diff --git a/packages/babel-make-styles/tsconfig.spec.json b/packages/babel-make-styles/tsconfig.spec.json index 9d7ad81faf716..131e01d283936 100644 --- a/packages/babel-make-styles/tsconfig.spec.json +++ b/packages/babel-make-styles/tsconfig.spec.json @@ -1,7 +1,9 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "noEmit": true + "module": "CommonJS", + "outDir": "dist", + "types": ["jest", "node", "inline-style-expand-shorthand"] }, - "include": ["__fixtures__/**/code.ts"] + "include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts", "__fixtures__/**/code.ts"] }