Giter VIP home page Giter VIP logo

Comments (2)

mikkoh avatar mikkoh commented on June 23, 2024

Yep you're probably right. Could allow clobbering via option. Not sure what the default should be.

I haven't used this module in awhile. Initially I was wanting to create a module that would track installed modules. A sort of analytics module.

from npm-hooks.

jordwalke avatar jordwalke commented on June 23, 2024

I found an incredibly important use case for this (or hooks in general). We created a far superior postinstall for the purpose of architecture specific compilation, but it could be used for any build step in postinstall. It's called esy.

  • Parallel builds among all packages.
  • Caches artifacts across projects (important for native compilation which takes minutes/hours).
  • Recoverable builds.
  • Out of source builds - doesn't touch your actual node_modules and write artifacts into them.

Here's what the package.json would look like:

{
  "name": "testtop",
  "version": "1.0.0",
  "scripts": {
    "install": "esybuild"
  },
  "esy": {
    "build": ["your commands here"]
  },
  "dependencies": {
    "esy": "*"
  }
}

Here's where I use my fork of this library to do that. What it does is, it attaches a hook to ensure that only the top level package's post install runs, which kicks of the parallel builds from the top down in a system we control, not npm.

Notice how it just looks like you're running esybuild on install - which you are, but that's not the real build :D

from npm-hooks.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.