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

Run buildAll in prepare, move husky install to postinstall #1583

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

Commits on Jan 20, 2024

  1. Run buildAll in prepare, move husky install to postinstall

    Husky adds git hooks into the repo. We want the dev experience of
    
        $ git clone remote/luxon
        $ npm install # installs husky hooks
        $ ...develop develop develop...
        $ git commit
        _lint runs, everything works_
    
    We also want to build luxon when we call npm pack or npm publish.
    
    We also want to build luxon when it is installed somewhere else as a git
    dependency
    (https://docs.npmjs.com/cli/v10/configuring-npm/package-json#git-urls-as-dependencies)
    
    Git dependencies work by running `npm install` from GitFetcher and then
    depend on DirFetcher running `npm prepare` (but only prepare, not
    prepack or postpack)
    
    This change moves `husky install` to postinstall (which will,
    unfortunately, still pointlessly run when we install luxon as a git
    dependency). It moves the buildAll to prepare from prepack so that the
    build happens when installed as a git dependency. This should preserve
    existing behavior while enabling installation from git.
    
    When installing from git and/or in CI environments, the husky command is
    sometimes not available in postinstall or is available but bails out
    when not run in the context of a git repo.
    schleyfox committed Jan 20, 2024
    Configuration menu
    Copy the full SHA
    87fd3ff View commit details
    Browse the repository at this point in the history