867 Commits

Author SHA1 Message Date
Fredrik Adelöw 378784ebf0 fix: restore runtime dependencies incorrectly demoted to devDependencies
PR #33936 removed duplicate dependency entries, but in two cases moved
deps from dependencies to devDependencies that are still re-exported in
the published API reports:

- @backstage/catalog-client: @backstage/plugin-catalog-common
  (AnalyzeLocationRequest/AnalyzeLocationResponse types)
- @backstage/frontend-plugin-api: @backstage/config (Config type)

These need to be runtime dependencies so consumers can resolve the
types at build time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-27 14:51:28 +02:00
github-actions[bot] b97fcb0a93 Version Packages 2026-05-19 18:28:24 +00:00
Patrik Oldsberg 10e5d6f8aa Remove NavItemBlueprint in favor of page-based nav discovery
Drop the deprecated NavItemBlueprint from the public API and migrate core
plugins to set title and icon on PageBlueprint instead. AppNav keeps
backward compatibility for legacy nav-item extensions via an internal
core.nav-item.target data ref.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 11:00:46 +02:00
Andre Wanlin 2f33a9f63f Fixes for non-breaking typos and typos configuration
Signed-off-by: Andre Wanlin <awanlin@spotify.com>

More

Signed-off-by: Andre Wanlin <awanlin@spotify.com>
2026-04-29 16:54:05 -05:00
github-actions[bot] 7295193bb6 Version Packages (next) 2026-04-28 15:53:09 +00:00
Marat Dyatko ab1cdbb9db Fix circular self-imports and add no-self-package-imports lint rule
- Fixes the `Cannot access '_AppRootElementBlueprintesm' before
  initialization` crash in `@backstage/frontend-plugin-api` caused by a
  self-referential import in the packaged ESM.
- Cleans up similar self-imports in `@backstage/catalog-model`,
  `@backstage/core-plugin-api`, `@backstage/plugin-catalog-node`,
  `@backstage/plugin-kubernetes-common`, and
  `@backstage/plugin-kubernetes-node`. Value imports switch to relative
  paths; type-only imports use `import type` so they're erased at
  runtime.
- Adds a new `@backstage/no-self-package-imports` ESLint rule. It reads
  each package's `exports` map, traverses the relative import graph from
  every entry's source file, and only reports imports where the current
  file is in the same bundle as the target entry (same-entry). Files
  that aren't reachable from any entry (tests, scripts, orphans) are
  skipped. `import type`, `package.json` imports, and cross-entry
  self-imports are allowed by default; cross-entry can be opted into
  with `allowCrossEntry: false`.

Signed-off-by: Marat Dyatko <maratd@spotify.com>
Made-with: Cursor
2026-04-23 14:43:01 +02:00
github-actions[bot] 1cc86bee1c Version Packages (next) 2026-04-21 15:07:43 +00:00
Patrik Oldsberg d9264ed271 Merge pull request #33952 from backstage/rugvip/zod-v3-config-schema-docs
frontend-plugin-api: clarify that zod v3 does not support configSchema
2026-04-17 10:34:20 +02:00
Patrik Oldsberg a6bbb0ae2d Merge pull request #33930 from backstage/remove-portable-schema-deprecated-prop
frontend-plugin-api: remove deprecated PortableSchema .schema property
2026-04-16 21:51:39 +02:00
Patrik Oldsberg 8738203119 frontend-plugin-api: remove deprecated PortableSchema .schema property
Remove the deprecated property form of PortableSchema.schema, keeping
only the method form. The schema member is now a plain method that must
be called as schema() rather than accessed as a property.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-16 20:56:02 +02:00
Patrik Oldsberg 085133fde0 Bump zod dependency to v4 for packages using configSchema
These packages use `configSchema` with `zod/v4` imports and require the
full Zod v4 package for JSON Schema support. The dependency range is
narrowed from `^3.25.76 || ^4.0.0` to `^4.0.0`.

