Create a new repository
For a new project, create a repository and clone the starter kit locally as a template for the new project . Change the remote of the cloned repository like described below so you're not pushing project changes to the starter kit repository.
IMPORTANT: When creating the repository, make sure NO files are created (which is a setting) -
since this creates a branch. Set both README.md and .gitignore to NO
when asked. All files we need are provided by the starter kit.
Forking won't work unfortunately since that causes PRs ending up in the starter kit repo; and template repositories are not yet a thing on Bitbucket
Steps in detail to clone a new repository (create a new repository first ☝️):
# Replace PROJECT with project name (dash-case):
git clone git@bitbucket.org:DODdevteam/helium-starter-kit.git ./PROJECT
cd ./PROJECT
# Replace GIT_URL with the SSH url of the new repo:
git remote set-url origin GIT_URL
git push -u origin master
# Initialize the project
npm i
git add . && git commit -m "Initialize project"
git push
The first time npm i is ran, the install
script initializes the project. This changes one or more files;
make sure to commit these
changes before having other people work on the project.
For security and convenience we always prefer using SSH over HTTPS whenever possible. Make sure your public key is known by Bitbucket for this to work:
✨ What happens during initialization?
- The repeatable blocks are being generated from
.templates/and.snippets/. After this, we don't need these folders anymore. - The
docker-compose.ymlfile is updated with the unique project name to prevent conflicts with other projects installed on a developers machine.
⌚ When will this script run?
- The initialization scripts will run only one time. This is done
by verifying no folders exist yet, other than the
.(dot) folders, insiderepeatable-default/andrepeatable-custom/. If there are more folders than that, the initialization script presumes the project is already initialized and the scripts to initialize will not continue onnpm install. - Need to re-initialize the repeatable sections? Run
npm run init:sections; this will ask you to remove all files and folders inrepeatable-custom/*andrepeatable-default/*, so the files can be generated again. Typically, this is useful when working on the starter kit itself, not when initializing a new project. ⚠️ BEWARE: This means all changes and additions in these folders will be deleted, except those in the.(dot) folders. ⚠️
Removing the .templates/ and .snippets/ folders is optional,
but recommended to avoid confusion for future developers on the
project. Obviously, after removing these folders, the command npm run init:sections will not
work unless both folders are recovered (from the starter kit repo
for instance).