diff --git a/CHANGELOG.md b/CHANGELOG.md index 60ed5e3..29c4e8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to `@red-hat-developer-hub/cli` are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 2.0.8 - 2026-09-15 + +### Fixed + +- **`plugin new`:** Add the missing `jest-environment-jsdom` development dependency to generated projects so `yarn test` runs successfully. + ## 2.0.7 - 2026-09-14 ### Added diff --git a/package.json b/package.json index 69a27b8..45afae5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@red-hat-developer-hub/cli", "description": "CLI for developing Backstage plugins and apps", - "version": "2.0.7", + "version": "2.0.8", "publishConfig": { "access": "public" }, diff --git a/src/commands/new/__snapshots__/command.test.ts.snap b/src/commands/new/__snapshots__/command.test.ts.snap index 8b87bdb..3d016b4 100644 --- a/src/commands/new/__snapshots__/command.test.ts.snap +++ b/src/commands/new/__snapshots__/command.test.ts.snap @@ -68,6 +68,7 @@ RHDH Dynamic Plugin Factory is the preferred workflow for repeatable build and p "@backstage/cli": "0.36.5", "@types/jest": "^29.5.14", "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", "typescript": "^5.4.5" } } @@ -200,6 +201,7 @@ RHDH Dynamic Plugin Factory is the preferred workflow for repeatable build and p "@backstage/cli": "0.36.5", "@types/jest": "^29.5.14", "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", "typescript": "^5.4.5" } } @@ -323,6 +325,7 @@ RHDH Dynamic Plugin Factory is the preferred workflow for repeatable build and p "react-dom": "^18.0.0", "react-router-dom": "^6.30.2", "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", "typescript": "^5.4.5" }, "peerDependencies": { diff --git a/src/commands/new/command.test.ts b/src/commands/new/command.test.ts index 619db2f..284ead0 100644 --- a/src/commands/new/command.test.ts +++ b/src/commands/new/command.test.ts @@ -88,6 +88,9 @@ describe('createPluginProject', () => { const packageJson = await fs.readJson(path.join(output, 'package.json')); expect(packageJson.devDependencies['@backstage/cli']).toBe('0.36.5'); + expect(packageJson.devDependencies['jest-environment-jsdom']).toBe( + '^29.7.0', + ); expect(packageJson.devDependencies).not.toHaveProperty( '@red-hat-developer-hub/cli', ); diff --git a/templates/plugin-new/backend/package.json.hbs b/templates/plugin-new/backend/package.json.hbs index 4f5b591..8ef1e7f 100644 --- a/templates/plugin-new/backend/package.json.hbs +++ b/templates/plugin-new/backend/package.json.hbs @@ -17,6 +17,7 @@ "@backstage/cli": "{{versionQuery '@backstage/cli'}}", "@types/jest": "^29.5.14", "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", "typescript": "^5.4.5" } } diff --git a/templates/plugin-new/catalog-processor-module/package.json.hbs b/templates/plugin-new/catalog-processor-module/package.json.hbs index e974241..ec8e78a 100644 --- a/templates/plugin-new/catalog-processor-module/package.json.hbs +++ b/templates/plugin-new/catalog-processor-module/package.json.hbs @@ -25,6 +25,7 @@ "@backstage/cli": "{{versionQuery '@backstage/cli'}}", "@types/jest": "^29.5.14", "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", "typescript": "^5.4.5" } } diff --git a/templates/plugin-new/frontend/package.json.hbs b/templates/plugin-new/frontend/package.json.hbs index c287720..48ec269 100644 --- a/templates/plugin-new/frontend/package.json.hbs +++ b/templates/plugin-new/frontend/package.json.hbs @@ -24,6 +24,7 @@ "react-dom": "^18.0.0", "react-router-dom": "^6.30.2", "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", "typescript": "^5.4.5" }, "peerDependencies": {