Created attachment 225246 [details]
diff file for new port code-server per Porters Handbook
This is a new port submission for code-server (https://github.com/cdr/code-server) which allows you to run VS Code on any machine anywhere as a server and access it in the browser.
Along with building and installing the software, it also installs an rc.d script to allow it to be easily controlled as a service.
I had posted an rc.d script on GitHub for it, and someone asked if I would be willing to make a port out of it, so I did. (https://github.com/microsoft/vscode-remote-release/issues/727#issuecomment-843870075)
Please let me know if you have any questions!
(In reply to Rob from comment #0)
Here is a link to the GitHub repo I made for this port:
Thanks for working on this port! I know that this is a long-wanted one from the community. :)
I haven't reviewed it thoroughly, but two things that I noticed:
- $FreeBSD$ line is deprecated.
- I feel like editors is not the best category for this - although one could argue that this does provide an editor, it is in fact an application server, and should probably belong to www?
(In reply to Guangyuan Yang from comment #2)
Thank you for starting to review!
Yes, I was torn between the editors and www categories and ultimately went with editors, but I agree with you that it actually is an application server. I have updated the category to www and also removed the deprecated $FreeBSD$ lines.
Please see the attached updated diff. Thank you!
Created attachment 225272 [details]
Updated diff file.
Changed category to www from editors, and removed deprecated $FreeBSD$ lines.
Ok, I think (from my limited experience in this topic of npm-based ports) this port won't pass Poudriere test port, since internet access in do-install is forbidden, but is required here from npm install.
There aren't many nodejs/npm based ports, and I am not sure what the best way is to solve this problem. A possible way is to pre-fetch and package the node_modules and serve it off for this port. Please take a look at misc/netron/Makefile, and I can possibly help you in the process.
(In reply to Guangyuan Yang from comment #5)
Yes, I was afraid of that :( I had let Poudriere access the internet during the build stage as I wasn't sure if no network access was a strict rule or not.
I did work on a version where during the fetch phase, I extracted the package.json file from the distfile, used it to pre-download the dependencies during fetch, then moved the node_modules to the work dir. (package.json is what npm/node uses to download dependencies into a node_modules folder). Unfortunately, it is not as simple as that for this particular software so the Makefile started getting ugly, but I will go back to the drawing board and work on it. It may not be pretty, but I am sure there is a way.
Regarding misc/netron, it appears they pre-packaged the entire node_modules folder as a download. That might be an option as a last resort (size permitting). Thank you!