From d746e9b2f7fe605d258bf51d11db2c61e890e091 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Thu, 25 Nov 2021 10:22:46 +0100 Subject: [PATCH] chore: run migration for @fluentui/jest-serializer-make-styles (#20747) * chore: run migration for @fluentui/jest-serializer-make-styles * Change files * fix devs * applied suggestions from another PR --- ...-18b8a2a0-fe05-4c69-b002-10fa9db10e89.json | 7 +++++ .../jest-serializer-make-styles/.npmignore | 1 - .../config/api-extractor.local.json | 2 +- .../jest.config.js | 2 +- .../jest-serializer-make-styles/package.json | 3 ++- .../jest-serializer-make-styles/tsconfig.json | 27 +++++++++++-------- .../tsconfig.lib.json | 13 +++++++++ .../tsconfig.spec.json | 9 +++++++ 8 files changed, 49 insertions(+), 15 deletions(-) create mode 100644 change/@fluentui-jest-serializer-make-styles-18b8a2a0-fe05-4c69-b002-10fa9db10e89.json create mode 100644 packages/jest-serializer-make-styles/tsconfig.lib.json create mode 100644 packages/jest-serializer-make-styles/tsconfig.spec.json diff --git a/change/@fluentui-jest-serializer-make-styles-18b8a2a0-fe05-4c69-b002-10fa9db10e89.json b/change/@fluentui-jest-serializer-make-styles-18b8a2a0-fe05-4c69-b002-10fa9db10e89.json new file mode 100644 index 00000000000000..140f808dc45794 --- /dev/null +++ b/change/@fluentui-jest-serializer-make-styles-18b8a2a0-fe05-4c69-b002-10fa9db10e89.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "update tooling config", + "packageName": "@fluentui/jest-serializer-make-styles", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} diff --git a/packages/jest-serializer-make-styles/.npmignore b/packages/jest-serializer-make-styles/.npmignore index fa2d3a7f5111ca..e719afb921bc93 100644 --- a/packages/jest-serializer-make-styles/.npmignore +++ b/packages/jest-serializer-make-styles/.npmignore @@ -1,4 +1,3 @@ -.cache/ .storybook/ .vscode/ bundle-size/ diff --git a/packages/jest-serializer-make-styles/config/api-extractor.local.json b/packages/jest-serializer-make-styles/config/api-extractor.local.json index c2ea401c1c3685..7974a129e8a337 100644 --- a/packages/jest-serializer-make-styles/config/api-extractor.local.json +++ b/packages/jest-serializer-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/jest-serializer-make-styles/jest.config.js b/packages/jest-serializer-make-styles/jest.config.js index bda6a84575ad0c..d32b9ed2b0438c 100644 --- a/packages/jest-serializer-make-styles/jest.config.js +++ b/packages/jest-serializer-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/jest-serializer-make-styles/package.json b/packages/jest-serializer-make-styles/package.json index d3b91ac365175b..e6cbd2ac8f0470 100644 --- a/packages/jest-serializer-make-styles/package.json +++ b/packages/jest-serializer-make-styles/package.json @@ -17,7 +17,8 @@ "clean": "just-scripts clean", "code-style": "just-scripts code-style", "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/jest-serializer-make-styles/src && yarn docs" + "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/jest-serializer-make-styles/src && yarn docs", + "type-check": "tsc -b tsconfig.json" }, "devDependencies": { "@fluentui/eslint-plugin": "*", diff --git a/packages/jest-serializer-make-styles/tsconfig.json b/packages/jest-serializer-make-styles/tsconfig.json index e0e8a45836c596..8dff38e64b0310 100644 --- a/packages/jest-serializer-make-styles/tsconfig.json +++ b/packages/jest-serializer-make-styles/tsconfig.json @@ -1,17 +1,22 @@ { "extends": "../../tsconfig.base.json", - "include": ["src"], "compilerOptions": { - "target": "ES5", - "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", "@testing-library/jest-dom"] - } + "preserveConstEnums": true + }, + "include": [], + "files": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] } diff --git a/packages/jest-serializer-make-styles/tsconfig.lib.json b/packages/jest-serializer-make-styles/tsconfig.lib.json new file mode 100644 index 00000000000000..b54df8cc55e297 --- /dev/null +++ b/packages/jest-serializer-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/jest-serializer-make-styles/tsconfig.spec.json b/packages/jest-serializer-make-styles/tsconfig.spec.json new file mode 100644 index 00000000000000..511c49256fba56 --- /dev/null +++ b/packages/jest-serializer-make-styles/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"] +}