Forge getting started instructions are solid for the range of newbies and experts because they embrace the "least common denominator" options. These instruction target the occasional developer within Atlassian, optimizing for:
- rapid spin-up of a Forge dev configuration
- potentially long times of inactivity, and a need to refresh the configuration
Follow the steps below instead of running Forge getting started. They are longer, but will make it easier to maintain over time.
Use the test subsections to check if the step was performed correctly. All test commands should return obvious results, like a version number. An error is a test failure.
These instructions assume running on MacOS.
The general configuration works on Linux
but no instructions have been written to explain that variation.
On MacOS, the default shell
is already zsh
.
echo $SHELL
Homebrew is, "The Missing Package Manager for macOS" (and also works on Linux). Because Atlassian no longer allows users to be admins on their own machines, please use the untar anywhere method of installation.
mkdir $HOME/homebrew
cd $HOME
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip-components 1 -C homebrew
eval "$($HOME/homebrew/bin/brew shellenv)"
brew update --force --quiet
chmod -R go-w "$(brew --prefix)/share/zsh"
You may need to confirm the installation of Xcode CLI tools.
brew -—version
brew install mask
mask --version
Git comes preinstalled on MacOS. And will be installed by Brew if it was not installed. As such the following is more a matter of configuration.
Over time, you may accumulate many cloned Git repos. It helps to have some directory structure to help manage them. For now, we only need the structure for cloning this repo. If you vary from this structure, you'll have to modify configuration in a later step.
mkdir -p $HOME/dev/git/github.com/ibuchanan
cd $HOME/dev/git/github.com/ibuchanan
git clone https://github.com/ibuchanan/forge-bootstrap.git
git --version
dir $HOME/dev/git/github.com/ibuchanan/forge-bootstrap
In the forge-bootstrap
dir:
mask home-update prereq
mask home-init shell
mask home-init bin
mask home-init npm-global
mask home-init beautification
Restart your shell. The quickest way is to start a new terminal window with Command-N.
Upon restart, you should see a pretty shell.
fnm --version
node --version
forge-bootstrap --help
forge-bootstrap home-update defaults
fnm ls
forge --version
Obtain an API Token and use it to login to Forge.
forge login
forge whoami
brew install visual-studio-code
cd $HOME/dev/git/github.com/ibuchanan/forge-bootstrap
code .
After the Bootstrapping step,
the home directory should have a profile.d
subdirectory.
The headers below explain where some additional configuration may be necessary
if defaults above do not work.
Set the following variables:
export GITHUB_USER=""
export EMAIL=""
export NAME=""
If forge login
does not work,
uncomment and set the following variables:
export FORGE_EMAIL=""
export FORGE_API_TOKEN=""
If the git repo was cloned into a different path, set the following variable accordingly:
export FORGE_BOOTSTRAP_HOME="$HOME/dev/git/github.com/ibuchanan/forge-bootstrap"
You will need a site as a development environment. For Atlassians, a One Atlassian environment is a good start because it has existing data. Use go/one-atlas-request to provision one automatically. Alternatively, use go/cloud-dev.
To start learning about Forge, make the Forge Quest.
Create new apps with the standard forge create
command.
Then layer the following into the project:
- biome: a tool for linting & formatting
- changelog: use the conventional commit notation and
git-cliff
to help manage versions - format-forge: order keys in the manifest for better walk-through explanation
- gitignore: expand files & directories that will be ignored by git
- oss: add Atlassian open-source boilerplate
- package: set better defaults in the
package.json
- rovo: move the prompt module into a file
- typescript: initialize TypeScript for the project
For more details on all these options,
see the maskfile.md
.
Feel free to apply configuration more selectively.
forge-bootstrap repo-init defaults
forge lint
From time to time, keep the environment configured with latest versions of the tooling.
cd $FORGE_BOOTSTRAP_HOME
git pull
forge-bootstrap --version
Upgrades Brew packages, installs latest LTS versions of Node, and makes sure global Node libs, including Forge, are up-to-date.
forge-bootstrap home-update defaults
node --version
forge --version