Open petelomax opened 1 year ago
Please go ahead and complete the requirements fully and I can get this setup for you.
Ping.
Pong. What are CJS and ESM builds anyway? I was thinking of adding a section for use on Node.js along the lines of "submit a PR with any needed changes and full instructions, then after that has been merged, simply follow those instructions."
Different JS standards, long story. If you follow the 3rd party guide and use our own ./tools/build -t cdn
the build process will create the dist
folder for you (along with CJS and ESM versions), you merely need to check them into GitHub.
Here is a typical Node example from another repo:
https://github.com/highlightjs/highlightjs-robots-txt#with-node-or-another-build-system
This will likely all change when we go ESM only with v12, but until then we do like to see all 3rd party modules support our "drop-in" CDN build format... which is just a CJS file that self-registers (which again we'll build for you)... like all the grammars we ship as part of our CDN package.
Ping.
No idea whether what I've just done is anything close to what you meant.
If you follow the 3rd party guide and use our own ./tools/build -t cdn the build process will create the dist folder for you (along with CJS and ESM versions), you merely need to check them into GitHub.
Did you try this?
Sure: F:\misc\highlightjs\highlight.js>node .\tools\build.js -t cdn Starting build. Finished build. Writing style files. node:fs:737 handleErrorFromBinding(ctx); ^
Error: EINVAL: invalid argument, read at Object.readSync (node:fs:737:3) at tryReadSync (node:fs:432:20) at Object.readFileSync (node:fs:478:19) at new Language (F:\misc\highlightjs\highlight.js\tools\lib\language.js:27:20) at Language.fromFile (F:\misc\highlightjs\highlight.js\tools\lib\language.js:67:12) at getLanguages (F:\misc\highlightjs\highlight.js\tools\lib\language.js:108:26) at async Object.buildCDN [as build] (F:\misc\highlightjs\highlight.js\tools\build_cdn.js:39:21) at async doTarget (F:\misc\highlightjs\highlight.js\tools\build.js:90:3) { errno: -4071, syscall: 'read', code: 'EINVAL' }
Node.js v19.3.0
F:\misc\highlightjs\highlight.js>
I'd suggest trying the build on linux or linux subsystem... unless someone who is a windows experts wants to come along and dig into this...
I would like to request the creation of a
highlightjs-phix
repository for my 3rd party grammar.I know very little about cdn or node.
Metadata
Requirements
dist
folder with CDN-readyCJS
andESM
buildsREADME.md
includes examples of simple web usageREADME.md
includes examples of Node.js usageAfterwards
Submit a PR that:
CHANGES.md
SUPPORTED_LANGUAGES.md
in the main library