facebook / lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
https://lexical.dev
MIT License
19.62k stars 1.67k forks source link

Feature: Build project separately so can install from thirty party github subdir #4897

Closed aquarius-wing closed 1 year ago

aquarius-wing commented 1 year ago

I hope that the lexical repository can be built separately, because there is such a scenario where I have only modified the @lexical/markdown module. It may take some time for my PR to be approved after I submit it, but I want my project to be able to use it now. So at this time, I hope there is some way to support me to npm install a subfolder of a GitHub repository in my own project. The solution I can think of now is gitpkg, but lexical is built as a whole, so I hope lexical can be packaged separately, which may also improve the packaging speed a little.

aquarius-wing commented 1 year ago

I understand that this method may seem complex, so here's how I've implemented it:

  1. To ensure the correct functioning of gitpkg, I created aquarius-wing/gh2npm. This allows GitHub subdirectories to be converted into tarball files.

  2. You can now fork the facebook/lexical repository as your own, similar to what I did with aquarius-wing/lexical-for-keepwork.

  3. Following this, you can import your npm repository like so: npm install https://gh2npm.vercel.app/api/aquarius-wing/lexical-for-keepword/packages/lexical-markdown/npm?branch=keepwork-main.

  4. Note: In the example above, the unique aspect of branch keepwork-main is that it builds and submits code to GitHub for npm installation.