| name | contentstack-apps |
|---|---|
| description | Contentstack Developer Hub apps, manifests, GraphQL, and HTTP helpers for this CLI. Use when changing API calls, manifest handling, regions, or shared app types. |
src/config/index.ts— Default filenames, Developer Hub base URL defaults, and related constants consumed by commands andBaseCommand.
- App manifest shape and typings live under
src/types/(e.g.AppManifest). - Commands that need on-disk manifest use
AppCLIBaseCommandandconfig.defaultAppFileName.
src/util/api-request-handler.ts— Shared request/error handling patterns; prefer extending these utilities over rawfetchscattered in commands.src/util/inquirer.ts—getDeveloperHubUrl()and related helpers; tests often nock against the derived host.
- Queries and fragments belong in
src/graphql/queries.ts(or sibling files if the folder grows). Keep query strings aligned with Developer Hub expectations used by install/deploy/update flows.
- Production code expects region and auth from
@contentstack/cli-utilitiesconfigHandler. - Unit tests must stub these (see
stubAuthenticationintest/unit/helpers/auth-stub-helper.ts); never require real credentials.
- If adding new network calls, follow existing patterns for errors and retries in utilities rather than blocking the CLI without feedback.