Skip to content

Commit

Permalink
🐛 Fix build scripts (closes #31)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartozzz committed Sep 15, 2017
1 parent 04cbedf commit 5ba8ff9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Coverage Status](https://coveralls.io/repos/github/qilin-editor/qilin-app/badge.svg?branch=master)](https://coveralls.io/github/qilin-editor/qilin-app?branch=master)
<br>

**Qilin** is a free, open-source text editor developed for exact sciences in mind. It fully supports [`KaTeX`](https://khan.github.io/KaTeX/) and [`AsciiMath`](http://asciimath.org/), partially [`LaTeX`](https://www.latex-project.org/). Qilin works on each desktop platform - it is based on `Chromium` and `Node.js`, licensed under the *BSD-3-Clause* license.
**Qilin** is a free, open-source text editor developed for exact sciences in mind. It fully supports [`LaTeX`](https://www.latex-project.org/), [`KaTeX`](https://khan.github.io/KaTeX/) and [`AsciiMath`](http://asciimath.org/). Qilin works on each desktop platform - it is based on `Chromium` and `Node.js`, licensed under the *BSD-3-Clause* license.

![Qilin editor](https://i.imgur.com/qpguVEw.png)
</div>
Expand All @@ -20,35 +20,38 @@
[![Github Closed Issues](https://img.shields.io/github/issues-closed-raw/qilin-editor/qilin-app.svg)](https://github.com/qilin-editor/qilin-app/issues?q=is%3Aissue+is%3Aclosed)
[![Github Pull Requests](https://img.shields.io/github/issues-pr-raw/qilin-editor/qilin-app.svg)](https://github.com/qilin-editor/qilin-app/pulls)

**We want contributing to Qilin to be fun, enjoyable, and educational for anyone, and everyone.** Changes and improvements are more than welcome! Feel free to fork and open a pull request. If you have found any issues, please [report them here](https://github.com/qilin-editor/qilin-app/issues/new) - they are being tracked on [GitHub Issues](https://github.com/qilin-editor/qilin-app/issues).
**We want contributing to Qilin to be fun, enjoyable, and educational for everyone.** Changes and improvements are more than welcome! Feel free to fork and open a pull request. If you have found any issues, please [report them here](https://github.com/qilin-editor/qilin-app/issues/new) - they are being tracked on [GitHub Issues](https://github.com/qilin-editor/qilin-app/issues).

### License

Project was created and developed by [Bartosz Łaniewski](https://github.com/Bartozzz). The full list of contributors can be found [here](https://github.com/qilin-editor/qilin-app/graphs/contributors). Qilin's code is [BSD-3-Clause licensed](https://github.com/qilin-editor/qilin-app/blob/master/LICENSE). We also provide an additional ["patent" grant](https://github.com/qilin-editor/qilin-app/blob/master/PATENTS).
Qilin was created and developed by [Bartosz Łaniewski](https://github.com/Bartozzz). The full list of contributors can be found [here](https://github.com/qilin-editor/qilin-app/graphs/contributors). Qilin's code is [BSD-3-Clause licensed](https://github.com/qilin-editor/qilin-app/blob/master/LICENSE). We also provide an additional ["patent" grant](https://github.com/qilin-editor/qilin-app/blob/master/PATENTS).

### Development

We have prepared multiple commands to help you develop Qilin on your own. Don't forget to install all `Node.js` dependencies from [npm](https://www.npmjs.com/). You will need a local copy of [Node.js](https://nodejs.org/en/) installed on your machine.

```bash
$ sudo npm install
$ npm install
```

#### Usage

```bash
$ sudo npm run <command>
$ npm run <command>
```

#### List of commands

| Command | Description | Root |
|---------------|---------------------------------------------------|:----:|
| preapre | Compiles SCSS and JavaScript used by Qilin | × |
| build | Builds Qilin releases for macOS, Windows, Linux ||
| watch | Runs Qilin application and re-compiles on changes ||
| start | Runs Qilin application | × |
| clean | Deletes output, builds ands cache ||
| Command | Description |
|---------------|---------------------------------------------------|
| `preapre` | Compiles resources used by Qilin |
| `build` | Builds Qilin releases for macOS, Windows, Linux |
| `watch` | Runs Qilin application and re-compiles on changes |
| `start` | Runs Qilin application |
| `clean` | Deletes builds and caches |
| `eslint` | Fixes ESLinter errors |

> **Note:** In some cases, you might need to run those scripts with administrator privileges (`sudo`).
### Installation

Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@
"node-sass": "^4.5.3"
},
"scripts": {
"prepare": "set NODE_ENV=production && ./node_modules/.bin/webpack --progress",
"watch": "set NODE_ENV=development && ./node_modules/.bin/webpack --progress --watch & ./node_modules/.bin/nw . --nwjs_build_type=sdk",
"start": "npm run prepare && ./node_modules/.bin/nw . --nwjs_build_type=sdk",
"build": "npm run prepare && node ./bin/compile",
"clear": "rm -rf ./build ./dist"
"prepare": "export NODE_ENV=production && npm run eslint && node_modules/.bin/webpack --progress",
"watch": "npm run prepare --watch & node_modules/.bin/nw . --nwjs_build_type=sdk",
"start": "npm run prepare && node_modules/.bin/nw . --nwjs_build_type=sdk",
"build": "npm run prepare && node bin/compile",
"eslint": "node_modules/.bin/eslint src --fix",
"clear": "rm -rf build cache dist"
},
"maintainers": [
{
Expand Down
10 changes: 4 additions & 6 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const Webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");

console.log(`Running in ${process.env.NODE_ENV || "production"} mode`);

const config = {
entry: "./src/index.js",

Expand All @@ -13,12 +15,12 @@ const config = {

resolve: {
extensions: [".js", ".jsx", ".json"],
modules: ["node_modules"],
},

watchOptions: {
ignored: [
path.resolve(__dirname, "./node_modules"),
path.resolve(__dirname, "./demos"),
path.resolve(__dirname, "./build"),
path.resolve(__dirname, "./cache"),
path.resolve(__dirname, "./dist"),
Expand All @@ -37,11 +39,7 @@ const config = {
use: "url-loader?limit=1000",
},
{
test: /\.(woff|woff2|eot|otf|ttf)$/,
use: "file-loader",
},
{
test: /\.svg$/,
test: /\.(woff|woff2|eot|otf|ttf|svg)$/,
use: "file-loader",
},
{
Expand Down

0 comments on commit 5ba8ff9

Please sign in to comment.