Packaging nodejs apps

Stephen Stewart stephen.stewart at canonical.com
Mon Nov 14 11:19:24 UTC 2016


On Mon, Nov 14, 2016 at 10:34 AM Didier Roche <didrocks at ubuntu.com> wrote:

> Le 14/11/2016 à 10:55, Stephen Stewart a écrit :
> > Hi,
> >
> > While looking into a nodejs/yarn plugin I wondered if I could make a
> > yarn snap (not plugin), and simply define nodejs and yarn as parts,
> > use dump plugin and be done, no plugin required:
> >
> > "Parts 'yarn' and 'node' have the following file paths in common which
> > have different contents:"
> >
> > https://pastebin.canonical.com/170573/
> >
> > So I am wondering why doesn't this just work?
>
> Hey Stephen,
>

Hi Didier,


>
> It doesn't work simply because snapcraft doesn't know which file from
> which part to ship. You have common files between parts with different
> contents (as the error message underline). Which one of yarn's or node's
> README.md should be included for instance?
>

Fair enough, but ...


> >
> > It seems like name collisions in parts might be a common enough thing,
> > and I couldn't quite understand the help docs around filesets and
> > organise to see a nice way to make this work for me across projects.
>
> I guess http://snapcraft.io/docs/build-snaps/advanced-features will be a
> better example.
> Basically, you define in one parts a fileset with:
> filesets:
>   exclude:
>     - -README.md
>     - - LICENSE
>     - -lib/constants.js
> (note the - to say to exclude those 3 files).
>

... sure, but both parts need `lib/constants.js`; I can't exclude
lib/constants for one part and hope that my snap will work, can I?

I feel like I'm missing something really obvious here :(


>
> then, in the same part you want to exclude those files:
> stage: [$exclude]
> snap: [$exclude]
>
> And you should be done!
> Didier
>
>
> --
> Snapcraft mailing list
> Snapcraft at lists.snapcraft.io
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/snapcraft
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20161114/33d24e47/attachment.html>


More information about the Snapcraft mailing list