@datadog/create-apps 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +54 -3
  2. package/dist/bin.js +499 -104
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -10,7 +10,7 @@ npm init @datadog/apps
10
10
  yarn init @datadog/apps
11
11
  ```
12
12
 
13
- Follow the interactive prompts to:
13
+ Choose a standalone app or monorepo. The standalone path then keeps the existing prompts:
14
14
 
15
15
  1. Enter your app name (human-readable, e.g. "My Awesome App")
16
16
  2. Enter a directory name (slugified default from the app name, e.g. "my-awesome-app")
@@ -50,7 +50,7 @@ Skip the template prompt and use the named template (e.g. `vite-react`).
50
50
 
51
51
  ### `--yes`, `-y`
52
52
 
53
- Accept all defaults without prompting. Requires a directory to be provided as a positional argument.
53
+ Accept all defaults without prompting. Requires a directory to be provided as a positional argument. New monorepos also require `--app-directory`.
54
54
 
55
55
  ### `--overwrite`
56
56
 
@@ -58,12 +58,63 @@ Overwrite an existing target directory without prompting. Required to replace an
58
58
 
59
59
  ### `--skip-post-scaffold`
60
60
 
61
- Skip automatic setup commands (dependency installation, git initialization, etc.).
61
+ Skip automatic setup commands (dependency installation, git initialization, etc.) for standalone apps. Workspace setup and lockfile validation cannot be skipped.
62
62
 
63
63
  ### `--validate`
64
64
 
65
65
  Validate the bundled templates and exit. Intended for CI / development of this CLI.
66
66
 
67
+ ## Monorepos
68
+
69
+ Use the development release to create an npm workspace and its first Datadog App:
70
+
71
+ ```bash
72
+ npm create @datadog/apps@dev -- my-workspace --monorepo \
73
+ --app-directory first-app --name "First App" --site datadoghq.com
74
+ ```
75
+
76
+ The workspace keeps apps under `apps/*`, shared packages under `packages/*`, shared TypeScript and ESLint configuration at the root, and one root `package-lock.json`. The root `package.json` records only the workspace layout (`datadogApps.container`); every app's site, identifier, and name stay in its own `datadog-app.config.json`.
77
+
78
+ When the command detects an existing generated workspace, it adds the requested app to that workspace instead of creating a nested repository:
79
+
80
+ ```bash
81
+ npm create @datadog/apps@dev -- another-app --name "Another App"
82
+ ```
83
+
84
+ Each app declares its own site. Interactive app creation prompts for it when `--site` is omitted; non-interactive creation uses `datadoghq.com` unless `--site` is passed.
85
+
86
+ Create a shared package from inside the workspace with:
87
+
88
+ ```bash
89
+ npm create @datadog/apps@dev -- --package shared-utils
90
+ ```
91
+
92
+ ### `--monorepo`
93
+
94
+ Create a new npm workspace and scaffold its first app. Without `--yes`, the initial prompt also offers this mode.
95
+
96
+ ### `--app-directory <directory>`
97
+
98
+ Set the first app's directory when creating a monorepo. `--name` remains the app's user-facing name.
99
+
100
+ ### `--container <directory>`
101
+
102
+ Change the generated workspace's apps container from the default `apps` directory. Nested containers use `/` separators on every platform.
103
+
104
+ ### `--package <name>`
105
+
106
+ Add a shared package under `packages/<name>` in a detected workspace.
107
+
108
+ ### `--github-repo <owner/repository>`
109
+
110
+ For a new monorepo, create a private GitHub repository with `gh`, set it as `origin`, and push the initial commit. Standalone creation remains unchanged and does not accept this option.
111
+
112
+ ### `--set-secrets`
113
+
114
+ Set or update `DATADOG_API_KEY` and `DATADOG_APP_KEY` on an existing workspace repository. The repository is read from `--github-repo` or the current `origin` remote.
115
+
116
+ New monorepos include `.github/workflows/validate-datadog-apps.yml` for unconditional pull-request checks and `.github/workflows/deploy-datadog-apps.yml` for path-filtered default-branch uploads. Both execute `.github/scripts/validate-workspace.mjs` for React dependency alignment. The deployment workflow detects affected apps and runs the root-installed `datadog-apps upload` command from each selected app directory, with each app's own site and the Git commit as its version name, without requiring an app-owned `upload` script. The repository variable `DD_SITE` overrides every app's site when set.
117
+
67
118
  ## What Gets Created
68
119
 
69
120
  The CLI will: