highlight.js icon indicating copy to clipboard operation
highlight.js copied to clipboard

(request org repo) highlightjs-phix

Open petelomax opened this issue 1 year ago • 10 comments

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.

  • [X] I have an existing personal repository ready to go

Metadata

Requirements

  • [X] I've read the language Contributor Checklist
  • [X] I've read the Language Contribution Guide
  • [X] I'm currently willing to support and maintain this grammar over time
  • [ ] That repo includes a dist folder with CDN-ready CJS and ESM builds
  • [X] That README.md includes examples of simple web usage
  • [ ] That README.md includes examples of Node.js usage

Afterwards

Submit a PR that:

  • [X] adds mention of your new language to CHANGES.md
  • [X] updates SUPPORTED_LANGUAGES.md in the main library

petelomax avatar Mar 03 '23 18:03 petelomax

Please go ahead and complete the requirements fully and I can get this setup for you.

joshgoebel avatar Mar 04 '23 07:03 joshgoebel

Ping.

joshgoebel avatar Mar 19 '23 15:03 joshgoebel

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."

petelomax avatar Mar 21 '23 07:03 petelomax

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

joshgoebel avatar Mar 21 '23 23:03 joshgoebel

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.

joshgoebel avatar Mar 21 '23 23:03 joshgoebel

Ping.

joshgoebel avatar Apr 29 '23 12:04 joshgoebel

No idea whether what I've just done is anything close to what you meant.

petelomax avatar Jun 12 '23 01:06 petelomax

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?

joshgoebel avatar Feb 13 '24 02:02 joshgoebel

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>

petelomax avatar Feb 13 '24 13:02 petelomax

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...

joshgoebel avatar Mar 19 '24 03:03 joshgoebel