Skip to content

Commit

Permalink
Work around
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Aug 1, 2023
1 parent ecdc4f8 commit 2466cb3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions build/ci/postInstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,23 @@ function verifyMomentIsOnlyUsedByJupyterLabCoreUtils() {
throw new Error(`Moment is being used by other packages (${otherPackagesUsingMoment.join(', ')}).`);
}
}

/**
* Work around for https://github.com/microsoft/vscode-python/issues/21720
*
* The npm package @vscode/python-extension has a peer dependency on @types/vscode.
* However Jupyter extensions uses @vscode-dts with the cli arg '-f' instead of @types/vscode.
* The webpack builds when running the command `npm list --production --parseable --depth=99999 --loglevel=error`
* Work around is to remove the peerDepencency on @types/vscode.
*/
function fixPythonExtensionNpmPackageJson() {
const jsonFilePath = path.join(__dirname, '..', '..', 'node_modules','@vscode','python-extension','package.json');
const packageJson = JSON.parse(fs.readFileSync(jsonFilePath));
if (packageJson.peerDependencies && packageJson.peerDependencies['@types/vscode']) {
delete packageJson.peerDependencies['@types/vscode'];
fs.writeFileSync(jsonFilePath, JSON.stringify(packageJson, undefined, 4));
}
}
async function downloadZmqBinaries() {
if (common.getBundleConfiguration() === common.bundleConfiguration.web) {
// No need to download zmq binaries for web.
Expand All @@ -254,6 +271,7 @@ fixVariableNameInKernelDefaultJs();
removeUnnecessaryLoggingFromKernelDefault();
updateJSDomTypeDefinition();
fixStripComments();
fixPythonExtensionNpmPackageJson();
verifyMomentIsOnlyUsedByJupyterLabCoreUtils();
downloadZmqBinaries()
.then(() => process.exit(0))
Expand Down

0 comments on commit 2466cb3

Please sign in to comment.