mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
add git submodule workflow documentation
This commit is contained in:
parent
82ceba614e
commit
2f1d7bc010
33
docs/git-submodule-workflow.md
Normal file
33
docs/git-submodule-workflow.md
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# Git Submodule Workflow
|
||||||
|
|
||||||
|
1. Create a new repository on bitbucket
|
||||||
|
2. Clone it and create the main file: `my_component.js`
|
||||||
|
```javascript
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
let MyComponent = React.createClass({
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<div></div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export default MyComponent;
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Commit and push to your newly created repository
|
||||||
|
4. Open `.gitignore` and add your future package folder to *NOT* to be ignored by git `!node_modules/<my-repository-name>`
|
||||||
|
5. Copy the repository's SSH link from bitbucket
|
||||||
|
6. Open a shell and go to `cd onion/node_modules`
|
||||||
|
7. Do `git submodule add <your-ssh-link>`
|
||||||
|
8. Git will clone the repository and add it to `node_modules`
|
||||||
|
9. open `package.json` inside of onion and adjust the `browser` field
|
||||||
|
```
|
||||||
|
"browser": {
|
||||||
|
"MyComponent": "./node_modules/my_component/my_component.js"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
10. (Optional) If you have browserify-shims in your newly created module, then add them in the `browserify-shim` as well. Check `package.json` for example.
|
||||||
|
11. Open `gulpfile.js` and find the `filesToWatch` property of `var config`. Add your newly added `my_component` folder to it: `'node_modules/<my_component>/*.js'`
|
||||||
|
12. THAT'S IT! YOU'RE AWESOME!
|
@ -45,7 +45,12 @@ var config = {
|
|||||||
'react',
|
'react',
|
||||||
'es6'
|
'es6'
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
filesToWatch: [
|
||||||
|
'build/css/*.css',
|
||||||
|
'build/js/*.js',
|
||||||
|
'node_modules/react-s3-fineuploader/*.js'
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
var constants = {
|
var constants = {
|
||||||
@ -83,7 +88,7 @@ gulp.task('run-server', function() {
|
|||||||
|
|
||||||
gulp.task('browser-sync', function() {
|
gulp.task('browser-sync', function() {
|
||||||
browserSync({
|
browserSync({
|
||||||
files: ['build/css/*.css', 'build/js/*.js'],
|
files: config.filesToWatch,
|
||||||
proxy: 'http://localhost:4000',
|
proxy: 'http://localhost:4000',
|
||||||
port: 3000
|
port: 3000
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user