Also adds a `.patches` entry for the patch release.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-16 18:44:51 +02:00
Patrik Oldsberg 72a552f0db frontend-plugin-api: clarify that zod v3 /v4 subpath does not support configSchema
Update error messages, deprecation warnings, migration docs, release
notes, and changelogs to reflect that the zod/v4 subpath export from
the Zod v3 package does not support JSON Schema conversion via the
Standard Schema interface. Users must fully migrate to the zod v4
package (zod@^4.0.0) to use configSchema.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-16 17:23:54 +02:00
Fredrik Adelöw 8e7f7249e7 chore: regenerate knip reports
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
2026-04-16 12:14:47 +02:00
Hellgren Heikki cad156e797 fix: replace old config schemas for extensions and blueprints
to overcome a lot of warnings given during for example testing where
these extensions are used.

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
2026-04-15 12:55:27 +03:00
github-actions[bot] 93e643d142 Version Packages 2026-04-14 14:57:31 +00:00
Patrik Oldsberg d3627319a1 Merge pull request #33836 from backstage/rugvip/explore-standard-schema-decoupling
frontend-plugin-api: decouple zod dependency using Standard Schema
2026-04-14 12:27:53 +02:00
Patrik Oldsberg 8923d6def0 Drop Zod v3 support from new configSchema path
The new `configSchema` option now strictly requires StandardSchemaV1
values (e.g. Zod v4 or `zod/v4` from the Zod v3 package). Direct Zod
v3 schemas are no longer silently converted and will throw an error.

The deprecated `config.schema` callback path continues to work with
Zod v3 through a separate `createDeprecatedConfigSchema` function.

