-
Notifications
You must be signed in to change notification settings - Fork 13
postinstall script depends on devDependencies #3
Comments
Yeah, it's a bad hack because those dependencies are only needed for install, and we don't want to ship them with vscode. Need to find a better way to do that... |
This actually isn't fixed yet, I rolled those changes back. @joaomoreno, wondering if you have any ideas here - the method I currently use to distribute ripgrep in vscode is not great. We have vscode-ripgrep as a dependency, and during its postinstall, it downloads the rg binary. It has some dependencies that it uses to download ripgrep, but they aren't needed at runtime, so they are marked as devDependencies, to keep vscode from shipping them. So when vscode-ripgrep is installed in vscode, of course these dependencies aren't actually enforced, but it works because they're required by gulp-atom-electron and other modules in vscode. Today it broke because we updated yauzl to an incompatible version and I clearly need to clean this up. Options
|
Why not implementing the whole thing in pure Node? You don't really need all those dependencies. You could use the |
Revert "Take yauzl update but keep devDeps, temporarily" This reverts commit 9dddf4f. Revert "Handle error from github.downloadAsset" This reverts commit b8fd6a9. Revert "Update to fix with latest yauzl, and fix roblourens#3" This reverts commit 8176795.
cc @sandy081 OK, long story: This morning, the extension viewlet was completely broken: it didn't render extensions. @sandy081 looked into it and found it the shared process failed to load altogether: That ... but it didn't. All builds started failing after that:
Oh, Fixed! I've triggered new insider builds. Questions:
Next steps:
|
After digging a bit more, this happens because Will investigate more! |
Sorry you had to deal with that! You probably could have just pulled in [email protected] instead of forking it. But yes
vscode-ripgrep has these all of its dependencies marked as devDependencies, so they are all ignored when we install it for vscode. If something else wasn't depending on Rewriting it without any dependencies is a good idea, but I'd rather use the power of npm if I can rather than reinventing the wheel. How about running vscode-ripgrep from our gulpfile and copying ripgrep into another folder somewhere? |
Doh! I also would like to keep using the power of npm. I meant it as "keep the postinstall, just dont depend on node modules to implement it". Why would dropping the dependency to yauzl go against that? I thought you create the zip files yourself and upload them to GitHub. In any case, feel free to (properly) upgrade yauzl to the latest version in our core, adopting the right API changes and updating the shrinkwrap file accordingly. If you do this, we can move back to 0.0.15. |
I understand, but I mean the power of the npm ecosystem. Besides yauzl, I'd rather keep using github-releases and the other deps to make life easier, rather than reimplement them. That just seems like an extreme solution. |
Then two options:
|
The semver breakage is annoying but didn't technically contribute to this issue, because the vscode-ripgrep deps are not respected by npm at all. In any case I'll work on taking the latest yauzl. |
Actually the deps are respected by npm. Core is locked into yauzl 2.3.1. vscode-ripgrep now depends on 2.8.0. Those two should be API compatible right? So, npm just keeps that 2.3.1 version around for vscode-ripgrep to use. That's how it fails, and that's why I had to revert. |
Actually vscode-ripgrep's deps are totally ignored by npm, because they are So I'm saying the best solution is to make vscode-ripgrep a |
But we do install our dependencies' |
|
Oh wow, it's the first time I ever realise that. You're right. @roblourens Did you take a look at https://www.npmjs.com/package/postinstall-build yet? |
Whoa, that's interesting, I will try it out. This would be an issue though:
|
I might not have the whole picture here but at the beginning of the thread it was mentioned that
if those deps can be resolved from higher in the dependency tree, when vscode-rigrep is installed, then they can be |
True, yet not all of those would make sense to be dependencies of vscode. :/ |
What's the status of switching to npm 5 officially? I see remaining issues around it. It sounds like postinstall-build would be the perfect solution if |
We are blocked on npm5: microsoft/vscode#30134. Usually we tend to wait months before adopting a major npm version. I already spent way too long on that this month. 😞 |
Still thinking about this.
Also still thinking about reimplementing it without any npm dependencies, as suggested above. Annoying thing is that if github changes something I can't just rev |
vscode-ripgrep's npm package now includes Seems to be working fine, I'll verify some more, and merge it, and update yauzl in vscode tomorrow. |
If you move your NOTE: this solution works only if the dependencies have no |
Cool, I wish I'd seen that package earlier yesterday! I'm opening a new issue to switch to publish-packed and closing this one. |
The postinstall script executes
./dist/postinstall.js
which depends on packages specified asdevDependencies
. Those packages should be either regular or peer dependencies as they won't be installed with vscode-riprep.Related: pnpm/pnpm#833
The text was updated successfully, but these errors were encountered: