diff --git a/.changeset/afraid-items-drum.md b/.changeset/afraid-items-drum.md new file mode 100644 index 0000000000..94ddd608cd --- /dev/null +++ b/.changeset/afraid-items-drum.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli-node': patch +--- + +Updated to use new utilities from `@backstage/cli-common`. diff --git a/.changeset/alert-api-replay.md b/.changeset/alert-api-replay.md new file mode 100644 index 0000000000..b41ec091a3 --- /dev/null +++ b/.changeset/alert-api-replay.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-app-api': patch +--- + +Added replay functionality to `AlertApiForwarder` to buffer and replay recent alerts to new subscribers, preventing missed alerts that were posted before subscription. diff --git a/.changeset/all-socks-taste.md b/.changeset/all-socks-taste.md new file mode 100644 index 0000000000..377782c2f9 --- /dev/null +++ b/.changeset/all-socks-taste.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend-module-gitlab': minor +--- + +In the `gitlabRepoPush` action, add 'auto' possibility for `commitAction` input. diff --git a/.changeset/angry-views-win.md b/.changeset/angry-views-win.md new file mode 100644 index 0000000000..9d406280a7 --- /dev/null +++ b/.changeset/angry-views-win.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-events-backend-module-kafka': minor +--- + +Added support for multiple named instances in `kafkaConsumingEventPublisher` configuration. The previous single configuration format is still supported for backward compatibility. diff --git a/.changeset/blue-signs-fry.md b/.changeset/blue-signs-fry.md new file mode 100644 index 0000000000..26861e3b7e --- /dev/null +++ b/.changeset/blue-signs-fry.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-mcp-actions-backend': patch +--- + +Added `@cfworker/json-schema` as a dependency to this package part of the `@modelcontextprotocol/sdk` bump as it's required in the types diff --git a/.changeset/bright-lions-unite.md b/.changeset/bright-lions-unite.md new file mode 100644 index 0000000000..e9bef02e10 --- /dev/null +++ b/.changeset/bright-lions-unite.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': minor +--- + +Provide `--no-node-snapshot` by default when running the `package start` or `package test`. You can disable this behavior by providing `NODE_OPTIONS='--node-snapshot'`. diff --git a/.changeset/bumpy-pens-swim.md b/.changeset/bumpy-pens-swim.md new file mode 100644 index 0000000000..462045e462 --- /dev/null +++ b/.changeset/bumpy-pens-swim.md @@ -0,0 +1,5 @@ +--- +'@backstage/integration': patch +--- + +Added support for using a GitHub App installation to generate tokens for public repository access when the `publicAccess` option is enabled. When all other authentication methods fail (e.g., the app is not installed in that organization), the provider will now use an available installation to generate a token that can be used to access public repositories as read only. diff --git a/.changeset/bumpy-planets-go.md b/.changeset/bumpy-planets-go.md new file mode 100644 index 0000000000..5477711c1a --- /dev/null +++ b/.changeset/bumpy-planets-go.md @@ -0,0 +1,7 @@ +--- +'@backstage/ui': patch +--- + +Fixed Checkbox indicator showing checkmark color when unchecked. + +Affected components: Checkbox diff --git a/.changeset/chilly-bikes-rule.md b/.changeset/chilly-bikes-rule.md new file mode 100644 index 0000000000..894999cf56 --- /dev/null +++ b/.changeset/chilly-bikes-rule.md @@ -0,0 +1,5 @@ +--- +'@techdocs/cli': patch +--- + +Updated to use new utilities from `@backstage/cli-common`. diff --git a/.changeset/chilly-waves-relate.md b/.changeset/chilly-waves-relate.md new file mode 100644 index 0000000000..2e78f9245e --- /dev/null +++ b/.changeset/chilly-waves-relate.md @@ -0,0 +1,11 @@ +--- +'@backstage/cli': minor +--- + +Switched the default module resolution to `bundler` and the `module` setting to `ES2020`. + +You may need to bump some dependencies as part of this change and fix imports in code. The most common source of this is that type checking will now consider the `exports` field in `package.json` when resolving imports. This in turn can break older versions of packages that had incompatible `exports` fields. Generally these issues will have already been fixed in the upstream packages. + +You might be tempted to use `--skipLibCheck` to hide issues due to this change, but it will weaken the type safety of your project. If you run into a large number of issues and want to keep the old behavior, you can reset the `moduleResolution` and `module` settings your own `tsconfig.json` file to `node` and `ESNext` respectively. But keep in mind that the `node` option will be removed in future versions of TypeScript. + +A future version of Backstage will make these new settings mandatory, as we move to rely on the `exports` field for type resolution in packages, rather than the `typesVersions` field. diff --git a/.changeset/common-coins-stare.md b/.changeset/common-coins-stare.md new file mode 100644 index 0000000000..0bd0078cf9 --- /dev/null +++ b/.changeset/common-coins-stare.md @@ -0,0 +1,7 @@ +--- +'@backstage/ui': patch +--- + +Fixed `ButtonIcon` incorrectly applying `className` to inner elements instead of only the root element. + +Affected components: ButtonIcon diff --git a/.changeset/crazy-hornets-spend.md b/.changeset/crazy-hornets-spend.md new file mode 100644 index 0000000000..4db99675ac --- /dev/null +++ b/.changeset/crazy-hornets-spend.md @@ -0,0 +1,11 @@ +--- +'@backstage/plugin-catalog-graph': patch +'@backstage/plugin-api-docs': patch +'@backstage/plugin-techdocs': patch +'@backstage/plugin-catalog': patch +'@backstage/plugin-search': patch +'@backstage/plugin-app': patch +'@backstage/plugin-org': patch +--- + +Minor extension type updates after frontend API bump diff --git a/.changeset/create-app-1764689798.md b/.changeset/create-app-1764689798.md new file mode 100644 index 0000000000..b50d431d4b --- /dev/null +++ b/.changeset/create-app-1764689798.md @@ -0,0 +1,5 @@ +--- +'@backstage/create-app': patch +--- + +Bumped create-app version. diff --git a/.changeset/curvy-things-call.md b/.changeset/curvy-things-call.md new file mode 100644 index 0000000000..d64f1a14fa --- /dev/null +++ b/.changeset/curvy-things-call.md @@ -0,0 +1,21 @@ +--- +'@backstage/plugin-notifications-backend-module-email': patch +--- + +SES config for the notification email processor now supports utilizing an ARN for the SES identity when sending an email after the SES SDK V2 update. + +The `sesConfig.fromArn` will set the `fromEmailAddressIdentityArn` option for the SES `SendEmailCommand`. The `sesConfig.sourceArn` field is removed since no equivalent option is available in the send email command options. Setting `sesConfig.sourceArn` will have no effect and log a warning. Example changes: + +```diff +notifications: + processors: + email: + transportConfig: + transport: "ses" + region: "us-west-2" + sender: "sender@mycompany.com" + replyTo: "no-reply@mycompany.com" + sesConfig: +- sourceArn: "arn:aws:ses:us-west-2:123456789012:identity/example.com" + fromArn: "arn:aws:ses:us-west-2:123456789012:identity/example.com" +``` diff --git a/.changeset/dependabot-0d8f6de.md b/.changeset/dependabot-0d8f6de.md new file mode 100644 index 0000000000..b0a3955f2d --- /dev/null +++ b/.changeset/dependabot-0d8f6de.md @@ -0,0 +1,47 @@ +--- +'@backstage/backend-defaults': patch +'@backstage/backend-dynamic-feature-service': patch +'@backstage/backend-openapi-utils': patch +'@backstage/backend-test-utils': patch +'@backstage/cli': patch +'@backstage/plugin-app-backend': patch +'@backstage/plugin-app-node': patch +'@backstage/plugin-auth-backend-module-atlassian-provider': patch +'@backstage/plugin-auth-backend-module-auth0-provider': patch +'@backstage/plugin-auth-backend-module-aws-alb-provider': patch +'@backstage/plugin-auth-backend-module-azure-easyauth-provider': patch +'@backstage/plugin-auth-backend-module-bitbucket-provider': patch +'@backstage/plugin-auth-backend-module-cloudflare-access-provider': patch +'@backstage/plugin-auth-backend-module-gcp-iap-provider': patch +'@backstage/plugin-auth-backend-module-gitlab-provider': patch +'@backstage/plugin-auth-backend-module-guest-provider': patch +'@backstage/plugin-auth-backend-module-microsoft-provider': patch +'@backstage/plugin-auth-backend-module-oidc-provider': patch +'@backstage/plugin-auth-backend-module-okta-provider': patch +'@backstage/plugin-auth-backend-module-onelogin-provider': patch +'@backstage/plugin-auth-backend-module-openshift-provider': patch +'@backstage/plugin-auth-backend-module-pinniped-provider': patch +'@backstage/plugin-auth-backend': patch +'@backstage/plugin-auth-node': patch +'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch +'@backstage/plugin-catalog-backend': patch +'@backstage/plugin-devtools-backend': patch +'@backstage/plugin-events-backend': patch +'@backstage/plugin-events-node': patch +'@backstage/plugin-gateway-backend': patch +'@backstage/plugin-kubernetes-backend': patch +'@backstage/plugin-mcp-actions-backend': patch +'@backstage/plugin-notifications-backend': patch +'@backstage/plugin-permission-backend': patch +'@backstage/plugin-permission-node': patch +'@backstage/plugin-proxy-backend': patch +'@backstage/plugin-scaffolder-backend': patch +'@backstage/plugin-search-backend': patch +'@backstage/plugin-signals-backend': patch +'@backstage/plugin-signals-node': patch +'@backstage/plugin-techdocs-backend': patch +'@backstage/plugin-techdocs-node': patch +'@backstage/plugin-user-settings-backend': patch +--- + +chore(deps): bump `express` from 4.21.2 to 4.22.0 diff --git a/.changeset/dependabot-5e654fe.md b/.changeset/dependabot-5e654fe.md new file mode 100644 index 0000000000..93563cffc6 --- /dev/null +++ b/.changeset/dependabot-5e654fe.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-defaults': patch +--- + +build(deps): bump `node-forge` from 1.3.1 to 1.3.2 diff --git a/.changeset/early-carpets-rush.md b/.changeset/early-carpets-rush.md new file mode 100644 index 0000000000..dbdc5410c9 --- /dev/null +++ b/.changeset/early-carpets-rush.md @@ -0,0 +1,16 @@ +--- +'@backstage/cli': patch +--- + +Add missing peer/dev dependencies to the frontend plugin template. + +`react-dom` was not declared as a peer dependency, causing module resolution +errors when generating plugins outside a Backstage monorepo. This adds +`react-dom` to `peerDependencies` (for consuming apps) and `devDependencies` +(for local development). `react-router-dom` is also added to `peerDependencies` (for consuming apps) and `devDependencies` +to support routing during plugin development. + +Fixes: + +- Module not found: Can't resolve 'react-dom' +- Module not found: Can't resolve 'react-router-dom' diff --git a/.changeset/early-doors-visit.md b/.changeset/early-doors-visit.md new file mode 100644 index 0000000000..41cd9e92b8 --- /dev/null +++ b/.changeset/early-doors-visit.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-defaults': patch +--- + +Allow configuration of the `referrerPolicy` diff --git a/.changeset/error-boundary-api.md b/.changeset/error-boundary-api.md new file mode 100644 index 0000000000..74803f1dc0 --- /dev/null +++ b/.changeset/error-boundary-api.md @@ -0,0 +1,7 @@ +--- +'@backstage/frontend-plugin-api': patch +--- + +Added a new `errorPresentation` prop to `ExtensionBoundary` to control how errors are presented to the user. The default is `'error-display'`, which is the current behavior of showing the error in the `ErrorDisplay` component. The new option is `'error-api'`, posts errors to the `ErrorApi` and does not allow retries. + +The `AppRootElementBlueprint` now wraps its element in an `ErrorBoundary` using the new `'error-api'` presentation mode. diff --git a/.changeset/fifty-coats-feel.md b/.changeset/fifty-coats-feel.md new file mode 100644 index 0000000000..0e3425a505 --- /dev/null +++ b/.changeset/fifty-coats-feel.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-kubernetes-react': patch +--- + +Enabled a pod terminal at GKE diff --git a/.changeset/fifty-lights-marry.md b/.changeset/fifty-lights-marry.md new file mode 100644 index 0000000000..423ef89721 --- /dev/null +++ b/.changeset/fifty-lights-marry.md @@ -0,0 +1,9 @@ +--- +'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch +'@backstage/plugin-kubernetes-backend': patch +'@backstage/backend-defaults': patch +'@backstage/plugin-scaffolder-react': patch +'@backstage/integration': patch +--- + +Updated luxon types diff --git a/.changeset/floppy-bobcats-serve.md b/.changeset/floppy-bobcats-serve.md new file mode 100644 index 0000000000..d698e1482c --- /dev/null +++ b/.changeset/floppy-bobcats-serve.md @@ -0,0 +1,12 @@ +--- +'@backstage/core-components': patch +--- + +Fixed bug in the `LogViewer` component where shift + click always opened a new window instead of just changing the selection. + +In addition, improved the `LogViewer` component by a few usability enhancements: + +- Added support for multiple selections using cmd/ctrl + click +- Improved the generated hash that is added to the URL to also support ranges & multiple selections +- Added an hover effect & info tooltip to the "Copy to clipboard" button to indicate its functionality +- Added some color and a separator to the line numbers to improve readability diff --git a/.changeset/fruity-words-melt.md b/.changeset/fruity-words-melt.md new file mode 100644 index 0000000000..0f02acee2b --- /dev/null +++ b/.changeset/fruity-words-melt.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs-module-addons-contrib': patch +--- + +Updated tests to match test-utils change diff --git a/.changeset/full-needles-drive.md b/.changeset/full-needles-drive.md new file mode 100644 index 0000000000..d0d7a59551 --- /dev/null +++ b/.changeset/full-needles-drive.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-kubernetes-backend': minor +'@backstage/plugin-kubernetes-node': minor +--- + +Add possibility to extends Kubernetes REST API. Add fetcher to parameters for custom objects provider diff --git a/.changeset/funny-hornets-peel.md b/.changeset/funny-hornets-peel.md new file mode 100644 index 0000000000..2af6702295 --- /dev/null +++ b/.changeset/funny-hornets-peel.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +Updated `isolated-vm` to `6.0.1` diff --git a/.changeset/funny-papayas-rest.md b/.changeset/funny-papayas-rest.md new file mode 100644 index 0000000000..95f52966ec --- /dev/null +++ b/.changeset/funny-papayas-rest.md @@ -0,0 +1,6 @@ +--- +'@backstage/repo-tools': patch +'@backstage/codemods': patch +--- + +Updated to use new utilities from `@backstage/cli-common`. diff --git a/.changeset/fuzzy-phones-own.md b/.changeset/fuzzy-phones-own.md new file mode 100644 index 0000000000..61725d1f1d --- /dev/null +++ b/.changeset/fuzzy-phones-own.md @@ -0,0 +1,9 @@ +--- +'@backstage/plugin-catalog-backend-module-github-org': patch +'@backstage/plugin-catalog-backend-module-github': patch +--- + +Introduce new configuration option to exclude suspended users from GitHub Enterprise instances. + +When it’s set to true, suspended users won’t be returned when querying the organization users for GitHub Enterprise instances. +Note that this option should be used only against GitHub Enterprise instances, the property does not exist in the github.com GraphQL schema, setting it will cause a schema validation error and the syncing of users will fail. diff --git a/.changeset/fuzzy-rivers-travel.md b/.changeset/fuzzy-rivers-travel.md new file mode 100644 index 0000000000..fa2c08a671 --- /dev/null +++ b/.changeset/fuzzy-rivers-travel.md @@ -0,0 +1,5 @@ +--- +'@backstage/frontend-plugin-api': patch +--- + +Made the return type of `.withOverrides` to be simplified. diff --git a/.changeset/fuzzy-trees-live.md b/.changeset/fuzzy-trees-live.md new file mode 100644 index 0000000000..84cec56fab --- /dev/null +++ b/.changeset/fuzzy-trees-live.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +long words like urls now breaks to new line on warning panels instead of overflowing the container diff --git a/.changeset/gentle-results-lie.md b/.changeset/gentle-results-lie.md new file mode 100644 index 0000000000..0c53407db3 --- /dev/null +++ b/.changeset/gentle-results-lie.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs': patch +--- + +Fixed schema type for additionalAllowedURIProtocols diff --git a/.changeset/gentle-singers-love.md b/.changeset/gentle-singers-love.md new file mode 100644 index 0000000000..ed4372ee06 --- /dev/null +++ b/.changeset/gentle-singers-love.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-app': patch +--- + +Support to set `defaultLanguage` and `availableLanguages` for the app language API in the new frontend system diff --git a/.changeset/great-files-shave.md b/.changeset/great-files-shave.md new file mode 100644 index 0000000000..271a8e8955 --- /dev/null +++ b/.changeset/great-files-shave.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-react': patch +--- + +Fixed an issue where `EntityOwnerPicker` failed to filter options when the input text contained uppercase characters. diff --git a/.changeset/green-lizards-boil.md b/.changeset/green-lizards-boil.md new file mode 100644 index 0000000000..640699e001 --- /dev/null +++ b/.changeset/green-lizards-boil.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-react': patch +--- + +Use a versioned context for `useEntityList`, to better work with mixed `@backstage/plugin-catalog-react` versions. diff --git a/.changeset/happy-streets-dress.md b/.changeset/happy-streets-dress.md new file mode 100644 index 0000000000..46f4d798ed --- /dev/null +++ b/.changeset/happy-streets-dress.md @@ -0,0 +1,5 @@ +--- +'@backstage/create-app': patch +--- + +Updated engines to support Node 22 or 24 diff --git a/.changeset/honest-bears-itch.md b/.changeset/honest-bears-itch.md new file mode 100644 index 0000000000..4c0cd5f47e --- /dev/null +++ b/.changeset/honest-bears-itch.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-test-utils': patch +--- + +Switched `textextensions` dependency for `text-extensions`. diff --git a/.changeset/large-planes-punch.md b/.changeset/large-planes-punch.md new file mode 100644 index 0000000000..3216653eb9 --- /dev/null +++ b/.changeset/large-planes-punch.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-defaults': patch +--- + +Fix for `jose` types diff --git a/.changeset/legal-otters-punch.md b/.changeset/legal-otters-punch.md new file mode 100644 index 0000000000..2003492e29 --- /dev/null +++ b/.changeset/legal-otters-punch.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-kubernetes-backend': patch +'@backstage/plugin-kubernetes-common': patch +'@backstage/plugin-kubernetes-react': patch +--- + +Add Kubernetes Plugin Secrets Accordion with masked secret datas diff --git a/.changeset/lemon-corners-hug.md b/.changeset/lemon-corners-hug.md new file mode 100644 index 0000000000..b41c09c928 --- /dev/null +++ b/.changeset/lemon-corners-hug.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs-node': patch +--- + +There was an issue in the uploading of large size files to the AWS S3. We have modified the logic by adding retry along with multipart uploading functionality. diff --git a/.changeset/loud-yaks-watch.md b/.changeset/loud-yaks-watch.md new file mode 100644 index 0000000000..b7ad65b9eb --- /dev/null +++ b/.changeset/loud-yaks-watch.md @@ -0,0 +1,5 @@ +--- +'@backstage/repo-tools': patch +--- + +Bump `@microsoft/api-documenter` and `@microsoft/api-extractor` to latest versions. diff --git a/.changeset/modern-taxes-start.md b/.changeset/modern-taxes-start.md new file mode 100644 index 0000000000..9fd7645570 --- /dev/null +++ b/.changeset/modern-taxes-start.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli-common': patch +--- + +Added new `run`, `runOutput`, and `runCheck` utilities to help run child processes in a safe and portable way. diff --git a/.changeset/neat-pens-clean.md b/.changeset/neat-pens-clean.md new file mode 100644 index 0000000000..aff67a2a10 --- /dev/null +++ b/.changeset/neat-pens-clean.md @@ -0,0 +1,5 @@ +--- +'@backstage/repo-tools': patch +--- + +Properly create workspace in OS temporary directory for `generate-patch` command diff --git a/.changeset/nice-humans-cry.md b/.changeset/nice-humans-cry.md new file mode 100644 index 0000000000..c6119702b4 --- /dev/null +++ b/.changeset/nice-humans-cry.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +'@backstage/backend-defaults': patch +--- + +Internal change to support new versions of the `logform` library diff --git a/.changeset/old-cats-shake.md b/.changeset/old-cats-shake.md new file mode 100644 index 0000000000..3ca30a0421 --- /dev/null +++ b/.changeset/old-cats-shake.md @@ -0,0 +1,6 @@ +--- +'@backstage/backend-defaults': patch +'@backstage/backend-plugin-api': minor +--- + +Adds a new experimental `RootSystemMetadataService` for tracking the collection of Backstage instances that may be deployed at any one time. It currently offers a single API, `getInstalledPlugins` that returns a list of installed plugins based on config you have set up in `discovery.endpoints` as well as the plugins installed on the instance you're calling the API with. It does not handle wildcard values or fallback values. The intention is for this plugin to provide plugin authors with a simple interface to fetch a trustworthy list of all installed plugins. diff --git a/.changeset/old-parks-smell.md b/.changeset/old-parks-smell.md new file mode 100644 index 0000000000..f089c7da21 --- /dev/null +++ b/.changeset/old-parks-smell.md @@ -0,0 +1,20 @@ +--- +'@backstage/plugin-techdocs-addons-test-utils': major +--- + +**BREAKING**: `TechDocsAddonTester.renderWithEffects()` no longer returns a screen; this means that you can no longer grab assertions such as `getByText` from its return value. + +Newer versions of `@testing-library` recommends using the `screen` export for assertions - and removing this from the addon tester contract allows us to more freely iterate on which underlying version of the testing library is being used. + +One notable effect of this, however, is that the `@testing-library` `screen` does NOT support assertions on the shadow DOM, which techdocs relies on. You will therefore want to add a dependency on [the `shadow-dom-testing-library` package](https://github.com/konnorrogers/shadow-dom-testing-library/) in your tests, and using its `screen` and its dedicated `*Shadow*` methods. As an example, if you keep doing `getByText` you will not get matches inside the shadow DOM - switch to `getByShadowText` instead. + +```ts +import { screen } from 'shadow-dom-testing-library'; + +// ... render the addon ... +await TechDocsAddonTester.buildAddonsInTechDocs([]) + .withDom(TEST_CONTENT) + .renderWithEffects(); + +expect(screen.getByShadowText('TEST_CONTENT')).toBeInTheDocument(); +``` diff --git a/.changeset/open-points-beam.md b/.changeset/open-points-beam.md new file mode 100644 index 0000000000..b58bf2b3d5 --- /dev/null +++ b/.changeset/open-points-beam.md @@ -0,0 +1,37 @@ +--- +'@backstage/ui': minor +--- + +**Breaking change** The `Cell` component has been refactored to be a generic wrapper component that accepts `children` for custom cell content. The text-specific functionality (previously part of `Cell`) has been moved to a new `CellText` component. + +### Migration Guide + +If you were using `Cell` with text-specific props (`title`, `description`, `leadingIcon`, `href`), you need to update your code to use `CellText` instead: + +**Before:** + +```tsx +} + href="/path" +/> +``` + +**After:** + +```tsx +} + href="/path" +/> +``` + +For custom cell content, use the new generic `Cell` component: + +```tsx +{/* Your custom content */} +``` diff --git a/.changeset/pre.json b/.changeset/pre.json index e341909093..3419f9dbb2 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -1,5 +1,5 @@ { - "mode": "pre", + "mode": "exit", "tag": "next", "initialVersions": { "example-app": "0.2.115", @@ -207,28 +207,92 @@ "@backstage/plugin-user-settings-common": "0.0.1" }, "changesets": [ + "afraid-items-drum", + "alert-api-replay", + "all-socks-taste", + "blue-signs-fry", + "bumpy-planets-go", "chatty-sides-wear", + "chilly-bikes-rule", "chilly-hotels-walk", + "chilly-waves-relate", "clean-toys-reply", + "common-coins-stare", + "crazy-hornets-spend", + "create-app-1764689798", + "dependabot-0d8f6de", + "dependabot-5e654fe", + "early-doors-visit", + "error-boundary-api", "famous-jars-lose", + "fifty-coats-feel", + "fifty-lights-marry", "fine-eagles-sleep", "flat-pillows-rush", + "floppy-bobcats-serve", "four-peaches-train", "fruity-rivers-arrive", + "fruity-words-melt", + "full-needles-drive", + "funny-hornets-peel", + "funny-papayas-rest", + "fuzzy-phones-own", + "fuzzy-rivers-travel", + "fuzzy-trees-live", + "gentle-singers-love", "gentle-trains-juggle", + "great-files-shave", + "green-lizards-boil", "happy-bottles-invite", + "happy-streets-dress", + "honest-bears-itch", "kind-hoops-double", + "large-planes-punch", "legal-cloths-spend", + "legal-otters-punch", + "lemon-corners-hug", "loose-pets-slide", + "loud-yaks-watch", "lucky-days-hug", "many-planes-join", "metal-boxes-laugh", "metal-humans-lose", + "modern-taxes-start", + "neat-pens-clean", + "nice-humans-cry", + "nice-trams-shake", + "old-cats-shake", + "old-parks-smell", + "open-points-beam", "quiet-hats-sleep", + "rare-rice-throw", + "ready-results-march", + "renovate-7b76d6d", + "renovate-959c095", + "renovate-97eef4b", + "renovate-9ec01ff", + "renovate-a3c2cbd", + "renovate-aa0bb93", + "renovate-ad7bf17", + "renovate-d7ceb06", + "renovate-ea25c93", + "rotten-melons-sleep", + "salty-camels-wash", + "seven-games-rest", "short-groups-knock", "slick-books-sleep", + "slick-onions-wash", + "slimy-islands-play", + "slimy-mugs-taste", + "sour-bats-press", "spicy-teeth-study", "stale-eagles-rush", + "stupid-cases-fold", + "tall-ideas-lead", + "tame-mirrors-sit", + "tender-dancers-hunt", + "tired-dogs-remain", + "tough-lies-grow", "twenty-ducks-relate" ] } diff --git a/.changeset/pretty-breads-speak.md b/.changeset/pretty-breads-speak.md new file mode 100644 index 0000000000..13accd1cd0 --- /dev/null +++ b/.changeset/pretty-breads-speak.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-notifications-backend-module-slack': patch +--- + +Slack notification handler throttling can now be configured with the `concurrencyLimit` and `throttleInterval` options. diff --git a/.changeset/rare-rice-throw.md b/.changeset/rare-rice-throw.md new file mode 100644 index 0000000000..6fa0434f67 --- /dev/null +++ b/.changeset/rare-rice-throw.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +Add `tooltipClasses` prop to `OverflowTooltip` component to allow customisation of the tooltip diff --git a/.changeset/ready-results-march.md b/.changeset/ready-results-march.md new file mode 100644 index 0000000000..c28ade8de9 --- /dev/null +++ b/.changeset/ready-results-march.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': patch +--- + +Fixed `catalogAboutEntityCard` to filter icon links before calling useProps(), preventing side effects from hooks in filtered-out links diff --git a/.changeset/renovate-7b76d6d.md b/.changeset/renovate-7b76d6d.md new file mode 100644 index 0000000000..9ccb2dd94b --- /dev/null +++ b/.changeset/renovate-7b76d6d.md @@ -0,0 +1,6 @@ +--- +'@backstage/cli': patch +'@backstage/plugin-scaffolder-backend': patch +--- + +Updated dependency `esbuild` to `^0.27.0`. diff --git a/.changeset/renovate-959c095.md b/.changeset/renovate-959c095.md new file mode 100644 index 0000000000..d2370a1c8b --- /dev/null +++ b/.changeset/renovate-959c095.md @@ -0,0 +1,11 @@ +--- +'@backstage/plugin-home-react': patch +'@backstage/plugin-home': patch +'@backstage/plugin-scaffolder-react': patch +'@backstage/plugin-scaffolder': patch +--- + +Updated dependency `@rjsf/utils` to `5.24.13`. +Updated dependency `@rjsf/core` to `5.24.13`. +Updated dependency `@rjsf/material-ui` to `5.24.13`. +Updated dependency `@rjsf/validator-ajv8` to `5.24.13`. diff --git a/.changeset/renovate-97eef4b.md b/.changeset/renovate-97eef4b.md new file mode 100644 index 0000000000..9b3692bc1c --- /dev/null +++ b/.changeset/renovate-97eef4b.md @@ -0,0 +1,5 @@ +--- +'@backstage/config-loader': patch +--- + +Updated dependency `typescript-json-schema` to `^0.67.0`. diff --git a/.changeset/renovate-9ec01ff.md b/.changeset/renovate-9ec01ff.md new file mode 100644 index 0000000000..1ab750c0e6 --- /dev/null +++ b/.changeset/renovate-9ec01ff.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-search-backend-module-explore': patch +--- + +Updated dependency `@backstage-community/plugin-explore-common` to `^0.9.0`. diff --git a/.changeset/renovate-a3c2cbd.md b/.changeset/renovate-a3c2cbd.md new file mode 100644 index 0000000000..2fde85d39e --- /dev/null +++ b/.changeset/renovate-a3c2cbd.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-react': patch +--- + +Updated dependency `use-immer` to `^0.11.0`. diff --git a/.changeset/renovate-aa0bb93.md b/.changeset/renovate-aa0bb93.md new file mode 100644 index 0000000000..5f40a61fab --- /dev/null +++ b/.changeset/renovate-aa0bb93.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-notifications-backend-module-email': patch +--- + +Updated dependency `@types/nodemailer` to `^7.0.0`. diff --git a/.changeset/renovate-ad7bf17.md b/.changeset/renovate-ad7bf17.md new file mode 100644 index 0000000000..a0f90ff97d --- /dev/null +++ b/.changeset/renovate-ad7bf17.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-defaults': patch +--- + +Updated dependency `@types/archiver` to `^7.0.0`. diff --git a/.changeset/renovate-d7ceb06.md b/.changeset/renovate-d7ceb06.md new file mode 100644 index 0000000000..d22f266301 --- /dev/null +++ b/.changeset/renovate-d7ceb06.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Updated dependency `@pmmmwh/react-refresh-webpack-plugin` to `^0.6.0`. diff --git a/.changeset/renovate-ea25c93.md b/.changeset/renovate-ea25c93.md new file mode 100644 index 0000000000..958e032b64 --- /dev/null +++ b/.changeset/renovate-ea25c93.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Updated dependency `webpack` to `~5.103.0`. diff --git a/.changeset/rotten-carrots-relax.md b/.changeset/rotten-carrots-relax.md new file mode 100644 index 0000000000..339a5cdd6b --- /dev/null +++ b/.changeset/rotten-carrots-relax.md @@ -0,0 +1,8 @@ +--- +'@backstage/plugin-notifications': patch +--- + +Move long notification descriptions behind `Show more/less` button. + +This improves readability of the notifications list by preventing long descriptions from taking up too much space +or rendering very small scrollable areas. diff --git a/.changeset/rotten-melons-sleep.md b/.changeset/rotten-melons-sleep.md new file mode 100644 index 0000000000..c12e0a9669 --- /dev/null +++ b/.changeset/rotten-melons-sleep.md @@ -0,0 +1,15 @@ +--- +'@backstage/plugin-catalog-unprocessed-entities-common': patch +'@backstage/plugin-catalog-unprocessed-entities': patch +--- + +Moved types, API and client to the common package, allowing both frontend and +backend plugins to use the `CatalogUnprocessedEntitiesClient`. + +The following types, clients and interfaces have been deprecated and should be +imported from the `@backstage/plugin-catalog-unprocessed-entities-common` instead: +`CatalogUnprocessedEntitiesApi`, `CatalogUnprocessedEntitiesApiResponse`, `UnprocessedEntity`, +`UnprocessedEntityCache`, `UnprocessedEntityError`, `CatalogUnprocessedEntitiesClient`. + +All those types, clients and interfaces are re-exported temporarily in the +`@backstage/plugin-catalog-unprocessed-entities` package until cleaned up. diff --git a/.changeset/salty-camels-wash.md b/.changeset/salty-camels-wash.md new file mode 100644 index 0000000000..56600db540 --- /dev/null +++ b/.changeset/salty-camels-wash.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Fixed internal usage of `yargs`. diff --git a/.changeset/seven-games-rest.md b/.changeset/seven-games-rest.md new file mode 100644 index 0000000000..b498c3b138 --- /dev/null +++ b/.changeset/seven-games-rest.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs-backend': patch +--- + +Corrected `ErrorCallback` type to work with Node 22 types diff --git a/.changeset/short-cloths-tie.md b/.changeset/short-cloths-tie.md new file mode 100644 index 0000000000..fe379fb18d --- /dev/null +++ b/.changeset/short-cloths-tie.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-defaults': patch +--- + +Don't warn when parsing `storeOptions` for `memory` cache diff --git a/.changeset/short-lizards-find.md b/.changeset/short-lizards-find.md new file mode 100644 index 0000000000..051fcd20bb --- /dev/null +++ b/.changeset/short-lizards-find.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-devtools-common': patch' +'@backstage/plugin-devtools-backend': patch +'@backstage/plugin-devtools': patch +--- + +Added scheduled tasks UI feature for the DevTools plugin diff --git a/.changeset/slimy-islands-play.md b/.changeset/slimy-islands-play.md new file mode 100644 index 0000000000..497d86761b --- /dev/null +++ b/.changeset/slimy-islands-play.md @@ -0,0 +1,7 @@ +--- +'@backstage/ui': patch +--- + +Added row selection support with visual state styling for hover, selected, and pressed states. Fixed checkbox rendering to only show for multi-select toggle mode. + +Affected components: Table, TableHeader, Row, Column diff --git a/.changeset/slimy-mugs-taste.md b/.changeset/slimy-mugs-taste.md new file mode 100644 index 0000000000..5773db6853 --- /dev/null +++ b/.changeset/slimy-mugs-taste.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-test-utils': patch +--- + +Fix PostgreSQL 18 `TestDatabases` by pinning the data directory diff --git a/.changeset/sour-bats-press.md b/.changeset/sour-bats-press.md new file mode 100644 index 0000000000..bfcf3985e6 --- /dev/null +++ b/.changeset/sour-bats-press.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-node': patch +--- + +fix flawed cookie removal logic with chunked tokens diff --git a/.changeset/spicy-sides-grow.md b/.changeset/spicy-sides-grow.md new file mode 100644 index 0000000000..3f44f35866 --- /dev/null +++ b/.changeset/spicy-sides-grow.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +added support for wrapLongLines option in CodeSnippet diff --git a/.changeset/stale-poets-battle.md b/.changeset/stale-poets-battle.md new file mode 100644 index 0000000000..1725fd2885 --- /dev/null +++ b/.changeset/stale-poets-battle.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-events-backend-module-kafka': minor +--- + +Added `KafkaPublishingEventConsumer` to support sending Backstage events to Kafka topics. + +This addition enables Backstage to publish events to external Kafka systems, complementing the existing ability to receive events from Kafka. This allows for better integration with external systems that rely on Kafka for event streaming. diff --git a/.changeset/stupid-cases-fold.md b/.changeset/stupid-cases-fold.md new file mode 100644 index 0000000000..6ee2472746 --- /dev/null +++ b/.changeset/stupid-cases-fold.md @@ -0,0 +1,7 @@ +--- +'@backstage/cli': patch +--- + +Switched compilation target to ES2022 in order to match the new set of supported Node.js versions, which are 22 and 24. + +The TypeScript compilation target has been set to ES2022, because setting it to a higher target will break projects on older TypeScript versions. If you use a newer TypeScript version in your own project, you can bump `compilerOptions.target` to ES2023 or ES2024 in your own `tsconfig.json` file. diff --git a/.changeset/swift-moments-think.md b/.changeset/swift-moments-think.md new file mode 100644 index 0000000000..185fd4ff48 --- /dev/null +++ b/.changeset/swift-moments-think.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-github': patch +--- + +Added configurable `pageSizes` option to `GithubOrgEntityProvider` for GitHub GraphQL API queries to prevent `RESOURCE_LIMITS_EXCEEDED` errors with organizations with large number of teams and members. This aligns the configuration options with `GithubMultiOrgEntityProvider`. diff --git a/.changeset/swift-wolves-judge.md b/.changeset/swift-wolves-judge.md new file mode 100644 index 0000000000..399ed5bad8 --- /dev/null +++ b/.changeset/swift-wolves-judge.md @@ -0,0 +1,5 @@ +--- +'@backstage/frontend-plugin-api': patch +--- + +Removed unnecessary dependencies on `@backstage/core-components`, `@backstage/config`, `@material-ui/core`, and `lodash`. diff --git a/.changeset/tall-ideas-lead.md b/.changeset/tall-ideas-lead.md new file mode 100644 index 0000000000..60bef903d8 --- /dev/null +++ b/.changeset/tall-ideas-lead.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend-module-bitbucket-server': patch +--- + +Improve error message when provided target branch is missing diff --git a/.changeset/tame-mirrors-sit.md b/.changeset/tame-mirrors-sit.md new file mode 100644 index 0000000000..f317185ea2 --- /dev/null +++ b/.changeset/tame-mirrors-sit.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-dev-utils': patch +--- + +Internal update for Node.js v24 support. diff --git a/.changeset/tender-dancers-hunt.md b/.changeset/tender-dancers-hunt.md new file mode 100644 index 0000000000..e20ec43ae0 --- /dev/null +++ b/.changeset/tender-dancers-hunt.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Updated to use new utilities from `@backstage/cli-common`. diff --git a/.changeset/tired-dogs-remain.md b/.changeset/tired-dogs-remain.md new file mode 100644 index 0000000000..06c193068b --- /dev/null +++ b/.changeset/tired-dogs-remain.md @@ -0,0 +1,12 @@ +--- +'@backstage/plugin-scaffolder-backend-module-rails': patch +'@backstage/plugin-kubernetes-cluster': patch +'@techdocs/cli': patch +'@backstage/cli-common': patch +'@backstage/create-app': patch +'@backstage/repo-tools': patch +'@backstage/codemods': patch +'@backstage/cli': patch +--- + +Bumped dev dependencies `@types/node` diff --git a/.github/workflows/api-breaking-changes-comment.yml b/.github/workflows/api-breaking-changes-comment.yml index 9b20cf80fb..654d73b4d4 100644 --- a/.github/workflows/api-breaking-changes-comment.yml +++ b/.github/workflows/api-breaking-changes-comment.yml @@ -23,7 +23,7 @@ jobs: comment-cache-key: ${{ steps.hash.outputs.COMMENT_FILE_HASH }} steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: disable-sudo: true egress-policy: block @@ -32,7 +32,7 @@ jobs: - name: 'Download artifacts' # Fetch output (zip archive) from the workflow run that triggered this workflow. - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: | let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ @@ -99,7 +99,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - name: Fetch cached Manifests File id: cache diff --git a/.github/workflows/api-breaking-changes.yml b/.github/workflows/api-breaking-changes.yml index d0230900cd..934add0716 100644 --- a/.github/workflows/api-breaking-changes.yml +++ b/.github/workflows/api-breaking-changes.yml @@ -14,11 +14,11 @@ jobs: if: ${{ github.event_name != 'pull_request' || github.event.action != 'closed' }} steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: # Fetch the commit that's merged into the base rather than the target ref # This will let us diff only the contents of the PR, without fetching more history @@ -29,13 +29,13 @@ jobs: - name: setup-node uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 20.x + node-version: 22.x registry-url: https://registry.npmjs.org/ - name: yarn install uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17 with: - cache-prefix: linux-v20 + cache-prefix: linux-v22 - name: breaking changes check run: | diff --git a/.github/workflows/automate_area-labels.yml b/.github/workflows/automate_area-labels.yml index b1663d1629..e85a9cf11f 100644 --- a/.github/workflows/automate_area-labels.yml +++ b/.github/workflows/automate_area-labels.yml @@ -13,11 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 + - uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1 with: repo-token: '${{ secrets.GITHUB_TOKEN }}' sync-labels: true diff --git a/.github/workflows/automate_changeset_feedback.yml b/.github/workflows/automate_changeset_feedback.yml index 703db824f1..257db3929a 100644 --- a/.github/workflows/automate_changeset_feedback.yml +++ b/.github/workflows/automate_changeset_feedback.yml @@ -23,11 +23,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: # Fetch the commit that's merged into the base rather than the target ref # This will let us diff only the contents of the PR, without fetching more history diff --git a/.github/workflows/automate_merge_message.yml b/.github/workflows/automate_merge_message.yml index b218b98259..83a1e32fcf 100644 --- a/.github/workflows/automate_merge_message.yml +++ b/.github/workflows/automate_merge_message.yml @@ -24,11 +24,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: '${{ github.event.pull_request.merge_commit_sha }}' @@ -44,7 +44,7 @@ jobs: node generate.js ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} > message.txt - name: Post Message - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: ISSUE_NUMBER: ${{ github.event.pull_request.number }} with: diff --git a/.github/workflows/automate_stale.yml b/.github/workflows/automate_stale.yml index cbdab4414a..a7eef4fae4 100644 --- a/.github/workflows/automate_stale.yml +++ b/.github/workflows/automate_stale.yml @@ -15,12 +15,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: Stale check - base - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0 + uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1 with: stale-issue-message: > This issue has been automatically marked as stale because it has not had @@ -42,7 +42,7 @@ jobs: operations-per-run: 100 - name: Stale check - bugs without repro - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0 + uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1 with: stale-issue-message: > This bug report has been automatically marked as stale because it has not had diff --git a/.github/workflows/ci-noop.yml b/.github/workflows/ci-noop.yml index d046686002..12aafe18ee 100644 --- a/.github/workflows/ci-noop.yml +++ b/.github/workflows/ci-noop.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: - node-version: [20.x, 22.x] + node-version: [22.x, 24.x] name: Verify ${{ matrix.node-version }} steps: @@ -35,12 +35,12 @@ jobs: strategy: matrix: - node-version: [20.x, 22.x] + node-version: [22.x, 24.x] name: Test ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ee89b62e2..36b4114efe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [20.x, 22.x] + node-version: [22.x, 24.x] env: CI: true @@ -28,11 +28,11 @@ jobs: name: Install ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: use node.js ${{ matrix.node-version }} uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 @@ -55,7 +55,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [20.x, 22.x] + node-version: [22.x, 24.x] env: CI: true @@ -64,11 +64,11 @@ jobs: name: Verify ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: use node.js ${{ matrix.node-version }} uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 @@ -154,7 +154,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [20.x, 22.x] + node-version: [22.x, 24.x] name: Test ${{ matrix.node-version }} services: @@ -203,14 +203,14 @@ jobs: env: CI: true - NODE_OPTIONS: --max-old-space-size=8192 --no-node-snapshot --experimental-vm-modules + NODE_OPTIONS: --max-old-space-size=8192 --experimental-vm-modules INTEGRATION_TEST_GITHUB_TOKEN: ${{ secrets.INTEGRATION_TEST_GITHUB_TOKEN }} INTEGRATION_TEST_GITLAB_TOKEN: ${{ secrets.INTEGRATION_TEST_GITLAB_TOKEN }} INTEGRATION_TEST_BITBUCKET_TOKEN: ${{ secrets.INTEGRATION_TEST_BITBUCKET_TOKEN }} INTEGRATION_TEST_AZURE_TOKEN: ${{ secrets.INTEGRATION_TEST_AZURE_TOKEN }} steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: fetch master branch run: git fetch origin master diff --git a/.github/workflows/cleanup_patch-files.yml b/.github/workflows/cleanup_patch-files.yml index 895049cde9..3dc0e27837 100644 --- a/.github/workflows/cleanup_patch-files.yml +++ b/.github/workflows/cleanup_patch-files.yml @@ -17,12 +17,12 @@ jobs: contents: write steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: fetch-depth: 0 token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }} @@ -34,7 +34,7 @@ jobs: - name: Extract PR numbers from commit messages id: extract-pr-numbers - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: github-token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }} script: | @@ -89,14 +89,14 @@ jobs: - name: Checkout master if: steps.extract-pr-numbers.outputs.has_pr_numbers == 'true' - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: master token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }} - name: Delete patch files if: steps.extract-pr-numbers.outputs.has_pr_numbers == 'true' - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: PR_NUMBERS: ${{ steps.extract-pr-numbers.outputs.pr_numbers }} REF_NAME: ${{ github.ref_name }} diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index bb759971b7..b695c88c90 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -10,7 +10,7 @@ jobs: timeout-minutes: 10 steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit diff --git a/.github/workflows/deploy_docker-image.yml b/.github/workflows/deploy_docker-image.yml index 0fac3ec0da..0cf49b4b8a 100644 --- a/.github/workflows/deploy_docker-image.yml +++ b/.github/workflows/deploy_docker-image.yml @@ -16,16 +16,16 @@ jobs: strategy: fail-fast: false matrix: - node-version: [20.x] + node-version: [22.x] steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: path: backstage ref: ${{ github.event.client_payload.version && env.RELEASE_VERSION || github.ref }} @@ -52,7 +52,7 @@ jobs: working-directory: ./example-app - name: Login to GitHub Container Registry - uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 + uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 with: registry: ghcr.io username: ${{ github.actor }} diff --git a/.github/workflows/deploy_microsite.yml b/.github/workflows/deploy_microsite.yml index da02ae7ee2..e799bcae00 100644 --- a/.github/workflows/deploy_microsite.yml +++ b/.github/workflows/deploy_microsite.yml @@ -23,12 +23,12 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: find latest release - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 id: find-release with: script: | @@ -54,20 +54,20 @@ jobs: result-encoding: string - name: checkout latest release - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: refs/tags/${{ steps.find-release.outputs.result }} - - name: Use Node.js 20.x + - name: Use Node.js 22.x uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 20.x + node-version: 22.x registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17 with: - cache-prefix: ${{ runner.os }}-v20.x + cache-prefix: ${{ runner.os }}-v22.x - name: build API reference run: yarn build:api-docs @@ -135,23 +135,23 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: checkout master - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - name: Use Node.js 20.x + - name: Use Node.js 22.x uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 20.x + node-version: 22.x registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17 with: - cache-prefix: ${{ runner.os }}-v20.x + cache-prefix: ${{ runner.os }}-v22.x - name: build API reference run: yarn build:api-docs @@ -240,19 +240,19 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - name: Use Node.js 20.x + - name: Use Node.js 22.x uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 20.x + node-version: 22.x registry-url: https://registry.npmjs.org/ # Needed for auth # Stable docs - name: checkout latest release - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: refs/tags/${{ needs.stable.outputs.release }} @@ -286,7 +286,7 @@ jobs: # Next docs - name: checkout master - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: clean: false diff --git a/.github/workflows/deploy_packages.yml b/.github/workflows/deploy_packages.yml index d70761066f..b8bc3fd120 100644 --- a/.github/workflows/deploy_packages.yml +++ b/.github/workflows/deploy_packages.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [20.x, 22.x] + node-version: [22.x, 24.x] services: postgres18: @@ -68,7 +68,7 @@ jobs: INTEGRATION_TEST_AZURE_TOKEN: ${{ secrets.INTEGRATION_TEST_AZURE_TOKEN }} steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: use node.js ${{ matrix.node-version }} uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 @@ -147,11 +147,11 @@ jobs: strategy: matrix: - node-version: [20.x] + node-version: [22.x] steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit diff --git a/.github/workflows/issue.yaml b/.github/workflows/issue.yaml index 2eefcfcd88..470ba954c1 100644 --- a/.github/workflows/issue.yaml +++ b/.github/workflows/issue.yaml @@ -16,13 +16,13 @@ jobs: if: github.repository == 'backstage/backstage' steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit # We need to checkout the `.github/ISSUE_TEMPLATE` for the advanced labeler action to be able to read the templates # While at it we might as well checkout all of `.github` so that the labeling actions don't need to fetch their configs - - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 with: sparse-checkout: .github @@ -38,7 +38,7 @@ jobs: # These two steps add labels based on user input in the issue form - name: Parse issue form - uses: stefanbuck/github-issue-parser@2ea9b35a8c584529ed00891a8f7e41dc46d0441e # v3 + uses: stefanbuck/github-issue-parser@25f1485edffc1fee3ea68eb9f59a72e58720ffc4 # v3 id: issue-parser with: template-path: .github/ISSUE_TEMPLATE/.common.yaml diff --git a/.github/workflows/mui-migration-tracker.yml b/.github/workflows/mui-migration-tracker.yml index 8c91e0e8a0..7ed8013a3b 100644 --- a/.github/workflows/mui-migration-tracker.yml +++ b/.github/workflows/mui-migration-tracker.yml @@ -18,23 +18,23 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - name: Setup Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 20.x + node-version: 22.x registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17 with: - cache-prefix: ${{ runner.os }}-v20.x + cache-prefix: ${{ runner.os }}-v22.x - name: Run migration analysis id: analysis @@ -48,7 +48,7 @@ jobs: echo "EOF" >> $GITHUB_ENV - name: Update GitHub Issue - uses: actions/github-script@v7 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | @@ -62,7 +62,7 @@ jobs: issue_number: issueNumber, body: reportBody }); - + console.log(`✅ Successfully updated issue #${issueNumber}`); } catch (error) { console.error(`❌ Error updating issue: ${error.message}`); diff --git a/.github/workflows/pr-review-comment-trigger.yaml b/.github/workflows/pr-review-comment-trigger.yaml index 968bc4ab12..95c9c921f5 100644 --- a/.github/workflows/pr-review-comment-trigger.yaml +++ b/.github/workflows/pr-review-comment-trigger.yaml @@ -20,7 +20,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit diff --git a/.github/workflows/pr-review-comment.yaml b/.github/workflows/pr-review-comment.yaml index 122eb4fcce..bb7bd26c53 100644 --- a/.github/workflows/pr-review-comment.yaml +++ b/.github/workflows/pr-review-comment.yaml @@ -17,13 +17,13 @@ jobs: steps: # Inspired by https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: Read PR Number id: pr-number - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 4067326890..36988f7d07 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -18,7 +18,7 @@ jobs: if: github.repository == 'backstage/backstage' && ( github.event.pull_request || github.event.issue.pull_request ) steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 6ff05611ee..96cb3368be 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -29,12 +29,12 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: 'Checkout code' - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: 'Upload to code-scanning' - uses: github/codeql-action/upload-sarif@a4e1a019f5e24960714ff6296aee04b736cbc3cf # v3.29.6 + uses: github/codeql-action/upload-sarif@497990dfed22177a82ba1bbab381bc8f6d27058f # v3.31.6 with: sarif_file: results.sarif diff --git a/.github/workflows/sync_canon.yml b/.github/workflows/sync_canon.yml index 712b58c19f..9da6c80b98 100644 --- a/.github/workflows/sync_canon.yml +++ b/.github/workflows/sync_canon.yml @@ -8,26 +8,26 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - name: Use Node.js 20.x + - name: Use Node.js 22.x uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 20.x + node-version: 22.x registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17 with: - cache-prefix: ${{ runner.os }}-v20.x + cache-prefix: ${{ runner.os }}-v22.x - name: Checkout backstage/docs-ui - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: repository: backstage/docs-ui path: bui-external-docs diff --git a/.github/workflows/sync_code-formatting.yml b/.github/workflows/sync_code-formatting.yml index f91d354662..9719a34886 100644 --- a/.github/workflows/sync_code-formatting.yml +++ b/.github/workflows/sync_code-formatting.yml @@ -10,11 +10,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: # Fetch changes to previous commit - required for 'only_changed' in Prettier action fetch-depth: 0 diff --git a/.github/workflows/sync_dependabot-changesets.yml b/.github/workflows/sync_dependabot-changesets.yml index 59eb674ab2..9e894631cc 100644 --- a/.github/workflows/sync_dependabot-changesets.yml +++ b/.github/workflows/sync_dependabot-changesets.yml @@ -11,12 +11,12 @@ jobs: if: github.actor == 'dependabot[bot]' && github.repository == 'backstage/backstage' steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: fetch-depth: 2 ref: ${{ github.head_ref }} @@ -26,7 +26,7 @@ jobs: git config --global user.email noreply@backstage.io git config --global user.name 'Github changeset workflow' - name: Generate changeset - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: | const { promises: fs } = require('fs'); diff --git a/.github/workflows/sync_patch-release.yml b/.github/workflows/sync_patch-release.yml index 1db492777e..e17a229256 100644 --- a/.github/workflows/sync_patch-release.yml +++ b/.github/workflows/sync_patch-release.yml @@ -25,12 +25,12 @@ jobs: pull-requests: write steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: fetch-depth: 20000 fetch-tags: true @@ -55,7 +55,7 @@ jobs: - name: Find existing PR id: find-pr if: steps.check-patches.outputs.has_patches == 'true' - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: github-token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }} script: | @@ -82,7 +82,7 @@ jobs: - name: Close PR and delete branch if no patches if: steps.check-patches.outputs.has_patches == 'false' - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: github-token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }} script: | @@ -131,7 +131,7 @@ jobs: - name: Read patch files for PR metadata if: steps.check-patches.outputs.has_patches == 'true' id: read-patches - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: github-token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }} script: | @@ -203,7 +203,7 @@ jobs: - name: Create or update PR if: steps.check-patches.outputs.has_patches == 'true' - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: PR_EXISTS: ${{ steps.find-pr.outputs.pr_exists }} PR_NUMBER: ${{ steps.find-pr.outputs.pr_number }} diff --git a/.github/workflows/sync_release-manifest.yml b/.github/workflows/sync_release-manifest.yml index e4713dabbe..7452505a22 100644 --- a/.github/workflows/sync_release-manifest.yml +++ b/.github/workflows/sync_release-manifest.yml @@ -8,26 +8,26 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: # 'v' prefix is added here for the tag, we keep it out of the manifest logic ref: v${{ github.event.client_payload.version }} - - name: Use Node.js 20.x + - name: Use Node.js 22.x uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 20.x + node-version: 22.x registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17 with: - cache-prefix: ${{ runner.os }}-v20.x + cache-prefix: ${{ runner.os }}-v22.x - name: Build yarn plugin working-directory: packages/yarn-plugin @@ -35,7 +35,7 @@ jobs: # Checkout backstage/versions into /backstage/versions, which is where store the output - name: Checkout versions - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: repository: backstage/versions path: versions @@ -71,7 +71,7 @@ jobs: git push - name: Dispatch update-helper update - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: github-token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }} # TODO(Rugvip): Remove the create-app dispatch once we've been on the release version for a while diff --git a/.github/workflows/sync_renovate-changesets.yml b/.github/workflows/sync_renovate-changesets.yml index f456fdf4e1..07f2e24697 100644 --- a/.github/workflows/sync_renovate-changesets.yml +++ b/.github/workflows/sync_renovate-changesets.yml @@ -11,12 +11,12 @@ jobs: if: github.actor == 'renovate[bot]' && github.repository == 'backstage/backstage' steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: fetch-depth: 2 ref: ${{ github.head_ref }} @@ -26,7 +26,7 @@ jobs: git config --global user.email noreply@backstage.io git config --global user.name 'Github changeset workflow' - name: Generate changeset - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: | const { promises: fs } = require("fs"); diff --git a/.github/workflows/sync_snyk-github-issues.yml b/.github/workflows/sync_snyk-github-issues.yml index 9335d4e1e1..97f7e8ed14 100644 --- a/.github/workflows/sync_snyk-github-issues.yml +++ b/.github/workflows/sync_snyk-github-issues.yml @@ -12,21 +12,21 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - name: Use Node.js 20.x + - name: Use Node.js 22.x uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 20.x + node-version: 22.x registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17 with: - cache-prefix: ${{ runner.os }}-v20.x + cache-prefix: ${{ runner.os }}-v22.x - name: Create Snyk report uses: snyk/actions/node@9adf32b1121593767fc3c057af55b55db032dc04 # master diff --git a/.github/workflows/sync_snyk-monitor.yml b/.github/workflows/sync_snyk-monitor.yml index ab937ecf8b..8b76338645 100644 --- a/.github/workflows/sync_snyk-monitor.yml +++ b/.github/workflows/sync_snyk-monitor.yml @@ -25,11 +25,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Monitor and Synchronize Snyk Policies uses: snyk/actions/node@9adf32b1121593767fc3c057af55b55db032dc04 # master with: @@ -58,6 +58,6 @@ jobs: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} NODE_OPTIONS: --max-old-space-size=7168 - name: Upload Snyk report - uses: github/codeql-action/upload-sarif@a4e1a019f5e24960714ff6296aee04b736cbc3cf # v3.29.6 + uses: github/codeql-action/upload-sarif@497990dfed22177a82ba1bbab381bc8f6d27058f # v3.31.6 with: sarif_file: snyk.sarif diff --git a/.github/workflows/sync_version-packages.yml b/.github/workflows/sync_version-packages.yml index 19e7b28989..683d527e45 100644 --- a/.github/workflows/sync_version-packages.yml +++ b/.github/workflows/sync_version-packages.yml @@ -12,20 +12,28 @@ jobs: create-release-pr: name: Create Changeset PR runs-on: ubuntu-latest + steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: fetch-depth: 20000 fetch-tags: true token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }} + - name: Use Node.js 22.x + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: 22.x + registry-url: https://registry.npmjs.org/ # Needed for auth + - name: Install Dependencies run: yarn --immutable + - name: Create Release Pull Request uses: backstage/changesets-action@a39baf18913e669734ffb00c2fd9900472cfa240 # v2.3.2 with: diff --git a/.github/workflows/verify_accessibility-noop.yml b/.github/workflows/verify_accessibility-noop.yml index abb3abc665..ee696ebc7f 100644 --- a/.github/workflows/verify_accessibility-noop.yml +++ b/.github/workflows/verify_accessibility-noop.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit diff --git a/.github/workflows/verify_accessibility.yml b/.github/workflows/verify_accessibility.yml index 35f9a702f4..82d26ca510 100644 --- a/.github/workflows/verify_accessibility.yml +++ b/.github/workflows/verify_accessibility.yml @@ -20,19 +20,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Use Node.js 20.x + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - name: Use Node.js 22.x uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 20.x + node-version: 22.x - name: yarn install uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17 with: - cache-prefix: ${{ runner.os }}-v20.x + cache-prefix: ${{ runner.os }}-v22.x - name: run Lighthouse CI run: | yarn dlx @lhci/cli@0.11.x autorun diff --git a/.github/workflows/verify_chromatic-noop.yml b/.github/workflows/verify_chromatic-noop.yml index 2a2ad7d43d..35015def52 100644 --- a/.github/workflows/verify_chromatic-noop.yml +++ b/.github/workflows/verify_chromatic-noop.yml @@ -20,7 +20,7 @@ jobs: name: Chromatic steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit diff --git a/.github/workflows/verify_chromatic.yml b/.github/workflows/verify_chromatic.yml index f515bef08a..a9d83b01e3 100644 --- a/.github/workflows/verify_chromatic.yml +++ b/.github/workflows/verify_chromatic.yml @@ -19,17 +19,17 @@ jobs: strategy: matrix: os: [ubuntu-latest] - node-version: [20.x] + node-version: [22.x] name: Chromatic steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: Checkout code - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: fetch-depth: 10000 # Required to retrieve git history diff --git a/.github/workflows/verify_codeql.yml b/.github/workflows/verify_codeql.yml index a91dd7e2a7..d06c8ea270 100644 --- a/.github/workflows/verify_codeql.yml +++ b/.github/workflows/verify_codeql.yml @@ -42,12 +42,12 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: Checkout repository - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. @@ -55,7 +55,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@a4e1a019f5e24960714ff6296aee04b736cbc3cf # v3.29.6 + uses: github/codeql-action/init@497990dfed22177a82ba1bbab381bc8f6d27058f # v3.31.6 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -66,7 +66,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@a4e1a019f5e24960714ff6296aee04b736cbc3cf # v3.29.6 + uses: github/codeql-action/autobuild@497990dfed22177a82ba1bbab381bc8f6d27058f # v3.31.6 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -80,4 +80,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@a4e1a019f5e24960714ff6296aee04b736cbc3cf # v3.29.6 + uses: github/codeql-action/analyze@497990dfed22177a82ba1bbab381bc8f6d27058f # v3.31.6 diff --git a/.github/workflows/verify_docs-quality.yml b/.github/workflows/verify_docs-quality.yml index 877614e908..8810f05a16 100644 --- a/.github/workflows/verify_docs-quality.yml +++ b/.github/workflows/verify_docs-quality.yml @@ -12,11 +12,11 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 # Vale does not support file excludes, so we use the script to generate a list of files instead # The action also does not allow args or a local config file to be passed in, so the files array diff --git a/.github/workflows/verify_e2e-linux-noop.yml b/.github/workflows/verify_e2e-linux-noop.yml index cc25b2db58..152f4cc2c0 100644 --- a/.github/workflows/verify_e2e-linux-noop.yml +++ b/.github/workflows/verify_e2e-linux-noop.yml @@ -24,12 +24,12 @@ jobs: strategy: matrix: - node-version: [20.x, 22.x] + node-version: [22.x, 24.x] name: E2E Linux ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit diff --git a/.github/workflows/verify_e2e-linux.yml b/.github/workflows/verify_e2e-linux.yml index f0b324c96c..436995ddc2 100644 --- a/.github/workflows/verify_e2e-linux.yml +++ b/.github/workflows/verify_e2e-linux.yml @@ -34,7 +34,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [20.x, 22.x] + node-version: [22.x, 24.x] env: CI: true @@ -43,11 +43,11 @@ jobs: name: E2E Linux ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Configure Git run: | diff --git a/.github/workflows/verify_e2e-techdocs.yml b/.github/workflows/verify_e2e-techdocs.yml index 3698bddcc3..07c751e098 100644 --- a/.github/workflows/verify_e2e-techdocs.yml +++ b/.github/workflows/verify_e2e-techdocs.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: - node-version: [20.x, 22.x] + node-version: [22.x, 24.x] env: CI: true @@ -32,11 +32,11 @@ jobs: name: Techdocs steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: '3.9' diff --git a/.github/workflows/verify_e2e-windows-noop.yml b/.github/workflows/verify_e2e-windows-noop.yml index f8681e8b10..f04748a950 100644 --- a/.github/workflows/verify_e2e-windows-noop.yml +++ b/.github/workflows/verify_e2e-windows-noop.yml @@ -20,12 +20,12 @@ jobs: strategy: matrix: - node-version: [20.x, 22.x] + node-version: [22.x, 24.x] name: E2E Windows ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit diff --git a/.github/workflows/verify_e2e-windows.yml b/.github/workflows/verify_e2e-windows.yml index 356555bbd5..f63eb5d61b 100644 --- a/.github/workflows/verify_e2e-windows.yml +++ b/.github/workflows/verify_e2e-windows.yml @@ -24,16 +24,16 @@ jobs: strategy: matrix: - node-version: [20.x, 22.x] + node-version: [22.x, 24.x] env: CI: true - NODE_OPTIONS: --max-old-space-size=8192 --no-node-snapshot --experimental-vm-modules + NODE_OPTIONS: --max-old-space-size=8192 --experimental-vm-modules name: E2E Windows ${{ matrix.node-version }} steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit @@ -44,7 +44,7 @@ jobs: git config --global core.autocrlf false git config --global core.eol lf - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Configure Git run: | diff --git a/.github/workflows/verify_fossa.yml b/.github/workflows/verify_fossa.yml index ee6b1681a4..681ac2c07a 100644 --- a/.github/workflows/verify_fossa.yml +++ b/.github/workflows/verify_fossa.yml @@ -14,12 +14,12 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Install Fossa run: "curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | bash" diff --git a/.github/workflows/verify_microsite-noop.yml b/.github/workflows/verify_microsite-noop.yml index a6edeb8415..70686e3bd9 100644 --- a/.github/workflows/verify_microsite-noop.yml +++ b/.github/workflows/verify_microsite-noop.yml @@ -21,7 +21,7 @@ jobs: name: Microsite steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit diff --git a/.github/workflows/verify_microsite.yml b/.github/workflows/verify_microsite.yml index 44e7281938..20a6e705cd 100644 --- a/.github/workflows/verify_microsite.yml +++ b/.github/workflows/verify_microsite.yml @@ -28,12 +28,12 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: find latest release - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 id: find-release with: script: | @@ -59,20 +59,20 @@ jobs: result-encoding: string - name: checkout latest release - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: refs/tags/${{ steps.find-release.outputs.result }} - - name: Use Node.js 20.x + - name: Use Node.js 22.x uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 20.x + node-version: 22.x registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17 with: - cache-prefix: ${{ runner.os }}-v20.x + cache-prefix: ${{ runner.os }}-v22.x - name: build API reference run: yarn build:api-docs @@ -137,23 +137,23 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - name: checkout master - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - name: Use Node.js 20.x + - name: Use Node.js 22.x uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 20.x + node-version: 22.x registry-url: https://registry.npmjs.org/ # Needed for auth - name: yarn install uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17 with: - cache-prefix: ${{ runner.os }}-v20.x + cache-prefix: ${{ runner.os }}-v22.x - name: build API reference run: yarn build:api-docs @@ -234,16 +234,16 @@ jobs: name: Microsite steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - name: Use Node.js 20.x + - name: Use Node.js 22.x uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 20.x + node-version: 22.x - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 with: python-version: '3.9' @@ -295,7 +295,7 @@ jobs: run: yarn build:api-docs - name: checkout master - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: clean: false diff --git a/.github/workflows/verify_microsite_accessibility-noop.yml b/.github/workflows/verify_microsite_accessibility-noop.yml index f4263e1398..bb13a85dfa 100644 --- a/.github/workflows/verify_microsite_accessibility-noop.yml +++ b/.github/workflows/verify_microsite_accessibility-noop.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit diff --git a/.github/workflows/verify_microsite_accessibility.yml b/.github/workflows/verify_microsite_accessibility.yml index 7d4a0e8ef8..0c428ae359 100644 --- a/.github/workflows/verify_microsite_accessibility.yml +++ b/.github/workflows/verify_microsite_accessibility.yml @@ -15,16 +15,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - name: Use Node.js 20.x + - name: Use Node.js 22.x uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: 20.x + node-version: 22.x - name: top-level install run: yarn install --immutable diff --git a/.github/workflows/verify_windows.yml b/.github/workflows/verify_windows.yml index f15f2b30c7..f7de04772d 100644 --- a/.github/workflows/verify_windows.yml +++ b/.github/workflows/verify_windows.yml @@ -17,11 +17,11 @@ jobs: strategy: fail-fast: false matrix: - node-version: [20.x, 22.x] + node-version: [22.x, 24.x] env: CI: true - NODE_OPTIONS: --max-old-space-size=8192 --no-node-snapshot --experimental-vm-modules + NODE_OPTIONS: --max-old-space-size=8192 --experimental-vm-modules INTEGRATION_TEST_GITHUB_TOKEN: ${{ secrets.INTEGRATION_TEST_GITHUB_TOKEN }} INTEGRATION_TEST_GITLAB_TOKEN: ${{ secrets.INTEGRATION_TEST_GITLAB_TOKEN }} INTEGRATION_TEST_BITBUCKET_TOKEN: ${{ secrets.INTEGRATION_TEST_BITBUCKET_TOKEN }} @@ -29,11 +29,11 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 + uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3 with: egress-policy: audit - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: use node.js ${{ matrix.node-version }} uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 diff --git a/.github/workflows/welcome.yml b/.github/workflows/welcome.yml index 5d47ba77da..9061b70d79 100644 --- a/.github/workflows/welcome.yml +++ b/.github/workflows/welcome.yml @@ -15,7 +15,7 @@ jobs: if: github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' steps: - name: Add a welcome comment - uses: actions/github-script@v7 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | diff --git a/.patches/pr-31817.txt b/.patches/pr-31817.txt deleted file mode 100644 index 38665ea30a..0000000000 --- a/.patches/pr-31817.txt +++ /dev/null @@ -1 +0,0 @@ -Fixed an issue where the `useTable` hook from `@backstage/ui` did not use the provided `rowCount` \ No newline at end of file diff --git a/.patches/pr-31843.txt b/.patches/pr-31843.txt deleted file mode 100644 index effa6ccccd..0000000000 --- a/.patches/pr-31843.txt +++ /dev/null @@ -1 +0,0 @@ -Fix table row with `href` still being rendered with routing context in `@backstage/ui` \ No newline at end of file diff --git a/ADOPTERS.md b/ADOPTERS.md index 961d9d534e..2b3cad0b25 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -287,3 +287,4 @@ _You can do this by using the [Adopter form](https://info.backstage.spotify.com/ | [Syngenta Digital](https://www.syngentadigital.com) | [Bitan Mallick](https://www.linkedin.com/in/bitanmallick) | Internal developer portal, designed to empower developers and streamline workflows. We use software catalog, tech-radar, software templates, tech-docs and various custom plugins to ensure an efficient and collaborative development experience. | | [Sophotech](https://sopho.tech) | [@archy-rock3t-cloud](https://github.com/archy-rock3t-cloud), [Artem Muterko](mailto:artem@sopho.tech) | Custom Developer Platform based on Backstage, providing a service catalog, infrastructure templates, and integrated tooling to give developers a self-service experience. | | [Swiss Mobiliar Insurance Company Ltd.](https://www.mobiliar.ch/) | [Patrick Wyler](mailto:patrick.wyler@mobiliar.ch) and [Beat Winistörfer](mailto:beat.winistoerfer@mobiliar.ch) | The portal provides a unified interface for accessing all relevant DevOps information previously scattered across various locations, enhancing accessibility and clarity for all IT employees. It relies on an internal graph database that enhances the Backstage software catalog with many additional elements. Significant effort has been invested in the visual representation of information through graphs and diagrams, facilitating analysis and improving the understanding of dependencies. | +| [DB Systel GmbH](https://www.dbsystel.de/dbsystel-en/) | [DB Systel GmbH](https://github.com/dbsystel) | Deutsche Bahn's Internal Developer Portal leverages Backstage and Crossplane.io to deliver a fully GitOps-driven onboarding experience for engineering teams across the company. Our Scaffolder ecosystem accelerates platform setup (Artifactory, GitLab, OpenShift), service bootstrapping, automated testing, AI-ready backends, and modern frontend development. We also make heavy use of custom catalog modules and frontend plugins that support developers in checking their provisioned resources or security and compliance of their code. | diff --git a/OWNERS.md b/OWNERS.md index 44b4ebca15..764237d9c1 100644 --- a/OWNERS.md +++ b/OWNERS.md @@ -5,11 +5,13 @@ Team: @backstage/maintainers -| Maintainer | Organization | GitHub | Discord | -| --------------- | ------------ | ----------------------------------------------- | ------------- | -| Patrik Oldsberg | Spotify | [Rugvip](https://github.com/Rugvip) | `Rugvip#0019` | -| Fredrik Adelöw | Spotify | [freben](https://github.com/freben) | `freben#3926` | -| Ben Lambert | Spotify | [benjdlambert](https://github.com/benjdlambert) | `blam#2159` | +| Maintainer | Organization | GitHub | Discord | +| --------------- | ------------ | ----------------------------------------------------- | ------------- | +| André Wanlin | Spotify | [awanlin](https://github.com/awanlin) | `ahhhndre` | +| Aramis Sennyey | DoorDash | [aramissennyeydd](https://github.com/aramissennyeydd) | `Aramis#7984` | +| Ben Lambert | Spotify | [benjdlambert](https://github.com/benjdlambert) | `blam#2159` | +| Fredrik Adelöw | Spotify | [freben](https://github.com/freben) | `freben#3926` | +| Patrik Oldsberg | Spotify | [Rugvip](https://github.com/Rugvip) | `Rugvip#0019` | ## Project Areas @@ -78,7 +80,7 @@ Scope: The Backstage Documentation and Microsite, excluding the plugins listing | Name | Organization | GitHub | Discord | | --------------- | ------------- | ----------------------------------------------------- | ------------- | -| Andre Wanlin | Spotify | [awanlin](https://github.com/awanlin) | `ahhhndre` | +| André Wanlin | Spotify | [awanlin](https://github.com/awanlin) | `ahhhndre` | | Aramis Sennyey | DoorDash | [aramissennyeydd](https://github.com/aramissennyeydd) | `Aramis#7984` | | Peter Macdonald | VodafoneZiggo | [Parsifal-M](https://github.com/Parsifal-M) | `parsifal` | @@ -267,6 +269,7 @@ Scope: The Scaffolder frontend and backend plugins, and related tooling. | Niklas Gustavsson | Spotify | [protocol7](https://github.com/protocol7) | | | Dave Zolotusky | Spotify | [dzolotusky](https://github.com/dzolotusky) | | | Pia Nilsson | Spotify | [pianilsson](https://github.com/pianilsson) | | +| Stefan Särne | Spotify | [ssarne](https://github.com/ssarne) | | ## Organization Members @@ -274,9 +277,7 @@ Scope: The Scaffolder frontend and backend plugins, and related tooling. | ------------------------------ | ------------------------- | ----------------------------------------------------- | ------------------------------ | | Adam Harvey | Okta | [adamdmharvey](https://github.com/adamdmharvey) | `adamharvey_` | | Alex Crome | | [afscrome](https://github.com/afscrome) | `afscrome` | -| Andre Wanlin | Spotify | [awanlin](https://github.com/awanlin) | `ahhhndre` | | Andrew Thauer | Wealthsimple | [andrewthauer](https://github.com/andrewthauer) | `andrewthauer#3060` | -| Aramis Sennyey | DoorDash | [aramissennyeydd](https://github.com/aramissennyeydd) | `Aramis#7984` | | Brian Fletcher | Roadie.io | [punkle](https://github.com/punkle) | `Brian Fletcher#7051` | | Carlos Esteban Lopez Jaramillo | VMWare | [luchillo17](https://github.com/luchillo17) | `luchillo17#8777` | | David Tuite | Roadie.io | [dtuite](https://github.com/dtuite) | `David Tuite (roadie.io)#1010` | diff --git a/README.md b/README.md index 545874adf9..e3e9bd77dd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,3 @@ -> [!NOTE] -> ✈️ From Monday November 10th through November 14rd, several maintainers and Spotify employees will be at KubeCon / BackstageCon! Expect the project to move a little slower than normal, and support to be limited. Normal service will resume after that! And do come visit our booth if you are there. ✈️ - [![headline](docs/assets/headline.png)](https://backstage.io/) # [Backstage](https://backstage.io) diff --git a/app-config.yaml b/app-config.yaml index c1a894dcc7..08c97c1172 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -311,3 +311,8 @@ auth: permission: enabled: true + +devTools: + scheduledTasks: + plugins: + - catalog diff --git a/contrib/catalog/ImmediateEntityProvider.ts b/contrib/catalog/ImmediateEntityProvider.ts index b5580b775a..9f9f986567 100644 --- a/contrib/catalog/ImmediateEntityProvider.ts +++ b/contrib/catalog/ImmediateEntityProvider.ts @@ -1,3 +1,8 @@ +import { + coreServices, + createBackendModule, + LoggerService, +} from '@backstage/backend-plugin-api'; import { ANNOTATION_LOCATION, ANNOTATION_ORIGIN_LOCATION, @@ -10,50 +15,18 @@ import { EntityProvider, EntityProviderConnection, } from '@backstage/plugin-catalog-node'; -import { parseEntityYaml } from '@backstage/plugin-catalog-backend'; +import { parseEntityYaml } from '@backstage/plugin-catalog-node'; +import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; import bodyParser from 'body-parser'; import express from 'express'; import Router from 'express-promise-router'; import lodash from 'lodash'; -import { Logger } from 'winston'; /** * An entity provider attached to a router, that lets users perform direct * manipulation of a set of entities using REST requests. - * - * @remarks - * - * Installation: - * - * Add it to the catalog builder in your - * `packages/backend/src/plugins/catalog.ts`. Note that it BOTH adds a provider - * and amends the catalog router: - * - * ``` - * const immediate = new ImmediateEntityProvider({ - * logger: env.logger, - * handleEntity: (deferred) => { - * // Optionally modify the incoming entity - * }, - * }); - * builder.addEntityProvider(immediate); - * - * // ... - * - * return router.use('/immediate', immediate.getRouter()); - * ``` - * - * API (assume a catalog prefix, e.g. `/api/catalog`): - * - * - `POST /immediate/entities`: Accepts a YAML document of entities, and - * inserts or updates the entities that match that document. Returns 201 OK on - * success. - * - * - `PUT /immediate/entities`: Accepts a YAML document of entities, and - * replaces the entire set of entities managed by the provider with those - * entities. Returns 201 OK on success. */ -export class ImmediateEntityProvider implements EntityProvider { +class ImmediateEntityProvider implements EntityProvider { private connection?: EntityProviderConnection; private readonly entityValidator: (data: unknown) => Entity; @@ -76,7 +49,7 @@ export class ImmediateEntityProvider implements EntityProvider { router.use(bodyParser.raw({ type: '*/*' })); - router.post('/entities', async (req, res) => { + router.post('/immediate/entities', async (req, res) => { if (!this.connection) { throw new Error(`Service is not yet initialized`); } @@ -89,7 +62,7 @@ export class ImmediateEntityProvider implements EntityProvider { res.status(201).end(); }); - router.put('/entities', async (req, res) => { + router.put('/immediate/entities', async (req, res) => { if (!this.connection) { throw new Error(`Service is not yet initialized`); } @@ -151,19 +124,59 @@ export class ImmediateEntityProvider implements EntityProvider { /** * Options for {@link ImmediateEntityProvider}. */ -export interface ImmediateEntityProviderOptions { +interface ImmediateEntityProviderOptions { /** - * The logger to use. + * The logger. */ - logger: Logger; + logger: LoggerService; /** - * An optional function to perform adjustments to, or validate, an incoming - * entity before being stored. It is permitted to modify the deferred entity, - * but the request is static and has had its body consumed. + * An optional callback function to perform adjustments to, or validate, an + * incoming entity before being stored. It is permitted to modify the deferred + * entity, but the request is static and has had its body consumed. */ handleEntity?: ( request: express.Request, deferred: DeferredEntity, ) => void | Promise; } + +/** + * Backend module that installs an immediate entity provider. + * + * @remarks + * + * Install it by doing `backend.add(immediateEntityProviderModule)` in your `packages/backend/src/index.ts` file. + * + * API: + * + * - `POST /api/catalog/immediate/entities`: Accepts a YAML document of entities, and + * inserts or updates the entities that match that document. Returns 201 OK on + * success. + * + * - `PUT /api/catalog/immediate/entities`: Accepts a YAML document of entities, and + * replaces the entire set of entities managed by the provider with those + * entities. Returns 201 OK on success. + */ +export const immediateEntityProviderModule = createBackendModule({ + pluginId: 'catalog', + moduleId: 'immediate-entity-provider', + register(env) { + env.registerInit({ + deps: { + logger: coreServices.logger, + router: coreServices.httpRouter, + catalogProcessing: catalogProcessingExtensionPoint, + }, + async init({ logger, router, catalogProcessing }) { + const provider = new ImmediateEntityProvider({ + logger, + // add handleEntity here if you need to modify incoming entities before they are stored + }); + + catalogProcessing.addEntityProvider(provider); + router.use(provider.getRouter()); + }, + }); + }, +}); diff --git a/docker-compose.deps.yml b/docker-compose.deps.yml index 2ad65d6085..fa7937fdf1 100644 --- a/docker-compose.deps.yml +++ b/docker-compose.deps.yml @@ -2,7 +2,7 @@ name: backstage services: psql: - image: postgres:17.6 + image: postgres:17.7 environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres diff --git a/docs-ui/package.json b/docs-ui/package.json index 319c0e130f..d6dcb4830a 100644 --- a/docs-ui/package.json +++ b/docs-ui/package.json @@ -24,7 +24,7 @@ "@lezer/highlight": "^1.2.1", "@mdx-js/loader": "^3.1.0", "@mdx-js/react": "^3.1.0", - "@next/mdx": "15.3.4", + "@next/mdx": "15.5.7", "@remixicon/react": "^4.6.0", "@storybook/react": "^8.6.12", "@uiw/codemirror-themes": "^4.23.7", @@ -32,7 +32,7 @@ "clsx": "^2.1.1", "html-react-parser": "^5.2.5", "motion": "^12.4.1", - "next": "15.4.7", + "next": "15.5.9", "next-mdx-remote-client": "^2.1.2", "prop-types": "^15.8.1", "react": "19.1.1", @@ -44,12 +44,12 @@ "@octokit/rest": "^22.0.1", "@shikijs/transformers": "^3.13.0", "@types/mdx": "^2.0.13", - "@types/node": "^20", + "@types/node": "^22.13.14", "@types/react": "19.1.9", "@types/react-dom": "19.1.7", "chokidar": "^3.6.0", "eslint": "^8", - "eslint-config-next": "15.3.4", + "eslint-config-next": "15.5.7", "lightningcss": "^1.28.2", "typescript": "^5", "unified": "^11.0.4" diff --git a/docs-ui/src/content/table.mdx b/docs-ui/src/content/table.mdx index d1a190e9dd..00b7290532 100644 --- a/docs-ui/src/content/table.mdx +++ b/docs-ui/src/content/table.mdx @@ -13,7 +13,9 @@ import { tableHybridSnippet, tableCellInteractionsSnippet, tablePaginationSnippet, - tableSelectionSnippet, + tableSelectionActionsSnippet, + tableSelectionModeSnippet, + tableSelectionBehaviorSnippet, tableSortingSnippet, columnPropDefs, rowPropDefs, @@ -91,7 +93,36 @@ Coming soon. ### Row selection -Coming soon. +Tables support row selection with two configuration options: selection mode and selection behavior. + +#### Selection mode + +Use `selectionMode` to control how many rows can be selected. With `single`, only one row can be selected at a time. With `multiple`, any number of rows can be selected, and a header checkbox provides select-all functionality. + +} + code={tableSelectionModeSnippet} +/> + +#### Selection behavior + +Use `selectionBehavior` to control how selection is indicated and interacted with. With `toggle`, checkboxes appear for selection. With `replace`, selection is indicated by row background color—click to select, Cmd/Ctrl+click for multiple. + +} + code={tableSelectionBehaviorSnippet} +/> + +#### With row actions + +With toggle behavior, clicking a row triggers its action when nothing is selected. Once any row is selected, clicking toggles selection instead. + +With replace behavior, clicking selects the row and double-clicking triggers the action. + +} + code={tableSelectionActionsSnippet} +/> ### Row Clicks diff --git a/docs-ui/src/content/table.props.ts b/docs-ui/src/content/table.props.ts index 443526182e..21bd5597c6 100644 --- a/docs-ui/src/content/table.props.ts +++ b/docs-ui/src/content/table.props.ts @@ -267,7 +267,7 @@ export const tablePaginationPropDefs: Record = { ...stylePropDefs, }; -export const tableUsageSnippet = `import { Cell, ..., TableHeader, TablePagination } from '@backstage/ui'; +export const tableUsageSnippet = `import { Cell, CellText, ..., TableHeader, TablePagination } from '@backstage/ui'; @@ -275,14 +275,14 @@ export const tableUsageSnippet = `import { Cell, ..., TableHeader, TablePaginati - +
`; -export const tableBasicSnippet = `import { Table, TableHeader, Column, TableBody, Row, Cell, CellProfile, TablePagination, useTable } from '@backstage/ui'; +export const tableBasicSnippet = `import { Table, TableHeader, Column, TableBody, Row, CellText, CellProfile, TablePagination, useTable } from '@backstage/ui'; const data = [ { @@ -318,11 +318,60 @@ const { data: paginatedData, paginationProps } = useTable({ src={item.image} href={item.website} /> - - - + + + ))} `; + +export const tableSelectionActionsSnippet = `import { Table, TableHeader, TableBody, Column, Row, CellText } from '@backstage/ui'; + +function MyTable() { + const [selectedKeys, setSelectedKeys] = React.useState(new Set([])); + + return ( + console.log('Opening', key)} + > + + Name + Status + + + + + + + + + + + +
+ ); +}`; + +export const tableSelectionModeSnippet = ` + {/* ... */} +
`; + +export const tableSelectionBehaviorSnippet = ` + {/* ... */} +
`; diff --git a/docs-ui/src/utils/changelog.ts b/docs-ui/src/utils/changelog.ts index 1179d7e189..0c3286d051 100644 --- a/docs-ui/src/utils/changelog.ts +++ b/docs-ui/src/utils/changelog.ts @@ -1,4 +1,5 @@ export * from './types'; +import { changelog_0_9_0 } from './changelogs/v0.9.0'; import { changelog_0_8_2 } from './changelogs/v0.8.2'; import { changelog_0_8_0 } from './changelogs/v0.8.0'; import { changelog_0_7_2 } from './changelogs/v0.7.2'; @@ -14,6 +15,7 @@ import { changelog_0_2_0 } from './changelogs/v0.2.0'; import { changelog_0_1_0 } from './changelogs/v0.1.0'; export const changelog = [ + ...changelog_0_9_0, ...changelog_0_8_2, ...changelog_0_8_0, ...changelog_0_7_2, diff --git a/docs-ui/src/utils/changelogs/v0.9.0.ts b/docs-ui/src/utils/changelogs/v0.9.0.ts new file mode 100644 index 0000000000..f5546b7ba9 --- /dev/null +++ b/docs-ui/src/utils/changelogs/v0.9.0.ts @@ -0,0 +1,354 @@ +import type { ChangelogProps } from '../types'; + +export const changelog_0_9_0: ChangelogProps[] = [ + { + components: ['avatar'], + version: '0.9.0', + prs: ['31566'], + description: `**BREAKING**: Migrated Avatar component from Base UI to custom implementation with size changes: + + - Base UI-specific props are no longer supported + - Size values have been updated: + - New \`x-small\` size added (1.25rem / 20px) + - \`small\` size unchanged (1.5rem / 24px) + - \`medium\` size unchanged (2rem / 32px, default) + - \`large\` size **changed from 3rem to 2.5rem** (40px) + - New \`x-large\` size added (3rem / 48px) + + Migration: + + \`\`\`diff + # Remove Base UI-specific props + - + + + + # Update large size usage to x-large for same visual size + - + + + \`\`\` + + Added \`purpose\` prop for accessibility control (\`'informative'\` or \`'decoration'\`).`, + type: 'breaking', + commitSha: '539cf26', + }, + { + components: ['checkbox'], + version: '0.9.0', + prs: ['31517'], + description: `**BREAKING**: Migrated Checkbox component from Base UI to React Aria Components. + + API changes required: + + - \`checked\` → \`isSelected\` + - \`defaultChecked\` → \`defaultSelected\` + - \`disabled\` → \`isDisabled\` + - \`required\` → \`isRequired\` + - \`label\` prop removed - use \`children\` instead + - CSS: \`bui-CheckboxLabel\` class removed + - Data attribute: \`data-checked\` → \`data-selected\` + - Use without label is no longer supported + + Migration examples: + + Before: + + \`\`\`tsx + + \`\`\` + + After: + + \`\`\`tsx + + Accept terms + + \`\`\` + + Before: + + \`\`\`tsx + + \`\`\` + + After: + + \`\`\`tsx + Option + \`\`\` + + Before: + + \`\`\`tsx + + \`\`\` + + After: + + \`\`\`tsx + + Accessible label + + \`\`\``, + type: 'breaking', + commitSha: '5c614ff', + }, + { + components: ['searchfield', 'textfield'], + version: '0.9.0', + prs: ['31507'], + description: `Fixing styles on SearchField in Backstage UI after migration to CSS modules. \`SearchField\` has now its own set of class names. We previously used class names from \`TextField\` but this approach was creating some confusion so going forward in your theme you'll be able to theme \`TextField\` and \`SearchField\` separately.`, + type: 'breaking', + commitSha: '134151f', + }, + { + components: [], + version: '0.9.0', + prs: ['31744'], + description: `**BREAKING**: Removed central \`componentDefinitions\` object and related type utilities (\`ComponentDefinitionName\`, \`ComponentClassNames\`). + + Component definitions are primarily intended for documenting the CSS class API for theming purposes, not for programmatic use in JavaScript/TypeScript. + + **Migration Guide:** + + If you were using component definitions or class names to build custom components, we recommend migrating to either: + + - Use Backstage UI components directly as building blocks, or + - Duplicate the component CSS in your own stylesheets instead of relying on internal class names`, + type: 'breaking', + commitSha: 'a67670d', + }, + { + components: ['menu', 'switch', 'skeleton', 'header', 'tabs'], + version: '0.9.0', + prs: ['31496'], + description: `**BREAKING**: Changed className prop behavior to augment default styles instead of being ignored or overriding them. + + Affected components: + + - Menu, MenuListBox, MenuAutocomplete, MenuAutocompleteListbox, MenuItem, MenuListBoxItem, MenuSection, MenuSeparator + - Switch + - Skeleton + - FieldLabel + - Header, HeaderToolbar + - HeaderPage + - Tabs, TabList, Tab, TabPanel + + If you were passing custom className values to any of these components that relied on the previous behavior, you may need to adjust your styles to account for the default classes now being applied alongside your custom classes.`, + type: 'breaking', + commitSha: 'b78fc45', + }, + { + components: ['accordion'], + version: '0.9.0', + prs: ['31493'], + description: `**BREAKING**: Removed \`Collapsible\` component. Migrate to \`Accordion\` or use React Aria \`Disclosure\`. + + ## Migration Path 1: Accordion (Opinionated Styled Component) + + Accordion provides preset styling with a similar component structure. + + \`\`\`diff + - import { Collapsible } from '@backstage/ui'; + + import { Accordion, AccordionTrigger, AccordionPanel } from '@backstage/ui'; + + - + - } /> + - Content + - + + + + + + + Content + + + \`\`\` + + CSS classes: \`.bui-CollapsibleRoot\` → \`.bui-Accordion\`, \`.bui-CollapsibleTrigger\` → \`.bui-AccordionTrigger\` (now on heading element), \`.bui-CollapsiblePanel\` → \`.bui-AccordionPanel\` + + ## Migration Path 2: React Aria Disclosure (Full Customization) + + For custom styling without preset styles: + + \`\`\`tsx + import { Disclosure, Button, DisclosurePanel } from 'react-aria-components'; + + + + Content + ; + \`\`\``, + type: 'breaking', + commitSha: '83c100e', + }, + { + components: ['select'], + version: '0.9.0', + prs: ['31649'], + description: `**BREAKING**: The \`SelectProps\` interface now accepts a generic type parameter for selection mode. + + Added searchable and multiple selection support to Select component. The component now accepts \`searchable\`, \`selectionMode\`, and \`searchPlaceholder\` props to enable filtering and multi-selection modes. + + Migration: If you're using \`SelectProps\` type directly, update from \`SelectProps\` to \`SelectProps<'single' | 'multiple'>\`. Component usage remains backward compatible.`, + type: 'breaking', + commitSha: '816af0f', + }, + { + components: ['header'], + version: '0.9.0', + prs: ['31525'], + description: `Fix broken external links in Backstage UI Header component.`, + type: 'fix', + commitSha: 'd01de00', + }, + { + components: ['select'], + version: '0.9.0', + prs: ['31618'], + description: `Fixed CSS issues in Select component including popover width constraints, focus outline behavior, and overflow handling.`, + type: 'fix', + commitSha: '35a3614', + }, + { + components: ['password-field', 'searchfield', 'menu'], + version: '0.9.0', + prs: ['31679'], + description: `Improved visual consistency of PasswordField, SearchField, and MenuAutocomplete components.`, + type: 'fix', + commitSha: '01476f0', + }, + { + components: [], + version: '0.9.0', + prs: ['31429'], + description: `Fix default text color in Backstage UI`, + type: 'fix', + commitSha: '26c6a78', + }, + { + components: ['text'], + version: '0.9.0', + prs: ['31615'], + description: `Fixed Text component to prevent \`truncate\` prop from being spread to the underlying DOM element.`, + type: 'fix', + commitSha: 'deaa427', + }, + { + components: ['link'], + version: '0.9.0', + prs: ['31524'], + description: `Improved the Link component structure in Backstage UI.`, + type: 'fix', + commitSha: '1059f95', + }, + { + components: ['dialog'], + version: '0.9.0', + prs: ['31673'], + description: `Fixed dialog backdrop appearance in dark mode.`, + type: 'fix', + commitSha: '836b0c7', + }, + { + components: ['table', 'avatar'], + version: '0.9.0', + prs: ['31608'], + description: `Migrated CellProfile component from Base UI Avatar to Backstage UI Avatar component.`, + type: 'fix', + commitSha: '6874094', + }, + { + components: ['avatar'], + version: '0.9.0', + prs: ['31623'], + description: `Avatar components in x-small and small sizes now display only one initial instead of two, improving readability at smaller dimensions.`, + type: 'fix', + commitSha: '719d772', + }, + { + components: [], + version: '0.9.0', + prs: ['31672'], + description: `Removed \`@base-ui-components/react\` dependency as all components now use React Aria Components.`, + type: 'fix', + commitSha: '6d35a6b', + }, + { + components: [], + version: '0.9.0', + prs: ['31435'], + description: `Fix the default font size in Backstage UI.`, + type: 'fix', + commitSha: 'dac851f', + }, + { + components: [], + version: '0.9.0', + prs: ['31448'], + description: `Fix CSS layer ordering in Backstage UI to make sure component styles are loaded after tokens and base declarations.`, + type: 'fix', + commitSha: '3c0ea67', + }, + { + components: ['radiogroup'], + version: '0.9.0', + prs: ['31576'], + description: `Fixed RadioGroup radio button ellipse distortion by preventing flex shrink and grow.`, + type: 'fix', + commitSha: '3b18d80', + }, + { + components: [], + version: '0.9.0', + prs: ['31444'], + description: `Fix font smoothing as default in Backstage UI.`, + type: 'fix', + commitSha: '4eb455c', + }, + { + components: [], + version: '0.9.0', + prs: ['31516'], + description: `Enable tree-shaking of imports other than \`*.css\`.`, + type: 'fix', + commitSha: 'ff9f0c3', + }, + { + components: ['button', 'button-icon'], + version: '0.9.0', + prs: ['31681'], + description: `Added \`loading\` prop to Button and ButtonIcon components for displaying spinner during async operations.`, + type: 'new', + commitSha: '7839e7b', + }, + { + components: ['table'], + version: '0.9.0', + prs: ['31680'], + description: `Fixed Table Row component to properly support opening links in new tabs via right-click or Cmd+Click when using the \`href\` prop.`, + type: 'fix', + commitSha: 'a00fb88', + }, + { + components: [], + version: '0.9.0', + prs: ['31469'], + description: `Set the color-scheme property depending on theme`, + type: 'fix', + commitSha: 'e16ece5', + }, + { + components: ['visually-hidden'], + version: '0.9.0', + prs: ['31484'], + description: `Added new VisuallyHidden component for hiding content visually while keeping it accessible to screen readers.`, + type: 'new', + commitSha: '1ef3ca4', + }, + { + components: [], + version: '0.9.0', + prs: ['31432'], + description: `Fix default font wight and font family in Backstage UI.`, + type: 'fix', + commitSha: '00bfb83', + }, +]; diff --git a/docs-ui/yarn.lock b/docs-ui/yarn.lock index a9e9b97305..7d22bb8977 100644 --- a/docs-ui/yarn.lock +++ b/docs-ui/yarn.lock @@ -31,11 +31,11 @@ __metadata: linkType: hard "@base-ui-components/react@npm:^1.0.0-beta.4": - version: 1.0.0-beta.6 - resolution: "@base-ui-components/react@npm:1.0.0-beta.6" + version: 1.0.0-rc.0 + resolution: "@base-ui-components/react@npm:1.0.0-rc.0" dependencies: "@babel/runtime": "npm:^7.28.4" - "@base-ui-components/utils": "npm:0.2.0" + "@base-ui-components/utils": "npm:0.2.2" "@floating-ui/react-dom": "npm:^2.1.6" "@floating-ui/utils": "npm:^0.2.10" reselect: "npm:^5.1.1" @@ -48,13 +48,13 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 10/b3cfa5449f596c6cb509017a33c31fad531c10ee3dc70ee98ca5a48dfc02a8333012bd29df660833f98b73ee895f34ff51037eeef35b58111492d98454881eee + checksum: 10/ea22dd8206962a1b74fea30f4b20f8b5995bd20155466a5ee7fc7a59cc1632e2ba9615094eac9983dbf8387e50daa8b078024da85b3a8d60cdbc43fb1cfc3b50 languageName: node linkType: hard -"@base-ui-components/utils@npm:0.2.0": - version: 0.2.0 - resolution: "@base-ui-components/utils@npm:0.2.0" +"@base-ui-components/utils@npm:0.2.2": + version: 0.2.2 + resolution: "@base-ui-components/utils@npm:0.2.2" dependencies: "@babel/runtime": "npm:^7.28.4" "@floating-ui/utils": "npm:^0.2.10" @@ -67,7 +67,7 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 10/b5eae460e3f45fdb2c5116c94612c5b0c00190d4f0763836ba121e36e5c46c1caad862f4aa05827d90a8ebe924c29e42a7561c124de23ce3dc565dba2a6dff98 + checksum: 10/a67803b5637cfce1071963f958306f90784f7934ae0b072b450dbf7f2e3423ea9b40e420672849cfcf2965c94ac5960d2c6a5e04e359f1f76166b929dda932a2 languageName: node linkType: hard @@ -179,14 +179,14 @@ __metadata: linkType: hard "@codemirror/view@npm:^6.0.0, @codemirror/view@npm:^6.17.0, @codemirror/view@npm:^6.23.0, @codemirror/view@npm:^6.27.0, @codemirror/view@npm:^6.34.4, @codemirror/view@npm:^6.35.0": - version: 6.38.6 - resolution: "@codemirror/view@npm:6.38.6" + version: 6.38.8 + resolution: "@codemirror/view@npm:6.38.8" dependencies: "@codemirror/state": "npm:^6.5.0" crelt: "npm:^1.0.6" style-mod: "npm:^4.1.0" w3c-keyname: "npm:^2.2.4" - checksum: 10/5a047337a98de111817ce8c8d39e6429c90ca0b0a4d2678d6e161e9e5961b1d476a891f447ab7a05cac395d4a93530e7c68bedd93191285265f0742a308ad00b + checksum: 10/81b1508015a378e4719d0239254173f0c5cd340c2abf96eb488fe5fb474bdb37ec1f010b9890ced774accd7aeb9443e7337cb6a89544b954273e5ddabece7cea languageName: node linkType: hard @@ -854,25 +854,25 @@ __metadata: languageName: node linkType: hard -"@next/env@npm:15.4.7": - version: 15.4.7 - resolution: "@next/env@npm:15.4.7" - checksum: 10/8341fa6f1b5aebb6f99d8abad2f3ee2685281aaa51785f8ceff3c9a7f03186645f372003ee833715c0ce05e4e7d960defa4252018977f19564001b872b24714e +"@next/env@npm:15.5.9": + version: 15.5.9 + resolution: "@next/env@npm:15.5.9" + checksum: 10/962329701343c2617c85ae99ef35adfd9e8f7b58d9c0316f2f0857f82875a91ef3151ef0743c50964b0066aa3d1214c5193cf229f7757d7c9329f7fb95605a4a languageName: node linkType: hard -"@next/eslint-plugin-next@npm:15.3.4": - version: 15.3.4 - resolution: "@next/eslint-plugin-next@npm:15.3.4" +"@next/eslint-plugin-next@npm:15.5.7": + version: 15.5.7 + resolution: "@next/eslint-plugin-next@npm:15.5.7" dependencies: fast-glob: "npm:3.3.1" - checksum: 10/8a473bd32a06f62c16f60f9c40b7b8149cf91170ce4c1546cda57e9c85ac8481c7ad3aa4a77e8c3c7000e80d3de809d2db7df6cb79e13fd258fff382729abf60 + checksum: 10/5b59860aeccc0d07a979c40e4405b410a9d7aa86a235d5dc0edbac8d2da35586f6f2fa3407cd3d80fd7e7d4f197c70291e9c6e71a64942d09b8fe82470e90ee0 languageName: node linkType: hard -"@next/mdx@npm:15.3.4": - version: 15.3.4 - resolution: "@next/mdx@npm:15.3.4" +"@next/mdx@npm:15.5.7": + version: 15.5.7 + resolution: "@next/mdx@npm:15.5.7" dependencies: source-map: "npm:^0.7.0" peerDependencies: @@ -883,62 +883,62 @@ __metadata: optional: true "@mdx-js/react": optional: true - checksum: 10/07904beda049317e43857f9dfe659adb6e57c4417475de1d21a7605f8ace5d9aa992a06465d1a94fe4b62331901765b15659555e8aadedbd410f86df1bebd1bd + checksum: 10/caf2ad1e3a8b02381ad33fe32f59e2ef4c15c96a04ba2a7d713991c142214d3b69d25b879ffc12da1c333ffd34d30aec44061d740f708c8e12529b183a159146 languageName: node linkType: hard -"@next/swc-darwin-arm64@npm:15.4.7": - version: 15.4.7 - resolution: "@next/swc-darwin-arm64@npm:15.4.7" +"@next/swc-darwin-arm64@npm:15.5.7": + version: 15.5.7 + resolution: "@next/swc-darwin-arm64@npm:15.5.7" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@next/swc-darwin-x64@npm:15.4.7": - version: 15.4.7 - resolution: "@next/swc-darwin-x64@npm:15.4.7" +"@next/swc-darwin-x64@npm:15.5.7": + version: 15.5.7 + resolution: "@next/swc-darwin-x64@npm:15.5.7" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@next/swc-linux-arm64-gnu@npm:15.4.7": - version: 15.4.7 - resolution: "@next/swc-linux-arm64-gnu@npm:15.4.7" +"@next/swc-linux-arm64-gnu@npm:15.5.7": + version: 15.5.7 + resolution: "@next/swc-linux-arm64-gnu@npm:15.5.7" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-arm64-musl@npm:15.4.7": - version: 15.4.7 - resolution: "@next/swc-linux-arm64-musl@npm:15.4.7" +"@next/swc-linux-arm64-musl@npm:15.5.7": + version: 15.5.7 + resolution: "@next/swc-linux-arm64-musl@npm:15.5.7" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@next/swc-linux-x64-gnu@npm:15.4.7": - version: 15.4.7 - resolution: "@next/swc-linux-x64-gnu@npm:15.4.7" +"@next/swc-linux-x64-gnu@npm:15.5.7": + version: 15.5.7 + resolution: "@next/swc-linux-x64-gnu@npm:15.5.7" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-x64-musl@npm:15.4.7": - version: 15.4.7 - resolution: "@next/swc-linux-x64-musl@npm:15.4.7" +"@next/swc-linux-x64-musl@npm:15.5.7": + version: 15.5.7 + resolution: "@next/swc-linux-x64-musl@npm:15.5.7" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@next/swc-win32-arm64-msvc@npm:15.4.7": - version: 15.4.7 - resolution: "@next/swc-win32-arm64-msvc@npm:15.4.7" +"@next/swc-win32-arm64-msvc@npm:15.5.7": + version: 15.5.7 + resolution: "@next/swc-win32-arm64-msvc@npm:15.5.7" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@next/swc-win32-x64-msvc@npm:15.4.7": - version: 15.4.7 - resolution: "@next/swc-win32-x64-msvc@npm:15.4.7" +"@next/swc-win32-x64-msvc@npm:15.5.7": + version: 15.5.7 + resolution: "@next/swc-win32-x64-msvc@npm:15.5.7" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -1153,74 +1153,74 @@ __metadata: languageName: node linkType: hard -"@shikijs/core@npm:3.13.0": - version: 3.13.0 - resolution: "@shikijs/core@npm:3.13.0" +"@shikijs/core@npm:3.19.0": + version: 3.19.0 + resolution: "@shikijs/core@npm:3.19.0" dependencies: - "@shikijs/types": "npm:3.13.0" + "@shikijs/types": "npm:3.19.0" "@shikijs/vscode-textmate": "npm:^10.0.2" "@types/hast": "npm:^3.0.4" hast-util-to-html: "npm:^9.0.5" - checksum: 10/c9b301a170cd76fa2ce446adee26b539b19204107a2e60207f3f5e7d96773df322367f6035e2d689d43f97a3e9f741793e976c366015d8e3a9709dcac1399af2 + checksum: 10/78fc5f849636459e267cd77f3e60b492c8260a8be9449d3b1b3a463eab22153354ca6c961e021f936cb8251695298d85913b2cb3b31aafa343fdddadebbfed1c languageName: node linkType: hard -"@shikijs/engine-javascript@npm:3.13.0": - version: 3.13.0 - resolution: "@shikijs/engine-javascript@npm:3.13.0" +"@shikijs/engine-javascript@npm:3.19.0": + version: 3.19.0 + resolution: "@shikijs/engine-javascript@npm:3.19.0" dependencies: - "@shikijs/types": "npm:3.13.0" + "@shikijs/types": "npm:3.19.0" "@shikijs/vscode-textmate": "npm:^10.0.2" - oniguruma-to-es: "npm:^4.3.3" - checksum: 10/acd4e78fdc732738c6a3a9f254011b7d8995a2149f2f72f7396d5e4514f3b0c3fdc767d52bf8852d65066e613dd8d1157bc4900442ab42684db7ef7396a44871 + oniguruma-to-es: "npm:^4.3.4" + checksum: 10/7b493cfce620976efd1d7cb3df946370897cac0c16fb71b089be9e197fde43ee60a3d1317db45820c61bcae47ae8e4ac4df91555454e733cd239dc064ef6cc03 languageName: node linkType: hard -"@shikijs/engine-oniguruma@npm:3.13.0": - version: 3.13.0 - resolution: "@shikijs/engine-oniguruma@npm:3.13.0" +"@shikijs/engine-oniguruma@npm:3.19.0": + version: 3.19.0 + resolution: "@shikijs/engine-oniguruma@npm:3.19.0" dependencies: - "@shikijs/types": "npm:3.13.0" + "@shikijs/types": "npm:3.19.0" "@shikijs/vscode-textmate": "npm:^10.0.2" - checksum: 10/bc7f1c69640ccece9a3ac3f3adc9cebde9c24bcd722747cc464c338a32725af2b9087a42646cd0f56fbea98d99414918c558f2ca0beadc13db0a740183e7707f + checksum: 10/6bf6e35aa61f62b1a532071d11e1937a67fb68469c1886ab3c06c6d384b8feee589973ee101cbebefad9ff9405040ee640ced429e83b9dddd906f07d994a1939 languageName: node linkType: hard -"@shikijs/langs@npm:3.13.0": - version: 3.13.0 - resolution: "@shikijs/langs@npm:3.13.0" +"@shikijs/langs@npm:3.19.0": + version: 3.19.0 + resolution: "@shikijs/langs@npm:3.19.0" dependencies: - "@shikijs/types": "npm:3.13.0" - checksum: 10/2a0478246ce61745d9012cf5051c9790ef5afad6c89fe5716be4a81d04d7dfd9ffc90af0bad0be0061111bfc001a3bc0c55ffd4fc0b82bc1c09a4c33d7b593ca + "@shikijs/types": "npm:3.19.0" + checksum: 10/679d61b89132c858bd1e96fc7a46fbae56dc8e9be176586cabb57cd9504bb7ea45bbd22879f63d822957060fe322302ad9824b9a6f18415a86b54e22347c0c2d languageName: node linkType: hard -"@shikijs/themes@npm:3.13.0": - version: 3.13.0 - resolution: "@shikijs/themes@npm:3.13.0" +"@shikijs/themes@npm:3.19.0": + version: 3.19.0 + resolution: "@shikijs/themes@npm:3.19.0" dependencies: - "@shikijs/types": "npm:3.13.0" - checksum: 10/4ab0ecf1ddb35e387cef22e267cdf3ed7548a84f24ad58885d19401f75cc01a5a10152ee0196222e01cead8202f20012615aa0076f798599f7dfc2bb7beaa617 + "@shikijs/types": "npm:3.19.0" + checksum: 10/7eb53912fe8b877e6fc498c937188ae55b960c681f65cd4201f2c3a919b0f5951f9ce090819ded5dc4eb0aabe7a811ba705a19b5c003e0dbfebad08d1ba535d5 languageName: node linkType: hard "@shikijs/transformers@npm:^3.13.0": - version: 3.13.0 - resolution: "@shikijs/transformers@npm:3.13.0" + version: 3.19.0 + resolution: "@shikijs/transformers@npm:3.19.0" dependencies: - "@shikijs/core": "npm:3.13.0" - "@shikijs/types": "npm:3.13.0" - checksum: 10/30f3e66334b60320dc976b9f645f823ba13b312aead4c891ae6db23d076f1570dad488443f603fb5eecd5937973ba7c2907da6678ccae2363a66e0c5b173bb02 + "@shikijs/core": "npm:3.19.0" + "@shikijs/types": "npm:3.19.0" + checksum: 10/813c2e4053007a8516ebae8c06f4fa2e7b42c6570ea4cae88ecd8bb749695be023ca3b271f8152559dbb74ed36404a77f76c14f63632dc44f225d963a446b1d1 languageName: node linkType: hard -"@shikijs/types@npm:3.13.0": - version: 3.13.0 - resolution: "@shikijs/types@npm:3.13.0" +"@shikijs/types@npm:3.19.0": + version: 3.19.0 + resolution: "@shikijs/types@npm:3.19.0" dependencies: "@shikijs/vscode-textmate": "npm:^10.0.2" "@types/hast": "npm:^3.0.4" - checksum: 10/a57cc95847edd84134166de1f11a044e356581834b2dfd75dcd67f2221aef6f20f505839c090a76b7c8e0a79d7d5cee829de50d261f363a633ae9afca29546c4 + checksum: 10/3f0e79f2ecbb0754ad08626e14313701a15dd1dbda1a1295d1e35a172b4555339a135118fabcc3ebdbf5017ceb64dbe3e5096268c3034c0c91ba3b0848e4b162 languageName: node linkType: hard @@ -1416,12 +1416,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^20": - version: 20.19.11 - resolution: "@types/node@npm:20.19.11" +"@types/node@npm:^22.13.14": + version: 22.19.2 + resolution: "@types/node@npm:22.19.2" dependencies: undici-types: "npm:~6.21.0" - checksum: 10/7179ed464a781cad20117362df58c12839b40922b53356e1a74f86c99d9d1ef9a27edce360901608f896c247c9c4131ba9c7222331e92cde17b723c75d5c8f2e + checksum: 10/c7e72fde4aef120d984416f4aa01d23b0704eeed7a0a63cdf6178783361f3985abb02a65133b80f47226ad61f38a27fe82c3cd6dd6a62d5b82bc643fe54b9c97 languageName: node linkType: hard @@ -1618,8 +1618,8 @@ __metadata: linkType: hard "@uiw/codemirror-themes@npm:^4.23.7": - version: 4.25.1 - resolution: "@uiw/codemirror-themes@npm:4.25.1" + version: 4.25.3 + resolution: "@uiw/codemirror-themes@npm:4.25.3" dependencies: "@codemirror/language": "npm:^6.0.0" "@codemirror/state": "npm:^6.0.0" @@ -1628,7 +1628,7 @@ __metadata: "@codemirror/language": ">=6.0.0" "@codemirror/state": ">=6.0.0" "@codemirror/view": ">=6.0.0" - checksum: 10/337316f7c15a57bca4824498769448e38861197ab3d73b3bc58b2193028751c525a175af06f1f3984fd25b001f990e1d30ce442ddc756642698d9f8adff7f95a + checksum: 10/f808ac3c4763f623ed6ea6215cc1421bb87234e0a05e7b6d9e917ab304fc6a4977c238996ca538e22093af8136c02bb27512aeeac653cb8fe82b4917ba1668a3 languageName: node linkType: hard @@ -2515,13 +2515,13 @@ __metadata: "@lezer/highlight": "npm:^1.2.1" "@mdx-js/loader": "npm:^3.1.0" "@mdx-js/react": "npm:^3.1.0" - "@next/mdx": "npm:15.3.4" + "@next/mdx": "npm:15.5.7" "@octokit/rest": "npm:^22.0.1" "@remixicon/react": "npm:^4.6.0" "@shikijs/transformers": "npm:^3.13.0" "@storybook/react": "npm:^8.6.12" "@types/mdx": "npm:^2.0.13" - "@types/node": "npm:^20" + "@types/node": "npm:^22.13.14" "@types/react": "npm:19.1.9" "@types/react-dom": "npm:19.1.7" "@uiw/codemirror-themes": "npm:^4.23.7" @@ -2529,11 +2529,11 @@ __metadata: chokidar: "npm:^3.6.0" clsx: "npm:^2.1.1" eslint: "npm:^8" - eslint-config-next: "npm:15.3.4" + eslint-config-next: "npm:15.5.7" html-react-parser: "npm:^5.2.5" lightningcss: "npm:^1.28.2" motion: "npm:^12.4.1" - next: "npm:15.4.7" + next: "npm:15.5.9" next-mdx-remote-client: "npm:^2.1.2" prop-types: "npm:^15.8.1" react: "npm:19.1.1" @@ -2942,11 +2942,11 @@ __metadata: languageName: node linkType: hard -"eslint-config-next@npm:15.3.4": - version: 15.3.4 - resolution: "eslint-config-next@npm:15.3.4" +"eslint-config-next@npm:15.5.7": + version: 15.5.7 + resolution: "eslint-config-next@npm:15.5.7" dependencies: - "@next/eslint-plugin-next": "npm:15.3.4" + "@next/eslint-plugin-next": "npm:15.5.7" "@rushstack/eslint-patch": "npm:^1.10.3" "@typescript-eslint/eslint-plugin": "npm:^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0" "@typescript-eslint/parser": "npm:^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0" @@ -2962,7 +2962,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10/6c21254d3383b9158ff5f3b2881cc702bee3d2635b4326757965945691f6e65e25fdfef4f2964382fb4b2f52d9f03b929cb71d267709727df7365e7da80c8c3a + checksum: 10/fd1813c7ef4e33ec297b86dd0de75879e10514b12cb04a103e7a5b8c5f27d2ea0a91dd15e6d530006c9fe3e7e18f815e900bd6ba117c3b8fbe311c38c340d899 languageName: node linkType: hard @@ -3451,9 +3451,9 @@ __metadata: languageName: node linkType: hard -"framer-motion@npm:^12.23.24": - version: 12.23.24 - resolution: "framer-motion@npm:12.23.24" +"framer-motion@npm:^12.23.25": + version: 12.23.25 + resolution: "framer-motion@npm:12.23.25" dependencies: motion-dom: "npm:^12.23.23" motion-utils: "npm:^12.23.6" @@ -3469,7 +3469,7 @@ __metadata: optional: true react-dom: optional: true - checksum: 10/c46015626d140557f3f225ffeaea14146988a42a99b33e46e3efbab88814343867a63014544169283b9518e1a3abed231ccefd890e601cf66b6c43425b0465e2 + checksum: 10/0b55dc0a5319cd923cdddcb42726352f0d74a8160f5222a3f090af53bbb2ed0d93c8482da41c9ffa875a3f7f666586e43be7594dca3612e70a1dea6bfbefebb4 languageName: node linkType: hard @@ -4735,8 +4735,8 @@ __metadata: linkType: hard "mdast-util-to-hast@npm:^13.0.0": - version: 13.2.0 - resolution: "mdast-util-to-hast@npm:13.2.0" + version: 13.2.1 + resolution: "mdast-util-to-hast@npm:13.2.1" dependencies: "@types/hast": "npm:^3.0.0" "@types/mdast": "npm:^4.0.0" @@ -4747,7 +4747,7 @@ __metadata: unist-util-position: "npm:^5.0.0" unist-util-visit: "npm:^5.0.0" vfile: "npm:^6.0.0" - checksum: 10/b17ee338f843af31a1c7a2ebf0df6f0b41c9380b7119a63ab521d271df665456578e1234bb7617883e8d860fe878038dcf2b76ab2f21e0f7451215a096d26cce + checksum: 10/8fddf5e66ea24dc85c8fe1cc2acd8fbe36e9d4f21b06322e156431fd71385eab9d2d767646f50276ca4ce3684cb967c4e226c60c3fff3428feb687ccb598fa39 languageName: node linkType: hard @@ -5265,10 +5265,10 @@ __metadata: linkType: hard "motion@npm:^12.4.1": - version: 12.23.24 - resolution: "motion@npm:12.23.24" + version: 12.23.25 + resolution: "motion@npm:12.23.25" dependencies: - framer-motion: "npm:^12.23.24" + framer-motion: "npm:^12.23.25" tslib: "npm:^2.4.0" peerDependencies: "@emotion/is-prop-valid": "*" @@ -5281,7 +5281,7 @@ __metadata: optional: true react-dom: optional: true - checksum: 10/d63d951676058001c6f234a6bdf8ed5a8fd222a38c1871ef209ed1fd87f2a288ec0e267fa616d80ac8837d0836a5f93ae85a80d773314517f19f304f25b81c3d + checksum: 10/67e86dd3c695362812fd86d06e82bb53173900212a78802c94adbcff947e70316141ec6e2908fb3ebf70d3686578bb7fbe7a820a359ce553cd2d79ff77fc1428 languageName: node linkType: hard @@ -5342,19 +5342,19 @@ __metadata: languageName: node linkType: hard -"next@npm:15.4.7": - version: 15.4.7 - resolution: "next@npm:15.4.7" +"next@npm:15.5.9": + version: 15.5.9 + resolution: "next@npm:15.5.9" dependencies: - "@next/env": "npm:15.4.7" - "@next/swc-darwin-arm64": "npm:15.4.7" - "@next/swc-darwin-x64": "npm:15.4.7" - "@next/swc-linux-arm64-gnu": "npm:15.4.7" - "@next/swc-linux-arm64-musl": "npm:15.4.7" - "@next/swc-linux-x64-gnu": "npm:15.4.7" - "@next/swc-linux-x64-musl": "npm:15.4.7" - "@next/swc-win32-arm64-msvc": "npm:15.4.7" - "@next/swc-win32-x64-msvc": "npm:15.4.7" + "@next/env": "npm:15.5.9" + "@next/swc-darwin-arm64": "npm:15.5.7" + "@next/swc-darwin-x64": "npm:15.5.7" + "@next/swc-linux-arm64-gnu": "npm:15.5.7" + "@next/swc-linux-arm64-musl": "npm:15.5.7" + "@next/swc-linux-x64-gnu": "npm:15.5.7" + "@next/swc-linux-x64-musl": "npm:15.5.7" + "@next/swc-win32-arm64-msvc": "npm:15.5.7" + "@next/swc-win32-x64-msvc": "npm:15.5.7" "@swc/helpers": "npm:0.5.15" caniuse-lite: "npm:^1.0.30001579" postcss: "npm:8.4.31" @@ -5397,7 +5397,7 @@ __metadata: optional: true bin: next: dist/bin/next - checksum: 10/e611751247d5cfff9337a84979918bcd61919d7b66a411c982569336c3dba7e7a8704eead7e082e579807200fa8bc80602a3e2ce4423a8b5387aab3353400918 + checksum: 10/ac27b82de08c9720e8e99cd64102af5e30306a8c861630d50da347a02c288cc441273ada64875c47e7a4d5991ff69cc92b23e906ce3271f9835a7911a0f060cc languageName: node linkType: hard @@ -5537,14 +5537,14 @@ __metadata: languageName: node linkType: hard -"oniguruma-to-es@npm:^4.3.3": - version: 4.3.3 - resolution: "oniguruma-to-es@npm:4.3.3" +"oniguruma-to-es@npm:^4.3.4": + version: 4.3.4 + resolution: "oniguruma-to-es@npm:4.3.4" dependencies: oniguruma-parser: "npm:^0.12.1" regex: "npm:^6.0.1" regex-recursion: "npm:^6.0.2" - checksum: 10/49b372569d335077c32bda066ac1da4a3f15dd25b717025cf43417fabd71d56e1152debcd8a832596e180d721b808822c88e65eb12abb26665ab8fe017f3c861 + checksum: 10/29be3f677cd948da7ea77c5ad62d0405daec58b015b4e4706c97d9f3dcd3a82a68a7314b90ec5dcd261a934aca9aa0bd8100180e2cbd252bc8a20e32fc9ab851 languageName: node linkType: hard @@ -6312,18 +6312,18 @@ __metadata: linkType: hard "shiki@npm:^3.13.0": - version: 3.13.0 - resolution: "shiki@npm:3.13.0" + version: 3.19.0 + resolution: "shiki@npm:3.19.0" dependencies: - "@shikijs/core": "npm:3.13.0" - "@shikijs/engine-javascript": "npm:3.13.0" - "@shikijs/engine-oniguruma": "npm:3.13.0" - "@shikijs/langs": "npm:3.13.0" - "@shikijs/themes": "npm:3.13.0" - "@shikijs/types": "npm:3.13.0" + "@shikijs/core": "npm:3.19.0" + "@shikijs/engine-javascript": "npm:3.19.0" + "@shikijs/engine-oniguruma": "npm:3.19.0" + "@shikijs/langs": "npm:3.19.0" + "@shikijs/themes": "npm:3.19.0" + "@shikijs/types": "npm:3.19.0" "@shikijs/vscode-textmate": "npm:^10.0.2" "@types/hast": "npm:^3.0.4" - checksum: 10/8d7cd039ac8df548f724047b4ba81cd84c09e8b96f411eb7c781d3d105c96ff2ec6f64e1bac724fd6fc56ac2926322bc2466124ea279d04c5ef668d5a04219bb + checksum: 10/004dabc26a9db25c69f1aa6ed0555c8a5a34153084a1aa5f42fa03edf800ca13dd468ad6d7ba4cbf8f36dc8d316a7de29cecec228ea8d2d252f4c4c95eb162e6 languageName: node linkType: hard diff --git a/docs/frontend-system/building-apps/01-index.md b/docs/frontend-system/building-apps/01-index.md index 0c96bdf15d..ed84aeafb2 100644 --- a/docs/frontend-system/building-apps/01-index.md +++ b/docs/frontend-system/building-apps/01-index.md @@ -14,16 +14,16 @@ A Backstage App is a monorepo setup that includes everything you need to run Bac To create a new Backstage app we recommend using the `@backstage/create-app` command line, and the easiest way to run this package is with `npx`: :::note -The create-app CLI requires Node.js Active LTS Release. +The create-app CLI requires Node.js Active LTS Release, see the [prerequisites documentation](../../getting-started/index.md) for all the details. ::: ```sh # The command bellow creates a Backstage App inside the current folder. # The name of the app-folder is the name that was provided when prompted. -npx @backstage/create-app@latest +npx @backstage/create-app@latest --next ``` -The created-app is currently templated for legacy frontend system applications, so the app wiring code it creates needs to be migrated, see [the app instance](#the-app-instance) section for an example. +Using the `--next` flag will result in a Backstage app using the New Frontend System which will be further explained in the sections below. ## The app instance diff --git a/docs/integrations/bitbucketCloud/discovery.md b/docs/integrations/bitbucketCloud/discovery.md index e0fab954ac..3f5920be5d 100644 --- a/docs/integrations/bitbucketCloud/discovery.md +++ b/docs/integrations/bitbucketCloud/discovery.md @@ -54,6 +54,8 @@ You need to decide how you want to receive events from external sources like - [via HTTP endpoint](https://github.com/backstage/backstage/tree/master/plugins/events-backend/README.md) - [via an AWS SQS queue](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-aws-sqs/README.md) +- [via Google Pub/Sub](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-google-pubsub/README.md) +- [via a Kafka topic](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-kafka/README.md) Further documentation: @@ -72,6 +74,8 @@ Additionally, you need to decide how you want to receive events from external so - [via HTTP endpoint](https://github.com/backstage/backstage/tree/master/plugins/events-backend/README.md) - [via an AWS SQS queue](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-aws-sqs/README.md) +- [via Google Pub/Sub](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-google-pubsub/README.md) +- [via a Kafka topic](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-kafka/README.md) Set up your provider diff --git a/docs/integrations/bitbucketServer/discovery.md b/docs/integrations/bitbucketServer/discovery.md index 350bc33aed..bbdd105af4 100644 --- a/docs/integrations/bitbucketServer/discovery.md +++ b/docs/integrations/bitbucketServer/discovery.md @@ -42,6 +42,8 @@ You need to decide how you want to receive events from external sources like - [via HTTP endpoint](https://github.com/backstage/backstage/tree/master/plugins/events-backend/README.md) - [via an AWS SQS queue](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-aws-sqs/README.md) +- [via Google Pub/Sub](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-google-pubsub/README.md) +- [via a Kafka topic](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-kafka/README.md) Further documentation: diff --git a/docs/integrations/github/discovery.md b/docs/integrations/github/discovery.md index f245e960ea..e17f514058 100644 --- a/docs/integrations/github/discovery.md +++ b/docs/integrations/github/discovery.md @@ -141,7 +141,7 @@ events: region: us-east-2 ``` -The [AWS SQS module `README`](https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-aws-sqs/README.md#configuration) has more details on the configuration options, the example above includes on the required options. +The [AWS SQS module `README`](https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-aws-sqs/README.md#configuration) has more details on the configuration options, the example above includes only the required options. ### Events Setup using Google Pub/Sub module @@ -179,7 +179,53 @@ events: targetTopic: 'github.{{ event.attributes.x-github-event }}' ``` -The [Google Pub/Sub module `README`](https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-google-pubsub/README.md#configuration) has more details on the configuration options, the example above includes on the required options. +The [Google Pub/Sub module `README`](https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-google-pubsub/README.md#configuration) has more details on the configuration options, the example above includes only the required options. + +### Events Setup using Kafka module + +Alternatively to using the HTTP endpoint you can use the Kafka module, here's how. + +First we need to add the package: + +```bash title="from your Backstage root directory" +yarn --cwd packages/backend add @backstage/plugin-events-backend-module-kafka +``` + +Then we need to add it to your backend: + +```ts title="in packages/backend/src/index.ts" +backend.add(import('@backstage/plugin-events-backend')); +backend.add(import('@backstage/plugin-events-backend-module-github')); +/* highlight-add-start */ +backend.add(import('@backstage/plugin-events-backend-module-kafka')); +/* highlight-add-end */ +``` + +Finally you will want to configure it: + +```yaml title="app-config.yaml +events: + modules: + kafka: + kafkaConsumingEventPublisher: + # Client ID used by Backstage to identify when connecting to the Kafka cluster. + clientId: your-client-id + # List of brokers in the Kafka cluster to connect to. + brokers: + - broker1 + - broker2 + topics: + # Replace with actual topic name as expected by subscribers + - topic: 'backstage.topic' + kafka: + # The Kafka topics to subscribe to. + topics: + - topic1 + # The GroupId to be used by the topic consumers. + groupId: your-group-id +``` + +The [Kafka module `README`](https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-kafka/README.md#configuration) has more details on the configuration options, the example above includes only the required options. ## Configuration diff --git a/docs/integrations/github/org.md b/docs/integrations/github/org.md index 6526183f2d..2dac8b8866 100644 --- a/docs/integrations/github/org.md +++ b/docs/integrations/github/org.md @@ -90,6 +90,7 @@ catalog: initialDelay: { seconds: 30 } frequency: { hours: 1 } timeout: { minutes: 50 } + excludeSuspendedUsers: true ``` Directly under the `githubOrg` is a list of configurations, each entry is a structure with the following elements: @@ -106,6 +107,8 @@ Directly under the `githubOrg` is a list of configurations, each entry is a stru Reducing page sizes will result in more API calls and slightly longer sync times, but will prevent API resource limits for organizations with large number of teams and members. +- `excludeSuspendedUsers` (optional): Whether to exclude suspended users when querying organization users. Only for GitHub Enterprise instances. Will error if used against GitHub.com API. + ### Events Support The catalog module for GitHub Org comes with events support enabled. @@ -129,6 +132,8 @@ You can decide between the following options (extensible): - [via HTTP endpoint](https://github.com/backstage/backstage/tree/master/plugins/events-backend/README.md) - [via an AWS SQS queue](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-aws-sqs/README.md) +- [via Google Pub/Sub](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-google-pubsub/README.md) +- [via a Kafka topic](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-kafka/README.md) You can check the official docs to [configure your webhook](https://docs.github.com/en/developers/webhooks-and-events/webhooks/creating-webhooks) and to [secure your request](https://docs.github.com/en/developers/webhooks-and-events/webhooks/securing-your-webhooks). The webhook will need to be configured to forward `organization`,`team` and `membership` events. diff --git a/docs/integrations/gitlab/discovery.md b/docs/integrations/gitlab/discovery.md index 5e02c853fa..3d47edba6d 100644 --- a/docs/integrations/gitlab/discovery.md +++ b/docs/integrations/gitlab/discovery.md @@ -43,6 +43,8 @@ You need to decide how you want to receive events from external sources like - [via HTTP endpoint](https://github.com/backstage/backstage/blob/master/plugins/events-backend/README.md#configuration) - [via an AWS SQS queue](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-aws-sqs/README.md) +- [via Google Pub/Sub](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-google-pubsub/README.md) +- [via a Kafka topic](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-kafka/README.md) Further documentation: @@ -92,6 +94,8 @@ Additionally, you need to decide how you want to receive events from external so - [via HTTP endpoint](https://github.com/backstage/backstage/tree/master/plugins/events-backend/README.md) - [via an AWS SQS queue](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-aws-sqs/README.md) +- [via Google Pub/Sub](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-google-pubsub/README.md) +- [via a Kafka topic](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-kafka/README.md) Set up your provider diff --git a/docs/integrations/gitlab/org.md b/docs/integrations/gitlab/org.md index 8249a97c24..2908bb7c09 100644 --- a/docs/integrations/gitlab/org.md +++ b/docs/integrations/gitlab/org.md @@ -49,6 +49,8 @@ You need to decide how you want to receive events from external sources like - [via HTTP endpoint](https://github.com/backstage/backstage/blob/master/plugins/events-backend/README.md#configuration) - [via an AWS SQS queue](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-aws-sqs/README.md) +- [via Google Pub/Sub](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-google-pubsub/README.md) +- [via a Kafka topic](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-kafka/README.md) Further documentation: @@ -101,6 +103,8 @@ Additionally, you need to decide how you want to receive events from external so - [via HTTP endpoint](https://github.com/backstage/backstage/tree/master/plugins/events-backend/README.md) - [via an AWS SQS queue](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-aws-sqs/README.md) +- [via Google Pub/Sub](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-google-pubsub/README.md) +- [via a Kafka topic](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-kafka/README.md) Set up your provider diff --git a/docs/notifications/processors.md b/docs/notifications/processors.md index 0802fde6cf..af0b9f8f93 100644 --- a/docs/notifications/processors.md +++ b/docs/notifications/processors.md @@ -149,6 +149,8 @@ notifications: broadcastChannels: # Optional, if you wish to support broadcast notifications. - C12345678 username: 'Backstage Bot' # Optional, defaults to the name of the Slack App. + concurrencyLimit: 20 # Optional, number of messages allowed per interval. Defaults to 10. + throttleInterval: 1m # Optional, Accepts ISO-8601 duration, ms-style ("1m", "30s"), or HumanDuration ({ minutes: 2 }). Defaults to 1 minute ``` Multiple instances can be added in the `slack` array, allowing you to have multiple configurations if you need to send diff --git a/docs/overview/versioning-policy.md b/docs/overview/versioning-policy.md index 669a982e1a..420b6489ae 100644 --- a/docs/overview/versioning-policy.md +++ b/docs/overview/versioning-policy.md @@ -177,7 +177,7 @@ When we say _Supporting_ a Node.js release, that means the following: - New Backstage projects created with `@backstage/create-app` will have their `engines.node` version set accordingly. - Dropping compatibility with unsupported releases is not considered a breaking change. This includes using new syntax or APIs, as well as bumping dependencies that drop support for these versions. -Based on the above Backstage supports Node.js 20 and 22 as of the `1.33.0` release. +Based on the above Backstage supports Node.js 22 and 24 as of the `1.46.0` release. ## TypeScript Releases diff --git a/docs/overview/what-is-backstage.md b/docs/overview/what-is-backstage.md index fa1c75de44..024bea8f81 100644 --- a/docs/overview/what-is-backstage.md +++ b/docs/overview/what-is-backstage.md @@ -39,8 +39,6 @@ Out of the box, Backstage includes: Backstage is a CNCF Incubation project after graduating from Sandbox. Read the announcement [here](https://backstage.io/blog/2022/03/16/backstage-turns-two#out-of-the-sandbox-and-into-incubation). -CNCF logo - ## Benefits - For _engineering managers_, it allows you to maintain standards and best diff --git a/docs/permissions/custom-rules.md b/docs/permissions/custom-rules.md index 7bfcd1220a..d90f36e59d 100644 --- a/docs/permissions/custom-rules.md +++ b/docs/permissions/custom-rules.md @@ -159,7 +159,7 @@ To install custom rules in a plugin, we need to use the [`PermissionsRegistrySer ```typescript title="packages/backend/src/modules/catalogPermissionRules.ts" import { createBackendModule } from '@backstage/backend-plugin-api'; import { catalogPermissionExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; - import { isInSystemRule } from './permissionPolicyExtension'; + import { isInSystemRule } from './permissionsPolicyExtension'; export default createBackendModule({ pluginId: 'catalog', diff --git a/docs/plugins/structure-of-a-plugin.md b/docs/plugins/structure-of-a-plugin.md index 0d18942320..8412ead179 100644 --- a/docs/plugins/structure-of-a-plugin.md +++ b/docs/plugins/structure-of-a-plugin.md @@ -81,7 +81,7 @@ export const ExamplePage = examplePlugin.provide( ``` This is where the plugin is created and where it creates and exports extensions -that can be imported and used the app. See reference docs for +that can be imported and used in the app. See reference docs for [`createPlugin`](../reference/core-plugin-api.createplugin.md) or introduction to the new [Composability System](./composability.md). diff --git a/docs/releases/v1.46.0-next.1-changelog.md b/docs/releases/v1.46.0-next.1-changelog.md new file mode 100644 index 0000000000..42a188ec7f --- /dev/null +++ b/docs/releases/v1.46.0-next.1-changelog.md @@ -0,0 +1,392 @@ +# Release v1.46.0-next.1 + +Upgrade Helper: [https://backstage.github.io/upgrade-helper/?to=1.46.0-next.1](https://backstage.github.io/upgrade-helper/?to=1.46.0-next.1) + +## @backstage/plugin-techdocs-addons-test-utils@2.0.0-next.1 + +### Major Changes + +- 8d6709e: **BREAKING**: `TechDocsAddonTester.renderWithEffects()` no longer returns a screen; this means that you can no longer grab assertions such as `getByText` from its return value. + + Newer versions of `@testing-library` recommends using the `screen` export for assertions - and removing this from the addon tester contract allows us to more freely iterate on which underlying version of the testing library is being used. + + One notable effect of this, however, is that the `@testing-library` `screen` does NOT support assertions on the shadow DOM, which techdocs relies on. You will therefore want to add a dependency on [the `shadow-dom-testing-library` package](https://github.com/konnorrogers/shadow-dom-testing-library/) in your tests, and using its `screen` and its dedicated `*Shadow*` methods. As an example, if you keep doing `getByText` you will not get matches inside the shadow DOM - switch to `getByShadowText` instead. + + ```ts + import { screen } from 'shadow-dom-testing-library'; + + // ... render the addon ... + await TechDocsAddonTester.buildAddonsInTechDocs([]) + .withDom(TEST_CONTENT) + .renderWithEffects(); + + expect(screen.getByShadowText('TEST_CONTENT')).toBeInTheDocument(); + ``` + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@1.21.4-next.1 + - @backstage/plugin-techdocs@1.16.1-next.1 + +## @backstage/ui@0.10.0-next.1 + +### Minor Changes + +- 16543fa: **Breaking change** The `Cell` component has been refactored to be a generic wrapper component that accepts `children` for custom cell content. The text-specific functionality (previously part of `Cell`) has been moved to a new `CellText` component. + + ### Migration Guide + + If you were using `Cell` with text-specific props (`title`, `description`, `leadingIcon`, `href`), you need to update your code to use `CellText` instead: + + **Before:** + + ```tsx + } + href="/path" + /> + ``` + + **After:** + + ```tsx + } + href="/path" + /> + ``` + + For custom cell content, use the new generic `Cell` component: + + ```tsx + {/* Your custom content */} + ``` + +### Patch Changes + +- 50b7927: Fixed Checkbox indicator showing checkmark color when unchecked. + + Affected components: Checkbox + +- 5bacf55: Fixed `ButtonIcon` incorrectly applying `className` to inner elements instead of only the root element. + + Affected components: ButtonIcon + +- a20d317: Added row selection support with visual state styling for hover, selected, and pressed states. Fixed checkbox rendering to only show for multi-select toggle mode. + + Affected components: Table, TableHeader, Row, Column + +## @backstage/cli@0.34.6-next.1 + +### Patch Changes + +- 7fbac5c: Updated to use new utilities from `@backstage/cli-common`. +- Updated dependencies + - @backstage/cli-node@0.2.16-next.1 + - @backstage/cli-common@0.1.16-next.1 + +## @backstage/cli-common@0.1.16-next.1 + +### Patch Changes + +- 5cfb2a4: Added new `run`, `runOutput`, and `runCheck` utilities to help run child processes in a safe and portable way. + +## @backstage/cli-node@0.2.16-next.1 + +### Patch Changes + +- 4e8c726: Updated to use new utilities from `@backstage/cli-common`. +- Updated dependencies + - @backstage/cli-common@0.1.16-next.1 + +## @backstage/codemods@0.1.53-next.1 + +### Patch Changes + +- 688f070: Updated to use new utilities from `@backstage/cli-common`. +- Updated dependencies + - @backstage/cli-common@0.1.16-next.1 + +## @backstage/core-components@0.18.4-next.1 + +### Patch Changes + +- 9a942a4: Fixed bug in the `LogViewer` component where shift + click always opened a new window instead of just changing the selection. + + In addition, improved the `LogViewer` component by a few usability enhancements: + + - Added support for multiple selections using cmd/ctrl + click + - Improved the generated hash that is added to the URL to also support ranges & multiple selections + - Added an hover effect & info tooltip to the "Copy to clipboard" button to indicate its functionality + - Added some color and a separator to the line numbers to improve readability + +- 207c3c8: long words like urls now breaks to new line on warning panels instead of overflowing the container + +- 5d52dab: Add i18n support for LogViewer search control + +## @backstage/create-app@0.7.7-next.1 + +### Patch Changes + +- Bumped create-app version. +- Updated dependencies + - @backstage/cli-common@0.1.16-next.1 + +## @backstage/dev-utils@1.1.18-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/ui@0.10.0-next.1 + - @backstage/core-components@0.18.4-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.1 + +## @backstage/repo-tools@0.16.1-next.1 + +### Patch Changes + +- 688f070: Updated to use new utilities from `@backstage/cli-common`. +- d1e38a7: Properly create workspace in OS temporary directory for `generate-patch` command +- Updated dependencies + - @backstage/cli-node@0.2.16-next.1 + - @backstage/cli-common@0.1.16-next.1 + +## @techdocs/cli@1.10.3-next.1 + +### Patch Changes + +- 43629b1: Updated to use new utilities from `@backstage/cli-common`. +- Updated dependencies + - @backstage/cli-common@0.1.16-next.1 + +## @backstage/plugin-app-visualizer@0.1.26-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/ui@0.10.0-next.1 + - @backstage/core-components@0.18.4-next.1 + +## @backstage/plugin-catalog-backend-module-aws@0.4.18-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-kubernetes-common@0.9.9-next.0 + +## @backstage/plugin-catalog-backend-module-gcp@0.3.15-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-kubernetes-common@0.9.9-next.0 + +## @backstage/plugin-catalog-backend-module-github@0.11.3-next.1 + +### Patch Changes + +- ed5a7a3: Introduce new configuration option to exclude suspended users from GitHub Enterprise instances. + + When it’s set to true, suspended users won’t be returned when querying the organization users for GitHub Enterprise instances. + Note that this option should be used only against GitHub Enterprise instances, the property does not exist in the github.com GraphQL schema, setting it will cause a schema validation error and the syncing of users will fail. + +## @backstage/plugin-catalog-backend-module-github-org@0.3.17-next.1 + +### Patch Changes + +- ed5a7a3: Introduce new configuration option to exclude suspended users from GitHub Enterprise instances. + + When it’s set to true, suspended users won’t be returned when querying the organization users for GitHub Enterprise instances. + Note that this option should be used only against GitHub Enterprise instances, the property does not exist in the github.com GraphQL schema, setting it will cause a schema validation error and the syncing of users will fail. + +- Updated dependencies + - @backstage/plugin-catalog-backend-module-github@0.11.3-next.1 + +## @backstage/plugin-catalog-backend-module-unprocessed@0.6.7-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-unprocessed-entities-common@0.0.12-next.0 + +## @backstage/plugin-catalog-react@1.21.4-next.1 + +### Patch Changes + +- 6d39141: Fixed an issue where `EntityOwnerPicker` failed to filter options when the input text contained uppercase characters. +- Updated dependencies + - @backstage/core-components@0.18.4-next.1 + +## @backstage/plugin-catalog-unprocessed-entities@0.2.24-next.1 + +### Patch Changes + +- df4d646: Moved types, API and client to the common package, allowing both frontend and + backend plugins to use the `CatalogUnprocessedEntitiesClient`. + + The following types, clients and interfaces have been deprecated and should be + imported from the `@backstage/plugin-catalog-unprocessed-entities-common` instead: + `CatalogUnprocessedEntitiesApi`, `CatalogUnprocessedEntitiesApiResponse`, `UnprocessedEntity`, + `UnprocessedEntityCache`, `UnprocessedEntityError`, `CatalogUnprocessedEntitiesClient`. + + All those types, clients and interfaces are re-exported temporarily in the + `@backstage/plugin-catalog-unprocessed-entities` package until cleaned up. + +- Updated dependencies + - @backstage/core-components@0.18.4-next.1 + - @backstage/plugin-catalog-unprocessed-entities-common@0.0.12-next.0 + +## @backstage/plugin-catalog-unprocessed-entities-common@0.0.12-next.0 + +### Patch Changes + +- df4d646: Moved types, API and client to the common package, allowing both frontend and + backend plugins to use the `CatalogUnprocessedEntitiesClient`. + + The following types, clients and interfaces have been deprecated and should be + imported from the `@backstage/plugin-catalog-unprocessed-entities-common` instead: + `CatalogUnprocessedEntitiesApi`, `CatalogUnprocessedEntitiesApiResponse`, `UnprocessedEntity`, + `UnprocessedEntityCache`, `UnprocessedEntityError`, `CatalogUnprocessedEntitiesClient`. + + All those types, clients and interfaces are re-exported temporarily in the + `@backstage/plugin-catalog-unprocessed-entities` package until cleaned up. + +## @backstage/plugin-kubernetes@0.12.14-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-kubernetes-react@0.5.14-next.1 + - @backstage/core-components@0.18.4-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.1 + - @backstage/plugin-kubernetes-common@0.9.9-next.0 + +## @backstage/plugin-kubernetes-backend@0.20.5-next.1 + +### Patch Changes + +- 8fa8d87: Add Kubernetes Plugin Secrets Accordion with masked secret datas +- Updated dependencies + - @backstage/plugin-kubernetes-common@0.9.9-next.0 + - @backstage/plugin-kubernetes-node@0.3.7-next.1 + +## @backstage/plugin-kubernetes-cluster@0.0.32-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-kubernetes-react@0.5.14-next.1 + - @backstage/core-components@0.18.4-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.1 + - @backstage/plugin-kubernetes-common@0.9.9-next.0 + +## @backstage/plugin-kubernetes-common@0.9.9-next.0 + +### Patch Changes + +- 8fa8d87: Add Kubernetes Plugin Secrets Accordion with masked secret datas + +## @backstage/plugin-kubernetes-node@0.3.7-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-kubernetes-common@0.9.9-next.0 + +## @backstage/plugin-kubernetes-react@0.5.14-next.1 + +### Patch Changes + +- f966a85: Enabled a pod terminal at GKE +- 8fa8d87: Add Kubernetes Plugin Secrets Accordion with masked secret datas +- Updated dependencies + - @backstage/core-components@0.18.4-next.1 + - @backstage/plugin-kubernetes-common@0.9.9-next.0 + +## @backstage/plugin-mui-to-bui@0.2.2-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/ui@0.10.0-next.1 + +## @backstage/plugin-scaffolder-react@1.19.4-next.1 + +### Patch Changes + +- 5ca461e: Fixed bug where custom `review.name` values were incorrectly formatted by `startCase`, preserving them exactly as written. +- Updated dependencies + - @backstage/core-components@0.18.4-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.1 + +## @backstage/plugin-techdocs@1.16.1-next.1 + +### Patch Changes + +- 592361e: The `techdocs` config is now marked as optional. +- Updated dependencies + - @backstage/core-components@0.18.4-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.1 + +## @backstage/plugin-techdocs-backend@2.1.3-next.1 + +### Patch Changes + +- 592361e: The `techdocs` config is now marked as optional. + +## @backstage/plugin-techdocs-module-addons-contrib@1.1.31-next.1 + +### Patch Changes + +- 8d6709e: Updated tests to match test-utils change +- Updated dependencies + - @backstage/core-components@0.18.4-next.1 + +## example-app@0.2.116-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/ui@0.10.0-next.1 + - @backstage/core-components@0.18.4-next.1 + - @backstage/plugin-techdocs-module-addons-contrib@1.1.31-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.1 + - @backstage/plugin-scaffolder-react@1.19.4-next.1 + - @backstage/plugin-catalog-unprocessed-entities@0.2.24-next.1 + - @backstage/cli@0.34.6-next.1 + - @backstage/plugin-techdocs@1.16.1-next.1 + - @backstage/plugin-mui-to-bui@0.2.2-next.1 + - @backstage/plugin-kubernetes@0.12.14-next.1 + - @backstage/plugin-kubernetes-cluster@0.0.32-next.1 + +## example-app-next@0.0.30-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/ui@0.10.0-next.1 + - @backstage/core-components@0.18.4-next.1 + - @backstage/plugin-techdocs-module-addons-contrib@1.1.31-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.1 + - @backstage/plugin-scaffolder-react@1.19.4-next.1 + - @backstage/plugin-catalog-unprocessed-entities@0.2.24-next.1 + - @backstage/cli@0.34.6-next.1 + - @backstage/plugin-techdocs@1.16.1-next.1 + - @backstage/plugin-app-visualizer@0.1.26-next.1 + - @backstage/plugin-kubernetes@0.12.14-next.1 + - @backstage/plugin-kubernetes-cluster@0.0.32-next.1 + +## techdocs-cli-embedded-app@0.2.115-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/ui@0.10.0-next.1 + - @backstage/core-components@0.18.4-next.1 + - @backstage/cli@0.34.6-next.1 + - @backstage/plugin-techdocs@1.16.1-next.1 diff --git a/docs/releases/v1.46.0-next.2-changelog.md b/docs/releases/v1.46.0-next.2-changelog.md new file mode 100644 index 0000000000..0bb2bf687d --- /dev/null +++ b/docs/releases/v1.46.0-next.2-changelog.md @@ -0,0 +1,1897 @@ +# Release v1.46.0-next.2 + +Upgrade Helper: [https://backstage.github.io/upgrade-helper/?to=1.46.0-next.2](https://backstage.github.io/upgrade-helper/?to=1.46.0-next.2) + +## @backstage/backend-plugin-api@1.6.0-next.1 + +### Minor Changes + +- 2a0c4b0: Adds a new experimental `RootSystemMetadataService` for tracking the collection of Backstage instances that may be deployed at any one time. It currently offers a single API, `getInstalledPlugins` that returns a list of installed plugins based on config you have set up in `discovery.endpoints` as well as the plugins installed on the instance you're calling the API with. It does not handle wildcard values or fallback values. The intention is for this plugin to provide plugin authors with a simple interface to fetch a trustworthy list of all installed plugins. + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/plugin-permission-node@0.10.7-next.1 + - @backstage/cli-common@0.1.16-next.2 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-permission-common@0.9.3 + +## @backstage/cli@0.35.0-next.2 + +### Minor Changes + +- f8dff94: Switched the default module resolution to `bundler` and the `module` setting to `ES2020`. + + You may need to bump some dependencies as part of this change and fix imports in code. The most common source of this is that type checking will now consider the `exports` field in `package.json` when resolving imports. This in turn can break older versions of packages that had incompatible `exports` fields. Generally these issues will have already been fixed in the upstream packages. + + You might be tempted to use `--skipLibCheck` to hide issues due to this change, but it will weaken the type safety of your project. If you run into a large number of issues and want to keep the old behavior, you can reset the `moduleResolution` and `module` settings your own `tsconfig.json` file to `node` and `ESNext` respectively. But keep in mind that the `node` option will be removed in future versions of TypeScript. + + A future version of Backstage will make these new settings mandatory, as we move to rely on the `exports` field for type resolution in packages, rather than the `typesVersions` field. + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- 1226647: Updated dependency `esbuild` to `^0.27.0`. +- f89a074: Updated dependency `@pmmmwh/react-refresh-webpack-plugin` to `^0.6.0`. +- 2b81751: Updated dependency `webpack` to `~5.103.0`. +- fafd9e1: Fixed internal usage of `yargs`. +- 2bae83a: Switched ECMAScript version to ES2023. +- 2bae83a: Bumped dev dependencies `@types/node` +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/config-loader@1.10.7-next.1 + - @backstage/cli-common@0.1.16-next.2 + - @backstage/catalog-model@1.7.6 + - @backstage/cli-node@0.2.16-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/eslint-plugin@0.2.0 + - @backstage/release-manifests@0.0.13 + - @backstage/types@1.2.2 + +## @backstage/plugin-kubernetes-backend@0.21.0-next.2 + +### Minor Changes + +- 7f9846f: Add possibility to extends Kubernetes REST API. Add fetcher to parameters for custom objects provider + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- fb029b6: Updated luxon types +- Updated dependencies + - @backstage/plugin-permission-node@0.10.7-next.1 + - @backstage/plugin-kubernetes-node@0.4.0-next.2 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/integration-aws-node@0.1.19 + - @backstage/types@1.2.2 + - @backstage/plugin-catalog-node@1.20.1-next.1 + - @backstage/plugin-kubernetes-common@0.9.9-next.0 + - @backstage/plugin-permission-common@0.9.3 + +## @backstage/plugin-kubernetes-node@0.4.0-next.2 + +### Minor Changes + +- 7f9846f: Add possibility to extends Kubernetes REST API. Add fetcher to parameters for custom objects provider + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/types@1.2.2 + - @backstage/plugin-kubernetes-common@0.9.9-next.0 + +## @backstage/plugin-scaffolder-backend-module-gitlab@0.11.0-next.1 + +### Minor Changes + +- f2d034b: In the `gitlabRepoPush` action, add 'auto' possibility for `commitAction` input. + +### Patch Changes + +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/backend-app-api@1.4.0-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + +## @backstage/backend-defaults@0.14.0-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- aa79251: build(deps): bump `node-forge` from 1.3.1 to 1.3.2 +- f96edff: Allow configuration of the `referrerPolicy` +- fb029b6: Updated luxon types +- 847a330: Fix for `jose` types +- 25b560e: Internal change to support new versions of the `logform` library +- 2a0c4b0: Adds a new experimental `RootSystemMetadataService` for tracking the collection of Backstage instances that may be deployed at any one time. It currently offers a single API, `getInstalledPlugins` that returns a list of installed plugins based on config you have set up in `discovery.endpoints` as well as the plugins installed on the instance you're calling the API with. It does not handle wildcard values or fallback values. The intention is for this plugin to provide plugin authors with a simple interface to fetch a trustworthy list of all installed plugins. +- 3016a79: Updated dependency `@types/archiver` to `^7.0.0`. +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/plugin-permission-node@0.10.7-next.1 + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config-loader@1.10.7-next.1 + - @backstage/backend-dev-utils@0.1.6-next.0 + - @backstage/backend-app-api@1.4.0-next.1 + - @backstage/cli-node@0.2.16-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/integration-aws-node@0.1.19 + - @backstage/types@1.2.2 + +## @backstage/backend-dev-utils@0.1.6-next.0 + +### Patch Changes + +- 2bae83a: Internal update for Node.js v24 support. + +## @backstage/backend-dynamic-feature-service@0.7.7-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/backend-openapi-utils@0.6.4-next.1 + - @backstage/plugin-app-node@0.1.40-next.1 + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/plugin-catalog-backend@3.2.1-next.1 + - @backstage/plugin-events-backend@0.5.9-next.1 + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/plugin-permission-node@0.10.7-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config-loader@1.10.7-next.1 + - @backstage/cli-common@0.1.16-next.2 + - @backstage/cli-node@0.2.16-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-permission-common@0.9.3 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + - @backstage/plugin-search-backend-node@1.4.0-next.1 + - @backstage/plugin-search-common@1.2.21 + +## @backstage/backend-openapi-utils@0.6.4-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + +## @backstage/backend-test-utils@1.10.2-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- 8be23a4: Switched `textextensions` dependency for `text-extensions`. +- 5a737e1: Fix PostgreSQL 18 `TestDatabases` by pinning the data directory +- Updated dependencies + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/backend-app-api@1.4.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-permission-common@0.9.3 + +## @backstage/cli-common@0.1.16-next.2 + +### Patch Changes + +- 2bae83a: Bumped dev dependencies `@types/node` +- Updated dependencies + - @backstage/errors@1.2.7 + +## @backstage/codemods@0.1.53-next.2 + +### Patch Changes + +- 2bae83a: Bumped dev dependencies `@types/node` +- Updated dependencies + - @backstage/cli-common@0.1.16-next.2 + +## @backstage/config-loader@1.10.7-next.1 + +### Patch Changes + +- 741c47a: Updated dependency `typescript-json-schema` to `^0.67.0`. +- Updated dependencies + - @backstage/cli-common@0.1.16-next.2 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + +## @backstage/core-app-api@1.19.3-next.1 + +### Patch Changes + +- 75683ed: Added replay functionality to `AlertApiForwarder` to buffer and replay recent alerts to new subscribers, preventing missed alerts that were posted before subscription. +- Updated dependencies + - @backstage/config@1.3.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/types@1.2.2 + - @backstage/version-bridge@1.0.11 + +## @backstage/core-components@0.18.4-next.2 + +### Patch Changes + +- 4c00303: Add `tooltipClasses` prop to `OverflowTooltip` component to allow customisation of the tooltip +- Updated dependencies + - @backstage/config@1.3.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/errors@1.2.7 + - @backstage/theme@0.7.1-next.0 + - @backstage/version-bridge@1.0.11 + +## @backstage/create-app@0.7.7-next.2 + +### Patch Changes + +- 2bae83a: Updated engines to support Node 22 or 24 +- 2bae83a: Bumped dev dependencies `@types/node` +- Updated dependencies + - @backstage/cli-common@0.1.16-next.2 + +## @backstage/frontend-plugin-api@0.13.2-next.1 + +### Patch Changes + +- 75683ed: Added a new `errorPresentation` prop to `ExtensionBoundary` to control how errors are presented to the user. The default is `'error-display'`, which is the current behavior of showing the error in the `ErrorDisplay` component. The new option is `'error-api'`, posts errors to the `ErrorApi` and does not allow retries. + + The `AppRootElementBlueprint` now wraps its element in an `ErrorBoundary` using the new `'error-api'` presentation mode. + +- f3f84f1: Made the return type of `.withOverrides` to be simplified. + +- Updated dependencies + - @backstage/core-components@0.18.4-next.2 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/version-bridge@1.0.11 + +## @backstage/integration@1.18.3-next.1 + +### Patch Changes + +- fb029b6: Updated luxon types +- Updated dependencies + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + +## @backstage/repo-tools@0.16.1-next.2 + +### Patch Changes + +- 2bae83a: Bump `@microsoft/api-documenter` and `@microsoft/api-extractor` to latest versions. +- 2bae83a: Bumped dev dependencies `@types/node` +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config-loader@1.10.7-next.1 + - @backstage/cli-common@0.1.16-next.2 + - @backstage/catalog-model@1.7.6 + - @backstage/cli-node@0.2.16-next.1 + - @backstage/errors@1.2.7 + +## @techdocs/cli@1.10.3-next.2 + +### Patch Changes + +- 2bae83a: Bumped dev dependencies `@types/node` +- Updated dependencies + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/plugin-techdocs-node@1.13.10-next.1 + - @backstage/cli-common@0.1.16-next.2 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + +## @backstage/plugin-api-docs@0.13.2-next.1 + +### Patch Changes + +- f3f84f1: Minor extension type updates after frontend API bump +- Updated dependencies + - @backstage/plugin-catalog@1.32.1-next.1 + - @backstage/frontend-plugin-api@0.13.2-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.2 + - @backstage/core-components@0.18.4-next.2 + - @backstage/catalog-model@1.7.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-permission-react@0.4.39-next.0 + +## @backstage/plugin-app@0.3.3-next.1 + +### Patch Changes + +- f3f84f1: Minor extension type updates after frontend API bump +- f7bc228: Support to set `defaultLanguage` and `availableLanguages` for the app language API in the new frontend system +- Updated dependencies + - @backstage/frontend-plugin-api@0.13.2-next.1 + - @backstage/core-components@0.18.4-next.2 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/integration-react@1.2.13-next.0 + - @backstage/theme@0.7.1-next.0 + - @backstage/types@1.2.2 + - @backstage/version-bridge@1.0.11 + - @backstage/plugin-permission-react@0.4.39-next.0 + +## @backstage/plugin-app-backend@0.5.9-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-app-node@0.1.40-next.1 + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config-loader@1.10.7-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + +## @backstage/plugin-app-node@0.1.40-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config-loader@1.10.7-next.1 + +## @backstage/plugin-auth-backend@0.25.7-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-auth-backend-module-atlassian-provider@0.4.10-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-auth-backend-module-auth0-provider@0.2.10-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-auth-backend-module-aws-alb-provider@0.4.10-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-backend@0.25.7-next.1 + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/errors@1.2.7 + +## @backstage/plugin-auth-backend-module-azure-easyauth-provider@0.2.15-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/errors@1.2.7 + +## @backstage/plugin-auth-backend-module-bitbucket-provider@0.3.10-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-auth-backend-module-bitbucket-server-provider@0.2.10-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-auth-backend-module-cloudflare-access-provider@0.4.10-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + +## @backstage/plugin-auth-backend-module-gcp-iap-provider@0.4.10-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + +## @backstage/plugin-auth-backend-module-github-provider@0.3.10-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-auth-backend-module-gitlab-provider@0.3.10-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-auth-backend-module-google-provider@0.3.10-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-auth-backend-module-guest-provider@0.2.15-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/errors@1.2.7 + +## @backstage/plugin-auth-backend-module-microsoft-provider@0.3.10-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-auth-backend-module-oauth2-provider@0.4.10-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-auth-backend-module-oauth2-proxy-provider@0.2.15-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/errors@1.2.7 + +## @backstage/plugin-auth-backend-module-oidc-provider@0.4.10-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-backend@0.25.7-next.1 + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/types@1.2.2 + +## @backstage/plugin-auth-backend-module-okta-provider@0.2.10-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-auth-backend-module-onelogin-provider@0.3.10-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-auth-backend-module-openshift-provider@0.1.3-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/types@1.2.2 + +## @backstage/plugin-auth-backend-module-pinniped-provider@0.3.10-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/types@1.2.2 + +## @backstage/plugin-auth-backend-module-vmware-cloud-provider@0.5.10-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + +## @backstage/plugin-auth-node@0.6.10-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- e9dd634: fix flawed cookie removal logic with chunked tokens +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + +## @backstage/plugin-catalog@1.32.1-next.1 + +### Patch Changes + +- f3f84f1: Minor extension type updates after frontend API bump +- 91f5ed8: Fixed `catalogAboutEntityCard` to filter icon links before calling useProps(), preventing side effects from hooks in filtered-out links +- Updated dependencies + - @backstage/frontend-plugin-api@0.13.2-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.2 + - @backstage/core-components@0.18.4-next.2 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/core-compat-api@0.5.5-next.0 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/errors@1.2.7 + - @backstage/integration-react@1.2.13-next.0 + - @backstage/types@1.2.2 + - @backstage/version-bridge@1.0.11 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-permission-react@0.4.39-next.0 + - @backstage/plugin-scaffolder-common@1.7.4-next.0 + - @backstage/plugin-search-common@1.2.21 + - @backstage/plugin-search-react@1.10.1-next.0 + - @backstage/plugin-techdocs-common@0.1.1 + - @backstage/plugin-techdocs-react@1.3.6-next.0 + +## @backstage/plugin-catalog-backend@3.2.1-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/backend-openapi-utils@0.6.4-next.1 + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/plugin-permission-node@0.10.7-next.1 + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + - @backstage/plugin-permission-common@0.9.3 + +## @backstage/plugin-catalog-backend-module-aws@0.4.18-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/integration-aws-node@0.1.19 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + - @backstage/plugin-kubernetes-common@0.9.9-next.0 + +## @backstage/plugin-catalog-backend-module-azure@0.3.12-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-catalog-backend-module-backstage-openapi@0.5.9-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-openapi-utils@0.6.4-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-catalog-backend-module-bitbucket-cloud@0.5.6-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/plugin-bitbucket-cloud-common@0.3.5-next.0 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-catalog-backend-module-bitbucket-server@0.5.6-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-catalog-backend-module-gcp@0.3.15-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/plugin-catalog-node@1.20.1-next.1 + - @backstage/plugin-kubernetes-common@0.9.9-next.0 + +## @backstage/plugin-catalog-backend-module-gerrit@0.3.9-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-catalog-backend-module-gitea@0.1.7-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-catalog-backend-module-github@0.11.3-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-catalog-backend-module-github-org@0.3.17-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/plugin-catalog-backend-module-github@0.11.3-next.2 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-catalog-backend-module-gitlab@0.7.6-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-catalog-backend-module-gitlab-org@0.2.16-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/plugin-catalog-backend-module-gitlab@0.7.6-next.1 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-catalog-backend-module-incremental-ingestion@0.7.7-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- fb029b6: Updated luxon types +- Updated dependencies + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/plugin-catalog-backend@3.2.1-next.1 + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-catalog-node@1.20.1-next.1 + - @backstage/plugin-permission-common@0.9.3 + +## @backstage/plugin-catalog-backend-module-ldap@0.12.1-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-catalog-backend-module-logs@0.1.17-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-backend@3.2.1-next.1 + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-catalog-backend-module-msgraph@0.8.3-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-catalog-backend-module-openapi@0.2.17-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/types@1.2.2 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-catalog-backend-module-puppetdb@0.2.17-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.2.15-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + - @backstage/plugin-scaffolder-common@1.7.4-next.0 + +## @backstage/plugin-catalog-backend-module-unprocessed@0.6.7-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + - @backstage/plugin-catalog-unprocessed-entities-common@0.0.12-next.0 + - @backstage/plugin-permission-common@0.9.3 + +## @backstage/plugin-catalog-graph@0.5.4-next.1 + +### Patch Changes + +- f3f84f1: Minor extension type updates after frontend API bump +- Updated dependencies + - @backstage/frontend-plugin-api@0.13.2-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.2 + - @backstage/core-components@0.18.4-next.2 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/types@1.2.2 + +## @backstage/plugin-catalog-node@1.20.1-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-permission-node@0.10.7-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-permission-common@0.9.3 + +## @backstage/plugin-catalog-react@1.21.4-next.2 + +### Patch Changes + +- b3c0594: Use a versioned context for `useEntityList`, to better work with mixed `@backstage/plugin-catalog-react` versions. +- Updated dependencies + - @backstage/frontend-plugin-api@0.13.2-next.1 + - @backstage/core-components@0.18.4-next.2 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/core-compat-api@0.5.5-next.0 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/errors@1.2.7 + - @backstage/frontend-test-utils@0.4.2-next.0 + - @backstage/integration-react@1.2.13-next.0 + - @backstage/types@1.2.2 + - @backstage/version-bridge@1.0.11 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-permission-common@0.9.3 + - @backstage/plugin-permission-react@0.4.39-next.0 + +## @backstage/plugin-devtools-backend@0.5.12-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/plugin-permission-node@0.10.7-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config-loader@1.10.7-next.1 + - @backstage/cli-common@0.1.16-next.2 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-devtools-common@0.1.19 + - @backstage/plugin-permission-common@0.9.3 + +## @backstage/plugin-events-backend@0.5.9-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/backend-openapi-utils@0.6.4-next.1 + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + +## @backstage/plugin-events-backend-module-aws-sqs@0.4.18-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/types@1.2.2 + +## @backstage/plugin-events-backend-module-azure@0.2.27-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-events-backend-module-bitbucket-cloud@0.2.27-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-events-backend-module-bitbucket-server@0.1.8-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-events-backend-module-gerrit@0.2.27-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-events-backend-module-github@0.4.7-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/types@1.2.2 + +## @backstage/plugin-events-backend-module-gitlab@0.3.8-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + +## @backstage/plugin-events-backend-module-google-pubsub@0.1.7-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + +## @backstage/plugin-events-backend-module-kafka@0.1.6-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/types@1.2.2 + +## @backstage/plugin-events-node@0.4.18-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + +## @backstage/plugin-gateway-backend@1.1.1-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-home@0.8.15-next.1 + +### Patch Changes + +- be21c5c: Updated dependency `@rjsf/utils` to `5.24.13`. + Updated dependency `@rjsf/core` to `5.24.13`. + Updated dependency `@rjsf/material-ui` to `5.24.13`. + Updated dependency `@rjsf/validator-ajv8` to `5.24.13`. +- Updated dependencies + - @backstage/core-app-api@1.19.3-next.1 + - @backstage/frontend-plugin-api@0.13.2-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.2 + - @backstage/core-components@0.18.4-next.2 + - @backstage/plugin-home-react@0.1.33-next.1 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/theme@0.7.1-next.0 + +## @backstage/plugin-home-react@0.1.33-next.1 + +### Patch Changes + +- be21c5c: Updated dependency `@rjsf/utils` to `5.24.13`. + Updated dependency `@rjsf/core` to `5.24.13`. + Updated dependency `@rjsf/material-ui` to `5.24.13`. + Updated dependency `@rjsf/validator-ajv8` to `5.24.13`. +- Updated dependencies + - @backstage/frontend-plugin-api@0.13.2-next.1 + - @backstage/core-components@0.18.4-next.2 + - @backstage/core-plugin-api@1.12.1-next.0 + +## @backstage/plugin-kubernetes-cluster@0.0.32-next.2 + +### Patch Changes + +- 2bae83a: Bumped dev dependencies `@types/node` +- Updated dependencies + - @backstage/plugin-catalog-react@1.21.4-next.2 + - @backstage/core-components@0.18.4-next.2 + - @backstage/catalog-model@1.7.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/plugin-kubernetes-common@0.9.9-next.0 + - @backstage/plugin-kubernetes-react@0.5.14-next.1 + - @backstage/plugin-permission-react@0.4.39-next.0 + +## @backstage/plugin-mcp-actions-backend@0.1.6-next.1 + +### Patch Changes + +- e83e038: Added `@cfworker/json-schema` as a dependency to this package part of the `@modelcontextprotocol/sdk` bump as it's required in the types +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-client@1.12.1 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-notifications-backend@0.6.1-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-signals-node@0.1.27-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-catalog-node@1.20.1-next.1 + - @backstage/plugin-notifications-common@0.2.0 + - @backstage/plugin-notifications-node@0.2.22-next.1 + +## @backstage/plugin-notifications-backend-module-email@0.3.17-next.1 + +### Patch Changes + +- b267aea: Updated dependency `@types/nodemailer` to `^7.0.0`. +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/integration-aws-node@0.1.19 + - @backstage/types@1.2.2 + - @backstage/plugin-catalog-node@1.20.1-next.1 + - @backstage/plugin-notifications-common@0.2.0 + - @backstage/plugin-notifications-node@0.2.22-next.1 + +## @backstage/plugin-notifications-backend-module-slack@0.2.2-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-catalog-node@1.20.1-next.1 + - @backstage/plugin-notifications-common@0.2.0 + - @backstage/plugin-notifications-node@0.2.22-next.1 + +## @backstage/plugin-notifications-node@0.2.22-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-signals-node@0.1.27-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/plugin-notifications-common@0.2.0 + +## @backstage/plugin-org@0.6.47-next.1 + +### Patch Changes + +- f3f84f1: Minor extension type updates after frontend API bump +- Updated dependencies + - @backstage/frontend-plugin-api@0.13.2-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.2 + - @backstage/core-components@0.18.4-next.2 + - @backstage/catalog-model@1.7.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/plugin-catalog-common@1.1.7 + +## @backstage/plugin-permission-backend@0.7.7-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/plugin-permission-node@0.10.7-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-permission-common@0.9.3 + +## @backstage/plugin-permission-backend-module-allow-all-policy@0.2.15-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/plugin-permission-node@0.10.7-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/plugin-permission-common@0.9.3 + +## @backstage/plugin-permission-node@0.10.7-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-permission-common@0.9.3 + +## @backstage/plugin-proxy-backend@0.6.9-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/types@1.2.2 + - @backstage/plugin-proxy-node@0.1.11-next.1 + +## @backstage/plugin-proxy-node@0.1.11-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + +## @backstage/plugin-scaffolder@1.34.4-next.1 + +### Patch Changes + +- be21c5c: Updated dependency `@rjsf/utils` to `5.24.13`. + Updated dependency `@rjsf/core` to `5.24.13`. + Updated dependency `@rjsf/material-ui` to `5.24.13`. + Updated dependency `@rjsf/validator-ajv8` to `5.24.13`. +- Updated dependencies + - @backstage/frontend-plugin-api@0.13.2-next.1 + - @backstage/plugin-scaffolder-react@1.19.4-next.2 + - @backstage/integration@1.18.3-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.2 + - @backstage/core-components@0.18.4-next.2 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/errors@1.2.7 + - @backstage/integration-react@1.2.13-next.0 + - @backstage/types@1.2.2 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-permission-react@0.4.39-next.0 + - @backstage/plugin-scaffolder-common@1.7.4-next.0 + - @backstage/plugin-techdocs-common@0.1.1 + - @backstage/plugin-techdocs-react@1.3.6-next.0 + +## @backstage/plugin-scaffolder-backend@3.1.0-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- 2bae83a: Updated `isolated-vm` to `6.0.1` +- 25b560e: Internal change to support new versions of the `logform` library +- 1226647: Updated dependency `esbuild` to `^0.27.0`. +- Updated dependencies + - @backstage/plugin-scaffolder-backend-module-gitlab@0.11.0-next.1 + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/backend-openapi-utils@0.6.4-next.1 + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/plugin-permission-node@0.10.7-next.1 + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.2.16-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-bitbucket-cloud-common@0.3.5-next.0 + - @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.2.15-next.1 + - @backstage/plugin-catalog-node@1.20.1-next.1 + - @backstage/plugin-permission-common@0.9.3 + - @backstage/plugin-scaffolder-backend-module-azure@0.2.16-next.1 + - @backstage/plugin-scaffolder-backend-module-bitbucket@0.3.17-next.1 + - @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.2.16-next.1 + - @backstage/plugin-scaffolder-backend-module-gerrit@0.2.16-next.1 + - @backstage/plugin-scaffolder-backend-module-gitea@0.2.16-next.1 + - @backstage/plugin-scaffolder-backend-module-github@0.9.3-next.1 + - @backstage/plugin-scaffolder-common@1.7.4-next.0 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/plugin-scaffolder-backend-module-azure@0.2.16-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/plugin-scaffolder-backend-module-bitbucket@0.3.17-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.2.16-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.2.16-next.1 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.2.16-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-bitbucket-cloud-common@0.3.5-next.0 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.2.16-next.1 + +### Patch Changes + +- 5a6aca2: Improve error message when provided target branch is missing +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/plugin-scaffolder-backend-module-confluence-to-markdown@0.3.16-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/plugin-scaffolder-backend-module-cookiecutter@0.3.18-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/plugin-scaffolder-backend-module-gcp@0.2.16-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/plugin-scaffolder-backend-module-gerrit@0.2.16-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/plugin-scaffolder-backend-module-gitea@0.2.16-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/plugin-scaffolder-backend-module-github@0.9.3-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-catalog-node@1.20.1-next.1 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/plugin-scaffolder-backend-module-notifications@0.1.17-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/plugin-notifications-common@0.2.0 + - @backstage/plugin-notifications-node@0.2.22-next.1 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/plugin-scaffolder-backend-module-rails@0.5.16-next.1 + +### Patch Changes + +- 2bae83a: Bumped dev dependencies `@types/node` +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/plugin-scaffolder-backend-module-sentry@0.2.16-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/plugin-scaffolder-backend-module-yeoman@0.4.17-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/types@1.2.2 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + - @backstage/plugin-scaffolder-node-test-utils@0.3.6-next.1 + +## @backstage/plugin-scaffolder-node@0.12.2-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-permission-common@0.9.3 + - @backstage/plugin-scaffolder-common@1.7.4-next.0 + +## @backstage/plugin-scaffolder-node-test-utils@0.3.6-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-test-utils@1.10.2-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/types@1.2.2 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + +## @backstage/plugin-scaffolder-react@1.19.4-next.2 + +### Patch Changes + +- fb029b6: Updated luxon types +- be21c5c: Updated dependency `@rjsf/utils` to `5.24.13`. + Updated dependency `@rjsf/core` to `5.24.13`. + Updated dependency `@rjsf/material-ui` to `5.24.13`. + Updated dependency `@rjsf/validator-ajv8` to `5.24.13`. +- 9b38f22: Updated dependency `use-immer` to `^0.11.0`. +- Updated dependencies + - @backstage/frontend-plugin-api@0.13.2-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.2 + - @backstage/core-components@0.18.4-next.2 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/theme@0.7.1-next.0 + - @backstage/types@1.2.2 + - @backstage/version-bridge@1.0.11 + - @backstage/plugin-permission-react@0.4.39-next.0 + - @backstage/plugin-scaffolder-common@1.7.4-next.0 + +## @backstage/plugin-search@1.5.1-next.1 + +### Patch Changes + +- f3f84f1: Minor extension type updates after frontend API bump +- Updated dependencies + - @backstage/frontend-plugin-api@0.13.2-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.2 + - @backstage/core-components@0.18.4-next.2 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/version-bridge@1.0.11 + - @backstage/plugin-search-common@1.2.21 + - @backstage/plugin-search-react@1.10.1-next.0 + +## @backstage/plugin-search-backend@2.0.9-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/backend-openapi-utils@0.6.4-next.1 + - @backstage/plugin-permission-node@0.10.7-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-permission-common@0.9.3 + - @backstage/plugin-search-backend-node@1.4.0-next.1 + - @backstage/plugin-search-common@1.2.21 + +## @backstage/plugin-search-backend-module-catalog@0.3.11-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + - @backstage/plugin-permission-common@0.9.3 + - @backstage/plugin-search-backend-node@1.4.0-next.1 + - @backstage/plugin-search-common@1.2.21 + +## @backstage/plugin-search-backend-module-elasticsearch@1.7.9-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/integration-aws-node@0.1.19 + - @backstage/plugin-search-backend-node@1.4.0-next.1 + - @backstage/plugin-search-common@1.2.21 + +## @backstage/plugin-search-backend-module-explore@0.3.10-next.1 + +### Patch Changes + +- 9b69262: Updated dependency `@backstage-community/plugin-explore-common` to `^0.9.0`. +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/plugin-search-backend-node@1.4.0-next.1 + - @backstage/plugin-search-common@1.2.21 + +## @backstage/plugin-search-backend-module-pg@0.5.51-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/plugin-search-backend-node@1.4.0-next.1 + - @backstage/plugin-search-common@1.2.21 + +## @backstage/plugin-search-backend-module-stack-overflow-collator@0.3.16-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/plugin-search-backend-node@1.4.0-next.1 + - @backstage/plugin-search-common@1.2.21 + +## @backstage/plugin-search-backend-module-techdocs@0.4.9-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-techdocs-node@1.13.10-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-node@1.20.1-next.1 + - @backstage/plugin-permission-common@0.9.3 + - @backstage/plugin-search-backend-node@1.4.0-next.1 + - @backstage/plugin-search-common@1.2.21 + +## @backstage/plugin-search-backend-node@1.4.0-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/plugin-permission-common@0.9.3 + - @backstage/plugin-search-common@1.2.21 + +## @backstage/plugin-signals-backend@0.3.11-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/plugin-signals-node@0.1.27-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/types@1.2.2 + +## @backstage/plugin-signals-node@0.1.27-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config@1.3.6 + - @backstage/types@1.2.2 + +## @backstage/plugin-techdocs@1.16.1-next.2 + +### Patch Changes + +- f3f84f1: Minor extension type updates after frontend API bump +- Updated dependencies + - @backstage/frontend-plugin-api@0.13.2-next.1 + - @backstage/integration@1.18.3-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.2 + - @backstage/core-components@0.18.4-next.2 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/errors@1.2.7 + - @backstage/integration-react@1.2.13-next.0 + - @backstage/theme@0.7.1-next.0 + - @backstage/plugin-auth-react@0.1.22-next.0 + - @backstage/plugin-search-common@1.2.21 + - @backstage/plugin-search-react@1.10.1-next.0 + - @backstage/plugin-techdocs-common@0.1.1 + - @backstage/plugin-techdocs-react@1.3.6-next.0 + +## @backstage/plugin-techdocs-backend@2.1.3-next.2 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- 2bae83a: Corrected `ErrorCallback` type to work with Node 22 types +- Updated dependencies + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/plugin-techdocs-node@1.13.10-next.1 + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-client@1.12.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-catalog-node@1.20.1-next.1 + +## @backstage/plugin-techdocs-node@1.13.10-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- 703f8c0: There was an issue in the uploading of large size files to the AWS S3. We have modified the logic by adding retry along with multipart uploading functionality. +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/integration-aws-node@0.1.19 + - @backstage/plugin-search-common@1.2.21 + - @backstage/plugin-techdocs-common@0.1.1 + +## @backstage/plugin-user-settings-backend@0.3.9-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/plugin-signals-node@0.1.27-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-user-settings-common@0.0.1 + +## example-app@0.2.116-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/core-app-api@1.19.3-next.1 + - @backstage/cli@0.35.0-next.2 + - @backstage/plugin-catalog-graph@0.5.4-next.1 + - @backstage/plugin-api-docs@0.13.2-next.1 + - @backstage/plugin-techdocs@1.16.1-next.2 + - @backstage/plugin-catalog@1.32.1-next.1 + - @backstage/plugin-search@1.5.1-next.1 + - @backstage/plugin-org@0.6.47-next.1 + - @backstage/plugin-scaffolder-react@1.19.4-next.2 + - @backstage/plugin-catalog-react@1.21.4-next.2 + - @backstage/core-components@0.18.4-next.2 + - @backstage/plugin-home@0.8.15-next.1 + - @backstage/plugin-scaffolder@1.34.4-next.1 + - @backstage/plugin-kubernetes-cluster@0.0.32-next.2 + - @backstage/app-defaults@1.7.3-next.0 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/frontend-app-api@0.13.3-next.0 + - @backstage/integration-react@1.2.13-next.0 + - @backstage/theme@0.7.1-next.0 + - @backstage/ui@0.10.0-next.1 + - @backstage/plugin-auth-react@0.1.22-next.0 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-import@0.13.8-next.0 + - @backstage/plugin-catalog-unprocessed-entities@0.2.24-next.1 + - @backstage/plugin-devtools@0.1.34-next.0 + - @backstage/plugin-kubernetes@0.12.14-next.1 + - @backstage/plugin-mui-to-bui@0.2.2-next.1 + - @backstage/plugin-notifications@0.5.12-next.0 + - @backstage/plugin-permission-react@0.4.39-next.0 + - @backstage/plugin-search-common@1.2.21 + - @backstage/plugin-search-react@1.10.1-next.0 + - @backstage/plugin-signals@0.0.26-next.0 + - @backstage/plugin-techdocs-module-addons-contrib@1.1.31-next.1 + - @backstage/plugin-techdocs-react@1.3.6-next.0 + - @backstage/plugin-user-settings@0.8.30-next.0 + +## example-app-next@0.0.30-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/core-app-api@1.19.3-next.1 + - @backstage/cli@0.35.0-next.2 + - @backstage/plugin-catalog-graph@0.5.4-next.1 + - @backstage/plugin-api-docs@0.13.2-next.1 + - @backstage/plugin-techdocs@1.16.1-next.2 + - @backstage/plugin-catalog@1.32.1-next.1 + - @backstage/plugin-search@1.5.1-next.1 + - @backstage/plugin-app@0.3.3-next.1 + - @backstage/plugin-org@0.6.47-next.1 + - @backstage/frontend-plugin-api@0.13.2-next.1 + - @backstage/plugin-scaffolder-react@1.19.4-next.2 + - @backstage/plugin-catalog-react@1.21.4-next.2 + - @backstage/core-components@0.18.4-next.2 + - @backstage/plugin-home@0.8.15-next.1 + - @backstage/plugin-scaffolder@1.34.4-next.1 + - @backstage/plugin-kubernetes-cluster@0.0.32-next.2 + - @backstage/app-defaults@1.7.3-next.0 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/core-compat-api@0.5.5-next.0 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/frontend-app-api@0.13.3-next.0 + - @backstage/frontend-defaults@0.3.4-next.0 + - @backstage/integration-react@1.2.13-next.0 + - @backstage/theme@0.7.1-next.0 + - @backstage/ui@0.10.0-next.1 + - @backstage/plugin-app-visualizer@0.1.26-next.1 + - @backstage/plugin-auth@0.1.3-next.0 + - @backstage/plugin-auth-react@0.1.22-next.0 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-import@0.13.8-next.0 + - @backstage/plugin-catalog-unprocessed-entities@0.2.24-next.1 + - @backstage/plugin-kubernetes@0.12.14-next.1 + - @backstage/plugin-notifications@0.5.12-next.0 + - @backstage/plugin-permission-react@0.4.39-next.0 + - @backstage/plugin-search-common@1.2.21 + - @backstage/plugin-search-react@1.10.1-next.0 + - @backstage/plugin-signals@0.0.26-next.0 + - @backstage/plugin-techdocs-module-addons-contrib@1.1.31-next.1 + - @backstage/plugin-techdocs-react@1.3.6-next.0 + - @backstage/plugin-user-settings@0.8.30-next.0 + +## example-backend@0.0.45-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-mcp-actions-backend@0.1.6-next.1 + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/plugin-app-backend@0.5.9-next.1 + - @backstage/plugin-auth-backend-module-guest-provider@0.2.15-next.1 + - @backstage/plugin-auth-backend-module-openshift-provider@0.1.3-next.1 + - @backstage/plugin-auth-backend@0.25.7-next.1 + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/plugin-catalog-backend@3.2.1-next.1 + - @backstage/plugin-devtools-backend@0.5.12-next.1 + - @backstage/plugin-events-backend@0.5.9-next.1 + - @backstage/plugin-kubernetes-backend@0.21.0-next.2 + - @backstage/plugin-notifications-backend@0.6.1-next.1 + - @backstage/plugin-permission-backend@0.7.7-next.1 + - @backstage/plugin-permission-node@0.10.7-next.1 + - @backstage/plugin-proxy-backend@0.6.9-next.1 + - @backstage/plugin-scaffolder-backend@3.1.0-next.1 + - @backstage/plugin-search-backend@2.0.9-next.1 + - @backstage/plugin-signals-backend@0.3.11-next.1 + - @backstage/plugin-techdocs-backend@2.1.3-next.2 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/plugin-search-backend-module-explore@0.3.10-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/plugin-auth-backend-module-github-provider@0.3.10-next.1 + - @backstage/plugin-catalog-backend-module-backstage-openapi@0.5.9-next.1 + - @backstage/plugin-catalog-backend-module-openapi@0.2.17-next.1 + - @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.2.15-next.1 + - @backstage/plugin-catalog-backend-module-unprocessed@0.6.7-next.2 + - @backstage/plugin-events-backend-module-google-pubsub@0.1.7-next.1 + - @backstage/plugin-permission-backend-module-allow-all-policy@0.2.15-next.1 + - @backstage/plugin-permission-common@0.9.3 + - @backstage/plugin-scaffolder-backend-module-github@0.9.3-next.1 + - @backstage/plugin-scaffolder-backend-module-notifications@0.1.17-next.1 + - @backstage/plugin-search-backend-module-catalog@0.3.11-next.1 + - @backstage/plugin-search-backend-module-elasticsearch@1.7.9-next.1 + - @backstage/plugin-search-backend-module-techdocs@0.4.9-next.1 + - @backstage/plugin-search-backend-node@1.4.0-next.1 + +## techdocs-cli-embedded-app@0.2.115-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/core-app-api@1.19.3-next.1 + - @backstage/cli@0.35.0-next.2 + - @backstage/plugin-techdocs@1.16.1-next.2 + - @backstage/plugin-catalog@1.32.1-next.1 + - @backstage/core-components@0.18.4-next.2 + - @backstage/app-defaults@1.7.3-next.0 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/integration-react@1.2.13-next.0 + - @backstage/test-utils@1.7.14-next.0 + - @backstage/theme@0.7.1-next.0 + - @backstage/ui@0.10.0-next.1 + - @backstage/plugin-techdocs-react@1.3.6-next.0 + +## @internal/plugin-todo-list-backend@1.0.46-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/errors@1.2.7 diff --git a/docs/tooling/cli/02-build-system.md b/docs/tooling/cli/02-build-system.md index c8d9034955..6f1b7fd54a 100644 --- a/docs/tooling/cli/02-build-system.md +++ b/docs/tooling/cli/02-build-system.md @@ -610,7 +610,7 @@ With that in mind, here are some IDEs configurations to run backstage components 1. Click on "Edit Configurations" on top panel 2. In the modal dialog click on link "Edit configuration templates..." located in the bottom left corner. 3. "Configuration file": leave empty (`backstage-cli` adds the config) - 4. "Node options": `--no-node-snapshot --experimental-vm-modules` + 4. "Node options": ` --experimental-vm-modules` 5. "Jest package": `~/workspace/backstage/node_modules/@backstage/cli` - the location of the backstage cli package. 6. "Working directory": `~/workspace/backstage` 7. "Jest Options": `repo test --runInBand --watch=false` @@ -621,20 +621,21 @@ With that in mind, here are some IDEs configurations to run backstage components #### VS Code +1. Install the [Jest extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest) for VS Code. +2. Update `settings.json` in the `.vscode` folder with: + ```jsonc { "jest.jestCommandLine": "yarn test", // In a large repo like the Backstage main repo you likely want to disable // watch mode and the initial test run too, leaving just manual and perhaps // on-save test runs in place. - "jest.autoRun": { - "watch": false, - "onSave": "test-src-file" - } + "jest.runMode": "on-save" } ``` -A complete launch configuration for VS Code debugging may look like this: +3. Add a launch configuration for VS Code in `launch.json` in the `.vscode` folder. + A complete configuration for debugging may look like this: ```jsonc { @@ -653,11 +654,13 @@ A complete launch configuration for VS Code debugging may look like this: ], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", - "disableOptimisticBPs": true, - "program": "${workspaceFolder}/node_modules/.bin/backstage-cli" + "program": "${workspaceFolder}/node_modules/@backstage/cli/bin/backstage-cli" } ``` +4. The configuration is not for manual runs from the "Run and Debug" view. + Instead use the Jest test explorer or the [test's gutter menu](https://github.com/jest-community/vscode-jest#how-to-trigger-a-test-run). + ## Publishing Package publishing is an optional part of the Backstage build system and not diff --git a/microsite/data/plugins/airbrake.yaml b/microsite/data/plugins/airbrake.yaml index 8facf13185..59910df629 100644 --- a/microsite/data/plugins/airbrake.yaml +++ b/microsite/data/plugins/airbrake.yaml @@ -6,5 +6,5 @@ category: Monitoring description: Access Airbrake error monitoring and other integrations from within Backstage documentation: https://github.com/backstage/community-plugins/tree/main/workspaces/airbrake/plugins/airbrake iconUrl: https://wp-assets.airbrake.io/wp-content/uploads/2020/10/05222904/Square-white-A-on-Orange.png -npmPackageName: '@backstage/plugin-airbrake' +npmPackageName: '@backstage-community/plugin-airbrake' addedDate: '2022-01-10' diff --git a/microsite/data/plugins/analytics-module-ga.yaml b/microsite/data/plugins/analytics-module-ga.yaml index 3dcb27bcd5..537a360c8c 100644 --- a/microsite/data/plugins/analytics-module-ga.yaml +++ b/microsite/data/plugins/analytics-module-ga.yaml @@ -6,5 +6,5 @@ category: Monitoring description: Track usage of your Backstage instance using Google Analytics 4. documentation: https://github.com/backstage/community-plugins/tree/main/workspaces/analytics/plugins/analytics-module-ga4#readme iconUrl: /img/ga-icon.png -npmPackageName: '@backstage/plugin-analytics-module-ga4' +npmPackageName: '@backstage-community/plugin-analytics-module-ga4' addedDate: '2021-10-07' diff --git a/microsite/data/plugins/apollo-explorer.yaml b/microsite/data/plugins/apollo-explorer.yaml index 2b0f834f92..83d121e055 100644 --- a/microsite/data/plugins/apollo-explorer.yaml +++ b/microsite/data/plugins/apollo-explorer.yaml @@ -6,5 +6,5 @@ category: Debugging description: Integrates Apollo Explorer graphs as a tool to browse GraphQL API endpoints inside Backstage. documentation: https://github.com/backstage/community-plugins/blob/main/workspaces/apollo-explorer/plugins/apollo-explorer/README.md iconUrl: /img/apollo-explorer.png -npmPackageName: '@backstage/plugin-apollo-explorer' +npmPackageName: '@backstage-community/plugin-apollo-explorer' addedDate: '2022-07-20' diff --git a/microsite/data/plugins/aws-amazon-ecs.yaml b/microsite/data/plugins/aws-amazon-ecs.yaml index a94779babd..e16028d802 100644 --- a/microsite/data/plugins/aws-amazon-ecs.yaml +++ b/microsite/data/plugins/aws-amazon-ecs.yaml @@ -6,5 +6,5 @@ category: Infrastructure description: View resources related to Amazon Elastic Container Service for your components in Backstage. documentation: https://github.com/awslabs/backstage-plugins-for-aws/tree/main/plugins/ecs#readme iconUrl: https://raw.githubusercontent.com/awslabs/backstage-plugins-for-aws/main/docs/images/logos/amazon-ecs-logo.png -npmPackageName: 'https://www.npmjs.com/package/@aws/amazon-ecs-plugin-for-backstage' +npmPackageName: '@aws/amazon-ecs-plugin-for-backstage' addedDate: '2024-04-22' diff --git a/microsite/data/plugins/aws-codebuild.yaml b/microsite/data/plugins/aws-codebuild.yaml index 2c12f92dce..504730402f 100644 --- a/microsite/data/plugins/aws-codebuild.yaml +++ b/microsite/data/plugins/aws-codebuild.yaml @@ -6,5 +6,5 @@ category: CI/CD description: View resources related to AWS CodeBuild for your components in Backstage. documentation: https://github.com/awslabs/backstage-plugins-for-aws/tree/main/plugins/codebuild#readme iconUrl: https://raw.githubusercontent.com/awslabs/backstage-plugins-for-aws/main/docs/images/logos/aws-codebuild-logo.png -npmPackageName: 'https://www.npmjs.com/package/@aws/aws-codebuild-plugin-for-backstage' +npmPackageName: '@aws/aws-codebuild-plugin-for-backstage' addedDate: '2024-04-22' diff --git a/microsite/data/plugins/aws-codepipeline.yaml b/microsite/data/plugins/aws-codepipeline.yaml index 16986b6718..a2eb8de230 100644 --- a/microsite/data/plugins/aws-codepipeline.yaml +++ b/microsite/data/plugins/aws-codepipeline.yaml @@ -6,5 +6,5 @@ category: CI/CD description: View resources related to AWS CodePipeline for your components in Backstage. documentation: https://github.com/awslabs/backstage-plugins-for-aws/tree/main/plugins/codepipeline#readme iconUrl: https://raw.githubusercontent.com/awslabs/backstage-plugins-for-aws/main/docs/images/logos/aws-codepipeline-logo.png -npmPackageName: 'https://www.npmjs.com/package/@aws/aws-codepipeline-plugin-for-backstage' +npmPackageName: '@aws/aws-codepipeline-plugin-for-backstage' addedDate: '2024-04-22' diff --git a/microsite/data/plugins/azure-pipelines.yaml b/microsite/data/plugins/azure-pipelines.yaml index e0e3534fdb..f9536eb192 100644 --- a/microsite/data/plugins/azure-pipelines.yaml +++ b/microsite/data/plugins/azure-pipelines.yaml @@ -6,5 +6,5 @@ category: CI/CD description: Easily view your Azure Pipelines within the Software Catalog documentation: https://github.com/backstage/community-plugins/blob/main/workspaces/azure-devops/plugins/azure-devops/README.md iconUrl: /img/azure-pipelines.svg -npmPackageName: '@backstage/plugin-azure-devops' +npmPackageName: '@backstage-community/plugin-azure-devops' addedDate: '2021-12-22' diff --git a/microsite/data/plugins/badges.yaml b/microsite/data/plugins/badges.yaml index 789aaf155d..9452054810 100644 --- a/microsite/data/plugins/badges.yaml +++ b/microsite/data/plugins/badges.yaml @@ -6,5 +6,5 @@ category: Discovery description: The badges plugin offers a set of badges that can be used outside of Backstage, showing information related to data from the catalog. documentation: https://github.com/backstage/community-plugins/blob/main/workspaces/badges/plugins/badges/README.md iconUrl: /img/badges.svg -npmPackageName: '@backstage/plugin-badges' +npmPackageName: '@backstage-community/plugin-badges' addedDate: '2021-09-29' diff --git a/microsite/data/plugins/bazaar.yaml b/microsite/data/plugins/bazaar.yaml index 1130822e77..d14aaaecd8 100644 --- a/microsite/data/plugins/bazaar.yaml +++ b/microsite/data/plugins/bazaar.yaml @@ -5,5 +5,5 @@ category: Discovery description: A marketplace where engineers can propose projects suitable for inner sourcing documentation: https://github.com/backstage/community-plugins/blob/main/workspaces/bazaar/plugins/bazaar/README.md iconUrl: /img/bazaar.svg -npmPackageName: '@backstage/plugin-bazaar' +npmPackageName: '@backstage-community/plugin-bazaar' addedDate: '2022-01-11' diff --git a/microsite/data/plugins/bitrise.yaml b/microsite/data/plugins/bitrise.yaml index 5cbfe5aabf..31f50a007c 100644 --- a/microsite/data/plugins/bitrise.yaml +++ b/microsite/data/plugins/bitrise.yaml @@ -6,5 +6,5 @@ category: CI/CD description: View Bitrise builds and download the build artifacts within Backstage. documentation: https://github.com/backstage/community-plugins/blob/main/workspaces/bitrise/plugins/bitrise/README.md iconUrl: https://avatars.githubusercontent.com/u/7174390?s=400&v=4 -npmPackageName: '@backstage/plugin-bitrise' +npmPackageName: '@backstage-community/plugin-bitrise' addedDate: '2021-03-01' diff --git a/microsite/data/plugins/conviso-platform.yaml b/microsite/data/plugins/conviso-platform.yaml new file mode 100644 index 0000000000..7017f74a3f --- /dev/null +++ b/microsite/data/plugins/conviso-platform.yaml @@ -0,0 +1,10 @@ +--- +title: Conviso Platform +author: Conviso Application Security +authorUrl: https://convisoappsec.com +category: Security +description: Import your Backstage catalog entities as security assets in Conviso Platform. +documentation: https://github.com/convisoappsec/backstage-plugin-conviso/blob/main/README.md +iconUrl: https://raw.githubusercontent.com/convisoappsec/backstage-plugin-conviso/main/assets/convisoappsec_logo.png +npmPackageName: 'backstage-plugin-conviso' +addedDate: '2025-11-14' diff --git a/microsite/data/plugins/digital.ai-deploy.yaml b/microsite/data/plugins/digital.ai-deploy.yaml index a36dd08ffb..62203a99ea 100644 --- a/microsite/data/plugins/digital.ai-deploy.yaml +++ b/microsite/data/plugins/digital.ai-deploy.yaml @@ -6,7 +6,7 @@ category: CI/CD description: The plugin offers integration with Digital.ai Deploy and backstage components and services. It provide access to deployments and reports. documentation: https://docs.digital.ai/deploy/docs/concept/xl-deploy-backstage-overview iconUrl: /img/digital.ai-deploy.svg -npmPackageName: '@digital.ai/plugin-dai-deploy' +npmPackageName: '@digital-ai/plugin-dai-deploy' tags: - ci - cd diff --git a/microsite/data/plugins/firehydrant.yaml b/microsite/data/plugins/firehydrant.yaml index 7aa00675b4..f5ccd3629d 100644 --- a/microsite/data/plugins/firehydrant.yaml +++ b/microsite/data/plugins/firehydrant.yaml @@ -6,5 +6,5 @@ category: Monitoring description: View service incidents information from FireHydrant, such as active incidents and incident metrics, directly within Backstage. documentation: https://github.com/backstage/community-plugins/blob/main/workspaces/firehydrant/plugins/firehydrant/README.md iconUrl: https://github.com/backstage/community-plugins/blob/main/workspaces/firehydrant/plugins/firehydrant/doc/firehydrant_logo.png -npmPackageName: '@backstage/plugin-firehydrant' +npmPackageName: '@backstage-community/plugin-firehydrant' addedDate: '2021-08-18' diff --git a/microsite/data/plugins/fossa.yaml b/microsite/data/plugins/fossa.yaml index a1a66eb7d6..34610c64e4 100644 --- a/microsite/data/plugins/fossa.yaml +++ b/microsite/data/plugins/fossa.yaml @@ -6,5 +6,5 @@ category: Quality description: View FOSSA license compliance of your components in Backstage. documentation: https://github.com/backstage/community-plugins/blob/main/workspaces/fossa/plugins/fossa/README.md iconUrl: https://avatars0.githubusercontent.com/u/9543448?s=400&v=4 -npmPackageName: '@backstage/plugin-fossa' +npmPackageName: '@backstage-community/plugin-fossa' addedDate: '2020-12-10' diff --git a/microsite/data/plugins/kubernetes-provider.yaml b/microsite/data/plugins/kubernetes-provider.yaml index e0971d55be..b23ab03caa 100644 --- a/microsite/data/plugins/kubernetes-provider.yaml +++ b/microsite/data/plugins/kubernetes-provider.yaml @@ -6,5 +6,5 @@ category: Kubernetes description: Import Kubernetes resources into Backstage Components documentation: https://github.com/AntoineDao/backstage-provider-kubernetes#readme iconUrl: https://avatars.githubusercontent.com/u/13629408 -npmPackageName: https://www.npmjs.com/package/@antoinedao/backstage-provider-kubernetes +npmPackageName: '@antoinedao/backstage-provider-kubernetes' addedDate: '2023-04-10' diff --git a/microsite/data/plugins/linguist.yaml b/microsite/data/plugins/linguist.yaml index fb8e88b747..15b79b3682 100644 --- a/microsite/data/plugins/linguist.yaml +++ b/microsite/data/plugins/linguist.yaml @@ -6,5 +6,5 @@ category: Metadata description: View the programming language break down for your entities within the Software Catalog documentation: https://github.com/backstage/community-plugins/blob/main/workspaces/linguist/plugins/linguist/README.md iconUrl: /img/linguist.svg -npmPackageName: '@backstage/plugin-linguist' +npmPackageName: '@backstage-community/plugin-linguist' addedDate: '2023-06-17' diff --git a/microsite/data/plugins/octopus-deploy.yaml b/microsite/data/plugins/octopus-deploy.yaml index cfc5e2c9e5..eb19f60e72 100644 --- a/microsite/data/plugins/octopus-deploy.yaml +++ b/microsite/data/plugins/octopus-deploy.yaml @@ -6,5 +6,5 @@ category: CI/CD description: Easily view your Octopus Deploy releases within the Software Catalog documentation: https://github.com/backstage/community-plugins/blob/main/workspaces/octopus-deploy/plugins/octopus-deploy/README.md iconUrl: /img/octopus-deploy.svg -npmPackageName: '@backstage/plugin-octopus-deploy' +npmPackageName: '@backstage-community/plugin-octopus-deploy' addedDate: '2023-02-24' diff --git a/microsite/data/plugins/opencost.yaml b/microsite/data/plugins/opencost.yaml index 95973e3b0c..9e98c85bcb 100644 --- a/microsite/data/plugins/opencost.yaml +++ b/microsite/data/plugins/opencost.yaml @@ -6,5 +6,5 @@ category: Monitoring description: OpenCost provides cloud cost monitoring for your cloud native environments. documentation: https://github.com/backstage/community-plugins/blob/main/workspaces/opencost/plugins/opencost/README.md iconUrl: /img/opencost.png -npmPackageName: '@backstage/plugin-opencost' +npmPackageName: '@backstage-community/plugin-opencost' addedDate: '2023-10-26' diff --git a/microsite/data/plugins/puppetdb.yaml b/microsite/data/plugins/puppetdb.yaml index 650d8318d3..26e8bbd3ef 100644 --- a/microsite/data/plugins/puppetdb.yaml +++ b/microsite/data/plugins/puppetdb.yaml @@ -6,7 +6,7 @@ category: Configuration Management description: Visualize resource information and Puppet facts from PuppetDB. documentation: https://github.com/backstage/community-plugins/blob/main/workspaces/puppetdb/plugins/puppetdb/README.md iconUrl: /img/puppet.png -npmPackageName: '@backstage/plugin-puppetdb' +npmPackageName: '@backstage-community/plugin-puppetdb' tags: - puppet - puppetdb diff --git a/microsite/data/plugins/renovate-hoster.yaml b/microsite/data/plugins/renovate-hoster.yaml index 4cf4f65956..06187581bf 100644 --- a/microsite/data/plugins/renovate-hoster.yaml +++ b/microsite/data/plugins/renovate-hoster.yaml @@ -5,5 +5,5 @@ authorUrl: https://github.com/secustor category: Quality description: This plugin enables you to host Renovate CLI yourself inside of Backstage and extract data from it. documentation: https://github.com/secustor/backstage-plugins/tree/main/plugins/renovate -npmPackageName: '@backstage/backstage-plugin-renovate' +npmPackageName: '@secustor/backstage-plugin-renovate' addedDate: '2025-03-31' diff --git a/microsite/data/plugins/shortcuts.yaml b/microsite/data/plugins/shortcuts.yaml index b420e28e2f..7d4e050df0 100644 --- a/microsite/data/plugins/shortcuts.yaml +++ b/microsite/data/plugins/shortcuts.yaml @@ -6,5 +6,5 @@ category: Utility description: The shortcuts plugin allows a user to have easy access to pages within a Backstage app by storing them as "shortcuts" in the Sidebar. documentation: https://github.com/backstage/community-plugins/blob/main/workspaces/shortcuts/plugins/shortcuts/README.md iconUrl: /img/shortcuts.svg -npmPackageName: '@backstage/plugin-shortcuts' +npmPackageName: '@backstage-community/plugin-shortcuts' addedDate: '2021-10-06' diff --git a/microsite/data/plugins/sonarqube.yaml b/microsite/data/plugins/sonarqube.yaml index 72c662e2fa..48793adea9 100644 --- a/microsite/data/plugins/sonarqube.yaml +++ b/microsite/data/plugins/sonarqube.yaml @@ -6,5 +6,5 @@ category: Quality description: Components to display code quality metrics from SonarCloud and SonarQube. documentation: https://github.com/backstage/community-plugins/blob/main/workspaces/sonarqube/plugins/sonarqube/README.md iconUrl: /img/sonarqube-icon.svg -npmPackageName: '@backstage/plugin-sonarqube' +npmPackageName: '@backstage-community/plugin-sonarqube' addedDate: '2020-11-03' diff --git a/microsite/data/plugins/stack-overflow.yaml b/microsite/data/plugins/stack-overflow.yaml index b058ce90fe..373c08de8f 100644 --- a/microsite/data/plugins/stack-overflow.yaml +++ b/microsite/data/plugins/stack-overflow.yaml @@ -6,5 +6,5 @@ category: Discovery description: Provides Stack Overflow specific functionality that can be used in different ways (e.g. for homepage and search) to compose your Backstage App. documentation: https://github.com/backstage/community-plugins/blob/main/workspaces/stack-overflow/plugins/stack-overflow/README.md iconUrl: /img/stack-overflow-logo.svg -npmPackageName: '@backstage/plugin-stack-overflow' +npmPackageName: '@backstage-community/plugin-stack-overflow' addedDate: '2022-06-14' diff --git a/microsite/data/plugins/template-designer.yaml b/microsite/data/plugins/template-designer.yaml index 7994a05430..86aa8a97f0 100644 --- a/microsite/data/plugins/template-designer.yaml +++ b/microsite/data/plugins/template-designer.yaml @@ -6,4 +6,5 @@ category: Productivity description: Template Designer turns blank Backstage YAML into a storyboard-like canvas, guiding anyone through drag-and-drop scaffolder authoring before ever touching code. Rally non-experts, broadcast best practices, and accelerate template launches directly inside Backstage. documentation: https://github.com/tduniec/template-designer-plugin/blob/main/README.md iconUrl: https://raw.githubusercontent.com/tduniec/template-designer-plugin/main/img/logo/templateDesignerLogo.png +npmPackageName: '@tduniec/plugin-template-designer' addedDate: 2025-11-19 diff --git a/microsite/data/plugins/torque.yaml b/microsite/data/plugins/torque.yaml index 1480c3bad9..a469c455fc 100644 --- a/microsite/data/plugins/torque.yaml +++ b/microsite/data/plugins/torque.yaml @@ -8,5 +8,5 @@ description: | Plugin includes an Entity ComponentCard, Backend API route and scaffolder actions. documentation: https://github.com/QualiTorque/torque-backstage-plugin/tree/main/packages/torque#readme iconUrl: https://user-images.githubusercontent.com/8643801/214640977-751bc338-6b77-40a0-a897-cba41b6f006a.png -npmPackageName: '@qtorque/backstage-plugin-torque' +npmPackageName: '@qtorque/backstage-torque-plugin' addedDate: '2023-01-25' diff --git a/microsite/data/plugins/xcmetrics.yaml b/microsite/data/plugins/xcmetrics.yaml index f02b195eb5..09a8b1547f 100644 --- a/microsite/data/plugins/xcmetrics.yaml +++ b/microsite/data/plugins/xcmetrics.yaml @@ -6,5 +6,5 @@ category: Monitoring description: Discover valuable insights hiding inside Xcode’s build logs. documentation: https://xcmetrics.io/ iconUrl: /img/xcmetrics-icon.png -npmPackageName: '@backstage/plugin-xcmetrics' +npmPackageName: '@backstage-community/plugin-xcmetrics' addedDate: '2021-08-06' diff --git a/microsite/package.json b/microsite/package.json index 81985a0e91..a3430545f4 100644 --- a/microsite/package.json +++ b/microsite/package.json @@ -44,11 +44,10 @@ "devDependencies": { "@docusaurus/module-type-aliases": "^3.1.1", "@docusaurus/tsconfig": "^3.1.1", - "@types/luxon": "^3.0.0", "@types/webpack-env": "^1.18.0", "js-yaml": "^4.1.1", "prettier": "^2.6.2", - "typescript": "~5.2.0", + "typescript": "~5.7.0", "yaml-loader": "^0.8.0" } } diff --git a/microsite/sidebars.ts b/microsite/sidebars.ts index 9a4f03620f..a68e81aa4f 100644 --- a/microsite/sidebars.ts +++ b/microsite/sidebars.ts @@ -508,6 +508,7 @@ export default { 'backend-system/core-services/plugin-metadata', 'backend-system/core-services/root-config', 'backend-system/core-services/root-health', + 'backend-system/core-services/root-instance-metadata', 'backend-system/core-services/root-http-router', 'backend-system/core-services/root-lifecycle', 'backend-system/core-services/root-logger', diff --git a/microsite/static/img/cncf-white.svg b/microsite/static/img/cncf-white.svg index c5e3b2af9a..652249b8d8 100644 --- a/microsite/static/img/cncf-white.svg +++ b/microsite/static/img/cncf-white.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/microsite/yarn.lock b/microsite/yarn.lock index 6badb33181..2f6e723889 100644 --- a/microsite/yarn.lock +++ b/microsite/yarn.lock @@ -2961,92 +2961,92 @@ __metadata: languageName: node linkType: hard -"@swc/core-darwin-arm64@npm:1.11.24": - version: 1.11.24 - resolution: "@swc/core-darwin-arm64@npm:1.11.24" +"@swc/core-darwin-arm64@npm:1.15.3": + version: 1.15.3 + resolution: "@swc/core-darwin-arm64@npm:1.15.3" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@swc/core-darwin-x64@npm:1.11.24": - version: 1.11.24 - resolution: "@swc/core-darwin-x64@npm:1.11.24" +"@swc/core-darwin-x64@npm:1.15.3": + version: 1.15.3 + resolution: "@swc/core-darwin-x64@npm:1.15.3" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@swc/core-linux-arm-gnueabihf@npm:1.11.24": - version: 1.11.24 - resolution: "@swc/core-linux-arm-gnueabihf@npm:1.11.24" +"@swc/core-linux-arm-gnueabihf@npm:1.15.3": + version: 1.15.3 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.15.3" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@swc/core-linux-arm64-gnu@npm:1.11.24": - version: 1.11.24 - resolution: "@swc/core-linux-arm64-gnu@npm:1.11.24" +"@swc/core-linux-arm64-gnu@npm:1.15.3": + version: 1.15.3 + resolution: "@swc/core-linux-arm64-gnu@npm:1.15.3" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-arm64-musl@npm:1.11.24": - version: 1.11.24 - resolution: "@swc/core-linux-arm64-musl@npm:1.11.24" +"@swc/core-linux-arm64-musl@npm:1.15.3": + version: 1.15.3 + resolution: "@swc/core-linux-arm64-musl@npm:1.15.3" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@swc/core-linux-x64-gnu@npm:1.11.24": - version: 1.11.24 - resolution: "@swc/core-linux-x64-gnu@npm:1.11.24" +"@swc/core-linux-x64-gnu@npm:1.15.3": + version: 1.15.3 + resolution: "@swc/core-linux-x64-gnu@npm:1.15.3" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-x64-musl@npm:1.11.24": - version: 1.11.24 - resolution: "@swc/core-linux-x64-musl@npm:1.11.24" +"@swc/core-linux-x64-musl@npm:1.15.3": + version: 1.15.3 + resolution: "@swc/core-linux-x64-musl@npm:1.15.3" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@swc/core-win32-arm64-msvc@npm:1.11.24": - version: 1.11.24 - resolution: "@swc/core-win32-arm64-msvc@npm:1.11.24" +"@swc/core-win32-arm64-msvc@npm:1.15.3": + version: 1.15.3 + resolution: "@swc/core-win32-arm64-msvc@npm:1.15.3" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@swc/core-win32-ia32-msvc@npm:1.11.24": - version: 1.11.24 - resolution: "@swc/core-win32-ia32-msvc@npm:1.11.24" +"@swc/core-win32-ia32-msvc@npm:1.15.3": + version: 1.15.3 + resolution: "@swc/core-win32-ia32-msvc@npm:1.15.3" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@swc/core-win32-x64-msvc@npm:1.11.24": - version: 1.11.24 - resolution: "@swc/core-win32-x64-msvc@npm:1.11.24" +"@swc/core-win32-x64-msvc@npm:1.15.3": + version: 1.15.3 + resolution: "@swc/core-win32-x64-msvc@npm:1.15.3" conditions: os=win32 & cpu=x64 languageName: node linkType: hard "@swc/core@npm:^1.3.46": - version: 1.11.24 - resolution: "@swc/core@npm:1.11.24" + version: 1.15.3 + resolution: "@swc/core@npm:1.15.3" dependencies: - "@swc/core-darwin-arm64": "npm:1.11.24" - "@swc/core-darwin-x64": "npm:1.11.24" - "@swc/core-linux-arm-gnueabihf": "npm:1.11.24" - "@swc/core-linux-arm64-gnu": "npm:1.11.24" - "@swc/core-linux-arm64-musl": "npm:1.11.24" - "@swc/core-linux-x64-gnu": "npm:1.11.24" - "@swc/core-linux-x64-musl": "npm:1.11.24" - "@swc/core-win32-arm64-msvc": "npm:1.11.24" - "@swc/core-win32-ia32-msvc": "npm:1.11.24" - "@swc/core-win32-x64-msvc": "npm:1.11.24" + "@swc/core-darwin-arm64": "npm:1.15.3" + "@swc/core-darwin-x64": "npm:1.15.3" + "@swc/core-linux-arm-gnueabihf": "npm:1.15.3" + "@swc/core-linux-arm64-gnu": "npm:1.15.3" + "@swc/core-linux-arm64-musl": "npm:1.15.3" + "@swc/core-linux-x64-gnu": "npm:1.15.3" + "@swc/core-linux-x64-musl": "npm:1.15.3" + "@swc/core-win32-arm64-msvc": "npm:1.15.3" + "@swc/core-win32-ia32-msvc": "npm:1.15.3" + "@swc/core-win32-x64-msvc": "npm:1.15.3" "@swc/counter": "npm:^0.1.3" - "@swc/types": "npm:^0.1.21" + "@swc/types": "npm:^0.1.25" peerDependencies: "@swc/helpers": ">=0.5.17" dependenciesMeta: @@ -3073,7 +3073,7 @@ __metadata: peerDependenciesMeta: "@swc/helpers": optional: true - checksum: 10/0b3e883f8a5652a7ab221a777386ccc8a65fc5b53d533bad15b703b22984eb3b449efd907b1872263f1a9990a9a50612f3c6deb619894a43f03cd974ec9bd1b7 + checksum: 10/280330d82328818138ed64fdcf9ea9abde6b6f16eca65a9d4db27dde06a8dfffd2649f3447d2243387277513c7430fa4142cafcfd64e943d682ce6a713cb8c2d languageName: node linkType: hard @@ -3084,12 +3084,12 @@ __metadata: languageName: node linkType: hard -"@swc/types@npm:^0.1.21": - version: 0.1.21 - resolution: "@swc/types@npm:0.1.21" +"@swc/types@npm:^0.1.25": + version: 0.1.25 + resolution: "@swc/types@npm:0.1.25" dependencies: "@swc/counter": "npm:^0.1.3" - checksum: 10/6554bf5c78519f49099a2ba448d170191a14b1c7a35df848f10ee4d6c03ecd681e5213884905187de1d1d221589ec8b5cb77f477d099dc1627c3ec9d7f2fcdb0 + checksum: 10/f6741450224892d12df43e5ca7f3cc0287df644dcd672626eb0cc2a3a8e3e875f4b29eb11336f37c7240cf6e010ba59eb3a79f4fb8bee5cbd168dfc1326ff369 languageName: node linkType: hard @@ -3328,13 +3328,6 @@ __metadata: languageName: node linkType: hard -"@types/luxon@npm:^3.0.0": - version: 3.4.2 - resolution: "@types/luxon@npm:3.4.2" - checksum: 10/fd89566e3026559f2bc4ddcc1e70a2c16161905ed50be9473ec0cfbbbe919165041408c4f6e06c4bcf095445535052e2c099087c76b1b38e368127e618fc968d - languageName: node - linkType: hard - "@types/mdast@npm:^3.0.0": version: 3.0.15 resolution: "@types/mdast@npm:3.0.15" @@ -4282,7 +4275,6 @@ __metadata: "@docusaurus/types": "npm:^3.1.1" "@mdx-js/react": "npm:^3.0.0" "@swc/core": "npm:^1.3.46" - "@types/luxon": "npm:^3.0.0" "@types/webpack-env": "npm:^1.18.0" clsx: "npm:^2.0.0" docusaurus-plugin-openapi-docs: "npm:^4.3.0" @@ -4297,7 +4289,7 @@ __metadata: react-dom: "npm:^18.0.2" sass: "npm:^1.57.1" swc-loader: "npm:^0.2.3" - typescript: "npm:~5.2.0" + typescript: "npm:~5.7.0" yaml-loader: "npm:^0.8.0" languageName: unknown linkType: soft @@ -4358,23 +4350,23 @@ __metadata: languageName: node linkType: hard -"body-parser@npm:1.20.3": - version: 1.20.3 - resolution: "body-parser@npm:1.20.3" +"body-parser@npm:~1.20.3": + version: 1.20.4 + resolution: "body-parser@npm:1.20.4" dependencies: - bytes: "npm:3.1.2" + bytes: "npm:~3.1.2" content-type: "npm:~1.0.5" debug: "npm:2.6.9" depd: "npm:2.0.0" - destroy: "npm:1.2.0" - http-errors: "npm:2.0.0" - iconv-lite: "npm:0.4.24" - on-finished: "npm:2.4.1" - qs: "npm:6.13.0" - raw-body: "npm:2.5.2" + destroy: "npm:~1.2.0" + http-errors: "npm:~2.0.1" + iconv-lite: "npm:~0.4.24" + on-finished: "npm:~2.4.1" + qs: "npm:~6.14.0" + raw-body: "npm:~2.5.3" type-is: "npm:~1.6.18" - unpipe: "npm:1.0.0" - checksum: 10/8723e3d7a672eb50854327453bed85ac48d045f4958e81e7d470c56bf111f835b97e5b73ae9f6393d0011cc9e252771f46fd281bbabc57d33d3986edf1e6aeca + unpipe: "npm:~1.0.0" + checksum: 10/ff67e28d3f426707be8697a75fdf8d564dc50c341b41f054264d8ab6e2924e519c7ce8acc9d0de05328fdc41e1d9f3f200aec9c1cfb1867d6b676a410d97c689 languageName: node linkType: hard @@ -4591,7 +4583,7 @@ __metadata: languageName: node linkType: hard -"bytes@npm:3.1.2": +"bytes@npm:~3.1.2": version: 3.1.2 resolution: "bytes@npm:3.1.2" checksum: 10/a10abf2ba70c784471d6b4f58778c0beeb2b5d405148e66affa91f23a9f13d07603d0a0354667310ae1d6dc141474ffd44e2a074be0f6e2254edb8fc21445388 @@ -5223,7 +5215,7 @@ __metadata: languageName: node linkType: hard -"content-disposition@npm:0.5.4": +"content-disposition@npm:~0.5.4": version: 0.5.4 resolution: "content-disposition@npm:0.5.4" dependencies: @@ -5246,17 +5238,17 @@ __metadata: languageName: node linkType: hard -"cookie-signature@npm:1.0.6": - version: 1.0.6 - resolution: "cookie-signature@npm:1.0.6" - checksum: 10/f4e1b0a98a27a0e6e66fd7ea4e4e9d8e038f624058371bf4499cfcd8f3980be9a121486995202ba3fca74fbed93a407d6d54d43a43f96fd28d0bd7a06761591a +"cookie-signature@npm:~1.0.6": + version: 1.0.7 + resolution: "cookie-signature@npm:1.0.7" + checksum: 10/1a62808cd30d15fb43b70e19829b64d04b0802d8ef00275b57d152de4ae6a3208ca05c197b6668d104c4d9de389e53ccc2d3bc6bcaaffd9602461417d8c40710 languageName: node linkType: hard -"cookie@npm:0.6.0": - version: 0.6.0 - resolution: "cookie@npm:0.6.0" - checksum: 10/c1f8f2ea7d443b9331680598b0ae4e6af18a618c37606d1bbdc75bec8361cce09fe93e727059a673f2ba24467131a9fb5a4eec76bb1b149c1b3e1ccb268dc583 +"cookie@npm:~0.7.1": + version: 0.7.2 + resolution: "cookie@npm:0.7.2" + checksum: 10/24b286c556420d4ba4e9bc09120c9d3db7d28ace2bd0f8ccee82422ce42322f73c8312441271e5eefafbead725980e5996cc02766dbb89a90ac7f5636ede608f languageName: node linkType: hard @@ -5772,7 +5764,7 @@ __metadata: languageName: node linkType: hard -"depd@npm:2.0.0": +"depd@npm:2.0.0, depd@npm:~2.0.0": version: 2.0.0 resolution: "depd@npm:2.0.0" checksum: 10/c0c8ff36079ce5ada64f46cc9d6fd47ebcf38241105b6e0c98f412e8ad91f084bcf906ff644cc3a4bd876ca27a62accb8b0fff72ea6ed1a414b89d8506f4a5ca @@ -5803,7 +5795,7 @@ __metadata: languageName: node linkType: hard -"destroy@npm:1.2.0": +"destroy@npm:1.2.0, destroy@npm:~1.2.0": version: 1.2.0 resolution: "destroy@npm:1.2.0" checksum: 10/0acb300b7478a08b92d810ab229d5afe0d2f4399272045ab22affa0d99dbaf12637659411530a6fcd597a9bdac718fc94373a61a95b4651bbc7b83684a565e38 @@ -5914,8 +5906,8 @@ __metadata: linkType: hard "docusaurus-plugin-openapi-docs@npm:^4.3.0": - version: 4.3.7 - resolution: "docusaurus-plugin-openapi-docs@npm:4.3.7" + version: 4.5.1 + resolution: "docusaurus-plugin-openapi-docs@npm:4.5.1" dependencies: "@apidevtools/json-schema-ref-parser": "npm:^11.5.4" "@redocly/openapi-core": "npm:^1.10.5" @@ -5937,7 +5929,7 @@ __metadata: "@docusaurus/utils": ^3.5.0 "@docusaurus/utils-validation": ^3.5.0 react: ^16.8.4 || ^17.0.0 || ^18.0.0 || ^19.0.0 - checksum: 10/ad011358b13fd5e574e33ad3e1b2bb002226e2dcab72e6a8c98c4ad5436a81e28815afe6f14252a48bb52f0c088b03dfd93a5955a8a6883fbda794bebf7d1792 + checksum: 10/496ce49d494f06803a61eaa6c6810782668269574c12a1a55315742974884a7ffd6e2c75875d8fd9909611bdccaa4de42419e0debbf47def0db6974617b9e5ba languageName: node linkType: hard @@ -6541,41 +6533,41 @@ __metadata: linkType: hard "express@npm:^4.17.3": - version: 4.21.0 - resolution: "express@npm:4.21.0" + version: 4.22.1 + resolution: "express@npm:4.22.1" dependencies: accepts: "npm:~1.3.8" array-flatten: "npm:1.1.1" - body-parser: "npm:1.20.3" - content-disposition: "npm:0.5.4" + body-parser: "npm:~1.20.3" + content-disposition: "npm:~0.5.4" content-type: "npm:~1.0.4" - cookie: "npm:0.6.0" - cookie-signature: "npm:1.0.6" + cookie: "npm:~0.7.1" + cookie-signature: "npm:~1.0.6" debug: "npm:2.6.9" depd: "npm:2.0.0" encodeurl: "npm:~2.0.0" escape-html: "npm:~1.0.3" etag: "npm:~1.8.1" - finalhandler: "npm:1.3.1" - fresh: "npm:0.5.2" - http-errors: "npm:2.0.0" + finalhandler: "npm:~1.3.1" + fresh: "npm:~0.5.2" + http-errors: "npm:~2.0.0" merge-descriptors: "npm:1.0.3" methods: "npm:~1.1.2" - on-finished: "npm:2.4.1" + on-finished: "npm:~2.4.1" parseurl: "npm:~1.3.3" - path-to-regexp: "npm:0.1.10" + path-to-regexp: "npm:~0.1.12" proxy-addr: "npm:~2.0.7" - qs: "npm:6.13.0" + qs: "npm:~6.14.0" range-parser: "npm:~1.2.1" safe-buffer: "npm:5.2.1" - send: "npm:0.19.0" - serve-static: "npm:1.16.2" + send: "npm:~0.19.0" + serve-static: "npm:~1.16.2" setprototypeof: "npm:1.2.0" - statuses: "npm:2.0.1" + statuses: "npm:~2.0.1" type-is: "npm:~1.6.18" utils-merge: "npm:1.0.1" vary: "npm:~1.1.2" - checksum: 10/3b1ee5bc5b1bd996f688702519cebc9b63a24e506965f6e1773268238cfa2c24ffdb38cc3fcb4fde66f77de1c0bebd9ee058dad06bb9c6f084b525f3c09164d3 + checksum: 10/f33c1bd0c7d36e2a1f18de9cdc176469d32f68e20258d2941b8d296ab9a4fd9011872c246391bf87714f009fac5114c832ec5ac65cbee39421f1258801eb8470 languageName: node linkType: hard @@ -6723,18 +6715,18 @@ __metadata: languageName: node linkType: hard -"finalhandler@npm:1.3.1": - version: 1.3.1 - resolution: "finalhandler@npm:1.3.1" +"finalhandler@npm:~1.3.1": + version: 1.3.2 + resolution: "finalhandler@npm:1.3.2" dependencies: debug: "npm:2.6.9" encodeurl: "npm:~2.0.0" escape-html: "npm:~1.0.3" - on-finished: "npm:2.4.1" + on-finished: "npm:~2.4.1" parseurl: "npm:~1.3.3" - statuses: "npm:2.0.1" + statuses: "npm:~2.0.2" unpipe: "npm:~1.0.0" - checksum: 10/4babe72969b7373b5842bc9f75c3a641a4d0f8eb53af6b89fa714d4460ce03fb92b28de751d12ba415e96e7e02870c436d67412120555e2b382640535697305b + checksum: 10/6cb4f9f80eaeb5a0fac4fdbd27a65d39271f040a0034df16556d896bfd855fd42f09da886781b3102117ea8fceba97b903c1f8b08df1fb5740576d5e0f481eed languageName: node linkType: hard @@ -6872,7 +6864,7 @@ __metadata: languageName: node linkType: hard -"fresh@npm:0.5.2": +"fresh@npm:0.5.2, fresh@npm:~0.5.2": version: 0.5.2 resolution: "fresh@npm:0.5.2" checksum: 10/64c88e489b5d08e2f29664eb3c79c705ff9a8eb15d3e597198ef76546d4ade295897a44abb0abd2700e7ef784b2e3cbf1161e4fbf16f59129193fd1030d16da1 @@ -7751,6 +7743,19 @@ __metadata: languageName: node linkType: hard +"http-errors@npm:~2.0.0, http-errors@npm:~2.0.1": + version: 2.0.1 + resolution: "http-errors@npm:2.0.1" + dependencies: + depd: "npm:~2.0.0" + inherits: "npm:~2.0.4" + setprototypeof: "npm:~1.2.0" + statuses: "npm:~2.0.2" + toidentifier: "npm:~1.0.1" + checksum: 10/9fe31bc0edf36566c87048aed1d3d0cbe03552564adc3541626a0613f542d753fbcb13bdfcec0a3a530dbe1714bb566c89d46244616b66bddd26ac413b06a207 + languageName: node + linkType: hard + "http-parser-js@npm:>=0.5.1": version: 0.5.8 resolution: "http-parser-js@npm:0.5.8" @@ -7865,15 +7870,6 @@ __metadata: languageName: node linkType: hard -"iconv-lite@npm:0.4.24": - version: 0.4.24 - resolution: "iconv-lite@npm:0.4.24" - dependencies: - safer-buffer: "npm:>= 2.1.2 < 3" - checksum: 10/6d3a2dac6e5d1fb126d25645c25c3a1209f70cceecc68b8ef51ae0da3cdc078c151fade7524a30b12a3094926336831fca09c666ef55b37e2c69638b5d6bd2e3 - languageName: node - linkType: hard - "iconv-lite@npm:0.6.3, iconv-lite@npm:^0.6.2": version: 0.6.3 resolution: "iconv-lite@npm:0.6.3" @@ -7883,6 +7879,15 @@ __metadata: languageName: node linkType: hard +"iconv-lite@npm:~0.4.24": + version: 0.4.24 + resolution: "iconv-lite@npm:0.4.24" + dependencies: + safer-buffer: "npm:>= 2.1.2 < 3" + checksum: 10/6d3a2dac6e5d1fb126d25645c25c3a1209f70cceecc68b8ef51ae0da3cdc078c151fade7524a30b12a3094926336831fca09c666ef55b37e2c69638b5d6bd2e3 + languageName: node + linkType: hard + "icss-utils@npm:^5.0.0, icss-utils@npm:^5.1.0": version: 5.1.0 resolution: "icss-utils@npm:5.1.0" @@ -8904,9 +8909,9 @@ __metadata: linkType: hard "luxon@npm:^3.0.0": - version: 3.5.0 - resolution: "luxon@npm:3.5.0" - checksum: 10/48f86e6c1c96815139f8559456a3354a276ba79bcef0ae0d4f2172f7652f3ba2be2237b0e103b8ea0b79b47715354ac9fac04eb1db3485dcc72d5110491dd47f + version: 3.7.2 + resolution: "luxon@npm:3.7.2" + checksum: 10/b24cd205ed306ce7415991687897dcc4027921ae413c9116590bc33a95f93b86ce52cf74ba72b4f5c5ab1c10090517f54ac8edfb127c049e0bf55b90dc2260be languageName: node linkType: hard @@ -10631,9 +10636,9 @@ __metadata: linkType: hard "node-forge@npm:^1": - version: 1.3.1 - resolution: "node-forge@npm:1.3.1" - checksum: 10/05bab6868633bf9ad4c3b1dd50ec501c22ffd69f556cdf169a00998ca1d03e8107a6032ba013852f202035372021b845603aeccd7dfcb58cdb7430013b3daa8d + version: 1.3.2 + resolution: "node-forge@npm:1.3.2" + checksum: 10/dcc54aaffe0cf52367214a20c0032aa9b209d9095dd14526504f1972d1900a07e96046b3684cb0c8d0cc3d48744dd18e02b7b447ab28fac615ffb850beeabf18 languageName: node linkType: hard @@ -10909,7 +10914,7 @@ __metadata: languageName: node linkType: hard -"on-finished@npm:2.4.1": +"on-finished@npm:2.4.1, on-finished@npm:~2.4.1": version: 2.4.1 resolution: "on-finished@npm:2.4.1" dependencies: @@ -11287,13 +11292,6 @@ __metadata: languageName: node linkType: hard -"path-to-regexp@npm:0.1.10": - version: 0.1.10 - resolution: "path-to-regexp@npm:0.1.10" - checksum: 10/894e31f1b20e592732a87db61fff5b95c892a3fe430f9ab18455ebe69ee88ef86f8eb49912e261f9926fc53da9f93b46521523e33aefd9cb0a7b0d85d7096006 - languageName: node - linkType: hard - "path-to-regexp@npm:2.2.1": version: 2.2.1 resolution: "path-to-regexp@npm:2.2.1" @@ -11310,6 +11308,13 @@ __metadata: languageName: node linkType: hard +"path-to-regexp@npm:~0.1.12": + version: 0.1.12 + resolution: "path-to-regexp@npm:0.1.12" + checksum: 10/2e30f6a0144679c1f95c98e166b96e6acd1e72be9417830fefc8de7ac1992147eb9a4c7acaa59119fb1b3c34eec393b2129ef27e24b2054a3906fc4fb0d1398e + languageName: node + linkType: hard + "path-type@npm:^4.0.0": version: 4.0.0 resolution: "path-type@npm:4.0.0" @@ -12049,16 +12054,7 @@ __metadata: languageName: node linkType: hard -"qs@npm:6.13.0": - version: 6.13.0 - resolution: "qs@npm:6.13.0" - dependencies: - side-channel: "npm:^1.0.6" - checksum: 10/f548b376e685553d12e461409f0d6e5c59ec7c7d76f308e2a888fd9db3e0c5e89902bedd0754db3a9038eda5f27da2331a6f019c8517dc5e0a16b3c9a6e9cef8 - languageName: node - linkType: hard - -"qs@npm:^6.12.3": +"qs@npm:^6.12.3, qs@npm:~6.14.0": version: 6.14.0 resolution: "qs@npm:6.14.0" dependencies: @@ -12130,15 +12126,15 @@ __metadata: languageName: node linkType: hard -"raw-body@npm:2.5.2": - version: 2.5.2 - resolution: "raw-body@npm:2.5.2" +"raw-body@npm:~2.5.3": + version: 2.5.3 + resolution: "raw-body@npm:2.5.3" dependencies: - bytes: "npm:3.1.2" - http-errors: "npm:2.0.0" - iconv-lite: "npm:0.4.24" - unpipe: "npm:1.0.0" - checksum: 10/863b5171e140546a4d99f349b720abac4410338e23df5e409cfcc3752538c9caf947ce382c89129ba976f71894bd38b5806c774edac35ebf168d02aa1ac11a95 + bytes: "npm:~3.1.2" + http-errors: "npm:~2.0.1" + iconv-lite: "npm:~0.4.24" + unpipe: "npm:~1.0.0" + checksum: 10/f35759fe5a6548e7c529121ead1de4dd163f899749a5896c42e278479df2d9d7f98b5bb17312737c03617765e5a1433e586f717616e5cfbebc13b4738b820601 languageName: node linkType: hard @@ -13059,8 +13055,8 @@ __metadata: linkType: hard "sass@npm:^1.57.1, sass@npm:^1.80.4": - version: 1.83.4 - resolution: "sass@npm:1.83.4" + version: 1.94.2 + resolution: "sass@npm:1.94.2" dependencies: "@parcel/watcher": "npm:^2.4.1" chokidar: "npm:^4.0.0" @@ -13071,7 +13067,7 @@ __metadata: optional: true bin: sass: sass.js - checksum: 10/9a7d1c6be1a9e711a1c561d189b9816aa7715f6d0ec0b2ec181f64163788d0caaf4741924eeadce558720b58b1de0e9b21b9dae6a0d14489c4d2a142d3f3b12e + checksum: 10/e60c214ea93677740c9ddfad55c77fd433255bbfdd9faba137acf1215bed5ba6ad9d83efea81feb87a89283931d01f0435227e3fff37c65c263e0ee05f885328 languageName: node linkType: hard @@ -13199,6 +13195,27 @@ __metadata: languageName: node linkType: hard +"send@npm:~0.19.0": + version: 0.19.1 + resolution: "send@npm:0.19.1" + dependencies: + debug: "npm:2.6.9" + depd: "npm:2.0.0" + destroy: "npm:1.2.0" + encodeurl: "npm:~2.0.0" + escape-html: "npm:~1.0.3" + etag: "npm:~1.8.1" + fresh: "npm:0.5.2" + http-errors: "npm:2.0.0" + mime: "npm:1.6.0" + ms: "npm:2.1.3" + on-finished: "npm:2.4.1" + range-parser: "npm:~1.2.1" + statuses: "npm:2.0.1" + checksum: 10/360bf50a839c7bbc181f67c3a0f3424a7ad8016dfebcd9eb90891f4b762b4377da14414c32250d67b53872e884171c27469110626f6c22765caa7c38c207ee1d + languageName: node + linkType: hard + "serialize-javascript@npm:^6.0.0, serialize-javascript@npm:^6.0.1": version: 6.0.2 resolution: "serialize-javascript@npm:6.0.2" @@ -13239,7 +13256,7 @@ __metadata: languageName: node linkType: hard -"serve-static@npm:1.16.2": +"serve-static@npm:~1.16.2": version: 1.16.2 resolution: "serve-static@npm:1.16.2" dependencies: @@ -13286,7 +13303,7 @@ __metadata: languageName: node linkType: hard -"setprototypeof@npm:1.2.0": +"setprototypeof@npm:1.2.0, setprototypeof@npm:~1.2.0": version: 1.2.0 resolution: "setprototypeof@npm:1.2.0" checksum: 10/fde1630422502fbbc19e6844346778f99d449986b2f9cdcceb8326730d2f3d9964dbcb03c02aaadaefffecd0f2c063315ebea8b3ad895914bf1afc1747fc172e @@ -13449,7 +13466,7 @@ __metadata: languageName: node linkType: hard -"side-channel@npm:^1.0.6, side-channel@npm:^1.1.0": +"side-channel@npm:^1.1.0": version: 1.1.0 resolution: "side-channel@npm:1.1.0" dependencies: @@ -13696,6 +13713,13 @@ __metadata: languageName: node linkType: hard +"statuses@npm:~2.0.1, statuses@npm:~2.0.2": + version: 2.0.2 + resolution: "statuses@npm:2.0.2" + checksum: 10/6927feb50c2a75b2a4caab2c565491f7a93ad3d8dbad7b1398d52359e9243a20e2ebe35e33726dee945125ef7a515e9097d8a1b910ba2bbd818265a2f6c39879 + languageName: node + linkType: hard + "std-env@npm:^3.0.1": version: 3.3.1 resolution: "std-env@npm:3.3.1" @@ -14119,7 +14143,7 @@ __metadata: languageName: node linkType: hard -"toidentifier@npm:1.0.1": +"toidentifier@npm:1.0.1, toidentifier@npm:~1.0.1": version: 1.0.1 resolution: "toidentifier@npm:1.0.1" checksum: 10/952c29e2a85d7123239b5cfdd889a0dde47ab0497f0913d70588f19c53f7e0b5327c95f4651e413c74b785147f9637b17410ac8c846d5d4a20a5a33eb6dc3a45 @@ -14226,23 +14250,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:~5.2.0": - version: 5.2.2 - resolution: "typescript@npm:5.2.2" +"typescript@npm:~5.7.0": + version: 5.7.3 + resolution: "typescript@npm:5.7.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10/d65e50eb849bd21ff8677e5b9447f9c6e74777e346afd67754934264dcbf4bd59e7d2473f6062d9a015d66bd573311166357e3eb07fea0b52859cf9bb2b58555 + checksum: 10/6a7e556de91db3d34dc51cd2600e8e91f4c312acd8e52792f243c7818dfadb27bae677175fad6947f9c81efb6c57eb6b2d0c736f196a6ee2f1f7d57b74fc92fa languageName: node linkType: hard -"typescript@patch:typescript@npm%3A~5.2.0#optional!builtin": - version: 5.2.2 - resolution: "typescript@patch:typescript@npm%3A5.2.2#optional!builtin::version=5.2.2&hash=f3b441" +"typescript@patch:typescript@npm%3A~5.7.0#optional!builtin": + version: 5.7.3 + resolution: "typescript@patch:typescript@npm%3A5.7.3#optional!builtin::version=5.7.3&hash=5786d5" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10/f79cc2ba802c94c2b78dbb00d767a10adb67368ae764709737dc277273ec148aa4558033a03ce901406b35fddf4eac46dabc94a1e1d12d2587e2b9cfe5707b4a + checksum: 10/dc58d777eb4c01973f7fbf1fd808aad49a0efdf545528dab9b07d94fdcb65b8751742804c3057e9619a4627f2d9cc85547fdd49d9f4326992ad0181b49e61d81 languageName: node linkType: hard @@ -14470,7 +14494,7 @@ __metadata: languageName: node linkType: hard -"unpipe@npm:1.0.0, unpipe@npm:~1.0.0": +"unpipe@npm:~1.0.0": version: 1.0.0 resolution: "unpipe@npm:1.0.0" checksum: 10/4fa18d8d8d977c55cb09715385c203197105e10a6d220087ec819f50cb68870f02942244f1017565484237f1f8c5d3cd413631b1ae104d3096f24fdfde1b4aa2 diff --git a/package.json b/package.json index 9fb5cd4a7f..caef1349f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "root", - "version": "1.46.0-next.0", + "version": "1.46.0-next.2", "backstage": { "cli": { "new": { @@ -146,7 +146,7 @@ "@techdocs/cli": "workspace:*", "@types/cacheable-request": "^8.3.6", "@types/memjs": "^1.3.3", - "@types/node": "^20.16.0", + "@types/node": "^22.13.14", "@types/webpack": "^5.28.0", "array-to-table": "^1.0.1", "command-exists": "^1.2.9", @@ -158,6 +158,7 @@ "eslint-plugin-testing-library": "^6.0.0", "fs-extra": "^11.2.0", "husky": "^9.0.0", + "js-yaml": "^4.1.1", "lint-staged": "^15.0.0", "madge": "^8.0.0", "minimist": "^1.2.5", @@ -175,7 +176,7 @@ }, "packageManager": "yarn@4.8.1", "engines": { - "node": "20 || 22" + "node": "22 || 24" }, "madge": { "fileExtensions": [ diff --git a/packages/app-next/CHANGELOG.md b/packages/app-next/CHANGELOG.md index 55ac9f8713..0a38482bab 100644 --- a/packages/app-next/CHANGELOG.md +++ b/packages/app-next/CHANGELOG.md @@ -1,5 +1,69 @@ # example-app-next +## 0.0.30-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/core-app-api@1.19.3-next.1 + - @backstage/cli@0.35.0-next.2 + - @backstage/plugin-catalog-graph@0.5.4-next.1 + - @backstage/plugin-api-docs@0.13.2-next.1 + - @backstage/plugin-techdocs@1.16.1-next.2 + - @backstage/plugin-catalog@1.32.1-next.1 + - @backstage/plugin-search@1.5.1-next.1 + - @backstage/plugin-app@0.3.3-next.1 + - @backstage/plugin-org@0.6.47-next.1 + - @backstage/frontend-plugin-api@0.13.2-next.1 + - @backstage/plugin-scaffolder-react@1.19.4-next.2 + - @backstage/plugin-catalog-react@1.21.4-next.2 + - @backstage/core-components@0.18.4-next.2 + - @backstage/plugin-home@0.8.15-next.1 + - @backstage/plugin-scaffolder@1.34.4-next.1 + - @backstage/plugin-kubernetes-cluster@0.0.32-next.2 + - @backstage/app-defaults@1.7.3-next.0 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/core-compat-api@0.5.5-next.0 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/frontend-app-api@0.13.3-next.0 + - @backstage/frontend-defaults@0.3.4-next.0 + - @backstage/integration-react@1.2.13-next.0 + - @backstage/theme@0.7.1-next.0 + - @backstage/ui@0.10.0-next.1 + - @backstage/plugin-app-visualizer@0.1.26-next.1 + - @backstage/plugin-auth@0.1.3-next.0 + - @backstage/plugin-auth-react@0.1.22-next.0 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-import@0.13.8-next.0 + - @backstage/plugin-catalog-unprocessed-entities@0.2.24-next.1 + - @backstage/plugin-kubernetes@0.12.14-next.1 + - @backstage/plugin-notifications@0.5.12-next.0 + - @backstage/plugin-permission-react@0.4.39-next.0 + - @backstage/plugin-search-common@1.2.21 + - @backstage/plugin-search-react@1.10.1-next.0 + - @backstage/plugin-signals@0.0.26-next.0 + - @backstage/plugin-techdocs-module-addons-contrib@1.1.31-next.1 + - @backstage/plugin-techdocs-react@1.3.6-next.0 + - @backstage/plugin-user-settings@0.8.30-next.0 + +## 0.0.30-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/ui@0.10.0-next.1 + - @backstage/core-components@0.18.4-next.1 + - @backstage/plugin-techdocs-module-addons-contrib@1.1.31-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.1 + - @backstage/plugin-scaffolder-react@1.19.4-next.1 + - @backstage/plugin-catalog-unprocessed-entities@0.2.24-next.1 + - @backstage/cli@0.34.6-next.1 + - @backstage/plugin-techdocs@1.16.1-next.1 + - @backstage/plugin-app-visualizer@0.1.26-next.1 + - @backstage/plugin-kubernetes@0.12.14-next.1 + - @backstage/plugin-kubernetes-cluster@0.0.32-next.1 + ## 0.0.30-next.0 ### Patch Changes diff --git a/packages/app-next/app-config.yaml b/packages/app-next/app-config.yaml index dcaddfb9bf..1121cfc0d5 100644 --- a/packages/app-next/app-config.yaml +++ b/packages/app-next/app-config.yaml @@ -21,6 +21,11 @@ app: ownerEntityRefs: [cubic-belugas] extensions: + # set availableLanguages example + - api:app/app-language: + config: + availableLanguages: ['en', 'es', 'fr', 'de', 'ja'] + defaultLanguage: 'en' - entity-card:org/members-list: config: showAggregateMembersToggle: true diff --git a/packages/app-next/package.json b/packages/app-next/package.json index 63a5b4c2dc..c6d1ae36cc 100644 --- a/packages/app-next/package.json +++ b/packages/app-next/package.json @@ -1,6 +1,6 @@ { "name": "example-app-next", - "version": "0.0.30-next.0", + "version": "0.0.30-next.2", "backstage": { "role": "frontend" }, diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index fd258fef5d..ec083df48f 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,65 @@ # example-app +## 0.2.116-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/core-app-api@1.19.3-next.1 + - @backstage/cli@0.35.0-next.2 + - @backstage/plugin-catalog-graph@0.5.4-next.1 + - @backstage/plugin-api-docs@0.13.2-next.1 + - @backstage/plugin-techdocs@1.16.1-next.2 + - @backstage/plugin-catalog@1.32.1-next.1 + - @backstage/plugin-search@1.5.1-next.1 + - @backstage/plugin-org@0.6.47-next.1 + - @backstage/plugin-scaffolder-react@1.19.4-next.2 + - @backstage/plugin-catalog-react@1.21.4-next.2 + - @backstage/core-components@0.18.4-next.2 + - @backstage/plugin-home@0.8.15-next.1 + - @backstage/plugin-scaffolder@1.34.4-next.1 + - @backstage/plugin-kubernetes-cluster@0.0.32-next.2 + - @backstage/app-defaults@1.7.3-next.0 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/frontend-app-api@0.13.3-next.0 + - @backstage/integration-react@1.2.13-next.0 + - @backstage/theme@0.7.1-next.0 + - @backstage/ui@0.10.0-next.1 + - @backstage/plugin-auth-react@0.1.22-next.0 + - @backstage/plugin-catalog-common@1.1.7 + - @backstage/plugin-catalog-import@0.13.8-next.0 + - @backstage/plugin-catalog-unprocessed-entities@0.2.24-next.1 + - @backstage/plugin-devtools@0.1.34-next.0 + - @backstage/plugin-kubernetes@0.12.14-next.1 + - @backstage/plugin-mui-to-bui@0.2.2-next.1 + - @backstage/plugin-notifications@0.5.12-next.0 + - @backstage/plugin-permission-react@0.4.39-next.0 + - @backstage/plugin-search-common@1.2.21 + - @backstage/plugin-search-react@1.10.1-next.0 + - @backstage/plugin-signals@0.0.26-next.0 + - @backstage/plugin-techdocs-module-addons-contrib@1.1.31-next.1 + - @backstage/plugin-techdocs-react@1.3.6-next.0 + - @backstage/plugin-user-settings@0.8.30-next.0 + +## 0.2.116-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/ui@0.10.0-next.1 + - @backstage/core-components@0.18.4-next.1 + - @backstage/plugin-techdocs-module-addons-contrib@1.1.31-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.1 + - @backstage/plugin-scaffolder-react@1.19.4-next.1 + - @backstage/plugin-catalog-unprocessed-entities@0.2.24-next.1 + - @backstage/cli@0.34.6-next.1 + - @backstage/plugin-techdocs@1.16.1-next.1 + - @backstage/plugin-mui-to-bui@0.2.2-next.1 + - @backstage/plugin-kubernetes@0.12.14-next.1 + - @backstage/plugin-kubernetes-cluster@0.0.32-next.1 + ## 0.2.116-next.0 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index d2be43b03c..6e6f1dd52d 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "example-app", - "version": "0.2.116-next.0", + "version": "0.2.116-next.2", "backstage": { "role": "frontend" }, diff --git a/packages/app/src/components/devtools/CustomDevToolsPage.tsx b/packages/app/src/components/devtools/CustomDevToolsPage.tsx index d1c68d9884..0fe17b14c3 100644 --- a/packages/app/src/components/devtools/CustomDevToolsPage.tsx +++ b/packages/app/src/components/devtools/CustomDevToolsPage.tsx @@ -18,6 +18,7 @@ import { ConfigContent, ExternalDependenciesContent, InfoContent, + ScheduledTasksContent, } from '@backstage/plugin-devtools'; import { DevToolsLayout } from '@backstage/plugin-devtools'; import { UnprocessedEntitiesContent } from '@backstage/plugin-catalog-unprocessed-entities'; @@ -31,6 +32,9 @@ const DevToolsPage = () => { + + + ; +// @alpha +export const rootSystemMetadataServiceFactory: ServiceFactory< + RootSystemMetadataService, + 'root', + 'singleton' +>; + // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-defaults/src/alpha/entrypoints/rootSystemMetadata/RootSystemMetadataService.test.ts b/packages/backend-defaults/src/alpha/entrypoints/rootSystemMetadata/RootSystemMetadataService.test.ts new file mode 100644 index 0000000000..13da5ae3c0 --- /dev/null +++ b/packages/backend-defaults/src/alpha/entrypoints/rootSystemMetadata/RootSystemMetadataService.test.ts @@ -0,0 +1,144 @@ +/* + * Copyright 2025 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { mockServices, startTestBackend } from '@backstage/backend-test-utils'; +import { + coreServices, + createBackendPlugin, + createServiceFactory, +} from '@backstage/backend-plugin-api'; +import Router from 'express-promise-router'; +import request from 'supertest'; +import { rootSystemMetadataServiceFactory } from './rootSystemMetadataServiceFactory'; +import { rootSystemMetadataServiceRef } from '@backstage/backend-plugin-api/alpha'; + +describe('SystemMetadataService', () => { + describe('returns plugins from config', () => { + const testPlugin = createBackendPlugin({ + pluginId: 'test-plugin', + register(reg) { + reg.registerInit({ + deps: { + systemMetadata: rootSystemMetadataServiceRef, + rootHttpRouter: coreServices.rootHttpRouter, + }, + init: async ({ systemMetadata, rootHttpRouter }) => { + const router = Router(); + router.use('/plugins', async (_, res) => { + res.json(await systemMetadata.getInstalledPlugins()); + }); + rootHttpRouter.use('/systemMetadata', router); + }, + }); + }, + }); + + it('should list all known instances', async () => { + const { server } = await startTestBackend({ + features: [ + testPlugin, + rootSystemMetadataServiceFactory, + mockServices.rootConfig.factory({ + data: { + backend: { + listen: { + port: 0, + }, + baseUrl: `http://localhost:0`, + }, + }, + }), + ], + }); + + const instanceResponse = await request(server).get( + `/systemMetadata/plugins`, + ); + + expect(instanceResponse.status).toBe(200); + expect(instanceResponse.body).toMatchObject([ + { + pluginId: 'test-plugin', + }, + ]); + }); + + it('should react to config updates', async () => { + const config = mockServices.rootConfig({ + data: { + backend: { + listen: { + port: 0, + }, + baseUrl: `http://localhost:0`, + }, + }, + }); + const configFactory = createServiceFactory({ + service: coreServices.rootConfig, + deps: {}, + factory: () => config, + }); + const { server } = await startTestBackend({ + features: [testPlugin, configFactory, rootSystemMetadataServiceFactory], + }); + + const initialResponse = await request(server).get( + `/systemMetadata/plugins`, + ); + + expect(initialResponse.status).toBe(200); + expect(initialResponse.body).toMatchObject([ + { + pluginId: 'test-plugin', + }, + ]); + + config.update({ + data: { + backend: { + listen: { + port: 0, + }, + baseUrl: `http://localhost:0`, + }, + discovery: { + endpoints: [ + { + target: `http://test.internal`, + plugins: ['your-new-plugin'], + }, + ], + }, + }, + }); + + const responseAfterUpdate = await request(server).get( + `/systemMetadata/plugins`, + ); + + expect(responseAfterUpdate.status).toBe(200); + expect(responseAfterUpdate.body).toMatchObject([ + { + pluginId: 'your-new-plugin', + }, + { + pluginId: 'test-plugin', + }, + ]); + }); + }); +}); diff --git a/packages/backend-defaults/src/alpha/entrypoints/rootSystemMetadata/index.ts b/packages/backend-defaults/src/alpha/entrypoints/rootSystemMetadata/index.ts new file mode 100644 index 0000000000..cff4eccdbe --- /dev/null +++ b/packages/backend-defaults/src/alpha/entrypoints/rootSystemMetadata/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export { rootSystemMetadataServiceFactory } from './rootSystemMetadataServiceFactory'; +export { DefaultRootSystemMetadataService } from './lib/DefaultRootSystemMetadataService'; diff --git a/packages/backend-defaults/src/alpha/entrypoints/rootSystemMetadata/lib/DefaultRootSystemMetadataService.ts b/packages/backend-defaults/src/alpha/entrypoints/rootSystemMetadata/lib/DefaultRootSystemMetadataService.ts new file mode 100644 index 0000000000..edbffdfb0e --- /dev/null +++ b/packages/backend-defaults/src/alpha/entrypoints/rootSystemMetadata/lib/DefaultRootSystemMetadataService.ts @@ -0,0 +1,74 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + LoggerService, + RootConfigService, + RootInstanceMetadataService, +} from '@backstage/backend-plugin-api'; +import { + RootSystemMetadataService, + RootSystemMetadataServicePluginInfo, +} from '@backstage/backend-plugin-api/alpha'; +import { getEndpoints } from '../../../../entrypoints/discovery/parsing'; +import { Config } from '@backstage/config'; + +function getPlugins(config: Config): string[] { + const endpoints = getEndpoints(config); + return Array.from(new Set(endpoints.flatMap(endpoint => endpoint.plugins))); +} + +/** + * @alpha + */ +export class DefaultRootSystemMetadataService + implements RootSystemMetadataService +{ + #plugins: string[]; + #instanceMetadata: RootInstanceMetadataService; + constructor(options: { + logger: LoggerService; + config: RootConfigService; + instanceMetadata: RootInstanceMetadataService; + }) { + const { config } = options; + this.#plugins = getPlugins(config); + config.subscribe?.(() => { + this.#plugins = getPlugins(config); + }); + this.#instanceMetadata = options.instanceMetadata; + } + + public static create(pluginEnv: { + logger: LoggerService; + config: RootConfigService; + instanceMetadata: RootInstanceMetadataService; + }) { + return new DefaultRootSystemMetadataService(pluginEnv); + } + + public async getInstalledPlugins(): Promise< + RootSystemMetadataServicePluginInfo[] + > { + const plugins = this.#plugins.map(pluginId => ({ pluginId })); + + for (const plugin of await this.#instanceMetadata.getInstalledPlugins()) { + plugins.push({ pluginId: plugin.pluginId }); + } + + return plugins; + } +} diff --git a/packages/backend-defaults/src/alpha/entrypoints/rootSystemMetadata/rootSystemMetadataServiceFactory.ts b/packages/backend-defaults/src/alpha/entrypoints/rootSystemMetadata/rootSystemMetadataServiceFactory.ts new file mode 100644 index 0000000000..5ee93d03d5 --- /dev/null +++ b/packages/backend-defaults/src/alpha/entrypoints/rootSystemMetadata/rootSystemMetadataServiceFactory.ts @@ -0,0 +1,43 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + coreServices, + createServiceFactory, +} from '@backstage/backend-plugin-api'; +import { DefaultRootSystemMetadataService } from './lib/DefaultRootSystemMetadataService'; +import { rootSystemMetadataServiceRef } from '@backstage/backend-plugin-api/alpha'; + +/** + * Metadata about an entire Backstage system, a collection of Backstage instances. + * + * @alpha + */ +export const rootSystemMetadataServiceFactory = createServiceFactory({ + service: rootSystemMetadataServiceRef, + deps: { + logger: coreServices.rootLogger, + config: coreServices.rootConfig, + instanceMetadata: coreServices.rootInstanceMetadata, + }, + async factory({ logger, config, instanceMetadata }) { + return DefaultRootSystemMetadataService.create({ + logger, + config, + instanceMetadata, + }); + }, +}); diff --git a/packages/backend-defaults/src/alpha/index.ts b/packages/backend-defaults/src/alpha/index.ts index da63aef9de..c17e0e71cb 100644 --- a/packages/backend-defaults/src/alpha/index.ts +++ b/packages/backend-defaults/src/alpha/index.ts @@ -16,3 +16,4 @@ export { actionsRegistryServiceFactory } from './entrypoints/actionsRegistry'; export { actionsServiceFactory } from './entrypoints/actions'; +export { rootSystemMetadataServiceFactory } from './entrypoints/rootSystemMetadata'; diff --git a/packages/backend-defaults/src/entrypoints/auth/plugin/keys/DatabasePluginKeySource.ts b/packages/backend-defaults/src/entrypoints/auth/plugin/keys/DatabasePluginKeySource.ts index e6a7bbcfc6..562086a07f 100644 --- a/packages/backend-defaults/src/entrypoints/auth/plugin/keys/DatabasePluginKeySource.ts +++ b/packages/backend-defaults/src/entrypoints/auth/plugin/keys/DatabasePluginKeySource.ts @@ -102,7 +102,7 @@ export class DatabasePluginKeySource implements PluginKeySource { await this.keyStore.addKey({ id: kid, - key: publicKey as InternalKey, + key: publicKey as unknown as InternalKey, expiresAt: new Date( Date.now() + this.keyDurationSeconds * diff --git a/packages/backend-defaults/src/entrypoints/cache/CacheManager.ts b/packages/backend-defaults/src/entrypoints/cache/CacheManager.ts index 06b2b0c57b..428a4b7592 100644 --- a/packages/backend-defaults/src/entrypoints/cache/CacheManager.ts +++ b/packages/backend-defaults/src/entrypoints/cache/CacheManager.ts @@ -134,7 +134,7 @@ export class CacheManager { ): CacheStoreOptions | undefined { const storeConfigPath = `backend.cache.${store}`; - if (!config.has(storeConfigPath)) { + if (store !== 'memory' && !config.has(storeConfigPath)) { logger?.warn( `No configuration found for cache store '${store}' at '${storeConfigPath}'.`, ); diff --git a/packages/backend-defaults/src/entrypoints/discovery/HostDiscovery.ts b/packages/backend-defaults/src/entrypoints/discovery/HostDiscovery.ts index 5a4631283e..18ed72a085 100644 --- a/packages/backend-defaults/src/entrypoints/discovery/HostDiscovery.ts +++ b/packages/backend-defaults/src/entrypoints/discovery/HostDiscovery.ts @@ -23,6 +23,7 @@ import { import { readHttpServerOptions } from '../rootHttpRouter/http/config'; import { SrvResolvers } from './SrvResolvers'; import { trimEnd } from 'lodash'; +import { getEndpoints } from './parsing'; type Resolver = (pluginId: string) => Promise; @@ -238,25 +239,7 @@ export class HostDiscovery implements DiscoveryService { const endpoints = defaultEndpoints?.slice() ?? []; // Allow config to override the default endpoints - const endpointConfigs = config.getOptionalConfigArray( - 'discovery.endpoints', - ); - for (const endpointConfig of endpointConfigs ?? []) { - if (typeof endpointConfig.get('target') === 'string') { - endpoints.push({ - target: endpointConfig.getString('target'), - plugins: endpointConfig.getStringArray('plugins'), - }); - } else { - endpoints.push({ - target: { - internal: endpointConfig.getOptionalString('target.internal'), - external: endpointConfig.getOptionalString('target.external'), - }, - plugins: endpointConfig.getStringArray('plugins'), - }); - } - } + endpoints.push(...getEndpoints(config)); // Build up a new set of resolvers const internalResolvers: Map = new Map(); diff --git a/packages/backend-defaults/src/entrypoints/discovery/parsing.ts b/packages/backend-defaults/src/entrypoints/discovery/parsing.ts new file mode 100644 index 0000000000..3a02fc4f51 --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/discovery/parsing.ts @@ -0,0 +1,41 @@ +/* + * Copyright 2025 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Config } from '@backstage/config'; +import type { HostDiscoveryEndpoint } from './HostDiscovery'; + +export function getEndpoints(config: Config): HostDiscoveryEndpoint[] { + const endpoints: HostDiscoveryEndpoint[] = []; + // Allow config to override the default endpoints + const endpointConfigs = config.getOptionalConfigArray('discovery.endpoints'); + for (const endpointConfig of endpointConfigs ?? []) { + if (typeof endpointConfig.get('target') === 'string') { + endpoints.push({ + target: endpointConfig.getString('target'), + plugins: endpointConfig.getStringArray('plugins'), + }); + } else { + endpoints.push({ + target: { + internal: endpointConfig.getOptionalString('target.internal'), + external: endpointConfig.getOptionalString('target.external'), + }, + plugins: endpointConfig.getStringArray('plugins'), + }); + } + } + return endpoints; +} diff --git a/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readHelmetOptions.test.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readHelmetOptions.test.ts index 97daef359a..38cdf75396 100644 --- a/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readHelmetOptions.test.ts +++ b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readHelmetOptions.test.ts @@ -39,6 +39,9 @@ describe('readHelmetOptions', () => { crossOriginOpenerPolicy: false, crossOriginResourcePolicy: false, originAgentCluster: false, + referrerPolicy: { + policy: ['no-referrer'], + }, }); }); @@ -50,6 +53,9 @@ describe('readHelmetOptions', () => { scriptSrcAttr: ['custom'], 'object-src': ['asd'], }, + referrer: { + policy: ['foo', 'bar'], + }, }); expect(readHelmetOptions(config)).toEqual({ contentSecurityPolicy: { @@ -71,6 +77,9 @@ describe('readHelmetOptions', () => { crossOriginOpenerPolicy: false, crossOriginResourcePolicy: false, originAgentCluster: false, + referrerPolicy: { + policy: ['foo', 'bar'], + }, }); }); diff --git a/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readHelmetOptions.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readHelmetOptions.ts index fc1fc59bcb..040da63e5f 100644 --- a/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readHelmetOptions.ts +++ b/packages/backend-defaults/src/entrypoints/rootHttpRouter/http/readHelmetOptions.ts @@ -46,6 +46,7 @@ export function readHelmetOptions(config?: Config): HelmetOptions { crossOriginOpenerPolicy: false, crossOriginResourcePolicy: false, originAgentCluster: false, + referrerPolicy: readReferrerPolicy(config), }; } @@ -113,3 +114,30 @@ export function applyCspDirectives( return result; } + +type ReferrerPolicy = Record | undefined; + +/** + * Attempts to read the ReferrerPolicy from the backend configuration object. + * + * @example + * ```yaml + * backend: + * referrer: + * policy: ["strict-origin-when-cross-origin"] + * ``` + */ +function readReferrerPolicy(config?: Config): ReferrerPolicy { + const cc = config?.getOptionalConfig('referrer'); + const result: Record = {}; + + if (!cc) { + result.policy = ['no-referrer']; + } else { + for (const key of cc.keys()) { + result[key] = cc.getStringArray(key); + } + } + + return result; +} diff --git a/packages/backend-defaults/src/entrypoints/rootLogger/WinstonLogger.ts b/packages/backend-defaults/src/entrypoints/rootLogger/WinstonLogger.ts index c48cef2f1f..0455912ca9 100644 --- a/packages/backend-defaults/src/entrypoints/rootLogger/WinstonLogger.ts +++ b/packages/backend-defaults/src/entrypoints/rootLogger/WinstonLogger.ts @@ -102,7 +102,9 @@ export class WinstonLogger implements RootLoggerService { return obj; } - obj[MESSAGE] = obj[MESSAGE]?.replace?.(redactionPattern, '***'); + if (typeof obj[MESSAGE] === 'string') { + obj[MESSAGE] = obj[MESSAGE].replace(redactionPattern, '***'); + } return obj; })(), @@ -157,8 +159,11 @@ export class WinstonLogger implements RootLoggerService { format.printf((info: TransformableInfo) => { const { timestamp, level, message, plugin, service, ...fields } = info; const prefix = plugin || service; - const timestampColor = colorizer.colorize('timestamp', timestamp); - const prefixColor = colorizer.colorize('prefix', prefix); + const timestampColor = colorizer.colorize( + 'timestamp', + String(timestamp), + ); + const prefixColor = colorizer.colorize('prefix', String(prefix)); const extraFields = Object.entries(fields) .map(([key, value]) => { diff --git a/packages/backend-defaults/src/entrypoints/scheduler/lib/TaskWorker.test.ts b/packages/backend-defaults/src/entrypoints/scheduler/lib/TaskWorker.test.ts index de1b6e4caf..5bd3fb38cb 100644 --- a/packages/backend-defaults/src/entrypoints/scheduler/lib/TaskWorker.test.ts +++ b/packages/backend-defaults/src/entrypoints/scheduler/lib/TaskWorker.test.ts @@ -46,7 +46,7 @@ describe('TaskWorker', () => { const settings: TaskSettingsV2 = { version: 2, cadence: '*/2 * * * * *', - initialDelayDuration: Duration.fromObject({ seconds: 1 }).toISO()!, + initialDelayDuration: Duration.fromObject({ seconds: 3 }).toISO()!, // over 1 second, to cover for 1-second granularity in some database timestamps timeoutAfterDuration: Duration.fromObject({ minutes: 1 }).toISO()!, }; @@ -65,7 +65,7 @@ describe('TaskWorker', () => { expect(JSON.parse(row.settings_json)).toEqual({ version: 2, cadence: '*/2 * * * * *', - initialDelayDuration: 'PT1S', + initialDelayDuration: 'PT3S', timeoutAfterDuration: 'PT1M', }); await expect(TaskWorker.taskStates(knex)).resolves.toEqual( @@ -80,6 +80,10 @@ describe('TaskWorker', () => { ]), ); + // Note that this is timing sensitive - if things take too long between + // persistTask and findReadyTask, this test will fail. We set some margin + // of initialDelayDuration to cover for this, but if this turns out to be + // flaky, we may have to revisit how this test is written. await expect(worker.findReadyTask()).resolves.toEqual({ result: 'not-ready-yet', }); diff --git a/packages/backend-defaults/src/entrypoints/scheduler/lib/TaskWorker.ts b/packages/backend-defaults/src/entrypoints/scheduler/lib/TaskWorker.ts index eb040ef415..e47967de90 100644 --- a/packages/backend-defaults/src/entrypoints/scheduler/lib/TaskWorker.ts +++ b/packages/backend-defaults/src/entrypoints/scheduler/lib/TaskWorker.ts @@ -280,8 +280,10 @@ export class TaskWorker { .sendAt() .minus({ seconds: 1 }) // immediately, if "* * * * * *" .toUTC(); + // We make a conversion here to make typescript happy, because the luxon versions of the cron library and here may not be the same + const timeConverted = DateTime.fromJSDate(time.toJSDate()); - nextStartAt = this.nextRunAtRaw(time); + nextStartAt = this.nextRunAtRaw(timeConverted); startAt ||= nextStartAt; } else if (isManual) { nextStartAt = this.knex.raw('null'); @@ -418,8 +420,10 @@ export class TaskWorker { if (isCron) { const time = new CronTime(settings.cadence).sendAt().toUTC(); this.logger.debug(`task: ${this.taskId} will next occur around ${time}`); + // We make a conversion here to make typescript happy, because the luxon versions of the cron library and here may not be the same + const timeConverted = DateTime.fromJSDate(time.toJSDate()); - nextRun = this.nextRunAtRaw(time); + nextRun = this.nextRunAtRaw(timeConverted); } else if (isManual) { nextRun = this.knex.raw('null'); } else { diff --git a/packages/backend-dev-utils/CHANGELOG.md b/packages/backend-dev-utils/CHANGELOG.md index 81686fb493..4b89697ee8 100644 --- a/packages/backend-dev-utils/CHANGELOG.md +++ b/packages/backend-dev-utils/CHANGELOG.md @@ -1,5 +1,11 @@ # @backstage/backend-dev-utils +## 0.1.6-next.0 + +### Patch Changes + +- 2bae83a: Internal update for Node.js v24 support. + ## 0.1.5 ### Patch Changes diff --git a/packages/backend-dev-utils/package.json b/packages/backend-dev-utils/package.json index 4d22c5010f..3eb9c05993 100644 --- a/packages/backend-dev-utils/package.json +++ b/packages/backend-dev-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/backend-dev-utils", - "version": "0.1.5", + "version": "0.1.6-next.0", "backstage": { "role": "node-library" }, diff --git a/packages/backend-dev-utils/src/ipcClient.ts b/packages/backend-dev-utils/src/ipcClient.ts index 6e1d3d181e..814767347e 100644 --- a/packages/backend-dev-utils/src/ipcClient.ts +++ b/packages/backend-dev-utils/src/ipcClient.ts @@ -126,7 +126,7 @@ export class BackstageIpcClient { timeout.unref(); this.#handlers.set(id, responseHandler); - this.#sendMessage(request, (e: Error) => { + this.#sendMessage(request, undefined, undefined, (e: Error | null) => { if (e) { reject(e); } diff --git a/packages/backend-dynamic-feature-service/CHANGELOG.md b/packages/backend-dynamic-feature-service/CHANGELOG.md index 25ae340cbf..aec27109a6 100644 --- a/packages/backend-dynamic-feature-service/CHANGELOG.md +++ b/packages/backend-dynamic-feature-service/CHANGELOG.md @@ -1,5 +1,31 @@ # @backstage/backend-dynamic-feature-service +## 0.7.7-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/backend-openapi-utils@0.6.4-next.1 + - @backstage/plugin-app-node@0.1.40-next.1 + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/plugin-catalog-backend@3.2.1-next.1 + - @backstage/plugin-events-backend@0.5.9-next.1 + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/plugin-permission-node@0.10.7-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config-loader@1.10.7-next.1 + - @backstage/cli-common@0.1.16-next.2 + - @backstage/cli-node@0.2.16-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-permission-common@0.9.3 + - @backstage/plugin-scaffolder-node@0.12.2-next.1 + - @backstage/plugin-search-backend-node@1.4.0-next.1 + - @backstage/plugin-search-common@1.2.21 + ## 0.7.7-next.0 ### Patch Changes diff --git a/packages/backend-dynamic-feature-service/package.json b/packages/backend-dynamic-feature-service/package.json index e2d1b95978..416cbfdc1e 100644 --- a/packages/backend-dynamic-feature-service/package.json +++ b/packages/backend-dynamic-feature-service/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/backend-dynamic-feature-service", - "version": "0.7.7-next.0", + "version": "0.7.7-next.1", "description": "Backstage dynamic feature service", "backstage": { "role": "node-library" @@ -70,7 +70,7 @@ "@manypkg/get-packages": "^1.1.3", "@module-federation/sdk": "^0.9.0", "chokidar": "^3.5.3", - "express": "^4.17.1", + "express": "^4.22.0", "express-promise-router": "^4.1.0", "fs-extra": "^11.2.0", "lodash": "^4.17.21", diff --git a/packages/backend-openapi-utils/CHANGELOG.md b/packages/backend-openapi-utils/CHANGELOG.md index 7f3a9328ae..2fb0b39cbd 100644 --- a/packages/backend-openapi-utils/CHANGELOG.md +++ b/packages/backend-openapi-utils/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/backend-openapi-utils +## 0.6.4-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + ## 0.6.4-next.0 ### Patch Changes diff --git a/packages/backend-openapi-utils/package.json b/packages/backend-openapi-utils/package.json index fb7af8b5f2..715c1ddbcb 100644 --- a/packages/backend-openapi-utils/package.json +++ b/packages/backend-openapi-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/backend-openapi-utils", - "version": "0.6.4-next.0", + "version": "0.6.4-next.1", "description": "OpenAPI typescript support.", "backstage": { "role": "node-library" @@ -52,7 +52,7 @@ "@types/express": "^4.17.6", "@types/express-serve-static-core": "^4.17.5", "ajv": "^8.16.0", - "express": "^4.17.1", + "express": "^4.22.0", "express-openapi-validator": "^5.5.8", "express-promise-router": "^4.1.0", "get-port": "^5.1.1", diff --git a/packages/backend-plugin-api/CHANGELOG.md b/packages/backend-plugin-api/CHANGELOG.md index 617012d22b..84ad95d700 100644 --- a/packages/backend-plugin-api/CHANGELOG.md +++ b/packages/backend-plugin-api/CHANGELOG.md @@ -1,5 +1,22 @@ # @backstage/backend-plugin-api +## 1.6.0-next.1 + +### Minor Changes + +- 2a0c4b0: Adds a new experimental `RootSystemMetadataService` for tracking the collection of Backstage instances that may be deployed at any one time. It currently offers a single API, `getInstalledPlugins` that returns a list of installed plugins based on config you have set up in `discovery.endpoints` as well as the plugins installed on the instance you're calling the API with. It does not handle wildcard values or fallback values. The intention is for this plugin to provide plugin authors with a simple interface to fetch a trustworthy list of all installed plugins. + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/plugin-permission-node@0.10.7-next.1 + - @backstage/cli-common@0.1.16-next.2 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-permission-common@0.9.3 + ## 1.5.1-next.0 ### Patch Changes diff --git a/packages/backend-plugin-api/package.json b/packages/backend-plugin-api/package.json index be377d1d12..c26c0ce1de 100644 --- a/packages/backend-plugin-api/package.json +++ b/packages/backend-plugin-api/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/backend-plugin-api", - "version": "1.5.1-next.0", + "version": "1.6.0-next.1", "description": "Core API used by Backstage backend plugins", "backstage": { "role": "node-library" diff --git a/packages/backend-plugin-api/report-alpha.api.md b/packages/backend-plugin-api/report-alpha.api.md index cefed593c0..e06e0c45d2 100644 --- a/packages/backend-plugin-api/report-alpha.api.md +++ b/packages/backend-plugin-api/report-alpha.api.md @@ -103,5 +103,26 @@ export const actionsServiceRef: ServiceRef< 'singleton' >; +// @public (undocumented) +export interface RootSystemMetadataService { + // (undocumented) + getInstalledPlugins: () => Promise< + ReadonlyArray + >; +} + +// @public (undocumented) +export interface RootSystemMetadataServicePluginInfo { + // (undocumented) + readonly pluginId: string; +} + +// @alpha +export const rootSystemMetadataServiceRef: ServiceRef< + RootSystemMetadataService, + 'root', + 'singleton' +>; + // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-plugin-api/src/alpha/RootSystemMetadataService.ts b/packages/backend-plugin-api/src/alpha/RootSystemMetadataService.ts new file mode 100644 index 0000000000..67cc43f8af --- /dev/null +++ b/packages/backend-plugin-api/src/alpha/RootSystemMetadataService.ts @@ -0,0 +1,27 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** @public */ +export interface RootSystemMetadataServicePluginInfo { + readonly pluginId: string; +} + +/** @public */ +export interface RootSystemMetadataService { + getInstalledPlugins: () => Promise< + ReadonlyArray + >; +} diff --git a/packages/backend-plugin-api/src/alpha/index.ts b/packages/backend-plugin-api/src/alpha/index.ts index b1edd68adc..56f02f5275 100644 --- a/packages/backend-plugin-api/src/alpha/index.ts +++ b/packages/backend-plugin-api/src/alpha/index.ts @@ -14,6 +14,11 @@ * limitations under the License. */ +export type { + RootSystemMetadataServicePluginInfo, + RootSystemMetadataService, +} from './RootSystemMetadataService'; + export type { ActionsRegistryService, ActionsRegistryActionOptions, @@ -22,4 +27,8 @@ export type { export type { ActionsService, ActionsServiceAction } from './ActionsService'; -export { actionsRegistryServiceRef, actionsServiceRef } from './refs'; +export { + actionsRegistryServiceRef, + actionsServiceRef, + rootSystemMetadataServiceRef, +} from './refs'; diff --git a/packages/backend-plugin-api/src/alpha/refs.ts b/packages/backend-plugin-api/src/alpha/refs.ts index cfbb215615..a890271364 100644 --- a/packages/backend-plugin-api/src/alpha/refs.ts +++ b/packages/backend-plugin-api/src/alpha/refs.ts @@ -45,3 +45,14 @@ export const actionsRegistryServiceRef = createServiceRef< >({ id: 'alpha.core.actionsRegistry', }); + +/** + * Read information about your current Backstage deployment. + * @alpha + */ +export const rootSystemMetadataServiceRef = createServiceRef< + import('./RootSystemMetadataService').RootSystemMetadataService +>({ + id: 'alpha.core.rootSystemMetadata', + scope: 'root', +}); diff --git a/packages/backend-test-utils/CHANGELOG.md b/packages/backend-test-utils/CHANGELOG.md index d8ee338822..921eac9383 100644 --- a/packages/backend-test-utils/CHANGELOG.md +++ b/packages/backend-test-utils/CHANGELOG.md @@ -1,5 +1,23 @@ # @backstage/backend-test-utils +## 1.10.2-next.1 + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- 8be23a4: Switched `textextensions` dependency for `text-extensions`. +- 5a737e1: Fix PostgreSQL 18 `TestDatabases` by pinning the data directory +- Updated dependencies + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/plugin-events-node@0.4.18-next.1 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/backend-app-api@1.4.0-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/plugin-permission-common@0.9.3 + ## 1.10.1-next.0 ### Patch Changes diff --git a/packages/backend-test-utils/package.json b/packages/backend-test-utils/package.json index 70bc3e2e81..08b5da6630 100644 --- a/packages/backend-test-utils/package.json +++ b/packages/backend-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/backend-test-utils", - "version": "1.10.1-next.0", + "version": "1.10.2-next.1", "description": "Test helpers library for Backstage backends", "backstage": { "role": "node-library" @@ -67,7 +67,7 @@ "@types/qs": "^6.9.6", "better-sqlite3": "^12.0.0", "cookie": "^0.7.0", - "express": "^4.17.1", + "express": "^4.22.0", "fs-extra": "^11.0.0", "keyv": "^5.2.1", "knex": "^3.0.0", @@ -75,8 +75,8 @@ "mysql2": "^3.0.0", "pg": "^8.11.3", "pg-connection-string": "^2.3.0", - "testcontainers": "^10.0.0", - "textextensions": "^5.16.0", + "testcontainers": "^11.9.0", + "text-extensions": "^2.4.0", "uuid": "^11.0.0", "yn": "^4.0.0", "zod": "^3.22.4", diff --git a/packages/backend-test-utils/src/database/postgres.ts b/packages/backend-test-utils/src/database/postgres.ts index e6122b9ab7..d7238cb36a 100644 --- a/packages/backend-test-utils/src/database/postgres.ts +++ b/packages/backend-test-utils/src/database/postgres.ts @@ -77,7 +77,11 @@ export async function startPostgresContainer(image: string): Promise<{ const container = await new GenericContainer(image) .withExposedPorts(5432) - .withEnvironment({ POSTGRES_PASSWORD: password }) + .withEnvironment({ + // Since postgres 18, the default directory changed - so we pin it here + PGDATA: '/var/lib/postgresql/data', + POSTGRES_PASSWORD: password, + }) .withTmpFs({ '/var/lib/postgresql/data': 'rw' }) .start(); diff --git a/packages/backend-test-utils/src/filesystem/MockDirectory.ts b/packages/backend-test-utils/src/filesystem/MockDirectory.ts index a1d616d8e0..f940a4cd7b 100644 --- a/packages/backend-test-utils/src/filesystem/MockDirectory.ts +++ b/packages/backend-test-utils/src/filesystem/MockDirectory.ts @@ -17,7 +17,7 @@ import os from 'os'; import { isChildPath } from '@backstage/backend-plugin-api'; import fs from 'fs-extra'; -import textextensions from 'textextensions'; +import textextensions from 'text-extensions'; import { dirname, extname, diff --git a/packages/backend/CHANGELOG.md b/packages/backend/CHANGELOG.md index 622c2329b2..dc0f2fc708 100644 --- a/packages/backend/CHANGELOG.md +++ b/packages/backend/CHANGELOG.md @@ -1,5 +1,47 @@ # example-backend +## 0.0.45-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-mcp-actions-backend@0.1.6-next.1 + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/plugin-app-backend@0.5.9-next.1 + - @backstage/plugin-auth-backend-module-guest-provider@0.2.15-next.1 + - @backstage/plugin-auth-backend-module-openshift-provider@0.1.3-next.1 + - @backstage/plugin-auth-backend@0.25.7-next.1 + - @backstage/plugin-auth-node@0.6.10-next.1 + - @backstage/plugin-catalog-backend@3.2.1-next.1 + - @backstage/plugin-devtools-backend@0.5.12-next.1 + - @backstage/plugin-events-backend@0.5.9-next.1 + - @backstage/plugin-kubernetes-backend@0.21.0-next.2 + - @backstage/plugin-notifications-backend@0.6.1-next.1 + - @backstage/plugin-permission-backend@0.7.7-next.1 + - @backstage/plugin-permission-node@0.10.7-next.1 + - @backstage/plugin-proxy-backend@0.6.9-next.1 + - @backstage/plugin-scaffolder-backend@3.1.0-next.1 + - @backstage/plugin-search-backend@2.0.9-next.1 + - @backstage/plugin-signals-backend@0.3.11-next.1 + - @backstage/plugin-techdocs-backend@2.1.3-next.2 + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/plugin-search-backend-module-explore@0.3.10-next.1 + - @backstage/catalog-model@1.7.6 + - @backstage/plugin-auth-backend-module-github-provider@0.3.10-next.1 + - @backstage/plugin-catalog-backend-module-backstage-openapi@0.5.9-next.1 + - @backstage/plugin-catalog-backend-module-openapi@0.2.17-next.1 + - @backstage/plugin-catalog-backend-module-scaffolder-entity-model@0.2.15-next.1 + - @backstage/plugin-catalog-backend-module-unprocessed@0.6.7-next.2 + - @backstage/plugin-events-backend-module-google-pubsub@0.1.7-next.1 + - @backstage/plugin-permission-backend-module-allow-all-policy@0.2.15-next.1 + - @backstage/plugin-permission-common@0.9.3 + - @backstage/plugin-scaffolder-backend-module-github@0.9.3-next.1 + - @backstage/plugin-scaffolder-backend-module-notifications@0.1.17-next.1 + - @backstage/plugin-search-backend-module-catalog@0.3.11-next.1 + - @backstage/plugin-search-backend-module-elasticsearch@1.7.9-next.1 + - @backstage/plugin-search-backend-module-techdocs@0.4.9-next.1 + - @backstage/plugin-search-backend-node@1.4.0-next.1 + ## 0.0.45-next.0 ### Patch Changes diff --git a/packages/backend/package.json b/packages/backend/package.json index 2af36b8077..10a2eeded3 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -1,6 +1,6 @@ { "name": "example-backend", - "version": "0.0.45-next.0", + "version": "0.0.45-next.1", "backstage": { "role": "backend" }, @@ -66,9 +66,9 @@ "@backstage/plugin-search-backend-node": "workspace:^", "@backstage/plugin-signals-backend": "workspace:^", "@backstage/plugin-techdocs-backend": "workspace:^", - "@opentelemetry/auto-instrumentations-node": "^0.61.0", - "@opentelemetry/exporter-prometheus": "^0.54.0", - "@opentelemetry/sdk-node": "^0.54.0", + "@opentelemetry/auto-instrumentations-node": "^0.67.0", + "@opentelemetry/exporter-prometheus": "^0.208.0", + "@opentelemetry/sdk-node": "^0.208.0", "example-app": "link:../app" }, "devDependencies": { diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index 541c3bd791..14eb36a3a6 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -15,6 +15,7 @@ */ import { createBackend } from '@backstage/backend-defaults'; +import { rootSystemMetadataServiceFactory } from '@backstage/backend-defaults/alpha'; import { coreServices, createBackendFeatureLoader, @@ -69,7 +70,7 @@ backend.add(searchLoader); backend.add(import('@backstage/plugin-techdocs-backend')); backend.add(import('@backstage/plugin-signals-backend')); backend.add(import('@backstage/plugin-notifications-backend')); -backend.add(import('./instanceMetadata')); +backend.add(rootSystemMetadataServiceFactory); backend.add(import('@backstage/plugin-events-backend-module-google-pubsub')); backend.add(import('@backstage/plugin-mcp-actions-backend')); diff --git a/packages/backend/src/instanceMetadata.ts b/packages/backend/src/instanceMetadata.ts deleted file mode 100644 index 026fc6fd02..0000000000 --- a/packages/backend/src/instanceMetadata.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { - coreServices, - createBackendPlugin, -} from '@backstage/backend-plugin-api'; - -// Example usage of the instance metadata service to log the installed plugins. -export default createBackendPlugin({ - pluginId: 'instance-metadata-logging', - register(env) { - env.registerInit({ - deps: { - instanceMetadata: coreServices.rootInstanceMetadata, - logger: coreServices.logger, - }, - async init({ instanceMetadata, logger }) { - const plugins = await instanceMetadata.getInstalledPlugins(); - logger.info( - `Installed plugins on this instance: ${plugins - .map(e => e.pluginId) - .join(', ')}`, - ); - }, - }); - }, -}); diff --git a/packages/cli-common/CHANGELOG.md b/packages/cli-common/CHANGELOG.md index d3529161ca..145e04ddb3 100644 --- a/packages/cli-common/CHANGELOG.md +++ b/packages/cli-common/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/cli-common +## 0.1.16-next.2 + +### Patch Changes + +- 2bae83a: Bumped dev dependencies `@types/node` +- Updated dependencies + - @backstage/errors@1.2.7 + +## 0.1.16-next.1 + +### Patch Changes + +- 5cfb2a4: Added new `run`, `runOutput`, and `runCheck` utilities to help run child processes in a safe and portable way. + ## 0.1.16-next.0 ### Patch Changes diff --git a/packages/cli-common/package.json b/packages/cli-common/package.json index b532da83c8..80857bffff 100644 --- a/packages/cli-common/package.json +++ b/packages/cli-common/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/cli-common", - "version": "0.1.16-next.0", + "version": "0.1.16-next.2", "description": "Common functionality used by cli, backend, and create-app", "backstage": { "role": "node-library" @@ -35,11 +35,14 @@ "test": "backstage-cli package test" }, "dependencies": { + "@backstage/errors": "workspace:^", + "cross-spawn": "^7.0.3", "global-agent": "^3.0.0", "undici": "^7.2.3" }, "devDependencies": { "@backstage/cli": "workspace:^", - "@types/node": "^20.16.0" + "@types/cross-spawn": "^6.0.2", + "@types/node": "^22.13.14" } } diff --git a/packages/cli-common/report.api.md b/packages/cli-common/report.api.md index 0e3c80afa4..175ec3cb2b 100644 --- a/packages/cli-common/report.api.md +++ b/packages/cli-common/report.api.md @@ -3,12 +3,23 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { ChildProcess } from 'child_process'; +import { CustomErrorBase } from '@backstage/errors'; +import { SpawnOptions } from 'child_process'; + // @public export const BACKSTAGE_JSON = 'backstage.json'; // @public export function bootstrapEnvProxyAgents(): void; +// @public +export class ExitCodeError extends CustomErrorBase { + constructor(code: number, command?: string); + // (undocumented) + readonly code: number; +} + // @public export function findPaths(searchDir: string): Paths; @@ -29,4 +40,32 @@ export type Paths = { // @public export type ResolveFunc = (...paths: string[]) => string; + +// @public +export function run(args: string[], options?: RunOptions): RunChildProcess; + +// @public +export function runCheck(args: string[]): Promise; + +// @public +export interface RunChildProcess extends ChildProcess { + waitForExit(): Promise; +} + +// @public +export type RunOnOutput = (data: Buffer) => void; + +// @public +export type RunOptions = Omit & { + env?: Partial; + onStdout?: RunOnOutput; + onStderr?: RunOnOutput; + stdio?: SpawnOptions['stdio']; +}; + +// @public +export function runOutput( + args: string[], + options?: RunOptions, +): Promise; ``` diff --git a/packages/cli-common/src/errors.ts b/packages/cli-common/src/errors.ts new file mode 100644 index 0000000000..07664d2ffb --- /dev/null +++ b/packages/cli-common/src/errors.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CustomErrorBase } from '@backstage/errors'; + +/** + * Error thrown when a child process exits with a non-zero code. + * @public + */ +export class ExitCodeError extends CustomErrorBase { + readonly code: number; + + constructor(code: number, command?: string) { + super( + command + ? `Command '${command}' exited with code ${code}` + : `Child exited with code ${code}`, + ); + this.code = code; + } +} diff --git a/packages/cli-common/src/index.ts b/packages/cli-common/src/index.ts index 11e5d05f4f..d11601b044 100644 --- a/packages/cli-common/src/index.ts +++ b/packages/cli-common/src/index.ts @@ -24,3 +24,12 @@ export { findPaths, BACKSTAGE_JSON } from './paths'; export { isChildPath } from './isChildPath'; export type { Paths, ResolveFunc } from './paths'; export { bootstrapEnvProxyAgents } from './proxyBootstrap'; +export { + run, + runOutput, + runCheck, + type RunChildProcess, + type RunOptions, + type RunOnOutput, +} from './run'; +export { ExitCodeError } from './errors'; diff --git a/packages/cli-common/src/run.test.ts b/packages/cli-common/src/run.test.ts new file mode 100644 index 0000000000..01c6c915d6 --- /dev/null +++ b/packages/cli-common/src/run.test.ts @@ -0,0 +1,342 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { run, runOutput, runCheck } from './run'; +import { ExitCodeError } from './errors'; + +describe('run', () => { + const activeChildren: Array<{ kill: () => void }> = []; + + afterEach(() => { + // Clean up any active child processes + activeChildren.forEach(child => { + try { + child.kill(); + } catch { + // Ignore errors during cleanup + } + }); + activeChildren.length = 0; + jest.restoreAllMocks(); + }); + + describe('run', () => { + it('should throw error for empty args', () => { + expect(() => run([])).toThrow('run requires at least one argument'); + }); + + it('should run a successful command', async () => { + const child = run(['node', '--version']); + activeChildren.push(child); + await expect(child.waitForExit()).resolves.not.toThrow(); + }); + + it('should throw ExitCodeError for non-zero exit code', async () => { + const child = run(['node', '--eval', 'process.exit(1)']); + activeChildren.push(child); + await expect(child.waitForExit()).rejects.toThrow(ExitCodeError); + await expect(child.waitForExit()).rejects.toThrow( + /Command 'node --eval process\.exit\(1\)' exited with code 1/, + ); + }); + + it('should call onStdout callback', async () => { + const stdoutChunks: Buffer[] = []; + const child = run(['node', '--version'], { + onStdout: data => stdoutChunks.push(data), + }); + activeChildren.push(child); + await child.waitForExit(); + expect(stdoutChunks.length).toBeGreaterThan(0); + const output = Buffer.concat(stdoutChunks).toString(); + expect(output).toMatch(/v\d+\.\d+\.\d+/); + }); + + it('should call onStderr callback', async () => { + const stderrChunks: Buffer[] = []; + const child = run(['node', '--eval', 'console.error("test error")'], { + onStderr: data => stderrChunks.push(data), + }); + activeChildren.push(child); + await child.waitForExit(); + expect(stderrChunks.length).toBeGreaterThan(0); + const output = Buffer.concat(stderrChunks).toString(); + expect(output).toContain('test error'); + }); + + it('should use custom stdio', async () => { + const child = run(['node', '--version'], { + stdio: 'pipe', + }); + activeChildren.push(child); + expect(child.stdout).toBeTruthy(); + expect(child.stderr).toBeTruthy(); + await child.waitForExit(); + }); + + it('should use custom env', async () => { + const customEnv = { CUSTOM_VAR: 'test-value' }; + const child = run( + ['node', '--eval', 'console.log(process.env.CUSTOM_VAR)'], + { + env: customEnv, + onStdout: data => { + const output = data.toString(); + expect(output).toContain('test-value'); + }, + }, + ); + activeChildren.push(child); + await child.waitForExit(); + }); + + it('should set FORCE_COLOR in env', async () => { + const child = run( + ['node', '--eval', 'console.log(process.env.FORCE_COLOR)'], + { + onStdout: data => { + const output = data.toString(); + expect(output.trim()).toBe('true'); + }, + }, + ); + activeChildren.push(child); + await child.waitForExit(); + }); + + it('should handle process already exited', async () => { + const child = run(['node', '--version']); + activeChildren.push(child); + // Wait for it to complete + await child.waitForExit(); + // Call waitForExit again - should return immediately + await expect(child.waitForExit()).resolves.not.toThrow(); + }); + + it('should handle multiple simultaneous calls to waitForExit', async () => { + const child = run(['node', '--version']); + activeChildren.push(child); + // Call waitForExit multiple times simultaneously + const [result1, result2, result3] = await Promise.all([ + child.waitForExit(), + child.waitForExit(), + child.waitForExit(), + ]); + // All should resolve successfully + expect(result1).toBeUndefined(); + expect(result2).toBeUndefined(); + expect(result3).toBeUndefined(); + }); + + it('should handle multiple simultaneous calls to waitForExit with error', async () => { + const child = run(['node', '--eval', 'process.exit(1)']); + activeChildren.push(child); + // Call waitForExit multiple times simultaneously + const promises = [ + child.waitForExit(), + child.waitForExit(), + child.waitForExit(), + ]; + // All should reject with the same error + for (const promise of promises) { + await expect(promise).rejects.toThrow(ExitCodeError); + await expect(promise).rejects.toThrow( + /Command 'node --eval process\.exit\(1\)' exited with code 1/, + ); + } + }); + + it('should handle signal handlers cleanup', async () => { + const child = run(['node', '--version']); + activeChildren.push(child); + const originalListeners = process.listenerCount('SIGINT'); + await child.waitForExit(); + // Signal handlers should be cleaned up + expect(process.listenerCount('SIGINT')).toBe(originalListeners); + }); + + it('should kill child process on SIGINT', async () => { + const child = run(['node', '--eval', 'setTimeout(() => {}, 10000)']); + activeChildren.push(child); + const killSpy = jest.spyOn(child, 'kill'); + // Start waiting (this registers signal handlers) + const waitPromise = child.waitForExit(); + // Simulate SIGINT + process.emit('SIGINT' as any, 'SIGINT'); + // Give it a moment + await new Promise(resolve => setTimeout(resolve, 100)); + expect(killSpy).toHaveBeenCalled(); + killSpy.mockRestore(); + // Clean up + child.kill(); + // Wait for cleanup + try { + await Promise.race([ + waitPromise, + new Promise(resolve => setTimeout(resolve, 100)), + ]); + } catch { + // Expected to fail + } + }); + + it('should kill child process on SIGTERM', async () => { + const child = run(['node', '--eval', 'setTimeout(() => {}, 10000)']); + activeChildren.push(child); + const killSpy = jest.spyOn(child, 'kill'); + // Start waiting (this registers signal handlers) + const waitPromise = child.waitForExit(); + // Simulate SIGTERM + process.emit('SIGTERM' as any, 'SIGTERM'); + // Give it a moment + await new Promise(resolve => setTimeout(resolve, 100)); + expect(killSpy).toHaveBeenCalled(); + killSpy.mockRestore(); + // Clean up + child.kill(); + // Wait for cleanup + try { + await Promise.race([ + waitPromise, + new Promise(resolve => setTimeout(resolve, 100)), + ]); + } catch { + // Expected to fail + } + }); + + it('should not kill already killed process on signal', async () => { + const child = run(['node', '--version']); + activeChildren.push(child); + await child.waitForExit(); + const killSpy = jest.spyOn(child, 'kill'); + // Simulate SIGINT after process has exited + process.emit('SIGINT' as any, 'SIGINT'); + await new Promise(resolve => setTimeout(resolve, 100)); + // Should not be called since process already exited + expect(killSpy).not.toHaveBeenCalled(); + killSpy.mockRestore(); + }); + + it('should handle process error', async () => { + const child = run(['nonexistent-command-12345']); + activeChildren.push(child); + await expect(child.waitForExit()).rejects.toThrow(); + }); + }); + + describe('runOutput', () => { + it('should throw error for empty args', async () => { + await expect(runOutput([])).rejects.toThrow( + 'runOutput requires at least one argument', + ); + }); + + it('should return stdout', async () => { + const output = await runOutput([ + 'node', + '--eval', + 'console.log("test output")', + ]); + expect(output).toBe('test output'); + }); + + it('should trim output', async () => { + const output = await runOutput([ + 'node', + '--eval', + 'console.log(" test output ")', + ]); + expect(output).toBe('test output'); + }); + + it('should attach stdout to error on failure', async () => { + let error: Error | undefined; + try { + await runOutput([ + 'node', + '--eval', + 'console.log("stdout before error"); process.exit(1)', + ]); + } catch (err) { + error = err; + } + expect(error).toBeInstanceOf(ExitCodeError); + expect((error as Error & { stdout?: string }).stdout).toContain( + 'stdout before error', + ); + }); + + it('should attach stderr to error on failure', async () => { + let error: Error | undefined; + try { + await runOutput([ + 'node', + '--eval', + 'console.error("stderr error"); process.exit(1)', + ]); + } catch (err) { + error = err; + } + expect(error).toBeInstanceOf(ExitCodeError); + expect((error as Error & { stderr?: string }).stderr).toContain( + 'stderr error', + ); + }); + + it('should call custom onStdout callback', async () => { + const customChunks: Buffer[] = []; + const output = await runOutput( + ['node', '--eval', 'console.log("test")'], + { + onStdout: data => customChunks.push(data), + }, + ); + expect(output).toBe('test'); + expect(customChunks.length).toBeGreaterThan(0); + }); + + it('should call custom onStderr callback', async () => { + const customChunks: Buffer[] = []; + await runOutput( + ['node', '--eval', 'console.error("error"); console.log("ok")'], + { + onStderr: data => customChunks.push(data), + }, + ); + expect(customChunks.length).toBeGreaterThan(0); + const errorOutput = Buffer.concat(customChunks).toString(); + expect(errorOutput).toContain('error'); + }); + }); + + describe('runCheck', () => { + it('should return true for successful command', async () => { + const result = await runCheck(['node', '--version']); + expect(result).toBe(true); + }); + + it('should return false for failed command', async () => { + const result = await runCheck(['node', '--eval', 'process.exit(1)']); + expect(result).toBe(false); + }); + + it('should return false for nonexistent command', async () => { + const result = await runCheck(['nonexistent-command-12345']); + expect(result).toBe(false); + }); + }); +}); diff --git a/packages/cli-common/src/run.ts b/packages/cli-common/src/run.ts new file mode 100644 index 0000000000..9bdfbcd1f6 --- /dev/null +++ b/packages/cli-common/src/run.ts @@ -0,0 +1,219 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ChildProcess, SpawnOptions } from 'child_process'; +import spawn from 'cross-spawn'; +import { ExitCodeError } from './errors'; +import { assertError } from '@backstage/errors'; + +/** + * Callback function that can be used to receive stdout or stderr data from a child process. + * + * @public + */ +export type RunOnOutput = (data: Buffer) => void; + +/** + * Options for running a child process with {@link run} or related functions. + * + * @public + */ +export type RunOptions = Omit & { + env?: Partial; + onStdout?: RunOnOutput; + onStderr?: RunOnOutput; + stdio?: SpawnOptions['stdio']; +}; + +/** + * Child process handle returned by {@link run}. + * + * @public + */ +export interface RunChildProcess extends ChildProcess { + /** + * Waits for the child process to exit. + * + * @remarks + * + * Resolves when the process exits successfully (exit code 0) or is terminated by a signal. + * If the process exits with a non-zero exit code, the promise is rejected with an {@link ExitCodeError}. + * + * @returns A promise that resolves when the process exits successfully or is terminated by a signal, or rejects on error. + */ + waitForExit(): Promise; +} + +/** + * Runs a command and returns a child process handle. + * + * @public + */ +export function run(args: string[], options: RunOptions = {}): RunChildProcess { + if (args.length === 0) { + throw new Error('run requires at least one argument'); + } + + const [name, ...cmdArgs] = args; + + const { onStdout, onStderr, stdio: customStdio, ...spawnOptions } = options; + const env: NodeJS.ProcessEnv = { + ...process.env, + FORCE_COLOR: 'true', + ...(options.env ?? {}), + }; + + const stdio = + customStdio ?? + ([ + 'inherit', + onStdout ? 'pipe' : 'inherit', + onStderr ? 'pipe' : 'inherit', + ] as ('inherit' | 'pipe')[]); + + const child = spawn(name, cmdArgs, { + ...spawnOptions, + stdio, + env, + }) as RunChildProcess; + + if (onStdout && child.stdout) { + child.stdout.on('data', onStdout); + } + if (onStderr && child.stderr) { + child.stderr.on('data', onStderr); + } + + const commandName = args.join(' '); + + let waitPromise: Promise | undefined; + + child.waitForExit = async (): Promise => { + if (waitPromise) { + return waitPromise; + } + + waitPromise = new Promise((resolve, reject) => { + if (typeof child.exitCode === 'number') { + if (child.exitCode) { + reject(new ExitCodeError(child.exitCode, commandName)); + } else { + resolve(); + } + return; + } + + function onError(error: Error) { + cleanup(); + reject(error); + } + + function onExit(code: number | null) { + cleanup(); + if (code) { + reject(new ExitCodeError(code, commandName)); + } else { + resolve(); + } + } + + function onSignal() { + if (!child.killed && child.exitCode === null) { + child.kill(); + } + } + + function cleanup() { + for (const signal of ['SIGINT', 'SIGTERM'] as const) { + process.removeListener(signal, onSignal); + } + child.removeListener('error', onError); + child.removeListener('exit', onExit); + } + + child.once('error', onError); + child.once('exit', onExit); + + for (const signal of ['SIGINT', 'SIGTERM'] as const) { + process.addListener(signal, onSignal); + } + }); + + return waitPromise; + }; + + return child; +} + +/** + * Runs a command and returns the stdout. + * + * @remarks + * + * On error, both stdout and stderr are attached to the error object as properties. + * + * @public + */ +export async function runOutput( + args: string[], + options?: RunOptions, +): Promise { + const stdoutChunks: Buffer[] = []; + const stderrChunks: Buffer[] = []; + + if (args.length === 0) { + throw new Error('runOutput requires at least one argument'); + } + + try { + await run(args, { + ...options, + onStdout: data => { + stdoutChunks.push(data); + options?.onStdout?.(data); + }, + onStderr: data => { + stderrChunks.push(data); + options?.onStderr?.(data); + }, + }).waitForExit(); + + return Buffer.concat(stdoutChunks).toString().trim(); + } catch (error) { + assertError(error); + + (error as Error & { stdout?: string }).stdout = + Buffer.concat(stdoutChunks).toString(); + (error as Error & { stderr?: string }).stderr = + Buffer.concat(stderrChunks).toString(); + + throw error; + } +} + +/** + * Runs a command and returns true if it exits with code 0, false otherwise. + * + * @public + */ +export async function runCheck(args: string[]): Promise { + try { + await run(args).waitForExit(); + return true; + } catch { + return false; + } +} diff --git a/packages/cli-node/CHANGELOG.md b/packages/cli-node/CHANGELOG.md index d77cc626b6..4c4005c0c9 100644 --- a/packages/cli-node/CHANGELOG.md +++ b/packages/cli-node/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/cli-node +## 0.2.16-next.1 + +### Patch Changes + +- 4e8c726: Updated to use new utilities from `@backstage/cli-common`. +- Updated dependencies + - @backstage/cli-common@0.1.16-next.1 + ## 0.2.16-next.0 ### Patch Changes diff --git a/packages/cli-node/package.json b/packages/cli-node/package.json index 92f86c533d..dcedc6b76c 100644 --- a/packages/cli-node/package.json +++ b/packages/cli-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/cli-node", - "version": "0.2.16-next.0", + "version": "0.2.16-next.1", "description": "Node.js library for Backstage CLIs", "backstage": { "role": "node-library" diff --git a/packages/cli-node/src/git/GitUtils.ts b/packages/cli-node/src/git/GitUtils.ts index 7b87487c56..7edb3581d6 100644 --- a/packages/cli-node/src/git/GitUtils.ts +++ b/packages/cli-node/src/git/GitUtils.ts @@ -15,23 +15,27 @@ */ import { assertError, ForwardedError } from '@backstage/errors'; -import { execFile, paths } from '../util'; +import { paths } from '../paths'; +import { runOutput } from '@backstage/cli-common'; /** * Run a git command, trimming the output splitting it into lines. */ export async function runGit(...args: string[]) { try { - const { stdout } = await execFile('git', args, { - shell: true, + const stdout = await runOutput(['git', ...args], { cwd: paths.targetRoot, }); return stdout.trim().split(/\r\n|\r|\n/); } catch (error) { assertError(error); - if (error.stderr || typeof error.code === 'number') { - const stderr = (error.stderr as undefined | Buffer)?.toString('utf8'); - const msg = stderr?.trim() ?? `with exit code ${error.code}`; + if ( + 'code' in error && + typeof (error as { code?: number }).code === 'number' + ) { + const code = (error as { code?: number }).code; + const stderr = (error as { stderr?: string }).stderr; + const msg = stderr?.trim() ?? `with exit code ${code}`; throw new Error(`git ${args[0]} failed, ${msg}`); } throw new ForwardedError('Unknown execution error', error); @@ -83,10 +87,8 @@ export class GitUtils { // silently fall back to using the ref directly if merge base is not available } - const { stdout } = await execFile('git', ['show', `${showRef}:${path}`], { - shell: true, + const stdout = await runOutput(['git', 'show', `${showRef}:${path}`], { cwd: paths.targetRoot, - maxBuffer: 1024 * 1024 * 50, }); return stdout; } diff --git a/packages/cli-node/src/monorepo/PackageGraph.test.ts b/packages/cli-node/src/monorepo/PackageGraph.test.ts index e2378b91c0..9bc9cbf72b 100644 --- a/packages/cli-node/src/monorepo/PackageGraph.test.ts +++ b/packages/cli-node/src/monorepo/PackageGraph.test.ts @@ -23,7 +23,7 @@ import { GitUtils } from '../git'; const mockListChangedFiles = jest.spyOn(GitUtils, 'listChangedFiles'); const mockReadFileAtRef = jest.spyOn(GitUtils, 'readFileAtRef'); -jest.mock('../util', () => ({ +jest.mock('../paths', () => ({ paths: { targetRoot: '/', resolveTargetRoot: (...paths: string[]) => resolvePath('/', ...paths), diff --git a/packages/cli-node/src/monorepo/PackageGraph.ts b/packages/cli-node/src/monorepo/PackageGraph.ts index 2f82af0808..76fbe9ba4f 100644 --- a/packages/cli-node/src/monorepo/PackageGraph.ts +++ b/packages/cli-node/src/monorepo/PackageGraph.ts @@ -16,7 +16,7 @@ import path from 'path'; import { getPackages, Package } from '@manypkg/get-packages'; -import { paths } from '../util'; +import { paths } from '../paths'; import { PackageRole } from '../roles'; import { GitUtils } from '../git'; import { Lockfile } from './Lockfile'; diff --git a/packages/cli-node/src/monorepo/isMonoRepo.ts b/packages/cli-node/src/monorepo/isMonoRepo.ts index f47ac4b9ad..da78c8dd53 100644 --- a/packages/cli-node/src/monorepo/isMonoRepo.ts +++ b/packages/cli-node/src/monorepo/isMonoRepo.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { paths } from '../util'; +import { paths } from '../paths'; import fs from 'fs-extra'; /** diff --git a/packages/cli-node/src/monorepo/isMonorepo.test.ts b/packages/cli-node/src/monorepo/isMonorepo.test.ts index 30c2d3ccbc..de0dae0893 100644 --- a/packages/cli-node/src/monorepo/isMonorepo.test.ts +++ b/packages/cli-node/src/monorepo/isMonorepo.test.ts @@ -19,7 +19,7 @@ import { createMockDirectory } from '@backstage/backend-test-utils'; const mockDir = createMockDirectory(); -jest.mock('../util', () => ({ +jest.mock('../paths', () => ({ paths: { resolveTargetRoot: (...args: string[]) => mockDir.resolve(...args) }, })); diff --git a/packages/cli-node/src/pacman/PackageManager.test.ts b/packages/cli-node/src/pacman/PackageManager.test.ts index 3997da554c..dd35e74902 100644 --- a/packages/cli-node/src/pacman/PackageManager.test.ts +++ b/packages/cli-node/src/pacman/PackageManager.test.ts @@ -21,8 +21,8 @@ import { withLogCollector } from '@backstage/test-utils'; const mockDir = createMockDirectory(); -jest.mock('../util', () => ({ - ...jest.requireActual('../util'), +jest.mock('../paths', () => ({ + ...jest.requireActual('../paths'), paths: { resolveTargetRoot: (...args: string[]) => mockDir.resolve(...args) }, })); diff --git a/packages/cli-node/src/pacman/PackageManager.ts b/packages/cli-node/src/pacman/PackageManager.ts index fc0aaa2c97..44c0849705 100644 --- a/packages/cli-node/src/pacman/PackageManager.ts +++ b/packages/cli-node/src/pacman/PackageManager.ts @@ -16,7 +16,8 @@ import { Yarn } from './yarn'; import { Lockfile } from './Lockfile'; -import { SpawnOptionsPartialEnv, paths } from '../util'; +import { paths } from '../paths'; +import { RunOptions } from '@backstage/cli-common'; import fs from 'fs-extra'; /** @@ -55,7 +56,7 @@ export interface PackageManager { getMonorepoPackages(): Promise; /** Uses the package manager to run a command in the repo. */ - run(args: string[], options?: SpawnOptionsPartialEnv): Promise; + run(args: string[], options?: RunOptions): Promise; /** * Executes the package manager's pack command to bundle the repo into an diff --git a/packages/cli-node/src/pacman/yarn/Yarn.test.ts b/packages/cli-node/src/pacman/yarn/Yarn.test.ts index 9584ef54b2..9bf866b821 100644 --- a/packages/cli-node/src/pacman/yarn/Yarn.test.ts +++ b/packages/cli-node/src/pacman/yarn/Yarn.test.ts @@ -19,8 +19,8 @@ import { Yarn } from './Yarn'; const mockDir = createMockDirectory(); -jest.mock('../../util', () => ({ - ...jest.requireActual('../../util'), +jest.mock('../../paths', () => ({ + ...jest.requireActual('../../paths'), paths: { resolveTargetRoot: (...args: string[]) => mockDir.resolve(...args) }, })); diff --git a/packages/cli-node/src/pacman/yarn/Yarn.ts b/packages/cli-node/src/pacman/yarn/Yarn.ts index 0a2b8d55ea..a6544344ca 100644 --- a/packages/cli-node/src/pacman/yarn/Yarn.ts +++ b/packages/cli-node/src/pacman/yarn/Yarn.ts @@ -23,7 +23,8 @@ import { PackageInfo, PackageManager } from '../PackageManager'; import { Lockfile } from '../Lockfile'; import { YarnVersion } from './types'; import fs from 'fs-extra'; -import { paths, run, execFile, SpawnOptionsPartialEnv } from '../../util'; +import { paths } from '../../paths'; +import { run, runOutput, RunOptions } from '@backstage/cli-common'; export class Yarn implements PackageManager { constructor(private readonly yarnVersion: YarnVersion) {} @@ -63,8 +64,8 @@ export class Yarn implements PackageManager { }); } - async run(args: string[], options?: SpawnOptionsPartialEnv) { - await run('yarn', args, options); + async run(args: string[], options?: RunOptions) { + await run(['yarn', ...args], options).waitForExit(); } async fetchPackageInfo(): Promise { @@ -98,8 +99,7 @@ function detectYarnVersion(dir?: string): Promise { const promise = Promise.resolve().then(async () => { try { - const { stdout } = await execFile('yarn', ['--version'], { - shell: true, + const stdout = await runOutput(['yarn', '--version'], { cwd, }); const versionString = stdout.trim(); @@ -109,9 +109,6 @@ function detectYarnVersion(dir?: string): Promise { return { version: versionString, codename }; } catch (error) { assertError(error); - if ('stderr' in error) { - process.stderr.write(error.stderr as Buffer); - } throw new ForwardedError('Failed to determine yarn version', error); } }); diff --git a/packages/cli-node/src/paths.ts b/packages/cli-node/src/paths.ts new file mode 100644 index 0000000000..2c658c27b3 --- /dev/null +++ b/packages/cli-node/src/paths.ts @@ -0,0 +1,20 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { findPaths } from '@backstage/cli-common'; + +/* eslint-disable-next-line no-restricted-syntax */ +export const paths = findPaths(__dirname); diff --git a/packages/cli-node/src/util.ts b/packages/cli-node/src/util.ts deleted file mode 100644 index eaf05855b1..0000000000 --- a/packages/cli-node/src/util.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2020 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { - ChildProcess, - execFile as execFileCb, - spawn, - SpawnOptions, -} from 'child_process'; -import { promisify } from 'util'; -import { findPaths } from '@backstage/cli-common'; -import { ExitCodeError } from './errors'; - -export const execFile = promisify(execFileCb); - -/* eslint-disable-next-line no-restricted-syntax */ -export const paths = findPaths(__dirname); - -/** - * A function that can be used to log data from a child process - * - * @public - */ -export type LogFunc = (data: Buffer) => void; - -/** - * Options for running a child process - * - * @public - */ -export type SpawnOptionsPartialEnv = Omit & { - env?: Partial; - // Pipe stdout to this log function - stdoutLogFunc?: LogFunc; - // Pipe stderr to this log function - stderrLogFunc?: LogFunc; -}; - -// Runs a child command, returning a promise that is only resolved if the child exits with code 0. -export async function run( - name: string, - args: string[] = [], - options: SpawnOptionsPartialEnv = {}, -) { - const { stdoutLogFunc, stderrLogFunc } = options; - const env: NodeJS.ProcessEnv = { - ...process.env, - FORCE_COLOR: 'true', - ...(options.env ?? {}), - }; - - const stdio = [ - 'inherit', - stdoutLogFunc ? 'pipe' : 'inherit', - stderrLogFunc ? 'pipe' : 'inherit', - ] as ('inherit' | 'pipe')[]; - - const child = spawn(name, args, { - stdio, - shell: true, - ...options, - env, - }); - - if (stdoutLogFunc && child.stdout) { - child.stdout.on('data', stdoutLogFunc); - } - if (stderrLogFunc && child.stderr) { - child.stderr.on('data', stderrLogFunc); - } - - await waitForExit(child, name); -} - -async function waitForExit( - child: ChildProcess & { exitCode: number | null }, - name?: string, -): Promise { - if (typeof child.exitCode === 'number') { - if (child.exitCode) { - throw new ExitCodeError(child.exitCode, name); - } - return; - } - - await new Promise((resolve, reject) => { - child.once('error', error => reject(error)); - child.once('exit', code => { - if (code) { - reject(new ExitCodeError(code, name)); - } else { - resolve(); - } - }); - }); -} diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index b86acf2d49..6dd279fadb 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,47 @@ # @backstage/cli +## 0.35.0-next.2 + +### Minor Changes + +- f8dff94: Switched the default module resolution to `bundler` and the `module` setting to `ES2020`. + + You may need to bump some dependencies as part of this change and fix imports in code. The most common source of this is that type checking will now consider the `exports` field in `package.json` when resolving imports. This in turn can break older versions of packages that had incompatible `exports` fields. Generally these issues will have already been fixed in the upstream packages. + + You might be tempted to use `--skipLibCheck` to hide issues due to this change, but it will weaken the type safety of your project. If you run into a large number of issues and want to keep the old behavior, you can reset the `moduleResolution` and `module` settings your own `tsconfig.json` file to `node` and `ESNext` respectively. But keep in mind that the `node` option will be removed in future versions of TypeScript. + + A future version of Backstage will make these new settings mandatory, as we move to rely on the `exports` field for type resolution in packages, rather than the `typesVersions` field. + +### Patch Changes + +- de96a60: chore(deps): bump `express` from 4.21.2 to 4.22.0 +- 1226647: Updated dependency `esbuild` to `^0.27.0`. +- f89a074: Updated dependency `@pmmmwh/react-refresh-webpack-plugin` to `^0.6.0`. +- 2b81751: Updated dependency `webpack` to `~5.103.0`. +- fafd9e1: Fixed internal usage of `yargs`. +- 2bae83a: Switched ECMAScript version to ES2023. +- 2bae83a: Bumped dev dependencies `@types/node` +- Updated dependencies + - @backstage/integration@1.18.3-next.1 + - @backstage/config-loader@1.10.7-next.1 + - @backstage/cli-common@0.1.16-next.2 + - @backstage/catalog-model@1.7.6 + - @backstage/cli-node@0.2.16-next.1 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/eslint-plugin@0.2.0 + - @backstage/release-manifests@0.0.13 + - @backstage/types@1.2.2 + +## 0.34.6-next.1 + +### Patch Changes + +- 7fbac5c: Updated to use new utilities from `@backstage/cli-common`. +- Updated dependencies + - @backstage/cli-node@0.2.16-next.1 + - @backstage/cli-common@0.1.16-next.1 + ## 0.34.6-next.0 ### Patch Changes diff --git a/packages/cli/config/nodeTransform.cjs b/packages/cli/config/nodeTransform.cjs index f54527b4a7..54984b74a4 100644 --- a/packages/cli/config/nodeTransform.cjs +++ b/packages/cli/config/nodeTransform.cjs @@ -61,7 +61,7 @@ addHook( ignoreDynamic: true, }, jsc: { - target: 'es2022', + target: 'es2023', parser: { syntax: 'typescript', }, diff --git a/packages/cli/config/nodeTransformHooks.mjs b/packages/cli/config/nodeTransformHooks.mjs index 7bf0473bb8..7e00eff9f6 100644 --- a/packages/cli/config/nodeTransformHooks.mjs +++ b/packages/cli/config/nodeTransformHooks.mjs @@ -277,7 +277,7 @@ export async function load(url, context, nextLoad) { exportInteropAnnotation: true, }, jsc: { - target: 'es2022', + target: 'es2023', parser: { syntax: 'typescript', }, diff --git a/packages/cli/config/tsconfig.json b/packages/cli/config/tsconfig.json index ac5e62b52e..40a572da4d 100644 --- a/packages/cli/config/tsconfig.json +++ b/packages/cli/config/tsconfig.json @@ -12,9 +12,9 @@ "incremental": true, "isolatedModules": true, "jsx": "react", - "lib": ["DOM", "DOM.Iterable", "ScriptHost", "ES2022"], - "module": "ESNext", - "moduleResolution": "node", + "lib": ["DOM", "DOM.Iterable", "ScriptHost", "ES2023"], + "module": "ES2020", + "moduleResolution": "bundler", "noEmit": false, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, diff --git a/packages/cli/package.json b/packages/cli/package.json index 3fcea01e9e..c48b529551 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/cli", - "version": "0.34.6-next.0", + "version": "0.35.0-next.2", "description": "CLI for developing Backstage plugins and apps", "backstage": { "role": "cli" @@ -88,7 +88,7 @@ "cross-spawn": "^7.0.3", "css-loader": "^6.5.1", "ctrlc-windows": "^2.1.0", - "esbuild": "^0.25.0", + "esbuild": "^0.27.0", "eslint": "^8.6.0", "eslint-config-prettier": "^9.0.0", "eslint-formatter-friendly": "^7.0.0", @@ -100,7 +100,7 @@ "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-unused-imports": "^4.1.4", "eslint-rspack-plugin": "^4.2.1", - "express": "^4.17.1", + "express": "^4.22.0", "fs-extra": "^11.2.0", "git-url-parse": "^15.0.0", "glob": "^7.1.7", @@ -167,14 +167,14 @@ "@backstage/plugin-scaffolder-node-test-utils": "workspace:^", "@backstage/test-utils": "workspace:^", "@backstage/theme": "workspace:^", - "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7", + "@pmmmwh/react-refresh-webpack-plugin": "^0.6.0", "@types/cross-spawn": "^6.0.2", "@types/ejs": "^3.1.3", "@types/express": "^4.17.6", "@types/fs-extra": "^11.0.0", "@types/http-proxy": "^1.17.4", "@types/inquirer": "^8.1.3", - "@types/node": "^20.16.0", + "@types/node": "^22.13.14", "@types/npm-packlist": "^3.0.0", "@types/recursive-readdir": "^2.2.0", "@types/rollup-plugin-peer-deps-external": "^2.2.0", @@ -192,18 +192,18 @@ "msw": "^1.0.0", "nodemon": "^3.0.1", "terser-webpack-plugin": "^5.1.3", - "webpack": "~5.96.0", + "webpack": "~5.103.0", "webpack-dev-server": "^5.0.0" }, "peerDependencies": { "@module-federation/enhanced": "^0.9.0", - "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7", + "@pmmmwh/react-refresh-webpack-plugin": "^0.6.0", "esbuild-loader": "^4.0.0", "eslint-webpack-plugin": "^4.2.0", "fork-ts-checker-webpack-plugin": "^9.0.0", "mini-css-extract-plugin": "^2.4.2", "terser-webpack-plugin": "^5.1.3", - "webpack": "~5.96.0", + "webpack": "~5.103.0", "webpack-dev-server": "^5.0.0" }, "peerDependenciesMeta": { diff --git a/packages/cli/src/lib/run.ts b/packages/cli/src/lib/run.ts deleted file mode 100644 index e8602fcb18..0000000000 --- a/packages/cli/src/lib/run.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2020 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { - SpawnOptions, - spawn, - ChildProcess, - execFile as execFileCb, -} from 'child_process'; -import { ExitCodeError } from './errors'; -import { promisify } from 'util'; -import { assertError, ForwardedError } from '@backstage/errors'; - -export const execFile = promisify(execFileCb); - -type LogFunc = (data: Buffer) => void; - -type SpawnOptionsPartialEnv = Omit & { - env?: Partial; - // Pipe stdout to this log function - stdoutLogFunc?: LogFunc; - // Pipe stderr to this log function - stderrLogFunc?: LogFunc; -}; - -// Runs a child command, returning a promise that is only resolved if the child exits with code 0. -export async function run( - name: string, - args: string[] = [], - options: SpawnOptionsPartialEnv = {}, -) { - const { stdoutLogFunc, stderrLogFunc } = options; - const env: NodeJS.ProcessEnv = { - ...process.env, - FORCE_COLOR: 'true', - ...(options.env ?? {}), - }; - - const stdio = [ - 'inherit', - stdoutLogFunc ? 'pipe' : 'inherit', - stderrLogFunc ? 'pipe' : 'inherit', - ] as ('inherit' | 'pipe')[]; - - const child = spawn(name, args, { - stdio, - shell: true, - ...options, - env, - }); - - if (stdoutLogFunc && child.stdout) { - child.stdout.on('data', stdoutLogFunc); - } - if (stderrLogFunc && child.stderr) { - child.stderr.on('data', stderrLogFunc); - } - - await waitForExit(child, name); -} - -export async function runPlain(cmd: string, ...args: string[]) { - try { - const { stdout } = await execFile(cmd, args, { shell: true }); - return stdout.trim(); - } catch (error) { - assertError(error); - if ('stderr' in error) { - process.stderr.write(error.stderr as Buffer); - } - if (typeof error.code === 'number') { - throw new ExitCodeError(error.code, [cmd, ...args].join(' ')); - } - throw new ForwardedError('Unknown execution error', error); - } -} - -export async function runCheck(cmd: string, ...args: string[]) { - try { - await execFile(cmd, args, { shell: true }); - return true; - } catch (error) { - return false; - } -} - -export async function waitForExit( - child: ChildProcess & { exitCode: number | null }, - name?: string, -): Promise { - if (typeof child.exitCode === 'number') { - if (child.exitCode) { - throw new ExitCodeError(child.exitCode, name); - } - return; - } - - await new Promise((resolve, reject) => { - child.once('error', error => reject(error)); - child.once('exit', code => { - if (code) { - reject(new ExitCodeError(code, name)); - } else { - resolve(); - } - }); - }); -} diff --git a/packages/cli/src/lib/versioning/packages.test.ts b/packages/cli/src/lib/versioning/packages.test.ts index de6e7e1ed2..e823ce8769 100644 --- a/packages/cli/src/lib/versioning/packages.test.ts +++ b/packages/cli/src/lib/versioning/packages.test.ts @@ -14,16 +14,17 @@ * limitations under the License. */ -import * as runObj from '../run'; +import * as runObj from '@backstage/cli-common'; import * as yarn from './yarn'; import { fetchPackageInfo, mapDependencies } from './packages'; import { createMockDirectory } from '@backstage/backend-test-utils'; import { NotFoundError } from '@backstage/errors'; -jest.mock('../run', () => { +jest.mock('@backstage/cli-common', () => { + const actual = jest.requireActual('@backstage/cli-common'); return { - run: jest.fn(), - execFile: jest.fn(), + ...actual, + runOutput: jest.fn(), }; }); @@ -39,42 +40,40 @@ describe('fetchPackageInfo', () => { }); it('should forward info for yarn classic', async () => { - jest.spyOn(runObj, 'execFile').mockResolvedValue({ - stdout: `{"type":"inspect","data":{"the":"data"}}`, - stderr: '', - }); + jest + .spyOn(runObj, 'runOutput') + .mockResolvedValue(`{"type":"inspect","data":{"the":"data"}}`); jest.spyOn(yarn, 'detectYarnVersion').mockResolvedValue('classic'); await expect(fetchPackageInfo('my-package')).resolves.toEqual({ the: 'data', }); - expect(runObj.execFile).toHaveBeenCalledWith( + expect(runObj.runOutput).toHaveBeenCalledWith([ 'yarn', - ['info', '--json', 'my-package'], - { shell: true }, - ); + 'info', + '--json', + 'my-package', + ]); }); it('should forward info for yarn berry', async () => { - jest - .spyOn(runObj, 'execFile') - .mockResolvedValue({ stdout: `{"the":"data"}`, stderr: '' }); + jest.spyOn(runObj, 'runOutput').mockResolvedValue(`{"the":"data"}`); jest.spyOn(yarn, 'detectYarnVersion').mockResolvedValue('berry'); await expect(fetchPackageInfo('my-package')).resolves.toEqual({ the: 'data', }); - expect(runObj.execFile).toHaveBeenCalledWith( + expect(runObj.runOutput).toHaveBeenCalledWith([ 'yarn', - ['npm', 'info', '--json', 'my-package'], - { shell: true }, - ); + 'npm', + 'info', + '--json', + 'my-package', + ]); }); it('should throw if no info with yarn classic', async () => { - jest - .spyOn(runObj, 'execFile') - .mockResolvedValue({ stdout: '', stderr: '' }); + jest.spyOn(runObj, 'runOutput').mockResolvedValue(''); jest.spyOn(yarn, 'detectYarnVersion').mockResolvedValue('classic'); await expect(fetchPackageInfo('my-package')).rejects.toThrow( @@ -83,9 +82,10 @@ describe('fetchPackageInfo', () => { }); it('should throw if no info with yarn berry', async () => { - jest - .spyOn(runObj, 'execFile') - .mockRejectedValue({ stdout: 'bla bla bla Response Code: 404 bla bla' }); + const error = new Error('Command failed'); + (error as Error & { stdout?: string }).stdout = + 'bla bla bla Response Code: 404 bla bla'; + jest.spyOn(runObj, 'runOutput').mockRejectedValue(error); jest.spyOn(yarn, 'detectYarnVersion').mockResolvedValue('berry'); await expect(fetchPackageInfo('my-package')).rejects.toThrow( diff --git a/packages/cli/src/lib/versioning/packages.ts b/packages/cli/src/lib/versioning/packages.ts index 223f6b8aab..11f1ba3041 100644 --- a/packages/cli/src/lib/versioning/packages.ts +++ b/packages/cli/src/lib/versioning/packages.ts @@ -17,7 +17,7 @@ import { minimatch } from 'minimatch'; import { getPackages } from '@manypkg/get-packages'; import { detectYarnVersion } from './yarn'; -import { execFile } from '../run'; +import { runOutput } from '@backstage/cli-common'; import { NotFoundError } from '@backstage/errors'; const DEP_TYPES = [ @@ -54,11 +54,7 @@ export async function fetchPackageInfo( const cmd = yarnVersion === 'classic' ? ['info'] : ['npm', 'info']; try { - const { stdout: output } = await execFile( - 'yarn', - [...cmd, '--json', name], - { shell: true }, - ); + const output = await runOutput(['yarn', ...cmd, '--json', name]); if (!output) { throw new NotFoundError( @@ -81,7 +77,12 @@ export async function fetchPackageInfo( throw error; } - if (error?.stdout.includes('Response Code: 404')) { + if ( + error instanceof Error && + 'stdout' in error && + typeof error.stdout === 'string' && + error.stdout.includes('Response Code: 404') + ) { throw new NotFoundError( `No package information found for package ${name}`, ); diff --git a/packages/cli/src/lib/versioning/yarn.ts b/packages/cli/src/lib/versioning/yarn.ts index b6c0383bc2..908ddca949 100644 --- a/packages/cli/src/lib/versioning/yarn.ts +++ b/packages/cli/src/lib/versioning/yarn.ts @@ -15,10 +15,7 @@ */ import { assertError, ForwardedError } from '@backstage/errors'; -import { execFile as execFileCb } from 'child_process'; -import { promisify } from 'util'; - -const execFile = promisify(execFileCb); +import { runOutput } from '@backstage/cli-common'; const versions = new Map>(); @@ -30,16 +27,12 @@ export function detectYarnVersion(dir?: string): Promise<'classic' | 'berry'> { const promise = Promise.resolve().then(async () => { try { - const { stdout } = await execFile('yarn', ['--version'], { - shell: true, + const stdout = await runOutput(['yarn', '--version'], { cwd, }); return stdout.trim().startsWith('1.') ? 'classic' : 'berry'; } catch (error) { assertError(error); - if ('stderr' in error) { - process.stderr.write(error.stderr as Buffer); - } throw new ForwardedError('Failed to determine yarn version', error); } }); diff --git a/packages/cli/src/modules/build/lib/builder/config.ts b/packages/cli/src/modules/build/lib/builder/config.ts index 8add3559f4..3e360b645c 100644 --- a/packages/cli/src/modules/build/lib/builder/config.ts +++ b/packages/cli/src/modules/build/lib/builder/config.ts @@ -259,7 +259,7 @@ export async function makeRollupConfigs( json(), yaml(), esbuild({ - target: 'ES2022', + target: 'ES2023', minify: options.minify, }), ], diff --git a/packages/cli/src/modules/build/lib/bundler/config.ts b/packages/cli/src/modules/build/lib/bundler/config.ts index da444dff15..284d49d10a 100644 --- a/packages/cli/src/modules/build/lib/bundler/config.ts +++ b/packages/cli/src/modules/build/lib/bundler/config.ts @@ -29,7 +29,7 @@ import { paths as cliPaths } from '../../../../lib/paths'; import fs from 'fs-extra'; import { optimization as optimizationConfig } from './optimization'; import pickBy from 'lodash/pickBy'; -import { runPlain } from '../../../../lib/run'; +import { runOutput } from '@backstage/cli-common'; import { transforms } from './transforms'; import { version } from '../../../../lib/version'; import yn from 'yn'; @@ -78,14 +78,14 @@ async function readBuildInfo() { let commit: string | undefined; try { - commit = await runPlain('git', 'rev-parse', 'HEAD'); + commit = await runOutput(['git', 'rev-parse', 'HEAD']); } catch (error) { // ignore, see below } let gitVersion: string | undefined; try { - gitVersion = await runPlain('git', 'describe', '--always'); + gitVersion = await runOutput(['git', 'describe', '--always']); } catch (error) { // ignore, see below } diff --git a/packages/cli/src/modules/build/lib/bundler/optimization.ts b/packages/cli/src/modules/build/lib/bundler/optimization.ts index 63319ebec6..8d0eea5b88 100644 --- a/packages/cli/src/modules/build/lib/bundler/optimization.ts +++ b/packages/cli/src/modules/build/lib/bundler/optimization.ts @@ -34,13 +34,13 @@ export const optimization = ( minimize: !isDev, minimizer: [ new MinifyPlugin({ - target: 'ES2022', + target: 'ES2023', format: 'iife', exclude: 'remoteEntry.js', }), // Avoid iife wrapping of module federation remote entry as it breaks the variable assignment new MinifyPlugin({ - target: 'ES2022', + target: 'ES2023', format: undefined, include: 'remoteEntry.js', }), diff --git a/packages/cli/src/modules/build/lib/bundler/transforms.ts b/packages/cli/src/modules/build/lib/bundler/transforms.ts index 64e33b220e..ecf6e20751 100644 --- a/packages/cli/src/modules/build/lib/bundler/transforms.ts +++ b/packages/cli/src/modules/build/lib/bundler/transforms.ts @@ -67,7 +67,7 @@ export const transforms = (options: TransformOptions): Transforms => { : 'builtin:swc-loader', options: { jsc: { - target: 'es2022', + target: 'es2023', externalHelpers: !isBackend, parser: { syntax: 'typescript', @@ -97,7 +97,7 @@ export const transforms = (options: TransformOptions): Transforms => { : 'builtin:swc-loader', options: { jsc: { - target: 'es2022', + target: 'es2023', externalHelpers: !isBackend, parser: { syntax: 'ecmascript', diff --git a/packages/cli/src/modules/build/lib/packager/createDistWorkspace.ts b/packages/cli/src/modules/build/lib/packager/createDistWorkspace.ts index 971409cd93..90635f1a73 100644 --- a/packages/cli/src/modules/build/lib/packager/createDistWorkspace.ts +++ b/packages/cli/src/modules/build/lib/packager/createDistWorkspace.ts @@ -25,7 +25,7 @@ import { tmpdir } from 'os'; import tar, { CreateOptions, FileOptions } from 'tar'; import partition from 'lodash/partition'; import { paths } from '../../../../lib/paths'; -import { run } from '../../../../lib/run'; +import { run } from '@backstage/cli-common'; import { dependencies as cliDependencies, devDependencies as cliDevDependencies, @@ -228,11 +228,11 @@ export async function createDistWorkspace( await runParallelWorkers({ items: customBuild, worker: async ({ name, dir, args }) => { - await run('yarn', ['run', 'build', ...(args || [])], { + await run(['yarn', 'run', 'build', ...(args || [])], { cwd: dir, - stdoutLogFunc: prefixLogFunc(`${name}: `, 'stdout'), - stderrLogFunc: prefixLogFunc(`${name}: `, 'stderr'), - }); + onStdout: prefixLogFunc(`${name}: `, 'stdout'), + onStderr: prefixLogFunc(`${name}: `, 'stderr'), + }).waitForExit(); }, }); } @@ -321,9 +321,9 @@ async function moveToDistWorkspace( console.log(`Repacking ${target.name} into dist workspace`); const archivePath = resolvePath(workspaceDir, archive); - await run('yarn', ['pack', '--filename', archivePath], { + await run(['yarn', 'pack', '--filename', archivePath], { cwd: target.dir, - }); + }).waitForExit(); const outputDir = relativePath(paths.targetRoot, target.dir); const absoluteOutputPath = resolvePath(workspaceDir, outputDir); diff --git a/packages/cli/src/modules/build/lib/runner/runBackend.test.ts b/packages/cli/src/modules/build/lib/runner/runBackend.test.ts new file mode 100644 index 0000000000..2b97ae352c --- /dev/null +++ b/packages/cli/src/modules/build/lib/runner/runBackend.test.ts @@ -0,0 +1,178 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { runBackend } from './runBackend'; +import spawn from 'cross-spawn'; + +// Mock external dependencies +jest.mock('chokidar', () => ({ + watch: jest.fn(() => ({ + on: jest.fn().mockReturnThis(), + add: jest.fn(), + })), +})); + +jest.mock('cross-spawn', () => + jest.fn(() => ({ + on: jest.fn().mockReturnThis(), + once: jest.fn().mockReturnThis(), + kill: jest.fn(), + killed: false, + exitCode: null, + pid: 12345, + })), +); + +jest.mock('../ipc', () => ({ + IpcServer: jest.fn().mockImplementation(() => ({ + addChild: jest.fn(), + })), + ServerDataStore: { + bind: jest.fn(), + }, +})); + +jest.mock('ctrlc-windows', () => ({ + ctrlc: jest.fn(), +})); + +describe('runBackend', () => { + let originalEnv: NodeJS.ProcessEnv; + let originalPlatform: string; + const mockSpawn = spawn as jest.MockedFunction; + + beforeEach(() => { + // Use fake timers to control debounce + jest.useFakeTimers(); + + // Save original environment + originalEnv = { ...process.env }; + process.env = { NODE_ENV: 'test' }; + originalPlatform = process.platform; + + // Mock process.stdin.on to prevent actual stdin reading + jest.spyOn(process.stdin, 'on').mockReturnValue(process.stdin); + + // Mock process.once to prevent actual signal handling + jest.spyOn(process, 'once').mockReturnValue(process); + }); + + afterEach(() => { + // Restore original environment + process.env = originalEnv; + Object.defineProperty(process, 'platform', { + value: originalPlatform, + }); + + jest.clearAllMocks(); + jest.useRealTimers(); + }); + + describe('--no-node-snapshot argument handling', () => { + it('should pass --no-node-snapshot when NODE_OPTIONS is not set', () => { + delete process.env.NODE_OPTIONS; + + runBackend({ + entry: 'src/index', + }); + + // Fast-forward past the debounce delay (100ms) + jest.advanceTimersByTime(100); + + expect(mockSpawn).toHaveBeenCalled(); + const spawnArgs = mockSpawn.mock.calls[0][1] as string[]; + expect(spawnArgs).toContain('--no-node-snapshot'); + }); + + it('should pass --no-node-snapshot when NODE_OPTIONS exists without --node-snapshot', () => { + process.env.NODE_OPTIONS = '--max-old-space-size=4096'; + + runBackend({ + entry: 'src/index', + }); + + // Fast-forward past the debounce delay (100ms) + jest.advanceTimersByTime(100); + + expect(mockSpawn).toHaveBeenCalled(); + const spawnArgs = mockSpawn.mock.calls[0][1] as string[]; + expect(spawnArgs).toContain('--no-node-snapshot'); + }); + + it('should not pass --no-node-snapshot when --node-snapshot already exists in NODE_OPTIONS', () => { + process.env.NODE_OPTIONS = '--node-snapshot --max-old-space-size=4096'; + + runBackend({ + entry: 'src/index', + }); + + // Fast-forward past the debounce delay (100ms) + jest.advanceTimersByTime(100); + + expect(mockSpawn).toHaveBeenCalled(); + const spawnArgs = mockSpawn.mock.calls[0][1] as string[]; + expect(spawnArgs).not.toContain('--no-node-snapshot'); + }); + + it('should not pass --no-node-snapshot when --node-snapshot exists in the middle of NODE_OPTIONS', () => { + process.env.NODE_OPTIONS = + '--max-old-space-size=4096 --node-snapshot --inspect'; + + runBackend({ + entry: 'src/index', + }); + + // Fast-forward past the debounce delay (100ms) + jest.advanceTimersByTime(100); + + expect(mockSpawn).toHaveBeenCalled(); + const spawnArgs = mockSpawn.mock.calls[0][1] as string[]; + expect(spawnArgs).not.toContain('--no-node-snapshot'); + }); + + it('should pass --no-node-snapshot even with trailing spaces in NODE_OPTIONS', () => { + process.env.NODE_OPTIONS = '--max-old-space-size=4096 '; + + runBackend({ + entry: 'src/index', + }); + + // Fast-forward past the debounce delay (100ms) + jest.advanceTimersByTime(100); + + expect(mockSpawn).toHaveBeenCalled(); + const spawnArgs = mockSpawn.mock.calls[0][1] as string[]; + expect(spawnArgs).toContain('--no-node-snapshot'); + }); + + it('should pass --no-node-snapshot alongside other option args like --inspect', () => { + delete process.env.NODE_OPTIONS; + + runBackend({ + entry: 'src/index', + inspectEnabled: true, + }); + + // Fast-forward past the debounce delay (100ms) + jest.advanceTimersByTime(100); + + expect(mockSpawn).toHaveBeenCalled(); + const spawnArgs = mockSpawn.mock.calls[0][1] as string[]; + expect(spawnArgs).toContain('--no-node-snapshot'); + expect(spawnArgs).toContain('--inspect'); + }); + }); +}); diff --git a/packages/cli/src/modules/build/lib/runner/runBackend.ts b/packages/cli/src/modules/build/lib/runner/runBackend.ts index 49dccf804f..0550ff2563 100644 --- a/packages/cli/src/modules/build/lib/runner/runBackend.ts +++ b/packages/cli/src/modules/build/lib/runner/runBackend.ts @@ -47,7 +47,7 @@ export type RunBackendOptions = { }; export async function runBackend(options: RunBackendOptions) { - const envEnv = process.env as { NODE_ENV: string }; + const envEnv = process.env as { NODE_ENV: string; NODE_OPTIONS?: string }; if (!envEnv.NODE_ENV) { envEnv.NODE_ENV = 'development'; } @@ -115,6 +115,12 @@ export async function runBackend(options: RunBackendOptions) { } } + // Unless the user explicitly toggles node-snapshot, default to provide --no-node-snapshot to reduce number of steps to run scaffolder + // on Node LTS. + if (!envEnv.NODE_OPTIONS?.includes('--node-snapshot')) { + optionArgs.push('--no-node-snapshot'); + } + const userArgs = process.argv .slice(['node', 'backstage-cli', 'package', 'start'].length) .filter(arg => !optionArgs.includes(arg)); diff --git a/packages/cli/src/modules/config/index.ts b/packages/cli/src/modules/config/index.ts index d62dbd4d26..3eabf5e9fc 100644 --- a/packages/cli/src/modules/config/index.ts +++ b/packages/cli/src/modules/config/index.ts @@ -62,7 +62,7 @@ export default createCliPlugin({ path: ['config:print'], description: 'Print the app configuration for the current package', execute: async ({ args, info }) => { - const argv = await yargs + const argv = await yargs() .options({ package: { type: 'string' }, lax: { type: 'boolean' }, @@ -82,7 +82,7 @@ export default createCliPlugin({ description: 'Validate that the given configuration loads and matches schema', execute: async ({ args }) => { - const argv = await yargs + const argv = await yargs() .options({ package: { type: 'string' }, lax: { type: 'boolean' }, @@ -105,7 +105,7 @@ export default createCliPlugin({ path: ['config:schema'], description: 'Print the JSON schema for the given configuration', execute: async ({ args }) => { - const argv = await yargs + const argv = await yargs() .options({ package: { type: 'string' }, format: { type: 'string' }, @@ -122,7 +122,7 @@ export default createCliPlugin({ path: ['config', 'schema'], description: 'Print the JSON schema for the given configuration', execute: async ({ args }) => { - const argv = await yargs + const argv = await yargs() .options({ package: { type: 'string' }, format: { type: 'string' }, diff --git a/packages/cli/src/modules/info/commands/info.ts b/packages/cli/src/modules/info/commands/info.ts index 416c995541..97090d8b9a 100644 --- a/packages/cli/src/modules/info/commands/info.ts +++ b/packages/cli/src/modules/info/commands/info.ts @@ -16,14 +16,14 @@ import { version as cliVersion } from '../../../../package.json'; import os from 'os'; -import { runPlain } from '../../../lib/run'; +import { runOutput } from '@backstage/cli-common'; import { paths } from '../../../lib/paths'; import { Lockfile } from '../../../lib/versioning'; import fs from 'fs-extra'; export default async () => { await new Promise(async () => { - const yarnVersion = await runPlain('yarn --version'); + const yarnVersion = await runOutput(['yarn', '--version']); const isLocal = fs.existsSync(paths.resolveOwn('./src')); const backstageFile = paths.resolveTargetRoot('backstage.json'); diff --git a/packages/cli/src/modules/maintenance/commands/repo/clean.ts b/packages/cli/src/modules/maintenance/commands/repo/clean.ts index 51c31129ea..c76076ad55 100644 --- a/packages/cli/src/modules/maintenance/commands/repo/clean.ts +++ b/packages/cli/src/modules/maintenance/commands/repo/clean.ts @@ -14,14 +14,11 @@ * limitations under the License. */ -import { execFile as execFileCb } from 'child_process'; import fs from 'fs-extra'; import { resolve as resolvePath } from 'path'; -import { promisify } from 'util'; import { PackageGraph } from '@backstage/cli-node'; import { paths } from '../../../../lib/paths'; - -const execFile = promisify(execFileCb); +import { run } from '@backstage/cli-common'; export async function command(): Promise { const packages = await PackageGraph.listTargetPackages(); @@ -44,12 +41,9 @@ export async function command(): Promise { await fs.remove(resolvePath(pkg.dir, 'dist-types')); await fs.remove(resolvePath(pkg.dir, 'coverage')); } else if (cleanScript) { - const result = await execFile('yarn', ['run', 'clean'], { + await run(['yarn', 'run', 'clean'], { cwd: pkg.dir, - shell: true, - }); - process.stdout.write(result.stdout); - process.stderr.write(result.stderr); + }).waitForExit(); } } }), diff --git a/packages/cli/src/modules/migrate/commands/packageLintConfigs.ts b/packages/cli/src/modules/migrate/commands/packageLintConfigs.ts index c8e8ef3a42..8f5e395b98 100644 --- a/packages/cli/src/modules/migrate/commands/packageLintConfigs.ts +++ b/packages/cli/src/modules/migrate/commands/packageLintConfigs.ts @@ -17,7 +17,7 @@ import fs from 'fs-extra'; import { resolve as resolvePath } from 'path'; import { PackageGraph } from '@backstage/cli-node'; -import { runPlain } from '../../../lib/run'; +import { runOutput } from '@backstage/cli-common'; const PREFIX = `module.exports = require('@backstage/cli/config/eslint-factory')`; @@ -84,6 +84,6 @@ export async function command() { } if (hasPrettier) { - await runPlain('prettier', '--write', ...configPaths); + await runOutput(['prettier', '--write', ...configPaths]); } } diff --git a/packages/cli/src/modules/migrate/commands/versions/bump.test.ts b/packages/cli/src/modules/migrate/commands/versions/bump.test.ts index 738610d09c..202704e030 100644 --- a/packages/cli/src/modules/migrate/commands/versions/bump.test.ts +++ b/packages/cli/src/modules/migrate/commands/versions/bump.test.ts @@ -15,7 +15,7 @@ */ import fs from 'fs-extra'; import { Command } from 'commander'; -import * as runObj from '../../../../lib/run'; +import * as runObj from '@backstage/cli-common'; import bump, { bumpBackstageJsonVersion, createVersionFinder } from './bump'; import { registerMswTestHooks, withLogCollector } from '@backstage/test-utils'; import { YarnInfoInspectData } from '../../../../lib/versioning/packages'; @@ -60,21 +60,22 @@ jest.mock('ora', () => ({ })); let mockDir: MockDirectory; -jest.mock('@backstage/cli-common', () => ({ - ...jest.requireActual('@backstage/cli-common'), - findPaths: () => ({ - resolveTargetRoot(filename: string) { - return mockDir.resolve(filename); - }, - get targetDir() { - return mockDir.path; - }, - }), -})); - -jest.mock('../../../../lib/run', () => { +jest.mock('@backstage/cli-common', () => { + const actual = jest.requireActual('@backstage/cli-common'); return { - run: jest.fn(), + ...actual, + findPaths: () => ({ + resolveTargetRoot(filename: string) { + return mockDir.resolve(filename); + }, + get targetDir() { + return mockDir.path; + }, + }), + run: jest.fn().mockReturnValue({ + exitCode: null, + waitForExit: jest.fn().mockResolvedValue(undefined), + }), }; }); @@ -184,7 +185,10 @@ describe('bump', () => { }, }); - jest.spyOn(runObj, 'run').mockResolvedValue(undefined); + jest.spyOn(runObj, 'run').mockReturnValue({ + exitCode: null, + waitForExit: jest.fn().mockResolvedValue(undefined), + } as any); worker.use( rest.get( 'https://versions.backstage.io/v1/tags/main/manifest.json', @@ -222,8 +226,7 @@ describe('bump', () => { expect(runObj.run).toHaveBeenCalledTimes(1); expect(runObj.run).toHaveBeenCalledWith( - 'yarn', - ['install'], + ['yarn', 'install'], expect.any(Object), ); @@ -277,7 +280,10 @@ describe('bump', () => { }, }); - jest.spyOn(runObj, 'run').mockResolvedValue(undefined); + jest.spyOn(runObj, 'run').mockReturnValue({ + exitCode: null, + waitForExit: jest.fn().mockResolvedValue(undefined), + } as any); worker.use( rest.get( 'https://versions.backstage.io/v1/tags/main/manifest.json', @@ -318,8 +324,7 @@ describe('bump', () => { expect(mockFetchPackageInfo).toHaveBeenCalledWith('@backstage/theme'); expect(runObj.run).not.toHaveBeenCalledWith( - 'yarn', - ['install'], + ['yarn', 'install'], expect.any(Object), ); @@ -373,7 +378,10 @@ describe('bump', () => { }, }); - jest.spyOn(runObj, 'run').mockResolvedValue(undefined); + jest.spyOn(runObj, 'run').mockReturnValue({ + exitCode: null, + waitForExit: jest.fn().mockResolvedValue(undefined), + } as any); worker.use( rest.get( 'https://versions.backstage.io/v1/tags/main/manifest.json', @@ -421,8 +429,7 @@ describe('bump', () => { expect(runObj.run).toHaveBeenCalledTimes(1); expect(runObj.run).toHaveBeenCalledWith( - 'yarn', - ['install'], + ['yarn', 'install'], expect.any(Object), ); @@ -477,7 +484,10 @@ describe('bump', () => { }, }); - jest.spyOn(runObj, 'run').mockResolvedValue(undefined); + jest.spyOn(runObj, 'run').mockReturnValue({ + exitCode: null, + waitForExit: jest.fn().mockResolvedValue(undefined), + } as any); worker.use( rest.get( 'https://versions.backstage.io/v1/tags/main/manifest.json', @@ -526,14 +536,14 @@ describe('bump', () => { expect(mockFetchPackageInfo).toHaveBeenCalledWith('@backstage/core'); expect(runObj.run).toHaveBeenCalledTimes(2); - expect(runObj.run).toHaveBeenCalledWith('yarn', [ + expect(runObj.run).toHaveBeenCalledWith([ + 'yarn', 'plugin', 'import', 'https://versions.backstage.io/v1/releases/0.0.1/yarn-plugin', ]); expect(runObj.run).toHaveBeenCalledWith( - 'yarn', - ['install'], + ['yarn', 'install'], expect.any(Object), ); @@ -587,7 +597,10 @@ describe('bump', () => { }, }); - jest.spyOn(runObj, 'run').mockResolvedValue(undefined); + jest.spyOn(runObj, 'run').mockReturnValue({ + exitCode: null, + waitForExit: jest.fn().mockResolvedValue(undefined), + } as any); worker.use( rest.get( 'https://versions.backstage.io/v1/releases/999.0.1/manifest.json', @@ -656,7 +669,10 @@ describe('bump', () => { }, }); - jest.spyOn(runObj, 'run').mockResolvedValue(undefined); + jest.spyOn(runObj, 'run').mockReturnValue({ + exitCode: null, + waitForExit: jest.fn().mockResolvedValue(undefined), + } as any); worker.use( rest.get( 'https://versions.backstage.io/v1/tags/main/manifest.json', @@ -763,7 +779,10 @@ describe('bump', () => { }, }); - jest.spyOn(runObj, 'run').mockResolvedValue(undefined); + jest.spyOn(runObj, 'run').mockReturnValue({ + exitCode: null, + waitForExit: jest.fn().mockResolvedValue(undefined), + } as any); worker.use( rest.get( 'https://versions.backstage.io/v1/tags/main/manifest.json', @@ -813,8 +832,7 @@ describe('bump', () => { expect(runObj.run).toHaveBeenCalledTimes(1); expect(runObj.run).toHaveBeenCalledWith( - 'yarn', - ['install'], + ['yarn', 'install'], expect.any(Object), ); @@ -873,7 +891,10 @@ describe('bump', () => { }); mockFetchPackageInfo.mockRejectedValue(new NotFoundError('Nope')); - jest.spyOn(runObj, 'run').mockResolvedValue(undefined); + jest.spyOn(runObj, 'run').mockReturnValue({ + exitCode: null, + waitForExit: jest.fn().mockResolvedValue(undefined), + } as any); worker.use( rest.get( 'https://versions.backstage.io/v1/tags/main/manifest.json', @@ -1094,7 +1115,10 @@ describe('environment variables', () => { }, }); - jest.spyOn(runObj, 'run').mockResolvedValue(undefined); + jest.spyOn(runObj, 'run').mockReturnValue({ + exitCode: null, + waitForExit: jest.fn().mockResolvedValue(undefined), + } as any); worker.use( rest.get( 'https://custom.example.com/v1/tags/main/manifest.json', @@ -1131,8 +1155,7 @@ describe('environment variables', () => { expect(runObj.run).toHaveBeenCalledTimes(1); expect(runObj.run).toHaveBeenCalledWith( - 'yarn', - ['install'], + ['yarn', 'install'], expect.any(Object), ); @@ -1186,7 +1209,10 @@ describe('environment variables', () => { }, }); - jest.spyOn(runObj, 'run').mockResolvedValue(undefined); + jest.spyOn(runObj, 'run').mockReturnValue({ + exitCode: null, + waitForExit: jest.fn().mockResolvedValue(undefined), + } as any); const { log: logs } = await withLogCollector(['log', 'warn'], async () => { await bump({ pattern: null, release: 'main' } as unknown as Command); @@ -1215,8 +1241,7 @@ describe('environment variables', () => { expect(runObj.run).toHaveBeenCalledTimes(1); expect(runObj.run).toHaveBeenCalledWith( - 'yarn', - ['install'], + ['yarn', 'install'], expect.any(Object), ); @@ -1253,7 +1278,10 @@ describe('environment variables', () => { }, }); - jest.spyOn(runObj, 'run').mockResolvedValue(undefined); + jest.spyOn(runObj, 'run').mockReturnValue({ + exitCode: null, + waitForExit: jest.fn().mockResolvedValue(undefined), + } as any); worker.use( rest.get( 'https://custom.example.com/v1/tags/main/manifest.json', @@ -1291,14 +1319,14 @@ describe('environment variables', () => { ]); expect(runObj.run).toHaveBeenCalledTimes(2); - expect(runObj.run).toHaveBeenCalledWith('yarn', [ + expect(runObj.run).toHaveBeenCalledWith([ + 'yarn', 'plugin', 'import', 'https://custom.example.com/v1/releases/1.5.0/yarn-plugin', ]); expect(runObj.run).toHaveBeenCalledWith( - 'yarn', - ['install'], + ['yarn', 'install'], expect.any(Object), ); }); diff --git a/packages/cli/src/modules/migrate/commands/versions/bump.ts b/packages/cli/src/modules/migrate/commands/versions/bump.ts index 19dcaae28f..cad477188b 100644 --- a/packages/cli/src/modules/migrate/commands/versions/bump.ts +++ b/packages/cli/src/modules/migrate/commands/versions/bump.ts @@ -41,7 +41,7 @@ import { } from '@backstage/release-manifests'; import { migrateMovedPackages } from './migrate'; import { runYarnInstall } from '../../lib/utils'; -import { run } from '../../../../lib/run'; +import { run } from '@backstage/cli-common'; const DEP_TYPES = [ 'dependencies', @@ -135,7 +135,7 @@ export default async (opts: OptionValues) => { ? `${env.BACKSTAGE_VERSIONS_BASE_URL}/v1/releases/${releaseManifest.releaseVersion}/yarn-plugin` : `https://versions.backstage.io/v1/releases/${releaseManifest.releaseVersion}/yarn-plugin`; - await run('yarn', ['plugin', 'import', yarnPluginUrl]); + await run(['yarn', 'plugin', 'import', yarnPluginUrl]).waitForExit(); console.log(); } diff --git a/packages/cli/src/modules/migrate/commands/versions/migrate.test.ts b/packages/cli/src/modules/migrate/commands/versions/migrate.test.ts index 9ff00fd285..936d10e24c 100644 --- a/packages/cli/src/modules/migrate/commands/versions/migrate.test.ts +++ b/packages/cli/src/modules/migrate/commands/versions/migrate.test.ts @@ -17,7 +17,7 @@ import { MockDirectory, createMockDirectory, } from '@backstage/backend-test-utils'; -import * as run from '../../../../lib/run'; +import * as runObj from '@backstage/cli-common'; import migrate from './migrate'; import { withLogCollector } from '@backstage/test-utils'; import fs from 'fs-extra'; @@ -33,21 +33,22 @@ jest.mock('chalk', () => ({ })); let mockDir: MockDirectory; -jest.mock('@backstage/cli-common', () => ({ - ...jest.requireActual('@backstage/cli-common'), - findPaths: () => ({ - resolveTargetRoot(filename: string) { - return mockDir.resolve(filename); - }, - get targetDir() { - return mockDir.path; - }, - }), -})); - -jest.mock('../../../../lib/run', () => { +jest.mock('@backstage/cli-common', () => { + const actual = jest.requireActual('@backstage/cli-common'); return { - run: jest.fn(), + ...actual, + findPaths: () => ({ + resolveTargetRoot(filename: string) { + return mockDir.resolve(filename); + }, + get targetDir() { + return mockDir.path; + }, + }), + run: jest.fn().mockReturnValue({ + exitCode: null, + waitForExit: jest.fn().mockResolvedValue(undefined), + }), }; }); @@ -58,8 +59,15 @@ function expectLogsToMatch(receivedLogs: String[], expected: String[]): void { describe('versions:migrate', () => { mockDir = createMockDirectory(); + beforeEach(() => { + (runObj.run as jest.Mock).mockReturnValue({ + exitCode: null, + waitForExit: jest.fn().mockResolvedValue(undefined), + }); + }); + afterEach(() => { - jest.resetAllMocks(); + (runObj.run as jest.Mock).mockClear(); }); it('should bump to the moved version when the package is moved', async () => { @@ -116,8 +124,6 @@ describe('versions:migrate', () => { }, }); - jest.spyOn(run, 'run').mockResolvedValue(undefined); - const { warn, log: logs } = await withLogCollector(async () => { await migrate({}); }); @@ -136,10 +142,9 @@ describe('versions:migrate', () => { 'Could not find package.json for @backstage/theme@^1.0.0 in b (dependencies)', ]); - expect(run.run).toHaveBeenCalledTimes(1); - expect(run.run).toHaveBeenCalledWith( - 'yarn', - ['install'], + expect(runObj.run).toHaveBeenCalledTimes(1); + expect(runObj.run).toHaveBeenCalledWith( + ['yarn', 'install'], expect.any(Object), ); @@ -227,16 +232,13 @@ describe('versions:migrate', () => { }, }); - jest.spyOn(run, 'run').mockResolvedValue(undefined); - await withLogCollector(async () => { await migrate({}); }); - expect(run.run).toHaveBeenCalledTimes(1); - expect(run.run).toHaveBeenCalledWith( - 'yarn', - ['install'], + expect(runObj.run).toHaveBeenCalledTimes(1); + expect(runObj.run).toHaveBeenCalledWith( + ['yarn', 'install'], expect.any(Object), ); @@ -259,7 +261,7 @@ describe('versions:migrate', () => { ); }); - it('should replaces the occurrences of changed packages, and is careful', async () => { + it('should replace occurrences of changed packages, and is careful', async () => { mockDir.setContent({ 'package.json': JSON.stringify({ workspaces: { @@ -314,16 +316,13 @@ describe('versions:migrate', () => { }, }); - jest.spyOn(run, 'run').mockResolvedValue(undefined); - await withLogCollector(async () => { await migrate({}); }); - expect(run.run).toHaveBeenCalledTimes(1); - expect(run.run).toHaveBeenCalledWith( - 'yarn', - ['install'], + expect(runObj.run).toHaveBeenCalledTimes(1); + expect(runObj.run).toHaveBeenCalledWith( + ['yarn', 'install'], expect.any(Object), ); diff --git a/packages/cli/src/modules/migrate/lib/utils.ts b/packages/cli/src/modules/migrate/lib/utils.ts index 5b7b544c87..c85f56dabb 100644 --- a/packages/cli/src/modules/migrate/lib/utils.ts +++ b/packages/cli/src/modules/migrate/lib/utils.ts @@ -16,7 +16,7 @@ import ora from 'ora'; import chalk from 'chalk'; -import { run } from '../../../lib/run'; +import { run } from '@backstage/cli-common'; export async function runYarnInstall() { const spinner = ora({ @@ -27,7 +27,7 @@ export async function runYarnInstall() { const installOutput = new Array(); try { - await run('yarn', ['install'], { + await run(['yarn', 'install'], { env: { FORCE_COLOR: 'true', // We filter out all of the npm_* environment variables that are added when @@ -39,9 +39,9 @@ export async function runYarnInstall() { ), ), }, - stdoutLogFunc: data => installOutput.push(data), - stderrLogFunc: data => installOutput.push(data), - }); + onStdout: data => installOutput.push(data), + onStderr: data => installOutput.push(data), + }).waitForExit(); spinner.succeed(); } catch (error) { spinner.fail(); diff --git a/packages/cli/src/modules/new/lib/execution/executePortableTemplate.ts b/packages/cli/src/modules/new/lib/execution/executePortableTemplate.ts index 6d34e35e4c..8e31f740cd 100644 --- a/packages/cli/src/modules/new/lib/execution/executePortableTemplate.ts +++ b/packages/cli/src/modules/new/lib/execution/executePortableTemplate.ts @@ -24,6 +24,7 @@ import { } from '../types'; import { installNewPackage } from './installNewPackage'; import { writeTemplateContents } from './writeTemplateContents'; +import { run } from '@backstage/cli-common'; type ExecuteNewTemplateOptions = { config: PortableTemplateConfig; @@ -54,14 +55,25 @@ export async function executePortableTemplate( } if (!options.skipInstall) { - await Task.forCommand('yarn install', { - cwd: targetDir, - optional: true, - }); - await Task.forCommand('yarn lint --fix', { - cwd: targetDir, - optional: true, - }); + for (const command of [ + ['yarn', 'install'], + ['yarn', 'lint', '--fix'], + ]) { + const commandStr = command.join(' '); + try { + await Task.forItem('executing', commandStr, async () => { + await run(command, { + cwd: targetDir, + stdio: 'ignore', + }).waitForExit(); + }); + } catch (error) { + assertError(error); + Task.error( + `Warning: Failed to execute command '${commandStr}', ${error}`, + ); + } + } } Task.log(); diff --git a/packages/cli/src/modules/new/lib/tasks.ts b/packages/cli/src/modules/new/lib/tasks.ts index 2922f34f35..f3620d242f 100644 --- a/packages/cli/src/modules/new/lib/tasks.ts +++ b/packages/cli/src/modules/new/lib/tasks.ts @@ -16,11 +16,6 @@ import chalk from 'chalk'; import ora from 'ora'; -import { promisify } from 'util'; -import { exec as execCb } from 'child_process'; -import { assertError } from '@backstage/errors'; - -const exec = promisify(execCb); const TASK_NAME_MAX_LENGTH = 14; @@ -64,30 +59,4 @@ export class Task { throw error; } } - - static async forCommand( - command: string, - options?: { cwd?: string; optional?: boolean }, - ) { - try { - await Task.forItem('executing', command, async () => { - await exec(command, { cwd: options?.cwd }); - }); - } catch (error) { - assertError(error); - if (error.stderr) { - process.stderr.write(error.stderr as Buffer); - } - if (error.stdout) { - process.stdout.write(error.stdout as Buffer); - } - if (options?.optional) { - Task.error(`Warning: Failed to execute command ${chalk.cyan(command)}`); - } else { - throw new Error( - `Failed to execute command '${chalk.cyan(command)}', ${error}`, - ); - } - } - } } diff --git a/packages/cli/src/modules/test/commands/package/test.ts b/packages/cli/src/modules/test/commands/package/test.ts index e7ef0af302..72e78eae7b 100644 --- a/packages/cli/src/modules/test/commands/package/test.ts +++ b/packages/cli/src/modules/test/commands/package/test.ts @@ -16,7 +16,7 @@ import { Command, OptionValues } from 'commander'; import { paths } from '../../../../lib/paths'; -import { runCheck } from '../../../../lib/run'; +import { runCheck } from '@backstage/cli-common'; function includesAnyOf(hayStack: string[], ...needles: string[]) { for (const needle of needles) { @@ -55,8 +55,8 @@ export default async (_opts: OptionValues, cmd: Command) => { !includesAnyOf(args, '--watch', '--watchAll') ) { const isGitRepo = () => - runCheck('git', 'rev-parse', '--is-inside-work-tree'); - const isMercurialRepo = () => runCheck('hg', '--cwd', '.', 'root'); + runCheck(['git', 'rev-parse', '--is-inside-work-tree']); + const isMercurialRepo = () => runCheck(['hg', '--cwd', '.', 'root']); if ((await isGitRepo()) || (await isMercurialRepo())) { args.push('--watch'); @@ -78,6 +78,14 @@ export default async (_opts: OptionValues, cmd: Command) => { process.env.TZ = 'UTC'; } + // Unless the user explicitly toggles node-snapshot, default to provide --no-node-snapshot to reduce number of steps to run scaffolder + // on Node LTS. + if (!process.env.NODE_OPTIONS?.includes('--node-snapshot')) { + process.env.NODE_OPTIONS = `${ + process.env.NODE_OPTIONS ? `${process.env.NODE_OPTIONS} ` : '' + }--no-node-snapshot`; + } + // This ensures that the process doesn't exit too early before stdout is flushed if (args.includes('--help')) { (process.stdout as any)._handle.setBlocking(true); diff --git a/packages/cli/src/modules/test/commands/repo/test.ts b/packages/cli/src/modules/test/commands/repo/test.ts index f0520d29e2..40e6666dcf 100644 --- a/packages/cli/src/modules/test/commands/repo/test.ts +++ b/packages/cli/src/modules/test/commands/repo/test.ts @@ -22,7 +22,7 @@ import { relative as relativePath } from 'path'; import { Command, OptionValues } from 'commander'; import { Lockfile, PackageGraph } from '@backstage/cli-node'; import { paths } from '../../../../lib/paths'; -import { runCheck, runPlain } from '../../../../lib/run'; +import { runCheck, runOutput } from '@backstage/cli-common'; import { isChildPath } from '@backstage/cli-common'; import { SuccessCache } from '../../../../lib/cache/SuccessCache'; @@ -63,14 +63,14 @@ async function readPackageTreeHashes(graph: PackageGraph) { ...pkg, path: relativePath(paths.targetRoot, pkg.dir), })); - const output = await runPlain( + const output = await runOutput([ 'git', 'ls-tree', - '--format="%(objectname)=%(path)"', + '--format=%(objectname)=%(path)', 'HEAD', '--', ...pkgs.map(pkg => pkg.path), - ); + ]); const map = new Map( output @@ -175,8 +175,8 @@ export async function command(opts: OptionValues, cmd: Command): Promise { !hasFlags('--coverage', '--watch', '--watchAll') ) { const isGitRepo = () => - runCheck('git', 'rev-parse', '--is-inside-work-tree'); - const isMercurialRepo = () => runCheck('hg', '--cwd', '.', 'root'); + runCheck(['git', 'rev-parse', '--is-inside-work-tree']); + const isMercurialRepo = () => runCheck(['hg', '--cwd', '.', 'root']); if ((await isGitRepo()) || (await isMercurialRepo())) { isSingleWatchMode = true; @@ -289,6 +289,14 @@ export async function command(opts: OptionValues, cmd: Command): Promise { process.env.TZ = 'UTC'; } + // Unless the user explicitly toggles node-snapshot, default to provide --no-node-snapshot to reduce number of steps to run scaffolder + // on Node LTS. + if (!process.env.NODE_OPTIONS?.includes('--node-snapshot')) { + process.env.NODE_OPTIONS = `${ + process.env.NODE_OPTIONS ? `${process.env.NODE_OPTIONS} ` : '' + }--no-node-snapshot`; + } + // This ensures that the process doesn't exit too early before stdout is flushed if (args.includes('--jest-help')) { removeOptionArg(args, '--jest-help'); diff --git a/packages/cli/src/tests/transforms/transforms.test.ts b/packages/cli/src/tests/transforms/transforms.test.ts index 7fb76bd741..0f51242206 100644 --- a/packages/cli/src/tests/transforms/transforms.test.ts +++ b/packages/cli/src/tests/transforms/transforms.test.ts @@ -36,18 +36,18 @@ const exportValues = { }; const expectedExports = { - commonJs: { + commonJs: expect.objectContaining({ ...exportValues.commonJs, dyn: exportValues.all, default: { ...exportValues.commonJs, dyn: exportValues.all, }, - }, - module: { + }), + module: expect.objectContaining({ ...exportValues.all, dyn: exportValues.all, - }, + }), }; function loadFixture(fixture: string) { diff --git a/packages/cli/templates/frontend-plugin/package.json.hbs b/packages/cli/templates/frontend-plugin/package.json.hbs index 1ee8231228..9499d11b18 100644 --- a/packages/cli/templates/frontend-plugin/package.json.hbs +++ b/packages/cli/templates/frontend-plugin/package.json.hbs @@ -31,7 +31,9 @@ "react-use": "{{versionQuery 'react-use' '17.2.4'}}" }, "peerDependencies": { - "react": "{{versionQuery 'react' '^16.13.1 || ^17.0.0 || ^18.0.0'}}" + "react": "{{versionQuery 'react' '^16.13.1 || ^17.0.0 || ^18.0.0'}}", + "react-dom": "{{versionQuery 'react-dom' '^16.13.1 || ^17.0.0 || ^18.0.0'}}", + "react-router-dom": "{{versionQuery 'react-router-dom' '^6.0.0'}}" }, "devDependencies": { "@backstage/cli": "{{versionQuery '@backstage/cli'}}", @@ -42,7 +44,9 @@ "@testing-library/react": "{{versionQuery '@testing-library/react' '14.0.0'}}", "@testing-library/user-event": "{{versionQuery '@testing-library/user-event' '14.0.0'}}", "msw": "{{versionQuery 'msw' '1.0.0'}}", - "react": "{{versionQuery 'react' '^16.13.1 || ^17.0.0 || ^18.0.0'}}" + "react": "{{versionQuery 'react' '^16.13.1 || ^17.0.0 || ^18.0.0'}}", + "react-dom": "{{versionQuery 'react-dom' '^16.13.1 || ^17.0.0 || ^18.0.0'}}", + "react-router-dom": "{{versionQuery 'react-router-dom' '^6.0.0'}}" }, "files": [ "dist" diff --git a/packages/codemods/CHANGELOG.md b/packages/codemods/CHANGELOG.md index 2a880f0520..3f85216f69 100644 --- a/packages/codemods/CHANGELOG.md +++ b/packages/codemods/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/codemods +## 0.1.53-next.2 + +### Patch Changes + +- 2bae83a: Bumped dev dependencies `@types/node` +- Updated dependencies + - @backstage/cli-common@0.1.16-next.2 + +## 0.1.53-next.1 + +### Patch Changes + +- 688f070: Updated to use new utilities from `@backstage/cli-common`. +- Updated dependencies + - @backstage/cli-common@0.1.16-next.1 + ## 0.1.53-next.0 ### Patch Changes diff --git a/packages/codemods/package.json b/packages/codemods/package.json index 534124c1bf..1a84ba417a 100644 --- a/packages/codemods/package.json +++ b/packages/codemods/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/codemods", - "version": "0.1.53-next.0", + "version": "0.1.53-next.2", "description": "A collection of codemods for Backstage projects", "backstage": { "role": "cli" @@ -52,6 +52,6 @@ "devDependencies": { "@backstage/cli": "workspace:^", "@types/jscodeshift": "^0.12.0", - "@types/node": "^20.16.0" + "@types/node": "^22.13.14" } } diff --git a/packages/codemods/src/action.ts b/packages/codemods/src/action.ts index b955ab17ea..467dd35f82 100644 --- a/packages/codemods/src/action.ts +++ b/packages/codemods/src/action.ts @@ -15,11 +15,9 @@ */ import { relative as relativePath } from 'path'; -import { spawn } from 'child_process'; import { OptionValues } from 'commander'; -import { findPaths } from '@backstage/cli-common'; +import { findPaths, run } from '@backstage/cli-common'; import { platform } from 'os'; -import { ExitCodeError } from './errors'; // eslint-disable-next-line no-restricted-syntax const paths = findPaths(__dirname); @@ -51,42 +49,25 @@ export function createCodemodAction(name: string) { console.log(`Running jscodeshift with these arguments: ${args.join(' ')}`); - let command; + let commandArgs: string[]; if (platform() === 'win32') { - command = 'jscodeshift'; + commandArgs = ['jscodeshift', ...args]; } else { // jscodeshift ships a slightly broken bin script with windows // line endings so we need to execute it using node rather than // letting the `#!/usr/bin/env node` take care of it - command = process.argv0; - args.unshift(require.resolve('.bin/jscodeshift')); + commandArgs = [ + process.argv0, + require.resolve('.bin/jscodeshift'), + ...args, + ]; } - const child = spawn(command, args, { - stdio: 'inherit', - shell: true, + await run(commandArgs, { env: { ...process.env, FORCE_COLOR: 'true', }, - }); - - if (typeof child.exitCode === 'number') { - if (child.exitCode) { - throw new ExitCodeError(child.exitCode, name); - } - return; - } - - await new Promise((resolve, reject) => { - child.once('error', error => reject(error)); - child.once('exit', code => { - if (code) { - reject(new ExitCodeError(code, name)); - } else { - resolve(); - } - }); - }); + }).waitForExit(); }; } diff --git a/packages/codemods/src/errors.ts b/packages/codemods/src/errors.ts index 2f67b94ae1..e27f66895c 100644 --- a/packages/codemods/src/errors.ts +++ b/packages/codemods/src/errors.ts @@ -15,6 +15,7 @@ */ import chalk from 'chalk'; +import { ExitCodeError } from '@backstage/cli-common'; export class CustomError extends Error { get name(): string { @@ -22,19 +23,6 @@ export class CustomError extends Error { } } -export class ExitCodeError extends CustomError { - readonly code: number; - - constructor(code: number, command?: string) { - if (command) { - super(`Command '${command}' exited with code ${code}`); - } else { - super(`Child exited with code ${code}`); - } - this.code = code; - } -} - export function exitWithError(error: Error): never { if (error instanceof ExitCodeError) { process.stderr.write(`\n${chalk.red(error.message)}\n\n`); diff --git a/packages/config-loader/CHANGELOG.md b/packages/config-loader/CHANGELOG.md index 00980c43bd..7055741def 100644 --- a/packages/config-loader/CHANGELOG.md +++ b/packages/config-loader/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/config-loader +## 1.10.7-next.1 + +### Patch Changes + +- 741c47a: Updated dependency `typescript-json-schema` to `^0.67.0`. +- Updated dependencies + - @backstage/cli-common@0.1.16-next.2 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + ## 1.10.7-next.0 ### Patch Changes diff --git a/packages/config-loader/package.json b/packages/config-loader/package.json index 69ac2fed6f..bedbbff518 100644 --- a/packages/config-loader/package.json +++ b/packages/config-loader/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/config-loader", - "version": "1.10.7-next.0", + "version": "1.10.7-next.1", "description": "Config loading functionality used by Backstage backend, and CLI", "backstage": { "role": "node-library" @@ -49,7 +49,7 @@ "json-schema-traverse": "^1.0.0", "lodash": "^4.17.21", "minimist": "^1.2.5", - "typescript-json-schema": "^0.65.0", + "typescript-json-schema": "^0.67.0", "yaml": "^2.0.0" }, "devDependencies": { diff --git a/packages/core-app-api/CHANGELOG.md b/packages/core-app-api/CHANGELOG.md index cc78499c94..19720d0c7e 100644 --- a/packages/core-app-api/CHANGELOG.md +++ b/packages/core-app-api/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/core-app-api +## 1.19.3-next.1 + +### Patch Changes + +- 75683ed: Added replay functionality to `AlertApiForwarder` to buffer and replay recent alerts to new subscribers, preventing missed alerts that were posted before subscription. +- Updated dependencies + - @backstage/config@1.3.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/types@1.2.2 + - @backstage/version-bridge@1.0.11 + ## 1.19.3-next.0 ### Patch Changes diff --git a/packages/core-app-api/package.json b/packages/core-app-api/package.json index d0c2d2b512..70670fa27d 100644 --- a/packages/core-app-api/package.json +++ b/packages/core-app-api/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/core-app-api", - "version": "1.19.3-next.0", + "version": "1.19.3-next.1", "description": "Core app API used by Backstage apps", "backstage": { "role": "web-library" diff --git a/packages/core-app-api/report.api.md b/packages/core-app-api/report.api.md index 0cecc22f4a..e039394946 100644 --- a/packages/core-app-api/report.api.md +++ b/packages/core-app-api/report.api.md @@ -20,6 +20,7 @@ import { AuthProviderInfo } from '@backstage/core-plugin-api'; import { AuthRequestOptions } from '@backstage/core-plugin-api'; import { BackstageIdentityApi } from '@backstage/core-plugin-api'; import { BackstageIdentityResponse } from '@backstage/core-plugin-api'; +import { BackstageIdentityResponse as BackstageIdentityResponse_2 } from '@backstage/frontend-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; import { bitbucketAuthApiRef } from '@backstage/core-plugin-api'; import { bitbucketServerAuthApiRef } from '@backstage/core-plugin-api'; @@ -55,6 +56,7 @@ import { OpenIdConnectApi } from '@backstage/core-plugin-api'; import { openshiftAuthApiRef } from '@backstage/core-plugin-api'; import { PendingOAuthRequest } from '@backstage/core-plugin-api'; import { ProfileInfo } from '@backstage/core-plugin-api'; +import { ProfileInfo as ProfileInfo_2 } from '@backstage/frontend-plugin-api'; import { ProfileInfoApi } from '@backstage/core-plugin-api'; import { PropsWithChildren } from 'react'; import PropTypes from 'prop-types'; @@ -62,6 +64,7 @@ import { ReactNode } from 'react'; import { RouteRef } from '@backstage/core-plugin-api'; import { SessionApi } from '@backstage/core-plugin-api'; import { SessionState } from '@backstage/core-plugin-api'; +import { SessionState as SessionState_2 } from '@backstage/frontend-plugin-api'; import { StorageApi } from '@backstage/core-plugin-api'; import { StorageValueSnapshot } from '@backstage/core-plugin-api'; import { SubRouteRef } from '@backstage/core-plugin-api'; @@ -511,13 +514,13 @@ export class MicrosoftAuth { // (undocumented) getBackstageIdentity( options?: AuthRequestOptions, - ): Promise; + ): Promise; // (undocumented) getIdToken(options?: AuthRequestOptions): Promise; // (undocumented) - getProfile(options?: AuthRequestOptions): Promise; + getProfile(options?: AuthRequestOptions): Promise; // (undocumented) - sessionState$(): Observable; + sessionState$(): Observable; // (undocumented) signIn(): Promise; // (undocumented) diff --git a/packages/core-app-api/src/apis/implementations/AlertApi/AlertApiForwarder.ts b/packages/core-app-api/src/apis/implementations/AlertApi/AlertApiForwarder.ts index 4e5397f65d..138d00c09c 100644 --- a/packages/core-app-api/src/apis/implementations/AlertApi/AlertApiForwarder.ts +++ b/packages/core-app-api/src/apis/implementations/AlertApi/AlertApiForwarder.ts @@ -17,20 +17,35 @@ import { AlertApi, AlertMessage } from '@backstage/core-plugin-api'; import { Observable } from '@backstage/types'; import { PublishSubject } from '../../../lib/subjects'; +import ObservableImpl from 'zen-observable'; /** * Base implementation for the AlertApi that simply forwards alerts to consumers. * + * Recent alerts are buffered and replayed to new subscribers to prevent + * missing alerts that were posted before subscription. + * * @public */ export class AlertApiForwarder implements AlertApi { private readonly subject = new PublishSubject(); + private readonly recentAlerts: AlertMessage[] = []; + private readonly maxBufferSize = 10; post(alert: AlertMessage) { + this.recentAlerts.push(alert); + if (this.recentAlerts.length > this.maxBufferSize) { + this.recentAlerts.shift(); + } this.subject.next(alert); } alert$(): Observable { - return this.subject; + return new ObservableImpl(subscriber => { + for (const alert of this.recentAlerts) { + subscriber.next(alert); + } + return this.subject.subscribe(subscriber); + }); } } diff --git a/packages/core-components/CHANGELOG.md b/packages/core-components/CHANGELOG.md index 8014cee0a4..b5f5ae226f 100644 --- a/packages/core-components/CHANGELOG.md +++ b/packages/core-components/CHANGELOG.md @@ -1,5 +1,33 @@ # @backstage/core-components +## 0.18.4-next.2 + +### Patch Changes + +- 4c00303: Add `tooltipClasses` prop to `OverflowTooltip` component to allow customisation of the tooltip +- Updated dependencies + - @backstage/config@1.3.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/errors@1.2.7 + - @backstage/theme@0.7.1-next.0 + - @backstage/version-bridge@1.0.11 + +## 0.18.4-next.1 + +### Patch Changes + +- 9a942a4: Fixed bug in the `LogViewer` component where shift + click always opened a new window instead of just changing the selection. + + In addition, improved the `LogViewer` component by a few usability enhancements: + + - Added support for multiple selections using cmd/ctrl + click + - Improved the generated hash that is added to the URL to also support ranges & multiple selections + - Added an hover effect & info tooltip to the "Copy to clipboard" button to indicate its functionality + - Added some color and a separator to the line numbers to improve readability + +- 207c3c8: long words like urls now breaks to new line on warning panels instead of overflowing the container +- 5d52dab: Add i18n support for LogViewer search control + ## 0.18.4-next.0 ### Patch Changes diff --git a/packages/core-components/package.json b/packages/core-components/package.json index 18d41eefb5..da266d1b66 100644 --- a/packages/core-components/package.json +++ b/packages/core-components/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/core-components", - "version": "0.18.4-next.0", + "version": "0.18.4-next.2", "description": "Core components used by Backstage plugins and apps", "backstage": { "role": "web-library" diff --git a/packages/core-components/report-alpha.api.md b/packages/core-components/report-alpha.api.md index 7608699487..785b97ce28 100644 --- a/packages/core-components/report-alpha.api.md +++ b/packages/core-components/report-alpha.api.md @@ -3,7 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { TranslationRef } from '@backstage/core-plugin-api/alpha'; +import { TranslationRef } from '@backstage/frontend-plugin-api'; // @alpha (undocumented) export const coreComponentsTranslationRef: TranslationRef< diff --git a/packages/core-components/report.api.md b/packages/core-components/report.api.md index 02fbb04805..5e842929e6 100644 --- a/packages/core-components/report.api.md +++ b/packages/core-components/report.api.md @@ -188,6 +188,7 @@ export interface CodeSnippetProps { showCopyCodeButton?: boolean; showLineNumbers?: boolean; text: string; + wrapLongLines?: boolean; } // Warning: (ae-forgotten-export) The symbol "Props_12" needs to be exported by the entry point index.d.ts diff --git a/packages/core-components/src/components/CodeSnippet/CodeSnippet.tsx b/packages/core-components/src/components/CodeSnippet/CodeSnippet.tsx index 8c31bc4e6d..e79dc07ad3 100644 --- a/packages/core-components/src/components/CodeSnippet/CodeSnippet.tsx +++ b/packages/core-components/src/components/CodeSnippet/CodeSnippet.tsx @@ -57,6 +57,14 @@ export interface CodeSnippetProps { * Array of line numbers to highlight */ highlightedNumbers?: number[]; + /** + * Whether to style the `` block with `white-space: pre-wrap` or `white-space: pre` + * + * @remarks + * + * Default: false (`white-space: pre`) + */ + wrapLongLines?: boolean; /** * Custom styles applied to code * @@ -79,6 +87,7 @@ export function CodeSnippet(props: CodeSnippetProps) { language, showLineNumbers = false, highlightedNumbers, + wrapLongLines, customStyle, showCopyCodeButton = false, } = props; @@ -94,6 +103,7 @@ export function CodeSnippet(props: CodeSnippetProps) { style={mode} showLineNumbers={showLineNumbers} wrapLines + wrapLongLines={wrapLongLines} lineNumberStyle={{ color: theme.palette.textVerySubtle }} lineProps={(lineNumber: number) => highlightedNumbers?.includes(lineNumber) diff --git a/packages/core-components/src/components/LogViewer/RealLogViewer.tsx b/packages/core-components/src/components/LogViewer/RealLogViewer.tsx index e384a8e882..1936061b1c 100644 --- a/packages/core-components/src/components/LogViewer/RealLogViewer.tsx +++ b/packages/core-components/src/components/LogViewer/RealLogViewer.tsx @@ -21,7 +21,7 @@ import classnames from 'classnames'; import { useEffect, useMemo, useRef, useState } from 'react'; import { useLocation } from 'react-router-dom'; import AutoSizer from 'react-virtualized-auto-sizer'; -import { VariableSizeList, FixedSizeList } from 'react-window'; +import { FixedSizeList, VariableSizeList } from 'react-window'; import { AnsiLine, AnsiProcessor } from './AnsiProcessor'; import { LogLine } from './LogLine'; @@ -29,6 +29,7 @@ import { LogViewerControls } from './LogViewerControls'; import { HEADER_SIZE, useStyles } from './styles'; import { useLogViewerSearch } from './useLogViewerSearch'; import { useLogViewerSelection } from './useLogViewerSelection'; +import Snackbar from '@material-ui/core/Snackbar'; export interface RealLogViewerProps { text: string; @@ -47,6 +48,7 @@ export function RealLogViewer(props: RealLogViewerProps) { // The processor keeps state that optimizes appending to the text const processor = useMemo(() => new AnsiProcessor(), []); const lines = processor.process(props.text); + const [showCopyInfo, setShowCopyInfo] = useState(false); const search = useLogViewerSearch(lines); const selection = useLogViewerSelection(lines); @@ -69,19 +71,39 @@ export function RealLogViewer(props: RealLogViewerProps) { } }, [listInstance, search.resultLine, lines]); + useEffect(() => { + const hash = selection.getHash(); + if (hash.length > 0) { + history.replaceState(null, '', hash); + } + }, [selection]); + useEffect(() => { if (location.hash) { - // #line-6 -> 6 - const line = parseInt(location.hash.replace(/\D/g, ''), 10); - selection.setSelection(line, false); + selection.selectAll(location.hash); } }, []); // eslint-disable-line react-hooks/exhaustive-deps const handleSelectLine = ( line: number, - event: { shiftKey: boolean; preventDefault: () => void }, + event: { + shiftKey: boolean; + metaKey: boolean; + ctrlKey: boolean; + preventDefault: () => void; + }, ) => { - selection.setSelection(line, event.shiftKey); + event.preventDefault(); + selection.setSelection( + line, + event.shiftKey, + event.metaKey || event.ctrlKey, + ); + }; + + const handleCopySelection = (line: number) => { + selection.copySelection(line); + setShowCopyInfo(true); }; function setRowHeight(index: number, size: number) { @@ -97,90 +119,99 @@ export function RealLogViewer(props: RealLogViewerProps) { } return ( - - {({ height, width }: { height?: number; width?: number }) => { - const commonProps = { - ref: setListInstance, - className: classes.log, - height: (height || 480) - HEADER_SIZE, - width: width || 640, - itemData: search.lines, - itemCount: search.lines.length, - }; + <> + + {({ height, width }: { height?: number; width?: number }) => { + const commonProps = { + ref: setListInstance, + className: classes.log, + height: (height || 480) - HEADER_SIZE, + width: width || 640, + itemData: search.lines, + itemCount: search.lines.length, + }; - const renderItem = ({ - index, - style, - data, - }: { - index: number; - style: React.CSSProperties; - data: AnsiLine[]; - }) => { - const line = data[index]; - const { lineNumber } = line; - return ( - - {selection.shouldShowButton(lineNumber) && ( - selection.copySelection()} - > - - - )} - handleSelectLine(lineNumber, event)} - onKeyPress={event => handleSelectLine(lineNumber, event)} + const renderItem = ({ + index, + style, + data, + }: { + index: number; + style: React.CSSProperties; + data: AnsiLine[]; + }) => { + const line = data[index]; + const { lineNumber } = line; + return ( + - {lineNumber} - - + {selection.shouldShowCopyButton(lineNumber) && ( + handleCopySelection(lineNumber)} + > + + + )} + handleSelectLine(lineNumber, event)} + onKeyPress={event => handleSelectLine(lineNumber, event)} + > + {lineNumber} + + + + ); + }; + + return ( + + + + + {shouldTextWrap ? ( + + {...commonProps} + itemSize={getRowHeight} + > + {renderItem} + + ) : ( + {...commonProps} itemSize={20}> + {renderItem} + + )} ); - }; - - return ( - - - - - {shouldTextWrap ? ( - - {...commonProps} - itemSize={getRowHeight} - > - {renderItem} - - ) : ( - {...commonProps} itemSize={20}> - {renderItem} - - )} - - ); - }} - + }} + + setShowCopyInfo(false)} + message="Lines copied to clipboard" + anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }} + /> + ); } diff --git a/packages/core-components/src/components/LogViewer/styles.ts b/packages/core-components/src/components/LogViewer/styles.ts index 238361f9a9..83fb3a84ad 100644 --- a/packages/core-components/src/components/LogViewer/styles.ts +++ b/packages/core-components/src/components/LogViewer/styles.ts @@ -89,15 +89,20 @@ export const useStyles = makeStyles( position: 'absolute', paddingTop: 0, paddingBottom: 0, + '&:hover': { + color: theme.palette.linkHover, + }, }, lineNumber: { display: 'inline-block', textAlign: 'end', width: 60, + paddingRight: theme.spacing(1), marginRight: theme.spacing(1), cursor: 'pointer', flexShrink: 0, - userSelect: 'none', + color: colors.blue[300], + borderRight: `1px solid ${colors.blue[700]}`, }, textHighlight: { background: alpha(theme.palette.info.main, 0.15), diff --git a/packages/core-components/src/components/LogViewer/useLogViewerSelection.test.tsx b/packages/core-components/src/components/LogViewer/useLogViewerSelection.test.tsx index 5314f4e7f6..13280d38a4 100644 --- a/packages/core-components/src/components/LogViewer/useLogViewerSelection.test.tsx +++ b/packages/core-components/src/components/LogViewer/useLogViewerSelection.test.tsx @@ -16,7 +16,7 @@ import { PropsWithChildren } from 'react'; import { act, renderHook } from '@testing-library/react'; -import { TestApiProvider, MockErrorApi } from '@backstage/test-utils'; +import { MockErrorApi, TestApiProvider } from '@backstage/test-utils'; import { errorApiRef } from '@backstage/core-plugin-api'; import { AnsiLine } from './AnsiProcessor'; import { useLogViewerSelection } from './useLogViewerSelection'; @@ -35,10 +35,26 @@ const lines = [ new AnsiLine(3, [{ text: '3', modifiers: {} }]), new AnsiLine(4, [{ text: '4', modifiers: {} }]), new AnsiLine(5, [{ text: '5', modifiers: {} }]), + new AnsiLine(6, [{ text: '6', modifiers: {} }]), + new AnsiLine(7, [{ text: '7', modifiers: {} }]), ]; +const expectSelectedLines = (rendered: any, selectedLines: number[]) => { + expect(rendered.result.current.isSelected(1)).toBe(selectedLines.includes(1)); + expect(rendered.result.current.isSelected(2)).toBe(selectedLines.includes(2)); + expect(rendered.result.current.isSelected(3)).toBe(selectedLines.includes(3)); + expect(rendered.result.current.isSelected(4)).toBe(selectedLines.includes(4)); + expect(rendered.result.current.isSelected(5)).toBe(selectedLines.includes(5)); + expect(rendered.result.current.isSelected(6)).toBe(selectedLines.includes(6)); + expect(rendered.result.current.isSelected(7)).toBe(selectedLines.includes(7)); +}; + describe('useLogViewerSelection', () => { - it('should manage a selection', () => { + beforeEach(() => { + (copyToClipboard as jest.Mock).mockClear(); + }); + + it('should select a new line when clicked', () => { const rendered = renderHook(() => useLogViewerSelection(lines), { wrapper: ({ children }: PropsWithChildren<{}>) => ( @@ -47,77 +63,290 @@ describe('useLogViewerSelection', () => { ), }); - expect(rendered.result.current.isSelected(1)).toBe(false); - expect(rendered.result.current.isSelected(2)).toBe(false); - expect(rendered.result.current.isSelected(3)).toBe(false); + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(2, false, false)); + expectSelectedLines(rendered, [2]); + act(() => rendered.result.current.setSelection(5, false, false)); + expectSelectedLines(rendered, [5]); + act(() => rendered.result.current.setSelection(2, false, false)); + expectSelectedLines(rendered, [2]); + }); - expect(rendered.result.current.shouldShowButton(1)).toBe(false); - expect(rendered.result.current.shouldShowButton(2)).toBe(false); - expect(rendered.result.current.shouldShowButton(3)).toBe(false); + it('should deselect a selected line when clicked', () => { + const rendered = renderHook(() => useLogViewerSelection(lines), { + wrapper: ({ children }: PropsWithChildren<{}>) => ( + + {children} + + ), + }); - act(() => rendered.result.current.setSelection(2, false)); + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(2, false, false)); + expectSelectedLines(rendered, [2]); + act(() => rendered.result.current.setSelection(2, false, false)); + expectSelectedLines(rendered, []); + }); - expect(rendered.result.current.isSelected(1)).toBe(false); - expect(rendered.result.current.isSelected(2)).toBe(true); - expect(rendered.result.current.isSelected(3)).toBe(false); + it('should select a new line on shift+click if nothing is selected', () => { + const rendered = renderHook(() => useLogViewerSelection(lines), { + wrapper: ({ children }: PropsWithChildren<{}>) => ( + + {children} + + ), + }); - expect(rendered.result.current.shouldShowButton(1)).toBe(false); - expect(rendered.result.current.shouldShowButton(2)).toBe(true); - expect(rendered.result.current.shouldShowButton(3)).toBe(false); + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(2, true, false)); + expectSelectedLines(rendered, [2]); + }); - act(() => rendered.result.current.setSelection(3, false)); + it('should deselect a single line on shift+click', () => { + const rendered = renderHook(() => useLogViewerSelection(lines), { + wrapper: ({ children }: PropsWithChildren<{}>) => ( + + {children} + + ), + }); - expect(rendered.result.current.isSelected(1)).toBe(false); - expect(rendered.result.current.isSelected(2)).toBe(false); - expect(rendered.result.current.isSelected(3)).toBe(true); - expect(rendered.result.current.isSelected(4)).toBe(false); + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(2, true, false)); + expectSelectedLines(rendered, [2]); + act(() => rendered.result.current.setSelection(2, true, false)); + expectSelectedLines(rendered, []); + }); - expect(rendered.result.current.shouldShowButton(1)).toBe(false); - expect(rendered.result.current.shouldShowButton(2)).toBe(false); - expect(rendered.result.current.shouldShowButton(3)).toBe(true); - expect(rendered.result.current.shouldShowButton(4)).toBe(false); + it('should select a range below on shift+click', () => { + const rendered = renderHook(() => useLogViewerSelection(lines), { + wrapper: ({ children }: PropsWithChildren<{}>) => ( + + {children} + + ), + }); - act(() => rendered.result.current.setSelection(1, true)); + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(2, true, false)); + expectSelectedLines(rendered, [2]); + act(() => rendered.result.current.setSelection(5, true, false)); + expectSelectedLines(rendered, [2, 3, 4, 5]); + }); - expect(rendered.result.current.isSelected(1)).toBe(true); - expect(rendered.result.current.isSelected(2)).toBe(true); - expect(rendered.result.current.isSelected(3)).toBe(true); - expect(rendered.result.current.isSelected(4)).toBe(false); + it('should select a range above on shift+click', () => { + const rendered = renderHook(() => useLogViewerSelection(lines), { + wrapper: ({ children }: PropsWithChildren<{}>) => ( + + {children} + + ), + }); - expect(rendered.result.current.shouldShowButton(1)).toBe(true); - expect(rendered.result.current.shouldShowButton(2)).toBe(false); - expect(rendered.result.current.shouldShowButton(3)).toBe(true); - expect(rendered.result.current.shouldShowButton(4)).toBe(false); + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(5, true, false)); + expectSelectedLines(rendered, [5]); + act(() => rendered.result.current.setSelection(2, true, false)); + expectSelectedLines(rendered, [2, 3, 4, 5]); + }); - act(() => rendered.result.current.setSelection(4, true)); + it('should reduce a selection on shift+click', () => { + const rendered = renderHook(() => useLogViewerSelection(lines), { + wrapper: ({ children }: PropsWithChildren<{}>) => ( + + {children} + + ), + }); - expect(rendered.result.current.isSelected(1)).toBe(false); - expect(rendered.result.current.isSelected(2)).toBe(false); - expect(rendered.result.current.isSelected(3)).toBe(true); - expect(rendered.result.current.isSelected(4)).toBe(true); - expect(rendered.result.current.isSelected(5)).toBe(false); + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(2, true, false)); + expectSelectedLines(rendered, [2]); + act(() => rendered.result.current.setSelection(7, true, false)); + expectSelectedLines(rendered, [2, 3, 4, 5, 6, 7]); + act(() => rendered.result.current.setSelection(4, true, false)); + expectSelectedLines(rendered, [2, 3, 4]); + act(() => rendered.result.current.setSelection(2, true, false)); + expectSelectedLines(rendered, [2]); + }); - expect(rendered.result.current.shouldShowButton(1)).toBe(false); - expect(rendered.result.current.shouldShowButton(2)).toBe(false); - expect(rendered.result.current.shouldShowButton(3)).toBe(true); - expect(rendered.result.current.shouldShowButton(4)).toBe(true); - expect(rendered.result.current.shouldShowButton(5)).toBe(false); + it('should add a new selection on cmd/ctrl+click', () => { + const rendered = renderHook(() => useLogViewerSelection(lines), { + wrapper: ({ children }: PropsWithChildren<{}>) => ( + + {children} + + ), + }); + + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(2, false, true)); + expectSelectedLines(rendered, [2]); + act(() => rendered.result.current.setSelection(5, false, true)); + expectSelectedLines(rendered, [2, 5]); + }); + + it('should merge selections on cmd/ctrl+click', () => { + const rendered = renderHook(() => useLogViewerSelection(lines), { + wrapper: ({ children }: PropsWithChildren<{}>) => ( + + {children} + + ), + }); + + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(1, false, true)); + expectSelectedLines(rendered, [1]); + act(() => rendered.result.current.setSelection(3, true, false)); + expectSelectedLines(rendered, [1, 2, 3]); + act(() => rendered.result.current.setSelection(5, false, true)); + expectSelectedLines(rendered, [1, 2, 3, 5]); + act(() => rendered.result.current.setSelection(7, true, false)); + expectSelectedLines(rendered, [1, 2, 3, 5, 6, 7]); + act(() => rendered.result.current.setSelection(4, false, true)); + expectSelectedLines(rendered, [1, 2, 3, 4, 5, 6, 7]); + }); + + it('should split a selection on cmd/ctrl+click', () => { + const rendered = renderHook(() => useLogViewerSelection(lines), { + wrapper: ({ children }: PropsWithChildren<{}>) => ( + + {children} + + ), + }); + + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(1, false, true)); + expectSelectedLines(rendered, [1]); + act(() => rendered.result.current.setSelection(5, true, false)); + expectSelectedLines(rendered, [1, 2, 3, 4, 5]); + act(() => rendered.result.current.setSelection(3, false, true)); + expectSelectedLines(rendered, [1, 2, 4, 5]); + }); + + it('should copy a selected line', () => { + const rendered = renderHook(() => useLogViewerSelection(lines), { + wrapper: ({ children }: PropsWithChildren<{}>) => ( + + {children} + + ), + }); + + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(2, false, false)); + expectSelectedLines(rendered, [2]); expect(copyToClipboard).not.toHaveBeenCalled(); - act(() => rendered.result.current.copySelection()); - expect(copyToClipboard).toHaveBeenLastCalledWith('3\n4'); + act(() => rendered.result.current.copySelection(2)); + expect(copyToClipboard).toHaveBeenLastCalledWith('2'); + }); - act(() => rendered.result.current.setSelection(2, true)); - act(() => rendered.result.current.setSelection(4, true)); + it('should copy a selected range', () => { + const rendered = renderHook(() => useLogViewerSelection(lines), { + wrapper: ({ children }: PropsWithChildren<{}>) => ( + + {children} + + ), + }); + rendered.rerender(); - act(() => rendered.result.current.copySelection()); - expect(copyToClipboard).toHaveBeenCalledWith('2\n3\n4'); + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(2, false, false)); + expectSelectedLines(rendered, [2]); + act(() => rendered.result.current.setSelection(5, true, false)); + expectSelectedLines(rendered, [2, 3, 4, 5]); - act(() => rendered.result.current.setSelection(2, false)); - act(() => rendered.result.current.setSelection(4, false)); - act(() => rendered.result.current.setSelection(4, false)); - act(() => rendered.result.current.setSelection(5, true)); - act(() => rendered.result.current.copySelection()); - expect(copyToClipboard).toHaveBeenCalledWith('5'); + expect(copyToClipboard).not.toHaveBeenCalled(); + act(() => rendered.result.current.copySelection(2)); + expect(copyToClipboard).toHaveBeenCalledWith('2\n3\n4\n5'); + }); + + it('should copy the correct selection', () => { + const rendered = renderHook(() => useLogViewerSelection(lines), { + wrapper: ({ children }: PropsWithChildren<{}>) => ( + + {children} + + ), + }); + rendered.rerender(); + + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(2, false, false)); + expectSelectedLines(rendered, [2]); + act(() => rendered.result.current.setSelection(5, true, false)); + expectSelectedLines(rendered, [2, 3, 4, 5]); + + act(() => rendered.result.current.setSelection(7, false, true)); + expectSelectedLines(rendered, [2, 3, 4, 5, 7]); + + expect(copyToClipboard).not.toHaveBeenCalled(); + act(() => rendered.result.current.copySelection(2)); + expect(copyToClipboard).toHaveBeenCalledWith('2\n3\n4\n5'); + act(() => rendered.result.current.copySelection(7)); + expect(copyToClipboard).toHaveBeenCalledWith('7'); + }); + + it('should add a single line selection to the hash', () => { + const rendered = renderHook(() => useLogViewerSelection(lines), { + wrapper: ({ children }: PropsWithChildren<{}>) => ( + + {children} + + ), + }); + rendered.rerender(); + + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(2, false, false)); + expectSelectedLines(rendered, [2]); + + expect(rendered.result.current.getHash()).toBe('#lines-2'); + }); + + it('should add a range selection to the hash', () => { + const rendered = renderHook(() => useLogViewerSelection(lines), { + wrapper: ({ children }: PropsWithChildren<{}>) => ( + + {children} + + ), + }); + rendered.rerender(); + + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(2, false, false)); + expectSelectedLines(rendered, [2]); + act(() => rendered.result.current.setSelection(5, true, false)); + expectSelectedLines(rendered, [2, 3, 4, 5]); + + expect(rendered.result.current.getHash()).toBe('#lines-2-5'); + }); + + it('should add multiple selections to the hash', () => { + const rendered = renderHook(() => useLogViewerSelection(lines), { + wrapper: ({ children }: PropsWithChildren<{}>) => ( + + {children} + + ), + }); + rendered.rerender(); + + expectSelectedLines(rendered, []); + act(() => rendered.result.current.setSelection(3, false, false)); + expectSelectedLines(rendered, [3]); + act(() => rendered.result.current.setSelection(5, true, false)); + expectSelectedLines(rendered, [3, 4, 5]); + act(() => rendered.result.current.setSelection(1, false, true)); + expectSelectedLines(rendered, [1, 3, 4, 5]); + act(() => rendered.result.current.setSelection(7, false, true)); + expectSelectedLines(rendered, [1, 3, 4, 5, 7]); + + expect(rendered.result.current.getHash()).toBe('#lines-3-5,1,7'); }); }); diff --git a/packages/core-components/src/components/LogViewer/useLogViewerSelection.tsx b/packages/core-components/src/components/LogViewer/useLogViewerSelection.tsx index 97fee53c8a..d59a552777 100644 --- a/packages/core-components/src/components/LogViewer/useLogViewerSelection.tsx +++ b/packages/core-components/src/components/LogViewer/useLogViewerSelection.tsx @@ -19,11 +19,14 @@ import { useEffect, useState } from 'react'; import useCopyToClipboard from 'react-use/esm/useCopyToClipboard'; import { AnsiLine } from './AnsiProcessor'; +type Selection = { + start: number; + end: number; +}; + export function useLogViewerSelection(lines: AnsiLine[]) { const errorApi = useApi(errorApiRef); - const [sel, setSelection] = useState<{ start: number; end: number }>(); - const start = sel ? Math.min(sel.start, sel.end) : undefined; - const end = sel ? Math.max(sel.start, sel.end) : undefined; + const [selections, setSelections] = useState([]); const [{ error }, copyToClipboard] = useCopyToClipboard(); @@ -33,38 +36,202 @@ export function useLogViewerSelection(lines: AnsiLine[]) { } }, [error, errorApi]); + const findClosestSelection = ( + allSelections: Selection[], + line: number, + ): Selection | undefined => { + if (selections.length === 0) { + return undefined; + } + let minDistance = Number.MAX_SAFE_INTEGER; + let closestSelection: Selection | undefined = undefined; + + allSelections.forEach(s => { + const distance = Math.min( + Math.abs(s.start - line), + Math.abs(s.end - line), + ); + if (distance < minDistance) { + minDistance = distance; + closestSelection = s; + } + }); + + return closestSelection; + }; + + const mergeNeighbouringSelections = ( + allSelections: Selection[], + line: number, + ): Selection[] => { + // Merge selections if they're next to each other + const neighboringSelections = allSelections.filter( + s => s.start - 1 === line || s.end + 1 === line, + ); + if (neighboringSelections.length === 0) { + return allSelections; + } + const newSelection = { + start: Math.min(line, ...neighboringSelections.map(s => s.start)), + end: Math.max(line, ...neighboringSelections.map(s => s.end)), + }; + + return [ + ...allSelections.filter( + s => + !neighboringSelections.includes(s) && + !(s.start === line && s.end === line), + ), + newSelection, + ]; + }; + return { - shouldShowButton(line: number) { - return start === line || end === line; + shouldShowCopyButton(line: number) { + // show copy button at the beginning of each selection + return selections.some(s => s.start === line); }, isSelected(line: number) { - if (!sel) { + if (!selections) { return false; } - return start! <= line && line <= end!; + // check if line is in any selection range + return selections.some( + s => s.start <= line && (s.end ?? s.start) >= line, + ); }, - setSelection(line: number, add: boolean) { - if (add) { - setSelection(s => - s ? { start: s.start, end: line } : { start: line, end: line }, + setSelection(line: number, addRange: boolean, addNewSelection: boolean) { + setSelections(currentSelections => { + const clickedSelection = currentSelections.find( + s => s.start <= line && s.end >= line, ); - } else { - setSelection(s => - s?.start === line && s?.end === line - ? undefined - : { start: line, end: line }, + const otherSelections = currentSelections.filter( + s => s !== clickedSelection, ); - } + + if (!addRange && !addNewSelection) { + // Normal click -> select only this line if nothing or multiple lines are selected + if ( + !clickedSelection || + clickedSelection.start !== clickedSelection.end + ) { + return [{ start: line, end: line }]; + } + // Clear selection if single line is selected + return []; + } + + if (addRange) { + // Shift+click -> extend/reduce selection + if (currentSelections.length === 0) { + // No existing selection -> create new selection + return [{ start: line, end: line }]; + } + + if (clickedSelection) { + // Clicked inside an existing selection -> reduce selection + if (clickedSelection.start === clickedSelection.end) { + // Single line selection -> remove it + return otherSelections; + } + // Reduce selection + return [ + ...otherSelections, + { start: clickedSelection.start, end: line }, + ]; + } + + // Extend the closest selection to the new line + const closestSelection = findClosestSelection( + currentSelections, + line, + ); + if (!closestSelection) { + // Can't actually happen + return currentSelections; + } + if (closestSelection.start < line) { + // Add lines before the selection + return mergeNeighbouringSelections( + [ + ...otherSelections.filter(s => s !== closestSelection), + { start: closestSelection.start, end: line }, + ], + line, + ); + } + // Add lines after the selection + return mergeNeighbouringSelections( + [ + ...otherSelections.filter(s => s !== closestSelection), + { start: line, end: closestSelection!.end }, + ], + line, + ); + } + + if (addNewSelection) { + // Ctrl/Cmd+click -> add new selection + if (!clickedSelection) { + // Just add new selection + return mergeNeighbouringSelections( + [...currentSelections, { start: line, end: line }], + line, + ); + } + if (clickedSelection.start === clickedSelection.end) { + // Single line selection -> remove it + return otherSelections; + } + // Multi line selection -> split it + return [ + ...otherSelections, + ...(clickedSelection.start < line + ? [{ start: clickedSelection.start, end: line - 1 }] + : []), + ...(clickedSelection.end > line + ? [{ start: line + 1, end: clickedSelection.end }] + : []), + ]; + } + + return []; + }); }, - copySelection() { - if (sel) { - const copyText = lines - .slice(Math.min(sel.start, sel.end) - 1, Math.max(sel.start, sel.end)) - .map(l => l.chunks.map(c => c.text).join('')) - .join('\n'); - copyToClipboard(copyText); - setSelection(undefined); + copySelection(line: number) { + const selection = selections.find(s => s.start === line); + if (!selection) { + return; } + const copyText = lines + .slice(selection.start - 1, selection.end) + .map(l => l.chunks.map(c => c.text).join('')) + .join('\n'); + copyToClipboard(copyText); + }, + getHash() { + if (selections.length === 0) { + return ''; + } + const parts = selections.map(s => { + if (s.start === s.end) { + return `${s.start}`; + } + return `${s.start}-${s.end}`; + }); + return `#lines-${parts.join(',')}`; + }, + selectAll(hash: string) { + const match = hash.match(/#lines-([\d,-]+)/); + const s: Selection[] = []; + if (match) { + const ranges = match[1].split(','); + ranges.forEach(r => { + const [start, end] = r.split('-').map(Number); + s.push({ start, end: end ?? start }); + }); + } + setSelections(s); }, }; } diff --git a/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx b/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx index 68499e2dc1..7fc45d767d 100644 --- a/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx +++ b/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx @@ -23,6 +23,7 @@ type Props = { title?: TooltipProps['title']; line?: number | undefined; placement?: TooltipProps['placement']; + tooltipClasses?: TooltipProps['classes']; }; export type OverflowTooltipClassKey = 'container'; @@ -51,6 +52,7 @@ export function OverflowTooltip(props: Props) { {props.text} diff --git a/packages/core-components/src/components/WarningPanel/WarningPanel.tsx b/packages/core-components/src/components/WarningPanel/WarningPanel.tsx index 7d9c4d472d..2e05784fd6 100644 --- a/packages/core-components/src/components/WarningPanel/WarningPanel.tsx +++ b/packages/core-components/src/components/WarningPanel/WarningPanel.tsx @@ -96,6 +96,7 @@ const useStyles = makeStyles( fontWeight: theme.typography.fontWeightBold, }, markdownContent: { + wordBreak: 'break-word', '& p': { display: 'inline', }, diff --git a/packages/create-app/CHANGELOG.md b/packages/create-app/CHANGELOG.md index c921e2ad9b..e26b1347a3 100644 --- a/packages/create-app/CHANGELOG.md +++ b/packages/create-app/CHANGELOG.md @@ -1,5 +1,22 @@ # @backstage/create-app +## 0.7.7-next.2 + +### Patch Changes + +- 2bae83a: Updated engines to support Node 22 or 24 +- 2bae83a: Bumped dev dependencies `@types/node` +- Updated dependencies + - @backstage/cli-common@0.1.16-next.2 + +## 0.7.7-next.1 + +### Patch Changes + +- Bumped create-app version. +- Updated dependencies + - @backstage/cli-common@0.1.16-next.1 + ## 0.7.7-next.0 ### Patch Changes diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 2132f57b1d..029cec855a 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/create-app", - "version": "0.7.7-next.0", + "version": "0.7.7-next.2", "description": "A CLI that helps you create your own Backstage app", "backstage": { "role": "cli" @@ -58,7 +58,7 @@ "@types/command-exists": "^1.2.0", "@types/fs-extra": "^11.0.0", "@types/inquirer": "^8.1.3", - "@types/node": "^20.16.0", + "@types/node": "^22.13.14", "@types/recursive-readdir": "^2.2.0", "msw": "^2.0.0", "nodemon": "^3.0.1" diff --git a/packages/create-app/templates/default-app/package.json.hbs b/packages/create-app/templates/default-app/package.json.hbs index 8399c6505a..d0a088a7d1 100644 --- a/packages/create-app/templates/default-app/package.json.hbs +++ b/packages/create-app/templates/default-app/package.json.hbs @@ -3,7 +3,7 @@ "version": "1.0.0", "private": true, "engines": { - "node": "20 || 22" + "node": "22 || 24" }, "scripts": { "start": "backstage-cli repo start", diff --git a/packages/create-app/templates/next-app/package.json.hbs b/packages/create-app/templates/next-app/package.json.hbs index 33e76aba3b..55a591067b 100644 --- a/packages/create-app/templates/next-app/package.json.hbs +++ b/packages/create-app/templates/next-app/package.json.hbs @@ -3,7 +3,7 @@ "version": "1.0.0", "private": true, "engines": { - "node": "20 || 22" + "node": "22 || 24" }, "scripts": { "start": "backstage-cli repo start", diff --git a/packages/dev-utils/CHANGELOG.md b/packages/dev-utils/CHANGELOG.md index 90b69eb678..1b26653336 100644 --- a/packages/dev-utils/CHANGELOG.md +++ b/packages/dev-utils/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/dev-utils +## 1.1.18-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/ui@0.10.0-next.1 + - @backstage/core-components@0.18.4-next.1 + - @backstage/plugin-catalog-react@1.21.4-next.1 + ## 1.1.18-next.0 ### Patch Changes diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 85361d46a0..5b0c9bbee7 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/dev-utils", - "version": "1.1.18-next.0", + "version": "1.1.18-next.1", "description": "Utilities for developing Backstage plugins.", "backstage": { "role": "web-library" diff --git a/packages/e2e-test/package.json b/packages/e2e-test/package.json index 65fe932620..e70f2f8105 100644 --- a/packages/e2e-test/package.json +++ b/packages/e2e-test/package.json @@ -47,7 +47,7 @@ "devDependencies": { "@backstage/cli": "workspace:^", "@types/fs-extra": "^11.0.0", - "@types/node": "^20.16.0", + "@types/node": "^22.13.14", "nodemon": "^3.0.1" } } diff --git a/packages/e2e-test/src/commands/index.ts b/packages/e2e-test/src/commands/index.ts index fd0ba59c30..cbcb9f3907 100644 --- a/packages/e2e-test/src/commands/index.ts +++ b/packages/e2e-test/src/commands/index.ts @@ -15,12 +15,12 @@ */ import { Command } from 'commander'; -import { run } from './run'; +import { runCommand } from './runCommand'; export function registerCommands(program: Command) { program .command('run') .option('--keep', 'Do not remove the temporary dir after tests complete') .description('Run e2e tests') - .action(run); + .action(runCommand); } diff --git a/packages/e2e-test/src/commands/run.ts b/packages/e2e-test/src/commands/runCommand.ts similarity index 94% rename from packages/e2e-test/src/commands/run.ts rename to packages/e2e-test/src/commands/runCommand.ts index 6df58349df..112937dbe7 100644 --- a/packages/e2e-test/src/commands/run.ts +++ b/packages/e2e-test/src/commands/runCommand.ts @@ -22,18 +22,12 @@ import killTree from 'tree-kill'; import { resolve as resolvePath, join as joinPath } from 'path'; import path from 'path'; -import { - spawnPiped, - runPlain, - waitFor, - waitForExit, - print, -} from '../lib/helpers'; +import { waitFor, print } from '../lib/helpers'; import mysql from 'mysql2/promise'; import pgtools from 'pgtools'; -import { findPaths } from '@backstage/cli-common'; +import { findPaths, runOutput, run } from '@backstage/cli-common'; import { OptionValues } from 'commander'; // eslint-disable-next-line no-restricted-syntax @@ -46,7 +40,7 @@ const templatePackagePaths = [ 'packages/create-app/templates/default-app/packages/backend/package.json.hbs', ]; -export async function run(opts: OptionValues) { +export async function runCommand(opts: OptionValues) { const rootDir = await fs.mkdtemp(resolvePath(os.tmpdir(), 'backstage-e2e-')); print(`CLI E2E test root: ${rootDir}\n`); @@ -67,7 +61,7 @@ export async function run(opts: OptionValues) { await createPlugin({ appDir, pluginId, select: 'backend-plugin' }); print(`Running 'yarn test:e2e' in newly created app with new plugin`); - await runPlain(['yarn', 'test:e2e'], { + await runOutput(['yarn', 'test:e2e'], { cwd: appDir, env: { ...process.env, CI: undefined }, }); @@ -75,13 +69,13 @@ export async function run(opts: OptionValues) { await switchToReact17(appDir); print(`Running 'yarn install' to install React 17`); - await runPlain(['yarn', 'install'], { cwd: appDir }); + await runOutput(['yarn', 'install'], { cwd: appDir }); print(`Running 'yarn tsc' with React 17`); - await runPlain(['yarn', 'tsc'], { cwd: appDir }); + await runOutput(['yarn', 'tsc'], { cwd: appDir }); print(`Running 'yarn test:e2e' with React 17`); - await runPlain(['yarn', 'test:e2e'], { + await runOutput(['yarn', 'test:e2e'], { cwd: appDir, env: { ...process.env, CI: undefined }, }); @@ -190,7 +184,7 @@ async function buildDistWorkspace(workspaceName: string, rootDir: string) { appendDeps(require('@backstage/create-app/package.json')); print(`Preparing workspace`); - await runPlain([ + await runOutput([ 'yarn', 'backstage-cli', 'build-workspace', @@ -209,7 +203,7 @@ async function buildDistWorkspace(workspaceName: string, rootDir: string) { } print('Installing workspace dependencies'); - await runPlain(['yarn', 'workspaces', 'focus', '--all', '--production'], { + await runOutput(['yarn', 'workspaces', 'focus', '--all', '--production'], { cwd: workspaceDir, }); @@ -257,7 +251,7 @@ async function createApp( workspaceDir: string, rootDir: string, ) { - const child = spawnPiped( + const child = run( [ 'node', resolvePath(workspaceDir, 'packages/create-app/bin/backstage-create-app'), @@ -265,6 +259,7 @@ async function createApp( ], { cwd: rootDir, + stdio: ['pipe', 'pipe', 'pipe'], }, ); @@ -278,7 +273,7 @@ async function createApp( child.stdin?.write(`${appName}\n`); print('Waiting for app create script to be done'); - await waitForExit(child); + await child.waitForExit(); const appDir = resolvePath(rootDir, appName); @@ -318,7 +313,7 @@ async function createApp( 'test:all', ]) { print(`Running 'yarn ${cmd}' in newly created app`); - await runPlain(['yarn', cmd], { cwd: appDir }); + await runOutput(['yarn', cmd], { cwd: appDir }); } return appDir; @@ -378,10 +373,11 @@ async function createPlugin(options: { select: string; }) { const { appDir, pluginId, select } = options; - const child = spawnPiped( + const child = run( ['yarn', 'new', '--select', select, '--option', `pluginId=${pluginId}`], { cwd: appDir, + stdio: ['pipe', 'pipe', 'pipe'], }, ); @@ -392,7 +388,7 @@ async function createPlugin(options: { }); print('Waiting for plugin create script to be done'); - await waitForExit(child); + await child.waitForExit(); const pluginDir = resolvePath( appDir, @@ -401,11 +397,11 @@ async function createPlugin(options: { ); print(`Running 'yarn tsc' in root for newly created plugin`); - await runPlain(['yarn', 'tsc'], { cwd: appDir }); + await runOutput(['yarn', 'tsc'], { cwd: appDir }); for (const cmd of [['lint'], ['test', '--no-watch']]) { print(`Running 'yarn ${cmd.join(' ')}' in newly created plugin`); - await runPlain(['yarn', ...cmd], { cwd: pluginDir }); + await runOutput(['yarn', ...cmd], { cwd: pluginDir }); } } finally { child.kill(); @@ -494,7 +490,7 @@ async function dropClientDatabases(client: string) { * Start serving the newly created backend and make sure that all db migrations works correctly */ async function testBackendStart(appDir: string, ...args: string[]) { - const child = spawnPiped(['yarn', 'workspace', 'backend', 'start', ...args], { + const child = run(['yarn', 'workspace', 'backend', 'start', ...args], { cwd: appDir, // Windows does not like piping stdin here, the child process will hang when requiring the 'process' module stdio: ['ignore', 'pipe', 'pipe'], @@ -586,7 +582,7 @@ async function testBackendStart(appDir: string, ...args: string[]) { } try { - await waitForExit(child); + await child.waitForExit(); } catch (error) { if (!successful) { throw new Error(`Backend failed to startup: ${stderr}`); diff --git a/packages/e2e-test/src/index.ts b/packages/e2e-test/src/index.ts index f3c63ae175..df299628b2 100644 --- a/packages/e2e-test/src/index.ts +++ b/packages/e2e-test/src/index.ts @@ -18,7 +18,6 @@ import { program } from 'commander'; import chalk from 'chalk'; import { registerCommands } from './commands'; import { version } from '../package.json'; -import { exitWithError } from './lib/helpers'; async function main(argv: string[]) { program.name('e2e-test').version(version); @@ -36,4 +35,12 @@ async function main(argv: string[]) { program.parse(argv); } -main(process.argv).catch(exitWithError); +main(process.argv).catch(err => { + process.stdout.write(`${err.name}: ${err.stack || err.message}\n`); + + if (typeof err.code === 'number') { + process.exit(err.code); + } else { + process.exit(1); + } +}); diff --git a/packages/e2e-test/src/lib/helpers.ts b/packages/e2e-test/src/lib/helpers.ts index fc5aefcff9..d310812794 100644 --- a/packages/e2e-test/src/lib/helpers.ts +++ b/packages/e2e-test/src/lib/helpers.ts @@ -14,77 +14,6 @@ * limitations under the License. */ -import { assertError } from '@backstage/errors'; -import { - spawn, - execFile as execFileCb, - SpawnOptions, - ChildProcess, -} from 'child_process'; -import { promisify } from 'util'; - -const execFile = promisify(execFileCb); - -export function spawnPiped(cmd: string[], options?: SpawnOptions) { - function pipeWithPrefix(stream: NodeJS.WriteStream, prefix = '') { - return (data: Buffer) => { - const prefixedMsg = data - .toString('utf8') - .trimEnd() - .replace(/^/gm, prefix); - stream.write(`${prefixedMsg}\n`, 'utf8'); - }; - } - - const child = spawn(cmd[0], cmd.slice(1), { - stdio: 'pipe', - shell: true, - ...options, - }); - child.on('error', exitWithError); - - const logPrefix = cmd.map(s => s.replace(/.+\//, '')).join(' '); - child.stdout?.on( - 'data', - pipeWithPrefix(process.stdout, `[${logPrefix}].out: `), - ); - child.stderr?.on( - 'data', - pipeWithPrefix(process.stderr, `[${logPrefix}].err: `), - ); - - return child; -} - -export async function runPlain(cmd: string[], options?: SpawnOptions) { - try { - const { stdout } = await execFile(cmd[0], cmd.slice(1), { - ...options, - shell: true, - }); - return stdout.trim(); - } catch (error) { - assertError(error); - if (error.stdout) { - process.stdout.write(error.stdout as Buffer); - } - if (error.stderr) { - process.stderr.write(error.stderr as Buffer); - } - throw error; - } -} - -export function exitWithError(err: Error & { code?: unknown }) { - process.stdout.write(`${err.name}: ${err.stack || err.message}\n`); - - if (typeof err.code === 'number') { - process.exit(err.code); - } else { - process.exit(1); - } -} - /** * Waits for fn() to be true * Checks every 100ms @@ -108,22 +37,6 @@ export function waitFor(fn: () => boolean, maxSeconds: number = 120) { }); } -export async function waitForExit(child: ChildProcess) { - if (child.exitCode !== null) { - throw new Error(`Child already exited with code ${child.exitCode}`); - } - await new Promise((resolve, reject) => - child.once('exit', code => { - if (code) { - reject(new Error(`Child exited with code ${code}`)); - } else { - print('Child finished'); - resolve(); - } - }), - ); -} - export function print(msg: string) { return process.stdout.write(`${msg}\n`); } diff --git a/packages/frontend-internal/package.json b/packages/frontend-internal/package.json index 4ac3285d9f..f2268f38f4 100644 --- a/packages/frontend-internal/package.json +++ b/packages/frontend-internal/package.json @@ -25,8 +25,7 @@ "dependencies": { "@backstage/frontend-plugin-api": "workspace:^", "@backstage/types": "workspace:^", - "@backstage/version-bridge": "workspace:^", - "zod": "^3.22.4" + "@backstage/version-bridge": "workspace:^" }, "devDependencies": { "@backstage/cli": "workspace:^", diff --git a/packages/frontend-plugin-api/CHANGELOG.md b/packages/frontend-plugin-api/CHANGELOG.md index c0c6b6ec0e..6c5ede72df 100644 --- a/packages/frontend-plugin-api/CHANGELOG.md +++ b/packages/frontend-plugin-api/CHANGELOG.md @@ -1,5 +1,21 @@ # @backstage/frontend-plugin-api +## 0.13.2-next.1 + +### Patch Changes + +- 75683ed: Added a new `errorPresentation` prop to `ExtensionBoundary` to control how errors are presented to the user. The default is `'error-display'`, which is the current behavior of showing the error in the `ErrorDisplay` component. The new option is `'error-api'`, posts errors to the `ErrorApi` and does not allow retries. + + The `AppRootElementBlueprint` now wraps its element in an `ErrorBoundary` using the new `'error-api'` presentation mode. + +- f3f84f1: Made the return type of `.withOverrides` to be simplified. +- Updated dependencies + - @backstage/core-components@0.18.4-next.2 + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + - @backstage/types@1.2.2 + - @backstage/version-bridge@1.0.11 + ## 0.13.2-next.0 ### Patch Changes diff --git a/packages/frontend-plugin-api/package.json b/packages/frontend-plugin-api/package.json index 25c40b2e0a..af3359ff22 100644 --- a/packages/frontend-plugin-api/package.json +++ b/packages/frontend-plugin-api/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/frontend-plugin-api", - "version": "0.13.2-next.0", + "version": "0.13.2-next.1", "backstage": { "role": "web-library" }, @@ -40,18 +40,15 @@ "test": "backstage-cli package test" }, "dependencies": { - "@backstage/config": "workspace:^", - "@backstage/core-components": "workspace:^", "@backstage/errors": "workspace:^", "@backstage/types": "workspace:^", "@backstage/version-bridge": "workspace:^", - "@material-ui/core": "^4.12.4", - "lodash": "^4.17.21", "zod": "^3.22.4", "zod-to-json-schema": "^3.21.4" }, "devDependencies": { "@backstage/cli": "workspace:^", + "@backstage/config": "workspace:^", "@backstage/frontend-app-api": "workspace:^", "@backstage/frontend-test-utils": "workspace:^", "@backstage/test-utils": "workspace:^", diff --git a/packages/frontend-plugin-api/report.api.md b/packages/frontend-plugin-api/report.api.md index d95634988c..fbe7110d80 100644 --- a/packages/frontend-plugin-api/report.api.md +++ b/packages/frontend-plugin-api/report.api.md @@ -4,12 +4,14 @@ ```ts import { AnyRouteRefParams as AnyRouteRefParams_2 } from '@backstage/frontend-plugin-api'; +import { ApiRef as ApiRef_2 } from '@backstage/frontend-plugin-api'; import { ComponentType } from 'react'; -import { Config } from '@backstage/config'; +import type { Config } from '@backstage/config'; import { ConfigurableExtensionDataRef as ConfigurableExtensionDataRef_2 } from '@backstage/frontend-plugin-api'; import { Expand } from '@backstage/types'; import { ExpandRecursive } from '@backstage/types'; import { ExtensionBlueprint as ExtensionBlueprint_2 } from '@backstage/frontend-plugin-api'; +import { ExtensionBlueprintParams as ExtensionBlueprintParams_2 } from '@backstage/frontend-plugin-api'; import { ExtensionDataRef as ExtensionDataRef_2 } from '@backstage/frontend-plugin-api'; import { IconComponent as IconComponent_2 } from '@backstage/frontend-plugin-api'; import { JsonObject } from '@backstage/types'; @@ -20,7 +22,8 @@ import { Observable } from '@backstage/types'; import { PropsWithChildren } from 'react'; import { ReactNode } from 'react'; import { RouteRef as RouteRef_2 } from '@backstage/frontend-plugin-api'; -import { z } from 'zod'; +import { SwappableComponentRef as SwappableComponentRef_2 } from '@backstage/frontend-plugin-api'; +import type { z } from 'zod'; // @public export type AlertApi = { @@ -80,12 +83,12 @@ export type AnalyticsImplementation = { }; // @public -export const AnalyticsImplementationBlueprint: ExtensionBlueprint<{ +export const AnalyticsImplementationBlueprint: ExtensionBlueprint_2<{ kind: 'analytics'; params: ( params: AnalyticsImplementationFactory, - ) => ExtensionBlueprintParams>; - output: ExtensionDataRef< + ) => ExtensionBlueprintParams_2>; + output: ExtensionDataRef_2< AnalyticsImplementationFactory<{}>, 'core.analytics.factory', {} @@ -94,7 +97,7 @@ export const AnalyticsImplementationBlueprint: ExtensionBlueprint<{ config: {}; configInput: {}; dataRefs: { - factory: ConfigurableExtensionDataRef< + factory: ConfigurableExtensionDataRef_2< AnalyticsImplementationFactory<{}>, 'core.analytics.factory', {} @@ -147,7 +150,7 @@ export type AnyRouteRefParams = | undefined; // @public -export const ApiBlueprint: ExtensionBlueprint<{ +export const ApiBlueprint: ExtensionBlueprint_2<{ kind: 'api'; params: < TApi, @@ -155,13 +158,13 @@ export const ApiBlueprint: ExtensionBlueprint<{ TDeps extends { [name in string]: unknown }, >( params: ApiFactory, - ) => ExtensionBlueprintParams; - output: ExtensionDataRef; + ) => ExtensionBlueprintParams_2; + output: ExtensionDataRef_2; inputs: {}; config: {}; configInput: {}; dataRefs: { - factory: ConfigurableExtensionDataRef< + factory: ConfigurableExtensionDataRef_2< AnyApiFactory, 'core.api.factory', {} @@ -256,12 +259,12 @@ export interface AppNodeSpec { } // @public -export const AppRootElementBlueprint: ExtensionBlueprint<{ +export const AppRootElementBlueprint: ExtensionBlueprint_2<{ kind: 'app-root-element'; params: { element: JSX.Element; }; - output: ExtensionDataRef; + output: ExtensionDataRef_2; inputs: {}; config: {}; configInput: {}; @@ -269,13 +272,13 @@ export const AppRootElementBlueprint: ExtensionBlueprint<{ }>; // @public -export const AppRootWrapperBlueprint: ExtensionBlueprint<{ +export const AppRootWrapperBlueprint: ExtensionBlueprint_2<{ kind: 'app-root-wrapper'; params: { Component?: [error: 'Use the `component` parameter instead']; component: (props: { children: ReactNode }) => JSX.Element | null; }; - output: ExtensionDataRef< + output: ExtensionDataRef_2< (props: { children: ReactNode }) => JSX.Element | null, 'app.root.wrapper', {} @@ -284,7 +287,7 @@ export const AppRootWrapperBlueprint: ExtensionBlueprint<{ config: {}; configInput: {}; dataRefs: { - component: ConfigurableExtensionDataRef< + component: ConfigurableExtensionDataRef_2< (props: { children: ReactNode }) => JSX.Element | null, 'app.root.wrapper', {} @@ -330,7 +333,7 @@ export interface AppTreeApi { } // @public -export const appTreeApiRef: ApiRef; +export const appTreeApiRef: ApiRef_2; // @public export const atlassianAuthApiRef: ApiRef< @@ -410,14 +413,14 @@ export interface ConfigurableExtensionDataRef< // @public (undocumented) export const coreExtensionData: { - title: ConfigurableExtensionDataRef; - reactElement: ConfigurableExtensionDataRef< + title: ConfigurableExtensionDataRef_2; + reactElement: ConfigurableExtensionDataRef_2< JSX_3.Element, 'core.reactElement', {} >; - routePath: ConfigurableExtensionDataRef; - routeRef: ConfigurableExtensionDataRef< + routePath: ConfigurableExtensionDataRef_2; + routeRef: ConfigurableExtensionDataRef_2< RouteRef, 'core.routing.ref', {} @@ -891,7 +894,7 @@ export interface DialogApiDialog { } // @public -export const dialogApiRef: ApiRef; +export const dialogApiRef: ApiRef_2; // @public export type DiscoveryApi = { @@ -928,7 +931,7 @@ export const errorApiRef: ApiRef; // @public (undocumented) export const ErrorDisplay: { (props: ErrorDisplayProps): JSX.Element | null; - ref: SwappableComponentRef; + ref: SwappableComponentRef_2; }; // @public (undocumented) @@ -975,7 +978,7 @@ export interface ExtensionBlueprint< // (undocumented) make< TName extends string | undefined, - TParamsInput extends AnyParamsInput>, + TParamsInput extends AnyParamsInput_2>, UParentInputs extends ExtensionDataRef, >(args: { name?: TName; @@ -1003,10 +1006,10 @@ export interface ExtensionBlueprint< }, UFactoryOutput extends ExtensionDataValue, UNewOutput extends ExtensionDataRef, + UParentInputs extends ExtensionDataRef, TExtraInputs extends { [inputName in string]: ExtensionInput; - }, - UParentInputs extends ExtensionDataRef, + } = {}, >(args: { name?: TName; attachTo?: ExtensionDefinitionAttachTo & @@ -1030,7 +1033,7 @@ export interface ExtensionBlueprint< }; factory( originalFactory: < - TParamsInput extends AnyParamsInput>, + TParamsInput extends AnyParamsInput_2>, >( params: TParamsInput extends ExtensionBlueprintDefineParams ? TParamsInput @@ -1060,26 +1063,30 @@ export interface ExtensionBlueprint< UFactoryOutput >; }): OverridableExtensionDefinition<{ - config: (string extends keyof TExtensionConfigSchema - ? {} - : { - [key in keyof TExtensionConfigSchema]: z.infer< - ReturnType - >; - }) & - T['config']; - configInput: (string extends keyof TExtensionConfigSchema - ? {} - : z.input< - z.ZodObject<{ - [key in keyof TExtensionConfigSchema]: ReturnType< - TExtensionConfigSchema[key] + config: Expand< + (string extends keyof TExtensionConfigSchema + ? {} + : { + [key in keyof TExtensionConfigSchema]: z.infer< + ReturnType >; - }> - >) & - T['configInput']; + }) & + T['config'] + >; + configInput: Expand< + (string extends keyof TExtensionConfigSchema + ? {} + : z.input< + z.ZodObject<{ + [key in keyof TExtensionConfigSchema]: ReturnType< + TExtensionConfigSchema[key] + >; + }> + >) & + T['configInput'] + >; output: ExtensionDataRef extends UNewOutput ? T['output'] : UNewOutput; - inputs: T['inputs'] & TExtraInputs; + inputs: Expand; kind: T['kind']; name: string | undefined extends TName ? undefined : TName; params: T['params']; @@ -1139,6 +1146,8 @@ export interface ExtensionBoundaryProps { // (undocumented) children: ReactNode; // (undocumented) + errorPresentation?: 'error-api' | 'error-display'; + // (undocumented) node: AppNode; } @@ -1449,12 +1458,12 @@ export const googleAuthApiRef: ApiRef< >; // @public (undocumented) -export const IconBundleBlueprint: ExtensionBlueprint<{ +export const IconBundleBlueprint: ExtensionBlueprint_2<{ kind: 'icon-bundle'; params: { icons: { [key in string]: IconComponent }; }; - output: ExtensionDataRef< + output: ExtensionDataRef_2< { [x: string]: IconComponent; }, @@ -1465,7 +1474,7 @@ export const IconBundleBlueprint: ExtensionBlueprint<{ config: {}; configInput: {}; dataRefs: { - icons: ConfigurableExtensionDataRef< + icons: ConfigurableExtensionDataRef_2< { [x: string]: IconComponent; }, @@ -1489,7 +1498,7 @@ export interface IconsApi { } // @public -export const iconsApiRef: ApiRef; +export const iconsApiRef: ApiRef_2; // @public export type IdentityApi = { @@ -1553,14 +1562,14 @@ export interface NavContentComponentProps { } // @public -export const NavItemBlueprint: ExtensionBlueprint<{ +export const NavItemBlueprint: ExtensionBlueprint_2<{ kind: 'nav-item'; params: { title: string; icon: IconComponent; routeRef: RouteRef; }; - output: ExtensionDataRef< + output: ExtensionDataRef_2< { title: string; icon: IconComponent; @@ -1573,7 +1582,7 @@ export const NavItemBlueprint: ExtensionBlueprint<{ config: {}; configInput: {}; dataRefs: { - target: ConfigurableExtensionDataRef< + target: ConfigurableExtensionDataRef_2< { title: string; icon: IconComponent; @@ -1588,7 +1597,7 @@ export const NavItemBlueprint: ExtensionBlueprint<{ // @public (undocumented) export const NotFoundErrorPage: { (props: NotFoundErrorPageProps): JSX.Element | null; - ref: SwappableComponentRef; + ref: SwappableComponentRef_2; }; // @public (undocumented) @@ -1676,7 +1685,7 @@ export interface OverridableExtensionDefinition< TExtraInputs extends { [inputName in string]: ExtensionInput; }, - TParamsInput extends AnyParamsInput_2>, + TParamsInput extends AnyParamsInput>, UParentInputs extends ExtensionDataRef, >( args: Expand< @@ -1702,7 +1711,7 @@ export interface OverridableExtensionDefinition< }; factory?( originalFactory: < - TFactoryParamsReturn extends AnyParamsInput_2< + TFactoryParamsReturn extends AnyParamsInput< NonNullable >, >( @@ -1799,7 +1808,7 @@ export interface OverridableFrontendPlugin< } // @public -export const PageBlueprint: ExtensionBlueprint<{ +export const PageBlueprint: ExtensionBlueprint_2<{ kind: 'page'; params: { defaultPath?: [Error: `Use the 'path' param instead`]; @@ -1808,10 +1817,10 @@ export const PageBlueprint: ExtensionBlueprint<{ routeRef?: RouteRef; }; output: - | ExtensionDataRef - | ExtensionDataRef - | ExtensionDataRef< - RouteRef, + | ExtensionDataRef_2 + | ExtensionDataRef_2 + | ExtensionDataRef_2< + RouteRef, 'core.routing.ref', { optional: true; @@ -1880,7 +1889,7 @@ export type ProfileInfoApi = { // @public (undocumented) export const Progress: { (props: ProgressProps): JSX.Element | null; - ref: SwappableComponentRef; + ref: SwappableComponentRef_2; }; // @public (undocumented) @@ -1915,13 +1924,13 @@ export type RouteFunc = ( ) => string; // @public (undocumented) -export const RouterBlueprint: ExtensionBlueprint<{ +export const RouterBlueprint: ExtensionBlueprint_2<{ kind: 'app-router-component'; params: { Component?: [error: 'Use the `component` parameter instead']; component: (props: { children: ReactNode }) => JSX.Element | null; }; - output: ExtensionDataRef< + output: ExtensionDataRef_2< (props: { children: ReactNode }) => JSX.Element | null, 'app.router.wrapper', {} @@ -1930,7 +1939,7 @@ export const RouterBlueprint: ExtensionBlueprint<{ config: {}; configInput: {}; dataRefs: { - component: ConfigurableExtensionDataRef< + component: ConfigurableExtensionDataRef_2< (props: { children: ReactNode }) => JSX.Element | null, 'app.router.wrapper', {} @@ -1963,7 +1972,7 @@ export interface RouteResolutionApi { } // @public -export const routeResolutionApiRef: ApiRef; +export const routeResolutionApiRef: ApiRef_2; // @public export type SessionApi = { @@ -1990,12 +1999,12 @@ export namespace SessionState { } // @public -export const SignInPageBlueprint: ExtensionBlueprint<{ +export const SignInPageBlueprint: ExtensionBlueprint_2<{ kind: 'sign-in-page'; params: { loader: () => Promise>; }; - output: ExtensionDataRef< + output: ExtensionDataRef_2< ComponentType, 'core.sign-in-page.component', {} @@ -2004,7 +2013,7 @@ export const SignInPageBlueprint: ExtensionBlueprint<{ config: {}; configInput: {}; dataRefs: { - component: ConfigurableExtensionDataRef< + component: ConfigurableExtensionDataRef_2< ComponentType, 'core.sign-in-page.component', {} @@ -2058,7 +2067,7 @@ export interface SubRouteRef< } // @public -export const SwappableComponentBlueprint: ExtensionBlueprint<{ +export const SwappableComponentBlueprint: ExtensionBlueprint_2<{ kind: 'component'; params: >(params: { component: Ref extends SwappableComponentRef< @@ -2074,7 +2083,7 @@ export const SwappableComponentBlueprint: ExtensionBlueprint<{ | (() => (props: IInnerComponentProps) => JSX.Element | null) | (() => Promise<(props: IInnerComponentProps) => JSX.Element | null>) : never; - }) => ExtensionBlueprintParams<{ + }) => ExtensionBlueprintParams_2<{ component: Ref extends SwappableComponentRef< any, infer IExternalComponentProps @@ -2089,7 +2098,7 @@ export const SwappableComponentBlueprint: ExtensionBlueprint<{ | (() => Promise<(props: IInnerComponentProps) => JSX.Element | null>) : never; }>; - output: ExtensionDataRef< + output: ExtensionDataRef_2< { ref: SwappableComponentRef; loader: @@ -2103,7 +2112,7 @@ export const SwappableComponentBlueprint: ExtensionBlueprint<{ config: {}; configInput: {}; dataRefs: { - component: ConfigurableExtensionDataRef< + component: ConfigurableExtensionDataRef_2< { ref: SwappableComponentRef; loader: @@ -2139,20 +2148,20 @@ export interface SwappableComponentsApi { } // @public -export const swappableComponentsApiRef: ApiRef; +export const swappableComponentsApiRef: ApiRef_2; // @public -export const ThemeBlueprint: ExtensionBlueprint<{ +export const ThemeBlueprint: ExtensionBlueprint_2<{ kind: 'theme'; params: { theme: AppTheme; }; - output: ExtensionDataRef; + output: ExtensionDataRef_2; inputs: {}; config: {}; configInput: {}; dataRefs: { - theme: ConfigurableExtensionDataRef; + theme: ConfigurableExtensionDataRef_2; }; }>; @@ -2178,12 +2187,12 @@ export type TranslationApi = { export const translationApiRef: ApiRef; // @public -export const TranslationBlueprint: ExtensionBlueprint<{ +export const TranslationBlueprint: ExtensionBlueprint_2<{ kind: 'translation'; params: { resource: TranslationResource | TranslationMessages; }; - output: ExtensionDataRef< + output: ExtensionDataRef_2< | TranslationResource | TranslationMessages< string, @@ -2199,7 +2208,7 @@ export const TranslationBlueprint: ExtensionBlueprint<{ config: {}; configInput: {}; dataRefs: { - translation: ConfigurableExtensionDataRef< + translation: ConfigurableExtensionDataRef_2< | TranslationResource | TranslationMessages< string, diff --git a/packages/frontend-plugin-api/src/apis/definitions/ConfigApi.ts b/packages/frontend-plugin-api/src/apis/definitions/ConfigApi.ts index d3bada9e46..f935dfa3af 100644 --- a/packages/frontend-plugin-api/src/apis/definitions/ConfigApi.ts +++ b/packages/frontend-plugin-api/src/apis/definitions/ConfigApi.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { ApiRef, createApiRef } from '../system'; -import { Config } from '@backstage/config'; +import type { Config } from '@backstage/config'; /** * The Config API is used to provide a mechanism to access the diff --git a/packages/frontend-plugin-api/src/blueprints/AppRootElementBlueprint.test.tsx b/packages/frontend-plugin-api/src/blueprints/AppRootElementBlueprint.test.tsx index 39f03cfad4..31d7323aec 100644 --- a/packages/frontend-plugin-api/src/blueprints/AppRootElementBlueprint.test.tsx +++ b/packages/frontend-plugin-api/src/blueprints/AppRootElementBlueprint.test.tsx @@ -14,7 +14,19 @@ * limitations under the License. */ +import { screen, waitFor } from '@testing-library/react'; +import { + MockErrorApi, + TestApiProvider, + withLogCollector, +} from '@backstage/test-utils'; +import { errorApiRef } from '../apis'; +import { + createExtensionTester, + renderInTestApp, +} from '@backstage/frontend-test-utils'; import { AppRootElementBlueprint } from './AppRootElementBlueprint'; +import { ForwardedError } from '@backstage/errors'; describe('AppRootElementBlueprint', () => { it('should create an extension with sensible defaults', () => { @@ -46,4 +58,57 @@ describe('AppRootElementBlueprint', () => { } `); }); + + it('should post error to errorApi and not render children when error occurs', async () => { + const errorApi = new MockErrorApi({ collect: true }); + const errorMessage = 'Test error message'; + const ErrorComponent = () => { + throw new Error(errorMessage); + }; + + await withLogCollector(['error'], async () => { + const extension = AppRootElementBlueprint.make({ + params: { + element: , + }, + }); + + const tester = createExtensionTester(extension); + renderInTestApp( + + {tester.reactElement()} + , + ); + + await waitFor(() => { + const errors = errorApi.getErrors(); + expect(errors.length).toBeGreaterThan(0); + const postedError = errors[0].error; + expect(postedError).toBeInstanceOf(ForwardedError); + expect(postedError.message).toBe( + "Error in extension 'app-root-element:test'; caused by Error: Test error message", + ); + }); + + expect(screen.queryByText(errorMessage)).not.toBeInTheDocument(); + }); + }); + + it('should render children when there is no error', async () => { + const successMessage = 'Success!'; + const SuccessComponent = () =>
{successMessage}
; + + const extension = AppRootElementBlueprint.make({ + params: { + element: , + }, + }); + + const tester = createExtensionTester(extension); + renderInTestApp(tester.reactElement()); + + await waitFor(() => { + expect(screen.getByText(successMessage)).toBeInTheDocument(); + }); + }); }); diff --git a/packages/frontend-plugin-api/src/blueprints/AppRootElementBlueprint.ts b/packages/frontend-plugin-api/src/blueprints/AppRootElementBlueprint.tsx similarity index 78% rename from packages/frontend-plugin-api/src/blueprints/AppRootElementBlueprint.ts rename to packages/frontend-plugin-api/src/blueprints/AppRootElementBlueprint.tsx index d1c71155f2..955abce136 100644 --- a/packages/frontend-plugin-api/src/blueprints/AppRootElementBlueprint.ts +++ b/packages/frontend-plugin-api/src/blueprints/AppRootElementBlueprint.tsx @@ -14,6 +14,7 @@ * limitations under the License. */ +import { ExtensionBoundary } from '@backstage/frontend-plugin-api'; import { coreExtensionData, createExtensionBlueprint } from '../wiring'; /** @@ -26,7 +27,11 @@ export const AppRootElementBlueprint = createExtensionBlueprint({ kind: 'app-root-element', attachTo: { id: 'app/root', input: 'elements' }, output: [coreExtensionData.reactElement], - *factory(params: { element: JSX.Element }) { - yield coreExtensionData.reactElement(params.element); + *factory(params: { element: JSX.Element }, { node }) { + yield coreExtensionData.reactElement( + + {params.element} + , + ); }, }); diff --git a/packages/frontend-plugin-api/src/components/ErrorApiBoundary.tsx b/packages/frontend-plugin-api/src/components/ErrorApiBoundary.tsx new file mode 100644 index 0000000000..e195da5d0f --- /dev/null +++ b/packages/frontend-plugin-api/src/components/ErrorApiBoundary.tsx @@ -0,0 +1,50 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Component, ErrorInfo, ReactNode } from 'react'; +import { AppNode, ErrorApi } from '../apis'; +import { ForwardedError } from '@backstage/errors'; + +/** @internal */ +export class ErrorApiBoundary extends Component< + { + children: ReactNode; + node: AppNode; + errorApi?: ErrorApi; + }, + { error?: Error } +> { + static getDerivedStateFromError(error: Error) { + return { error }; + } + + state = { error: undefined }; + + componentDidCatch(error: Error, _errorInfo: ErrorInfo) { + const { node, errorApi } = this.props; + errorApi?.post( + new ForwardedError(`Error in extension '${node.spec.id}'`, error), + ); + } + + render() { + if (this.state.error) { + return null; + } + + return this.props.children; + } +} diff --git a/packages/frontend-plugin-api/src/components/ErrorBoundary.tsx b/packages/frontend-plugin-api/src/components/ErrorDisplayBoundary.tsx similarity index 80% rename from packages/frontend-plugin-api/src/components/ErrorBoundary.tsx rename to packages/frontend-plugin-api/src/components/ErrorDisplayBoundary.tsx index 4cde84ee93..1584f18514 100644 --- a/packages/frontend-plugin-api/src/components/ErrorBoundary.tsx +++ b/packages/frontend-plugin-api/src/components/ErrorDisplayBoundary.tsx @@ -14,25 +14,23 @@ * limitations under the License. */ -import { Component, PropsWithChildren } from 'react'; +import { Component, ReactNode } from 'react'; import { FrontendPlugin } from '../wiring'; import { ErrorDisplay } from './DefaultSwappableComponents'; -type ErrorBoundaryProps = PropsWithChildren<{ - plugin?: FrontendPlugin; -}>; -type ErrorBoundaryState = { error?: Error }; - /** @internal */ -export class ErrorBoundary extends Component< - ErrorBoundaryProps, - ErrorBoundaryState +export class ErrorDisplayBoundary extends Component< + { + children: ReactNode; + plugin: FrontendPlugin; + }, + { error?: Error } > { static getDerivedStateFromError(error: Error) { return { error }; } - state: ErrorBoundaryState = { error: undefined }; + state = { error: undefined }; handleErrorReset = () => { this.setState({ error: undefined }); diff --git a/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx b/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx index 421f41be56..6e4487ed9b 100644 --- a/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx +++ b/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx @@ -22,14 +22,23 @@ import { lazy as reactLazy, } from 'react'; import { AnalyticsContext, useAnalytics } from '../analytics'; -import { ErrorBoundary } from './ErrorBoundary'; +import { ErrorDisplayBoundary } from './ErrorDisplayBoundary'; +import { ErrorApiBoundary } from './ErrorApiBoundary'; // eslint-disable-next-line @backstage/no-relative-monorepo-imports import { routableExtensionRenderedEvent } from '../../../core-plugin-api/src/analytics/Tracker'; -import { AppNode } from '../apis'; +import { AppNode, ErrorApi, errorApiRef, useApi } from '../apis'; import { coreExtensionData } from '../wiring'; import { AppNodeProvider } from './AppNodeProvider'; import { Progress } from './DefaultSwappableComponents'; +function useOptionalErrorApi(): ErrorApi | undefined { + try { + return useApi(errorApiRef); + } catch { + return undefined; + } +} + type RouteTrackerProps = PropsWithChildren<{ enabled?: boolean; }>; @@ -53,6 +62,7 @@ const RouteTracker = (props: RouteTrackerProps) => { /** @public */ export interface ExtensionBoundaryProps { + errorPresentation?: 'error-api' | 'error-display'; node: AppNode; children: ReactNode; } @@ -61,6 +71,8 @@ export interface ExtensionBoundaryProps { export function ExtensionBoundary(props: ExtensionBoundaryProps) { const { node, children } = props; + const errorApi = useOptionalErrorApi(); + const hasRoutePathOutput = Boolean( node.instance?.getData(coreExtensionData.routePath), ); @@ -70,18 +82,30 @@ export function ExtensionBoundary(props: ExtensionBoundaryProps) { // Skipping "routeRef" attribute in the new system, the extension "id" should provide more insight const attributes = { extensionId: node.spec.id, - pluginId: node.spec.plugin?.id ?? 'app', + pluginId: plugin.id ?? 'app', }; + let content = ( + + {children} + + ); + + if (props.errorPresentation === 'error-api') { + content = ( + + {content} + + ); + } else { + content = ( + {content} + ); + } + return ( - }> - - - {children} - - - + }>{content} ); } diff --git a/packages/frontend-plugin-api/src/schema/createSchemaFromZod.ts b/packages/frontend-plugin-api/src/schema/createSchemaFromZod.ts index 85f9d5c44a..b15ff980ec 100644 --- a/packages/frontend-plugin-api/src/schema/createSchemaFromZod.ts +++ b/packages/frontend-plugin-api/src/schema/createSchemaFromZod.ts @@ -15,7 +15,7 @@ */ import { JsonObject } from '@backstage/types'; -import { z, ZodSchema, ZodTypeDef } from 'zod'; +import { z, type ZodSchema, type ZodTypeDef } from 'zod'; import zodToJsonSchema from 'zod-to-json-schema'; import { PortableSchema } from './types'; diff --git a/packages/frontend-plugin-api/src/wiring/createExtension.ts b/packages/frontend-plugin-api/src/wiring/createExtension.ts index 9b55505056..6e4aba2910 100644 --- a/packages/frontend-plugin-api/src/wiring/createExtension.ts +++ b/packages/frontend-plugin-api/src/wiring/createExtension.ts @@ -26,7 +26,7 @@ import { } from '@internal/frontend'; import { ExtensionDataRef, ExtensionDataValue } from './createExtensionDataRef'; import { ExtensionInput } from './createExtensionInput'; -import { z } from 'zod'; +import type { z } from 'zod'; import { createSchemaFromZod } from '../schema/createSchemaFromZod'; import { OpaqueExtensionDefinition } from '@internal/frontend'; import { ExtensionDataContainer } from './types'; diff --git a/packages/frontend-plugin-api/src/wiring/createExtensionBlueprint.ts b/packages/frontend-plugin-api/src/wiring/createExtensionBlueprint.ts index 70b6209ae3..a7537d27e9 100644 --- a/packages/frontend-plugin-api/src/wiring/createExtensionBlueprint.ts +++ b/packages/frontend-plugin-api/src/wiring/createExtensionBlueprint.ts @@ -26,7 +26,7 @@ import { ctxParamsSymbol, VerifyExtensionAttachTo, } from './createExtension'; -import { z } from 'zod'; +import type { z } from 'zod'; import { ExtensionInput } from './createExtensionInput'; import { ExtensionDataRef, ExtensionDataValue } from './createExtensionDataRef'; import { createExtensionDataContainer } from '@internal/frontend'; @@ -249,8 +249,8 @@ export interface ExtensionBlueprint< }, UFactoryOutput extends ExtensionDataValue, UNewOutput extends ExtensionDataRef, - TExtraInputs extends { [inputName in string]: ExtensionInput }, UParentInputs extends ExtensionDataRef, + TExtraInputs extends { [inputName in string]: ExtensionInput } = {}, >(args: { name?: TName; attachTo?: ExtensionDefinitionAttachTo & @@ -304,26 +304,30 @@ export interface ExtensionBlueprint< UFactoryOutput >; }): OverridableExtensionDefinition<{ - config: (string extends keyof TExtensionConfigSchema - ? {} - : { - [key in keyof TExtensionConfigSchema]: z.infer< - ReturnType - >; - }) & - T['config']; - configInput: (string extends keyof TExtensionConfigSchema - ? {} - : z.input< - z.ZodObject<{ - [key in keyof TExtensionConfigSchema]: ReturnType< - TExtensionConfigSchema[key] + config: Expand< + (string extends keyof TExtensionConfigSchema + ? {} + : { + [key in keyof TExtensionConfigSchema]: z.infer< + ReturnType >; - }> - >) & - T['configInput']; + }) & + T['config'] + >; + configInput: Expand< + (string extends keyof TExtensionConfigSchema + ? {} + : z.input< + z.ZodObject<{ + [key in keyof TExtensionConfigSchema]: ReturnType< + TExtensionConfigSchema[key] + >; + }> + >) & + T['configInput'] + >; output: ExtensionDataRef extends UNewOutput ? T['output'] : UNewOutput; - inputs: T['inputs'] & TExtraInputs; + inputs: Expand; kind: T['kind']; name: string | undefined extends TName ? undefined : TName; params: T['params']; diff --git a/packages/integration-react/report.api.md b/packages/integration-react/report.api.md index 78da2eb5fa..0974c4821a 100644 --- a/packages/integration-react/report.api.md +++ b/packages/integration-react/report.api.md @@ -3,17 +3,17 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { ApiFactory } from '@backstage/core-plugin-api'; +import { ApiFactory } from '@backstage/frontend-plugin-api'; import { ApiRef } from '@backstage/core-plugin-api'; import { AuthRequestOptions } from '@backstage/core-plugin-api'; -import { BackstageIdentityApi } from '@backstage/core-plugin-api'; +import { BackstageIdentityApi } from '@backstage/frontend-plugin-api'; import { Config } from '@backstage/config'; import { JSX as JSX_2 } from 'react/jsx-runtime'; import { OAuthApi } from '@backstage/core-plugin-api'; -import { OpenIdConnectApi } from '@backstage/core-plugin-api'; -import { ProfileInfoApi } from '@backstage/core-plugin-api'; +import { OpenIdConnectApi } from '@backstage/frontend-plugin-api'; +import { ProfileInfoApi } from '@backstage/frontend-plugin-api'; import { ScmIntegrationRegistry } from '@backstage/integration'; -import { SessionApi } from '@backstage/core-plugin-api'; +import { SessionApi } from '@backstage/frontend-plugin-api'; // @public export class ScmAuth implements ScmAuthApi { diff --git a/packages/integration/CHANGELOG.md b/packages/integration/CHANGELOG.md index a45b3d9770..3e412d5d88 100644 --- a/packages/integration/CHANGELOG.md +++ b/packages/integration/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/integration +## 1.18.3-next.1 + +### Patch Changes + +- fb029b6: Updated luxon types +- Updated dependencies + - @backstage/config@1.3.6 + - @backstage/errors@1.2.7 + ## 1.18.3-next.0 ### Patch Changes diff --git a/packages/integration/config.d.ts b/packages/integration/config.d.ts index a601d63472..a49c4cc0d6 100644 --- a/packages/integration/config.d.ts +++ b/packages/integration/config.d.ts @@ -330,6 +330,10 @@ export interface Config { * https://docs.github.com/en/rest/reference/apps#list-installations-for-the-authenticated-app--code-samples */ allowedInstallationOwners?: string[]; + /** + * If true, then an installation token will be issued for access when no other token is available. + */ + publicAccess?: boolean; }>; }>; diff --git a/packages/integration/package.json b/packages/integration/package.json index 3294a70dc5..f984c2b249 100644 --- a/packages/integration/package.json +++ b/packages/integration/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/integration", - "version": "1.18.3-next.0", + "version": "1.18.3-next.1", "description": "Helpers for managing integrations towards external systems", "backstage": { "role": "common-library" @@ -51,7 +51,6 @@ "devDependencies": { "@backstage/cli": "workspace:^", "@backstage/config-loader": "workspace:^", - "@types/luxon": "^3.0.0", "msw": "^1.0.0" }, "configSchema": "config.d.ts" diff --git a/packages/integration/report.api.md b/packages/integration/report.api.md index f642058ccd..d065f441f0 100644 --- a/packages/integration/report.api.md +++ b/packages/integration/report.api.md @@ -665,6 +665,7 @@ export type GithubAppConfig = { clientId: string; clientSecret: string; allowedInstallationOwners?: string[]; + publicAccess?: boolean; }; // @public diff --git a/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.test.ts b/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.test.ts index 0468e96e14..fefccf22f6 100644 --- a/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.test.ts +++ b/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.test.ts @@ -563,4 +563,330 @@ describe('SingleInstanceGithubCredentialsProvider tests', () => { 2, ); }); + + describe('public access', () => { + it('should use an installation token when public access is enabled and owner is not in allowed list', async () => { + const githubProvider = SingleInstanceGithubCredentialsProvider.create({ + host: 'github.com', + apps: [ + { + appId: 1, + privateKey: 'privateKey', + webhookSecret: '123', + clientId: 'CLIENT_ID', + clientSecret: 'CLIENT_SECRET', + allowedInstallationOwners: ['other-org'], + publicAccess: true, + }, + ], + }); + + octokit.apps.listInstallations.mockResolvedValue({ + headers: { + etag: '123', + }, + data: [ + { + id: 1, + repository_selection: 'all', + account: { + login: 'other-org', + }, + }, + ], + } as RestEndpointMethodTypes['apps']['listInstallations']['response']); + + octokit.apps.createInstallationAccessToken.mockResolvedValueOnce({ + data: { + expires_at: DateTime.local().plus({ hours: 1 }).toString(), + token: 'public_access_token', + }, + } as RestEndpointMethodTypes['apps']['createInstallationAccessToken']['response']); + + const { token, headers, type } = await githubProvider.getCredentials({ + url: 'https://github.com/some-public-org/some-repo', + }); + + expect(type).toEqual('app'); + expect(token).toEqual('public_access_token'); + expect(headers).toEqual({ Authorization: 'Bearer public_access_token' }); + }); + + it('should use an installation token when public access is enabled and no installation exists for owner', async () => { + const githubProvider = SingleInstanceGithubCredentialsProvider.create({ + host: 'github.com', + apps: [ + { + appId: 1, + privateKey: 'privateKey', + webhookSecret: '123', + clientId: 'CLIENT_ID', + clientSecret: 'CLIENT_SECRET', + publicAccess: true, + }, + ], + }); + + octokit.apps.listInstallations.mockResolvedValue({ + headers: { + etag: '123', + }, + data: [ + { + id: 42, + repository_selection: 'all', + account: { + login: 'installed-org', + }, + }, + ], + } as RestEndpointMethodTypes['apps']['listInstallations']['response']); + + octokit.apps.createInstallationAccessToken.mockResolvedValueOnce({ + data: { + expires_at: DateTime.local().plus({ hours: 1 }).toString(), + token: 'public_installation_token', + }, + } as RestEndpointMethodTypes['apps']['createInstallationAccessToken']['response']); + + const { token, headers, type } = await githubProvider.getCredentials({ + url: 'https://github.com/non-installed-org/some-repo', + }); + + expect(type).toEqual('app'); + expect(token).toEqual('public_installation_token'); + expect(headers).toEqual({ + Authorization: 'Bearer public_installation_token', + }); + }); + + it('should not use public access when normal installation credentials are available', async () => { + const githubProvider = SingleInstanceGithubCredentialsProvider.create({ + host: 'github.com', + apps: [ + { + appId: 1, + privateKey: 'privateKey', + webhookSecret: '123', + clientId: 'CLIENT_ID', + clientSecret: 'CLIENT_SECRET', + publicAccess: true, + }, + ], + }); + + octokit.apps.listInstallations.mockResolvedValue({ + headers: { + etag: '123', + }, + data: [ + { + id: 1, + repository_selection: 'all', + account: { + login: 'backstage', + }, + }, + ], + } as RestEndpointMethodTypes['apps']['listInstallations']['response']); + + octokit.apps.createInstallationAccessToken.mockResolvedValueOnce({ + data: { + expires_at: DateTime.local().plus({ hours: 1 }).toString(), + token: 'normal_token', + }, + } as RestEndpointMethodTypes['apps']['createInstallationAccessToken']['response']); + + const { token, type } = await githubProvider.getCredentials({ + url: 'https://github.com/backstage/repo', + }); + + expect(type).toEqual('app'); + expect(token).toEqual('normal_token'); + // createInstallationAccessToken should only be called once for the normal flow + expect(octokit.apps.createInstallationAccessToken).toHaveBeenCalledTimes( + 1, + ); + }); + + it('should fall back to configured token when public access fails', async () => { + const githubProvider = SingleInstanceGithubCredentialsProvider.create({ + host: 'github.com', + apps: [ + { + appId: 1, + privateKey: 'privateKey', + webhookSecret: '123', + clientId: 'CLIENT_ID', + clientSecret: 'CLIENT_SECRET', + allowedInstallationOwners: ['other-org'], + publicAccess: true, + }, + ], + token: 'fallback_token', + }); + + octokit.apps.listInstallations.mockResolvedValue({ + headers: { + etag: '123', + }, + data: [], + } as unknown as RestEndpointMethodTypes['apps']['listInstallations']['response']); + + const { token, type } = await githubProvider.getCredentials({ + url: 'https://github.com/some-org/repo', + }); + + expect(type).toEqual('token'); + expect(token).toEqual('fallback_token'); + }); + + it('should return undefined when public access is disabled and no installation exists', async () => { + const githubProvider = SingleInstanceGithubCredentialsProvider.create({ + host: 'github.com', + apps: [ + { + appId: 1, + privateKey: 'privateKey', + webhookSecret: '123', + clientId: 'CLIENT_ID', + clientSecret: 'CLIENT_SECRET', + allowedInstallationOwners: ['other-org'], + // publicAccess is not set (defaults to false) + }, + ], + }); + + octokit.apps.listInstallations.mockResolvedValue({ + headers: { + etag: '123', + }, + data: [ + { + id: 1, + repository_selection: 'all', + account: { + login: 'other-org', + }, + }, + ], + } as RestEndpointMethodTypes['apps']['listInstallations']['response']); + + const { token, headers } = await githubProvider.getCredentials({ + url: 'https://github.com/some-org/repo', + }); + + expect(token).toBeUndefined(); + expect(headers).toBeUndefined(); + }); + + it('should cache public access tokens separately from regular tokens', async () => { + const githubProvider = SingleInstanceGithubCredentialsProvider.create({ + host: 'github.com', + apps: [ + { + appId: 1, + privateKey: 'privateKey', + webhookSecret: '123', + clientId: 'CLIENT_ID', + clientSecret: 'CLIENT_SECRET', + allowedInstallationOwners: ['installed-org'], + publicAccess: true, + }, + ], + }); + + octokit.apps.listInstallations.mockResolvedValue({ + headers: { + etag: '123', + }, + data: [ + { + id: 1, + repository_selection: 'all', + account: { + login: 'installed-org', + }, + }, + ], + } as RestEndpointMethodTypes['apps']['listInstallations']['response']); + + octokit.apps.createInstallationAccessToken.mockResolvedValue({ + data: { + expires_at: DateTime.local().plus({ hours: 1 }).toString(), + token: 'public_token', + }, + } as RestEndpointMethodTypes['apps']['createInstallationAccessToken']['response']); + + // First call for a public org + await githubProvider.getCredentials({ + url: 'https://github.com/public-org/repo', + }); + + // Second call for the same public org should use cached token + await githubProvider.getCredentials({ + url: 'https://github.com/public-org/repo', + }); + + // createInstallationAccessToken should only be called once due to caching + expect(octokit.apps.createInstallationAccessToken).toHaveBeenCalledTimes( + 1, + ); + }); + + it('should use public access with multiple apps when only one has publicAccess enabled', async () => { + const githubProvider = SingleInstanceGithubCredentialsProvider.create({ + host: 'github.com', + apps: [ + { + appId: 1, + privateKey: 'privateKey', + webhookSecret: '123', + clientId: 'CLIENT_ID', + clientSecret: 'CLIENT_SECRET', + allowedInstallationOwners: ['org-1'], + // publicAccess not set, defaults to false + }, + { + appId: 2, + privateKey: 'privateKey2', + webhookSecret: '456', + clientId: 'CLIENT_ID_2', + clientSecret: 'CLIENT_SECRET_2', + allowedInstallationOwners: ['org-2'], + publicAccess: true, + }, + ], + }); + + octokit.apps.listInstallations.mockResolvedValue({ + headers: { + etag: '123', + }, + data: [ + { + id: 1, + repository_selection: 'all', + account: { + login: 'org-2', + }, + }, + ], + } as RestEndpointMethodTypes['apps']['listInstallations']['response']); + + octokit.apps.createInstallationAccessToken.mockResolvedValueOnce({ + data: { + expires_at: DateTime.local().plus({ hours: 1 }).toString(), + token: 'public_access_from_app_2', + }, + } as RestEndpointMethodTypes['apps']['createInstallationAccessToken']['response']); + + const { token, type } = await githubProvider.getCredentials({ + url: 'https://github.com/unknown-org/repo', + }); + + expect(type).toEqual('app'); + expect(token).toEqual('public_access_from_app_2'); + }); + }); }); diff --git a/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts b/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts index d2c1e37a65..40d166b223 100644 --- a/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts +++ b/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts @@ -100,6 +100,7 @@ class GithubAppManager { private readonly baseAuthConfig: { appId: number; privateKey: string }; private readonly cache = new Cache(); private readonly allowedInstallationOwners: string[] | undefined; // undefined allows all installations + public readonly publicAccess: boolean; constructor(config: GithubAppConfig, baseUrl?: string) { this.allowedInstallationOwners = config.allowedInstallationOwners?.map( @@ -116,6 +117,7 @@ class GithubAppManager { authStrategy: createAppAuth, auth: this.baseAuthConfig, }); + this.publicAccess = config.publicAccess ?? false; } async getInstallationCredentials( @@ -170,6 +172,30 @@ class GithubAppManager { }); } + async getPublicInstallationToken(): Promise<{ accessToken: string }> { + const [installation] = await this.getInstallations(); + + if (!installation) { + throw new Error(`No installation found for public app`); + } + + return this.cache.getOrCreateToken( + `public:${installation.id}`, + undefined, + async () => { + const result = await this.appClient.apps.createInstallationAccessToken({ + installation_id: installation.id, + headers: HEADERS, + }); + + return { + token: result.data.token, + expiresAt: DateTime.fromISO(result.data.expires_at), + }; + }, + ); + } + getInstallations(): Promise< RestEndpointMethodTypes['apps']['listInstallations']['response']['data'] > { @@ -185,12 +211,14 @@ class GithubAppManager { inst.account.login?.toLocaleLowerCase('en-US') === owner.toLocaleLowerCase('en-US'), ); + if (installation) { return { installationId: installation.id, suspended: Boolean(installation.suspended_by), }; } + const notFoundError = new Error( `No app installation found for ${owner} in ${this.baseAuthConfig.appId}`, ); @@ -245,10 +273,26 @@ export class GithubAppCredentialsMux { const result = results.find( resultItem => resultItem.credentials?.accessToken, ); + if (result) { return result.credentials!.accessToken; } + // If there was no token returned, then let's find a public access app and use an installation to get a token. + const publicAccessApp = this.apps.find(app => app.publicAccess); + if (publicAccessApp) { + const publicResult = await publicAccessApp + .getPublicInstallationToken() + .then( + credentials => ({ credentials, error: undefined }), + error => ({ credentials: undefined, error }), + ); + + if (publicResult.credentials?.accessToken) { + return publicResult.credentials.accessToken; + } + } + const errors = results.map(r => r.error); const notNotFoundError = errors.find(err => err?.name !== 'NotFoundError'); if (notNotFoundError) { diff --git a/packages/integration/src/github/config.ts b/packages/integration/src/github/config.ts index 74a0267d62..f755b84c2a 100644 --- a/packages/integration/src/github/config.ts +++ b/packages/integration/src/github/config.ts @@ -109,6 +109,10 @@ export type GithubAppConfig = { * https://docs.github.com/en/rest/reference/apps#list-installations-for-the-authenticated-app--code-samples */ allowedInstallationOwners?: string[]; + /** + * If true, then an installation token will be issued for access when no other token is available. + */ + publicAccess?: boolean; }; /** @@ -133,6 +137,7 @@ export function readGithubIntegrationConfig( allowedInstallationOwners: c.getOptionalStringArray( 'allowedInstallationOwners', ), + publicAccess: c.getOptionalBoolean('publicAccess'), })); if (!isValidHost(host)) { diff --git a/packages/repo-tools/CHANGELOG.md b/packages/repo-tools/CHANGELOG.md index db451fee15..d9fe8257fe 100644 --- a/packages/repo-tools/CHANGELOG.md +++ b/packages/repo-tools/CHANGELOG.md @@ -1,5 +1,29 @@ # @backstage/repo-tools +## 0.16.1-next.2 + +### Patch Changes + +- 2bae83a: Bump `@microsoft/api-documenter` and `@microsoft/api-extractor` to latest versions. +- 2bae83a: Bumped dev dependencies `@types/node` +- Updated dependencies + - @backstage/backend-plugin-api@1.6.0-next.1 + - @backstage/config-loader@1.10.7-next.1 + - @backstage/cli-common@0.1.16-next.2 + - @backstage/catalog-model@1.7.6 + - @backstage/cli-node@0.2.16-next.1 + - @backstage/errors@1.2.7 + +## 0.16.1-next.1 + +### Patch Changes + +- 688f070: Updated to use new utilities from `@backstage/cli-common`. +- d1e38a7: Properly create workspace in OS temporary directory for `generate-patch` command +- Updated dependencies + - @backstage/cli-node@0.2.16-next.1 + - @backstage/cli-common@0.1.16-next.1 + ## 0.16.1-next.0 ### Patch Changes diff --git a/packages/repo-tools/package.json b/packages/repo-tools/package.json index 4de9c4459d..95e29cb3f6 100644 --- a/packages/repo-tools/package.json +++ b/packages/repo-tools/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/repo-tools", - "version": "0.16.1-next.0", + "version": "0.16.1-next.2", "description": "CLI for Backstage repo tooling ", "backstage": { "role": "cli" @@ -51,8 +51,8 @@ "@backstage/errors": "workspace:^", "@electric-sql/pglite": "^0.3.0", "@manypkg/get-packages": "^1.1.3", - "@microsoft/api-documenter": "^7.25.7", - "@microsoft/api-extractor": "^7.47.2", + "@microsoft/api-documenter": "^7.28.1", + "@microsoft/api-extractor": "^7.55.1", "@openapitools/openapi-generator-cli": "^2.7.0", "@stoplight/spectral-core": "^1.18.0", "@stoplight/spectral-formatters": "^1.1.0", @@ -90,7 +90,7 @@ "@backstage/cli": "workspace:^", "@backstage/types": "workspace:^", "@types/is-glob": "^4.0.2", - "@types/node": "^20.16.0", + "@types/node": "^22.13.14", "@types/prettier": "^2.0.0", "typedoc": "^0.28.0" }, diff --git a/packages/repo-tools/src/commands/api-reports/api-reports/generateTypeDeclarations.ts b/packages/repo-tools/src/commands/api-reports/api-reports/generateTypeDeclarations.ts index d7304553c0..a51c9ed17b 100644 --- a/packages/repo-tools/src/commands/api-reports/api-reports/generateTypeDeclarations.ts +++ b/packages/repo-tools/src/commands/api-reports/api-reports/generateTypeDeclarations.ts @@ -15,7 +15,7 @@ */ import fs from 'fs-extra'; -import { spawnSync } from 'child_process'; +import { run, ExitCodeError } from '@backstage/cli-common'; import { paths as cliPaths } from '../../../lib/paths'; /** @@ -30,21 +30,26 @@ import { paths as cliPaths } from '../../../lib/paths'; */ export async function generateTypeDeclarations(tsconfigFilePath: string) { await fs.remove(cliPaths.resolveTargetRoot('dist-types')); - const { status } = spawnSync( - 'yarn', - [ - 'tsc', - ['--project', tsconfigFilePath], - ['--skipLibCheck', 'false'], - ['--incremental', 'false'], - ].flat(), - { - stdio: 'inherit', - shell: true, - cwd: cliPaths.targetRoot, - }, - ); - if (status !== 0) { - process.exit(status || undefined); + try { + await run( + [ + 'yarn', + 'tsc', + '--project', + tsconfigFilePath, + '--skipLibCheck', + 'false', + '--incremental', + 'false', + ], + { + cwd: cliPaths.targetRoot, + }, + ).waitForExit(); + } catch (error) { + if (error instanceof ExitCodeError) { + process.exit(error.code); + } + throw error; } } diff --git a/packages/repo-tools/src/commands/generate-patch/generate-patch.ts b/packages/repo-tools/src/commands/generate-patch/generate-patch.ts index 10b31e0584..90cbe7f322 100644 --- a/packages/repo-tools/src/commands/generate-patch/generate-patch.ts +++ b/packages/repo-tools/src/commands/generate-patch/generate-patch.ts @@ -98,7 +98,9 @@ export default async ( throw new Error(`Could not find package ${packageArg} in source repo`); } - const tmpDir = await fs.mkdtemp(os.tmpdir()); + const tmpDir = await fs.mkdtemp( + joinPath(os.tmpdir(), 'backstage-repo-tools-generate-patch-'), + ); const ctx: PatchContext = { sourceRepo, targetRepo, diff --git a/packages/techdocs-cli-embedded-app/CHANGELOG.md b/packages/techdocs-cli-embedded-app/CHANGELOG.md index eb81d1d132..63fe804a80 100644 --- a/packages/techdocs-cli-embedded-app/CHANGELOG.md +++ b/packages/techdocs-cli-embedded-app/CHANGELOG.md @@ -1,5 +1,35 @@ # techdocs-cli-embedded-app +## 0.2.115-next.2 + +### Patch Changes + +- Updated dependencies + - @backstage/core-app-api@1.19.3-next.1 + - @backstage/cli@0.35.0-next.2 + - @backstage/plugin-techdocs@1.16.1-next.2 + - @backstage/plugin-catalog@1.32.1-next.1 + - @backstage/core-components@0.18.4-next.2 + - @backstage/app-defaults@1.7.3-next.0 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + - @backstage/core-plugin-api@1.12.1-next.0 + - @backstage/integration-react@1.2.13-next.0 + - @backstage/test-utils@1.7.14-next.0 + - @backstage/theme@0.7.1-next.0 + - @backstage/ui@0.10.0-next.1 + - @backstage/plugin-techdocs-react@1.3.6-next.0 + +## 0.2.115-next.1 + +### Patch Changes + +- Updated dependencies + - @backstage/ui@0.10.0-next.1 + - @backstage/core-components@0.18.4-next.1 + - @backstage/cli@0.34.6-next.1 + - @backstage/plugin-techdocs@1.16.1-next.1 + ## 0.2.115-next.0 ### Patch Changes diff --git a/packages/techdocs-cli-embedded-app/package.json b/packages/techdocs-cli-embedded-app/package.json index deec921041..b0018e634f 100644 --- a/packages/techdocs-cli-embedded-app/package.json +++ b/packages/techdocs-cli-embedded-app/package.json @@ -1,6 +1,6 @@ { "name": "techdocs-cli-embedded-app", - "version": "0.2.115-next.0", + "version": "0.2.115-next.2", "backstage": { "role": "frontend" }, diff --git a/packages/techdocs-cli/CHANGELOG.md b/packages/techdocs-cli/CHANGELOG.md index e8d5065f9a..32d6ad189e 100644 --- a/packages/techdocs-cli/CHANGELOG.md +++ b/packages/techdocs-cli/CHANGELOG.md @@ -1,5 +1,25 @@ # @techdocs/cli +## 1.10.3-next.2 + +### Patch Changes + +- 2bae83a: Bumped dev dependencies `@types/node` +- Updated dependencies + - @backstage/backend-defaults@0.14.0-next.1 + - @backstage/plugin-techdocs-node@1.13.10-next.1 + - @backstage/cli-common@0.1.16-next.2 + - @backstage/catalog-model@1.7.6 + - @backstage/config@1.3.6 + +## 1.10.3-next.1 + +### Patch Changes + +- 43629b1: Updated to use new utilities from `@backstage/cli-common`. +- Updated dependencies + - @backstage/cli-common@0.1.16-next.1 + ## 1.10.3-next.0 ### Patch Changes diff --git a/packages/techdocs-cli/package.json b/packages/techdocs-cli/package.json index 774969edb3..fae5187156 100644 --- a/packages/techdocs-cli/package.json +++ b/packages/techdocs-cli/package.json @@ -1,6 +1,6 @@ { "name": "@techdocs/cli", - "version": "1.10.3-next.0", + "version": "1.10.3-next.2", "description": "Utility CLI for managing TechDocs sites in Backstage.", "backstage": { "role": "cli" @@ -62,7 +62,7 @@ "@types/commander": "^2.12.2", "@types/fs-extra": "^11.0.0", "@types/http-proxy": "^1.17.4", - "@types/node": "^20.16.0", + "@types/node": "^22.13.14", "@types/serve-handler": "^6.1.0", "@types/webpack-env": "^1.15.3", "find-process": "^1.4.5", diff --git a/packages/techdocs-cli/src/commands/serve/mkdocs.ts b/packages/techdocs-cli/src/commands/serve/mkdocs.ts index 00c5e5f0ed..cd1072a88f 100644 --- a/packages/techdocs-cli/src/commands/serve/mkdocs.ts +++ b/packages/techdocs-cli/src/commands/serve/mkdocs.ts @@ -18,7 +18,7 @@ import { OptionValues } from 'commander'; import openBrowser from 'react-dev-utils/openBrowser'; import { createLogger } from '../../lib/utility'; import { runMkdocsServer } from '../../lib/mkdocsServer'; -import { LogFunc, waitForSignal } from '../../lib/run'; +import { RunOnOutput } from '@backstage/cli-common'; import { getMkdocsYml } from '@backstage/plugin-techdocs-node'; import fs from 'fs-extra'; import { checkIfDockerIsOperational } from './utils'; @@ -45,7 +45,7 @@ export default async function serveMkdocs(opts: OptionValues) { // We want to open browser only once based on a log. let boolOpenBrowserTriggered = false; - const logFunc: LogFunc = data => { + const logFunc: RunOnOutput = data => { // Sometimes the lines contain an unnecessary extra new line in between const logLines = data.toString().split('\n'); const logPrefix = opts.docker ? '[docker/mkdocs]' : '[mkdocs]'; @@ -74,18 +74,18 @@ export default async function serveMkdocs(opts: OptionValues) { // Had me questioning this whole implementation for half an hour. // Commander stores --no-docker in cmd.docker variable - const childProcess = await runMkdocsServer({ + const childProcess = runMkdocsServer({ port: opts.port, dockerImage: opts.dockerImage, dockerEntrypoint: opts.dockerEntrypoint, dockerOptions: opts.dockerOption, useDocker: opts.docker, - stdoutLogFunc: logFunc, - stderrLogFunc: logFunc, + onStdout: logFunc, + onStderr: logFunc, }); // Keep waiting for user to cancel the process - await waitForSignal([childProcess]); + await childProcess.waitForExit(); if (configIsTemporary) { process.on('exit', async () => { diff --git a/packages/techdocs-cli/src/commands/serve/serve.ts b/packages/techdocs-cli/src/commands/serve/serve.ts index 27f432c22d..a0d0030c6b 100644 --- a/packages/techdocs-cli/src/commands/serve/serve.ts +++ b/packages/techdocs-cli/src/commands/serve/serve.ts @@ -17,10 +17,9 @@ import { OptionValues } from 'commander'; import path from 'path'; import openBrowser from 'react-dev-utils/openBrowser'; -import { findPaths } from '@backstage/cli-common'; +import { findPaths, RunOnOutput } from '@backstage/cli-common'; import HTTPServer from '../../lib/httpServer'; import { runMkdocsServer } from '../../lib/mkdocsServer'; -import { LogFunc, waitForSignal } from '../../lib/run'; import { createLogger } from '../../lib/utility'; import { getMkdocsYml } from '@backstage/plugin-techdocs-node'; import fs from 'fs-extra'; @@ -83,7 +82,7 @@ export default async function serve(opts: OptionValues) { } let mkdocsServerHasStarted = false; - const mkdocsLogFunc: LogFunc = data => { + const mkdocsLogFunc: RunOnOutput = data => { // Sometimes the lines contain an unnecessary extra new line const logLines = data.toString().split('\n'); const logPrefix = opts.docker ? '[docker/mkdocs]' : '[mkdocs]'; @@ -107,14 +106,14 @@ export default async function serve(opts: OptionValues) { // https://github.com/mkdocs/mkdocs/issues/879#issuecomment-203536006 // Had me questioning this whole implementation for half an hour. logger.info('Starting mkdocs server.'); - const mkdocsChildProcess = await runMkdocsServer({ + const mkdocsChildProcess = runMkdocsServer({ port: opts.mkdocsPort, dockerImage: opts.dockerImage, dockerEntrypoint: opts.dockerEntrypoint, dockerOptions: opts.dockerOption, useDocker: opts.docker, - stdoutLogFunc: mkdocsLogFunc, - stderrLogFunc: mkdocsLogFunc, + onStdout: mkdocsLogFunc, + onStderr: mkdocsLogFunc, mkdocsConfigFileName: mkdocsYmlPath, mkdocsParameterClean: opts.mkdocsParameterClean, mkdocsParameterDirtyReload: opts.mkdocsParameterDirtyreload, @@ -161,7 +160,7 @@ export default async function serve(opts: OptionValues) { ); }); - await waitForSignal([mkdocsChildProcess]); + await mkdocsChildProcess.waitForExit(); if (configIsTemporary) { process.on('exit', async () => { diff --git a/packages/techdocs-cli/src/commands/serve/utils.ts b/packages/techdocs-cli/src/commands/serve/utils.ts index 2b19b0fbc0..9ecb8bc29b 100644 --- a/packages/techdocs-cli/src/commands/serve/utils.ts +++ b/packages/techdocs-cli/src/commands/serve/utils.ts @@ -14,25 +14,22 @@ * limitations under the License. */ -import { promisify } from 'util'; import * as winston from 'winston'; -import { execFile } from 'child_process'; +import { runCheck } from '@backstage/cli-common'; export async function checkIfDockerIsOperational( logger: winston.Logger, ): Promise { logger.info('Checking Docker status...'); - try { - const runCheck = promisify(execFile); - await runCheck('docker', ['info'], { shell: true }); + const isOperational = await runCheck(['docker', 'info']); + if (isOperational) { logger.info( 'Docker is up and running. Proceed to starting up mkdocs server', ); return true; - } catch { - logger.error( - 'Docker is not running. Exiting. Please check status of Docker daemon with `docker info` before re-running', - ); - return false; } + logger.error( + 'Docker is not running. Exiting. Please check status of Docker daemon with `docker info` before re-running', + ); + return false; } diff --git a/packages/techdocs-cli/src/lib/mkdocsServer.test.ts b/packages/techdocs-cli/src/lib/mkdocsServer.test.ts index 83f9c9f382..5acd1784a3 100644 --- a/packages/techdocs-cli/src/lib/mkdocsServer.test.ts +++ b/packages/techdocs-cli/src/lib/mkdocsServer.test.ts @@ -15,9 +15,9 @@ */ import { runMkdocsServer } from './mkdocsServer'; -import { run } from './run'; +import { run } from '@backstage/cli-common'; -jest.mock('./run', () => { +jest.mock('@backstage/cli-common', () => { return { run: jest.fn(), }; @@ -29,12 +29,12 @@ describe('runMkdocsServer', () => { }); describe('docker', () => { - it('should run docker directly by default', async () => { - await runMkdocsServer({}); + it('should run docker directly by default', () => { + runMkdocsServer({}); expect(run).toHaveBeenCalledWith( - 'docker', expect.arrayContaining([ + 'docker', 'run', `${process.cwd()}:/content`, '8000:8000', @@ -47,26 +47,24 @@ describe('runMkdocsServer', () => { ); }); - it('should accept port option', async () => { - await runMkdocsServer({ port: '5678' }); + it('should accept port option', () => { + runMkdocsServer({ port: '5678' }); expect(run).toHaveBeenCalledWith( - 'docker', - expect.arrayContaining(['5678:5678', '0.0.0.0:5678']), + expect.arrayContaining(['docker', '5678:5678', '0.0.0.0:5678']), expect.objectContaining({}), ); }); - it('should accept custom docker image', async () => { - await runMkdocsServer({ dockerImage: 'my-org/techdocs' }); + it('should accept custom docker image', () => { + runMkdocsServer({ dockerImage: 'my-org/techdocs' }); expect(run).toHaveBeenCalledWith( - 'docker', - expect.arrayContaining(['my-org/techdocs']), + expect.arrayContaining(['docker', 'my-org/techdocs']), expect.objectContaining({}), ); }); - it('should accept custom docker options', async () => { - await runMkdocsServer({ + it('should accept custom docker options', () => { + runMkdocsServer({ dockerOptions: [ '--add-host=internal.host:192.168.11.12', '--name', @@ -75,8 +73,8 @@ describe('runMkdocsServer', () => { }); expect(run).toHaveBeenCalledWith( - 'docker', expect.arrayContaining([ + 'docker', 'run', '--rm', '-w', @@ -98,14 +96,14 @@ describe('runMkdocsServer', () => { ); }); - it('should accept additinoal mkdocs CLI parameters', async () => { - await runMkdocsServer({ + it('should accept additinoal mkdocs CLI parameters', () => { + runMkdocsServer({ mkdocsParameterClean: true, mkdocsParameterStrict: true, }); expect(run).toHaveBeenCalledWith( - 'docker', expect.arrayContaining([ + 'docker', 'serve', '--dev-addr', '0.0.0.0:8000', @@ -118,21 +116,24 @@ describe('runMkdocsServer', () => { }); describe('mkdocs', () => { - it('should run mkdocs if specified', async () => { - await runMkdocsServer({ useDocker: false }); + it('should run mkdocs if specified', () => { + runMkdocsServer({ useDocker: false }); expect(run).toHaveBeenCalledWith( - 'mkdocs', - expect.arrayContaining(['serve', '--dev-addr', '127.0.0.1:8000']), + expect.arrayContaining([ + 'mkdocs', + 'serve', + '--dev-addr', + '127.0.0.1:8000', + ]), expect.objectContaining({}), ); }); - it('should accept port option', async () => { - await runMkdocsServer({ useDocker: false, port: '5678' }); + it('should accept port option', () => { + runMkdocsServer({ useDocker: false, port: '5678' }); expect(run).toHaveBeenCalledWith( - 'mkdocs', - expect.arrayContaining(['127.0.0.1:5678']), + expect.arrayContaining(['mkdocs', '127.0.0.1:5678']), expect.objectContaining({}), ); }); diff --git a/packages/techdocs-cli/src/lib/mkdocsServer.ts b/packages/techdocs-cli/src/lib/mkdocsServer.ts index a793643367..c557015256 100644 --- a/packages/techdocs-cli/src/lib/mkdocsServer.ts +++ b/packages/techdocs-cli/src/lib/mkdocsServer.ts @@ -14,30 +14,29 @@ * limitations under the License. */ -import { ChildProcess } from 'child_process'; -import { run, LogFunc } from './run'; +import { run, RunChildProcess, RunOnOutput } from '@backstage/cli-common'; -export const runMkdocsServer = async (options: { +export const runMkdocsServer = (options: { port?: string; useDocker?: boolean; dockerImage?: string; dockerEntrypoint?: string; dockerOptions?: string[]; - stdoutLogFunc?: LogFunc; - stderrLogFunc?: LogFunc; + onStdout?: RunOnOutput; + onStderr?: RunOnOutput; mkdocsConfigFileName?: string; mkdocsParameterClean?: boolean; mkdocsParameterDirtyReload?: boolean; mkdocsParameterStrict?: boolean; -}): Promise => { +}): RunChildProcess => { const port = options.port ?? '8000'; const useDocker = options.useDocker ?? true; const dockerImage = options.dockerImage ?? 'spotify/techdocs'; if (useDocker) { - return await run( - 'docker', + return run( [ + 'docker', 'run', '--rm', '-w', @@ -63,15 +62,15 @@ export const runMkdocsServer = async (options: { ...(options.mkdocsParameterStrict ? ['--strict'] : []), ], { - stdoutLogFunc: options.stdoutLogFunc, - stderrLogFunc: options.stderrLogFunc, + onStdout: options.onStdout, + onStderr: options.onStderr, }, ); } - return await run( - 'mkdocs', + return run( [ + 'mkdocs', 'serve', '--dev-addr', `127.0.0.1:${port}`, @@ -83,8 +82,8 @@ export const runMkdocsServer = async (options: { ...(options.mkdocsParameterStrict ? ['--strict'] : []), ], { - stdoutLogFunc: options.stdoutLogFunc, - stderrLogFunc: options.stderrLogFunc, + onStdout: options.onStdout, + onStderr: options.onStderr, }, ); }; diff --git a/packages/techdocs-cli/src/lib/run.ts b/packages/techdocs-cli/src/lib/run.ts deleted file mode 100644 index 13ac7d9d4c..0000000000 --- a/packages/techdocs-cli/src/lib/run.ts +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2020 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { spawn, SpawnOptions, ChildProcess } from 'child_process'; - -export type LogFunc = (data: Buffer | string) => void; -type SpawnOptionsPartialEnv = Omit & { - env?: Partial; - // Pipe stdout to this log function - stdoutLogFunc?: LogFunc; - // Pipe stderr to this log function - stderrLogFunc?: LogFunc; -}; - -// TODO: Accept log functions to pipe logs with. -// Runs a child command, returning the child process instance. -// Use it along with waitForSignal to run a long running process e.g. mkdocs serve -export const run = async ( - name: string, - args: string[] = [], - options: SpawnOptionsPartialEnv = {}, -): Promise => { - const { stdoutLogFunc, stderrLogFunc } = options; - - const env: NodeJS.ProcessEnv = { - ...process.env, - FORCE_COLOR: 'true', - ...(options.env ?? {}), - }; - - // Refer: https://nodejs.org/api/child_process.html#child_process_subprocess_stdio - const stdio = [ - 'inherit', - stdoutLogFunc ? 'pipe' : 'inherit', - stderrLogFunc ? 'pipe' : 'inherit', - ] as ('inherit' | 'pipe')[]; - - const childProcess = spawn(name, args, { - stdio: stdio, - ...options, - env, - }); - - if (stdoutLogFunc && childProcess.stdout) { - childProcess.stdout.on('data', stdoutLogFunc); - } - if (stderrLogFunc && childProcess.stderr) { - childProcess.stderr.on('data', stderrLogFunc); - } - - return childProcess; -}; - -// Block indefinitely and wait for a signal to stop the child process(es) -// Throw error if any child process errors -// Resolves only when all processes exit with status code 0 -export async function waitForSignal( - childProcesses: Array, -): Promise { - const promises: Array> = []; - - for (const signal of ['SIGINT', 'SIGTERM'] as const) { - process.on(signal, () => { - childProcesses.forEach(childProcess => { - childProcess.kill(); - }); - }); - } - - childProcesses.forEach(childProcess => { - if (typeof childProcess.exitCode === 'number') { - if (childProcess.exitCode) { - throw new Error(`Non zero exit code from child process`); - } - return; - } - - promises.push( - new Promise((resolve, reject) => { - childProcess.once('error', reject); - childProcess.once('exit', resolve); - }), - ); - }); - - await Promise.all(promises); -} diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index d4a1de4688..9f867ba2ed 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -1,5 +1,57 @@ # @backstage/ui +## 0.10.0-next.1 + +### Minor Changes + +- 16543fa: **Breaking change** The `Cell` component has been refactored to be a generic wrapper component that accepts `children` for custom cell content. The text-specific functionality (previously part of `Cell`) has been moved to a new `CellText` component. + + ### Migration Guide + + If you were using `Cell` with text-specific props (`title`, `description`, `leadingIcon`, `href`), you need to update your code to use `CellText` instead: + + **Before:** + + ```tsx + } + href="/path" + /> + ``` + + **After:** + + ```tsx + } + href="/path" + /> + ``` + + For custom cell content, use the new generic `Cell` component: + + ```tsx + {/* Your custom content */} + ``` + +### Patch Changes + +- 50b7927: Fixed Checkbox indicator showing checkmark color when unchecked. + + Affected components: Checkbox + +- 5bacf55: Fixed `ButtonIcon` incorrectly applying `className` to inner elements instead of only the root element. + + Affected components: ButtonIcon + +- a20d317: Added row selection support with visual state styling for hover, selected, and pressed states. Fixed checkbox rendering to only show for multi-select toggle mode. + + Affected components: Table, TableHeader, Row, Column + ## 0.9.1-next.0 ### Patch Changes diff --git a/packages/ui/package.json b/packages/ui/package.json index 1d5d6f945c..3ac6e991c8 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/ui", - "version": "0.9.1-next.0", + "version": "0.10.0-next.1", "backstage": { "role": "web-library" }, diff --git a/packages/ui/report.api.md b/packages/ui/report.api.md index 30910724eb..0a7e289d0a 100644 --- a/packages/ui/report.api.md +++ b/packages/ui/report.api.md @@ -406,7 +406,16 @@ export interface CellProfileProps extends CellProps_2 { } // @public (undocumented) -export interface CellProps extends CellProps_2 { +export interface CellProps extends CellProps_2 {} + +// @public (undocumented) +export const CellText: { + (props: CellTextProps): JSX_2.Element; + displayName: string; +}; + +// @public (undocumented) +export interface CellTextProps extends CellProps_2 { // (undocumented) color?: TextColors; // (undocumented) @@ -863,12 +872,16 @@ export const LinkDefinition: { // @public (undocumented) export interface LinkProps extends LinkProps_2 { + // (undocumented) + children?: ReactNode; // (undocumented) color?: | TextColors | TextColorStatus | Partial>; // (undocumented) + title?: string; + // (undocumented) truncate?: boolean; // (undocumented) variant?: TextVariants | Partial>; @@ -1265,6 +1278,8 @@ export const TableDefinition: { readonly cellProfileAvatarFallback: 'bui-TableCellProfileAvatarFallback'; readonly cellProfileName: 'bui-TableCellProfileName'; readonly cellProfileLink: 'bui-TableCellProfileLink'; + readonly headSelection: 'bui-TableHeadSelection'; + readonly cellSelection: 'bui-TableCellSelection'; }; }; diff --git a/packages/ui/src/components/ButtonIcon/ButtonIcon.tsx b/packages/ui/src/components/ButtonIcon/ButtonIcon.tsx index d3596da799..9bbeca9d5b 100644 --- a/packages/ui/src/components/ButtonIcon/ButtonIcon.tsx +++ b/packages/ui/src/components/ButtonIcon/ButtonIcon.tsx @@ -64,7 +64,6 @@ export const ButtonIcon = forwardRef( classNamesButtonIcon.content, stylesButton[classNames.content], stylesButtonIcon[classNamesButtonIcon.content], - className, )} > {icon} @@ -79,7 +78,6 @@ export const ButtonIcon = forwardRef( classNamesButtonIcon.spinner, stylesButton[classNames.spinner], stylesButtonIcon[classNamesButtonIcon.spinner], - className, )} >