From 9a7ceeb774d5739a71887c1296021991dafe186f Mon Sep 17 00:00:00 2001 From: Juan Pablo Garcia Ripa Date: Wed, 28 Dec 2022 10:29:36 +0100 Subject: [PATCH] remove no longer needed patch Signed-off-by: Juan Pablo Garcia Ripa --- packages/repo-tools/package.json | 1 - .../src/commands/api-reports/api-extractor.ts | 28 +------------------ yarn.lock | 1 - 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/packages/repo-tools/package.json b/packages/repo-tools/package.json index 7f0eaa5c6c..6e6b1e92b0 100644 --- a/packages/repo-tools/package.json +++ b/packages/repo-tools/package.json @@ -53,7 +53,6 @@ "@microsoft/api-extractor-model": "*", "@microsoft/tsdoc": "*", "@microsoft/tsdoc-config": "*", - "@rushstack/node-core-library": "*", "prettier": "^2.8.1", "typescript": "> 3.0.0" }, diff --git a/packages/repo-tools/src/commands/api-reports/api-extractor.ts b/packages/repo-tools/src/commands/api-reports/api-extractor.ts index 10b58c4dad..89eeb7454c 100644 --- a/packages/repo-tools/src/commands/api-reports/api-extractor.ts +++ b/packages/repo-tools/src/commands/api-reports/api-extractor.ts @@ -18,7 +18,6 @@ import { resolve as resolvePath, relative as relativePath, basename, - dirname, join, } from 'path'; import { execFile } from 'child_process'; @@ -70,32 +69,7 @@ const tmpDir = cliPaths.resolveTargetRoot( ); /** - * All of this monkey patching below is because MUI has these bare package.json file as a method - * for making TypeScript accept imports like `@material-ui/core/Button`, and improve tree-shaking - * by declaring them side effect free. - * - * The package.json lookup logic in api-extractor really doesn't like that though, as it enforces - * that the 'name' field exists in all package.json files that it discovers. This below is just - * making sure that we ignore those file package.json files instead of crashing. - */ -const { - PackageJsonLookup, -} = require('@rushstack/node-core-library/lib/PackageJsonLookup'); - -const old = PackageJsonLookup.prototype.tryGetPackageJsonFilePathFor; -PackageJsonLookup.prototype.tryGetPackageJsonFilePathFor = - function tryGetPackageJsonFilePathForPatch(path: string) { - if ( - path.includes('@material-ui') && - !dirname(path).endsWith('@material-ui') - ) { - return undefined; - } - return old.call(this, path); - }; - -/** - * Another monkey patch where we apply prettier to the API reports. This has to be patched into + * All of this monkey patching below is for apply prettier to the API reports. This has to be patched into * the middle of the process as API Extractor does a comparison of the contents of the old * and new files during generation. This inserts the formatting just before that comparison. */ diff --git a/yarn.lock b/yarn.lock index 4282304749..aad88b373f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8459,7 +8459,6 @@ __metadata: "@microsoft/api-extractor-model": "*" "@microsoft/tsdoc": "*" "@microsoft/tsdoc-config": "*" - "@rushstack/node-core-library": "*" prettier: ^2.8.1 typescript: "> 3.0.0" peerDependenciesMeta: