Skip to content
This repository was archived by the owner on Apr 18, 2023. It is now read-only.

Commit 0eeb149

Browse files
authored
Merge pull request #35 from blockstack/develop
Version 0.5.0
2 parents 5535d45 + 59bbeb3 commit 0eeb149

File tree

8 files changed

+5950
-5346
lines changed

8 files changed

+5950
-5346
lines changed

.circleci/config.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Javascript Node CircleCI 2.0 configuration file
2+
#
3+
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
4+
#
5+
version: 2
6+
jobs:
7+
build:
8+
docker:
9+
# specify the version you desire here
10+
- image: circleci/node:8.11.3
11+
12+
# Specify service dependencies here if necessary
13+
# CircleCI maintains a library of pre-built images
14+
# documented at https://circleci.com/docs/2.0/circleci-images/
15+
# - image: circleci/mongo:3.4.4
16+
17+
working_directory: ~/repo
18+
19+
steps:
20+
- checkout
21+
- run:
22+
name: "Update npm"
23+
command: |
24+
npm install npm@latest
25+
sudo rm -rf /usr/local/lib/node_modules/npm
26+
sudo mv node_modules/npm /usr/local/lib/node_modules/npm
27+
sudo chown -R 500:500 /usr/local/lib/node_modules/npm
28+
29+
# Download and cache dependencies
30+
- restore_cache:
31+
keys:
32+
- v1-dependencies-{{ checksum "package.json" }}
33+
# fallback to using the latest cache if no exact match is found
34+
- v1-dependencies-
35+
36+
- run: npm install
37+
38+
- save_cache:
39+
paths:
40+
- node_modules
41+
key: v1-dependencies-{{ checksum "package.json" }}
42+
43+
# run tests!
44+
- run: npm test

.travis.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
language: node_js
22
node_js:
3-
- v7
4-
- v6
5-
- v5
6-
- v4
7-
- '0.12'
3+
- v8

app/index.js

+67-73
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ var Generator = require('yeoman-generator');
33
var chalk = require('chalk');
44
var yosay = require('yosay');
55

