René's URL Explorer Experiment


Title: fix: Generate shrinkwraps for the bundled vscode by edvincent · Pull Request #5071 · coder/code-server · GitHub

Open Graph Title: fix: Generate shrinkwraps for the bundled vscode by edvincent · Pull Request #5071 · coder/code-server

X Title: fix: Generate shrinkwraps for the bundled vscode by edvincent · Pull Request #5071 · coder/code-server

Description: Fixes #5056 #5174 Why are we removing synp after all? Because it only takes care of putting in the package-lock/shrinkwrap file the first level of dependencies, not the nested dependencies which we have from the yarn lockfile. See the contents of https://unpkg.com/browse/code-server@4.2.0-5047-90c9adcded65d10004a9db71d0717cd90565baa3/npm-shrinkwrap.json, and how for example, @mapbox/node-pre-gyp is listed as a dependency of argon2 - but is not present anywhere in the shrinkwrap file. Why are we adding packages from resolutions in devDependencies too? What initially drove me to use synp was the fact that the npm shrinkwrap command would generate a lockfile that wasn't usable. Trying to install the package with that lockfile would fail with the following exception: Installing Code dependencies... [..] npm ERR! Cannot read property 'requires' of undefined This was actually due to npm shrinkwrap (in NPM 6) choking with some packages not being anywhere in the lockfile but being present in the package.json. So I simply tracked down their dependency tree, saw they were coming from devDependencies, and added them there - which now prevents the npm shrinkwrap-generated lockfile from breaking, and allows us to remove synp. This doesn't change the size of the dependency tree, and should be able to be removed when there are higher versions of NPM used. Why aren't we using npm ci to replace yarn --frozen-lockfile? NPM 6's npm ci doesn't deal very well with optional dependencies, which the bundled vscode needs for some Windows dependencies (namely, windows-process-tree and @vscode/windows-registry): The npm shrinkwrap command doesn't add them to the lockfile, because the CI runs from Linux, so it doesn't install them - and the commands generates the lockfile based on what's in node_modules. If we hacked the lockfile and added them there manually (with "optional": true), the install on a Linux machine would fail - because NPM 6's npm ci doesn't respect them from an npm-shrinkwrap.json file. If we don't add them and use npm ci, they are not installed - even on Windows machines. What I settled for was using npm install --production (for now), that will always respect the lockfile version if an entry is there, and will try to get versions not listed there. This effectively means that those two packages, on windows, won't be following the yarn.lock that is being used in the development package, but that seemed less worse. Note: Another idea was to hackily add the packages to the lockfile + enhance the postinstall.sh script to conditionally use --no-optional if we're running on a non-Windows machine - which skips those optional dependencies. I wasn't convinced by either the hacking around of the lockfile nor this conditional... But happy to hear thoughts? Why don't we need the "Remove the devDependencies" hack anymore? Because we are now generating the shrinkwrap file after stuff has been installed with yarn --production, which means npm shrinkwrap will only list the production dependencies. Why are we removing json after all? Because we don't need to remove the devDependencies anymore - which needed some more complex JSON mangling. Now we simply need to remove a line, which can be done with sed. But also, because doing it with json gets a bit tricky, as json would need to be listed as an actual dependency (rather than devDependency) of code-server and vscode too to be able to be used... Not worth it. Switching the jq commands to json might still be worth it, but no need to conflate the commits. Why no more yarn pack artifact? Realized I was trying to fix/conflate too many things into one PR, so will likely create a different issue to discuss this one.

Open Graph Description: Fixes #5056 #5174 Why are we removing synp after all? Because it only takes care of putting in the package-lock/shrinkwrap file the first level of dependencies, not the nested dependencies which ...

X Description: Fixes #5056 #5174 Why are we removing synp after all? Because it only takes care of putting in the package-lock/shrinkwrap file the first level of dependencies, not the nested dependencies which ...

