Skip to content

Commit 9ecdef2

Browse files
authored
Merge pull request #118 from clarkdo/dev
release: 0.1.4
2 parents e2df648 + ca39b59 commit 9ecdef2

39 files changed

+2051
-1277
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
node_modules
21
npm-debug.log

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Nuxt build
22
.nuxt
3+
.build
34
dist
5+
.cache
46

57
# Nuxt generate
68
.generated

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ os:
1010
- linux
1111
- osx
1212
install:
13-
- yarn install
14-
# - yarn run build
13+
- yarn
14+
# - yarn build
1515
script:
16-
# - yarn run lint
17-
- yarn run test
16+
# - yarn lint
17+
- yarn test

.vscode/cSpell.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"chartjs",
2424
"contenthash",
2525
"mixins",
26-
"consts"
26+
"consts",
27+
"params"
2728
],
2829
// flagWords - list of words to be always considered incorrect
2930
// This is useful for offensive words and common spelling errors.

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"request": "launch",
5050
"protocol": "inspector",
5151
"name": "Debug Hare Prod",
52-
"program": "${workspaceRoot}/.nuxt/dist/server-app",
52+
"program": "${workspaceRoot}/.build/dist/server-app",
5353
"env": {
5454
"NODE_ENV": "production",
5555
"DEBUG": "nuxt:*"

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM node:8-alpine
2+
3+
# For legacy version
4+
MAINTAINER "[email protected]"
5+
LABEL maintainer="[email protected]"
6+
7+
# Create app directory
8+
RUN mkdir -p /usr/app
9+
WORKDIR /usr/app
10+
11+
# Bundle app source
12+
COPY package.json ./
13+
COPY node_modules ./node_modules/
14+
COPY .build ./.build
15+
16+
EXPOSE 3000
17+
CMD [ "yarn", "start" ]

Dockerfile.dev

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
FROM node:8-alpine
22

3+
# For legacy version
4+
MAINTAINER "[email protected]"
5+
LABEL maintainer="[email protected]"
6+
37
# Create app directory
4-
RUN mkdir -p /usr/src/app
5-
WORKDIR /usr/src/app
8+
RUN mkdir -p /usr/app
9+
WORKDIR /usr/app
610

711
# Bundle app source
8-
COPY . /usr/src/app/
12+
COPY . /usr/app/
913

1014
# Install app dependencies
11-
RUN yarn install
15+
RUN yarn
1216

1317
EXPOSE 3000
14-
CMD [ "yarn", "run", "dev" ]
18+
CMD [ "yarn", "dev" ]

README.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
[![Max OSX and Linux](https://travis-ci.org/clarkdo/hare.svg?branch=master)](https://travis-ci.org/clarkdo/hare)
44
[![Windows](https://ci.appveyor.com/api/projects/status/16eua6xnlnwxqomp?svg=true)](https://ci.appveyor.com/project/clarkdo/hare)
55
[![Vulnerabilities](https://snyk.io/test/github/clarkdo/hare/badge.svg)](https://snyk.io/test/github/clarkdo/hare)
6+
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
7+
[![ESLint](https://img.shields.io/badge/styled_with-eslint-blue.svg?colorB=8080f2)](https://github.com/eslint/eslint)
68
[![Issues](https://img.shields.io/github/issues/clarkdo/hare.svg)](https://github.com/clarkdo/hare/issues)
79
[![Stars](https://img.shields.io/github/stars/clarkdo/hare.svg)](https://github.com/clarkdo/hare/stargazers)
810
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/clarkdo/hare/master/LICENSE)
@@ -13,7 +15,7 @@
1315
$ git clone [email protected]:clarkdo/hare.git
1416
$ cd hare
1517
# install dependencies
16-
$ yarn install
18+
$ yarn
1719
```
1820

1921
## Usage
@@ -22,7 +24,7 @@ $ yarn install
2224

2325
``` bash
2426
# serve with hot reloading at localhost:3000
25-
$ yarn run dev
27+
$ yarn dev
2628
```
2729

2830
Go to [http://localhost:3000](http://localhost:3000)
@@ -31,31 +33,31 @@ Go to [http://localhost:3000](http://localhost:3000)
3133

3234
``` bash
3335
# configure ESLint as a tool to keep codes clean
34-
$ yarn run lint
36+
$ yarn lint
3537
# use ava as testing framework, mixed with jsdom
36-
$ yarn run test
38+
$ yarn test
3739
```
3840

3941
### Production
4042

4143
``` bash
4244
# build for production and launch the server
43-
$ yarn run build
44-
$ yarn run start
45+
$ yarn build
46+
$ yarn start
4547
```
4648

4749
### Generate
4850

4951
``` bash
5052
# generate a static project
51-
$ yarn run generate
53+
$ yarn generate
5254
```
5355

5456
### Analyze
5557

5658
``` bash
5759
# build and launch the bundle analyze
58-
$ yarn run analyze
60+
$ yarn analyze
5961
```
6062

6163
### Use PM
@@ -88,7 +90,21 @@ $ pm2 delete hare
8890
``` bash
8991
# build image
9092
$ docker build -t hare-dev -f Dockerfile.dev ./
91-
$ docker run -d -p 8888:3000 --env HOST=0.0.0.0 hare-dev
93+
$ docker run -d -p 8888:3000 -e HOST=0.0.0.0 hare-dev
94+
```
95+
96+
### Docker Production
97+
98+
``` bash
99+
# build bundle
100+
$ export NODE_ENV=''
101+
$ yarn
102+
$ yarn build
103+
# install production dependencies (remove devDependencies)
104+
$ yarn --prod
105+
# build image
106+
$ docker build -t hare-prod -f Dockerfile ./
107+
$ docker run -d -p 8889:3000 -e HOST=0.0.0.0 hare-prod
92108
```
93109

94110
Go to [http://localhost:8888](http://localhost:8888)

appveyor.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ install:
2525
# Get the latest stable version of Node.js or io.js
2626
- ps: Install-Product node $env:nodejs_version
2727
# install modules
28-
- yarn install
28+
- yarn
2929

3030
# Post-install test scripts.
3131
test_script:
3232
# Output useful info for debugging.
3333
- node --version
3434
- yarn --version
35-
# - yarn run lint
35+
# - yarn lint
3636
# run tests
37-
- yarn run test
37+
- yarn test
3838

3939
# build_script:
4040
# # run build
41-
# - yarn run build
41+
# - yarn build
4242
build: off

client/assets/css/main.scss

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)