From d420f949fe01f8d1bce7126674b58b025f304985 Mon Sep 17 00:00:00 2001 From: Elizabeth Craig Date: Wed, 2 Feb 2022 16:30:21 -0800 Subject: [PATCH 1/2] Temporarily add resolution for babel to work around bug --- ...-cra-template-a130326a-e7ca-434d-bb78-5c568d837747.json | 7 +++++++ packages/cra-template/template.json | 3 +++ 2 files changed, 10 insertions(+) create mode 100644 change/@fluentui-cra-template-a130326a-e7ca-434d-bb78-5c568d837747.json diff --git a/change/@fluentui-cra-template-a130326a-e7ca-434d-bb78-5c568d837747.json b/change/@fluentui-cra-template-a130326a-e7ca-434d-bb78-5c568d837747.json new file mode 100644 index 0000000000000..62b632e895108 --- /dev/null +++ b/change/@fluentui-cra-template-a130326a-e7ca-434d-bb78-5c568d837747.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Temporarily add resolution for `@babel/core` to work around bug", + "packageName": "@fluentui/cra-template", + "email": "elcraig@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/cra-template/template.json b/packages/cra-template/template.json index fcbdd17b3dab4..85c17948a7bda 100644 --- a/packages/cra-template/template.json +++ b/packages/cra-template/template.json @@ -12,6 +12,9 @@ "typescript": "^4.1.2", "web-vitals": "^1.0.1" }, + "resolutions": { + "@babel/core": "7.16.12" + }, "eslintConfig": { "extends": ["react-app", "react-app/jest"] } From 36cd91090e33ef6a3becf20bcfc81b3db78d65c4 Mon Sep 17 00:00:00 2001 From: Elizabeth Craig Date: Wed, 2 Feb 2022 16:56:44 -0800 Subject: [PATCH 2/2] add workaround in projects-test --- packages/fluentui/projects-test/src/createReactApp.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/fluentui/projects-test/src/createReactApp.ts b/packages/fluentui/projects-test/src/createReactApp.ts index 2088648b409ee..8810ab14e2dd6 100644 --- a/packages/fluentui/projects-test/src/createReactApp.ts +++ b/packages/fluentui/projects-test/src/createReactApp.ts @@ -30,6 +30,14 @@ export async function createReactApp() { await prepareCreateReactApp(tempPaths, 'typescript'); const testAppPath = config.paths.withRootAt(tempPaths.testApp); + + // TODO: remove once babel issue is fixed (tracked by https://github.com/microsoft/fluentui/issues/21546) + logger('Add resolution to work around @babel/core issue'); + const packageJson = fs.readJSONSync(testAppPath('package.json')); + packageJson.resolutions = { '@babel/core': '7.16.12' }; + fs.writeJSONSync(testAppPath('package.json'), packageJson, { spaces: 2 }); + await shEcho('yarn', testAppPath()); + logger(`Test React project is successfully created: ${testAppPath()}`); logger('STEP 2. Add Fluent UI dependency to test project..');