janbiasi/monopacker

Npm pack instead of copy

smollweide opened this issue · 3 comments

Hi Jan,

thanks for this project.

Currently it’s needed to define which files should or should not be copied to the packed package. Instead of this you could use npm pack.

Because this projects „simulates“ an npm publish it would be more familiar to use npm pack.

Npm pack creates an zip file including the files which are included if it would be published to npm.

Hey @smollweide

Thanks for the input, but I don't get it through from 0 - end; 1) should it do a pack of each dependency (instead of copying) or 2) should the source application be packed? If it's case 2) we could try this simply with a hook but if 1) should be the case I don't get it completely as the docs of npm pack are minimalistic and not really helping 😆 We could also talk about that in the next few days! Would really like to know what you mean :)

Allright, @jantimon and I guessed what we need to try out:

dist
    app
        .monopacker
            @my-space
                pack1.tar.gz
                pack2.tar.gz
        node_modules
        src
            index.js <- require("@my-space/pack2/src/fancy-calculation.js")
        package.json
            postinstall -> "monopacker-install-helper" exec (installs from .monopacker)

does this fit your initial idea of using npm pack instead of copy @smollweide? :D

What I like about the idea is that the usage would be exactly the same as npm-pack but it would also work for mono repositories. So it could be advertised as "npm-pack for mono repositories" 😄- That might actually have a good seo effect 🤔