Also adds `createZodV4FilterPredicateSchema` to `@backstage/filter-predicates`
as a v4 counterpart to the now-deprecated v3 variant.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-13 21:38:28 +02:00
Patrik Oldsberg 4c09967317 Deduplicate frontend plugin/module extension collection logic (#33869)
Extract the shared extension resolution and duplicate-check logic from
createFrontendPlugin and createFrontendModule into a new
resolveExtensionDefinitions helper. Also fixes the duplicate extension
error message in createFrontendModule to say "Module" instead of
"Plugin".


Made-with: Cursor

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-04-13 13:58:59 +02:00
Patrik Oldsberg 25392cab00 Use StandardSchemaV1.InferOutput/InferInput utility types
Replace raw NonNullable<T['~standard']['types']>['output'] access
with the canonical StandardSchemaV1.InferOutput and InferInput
utility types for improved readability.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-12 19:17:39 +02:00
Patrik Oldsberg e4804abb44 Add DialogApi.open() and deprecate show/showModal
The existing show() and showModal() methods render dialog chrome (a
Material UI Dialog) as part of the implementation. This causes focus
trap conflicts when the caller's content uses components from a
different design library (e.g. Backstage UI).

The new open() method renders the caller's content as-is, without any
dialog chrome. The caller provides the full dialog component including
overlay, backdrop, and surface, making the API design-library-agnostic.

The deprecated show/showModal are re-implemented on top of open() with
a MUI Dialog wrapper for backward compatibility, and emit console
warnings when used.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-12 11:14:02 +02:00
Patrik Oldsberg 5b6061ac77 Address review feedback: zod import path and legacy route ref
Use explicit zod/v4 import path in tests, and remove unnecessary
convertLegacyRouteRef wrapper in catalog-graph README.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 16:54:06 +02:00
Patrik Oldsberg 461d4fc48b Clean up parse output and schema enumerability
Skip assigning undefined keys for absent optional fields in parse,
matching the previous zod-object behavior. Make the schema getter
non-enumerable so JSON.stringify on the portable schema only
serializes parse and _fields.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 15:09:02 +02:00
Patrik Oldsberg fe8473b5f1 Fix review feedback: override warnings and search docs
Add explicit deprecation warnings in override and makeWithOverrides when
config.schema is used, since the merged result now passes through
configSchema. Update search declarative-integration docs to use
SearchResultListItemBlueprint instead of the removed extension creator.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 13:58:38 +02:00
Patrik Oldsberg 27bc970c91 Fix review feedback: override warning, input guard, required tests
Pass merged config schemas via configSchema instead of config.schema in
the override method to avoid false deprecation warnings. Add type guard
for non-object inputs in parse. Add tests for defaulted field required
semantics (already correct) and invalid input types.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 13:16:25 +02:00
Patrik Oldsberg 8330f1319a frontend-plugin-api: restore @ignore on internal utility types
Route createExtension overloads through CreateExtensionOptions so that
ResolvedExtensionInputs, VerifyExtensionFactoryOutput, VerifyExtensionAttachTo,
and RequiredExtensionIds can remain @ignore without ae-forgotten-export warnings.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 12:52:59 +02:00
Patrik Oldsberg effa7bf459 Fix missing changesets and tsc errors from CI
Add changesets for plugin-app and plugin-catalog-graph. Fix cross-style
merge test to use direct schema values with configSchema instead of
factory functions.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 12:26:25 +02:00
Patrik Oldsberg 540a03171c Add missing changeset and test coverage for PR review gaps
Add changeset for catalog-react blueprint migration. Add tests for
cross-style config merge (configSchema + deprecated config.schema),
deprecation warning emission, and empty configSchema edge case.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 11:28:38 +02:00
Patrik Oldsberg 2d89e198bd frontend-plugin-api: remove deprecated createSchemaFromZod
The helper is no longer used internally and has been replaced by
the `configSchema` option with direct Standard Schema values.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 11:18:03 +02:00
Patrik Oldsberg 1e6d2e91ad frontend-plugin-api: thorough error message tests for portable schema
Cover zod v3, zod v4, mixed, and merged schema error messages
with exact string assertions to document the error format produced
for missing fields, type mismatches, nested paths, and multi-field
errors.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 11:13:27 +02:00
Patrik Oldsberg 1ef7954725 Migrate catalog-react and app blueprints to configSchema
Move EntityCardBlueprint and EntityContentBlueprint to the new
`configSchema` option using zod v3, and AppLanguageApi to zod v4.
Fix config schema merge in `makeWithOverrides` when mixing
`configSchema` and deprecated `config.schema` sources.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 10:39:50 +02:00
Patrik Oldsberg 8bb8560557 frontend-plugin-api: always warn on deprecated config.schema with call site
Instead of a one-time warning, emit a deprecation warning every time
an extension is created using the deprecated `config.schema` option,
including the call site location to help track down each usage.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 10:19:51 +02:00
Patrik Oldsberg 426d1b389f frontend-plugin-api: clean up comments in createPortableSchema
Replace box-style section comments with TSDoc comments to match
the style used throughout the rest of the repository.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 10:17:35 +02:00
Patrik Oldsberg 1f80e1a5a4 frontend-plugin-api: per-field config schema with lazy JSON Schema
Replace the monolithic `createSchemaFromZod` approach with per-field
schema resolution via `createConfigSchema`. Each field is resolved
individually and eagerly validated for JSON Schema conversion support,
but the actual JSON Schema generation is deferred until first access.

`PortableSchema.schema` is now a lazy callable — it can still be
accessed as a property (backward compat, deprecated) or called as a
method returning `{ schema: JsonObject }` for the new API.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 10:13:19 +02:00
Patrik Oldsberg 0d398f3271 frontend-plugin-api: remove ConfigFieldSchema and fix API report warnings
Remove the `ConfigFieldSchema` and `ConfigSchemaRecord` types that are
no longer needed now that `configSchema` and `config.schema` each accept
only one form. The deprecated overloads now constrain directly to the
factory signature `(zImpl: typeof z) => z.ZodType`.

Also fix pre-existing API report warnings by promoting
`ResolvedExtensionInputs`, `RequiredExtensionIds`,
`VerifyExtensionFactoryOutput`, and `VerifyExtensionAttachTo` to
`@public` and exporting them from both entry points.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 09:21:40 +02:00
Patrik Oldsberg 4c7905d22c frontend-plugin-api: add configSchema option and deprecate config.schema
Introduce a new top-level `configSchema` option for `createExtension`,
`createExtensionBlueprint`, `override`, and `makeWithOverrides` that
accepts Standard Schema values directly. The old `config.schema` form
is deprecated via function/method overloads so that the entire call
site gets editor strikethrough when matched.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 08:54:43 +02:00
Patrik Oldsberg 787200224e frontend-plugin-api: use @standard-schema/spec dependency instead of inlining
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-09 18:45:20 +02:00
Patrik Oldsberg 23a35d1b91 frontend-plugin-api: widen config schema constraint to accept Standard Schema
Widens the TConfigSchema generic constraint in createExtension,
createExtensionBlueprint, and their override/makeWithOverrides methods
to accept both the existing zod factory form and direct Standard Schema
instances via the new ConfigFieldSchema union type.

Existing consumers are unaffected — the factory form continues to
infer concrete types through z.infer<ReturnType<...>>. Direct Standard
Schema values are accepted but infer as any in the current iteration.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-09 16:36:00 +02:00
Patrik Oldsberg 7169cd543c exploration: Standard Schema utility for zod version decoupling
Adds a mock/exploration file showing what a central Standard-Schema-based
utility could look like for decoupling the exact zod version from the
public API surface of extension config schemas.

This is not wired into anything — just saving progress on the design
exploration for per-field validation, JSON Schema generation, and
schema merging across different sources (blueprint + override) that
may use different schema libraries or zod versions.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-08 11:18:58 +02:00
github-actions[bot] 6c10d88c13 Version Packages (next) 2026-04-07 15:30:58 +00:00
github-actions[bot] a2cb332e25 Version Packages (next) 2026-03-31 15:30:51 +00:00
Fredrik Adelöw 49397c16e0 Simplify createRouteRef type signature
Replace dual TParams/TParamKeys type parameters with a single TParamKey,
removing unnecessary complexity while preserving runtime behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-28 10:58:37 +01:00
Fredrik Adelöw 3f8060c460 Merge pull request #33536 from jonkoops/fix/zod-schema-first-generics
fix: use schema-first generic pattern for Zod type compatibility
2026-03-26 17:16:51 +01:00
Jon Koops fa550786b0 fix: use schema-first generic pattern for Zod type compatibility
Refactor `SignInResolverFactoryOptions` and `createSchemaFromZod` to use
`TSchema extends ZodType` instead of `ZodSchema<Output, Def, Input>`,
avoiding "excessively deep" TypeScript inference errors when multiple
Zod copies are resolved in a project.

Signed-off-by: Jon Koops <jonkoops@gmail.com>
2026-03-26 16:31:41 +01:00
Fredrik Adelöw 7a39b2c4ea fix: change unreachable branch to never in FlattenedMessages
The last branch of the conditional is unreachable since TMessages[TKey]
is constrained to string | AnyNestedMessages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-24 22:54:11 +01:00
Fredrik Adelöw ddc5247f67 fix(frontend-plugin-api): fix FlattenedMessages type depth for TypeScript 6
Restructure the FlattenedMessages conditional type to check
`TMessages[TKey] extends string` directly instead of using an
intermediate `infer TValue` pattern, which caused excessive type
instantiation depth in TypeScript 6.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-24 22:30:56 +01:00
github-actions[bot] c1b510cabb Version Packages (next) 2026-03-24 14:54:00 +00:00
Patrik Oldsberg d39c2dcce3 Merge pull request #33441 from backstage/rugvip/remove-plugin-header-action-define-params
frontend-plugin-api: remove defineParams from PluginHeaderActionBlueprint
2026-03-20 11:48:11 +01:00
Johan Persson d66a3ec9ab feat(frontend-plugin-api): add titleRouteRef to PageBlueprint
Add `titleRouteRef` to `PageLayoutProps` so the plugin header title
links back to the plugin root. `PageBlueprint` resolves it from
`plugin.routes.root` with fallback to `params.routeRef`.

- PageLayout swap resolves the title link via a conditional child
  component that calls `useRouteRef` only when a route ref exists
- Header actions get stable React keys via `cloneElement`

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2026-03-20 09:05:23 +01:00
Patrik Oldsberg e220589506 frontend-plugin-api: remove defineParams from PluginHeaderActionBlueprint
Replace the defineParams + createExtensionBlueprintParams pattern with
inline param types on the factory, matching PageBlueprint, SubPageBlueprint,
and other blueprints. Update the app-visualizer usage accordingly.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-19 13:43:08 +01:00
github-actions[bot] 5725b5fcfa Version Packages 2026-03-17 21:39:07 +00:00