Opengraph URL: https://github.com/coder/code-server/pull/5071

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:06a4f6b2-e8f4-b238-8ff2-f916f174a6a4
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idEC42:1F2B:CBE4BF:111267F:6B01D241
html-safe-nonced7b44aa50f159ec877c08d499f744eb14ab780b6a7b09f2bbd0296d155887cd3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzQyOjFGMkI6Q0JFNEJGOjExMTI2N0Y6NkIwMUQyNDEiLCJ2aXNpdG9yX2lkIjoiODY1NDgwMzgyNTYyMzk0NTc5MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacea59ec558cd82162ce421dc3e71ea484bf86989e8d47e3b429b89ce279d9dc3a
hovercard-subject-tagpull_request:902186829
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/coder/code-server/pull/5071/files
twitter:imagehttps://avatars.githubusercontent.com/u/4997403?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/4997403?s=400&v=4
og:image:altFixes #5056 #5174 Why are we removing synp after all? Because it only takes care of putting in the package-lock/shrinkwrap file the first level of dependencies, not the nested dependencies which ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/coder/code-server git https://github.com/coder/code-server.git
octolytics-dimension-user_id95932066
octolytics-dimension-user_logincoder
octolytics-dimension-repository_id172953845
octolytics-dimension-repository_nwocoder/code-server
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id172953845
octolytics-dimension-repository_network_root_nwocoder/code-server
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/coder/code-server/pull/5071/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcode-server%2Fpull%2F5071%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcode-server%2Fpull%2F5071%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=coder%2Fcode-server
Reloadhttps://github.com/coder/code-server/pull/5071/files
Reloadhttps://github.com/coder/code-server/pull/5071/files
Reloadhttps://github.com/coder/code-server/pull/5071/files
coderhttps://github.com/coder
code-serverhttps://github.com/coder/code-server
Codehttps://github.com/coder/code-server
Issues147 (147)https://github.com/coder/code-server/issues
Pull requests17 (17)https://github.com/coder/code-server/pulls
Discussionshttps://github.com/coder/code-server/discussions
Actionshttps://github.com/coder/code-server/actions
Projectshttps://github.com/coder/code-server/projects
Security and quality3 (3)https://github.com/coder/code-server/security
Insightshttps://github.com/coder/code-server/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fcoder%2Fcode-server%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fcoder%2Fcode-server%2Fissues%2Fnew%2Fchoose
code-asherhttps://github.com/code-asher
coder:mainhttps://github.com/coder/code-server/tree/main
edvincent:fix-shrinkwraphttps://github.com/edvincent/code-server/tree/fix-shrinkwrap
Conversation 51 https://github.com/coder/code-server/pull/5071
Commits 1 https://github.com/coder/code-server/pull/5071/commits
Checks 0 https://github.com/coder/code-server/pull/5071/checks
Files changed https://github.com/coder/code-server/pull/5071/files
Please reload this pagehttps://github.com/coder/code-server/pull/5071/files
fix: Generate shrinkwraps for the bundled vscode https://github.com/coder/code-server/pull/5071/files#top
Show all changes 1 commit https://github.com/coder/code-server/pull/5071/files
5c0cfdc Generate shrinkwrap file for deterministic dependencies edvincent Aug 18, 2022 https://github.com/coder/code-server/pull/5071/commits/5c0cfdcd5b11a1754fa6ba5968fa2a5ebef9b2fc
Clear filters https://github.com/coder/code-server/pull/5071/files
Please reload this pagehttps://github.com/coder/code-server/pull/5071/files
Please reload this pagehttps://github.com/coder/code-server/pull/5071/files
build-release.sh https://github.com/coder/code-server/pull/5071/files#diff-471375dd1b99488272fffd0471bbd64b79dfd813b8d5b631b0f072a8ca40fcaa
npm-postinstall.sh https://github.com/coder/code-server/pull/5071/files#diff-9efc23615796709119daa0db0050a3b67205c9c8ee6d23a2ef635a88958ae777
package.json https://github.com/coder/code-server/pull/5071/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
yarn.lock https://github.com/coder/code-server/pull/5071/files#diff-51e4f558fae534656963876761c95b83b6ef5da5103c4adef6768219ed76c2de
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
ci/build/build-release.shhttps://github.com/coder/code-server/pull/5071/files#diff-471375dd1b99488272fffd0471bbd64b79dfd813b8d5b631b0f072a8ca40fcaa
View file https://github.com/edvincent/code-server/blob/5c0cfdcd5b11a1754fa6ba5968fa2a5ebef9b2fc/ci/build/build-release.sh
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/5071/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/5071/files#diff-471375dd1b99488272fffd0471bbd64b79dfd813b8d5b631b0f072a8ca40fcaa
https://github.com/coder/code-server/pull/5071/files#diff-471375dd1b99488272fffd0471bbd64b79dfd813b8d5b631b0f072a8ca40fcaa
https://github.com/coder/code-server/pull/5071/files#diff-471375dd1b99488272fffd0471bbd64b79dfd813b8d5b631b0f072a8ca40fcaa
https://github.com/coder/code-server/pull/5071/files#diff-471375dd1b99488272fffd0471bbd64b79dfd813b8d5b631b0f072a8ca40fcaa
https://github.com/coder/code-server/pull/5071/files#diff-471375dd1b99488272fffd0471bbd64b79dfd813b8d5b631b0f072a8ca40fcaa
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
ci/build/npm-postinstall.shhttps://github.com/coder/code-server/pull/5071/files#diff-9efc23615796709119daa0db0050a3b67205c9c8ee6d23a2ef635a88958ae777
View file https://github.com/edvincent/code-server/blob/5c0cfdcd5b11a1754fa6ba5968fa2a5ebef9b2fc/ci/build/npm-postinstall.sh
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/5071/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/5071/files#diff-9efc23615796709119daa0db0050a3b67205c9c8ee6d23a2ef635a88958ae777
https://github.com/coder/code-server/pull/5071/files#diff-9efc23615796709119daa0db0050a3b67205c9c8ee6d23a2ef635a88958ae777
Please reload this pagehttps://github.com/coder/code-server/pull/5071/files
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
package.jsonhttps://github.com/coder/code-server/pull/5071/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
View file https://github.com/edvincent/code-server/blob/5c0cfdcd5b11a1754fa6ba5968fa2a5ebef9b2fc/package.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/5071/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/5071/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
https://github.com/coder/code-server/pull/5071/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
https://github.com/coder/code-server/pull/5071/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
https://github.com/coder/code-server/pull/5071/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
Please reload this pagehttps://github.com/coder/code-server/pull/5071/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.