remove no longer needed patch

Signed-off-by: Juan Pablo Garcia Ripa <juanpablog@spotify.com>
This commit is contained in:
Juan Pablo Garcia Ripa
2022-12-28 10:29:36 +01:00
parent 84cda2bd56
commit 9a7ceeb774
3 changed files with 1 additions and 29 deletions
-1
View File
@@ -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"
},
@@ -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.
*/
-1
View File
@@ -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: