Skip to content

Commit 500550b

Browse files
committed
Initial commit after running donejs add generator
0 parents commit 500550b

File tree

10 files changed

+201
-0
lines changed

10 files changed

+201
-0
lines changed

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Directory for instrumented libs generated by jscoverage/JSCover
11+
lib-cov
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
16+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17+
.grunt
18+
19+
# Compiled binary addons (http://nodejs.org/api/addons.html)
20+
build/Release
21+
22+
# Dependency directory
23+
# Commenting this out is preferred by some people, see
24+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
25+
node_modules
26+
27+
# Users Environment Variables
28+
.lock-wscript
29+
30+
docs/

.jshintrc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"node": true,
3+
"esnext": true,
4+
"bitwise": true,
5+
"camelcase": true,
6+
"curly": true,
7+
"eqeqeq": true,
8+
"immed": true,
9+
"indent": 2,
10+
"latedef": "nofunc",
11+
"newcap": false,
12+
"noarg": true,
13+
"regexp": true,
14+
"undef": true,
15+
"unused": true,
16+
"strict": false,
17+
"trailing": true,
18+
"smarttabs": true,
19+
"white": false,
20+
"globals": {
21+
"it": true,
22+
"describe": true,
23+
"before": true,
24+
"after": true,
25+
"exports": true
26+
}
27+
}

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
language: node_js
2+
node_js: "node"

default/index.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
var generator = require('yeoman-generator');
2+
3+
module.exports = generator.Base.extend({
4+
initializing: function () {
5+
this.pkg = this.fs.readJSON(this.destinationPath('package.json'), {});
6+
7+
this.files = [
8+
'file.js'
9+
];
10+
},
11+
12+
prompting: function () {
13+
var done = this.async();
14+
15+
this.prompt([{
16+
type : 'input',
17+
name : 'name',
18+
message : 'What is the name of the file?'
19+
}]).then(function (answers) {
20+
this.props = answers;
21+
done();
22+
}.bind(this));
23+
},
24+
writing: function () {
25+
this.log('Copying file to ' + this.destinationPath(this.props.name + '.js'));
26+
27+
this.fs.copyTpl(
28+
this.templatePath('file.js'),
29+
this.destinationPath(this.props.name + '.js'),
30+
this.props
31+
);
32+
}
33+
});

default/templates/file.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function() {
2+
return 'This is a file from the donejs-firebase DoneJS generator';
3+
}

lib/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exports.default = require('../default/index');

license.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Bitovi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

package.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "donejs-firebase",
3+
"version": "0.0.0",
4+
"description": "A plugin for deploying your DoneJS application to Firebase.",
5+
"homepage": "https://donejs.com/",
6+
"author": {
7+
"name": "Bitovi",
8+
"email": "contact@bitovi.com",
9+
"url": "http://bitovi.com/"
10+
},
11+
"license": "MIT",
12+
"main": "lib/",
13+
"scripts": {
14+
"test": "npm run jshint && npm run mocha",
15+
"jshint": "jshint test/. default/index.js --config",
16+
"mocha": "mocha test/ --timeout 120000",
17+
"publish": "git push origin --tags && git push origin",
18+
"release:patch": "npm version patch && npm publish",
19+
"release:minor": "npm version minor && npm publish",
20+
"release:major": "npm version major && npm publish"
21+
},
22+
"keywords": [
23+
"donejs",
24+
"plugin"
25+
],
26+
"dependencies": {
27+
"lodash": "^4.12.0",
28+
"yeoman-generator": "^0.23.3"
29+
},
30+
"devDependencies": {
31+
"jshint": "^2.9.2",
32+
"mocha": "^2.4.5",
33+
"yeoman-assert": "^2.2.1",
34+
"yeoman-test": "^1.4.0"
35+
}
36+
}

readme.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# donejs-firebase
2+
3+
[![Build Status](https://travis-ci.org/donejs/donejs-firebase.svg?branch=master)](https://travis-ci.org/donejs/donejs-firebase)
4+
[![npm version](https://badge.fury.io/js/donejs-firebase.svg)](http://badge.fury.io/js/donejs-firebase)
5+
6+
A plugin for deploying your DoneJS application to Firebase.
7+
8+
## Using the generator
9+
10+
To add this generator to your DoneJS application, run
11+
12+
```
13+
donejs add firebase
14+
```
15+
16+
## Developing
17+
18+
To make changes to this generator, clone the repository and install the dependencies
19+
20+
```
21+
git clone git@github.com:donejs/donejs-firebase.git
22+
cd donejs-firebase
23+
npm install
24+
```
25+
26+
Then you can run the tests with
27+
28+
```
29+
npm test
30+
```

test/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
var path = require('path');
2+
var helpers = require('yeoman-test');
3+
var assert = require('yeoman-assert');
4+
5+
describe('donejs-firebase', function() {
6+
before(function(done) {
7+
helpers.run(path.join(__dirname, '../default'))
8+
.inTmpDir()
9+
.withPrompts({
10+
name: 'testing'
11+
}).on('end', done);
12+
});
13+
14+
it('should write testing.js file', function() {
15+
assert.file(['testing.js']);
16+
assert.fileContent('testing.js', /This is a file from the donejs-firebase DoneJS generator/);
17+
});
18+
});

0 commit comments

Comments
 (0)