diff --git a/.github/workflows/publish-npm.yaml b/.github/workflows/publish-npm.yaml index 98209be6..86076f7f 100644 --- a/.github/workflows/publish-npm.yaml +++ b/.github/workflows/publish-npm.yaml @@ -69,6 +69,11 @@ jobs: env: RELEASE_VERSION: ${{ env.RELEASE_VERSION }} + - name: Prepare package READMEs for publish + run: pnpm -r --filter "@contentful/optimization-*" exec build-tools rewrite-readme prepare + env: + RELEASE_TAG: ${{ env.RELEASE_TAG }} + - name: Create packages for troubleshooting run: pnpm pack --filter "@contentful/optimization-*" --pack-destination pkgs @@ -92,3 +97,7 @@ jobs: run: pnpm -r --filter "@contentful/optimization-*" publish --access public --no-git-checks env: NODE_AUTH_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }} + + - name: Restore package READMEs after publish + if: always() + run: pnpm -r --filter "@contentful/optimization-*" exec build-tools rewrite-readme restore diff --git a/AGENTS.md b/AGENTS.md index 87d66c1b..4a248e8d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -44,6 +44,7 @@ Prefer editing source files and configuration: - `e2e/**` - `__tests__/**` - `scripts/**` +- `documentation/**` - `README.md` - `package.json` - `tsconfig*.json` @@ -96,6 +97,9 @@ Do not hand-edit generated or local-only artifacts unless the task is explicitly ## Validation Policy - Run the smallest meaningful validation that matches the change. +- When linting or formatting is likely needed, prefer the smallest fix-enabled command that matches + the edited area first, then confirm with a check-only command if needed. Avoid the pattern of + running a pure check, then rerunning the same tool again only to apply obvious auto-fixes. - For TypeScript or TSX edits, run the relevant lint command early enough to influence the shape of the implementation, not only at the end. - For `lib/` or `packages/` edits, prefer `pnpm lint` after the first meaningful patch and again @@ -137,6 +141,8 @@ High-signal repo-wide commands: - unknown - Prefer a small probe before a full rerun. Check the nearest `AGENTS.md`, the target `package.json`, and any relevant `README.md` or `CONTRIBUTING.md` section before guessing. +- If a lint or format command fails with findings that the tool can auto-fix, prefer a targeted + fix-enabled rerun over repeated check-only runs, then revalidate once. - If the shell reports a command as missing: - first prefer `pnpm