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

Provide node-pty package for plugins #14720

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

msujew
Copy link
Member

@msujew msujew commented Jan 13, 2025

What it does

Closes #14714
Closes #13779

Adds a further override of the require function to the plugin host. In case any node-pty package is required, it will simply return the node-pty package that is packaged with Theia.

How to test

Run the steps in #14714 and see that you don't get the require error.

Follow-ups

We could add further dependencies in there.

Review checklist

Reminder for reviewers

@msujew msujew added plug-in system issues related to the plug-in system vscode issues related to VSCode compatibility labels Jan 13, 2025
@msujew msujew force-pushed the msujew/provide-node-pty branch from 3c65c49 to b523d2d Compare January 13, 2025 13:32
@msujew msujew requested a review from tsmaeder January 13, 2025 14:48
const original = node_module._load;
node_module._load = function (request: string): unknown {
for (const filter of overrides) {
if (request === filter.package || request.endsWith(`node_modules/${filter.package}`) || request.endsWith(`node_modules\\${filter.package}`)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if someone actually went to the trouble of packaging their own node-pty with the plugins, would our version override the packaged version? Is this what we want or should we first check if module in question can be loaded normally?

Copy link
Member Author

@msujew msujew Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess, yes. It probably makes sense to check for it first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plug-in system issues related to the plug-in system vscode issues related to VSCode compatibility
Projects
Status: Waiting on reviewers
Development

Successfully merging this pull request may close these issues.

Cannot create projects with swift extension Google Cloud extension fails to load.
2 participants