Skip to content

Commit 338f1a6

Browse files
committed
docs: update developer portal docs
1 parent 7ab8310 commit 338f1a6

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed

docs/_sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
- [**Getting Started**](getting-started)
2+
- - [Initialize a new web application](commands/create-app)
23
- **Commands**
34
- - [`d2`](commands/d2)
45
- - [`d2 cluster`](commands/d2-cluster)

docs/commands/create-app.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Create a new app
3+
sidebar_label: Create new app
4+
id: create-app
5+
slug: '/cli/create-app'
6+
---
7+
8+
# @dhis2/create-app
9+
10+
This package publishes a package that follows the convention of [npm create](https://docs.npmjs.com/cli/v11/commands/npm-init#synopsis).
11+
12+
This allows users to create a new DHIS2 web application by running the command:
13+
14+
```sh
15+
# with pnpm
16+
pnpm create @dhis2/app project-name --yes
17+
#
18+
```
19+
20+
```sh
21+
# with npm
22+
npx @dhis2/create-app --yes
23+
# or npm create @dhis2/app -- --yes
24+
```
25+
26+
By passing `--yes` argument, this will create a new DHIS2 web application using the default options without prompting (using `pnpm` as a package manager, and `TypeScript` as the language).
27+
28+
If you omit the `--yes` argument `pnpm create @dhis2/app project-name` then you will be prompted and guided through a wizard to choose your options.
29+
30+
You can run the commands in `debug` mode to get more verbose logs by passing the `--debug` option (`pnpm create @dhis2/app project-name --debug`).

docs/getting-started.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ npm install --global @dhis2/cli
2020
d2 --version
2121
```
2222

23+
## Initialize a new web app
24+
25+
If you are only interested in scaffolding a new web app you can bypass installing the whole CLI, and make use of [npm create](https://docs.npmjs.com/cli/v11/commands/npm-init) convention:
26+
27+
```sh
28+
# with pnpm
29+
pnpm create @dhis2/app project-name --yes
30+
#
31+
```
32+
33+
This will create a new DHIS2 web application. Check the documentation for [@dhis2/create-app](./commands/create-app.md) for more information.
34+
2335
## Ad-hoc usage
2436

2537
You can also run the CLI ad-hoc with `npx`, no installation necessary (sacrifices startup performance). So only do this if you've got a good use case for it. In most cases you'll want to install it globally.

packages/create-app/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ pnpm create @dhis2/app project-name --yes
1212

1313
```sh
1414
# with npm
15-
npm create @dhis2/app -- --yes
16-
# or npx @dhis2/create-app --yes
15+
npx @dhis2/create-app --yes
16+
# npm create @dhis2/app -- --yes
1717
```
1818

1919
By passing `--yes` argument, this will create a new DHIS2 web application using the default options without prompting (using `pnpm` as a package manager, and `TypeScript` as the language).

0 commit comments

Comments
 (0)