Skip to content

Commit 11a15ea

Browse files
authored
Merge pull request #73 from cesine/node_12
node 12
2 parents 30e5a68 + f6b5663 commit 11a15ea

File tree

7 files changed

+18480
-7043
lines changed

7 files changed

+18480
-7043
lines changed

.browserslistrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
['last 2 versions']

.travis.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
language: node_js
22

33
node_js:
4-
- 6
4+
- 12
5+
56
script:
6-
- yarn lint
7-
- yarn lint:es6
8-
- yarn test
9-
- yarn test:ci
7+
- npm run lint
8+
- npm run lint:es6
9+
- npm run test
10+
- npm run test:ci
11+
- npm run build:production
12+
- npm run test
13+
- npm run test:ci

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Mac:
1313

1414
```bash
1515
$ brew install node
16-
$ brew install yarn # optional, you can also use npm
1716
```
1817

1918
Linux:
@@ -31,7 +30,7 @@ You can download node from http://nodejs.org
3130
### Install dependancies
3231

3332
```
34-
$ yarn install
33+
$ npm install
3534
```
3635

3736
## Configure
@@ -45,13 +44,13 @@ You can create a `config/local.js` file to point to the corpus service you want
4544
To turn on the server:
4645

4746
```bash
48-
$ yarn watch
47+
$ npm run watch
4948
```
5049

5150
To develop offline with fixture data:
5251

5352
```bash
54-
$ OFFLINE=true yarn start --offline
53+
$ OFFLINE=true npm start --offline
5554
```
5655

5756
Then open https://localhost:3182 and accept the security certificate warning since you are developing locally with a self signed certificate.
@@ -126,7 +125,7 @@ Redux server side render is based on from [mz026](https://github.com/mz026/unive
126125
- [Webpack](https://webpack.github.io/)@2.2
127126
- [Babel](https://babeljs.io/)@6
128127
- Express as isomorphic server
129-
- `yarn` as package manager
128+
- `npm` as package manager
130129

131130

132131
### Testing:
@@ -152,25 +151,31 @@ To test your production build:
152151

153152
```bash
154153
$ gulp build
155-
$ NODE_ENV=production yarn start
154+
$ NODE_ENV=production npm start
156155
```
157156

158157
## Deployment:
159158

160159
To deploy this app to production environment:
161160

162-
- Run `$ NODE_ENV=production yarn install` on server
163-
- After the installation above, `postinstall` script will run automatically, building front-end related assets and rev-ed server code under `dist/` folder.
161+
- Run `$ NODE_ENV=development npm install` on server
162+
- After the installation above, then run `$ npm run build:production` which will build the front-end related assets and rev-ed server code under `dist/` folder.
164163

165164
- Kick off the server with:
166165

167-
` NODE_ENV=production NODE_PATH=./dist/server-build node dist/server-build/server`
166+
`$ npm run start:production`
167+
168+
- Once you're sure the server is operational, start the service with forever:
169+
170+
`$./start_service`
168171

169172
## Release History
170173
* v1.62 activity heat map
171174
* v1.72 display of terms of use and elastic search integration
172175
* v3.19 refactored server.js into routes and updated express 2.x to 4.x
173-
176+
* v3.21.15 migrated public urls from jade to handlebars
177+
* v5.4.21 migrated public urls from handlebars to react
178+
* v5.168.15 upgraded to node 12
174179

175180
## License
176181
Licensed under the Apache, 2.0 licenses.

gulpfile.js

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,53 @@
1-
var gulp = require('gulp'),
2-
$ = require('gulp-load-plugins')({
3-
camelize: true
4-
}),
5-
runSequence = require('run-sequence')
1+
var gulp = require('gulp');
2+
var RevAll = require("gulp-rev-all");
3+
4+
$ = require('gulp-load-plugins')({
5+
camelize: true
6+
});
67

78
gulp.task('css', function() {
89
return gulp.src('app/components/App/app.scss')
910
.pipe($.sourcemaps.init())
1011
.pipe($.sass().on('error', $.sass.logError))
1112
.pipe($.autoprefixer({
12-
browsers: ['last 2 versions'],
13+
// browsers: ['last 2 versions'],
1314
cascade: false
1415
}))
1516
.pipe($.sourcemaps.write())
1617
.pipe(gulp.dest('./dist'))
1718
})
1819

19-
gulp.task('css:watch', ['css'], function() {
20+
gulp.task('css:watch', gulp.series(['css'], function() {
2021
gulp.watch('app/**/*.scss', ['css'])
21-
})
22+
}))
2223

2324
gulp.task('moveAssets', function() {
2425
return gulp.src('./app/assets/**/*')
2526
.pipe(gulp.dest('./dist/assets'))
2627
})
2728

28-
gulp.task('build:revAssets', ['css', 'moveAssets'], function() {
29-
var rev = new $.revAll()
29+
gulp.task('build:revAssets', gulp.series(['css', 'moveAssets'], function() {
30+
// var rev = new $.revAll()
3031
return gulp.src('./dist/**/*')
31-
.pipe(rev.revision())
32+
.pipe(RevAll.revision())
3233
.pipe(gulp.dest('./dist/public'))
33-
.pipe(rev.manifestFile())
34+
.pipe(RevAll.manifestFile())
3435
.pipe(gulp.dest('./dist'))
35-
})
36+
}))
3637

3738
gulp.task('build:cpServer', function() {
3839
return gulp.src('./app/**/*.{js,jsx,ejs}')
3940
.pipe(gulp.dest('./dist/server-build'))
4041
})
41-
gulp.task('build:revServer', ['build:cpServer'], function() {
42+
gulp.task('build:revServer', gulp.series(['build:cpServer'], function() {
4243
var manifest = gulp.src('./dist/rev-manifest.json')
4344
return gulp.src('./dist/server-build/{components,containers}/**/*')
4445
.pipe($.revReplace({
4546
manifest: manifest
4647
}))
4748
.pipe(gulp.dest('./dist/server-build'))
48-
})
49+
}))
4950

50-
gulp.task('build', function() {
51-
runSequence('build:revAssets', 'build:revServer')
52-
})
51+
gulp.task('build', gulp.series('build:revAssets', 'build:revServer', function (done) {
52+
done();
53+
}));

0 commit comments

Comments
 (0)