From 4c2d1654c4a071f934092877e50a05024705f618 Mon Sep 17 00:00:00 2001 From: Jehon Date: Mon, 8 Oct 2018 21:52:10 +0200 Subject: [PATCH 1/2] Enrich package.json (and Readme) to avoid gulp global install (#1753) Add commands from readme into the package.json scripts to make gulp install globally optional Not everybody want to have a global install of gulp, when it is not necessary. --- README.md | 19 +++++++++++++------ package.json | 4 +++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index fad6c340..f70b2ccf 100644 --- a/README.md +++ b/README.md @@ -56,11 +56,18 @@ The app is based on the AngularJS JavaScript framework, and written in pure Java The project repository is based on angularjs-seed and includes gulp tasks, so it's easy to launch the app locally on your desktop. -Install [node.js](http://nodejs.org/) and run the following commands in the project directory +Install [node.js](http://nodejs.org/). +Install dependencies with: + +```lang=bash +npm install ``` + +Optionaly, run the following commands in the project directory to install gulp globally: + +```lang=bash sudo npm install -g gulp -npm install ``` This will install all the needed dependencies. @@ -69,7 +76,7 @@ This will install all the needed dependencies. #### Running web-server -Just run `gulp watch` to start the web server and the livereload task. +Just run `npm start` (`gulp watch`) to start the web server and the livereload task. Open http://localhost:8000/app/index.html in your browser. @@ -78,18 +85,18 @@ Open http://localhost:8000/app/index.html in your browser. To run this application in Google Chrome as a packaged app, open this URL (in Chrome): `chrome://extensions/`, then tick "Developer mode" and press "Load unpacked extension...". Select the downloaded `app` folder and Webogram should appear in the list. -Run `gulp watch` to watch for file changes and automatically rebuild the app. +Run `npm start` (`gulp watch`) to watch for file changes and automatically rebuild the app. #### Running as Firefox OS App To run this application in Firefox as a packaged app, open "Menu" -> "Developer" -> "WebIDE" (or hit `Shift + F8`). Choose "Open packaged app" from the Project menu and select the `app` folder. -Run `gulp watch` to watch for file changes and automatically rebuild the app. +Run `npm start` (`gulp watch`) to watch for file changes and automatically rebuild the app. #### Running in production -Run `gulp clean`, then `gulp publish` to build the minimized production version of the app. Copy `dist` folder contents to your web server. Don't forget to set `X-Frame-Options SAMEORIGIN` header ([docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options)). +Run `npm run clean` (`gulp clean`), then `npm run publish` (`gulp publish`) to build the minimized production version of the app. Copy `dist` folder contents to your web server. Don't forget to set `X-Frame-Options SAMEORIGIN` header ([docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options)). ### Third party libraries diff --git a/package.json b/package.json index 20d2ca05..cce478f5 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,10 @@ "show": true }, "scripts": { + "clean": "gulp clean", "start": "gulp watch", - "test": "gulp test" + "test": "gulp test", + "build": "gulp publish" }, "repository": { "type": "git", From e565ca3a82dc9bfed4541ed7773f904c350f6f20 Mon Sep 17 00:00:00 2001 From: MiniDigger Date: Mon, 12 Nov 2018 19:39:45 +0100 Subject: [PATCH 2/2] Fix wrong build instruction in readme (#1780) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f70b2ccf..05e9eb70 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ Run `npm start` (`gulp watch`) to watch for file changes and automatically rebui #### Running in production -Run `npm run clean` (`gulp clean`), then `npm run publish` (`gulp publish`) to build the minimized production version of the app. Copy `dist` folder contents to your web server. Don't forget to set `X-Frame-Options SAMEORIGIN` header ([docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options)). +Run `npm run clean` (`gulp clean`), then `npm run build` (`gulp publish`) to build the minimized production version of the app. Copy `dist` folder contents to your web server. Don't forget to set `X-Frame-Options SAMEORIGIN` header ([docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options)). ### Third party libraries