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

Add prepare script, making it easy to install Prism from outside of NPM. #3699

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Commits on Jun 30, 2023

  1. A prepare script, making it easy to install Prism from outside of NPM.

    The `prepare` script is the NPM-standard way in which outside-of-NPM packages can be build, for example with installed from a git location.
    
    After merging this into the main branch (currently `master`), people will be able to do this:
    
    ```sh
    npm install prismjs@github:PrismJS/prism
    ```
    
    If they want to try it right now before v2 is merged (if this is merged into v2), they can do this:
    
    ```sh
    npm install prismjs@github:PrismJS/prism#v2
    ```
    
    Without this, such installations are not possible.
    
    What NPM does during the `install` process is
    
    - it clones the specified repo,
    - checks out the specified git ref (f.e. `v2`),
    - installs dependencies including dev dependencies,
    - runs the `prepare` script if any (the `prepare` script will *always* have dev dependencies available to it),
    - and finally packages the result in the same way as `npm pack` such that build outputs are included in the final package that gets installed into the user's node_modules
    
    This would be a way for people to easily test v2 right now and provide feedback.
    trusktr committed Jun 30, 2023
    Configuration menu
    Copy the full SHA
    f78f1e8 View commit details
    Browse the repository at this point in the history