From d929d4cb29f181368133eecba9e1e0c1b27a6faf Mon Sep 17 00:00:00 2001 From: Patrick Huang Date: Tue, 9 Jun 2015 12:28:14 +1000 Subject: [PATCH 1/5] download node and npm to user.home/Downloads so a clean build won't download them again --- frontend/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/pom.xml b/frontend/pom.xml index 4a3b2992b2..6b4c78a966 100644 --- a/frontend/pom.xml +++ b/frontend/pom.xml @@ -17,7 +17,7 @@ ${project.build.directory}/web ${project.build.directory}/build ${bundle.output}/META-INF/resources - ${project.build.directory} + ${download.dir}/zanata-frontend/node-${node.version}-npm-${npm.version} ${node.install.directory}/node/npm/bin/npm-cli.js From b90145b3e7802eaffb991d19357b7c96b5c3f812 Mon Sep 17 00:00:00 2001 From: Patrick Huang Date: Tue, 9 Jun 2015 13:47:11 +1000 Subject: [PATCH 2/5] tell npm to always try install from cache if it has cache younger than configured large value --- frontend/pom.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/pom.xml b/frontend/pom.xml index 6b4c78a966..adb3066481 100644 --- a/frontend/pom.xml +++ b/frontend/pom.xml @@ -85,6 +85,9 @@ ${npm.cli.script} install + --cache-min + + 999999 From 628ea6ae53f86a16218be101bae453fb772af979 Mon Sep 17 00:00:00 2001 From: Patrick Huang Date: Tue, 9 Jun 2015 14:04:24 +1000 Subject: [PATCH 3/5] add readme to frontend module --- frontend/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 frontend/README.md diff --git a/frontend/README.md b/frontend/README.md new file mode 100644 index 0000000000..be9c2ba7af --- /dev/null +++ b/frontend/README.md @@ -0,0 +1,18 @@ +## This is a module to build frontend javascript projects + +At the moment it only contains "user profile page" bundle. + +To build it, just run + +```mvn install``` + +Following mvn arguments is overrideable from command line: + +``` +v0.12.2 +2.7.6 +${download.dir}/zanata-frontend/node-${node.version}-npm-${npm.version} +${node.install.directory}/node/npm/bin/npm-cli.js +``` + +By default it will try to install npm modules using cache unless the cache entry is older than configured value (at time of writing, it's 999999 seconds). From eca53063eaf4335bf77c45605146585ca7c23fe0 Mon Sep 17 00:00:00 2001 From: Patrick Huang Date: Tue, 9 Jun 2015 14:42:29 +1000 Subject: [PATCH 4/5] change default to install from npm registry with profile to activate offline cache mode --- frontend/README.md | 5 +++-- frontend/pom.xml | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/frontend/README.md b/frontend/README.md index be9c2ba7af..608ebae783 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -2,7 +2,7 @@ At the moment it only contains "user profile page" bundle. -To build it, just run +To build it, just run ```mvn install``` @@ -15,4 +15,5 @@ Following mvn arguments is overrideable from command line: ${node.install.directory}/node/npm/bin/npm-cli.js ``` -By default it will try to install npm modules using cache unless the cache entry is older than configured value (at time of writing, it's 999999 seconds). +By default it will try to install npm modules from npm registry (default cache TTL is 10 seconds). +If you activate profile ```-DnpmOffline``` the cache-min option will become 9999999 which means it will try to install npm modules from cache first. diff --git a/frontend/pom.xml b/frontend/pom.xml index adb3066481..b9b55c1e53 100644 --- a/frontend/pom.xml +++ b/frontend/pom.xml @@ -19,6 +19,8 @@ ${bundle.output}/META-INF/resources ${download.dir}/zanata-frontend/node-${node.version}-npm-${npm.version} ${node.install.directory}/node/npm/bin/npm-cli.js + + 10 user-profile-page @@ -86,8 +88,7 @@ ${npm.cli.script} install --cache-min - - 999999 + ${npm.cache.min} @@ -128,4 +129,18 @@ + + + npm offline + + + npmOffline + + + + 9999999 + + + + From 94b2367eed43b71f5530f272b9454ac1ffb64243 Mon Sep 17 00:00:00 2001 From: Patrick Huang Date: Tue, 9 Jun 2015 15:00:51 +1000 Subject: [PATCH 5/5] minor naming and readme change --- frontend/README.md | 8 ++++++-- frontend/pom.xml | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/README.md b/frontend/README.md index 608ebae783..65e5acff5a 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,4 +1,4 @@ -## This is a module to build frontend javascript projects +## This is a module to build zanata frontend javascript projects At the moment it only contains "user profile page" bundle. @@ -6,7 +6,11 @@ To build it, just run ```mvn install``` -Following mvn arguments is overrideable from command line: +It will build and deploy to local maven repository a jar file containing the javascript bundle. +The jar file can be used directly under any servlet 3 compatible container and the bundle is accessible as static resources. +See [Servlet 3 static resources](http://www.webjars.org/documentation#servlet3). + +The following Maven properties can be overridden on the command line with ```-Dkey=value```: ``` v0.12.2 diff --git a/frontend/pom.xml b/frontend/pom.xml index b9b55c1e53..741196cf34 100644 --- a/frontend/pom.xml +++ b/frontend/pom.xml @@ -131,7 +131,7 @@ - npm offline + npmOffline npmOffline