Merge ~mpontillo/maas:move-node-modules-to-top-level into maas:master

Proposed by Mike Pontillo
Status: Merged
Approved by: Mike Pontillo
Approved revision: cda13eaf145e11a3018a3485bab5197b80c8a246
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~mpontillo/maas:move-node-modules-to-top-level
Merge into: maas:master
Diff against target: 45 lines (+4/-5)
2 files modified
Makefile (+3/-4)
src/maasserver/static/scss/build.scss (+1/-1)
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+338463@code.launchpad.net

Commit message

Move node_modules to top level directory.

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Looks good.

review: Approve
Revision history for this message
Mike Pontillo (mpontillo) wrote :

This change is being made because Webpack (and other node.js tools) require special configuration in order to operate when the node_modules directory is located somewhere other than the root. This change will make the MAAS development environment more consistent with regard to the expectations of the node.js platform.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile b/Makefile
2index e3f698b..eec759a 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -39,7 +39,6 @@ dbrun := bin/database --preserve run --
6 # Path to install local nodejs.
7 mkfile_dir := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
8 nodejs_path := $(mkfile_dir)/include/nodejs/bin
9-nodejs_modules_path := include/nodejs/node_modules
10
11 export PATH := $(nodejs_path):$(PATH)
12
13@@ -190,8 +189,8 @@ include/nodejs/yarn.tar.gz:
14 include/nodejs/bin/yarn: include/nodejs/yarn.tar.gz
15 tar -C include/nodejs/ -xf include/nodejs/yarn.tar.gz --strip-components=1
16
17-$(nodejs_modules_path): include/nodejs/bin/node include/nodejs/bin/yarn
18- yarn --modules-folder $@
19+node_modules: include/nodejs/bin/node include/nodejs/bin/yarn
20+ yarn
21
22 define js_bins
23 bin/karma
24@@ -199,7 +198,7 @@ define js_bins
25 bin/node-sass
26 endef
27
28-$(strip $(js_bins)): $(nodejs_modules_path)
29+$(strip $(js_bins)): node_modules
30 ln -sf ../node_modules/.bin/$(notdir $@) $@
31
32 js-update-macaroonbakery:
33diff --git a/src/maasserver/static/scss/build.scss b/src/maasserver/static/scss/build.scss
34index 3b0aacf..3def6ee 100644
35--- a/src/maasserver/static/scss/build.scss
36+++ b/src/maasserver/static/scss/build.scss
37@@ -3,7 +3,7 @@
38 @import 'utils';
39
40 // Import Vanilla framework
41-@import '../../../../include/nodejs/node_modules/vanilla-framework/scss/vanilla';
42+@import '../../../../node_modules/vanilla-framework/scss/vanilla';
43 @include vanilla;
44
45 // Import local patterns

Subscribers

People subscribed via source and target branches