mirror of
https://github.com/ascribe/onion.git
synced 2024-11-16 01:55:07 +01:00
1.4 KiB
1.4 KiB
Git Submodule Workflow
ATTENTION: Adding submodules at the wrong place of the project will actually f&%k up your git if you want to remove them again. So please take all those steps with care!!!
- Create a new repository on bitbucket
- Clone it and create the main file:
my_component.js
import React from 'react';
let MyComponent = React.createClass({
render() {
return (
<div></div>
);
}
});
export default MyComponent;
- Open a shell and go to
cd onion/node_modules
- Commit and push to your newly created repository
- Open
.gitignore
and add your future package folder to NOT to be ignored by git!node_modules/<my-repository-name>
- Copy the repository's SSH link from bitbucket
- Do
git submodule add <your-ssh-link>
- Git will clone the repository and add it to
node_modules
- open
package.json
inside of onion and adjust thebrowser
field
"browser": {
"MyComponent": "./node_modules/my_component/my_component.js"
}
- (Optional) If you have browserify-shims in your newly created module, then add them in the
browserify-shim
as well. Checkpackage.json
for example. - Open
gulpfile.js
and find thefilesToWatch
property ofvar config
. Add your newly addedmy_component
folder to it:'node_modules/<my_component>/*.js'
- THAT'S IT! YOU'RE AWESOME!