| name | dev-workflow |
| description | Local build, test, lint, coverage, TypeScript layout, ESLint, and oclif-generated docs for contentstack-cli-content-type. Use when changing package.json scripts, tsconfig, .eslintrc, Jest config, README/oclif manifest, or validating before a PR. |
dev-workflow – contentstack-cli-content-type
When to use
- Running or changing pnpm scripts (
test, test:coverage, lint, build, version).
- Editing
tsconfig.json, .eslintrc, or jest.config.js.
- Regenerating
README.md or oclif.manifest.json after command or flag changes.
- Checking expectations before opening a PR (tests + lint + coverage).
Instructions
Validation before a PR
- Run
pnpm test; fix failures before review.
pnpm run lint runs ESLint on .ts files per package.json (eslint . --ext .ts --config .eslintrc). Keep it green when shipping changes.
- When changing behavior in
src/core/ or src/utils/, run pnpm run test:coverage and ensure coverage meets jest.config.js global thresholds (see AGENTS.md).
- After changing command IDs, flags, or descriptions, regenerate CLI docs with
pnpm run build or the version script so README.md and oclif.manifest.json stay aligned.
- From the monorepo root, filter to this package:
pnpm --filter contentstack-cli-content-type run <script>.
TypeScript build
- Preserve
tsconfig.json: strict: true, rootDir: src, outDir: lib, module: commonjs, target: es2017, composite: true.
- Changes to
include, compilerOptions.paths, or rootDir/outDir affect the whole package and published lib/ output—validate with tsc -b (as in build).
- Source of truth for app code is
src/; compiled JS lives under lib/ (do not hand-edit lib/).
ESLint
- Config extends oclif-typescript and
@typescript-eslint/recommended (see .eslintrc).
- Notable conventions: single quotes,
eqeqeq smart, @typescript-eslint/no-unused-vars (args none), no-var. New rule overrides should not break pnpm run lint.
- Prefer fixing lint in
src/ and tests/ rather than disabling rules project-wide without team agreement.
Oclif docs and manifest
README.md command sections and oclif.manifest.json are generated by oclif readme and oclif manifest (see package.json build, version).
- Prefer changing
src/commands/**/*.ts (descriptions, flags, examples), then run pnpm run build so README and manifest stay consistent—avoid hand-editing generated command blocks unless you regenerate immediately after.
CI
Unit tests run in the monorepo via .github/workflows/unit-test.yml (Run tests for Contentstack Content Type plugin step, npm run test:unit). Release publishing is handled by release-production-plugins.yml on push to main (tag latest). Align local validation with these workflows before opening a PR.
References