-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Node Build Script #550
Node Build Script #550
Conversation
This mimics the old build script in python so there is minimal transitioning from old to new. As an example, the node build: python3 tools/build.py -t node node tools/build.js -t node
This is used for browser, amd, and part of the cdn build.
Yeah, I was thinking about the same since @chriseidhof's danced around Python version for Travis. There's one reason why we can't just switch immediately to this: the Python script as used as a library within highlightjs.org to generate custom downloads. I should look into it to see if it's feasible to call an external process instead. |
Oh awesome! The python and node dependency was a bit weird. Great that it'll be all javascript now. |
This is mainly because browserify doesn't recognise requiring the languages via a loop.
@isagalaev any progress on getting this working for highlightjs.org? |
Not yet, I was invested into another project for the past few weeks. I should get back to highlight.js next week. Though I was planning to finish first the new demo "page" in #542. |
As it happens, while writing a vast explanation of how non-trivial that would be for highlightjs.org I realized that it's actually quite doable :-). Here's the edited out version: There are a few things for which highlightjs.org uses the build script as a library:
As I realize now, the first two items were there before we had the CDN build target and it apparently does exactly what I need, I will just have to concatenate all the files together which is easy and (hopefully) future-proof. The listing languges part can (and probably should) be fixed by moving category definition from the build script into language headers ( So here's the proposed plan:
Sounds good? |
BTW, it probably makes sense to do all this after the CDN auto-update thing and the release of 8.3. |
Progress update: I've updated the site, it doesn't depend anymore on the Python code, needs only to switch to the new shell command invocation. BTW, it's impressive how fast the builds are now, when there's no JVM involved :-) |
Really cool stuff! Thanks for mentioning me in the blogpost, that wasn't On Tue, Oct 7, 2014 at 9:18 PM, Ivan Sagalaev [email protected]
Chris Eidhof |
You removed the headache of doing research and testing the result. The fact of taking care of the overall job is usually worth much, much more than the actual amount of work required. So thank you! |
Since both python and javascript can parse JSON easily, wouldn't it be better to just put these categories into a separate JSON file? |
I was hoping to finally unify meta data in one place, and the file's header seems a good place. Aren't you parsing them anyway for "Requires"? |
Tentatively nominating it for 8.3 as I feel it shouldn't take long to iron out now. @sourrust feel free to drop the milestone, I'll release the 8.3 right away then. |
This will first take only the base files needed then put back in files that have a "requires" field in their file header.
I am, but I thought it would be a simpler solution. Either way, I got it working with Category in the language headers. |
Implemented the old python script in node to rely on one dependency -- that being node.js. I made the CLI identical to the old one so it won't be that difficult to change from the old to the new.
I'm pretty sure I've got the builds correctly but I'm making this pull request to stamp on any issues.