Skip to content

Commit

Permalink
Simplified build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
coldsource committed May 14, 2020
1 parent 5c36a4c commit 12da57c
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
package-lock.json
evqueue-browser-plugin.zip
evqueue-browser-plugin-src.zip
evqueue.zip
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ It allows you to create workflows (a chain of tasks), schedule tasks and workflo

For documentation and download, visit [the official website](http://www.evqueue.net/)!

### Packages

If you are looking for pre-compiled packages, see [our debian repository](https://packagecloud.io/coldsource/evqueue).
This technical documentation is only needed if you want to contribute to the project. If you just want to use the frontend, you should download [Firefox Addon](https://addons.mozilla.org/fr/firefox/addon/evqueue/) or [pre-built zip files](http://www.evqueue.net/downloads).

### Build

First, install dependencies :

```
$ npm install
```

Then build the project :

```
$ npm run build
```

Expand All @@ -26,18 +31,15 @@ $ npm run watch

### Package for production

This will pack :

* Browser extension
* Browser extension source ZIP
* Frontend dist ZIP

```
$ npm install
$ npm run build
$ npm run pack
```

Edit index.html and switch to production configuration in the bottom of the file.

### Build browser plugin

First, build and package application (see above steps). Then use :

```
$ npm run build:extension
```
You should then find 3 zip files, namely **evqueue-browser-plugin.zip**, **evqueue-browser-plugin-src.zip** and **evqueue.zip**.
5 changes: 5 additions & 0 deletions htdocs/conf/cluster.dist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"local#cbcbcb": [
"ws://127.0.0.1:5001"
]
}
7 changes: 4 additions & 3 deletions htdocs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@
Licensed under GPLv3 (<a target="_blank" href="http://www.evqueue.net">evqueue.net</a>)
</div>

<!-- DEV Settings -->
<!-- DEV -->
<script src="js/vendor/react/react.development.js"></script>
<script src="js/vendor/react/react-dom.development.js"></script>
<script src="js/vendor/chart/Chart.bundle.js"></script>
<script type="module" src="js/dist/components/base/app.js"></script>
<!-- END DEV -->

<!-- PROD Settings
<!-- PROD
<script src="js/vendor/react/react.production.min.js"></script>
<script src="js/vendor/react/react-dom.production.min.js"></script>
<script src="js/vendor/chart/Chart.bundle.min.js"></script>
<script src="js/dist/evqueue.js"></script>
-->
END PROD -->
</body>
</html>
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@
"webpack-cli": "3.3.11"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "node_modules/babel-cli/bin/babel.js htdocs/js/src --out-dir htdocs/js/dist --presets react && node_modules/sass/sass.js --no-source-map --style compressed htdocs/styles/src/ui.scss htdocs/styles/dist/ui.css",
"build:extension": "zip evqueue-browser-plugin.zip manifest.json browser-plugin/* htdocs/index.html htdocs/fonts/* htdocs/images/* htdocs/styles/dist/ui.css htdocs/styles/vendor/* htdocs/js/dist/evqueue.js htdocs/js/vendor/*/*; zip evqueue-browser-plugin-src.zip -r browser-plugin htdocs manifest.json package.json README.md",
"build:js": "node_modules/babel-cli/bin/babel.js htdocs/js/src --out-dir htdocs/js/dist --presets react",
"build:css": "node_modules/sass/sass.js --no-source-map --style compressed htdocs/styles/src/ui.scss htdocs/styles/dist/ui.css",
"build": "node_modules/npm-run-all/bin/npm-run-all/index.js build:*",
"watch:js": "node_modules/babel-cli/bin/babel.js --watch htdocs/js/src --out-dir htdocs/js/dist --presets react",
"watch:css": "node_modules/sass/sass.js --source-map --style expanded --watch htdocs/styles/src/ui.scss htdocs/styles/dist/ui.css",
"watch": "node_modules/npm-run-all/bin/npm-run-all/index.js --parallel watch:*",
"pack": "node_modules/webpack-cli/bin/cli.js --mode=production htdocs/js/dist/components/base/app.js --output htdocs/js/dist/evqueue.js"
"pack:js": "node_modules/webpack-cli/bin/cli.js --mode=production htdocs/js/dist/components/base/app.js --output htdocs/js/dist/evqueue.js",
"pack:index": "cat htdocs/index.html | sed -e '/DEV/,/END DEV/c\\' | grep -v PROD | grep -v 'END PROD' >htdocs/index.prod.html",
"pack:extension": "zip evqueue-browser-plugin.zip manifest.json browser-plugin/* htdocs/index.prod.html htdocs/fonts/* htdocs/images/* htdocs/styles/dist/ui.css htdocs/styles/vendor/* htdocs/js/dist/evqueue.js htdocs/js/vendor/*/*; zip evqueue-browser-plugin-src.zip -r browser-plugin htdocs manifest.json package.json README.md && printf \"@ htdocs/index.prod.html\\n@=htdocs/index.html\\n\" | zipnote -w evqueue-browser-plugin.zip && printf \"@ htdocs/index.prod.html\\n@=htdocs/index.html\\n\" | zipnote -w evqueue-browser-plugin-src.zip",
"pack:dist": "ln -s htdocs evqueue && zip evqueue.zip evqueue/index.prod.html evqueue/fonts/* evqueue/images/* evqueue/styles/dist/ui.css evqueue/styles/vendor/* evqueue/js/dist/evqueue.js evqueue/js/vendor/*/* evqueue/conf/cluster.dist.json && printf \"@ evqueue/index.prod.html\\n@=evqueue/index.html\\n\" | zipnote -w evqueue.zip && printf \"@ evqueue/conf/cluster.dist.json\\n@=evqueue/conf/cluster.json\\n\" | zipnote -w evqueue.zip && rm evqueue",
"pack": "rm evqueue evqueue.zip evqueue-browser-plugin.zip evqueue-browser-plugin-src.zip 2>/dev/null; npm run build && npm run pack:js && npm run pack:index && npm run pack:extension && npm run pack:dist && rm htdocs/index.prod.html"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 12da57c

Please sign in to comment.