refactor: project utils - #5569
Conversation
getDocumentClient belongs in db-dynamodb, not api-core-ddb (avoids circular dependency, correct abstraction level). setupDynalite stays in project-utils (vitest singleton requirement). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove unnecessary @webiny/db-dynamodb devDep from api package. Regenerate tsconfigs to clear stale api-core-ddb reference. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move createRunner/createMockTaskService to background-tasks/src/testing. Move lifecycleTracker/sleep/until to api/src/testing. Update all consumer imports (21 files). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8f71216 to
dc21aa7
Compare
|
🚓 Slop Cop The PR is a large, coherent multi-commit refactor that systematically moves testing utilities out of project-utils into more appropriate packages (api-core, db-dynamodb, background-tasks, api, api-opensearch-aws), matching its stated intent; the size (208 files) is explained by the mechanical nature of import-path updates and tsconfig/package.json path fixes across many packages, not by unrelated deletions. 🚨 Should this be in the PR? 🟡 Low — Unrelated dependency/version bumps included in refactor PR Many package.json files across the repo have unrelated version bumps (e.g. cypress, nanoid, storybook, aws-sdk, next, oxlint, better-sqlite3, pg, tsx, etc.) alongside the project-utils migration. This is likely from a lockfile/deps update commit ('chore: update project-utils deps and lockfile') but inflates the diff far beyond the stated 'remove project-utils usage' intent. Not a red flag of accidental deletion, but reviewers should confirm these version bumps are intentional and not from a stale branch merge. 📏 Code-style rule checks 🟠 Medium — console.log used in simulateStream.ts error path packages/api-opensearch-aws/src/testing/simulateStream.ts (new file) uses 🟡 Low — Non-standard comment style in ExperimentsEditorPresenter.ts diff packages/app-website-builder/.../ExperimentsEditorPresenter.ts shows a reformatting of Automated, non-blocking heads-up from an LLM. It can be wrong — use your judgment. Regenerates on every push. |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move setStorageOps/getStorageOps/clearStorageOps to api-core/src/testing. Remove redundant root JS testing dirs (symlinks point to dist/). Update all consumer imports (47 files). Clean unused project-utils dep from api-headless-cms-testing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move setupDynalite to db-dynamodb/src/testing (TS, compiled to dist). Singleton works via dist/ compiled JS (symlinks point to dist/). api package keeps project-utils import to avoid circular dep chain. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove tasks/, helpers/, dynamodb/ from project-utils/testing. These now live in background-tasks, api, db-dynamodb, api-opensearch-aws. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
api package didn't need dynalite (no DynamoDB tests). Removed setup. All consumers now use db-dynamodb/testing and api-core/testing. project-utils/testing/ now only has presets/ and logger.js. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
No consumers — was only used by setupDynalite which moved to db-dynamodb. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove unused dependencies from project-utils after testing migration. Update references.json and yarn.lock. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Changes
Remove project-utils usage from packages.