6-
module.exports = Generator.extend({
7-
prompting: function () {
6+
class BlockstackGenerator extends Generator {
7+
prompting() {
88
// Have Yeoman greet the user.
99
this.log(yosay(
1010
'Welcome to the ' + chalk.red('Blockstack') + ' app generator!'
@@ -21,80 +21,74 @@ module.exports = Generator.extend({
2121
// To access props later use this.props.someAnswer
2222
this.props = props;
2323
}.bind(this));
24-
},
24+
}
2525

26-
writing: {
27-
configs: function () {
28-
this.fs.copy(
29-
this.templatePath('_package.json'),
30-
this.destinationPath('package.json')
31-
);
32-
this.fs.copy(
33-
this.templatePath('editorconfig'),
34-
this.destinationPath('.editorconfig')
35-
);
36-
this.fs.copy(
37-
this.templatePath('gitignore'),
38-
this.destinationPath('.gitignore')
39-
);
40-
this.fs.copy(
41-
this.templatePath('requires.js'),
42-
this.destinationPath('requires.js')
43-
);
44-
this.fs.copy(
45-
this.templatePath('firebase.json'),
46-
this.destinationPath('firebase.json')
47-
);
48-
},
49-
server: function () {
50-
this.fs.copy(
51-
this.templatePath('server.js'),
52-
this.destinationPath('server.js')
53-
);
54-
},
55-
styles: function () {
56-
this.fs.copy(
57-
this.templatePath('public/app.css'),
58-
this.destinationPath('public/app.css')
59-
);
60-
this.fs.copy(
61-
this.templatePath('public/bootstrap.min.css'),
62-
this.destinationPath('public/bootstrap.min.css')
63-
);
64-
},
65-
scripts: function () {
66-
this.fs.copy(
67-
this.templatePath('public/app.js'),
68-
this.destinationPath('public/app.js')
69-
);
70-
},
71-
images: function () {
72-
this.fs.copy(
73-
this.templatePath('public/icon-192x192.png'),
74-
this.destinationPath('public/icon-192x192.png')
75-
)
76-
},
77-
html: function () {
78-
this.fs.copy(
79-
this.templatePath('public/index.html'),
80-
this.destinationPath('public/index.html')
81-
);
82-
},
83-
publicExtras: function () {
84-
this.fs.copy(
85-
this.templatePath('public/robots.txt'),
86-
this.destinationPath('public/robots.txt')
87-
);
88-
this.fs.copy(
89-
this.templatePath('public/manifest.json'),
90-
this.destinationPath('public/manifest.json')
91-
);
92-
}
93-
},
26+
writing() {
27+
this.fs.copy(
28+
this.templatePath('_package.json'),
29+
this.destinationPath('package.json')
30+
);
31+
this.fs.copy(
32+
this.templatePath('editorconfig'),
33+
this.destinationPath('.editorconfig')
34+
);
35+
this.fs.copy(
36+
this.templatePath('gitignore'),
37+
this.destinationPath('.gitignore')
38+
);
39+
this.fs.copy(
40+
this.templatePath('requires.js'),
41+
this.destinationPath('requires.js')
42+
);
43+
this.fs.copy(
44+
this.templatePath('firebase.json'),
45+
this.destinationPath('firebase.json')
46+
);
47+
// server
48+
this.fs.copy(
49+
this.templatePath('server.js'),
50+
this.destinationPath('server.js')
51+
);
52+
// styles
53+
this.fs.copy(
54+
this.templatePath('public/app.css'),
55+
this.destinationPath('public/app.css')
56+
);
57+
this.fs.copy(
58+
this.templatePath('public/bootstrap.min.css'),
59+
this.destinationPath('public/bootstrap.min.css')
60+
);
61+
// scripts
62+
this.fs.copy(
63+
this.templatePath('public/app.js'),
64+
this.destinationPath('public/app.js')
65+
);
66+
// images
67+
this.fs.copy(
68+
this.templatePath('public/icon-192x192.png'),
69+
this.destinationPath('public/icon-192x192.png')
70+
)
71+
// html
72+
this.fs.copy(
73+
this.templatePath('public/index.html'),
74+
this.destinationPath('public/index.html')
75+
);
76+
// publicExtras
77+
this.fs.copy(
78+
this.templatePath('public/robots.txt'),
79+
this.destinationPath('public/robots.txt')
80+
);
81+
this.fs.copy(
82+
this.templatePath('public/manifest.json'),
83+
this.destinationPath('public/manifest.json')
84+
);
85+
}
9486

95-
install: function () {
87+
install() {
9688
this.installDependencies({
9789
bower: false
9890
});
9991
}
100-
});
92+
}
93+
94+
module.exports = BlockstackGenerator;

app/templates/server.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const express = require('express')
1+
const express = require('express')
22
const opn = require('opn')
33

4-
const app = express()
4+
const app = express()
55
const port = 5000
66

77
function allowCrossDomain(req, res, next) {
@@ -13,10 +13,10 @@ function allowCrossDomain(req, res, next) {
1313

1414
app.use(allowCrossDomain)
1515
app.use('/', express.static(__dirname + '/public'))
16-
app.listen(port, (err) => {
16+
app.listen(port, (err) => {
1717
if (err) {
1818
return console.log('something bad happened', err)
1919
}
2020
console.log(`server is listening on ${port}`)
21-
opn('http://localhost:5000')
22-
})
21+
opn(`http://localhost:${port}`)
22+
})

gulpfile.js

+6-36
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ var gulp = require('gulp');
44
var eslint = require('gulp-eslint');
55
var excludeGitignore = require('gulp-exclude-gitignore');
66
var mocha = require('gulp-mocha');
7-
var istanbul = require('gulp-istanbul');
87
var nsp = require('gulp-nsp');
98
var plumber = require('gulp-plumber');
10-
var coveralls = require('gulp-coveralls');
119

1210
gulp.task('static', function () {
1311
return gulp.src('**/*.js')
@@ -21,42 +19,14 @@ gulp.task('nsp', function (cb) {
2119
nsp({package: path.resolve('package.json')}, cb);
2220
});
2321

24-
gulp.task('pre-test', function () {
25-
return gulp.src('generators/**/*.js')
26-
.pipe(excludeGitignore())
27-
.pipe(istanbul({
28-
includeUntested: true
29-
}))
30-
.pipe(istanbul.hookRequire());
31-
});
32-
33-
gulp.task('test', ['pre-test'], function (cb) {
34-
var mochaErr;
35-
36-
gulp.src('test/**/*.js')
37-
.pipe(plumber())
38-
.pipe(mocha({reporter: 'spec'}))
39-
.on('error', function (err) {
40-
mochaErr = err;
41-
})
42-
.pipe(istanbul.writeReports())
43-
.on('end', function () {
44-
cb(mochaErr);
45-
});
46-
});
22+
gulp.task('test', () =>
23+
gulp.src(['test/**/*.js'])
24+
.pipe(plumber())
25+
.pipe(mocha()));
4726

4827
gulp.task('watch', function () {
4928
gulp.watch(['generators/**/*.js', 'test/**'], ['test']);
5029
});
5130

52-
gulp.task('coveralls', ['test'], function () {
53-
if (!process.env.CI) {
54-
return;
55-
}
56-
57-
return gulp.src(path.join(__dirname, 'coverage/lcov.info'))
58-
.pipe(coveralls());
59-
});
60-
61-
gulp.task('prepublish', ['nsp']);
62-
gulp.task('default', ['static', 'test']);
31+
gulp.task('prepublish', gulp.series('nsp'));
32+
gulp.task('default', gulp.series('static', 'test'));

0 commit comments

Comments
 (0)