highlightjs / highlightjs-cypher

Cypher language syntax highlighting plugin for highlight.js

Home Page:https://highlight.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document how to generate the dist file

ggrossetie opened this issue · comments

The package.json does not contain a dist task. How the file dist/cypher.min.js is generated?

Hello @Mogztter

Here is small tutorial done by @yyyc514:

highlightjs/highlight.js#2328

Or the quick snippet:

git clone https://github.com/highlightjs/highlight.js
git checkout squash_build_pipeline

npm install

mkdir extra
cd extra
git clone https://github.com/highlightjs/highlightjs-cypher
cd ..

node ./tools/build.js -t browser :common cypher

// or

node  --stack-size=65500  ./tools/build.js -t cdn

Alright, so if I understand correctly, we should rely on the main repository (highlightjs/highlight.js) to generate the dist: #2 (comment).

We should probably add the procedure to the README (once the branch squash_build_pipeline is merged).

@Mogztter

Actually I wanted to minify the Cypher files. But you did.

Alright, so if I understand correctly, we should rely on the main repository (highlightjs/highlight.js) to generate the dist:

Yes, though eventually perhaps we need a nicer way of doing it. :-)

I think node --stack-size=65500 ./tools/build.js -t cdn generates and minify a CYpher file. Let us see @yyyc514's answer.

It builds a FULL CDN build of all languages (including all 3rd party ones in extra) and it places the 3rd party distributables into the dist folder automagically.

Ah, I got.

@Mogztter, please make a PR and add the minified files from the folder dist.

Yes, though eventually perhaps we need a nicer way of doing it. :-)

@yyyc514 I think it would be useful if we could generate the dist without a local copy of the highlightjs repository.
I believe it should be possible to create a npm package of the build scripts?

npm i highlightjs-tools-build --save-dev
const builder = require('highlightjs-tools-build')
builder.build('/path/to/repository')

Or we could provide a binary:

"scripts": {
  "dist": "highlightjs-build -t cdn ."
}

Wdyt?

Long-term, yes. Though there is no great way to run the FULL test suite (auto-detect tests) that way... I don't think I'd want to release a WHOLE other npm package... that means it's probably be the existing npm package that expanded, but I'm not sure we want ALL the test bits in there. Haven't given it a lot of thought.