Here’s my issue:
the nodejs plugin will actually run “npm install” during the pull phase before it runs the build step.
I have a dependency “model” in “bar” that is not in the npm repositories, and I have to pull in locally.
So, I have to be able to put the “model” part into the “parts/bar/src/node_modules” before I start pulling “bar”, or npm will fail to install because it can’t find “model”.
Is there a way to do this? Or is there a more elegant way that I am just missing?
Here is my snapcraft.yaml:
name: bar
version: '0.1'
grade: stable
confinement: devmode
summary: some package
description: package ahoy
apps:
bar:
command: yarn run watch
plugs: [network, network-bind, network-manager,network-control]
parts:
model:
source: "file://../../model/"
plugin: nodejs
source-type: local
node-engine: "8.11.0"
node-package-manager: "npm"
override-build: |
#copy model into node_modules/@lerna_monorepo/model,
#then build bar
snapcraftctl build
mkdir -p $SNAPCRAFT_PART_INSTALL/node_modules/@lerna_monorepo/model
cp package.json $SNAPCRAFT_PART_INSTALL/node_modules/@lerna_monorepo/model
cp .gitignore $SNAPCRAFT_PART_INSTALL/node_modules/@lerna_monorepo/model
cp -R src/ $SNAPCRAFT_PART_INSTALL/node_modules/@lerna_monorepo/model
cp -R node_modules/ $SNAPCRAFT_PART_INSTALL/node_modules/@lerna_monorepo/model
cp -R dist/ $SNAPCRAFT_PART_INSTALL/node_modules/@lerna_monorepo/model
bar:
source: .
plugin: nodejs
node-engine: "8.11.0"
node-package-manager: "npm"
after: [model]