Skip to content
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

Document how to generate the dist file #9

Closed
ggrossetie opened this issue Jan 9, 2020 · 9 comments · Fixed by #14
Closed

Document how to generate the dist file #9

ggrossetie opened this issue Jan 9, 2020 · 9 comments · Fixed by #14

Comments

@ggrossetie
Copy link
Contributor

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

@gusbemacbe
Copy link
Collaborator

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

@ggrossetie
Copy link
Contributor Author

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

@gusbemacbe
Copy link
Collaborator

@Mogztter

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

@joshgoebel
Copy link
Member

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

@gusbemacbe
Copy link
Collaborator

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

@joshgoebel
Copy link
Member

joshgoebel commented Jan 11, 2020

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.

@gusbemacbe
Copy link
Collaborator

Ah, I got.

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

@ggrossetie
Copy link
Contributor Author

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?

@joshgoebel
Copy link
Member

joshgoebel commented Jan 11, 2020

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.

gusbemacbe added a commit that referenced this issue Jan 12, 2020
resolves #9 document how to generate the dist file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants