The initial setup requires a certain sequence of operations to work with the app within a running Jira Cloud instance. This sequence is slightly different from the example from the Forge docs since the code already exists.
- Create your own Atlassian developer instance: https://go.atlassian.com/cloud-dev
npm ci
install all dependencies of the project locallynpm run forge-login
authorizes the ForgeCLI with your Atlassian IDnpm run forge-register
registers a new app for this project in your developer consolenpm run forge-deploy
deploys the backend functions to the Atlassian Forge platformnpm run forge-install
install the app into a specific Atlassian Cloud application instance, in this case a Jira Cloud instancenpm run forge-tunnel
start a tunnel for local development with hot-reload to the deployed application with docker (see docs for more information)npm run dev
starts watcher and dev server during development
Enable prettier and eslint support. Prettier should format any file type that it knows. Developers might need to set these file extensions explicitly in the IDE:
- For Prettier:
{**/*,*}.{css,scss,html,js,ts,jsx,tsx,md,mdx,sh,json,yaml,yml,xml,java}
. - For ESlint:
{**/*,*}.{html,js,ts,jsx,tsx}
. - For Stylint:
{**/*,*}.{css,scss}
.
After the initial setup is done, only a subset of steps is necessary during development. The app is only accessible to the developer. To show the app to someone else, it is necessary to deploy to staging or production.
npm run forge-deploy
is necessary if you changed themanifest.yml
npm run forge-install -- --upgrade
is necessary if you changed themanifest.yml
npm run forge-tunnel
start the tunnel with hot-deployment of local code changes and hot-reload for UI- in a new terminal run
npm run dev
to watch forge workspace and start vite dev server
To show the results to someone else but yourself you have to deploy on staging and enable ap distribution once. The app is completely separated from the dev version: it has separate entries in the app manager in the Atlassian product and menus.
npm run forge-deploy -- -e staging
is necessary if you changed themanifest.yml
npm run forge-install -- -e staging
is necessary if you changed themanifest.yml
In order to allow access for someone but the developer itself, app distribution must be enabled. To enable app distribution, go to your app in the console, choose "Distribution" and fill all fields.
Next to the Forge cli wrappers forge-login
, forge-register
, forge-deploy
, forge-install
, forge-tunnel
the project contains the following scripts.
This setup uses turborepo to ease maintenance of the dependencies between workspaces.
Runs vite dev server and watcher on all workspaces.
The build result is located in forge/dist
.
Builds all workspaces and bundles them into forge/dist
.
Runs lint in all workspaces.
Runs forge-wrapper
with tunnel preparations.
Run dev
in a separate terminal to use the docker tunnel.
This is a wrapper script to manage local building steps before using the Forge CLI and app registration.
All listed commands call the corresponding Forge CLI command, i.e. forge-wrapper.sh register
calls forge register
but wraps some commands around it.
See Forge CLI docs for more details.
This command registers a new app for your personal account that you authenticated with forge login
before.
When successful, the script creates a .env.local
file with the created app's id.
You can manage your registered apps in your Atlassian developer console.
deploy
builds and uploads the app to the Atlassian Forge platform.
This forge command deploys to development stage by default.
Use deploy -e staging
or deploy -e production
for deploying to different stages.
Builds and installs the app as plugin into an Atlassian Cloud product instance of your choice. If you are missing an instance create one at https://go.atlassian.com/cloud-dev.
This forge command installs the development stage by default.
Use install -e staging
or install -e production
to install different stages of the app.
! Due to an implementation flaw inside Forge cli, this command only prepares to forge tunnel
. Using npm run forge-tunnel
however starts the tunnel. !
Builds and starts the tunnel for hot-reload and hot-deployment of local development.
To serve and run a build result, run deploy
again.
Also run watch and vite dev server in a separate tab with the following command:
npm run dev
The tunnel
command might log an ignorable warning on M1 chips which so far has no impact during development:
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Runs the Forge linter within the project.
Maybe we already documented what it is and how to workaround it here: https://seibertmedia-cloud.atlassian.net/wiki/x/oADtzw
Find your app under https://developer.atlassian.com/console/myapps and copy the app id from the overview page.
Create a .env.local
file with this content:
APP_ID=<your app's id>