Skip to content

Commit 6a6e071

Browse files
committedApr 17, 2015
chore(docs): add docs for other people to play around with the project
1 parent 9dc7aee commit 6a6e071

File tree

10 files changed

+105
-5
lines changed

10 files changed

+105
-5
lines changed
 

‎README.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# WrenchJS
2+
3+
Hey there!
4+
5+
So you want to play around with wrenchjs?
6+
7+
It's easy. To set up the project on your machine, run these commands:
8+
```bash
9+
# Get the source code on your machine
10+
git clone git@github.com:rodyhaddad/wrenchjs.git;
11+
# Step inside the project
12+
cd wrenchjs;
13+
# Install the project dependency
14+
npm install;
15+
# Creates a global link, and exposes the bins of the project
16+
npm link;
17+
```
18+
19+
After you ran that, you now have a `wrenchjs` command line tool! It has the same interface as ember-cli for now.
20+
21+
You can use it to generate new projects, build them, serve them and so on.
22+
23+
But the stuff that are already provided are tailored for Ember projects.
24+
You probably want it for Angular, and that's why you're playing with this!
25+
26+
You most likely want to develop new blueprints and addons.
27+
28+
To do that, copy the existing dummy-addon or dummy-blueprint.
29+
30+
If you want to know more about blueprints, check [here](https://github.com/ember-cli/ember-cli/blob/master/lib/models/blueprint.js#L37).
31+
If you want to know more about addons, check [here](https://github.com/ember-cli/ember-cli/blob/master/ADDON_HOOKS.md) and [here](http://www.ember-cli.com/#developing-addons-and-blueprints).
32+
33+
Since wrenchjs is a customized proxy to wrenchjs, you can check the [existing ember-cli addons](http://www.emberaddons.com/) to get inspired.
34+
35+
If you're curious, to have addons discovered by the `wrenchjs` cli tool, they either need to:
36+
37+
* Be in the `addon` directory of the project
38+
* As a npm dependency to wrenchjs
39+
* As a npm dependency to any "wrenchjs" project (meaning you're using `wrenchjs` in that project directory)
40+
41+
Addons should still use the `ember-addon` keyword in their package.json to get discovered for now.
42+
43+
If you have any questions, please let me know :-)

‎addon/dummy-addon/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a dummy addon, used to demonstrate the use of `internalAddonPaths`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The dummy blueprint just got installed.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "dummy-blueprint",
3+
"main": "index.js",
4+
"version": "0.0.0",
5+
"homepage": "https://github.com/rodyhaddad/wrenchjs",
6+
"authors": [
7+
"rodyhaddad <rody@rodyhaddad.com>"
8+
],
9+
"license": "MIT"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "dummy-blueprint",
3+
"version": "0.0.0",
4+
"description": "A dummy blueprint",
5+
"author": "rodyhaddad",
6+
"license": "MIT"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
description: ''
3+
4+
// locals: function(options) {
5+
// // Return custom template variables here.
6+
// return {
7+
// foo: options.entity.options.foo
8+
// };
9+
// }
10+
11+
// afterInstall: function(options) {
12+
// // Perform extra work here.
13+
// }
14+
};

‎addon/dummy-addon/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* jshint node: true */
2+
'use strict';
3+
4+
module.exports = {
5+
name: 'dummy-addon'
6+
};

‎addon/dummy-addon/package.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "dummy-addon",
3+
"version": "0.0.0",
4+
"description": "A dummy addon",
5+
"author": "rodyhaddad",
6+
"license": "MIT",
7+
"keywords": [
8+
"ember-addon"
9+
]
10+
}

‎index.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
/* jshint node: true */
22
'use strict';
33

4+
var path = require('path');
5+
46
module.exports = {
5-
name: 'wrenchjs',
6-
exposedChildAddons: function () {
7-
return ['angular-project-draft'];
8-
}
7+
name: 'wrenchjs'
98
};

‎lib/cli/index.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
var cli = require('ember-cli/lib/cli');
22
var path = require('path');
3+
var fs = require('fs');
4+
5+
var internalAddonDir = path.join(__dirname, '..', '..', 'addon');
36

47
module.exports = function (options) {
8+
9+
var internalAddonPaths = fs.readdirSync(internalAddonDir).map(function (file) {
10+
return path.join(internalAddonDir, file);
11+
});
12+
513
options.cli = {
614
name: 'wrenchjs',
7-
cliRoot: path.join(__dirname, '..', '..')
15+
cliRoot: path.join(__dirname, '..', '..'),
16+
internalAddonPaths: internalAddonPaths
817
};
918
return cli(options);
1019
};

0 commit comments

Comments
 (0)
Please sign in to comment.