From 7c7e3f01e20433f4ed0114e029f8e7c0b3f7f99f Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Wed, 24 Nov 2021 11:55:15 +0100 Subject: [PATCH 1/5] chore: run migration for @fluentui/babel-make-styles --- packages/babel-make-styles/.npmignore | 1 - .../config/api-extractor.local.json | 2 +- packages/babel-make-styles/jest.config.js | 3 +-- 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 +++-- 7 files changed, 37 insertions(+), 19 deletions(-) create mode 100644 packages/babel-make-styles/tsconfig.lib.json 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..0461ef525cda0 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, }, }, @@ -16,6 +16,5 @@ module.exports = { '^.+\\.tsx?$': 'ts-jest', }, coverageDirectory: './coverage', - moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'], setupFilesAfterEnv: ['./config/tests.js'], }; diff --git a/packages/babel-make-styles/package.json b/packages/babel-make-styles/package.json index db9349244ca45..629758dd2e34a 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..9d0658756b6c7 --- /dev/null +++ b/packages/babel-make-styles/tsconfig.lib.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "lib": ["ES2019"], + "outDir": "dist", + "declaration": true, + "types": ["static-assets", "environment"], + "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..28fa5226de420 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"] } From 9607668908bc5039be03b7499155d069ebdfead7 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Wed, 24 Nov 2021 11:55:44 +0100 Subject: [PATCH 2/5] Change files --- ...l-make-styles-491f40e8-ca6d-43b6-8cc0-7c4d75f0b5ab.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@fluentui-babel-make-styles-491f40e8-ca6d-43b6-8cc0-7c4d75f0b5ab.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" +} From a03ce3cf917d52334cc0dd60fea746e88902cfb9 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Wed, 24 Nov 2021 15:31:06 +0100 Subject: [PATCH 3/5] Apply suggestions from code review Co-authored-by: Martin Hochel --- packages/babel-make-styles/tsconfig.lib.json | 4 ++-- packages/babel-make-styles/tsconfig.spec.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/babel-make-styles/tsconfig.lib.json b/packages/babel-make-styles/tsconfig.lib.json index 9d0658756b6c7..b54df8cc55e29 100644 --- a/packages/babel-make-styles/tsconfig.lib.json +++ b/packages/babel-make-styles/tsconfig.lib.json @@ -2,10 +2,10 @@ "extends": "./tsconfig.json", "compilerOptions": { "noEmit": false, - "lib": ["ES2019"], + "lib": ["DOM", "ES2019"], "outDir": "dist", "declaration": true, - "types": ["static-assets", "environment"], + "types": ["static-assets", "environment", "inline-style-expand-shorthand"], "module": "CommonJS" }, "exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx"], diff --git a/packages/babel-make-styles/tsconfig.spec.json b/packages/babel-make-styles/tsconfig.spec.json index 28fa5226de420..0712632001727 100644 --- a/packages/babel-make-styles/tsconfig.spec.json +++ b/packages/babel-make-styles/tsconfig.spec.json @@ -5,5 +5,5 @@ "outDir": "dist", "types": ["jest", "node", "inline-style-expand-shorthand"] }, - "include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"] + "include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts", "__fixtures__/**/code.ts"] } From da0f7eb3f29ec7cefbb0b25bcb2d286f2d82c694 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Wed, 24 Nov 2021 16:27:36 +0100 Subject: [PATCH 4/5] fix fmt --- packages/babel-make-styles/tsconfig.spec.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-make-styles/tsconfig.spec.json b/packages/babel-make-styles/tsconfig.spec.json index 0712632001727..131e01d283936 100644 --- a/packages/babel-make-styles/tsconfig.spec.json +++ b/packages/babel-make-styles/tsconfig.spec.json @@ -5,5 +5,5 @@ "outDir": "dist", "types": ["jest", "node", "inline-style-expand-shorthand"] }, - "include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts", "__fixtures__/**/code.ts"] + "include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts", "__fixtures__/**/code.ts"] } From 48d25ff6c120f964edc88424752fa8e7526552d5 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Wed, 24 Nov 2021 18:00:57 +0100 Subject: [PATCH 5/5] restore change in jest config --- packages/babel-make-styles/jest.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/babel-make-styles/jest.config.js b/packages/babel-make-styles/jest.config.js index 0461ef525cda0..3944224a3e61d 100644 --- a/packages/babel-make-styles/jest.config.js +++ b/packages/babel-make-styles/jest.config.js @@ -16,5 +16,6 @@ module.exports = { '^.+\\.tsx?$': 'ts-jest', }, coverageDirectory: './coverage', + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'], setupFilesAfterEnv: ['./config/tests.js'], };