Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temp fix: resolve mini-css-extractor-plugin to an older version for cra-template & projects-test #21295

Merged
merged 4 commits into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "temp fix: resolve mini-css-extractor-plugin to older version to fix error.",
"packageName": "@fluentui/cra-template",
"email": "tristan.watanabe@gmail.com",
"dependentChangeType": "none"
}
8 changes: 8 additions & 0 deletions packages/cra-template/scripts/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ async function runE2ETest() {

logger('STEP 2. Create test React app from template');
await prepareCreateReactApp(tempPaths, `file:${templatePath}`);
/**
* This is a temporary quick-fix solution. Remove once issue with mini-css-extract-plugin
* is resolved @see https://github.com/facebook/create-react-app/issues/11930
*/
const parsedJSON = JSON.parse(fs.readFileSync(`${tempPaths.testApp}/package.json`, 'utf-8'));
parsedJSON.resolutions['mini-css-extract-plugin'] = '2.4.5';
fs.writeFileSync(`${tempPaths.testApp}/package.json`, JSON.stringify(parsedJSON));

await shEcho('yarn add cross-env', tempPaths.testApp);
logger(`✔️ Test React app is successfully created: ${tempPaths.testApp}`);

Expand Down
8 changes: 8 additions & 0 deletions packages/fluentui/projects-test/src/createReactApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ export async function createReactApp() {
const packedPackages = await packProjectPackages(logger, config.paths.packages(), ['@fluentui/react-northstar']);
await addResolutionPathsForProjectPackages(testAppPath());

/**
* This is a temporary quick-fix solution. Remove once issue with mini-css-extract-plugin
* is resolved @see https://github.com/facebook/create-react-app/issues/11930
*/
const parsedJSON = JSON.parse(fs.readFileSync(`${tempPaths.testApp}/package.json`, 'utf-8'));
parsedJSON.resolutions['mini-css-extract-plugin'] = '2.4.5';
fs.writeFileSync(`${tempPaths.testApp}/package.json`, JSON.stringify(parsedJSON));

await shEcho(`yarn add ${packedPackages['@fluentui/react-northstar']}`, testAppPath());
logger(`✔️ Fluent UI packages were added to dependencies`);

Expand Down