I’m a freelancer making websites for clients. I have my own devstack based on React and Node. Currently, when I’m developing a new site, I just copy the last project that I’ve programmed and modify routes, pages and so on. When I add some new functionality (update webpack 1 to 2 and so on), I then have to do it manually at each project (or I don’t do it at all).
I’d like to have a more professional approach to this. Can you recommend me some materials or attitudes towards it?
My current goal is this: Have a repo (private github and after verification give it public) with my devstack (framework). Everytime I start a new project, I fork it (so that it stays as upstream origin) and start developing. Everytime I change some core functionality or add something that I want to have in other projects too, I want to push it somehow to the devstack repo. I could also copy this code to the devstack manually, but I don’t want to write it twice, so a better approach would help.
How can I do that, is my idea good? Basically, some recommendation if it makes sence at all and some link to an article would help me enough. Thank you.
You can fork any repo by clicking the fork button in the upper right hand corner of a repo page. Click on the Fork button to fork any repo on github.com. Source: GitHub Guides.
Creating a fork on GitHub is as easy as clicking the “fork” button on the repository page. The fork will then appear in the list of your repositories on GitHub where you can clone it to your local machine and edit it. Once you are done editing, you push your commits back to the fork on GitHub.
A fork is a copy of a repository that you manage. Forks let you make changes to a project without affecting the original repository. You can fetch updates from or submit changes to the original repository with pull requests.
A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.
Why build a framework? Frameworks generally answer the question of consistency, reusability and speed in future development. They are useful for companies / agencies that want to build something custom tailored to their needs.
An easy way to adopt a project management framework is to use a PM tool like Workamajig. Workamajig’s integrated approach to project management ensures that your entire organization is on the same page at all times. Test it out on your own – just hit the link below to get started!
If you want to build your very own framework or component library, I recommend taking it slowly. Plan out every single component you want even draw them if you need. Think of a name, do you want a documentation site?
We have already used CSS frameworks such as Bootstrap and Material. They are great frameworks. However, in some situations, they are not enough for us. We need other small specific libraries and more. As a result, dependencies of our projects may be huge. In this case, we may need to build our own CSS framework.
"Everytime I change some core functionality or add something that I want to have in other projects too, I want to push it somehow to the
devstack
repo."
Pushing to a devstack
repo (the original one you have forked for all your project) is a good first step, but it won't magically "propagate" that new feature to all your other repos.
However, you can take advantage of the triangular workflow:
devstack
(that is what you are doing already for your projects)clone that fork locally for a given project,
git clone /url/my/fork myfork
add as remote upstream
the original repo
cd myfork
git remote add upstream /url/to/devstack
From there, with git 2.9 or more, configure:
git config --global pull.rebase true
git config --global rebase.autoStash true
Finally, each time you want to update one of your repo to benefit from a feature pushed to devstack
:
cd /path/to/one/of/mine/projects
git checkout mybranch
git fetch upstream
git rebase upstream/master
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With