From 2042bb86936576a478b00e700315af65676d6006 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Wed, 24 Nov 2021 14:31:08 +0100 Subject: [PATCH 1/6] chore: migrate @fluentui/make-styles-webpack-loader --- .../make-styles-webpack-loader/.npmignore | 1 - .../config/api-extractor.local.json | 2 +- .../make-styles-webpack-loader/jest.config.js | 4 +-- .../make-styles-webpack-loader/package.json | 4 +-- .../make-styles-webpack-loader/tsconfig.json | 27 +++++++++++-------- .../tsconfig.spec.json | 6 +++-- 6 files changed, 24 insertions(+), 20 deletions(-) diff --git a/packages/make-styles-webpack-loader/.npmignore b/packages/make-styles-webpack-loader/.npmignore index fa2d3a7f5111c..e719afb921bc9 100644 --- a/packages/make-styles-webpack-loader/.npmignore +++ b/packages/make-styles-webpack-loader/.npmignore @@ -1,4 +1,3 @@ -.cache/ .storybook/ .vscode/ bundle-size/ diff --git a/packages/make-styles-webpack-loader/config/api-extractor.local.json b/packages/make-styles-webpack-loader/config/api-extractor.local.json index c2ea401c1c368..7974a129e8a33 100644 --- a/packages/make-styles-webpack-loader/config/api-extractor.local.json +++ b/packages/make-styles-webpack-loader/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/make-styles-webpack-loader/jest.config.js b/packages/make-styles-webpack-loader/jest.config.js index ef5e818fec600..4b55aebc69102 100644 --- a/packages/make-styles-webpack-loader/jest.config.js +++ b/packages/make-styles-webpack-loader/jest.config.js @@ -8,15 +8,13 @@ module.exports = { preset: '../../jest.preset.js', globals: { 'ts-jest': { - tsConfig: '/tsconfig.json', + tsConfig: '/tsconfig.spec.json', diagnostics: false, }, }, transform: { '^.+\\.tsx?$': 'ts-jest', }, - moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'], - testEnvironment: 'node', coverageDirectory: './coverage', setupFilesAfterEnv: ['./config/tests.js'], }; diff --git a/packages/make-styles-webpack-loader/package.json b/packages/make-styles-webpack-loader/package.json index c2b1d5b323180..1b80cea781d6a 100644 --- a/packages/make-styles-webpack-loader/package.json +++ b/packages/make-styles-webpack-loader/package.json @@ -17,8 +17,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/make-styles-webpack-loader/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/make-styles-webpack-loader/src && yarn docs", + "type-check": "tsc -b tsconfig.json" }, "devDependencies": { "@fluentui/eslint-plugin": "*", diff --git a/packages/make-styles-webpack-loader/tsconfig.json b/packages/make-styles-webpack-loader/tsconfig.json index f8876269793eb..8dff38e64b031 100644 --- a/packages/make-styles-webpack-loader/tsconfig.json +++ b/packages/make-styles-webpack-loader/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/make-styles-webpack-loader/tsconfig.spec.json b/packages/make-styles-webpack-loader/tsconfig.spec.json index 9d7ad81faf716..28fa5226de420 100644 --- a/packages/make-styles-webpack-loader/tsconfig.spec.json +++ b/packages/make-styles-webpack-loader/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 17748e7c3eb00698d66662a056999f4dad783908 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Wed, 24 Nov 2021 14:32:04 +0100 Subject: [PATCH 2/6] Change files --- ...ebpack-loader-94516228-2e64-4dc7-b0eb-4b29e75b8697.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@fluentui-make-styles-webpack-loader-94516228-2e64-4dc7-b0eb-4b29e75b8697.json diff --git a/change/@fluentui-make-styles-webpack-loader-94516228-2e64-4dc7-b0eb-4b29e75b8697.json b/change/@fluentui-make-styles-webpack-loader-94516228-2e64-4dc7-b0eb-4b29e75b8697.json new file mode 100644 index 0000000000000..695c011bd26dd --- /dev/null +++ b/change/@fluentui-make-styles-webpack-loader-94516228-2e64-4dc7-b0eb-4b29e75b8697.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "update tooling configs", + "packageName": "@fluentui/make-styles-webpack-loader", + "email": "olfedias@microsoft.com", + "dependentChangeType": "none" +} From 6c7c34ab348c1babcc77f31863cd9e30bce8e9c7 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Wed, 24 Nov 2021 14:32:45 +0100 Subject: [PATCH 3/6] chore: migrate @fluentui/make-styles-webpack-loader --- .../make-styles-webpack-loader/tsconfig.lib.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 packages/make-styles-webpack-loader/tsconfig.lib.json diff --git a/packages/make-styles-webpack-loader/tsconfig.lib.json b/packages/make-styles-webpack-loader/tsconfig.lib.json new file mode 100644 index 0000000000000..9d0658756b6c7 --- /dev/null +++ b/packages/make-styles-webpack-loader/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"] +} From d20d8d1a19af8fe455dd787fcc9a07501d424f31 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Wed, 24 Nov 2021 15:42:35 +0100 Subject: [PATCH 4/6] applied suggestions from another PR --- packages/make-styles-webpack-loader/tsconfig.lib.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/make-styles-webpack-loader/tsconfig.lib.json b/packages/make-styles-webpack-loader/tsconfig.lib.json index 9d0658756b6c7..b54df8cc55e29 100644 --- a/packages/make-styles-webpack-loader/tsconfig.lib.json +++ b/packages/make-styles-webpack-loader/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"], From 8b3cfe0a619b9d085ad14547d23a166d5a013e98 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Wed, 24 Nov 2021 16:31:10 +0100 Subject: [PATCH 5/6] restore jest config --- packages/make-styles-webpack-loader/jest.config.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/make-styles-webpack-loader/jest.config.js b/packages/make-styles-webpack-loader/jest.config.js index 4b55aebc69102..0e79391bed327 100644 --- a/packages/make-styles-webpack-loader/jest.config.js +++ b/packages/make-styles-webpack-loader/jest.config.js @@ -15,6 +15,8 @@ module.exports = { transform: { '^.+\\.tsx?$': 'ts-jest', }, + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'], + testEnvironment: 'node', coverageDirectory: './coverage', setupFilesAfterEnv: ['./config/tests.js'], }; From 0dc4ae65d673eb449ad76090d649da19509eb12d Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Wed, 24 Nov 2021 16:32:43 +0100 Subject: [PATCH 6/6] restore fixtures --- packages/make-styles-webpack-loader/tsconfig.spec.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/make-styles-webpack-loader/tsconfig.spec.json b/packages/make-styles-webpack-loader/tsconfig.spec.json index 28fa5226de420..131e01d283936 100644 --- a/packages/make-styles-webpack-loader/tsconfig.spec.json +++ b/packages/make-styles-webpack-loader/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"] }