@backstage/frontend-plugin-api 0.18.0-next.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @backstage/frontend-plugin-api
2
2
 
3
+ ## 0.18.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 907793c: **BREAKING**: Removed the deprecated `config.schema` option for extensions and extension blueprints. Use the top-level `configSchema` option with Standard Schema-compatible schema values, such as Zod v4.
8
+
9
+ ### Patch Changes
10
+
11
+ - e156f1e: Added support for using a `SubRouteRef` as the parent of another `SubRouteRef`. Child paths are combined with ancestor paths at creation, and nested sub-routes inherit parameters from their complete ancestor chain.
12
+
3
13
  ## 0.18.0-next.0
4
14
 
5
15
  ### Minor Changes
package/dist/alpha.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { b as AnyRouteRefParams, d as ApiHolder, e as ApiRef, f as AppNode, g as AppNodeEdges, h as AppNodeInstance, i as AppNodeSpec, j as AppTree, C as ConfigurableExtensionDataRef, E as Extension, p as ExtensionAttachTo, q as ExtensionBlueprint, r as ExtensionBlueprintDefineParams, s as ExtensionBlueprintParameters, t as ExtensionBlueprintParams, u as ExtensionDataContainer, v as ExtensionDataRef, w as ExtensionDataValue, x as ExtensionDefinition, y as ExtensionDefinitionAttachTo, z as ExtensionDefinitionParameters, D as ExtensionInput, F as ExternalRouteRef, J as FrontendPlugin, K as FrontendPluginInfo, N as IconElement, O as OverridableExtensionDefinition, R as PluginWrapperApi, S as PluginWrapperBlueprint, T as PluginWrapperDefinition, U as PortableSchema, V as RouteRef, W as SubRouteRef, $ as createExtensionBlueprintParams, a7 as pluginWrapperApiRef } from './types/alpha.d-CUDLigYe.js';
1
+ export { b as AnyRouteRefParams, d as ApiHolder, e as ApiRef, f as AppNode, g as AppNodeEdges, h as AppNodeInstance, i as AppNodeSpec, j as AppTree, C as ConfigurableExtensionDataRef, E as Extension, p as ExtensionAttachTo, q as ExtensionBlueprint, r as ExtensionBlueprintDefineParams, s as ExtensionBlueprintParameters, t as ExtensionBlueprintParams, u as ExtensionDataContainer, v as ExtensionDataRef, w as ExtensionDataValue, x as ExtensionDefinition, y as ExtensionDefinitionAttachTo, z as ExtensionDefinitionParameters, D as ExtensionInput, F as ExternalRouteRef, J as FrontendPlugin, K as FrontendPluginInfo, N as IconElement, O as OverridableExtensionDefinition, R as PluginWrapperApi, S as PluginWrapperBlueprint, T as PluginWrapperDefinition, U as PortableSchema, V as RouteRef, W as SubRouteRef, $ as createExtensionBlueprintParams, a7 as pluginWrapperApiRef } from './types/alpha.d-gY8B1WFX.js';
2
2
  export { StandardSchemaV1 } from '@standard-schema/spec';
3
3
  import '@backstage/frontend-plugin-api';
4
4
  import 'react';
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { ReactNode, JSX as JSX$1, ComponentType, PropsWithChildren } from 'react';
4
4
  import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
5
- import { N as IconElement, V as RouteRef, b as AnyRouteRefParams, W as SubRouteRef, F as ExternalRouteRef, H as FrontendFeature, M as IconComponent, f as AppNode, J as FrontendPlugin, e as ApiRef, d as ApiHolder, X as TypesToApiRefs, c as ApiFactory, A as AnyApiFactory } from './types/alpha.d-CUDLigYe.js';
6
- export { a as AnyApiRef, g as AppNodeEdges, h as AppNodeInstance, i as AppNodeSpec, j as AppTree, k as AppTreeApi, C as ConfigurableExtensionDataRef, l as CreateExtensionBlueprintOptions, m as CreateExtensionOptions, n as CreateFrontendModuleOptions, o as CreateFrontendPluginOptions, E as Extension, p as ExtensionAttachTo, q as ExtensionBlueprint, r as ExtensionBlueprintDefineParams, s as ExtensionBlueprintParameters, t as ExtensionBlueprintParams, u as ExtensionDataContainer, v as ExtensionDataRef, w as ExtensionDataValue, x as ExtensionDefinition, y as ExtensionDefinitionAttachTo, z as ExtensionDefinitionParameters, B as ExtensionFactoryMiddleware, D as ExtensionInput, G as FeatureFlagConfig, I as FrontendModule, K as FrontendPluginInfo, L as FrontendPluginInfoOptions, O as OverridableExtensionDefinition, P as OverridableFrontendPlugin, Q as PluginOptions, R as PluginWrapperApi, S as PluginWrapperBlueprint, T as PluginWrapperDefinition, U as PortableSchema, Y as appTreeApiRef, Z as createExtension, _ as createExtensionBlueprint, $ as createExtensionBlueprintParams, a0 as createExtensionDataRef, a1 as createExtensionInput, a2 as createExternalRouteRef, a3 as createFrontendModule, a4 as createFrontendPlugin, a5 as createRouteRef, a6 as createSubRouteRef, a7 as pluginWrapperApiRef } from './types/alpha.d-CUDLigYe.js';
5
+ import { N as IconElement, V as RouteRef, b as AnyRouteRefParams, W as SubRouteRef, F as ExternalRouteRef, H as FrontendFeature, M as IconComponent, f as AppNode, J as FrontendPlugin, e as ApiRef, d as ApiHolder, X as TypesToApiRefs, c as ApiFactory, A as AnyApiFactory } from './types/alpha.d-gY8B1WFX.js';
6
+ export { a as AnyApiRef, g as AppNodeEdges, h as AppNodeInstance, i as AppNodeSpec, j as AppTree, k as AppTreeApi, C as ConfigurableExtensionDataRef, l as CreateExtensionBlueprintOptions, m as CreateExtensionOptions, n as CreateFrontendModuleOptions, o as CreateFrontendPluginOptions, E as Extension, p as ExtensionAttachTo, q as ExtensionBlueprint, r as ExtensionBlueprintDefineParams, s as ExtensionBlueprintParameters, t as ExtensionBlueprintParams, u as ExtensionDataContainer, v as ExtensionDataRef, w as ExtensionDataValue, x as ExtensionDefinition, y as ExtensionDefinitionAttachTo, z as ExtensionDefinitionParameters, B as ExtensionFactoryMiddleware, D as ExtensionInput, G as FeatureFlagConfig, I as FrontendModule, K as FrontendPluginInfo, L as FrontendPluginInfoOptions, O as OverridableExtensionDefinition, P as OverridableFrontendPlugin, Q as PluginOptions, R as PluginWrapperApi, S as PluginWrapperBlueprint, T as PluginWrapperDefinition, U as PortableSchema, Y as appTreeApiRef, Z as createExtension, _ as createExtensionBlueprint, $ as createExtensionBlueprintParams, a0 as createExtensionDataRef, a1 as createExtensionInput, a2 as createExternalRouteRef, a3 as createFrontendModule, a4 as createFrontendPlugin, a5 as createRouteRef, a6 as createSubRouteRef, a7 as pluginWrapperApiRef } from './types/alpha.d-gY8B1WFX.js';
7
7
  import { Observable, JsonValue, Expand, ExpandRecursive } from '@backstage/types';
8
8
  import { Config } from '@backstage/config';
9
9
  export { StandardSchemaV1 } from '@standard-schema/spec';
@@ -1,13 +1,15 @@
1
- import { OpaqueRouteRef } from '../frontend-internal/src/routing/OpaqueRouteRef.esm.js';
2
1
  import { OpaqueSubRouteRef } from '../frontend-internal/src/routing/OpaqueSubRouteRef.esm.js';
2
+ import { OpaqueRouteRef } from '../frontend-internal/src/routing/OpaqueRouteRef.esm.js';
3
3
  import '../frontend-internal/src/routing/OpaqueExternalRouteRef.esm.js';
4
4
 
5
5
  const PARAM_PATTERN = /^\w+$/;
6
6
  function createSubRouteRef(config) {
7
7
  const { path, parent } = config;
8
- const internalParent = OpaqueRouteRef.toInternal(parent);
9
- const parentParams = internalParent.getParams();
10
- const parentDescription = internalParent.getDescription();
8
+ const subRouteParent = OpaqueSubRouteRef.isType(parent) ? OpaqueSubRouteRef.toInternal(parent) : void 0;
9
+ const parentRef = subRouteParent?.getParent() ?? parent;
10
+ const internalParent = OpaqueRouteRef.toInternal(parentRef);
11
+ const parentParams = subRouteParent?.getParams() ?? internalParent.getParams();
12
+ const subPath = subRouteParent ? `${subRouteParent.path}${path}` : path;
11
13
  const pathParams = path.split("/").filter((p) => p.startsWith(":")).map((p) => p.substring(1));
12
14
  const params = [...parentParams, ...pathParams];
13
15
  if (parentParams.some((p) => pathParams.includes(p))) {
@@ -28,18 +30,18 @@ function createSubRouteRef(config) {
28
30
  }
29
31
  return OpaqueSubRouteRef.createInstance("v1", {
30
32
  T: void 0,
31
- path,
33
+ path: subPath,
32
34
  getParams() {
33
35
  return params;
34
36
  },
35
37
  getParent() {
36
- return parent;
38
+ return parentRef;
37
39
  },
38
40
  getDescription() {
39
- return `at ${path} with parent ${parentDescription}`;
41
+ return `at ${subPath} with parent ${internalParent.getDescription()}`;
40
42
  },
41
43
  toString() {
42
- return `subRouteRef{path='${path}',parent=${parent}}`;
44
+ return `subRouteRef{path='${subPath}',parent=${parentRef}}`;
43
45
  }
44
46
  });
45
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SubRouteRef.esm.js","sources":["../../src/routing/SubRouteRef.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OpaqueRouteRef, OpaqueSubRouteRef } from '@internal/frontend';\nimport { RouteRef } from './RouteRef';\nimport { AnyRouteRefParams } from './types';\n\n// Should match the pattern in react-router\nconst PARAM_PATTERN = /^\\w+$/;\n\n/**\n * Descriptor of a route relative to an absolute {@link RouteRef}.\n *\n * @remarks\n *\n * See {@link https://backstage.io/docs/plugins/composability#routing-system}.\n *\n * @public\n */\nexport interface SubRouteRef<\n TParams extends AnyRouteRefParams = AnyRouteRefParams,\n> {\n readonly $$type: '@backstage/SubRouteRef';\n\n readonly T: TParams;\n\n readonly path: string;\n}\n\n/** @internal */\nexport interface InternalSubRouteRef<\n TParams extends AnyRouteRefParams = AnyRouteRefParams,\n> extends SubRouteRef<TParams> {\n readonly version: 'v1';\n\n getParams(): string[];\n getParent(): RouteRef;\n getDescription(): string;\n}\n\n/**\n * Used in {@link PathParams} type declaration.\n * @ignore\n */\ntype ParamPart<S extends string> = S extends `:${infer Param}` ? Param : never;\n\n/**\n * Used in {@link PathParams} type declaration.\n * @ignore\n */\ntype ParamNames<S extends string> = S extends `${infer Part}/${infer Rest}`\n ? ParamPart<Part> | ParamNames<Rest>\n : ParamPart<S>;\n/**\n * This utility type helps us infer a Param object type from a string path\n * For example, `/foo/:bar/:baz` inferred to `{ bar: string, baz: string }`\n * @ignore\n */\ntype PathParams<S extends string> = { [name in ParamNames<S>]: string };\n\n/**\n * Merges a param object type with an optional params type into a params object.\n * @ignore\n */\ntype MergeParams<\n P1 extends { [param in string]: string },\n P2 extends AnyRouteRefParams,\n> = (P1[keyof P1] extends never ? {} : P1) & (P2 extends undefined ? {} : P2);\n\n/**\n * Convert empty params to undefined.\n * @ignore\n */\ntype TrimEmptyParams<Params extends { [param in string]: string }> =\n keyof Params extends never ? undefined : Params;\n\n/**\n * Creates a SubRouteRef type given the desired parameters and parent route parameters.\n * The parameters types are merged together while ensuring that there is no overlap between the two.\n *\n * @ignore\n */\ntype MakeSubRouteRef<\n Params extends { [param in string]: string },\n ParentParams extends AnyRouteRefParams,\n> = keyof Params & keyof ParentParams extends never\n ? SubRouteRef<TrimEmptyParams<MergeParams<Params, ParentParams>>>\n : never;\n\n/**\n * Create a {@link SubRouteRef} from a route descriptor.\n *\n * @param config - Description of the route reference to be created.\n * @public\n */\nexport function createSubRouteRef<\n Path extends string,\n ParentParams extends AnyRouteRefParams = never,\n>(config: {\n path: Path;\n parent: RouteRef<ParentParams>;\n}): MakeSubRouteRef<PathParams<Path>, ParentParams> {\n const { path, parent } = config;\n type Params = PathParams<Path>;\n\n const internalParent = OpaqueRouteRef.toInternal(parent);\n const parentParams = internalParent.getParams();\n const parentDescription = internalParent.getDescription();\n\n // Collect runtime parameters from the path, e.g. ['bar', 'baz'] from '/foo/:bar/:baz'\n const pathParams = path\n .split('/')\n .filter(p => p.startsWith(':'))\n .map(p => p.substring(1));\n const params = [...parentParams, ...pathParams];\n\n if (parentParams.some(p => pathParams.includes(p as string))) {\n throw new Error(\n 'SubRouteRef may not have params that overlap with its parent',\n );\n }\n if (!path.startsWith('/')) {\n throw new Error(`SubRouteRef path must start with '/', got '${path}'`);\n }\n if (path.endsWith('/')) {\n throw new Error(`SubRouteRef path must not end with '/', got '${path}'`);\n }\n for (const param of pathParams) {\n if (!PARAM_PATTERN.test(param)) {\n throw new Error(`SubRouteRef path has invalid param, got '${param}'`);\n }\n }\n\n return OpaqueSubRouteRef.createInstance('v1', {\n T: undefined as unknown as TrimEmptyParams<\n MergeParams<Params, ParentParams>\n >,\n path,\n getParams() {\n return params;\n },\n getParent() {\n return parent;\n },\n getDescription() {\n return `at ${path} with parent ${parentDescription}`;\n },\n toString() {\n return `subRouteRef{path='${path}',parent=${parent}}`;\n },\n });\n}\n"],"names":[],"mappings":";;;;AAqBA,MAAM,aAAA,GAAgB,OAAA;AAuFf,SAAS,kBAGd,MAAA,EAGkD;AAClD,EAAA,MAAM,EAAE,IAAA,EAAM,MAAA,EAAO,GAAI,MAAA;AAGzB,EAAA,MAAM,cAAA,GAAiB,cAAA,CAAe,UAAA,CAAW,MAAM,CAAA;AACvD,EAAA,MAAM,YAAA,GAAe,eAAe,SAAA,EAAU;AAC9C,EAAA,MAAM,iBAAA,GAAoB,eAAe,cAAA,EAAe;AAGxD,EAAA,MAAM,aAAa,IAAA,CAChB,KAAA,CAAM,GAAG,CAAA,CACT,OAAO,CAAA,CAAA,KAAK,CAAA,CAAE,UAAA,CAAW,GAAG,CAAC,CAAA,CAC7B,GAAA,CAAI,OAAK,CAAA,CAAE,SAAA,CAAU,CAAC,CAAC,CAAA;AAC1B,EAAA,MAAM,MAAA,GAAS,CAAC,GAAG,YAAA,EAAc,GAAG,UAAU,CAAA;AAE9C,EAAA,IAAI,aAAa,IAAA,CAAK,CAAA,CAAA,KAAK,WAAW,QAAA,CAAS,CAAW,CAAC,CAAA,EAAG;AAC5D,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA,EACF;AACA,EAAA,IAAI,CAAC,IAAA,CAAK,UAAA,CAAW,GAAG,CAAA,EAAG;AACzB,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,2CAAA,EAA8C,IAAI,CAAA,CAAA,CAAG,CAAA;AAAA,EACvE;AACA,EAAA,IAAI,IAAA,CAAK,QAAA,CAAS,GAAG,CAAA,EAAG;AACtB,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,6CAAA,EAAgD,IAAI,CAAA,CAAA,CAAG,CAAA;AAAA,EACzE;AACA,EAAA,KAAA,MAAW,SAAS,UAAA,EAAY;AAC9B,IAAA,IAAI,CAAC,aAAA,CAAc,IAAA,CAAK,KAAK,CAAA,EAAG;AAC9B,MAAA,MAAM,IAAI,KAAA,CAAM,CAAA,yCAAA,EAA4C,KAAK,CAAA,CAAA,CAAG,CAAA;AAAA,IACtE;AAAA,EACF;AAEA,EAAA,OAAO,iBAAA,CAAkB,eAAe,IAAA,EAAM;AAAA,IAC5C,CAAA,EAAG,MAAA;AAAA,IAGH,IAAA;AAAA,IACA,SAAA,GAAY;AACV,MAAA,OAAO,MAAA;AAAA,IACT,CAAA;AAAA,IACA,SAAA,GAAY;AACV,MAAA,OAAO,MAAA;AAAA,IACT,CAAA;AAAA,IACA,cAAA,GAAiB;AACf,MAAA,OAAO,CAAA,GAAA,EAAM,IAAI,CAAA,aAAA,EAAgB,iBAAiB,CAAA,CAAA;AAAA,IACpD,CAAA;AAAA,IACA,QAAA,GAAW;AACT,MAAA,OAAO,CAAA,kBAAA,EAAqB,IAAI,CAAA,SAAA,EAAY,MAAM,CAAA,CAAA,CAAA;AAAA,IACpD;AAAA,GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"SubRouteRef.esm.js","sources":["../../src/routing/SubRouteRef.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OpaqueRouteRef, OpaqueSubRouteRef } from '@internal/frontend';\nimport { RouteRef } from './RouteRef';\nimport { AnyRouteRefParams } from './types';\n\n// Should match the pattern in react-router\nconst PARAM_PATTERN = /^\\w+$/;\n\n/**\n * Descriptor of a route relative to a {@link RouteRef} or another sub-route.\n *\n * @remarks\n *\n * See {@link https://backstage.io/docs/plugins/composability#routing-system}.\n *\n * @public\n */\nexport interface SubRouteRef<\n TParams extends AnyRouteRefParams = AnyRouteRefParams,\n> {\n readonly $$type: '@backstage/SubRouteRef';\n\n readonly T: TParams;\n\n readonly path: string;\n}\n\n/** @internal */\nexport interface InternalSubRouteRef<\n TParams extends AnyRouteRefParams = AnyRouteRefParams,\n> extends SubRouteRef<TParams> {\n readonly version: 'v1';\n\n getParams(): string[];\n getParent(): RouteRef;\n getDescription(): string;\n}\n\n/**\n * Used in {@link PathParams} type declaration.\n * @ignore\n */\ntype ParamPart<S extends string> = S extends `:${infer Param}` ? Param : never;\n\n/**\n * Used in {@link PathParams} type declaration.\n * @ignore\n */\ntype ParamNames<S extends string> = S extends `${infer Part}/${infer Rest}`\n ? ParamPart<Part> | ParamNames<Rest>\n : ParamPart<S>;\n/**\n * This utility type helps us infer a Param object type from a string path\n * For example, `/foo/:bar/:baz` inferred to `{ bar: string, baz: string }`\n * @ignore\n */\ntype PathParams<S extends string> = { [name in ParamNames<S>]: string };\n\n/**\n * Merges a param object type with an optional params type into a params object.\n * @ignore\n */\ntype MergeParams<\n P1 extends { [param in string]: string },\n P2 extends AnyRouteRefParams,\n> = (P1[keyof P1] extends never ? {} : P1) & (P2 extends undefined ? {} : P2);\n\n/**\n * Convert empty params to undefined.\n * @ignore\n */\ntype TrimEmptyParams<Params extends { [param in string]: string }> =\n keyof Params extends never ? undefined : Params;\n\n/**\n * Creates a SubRouteRef type given the desired parameters and parent route parameters.\n * The parameters types are merged together while ensuring that there is no overlap between the two.\n *\n * @ignore\n */\ntype MakeSubRouteRef<\n Params extends { [param in string]: string },\n ParentParams extends AnyRouteRefParams,\n> = keyof Params & keyof ParentParams extends never\n ? SubRouteRef<TrimEmptyParams<MergeParams<Params, ParentParams>>>\n : never;\n\n/**\n * Create a {@link SubRouteRef} from a route descriptor.\n *\n * @param config - Description of the route reference to be created.\n * @public\n */\nexport function createSubRouteRef<\n Path extends string,\n ParentParams extends AnyRouteRefParams = never,\n>(config: {\n path: Path;\n parent: RouteRef<ParentParams> | SubRouteRef<ParentParams>;\n}): MakeSubRouteRef<PathParams<Path>, ParentParams> {\n const { path, parent } = config;\n type Params = PathParams<Path>;\n\n const subRouteParent = OpaqueSubRouteRef.isType(parent)\n ? OpaqueSubRouteRef.toInternal(parent)\n : undefined;\n const parentRef = subRouteParent?.getParent() ?? (parent as RouteRef);\n const internalParent = OpaqueRouteRef.toInternal(parentRef);\n const parentParams =\n subRouteParent?.getParams() ?? internalParent.getParams();\n const subPath = subRouteParent ? `${subRouteParent.path}${path}` : path;\n\n // Collect runtime parameters from the path, e.g. ['bar', 'baz'] from '/foo/:bar/:baz'\n const pathParams = path\n .split('/')\n .filter(p => p.startsWith(':'))\n .map(p => p.substring(1));\n const params = [...parentParams, ...pathParams];\n\n if (parentParams.some(p => pathParams.includes(p as string))) {\n throw new Error(\n 'SubRouteRef may not have params that overlap with its parent',\n );\n }\n if (!path.startsWith('/')) {\n throw new Error(`SubRouteRef path must start with '/', got '${path}'`);\n }\n if (path.endsWith('/')) {\n throw new Error(`SubRouteRef path must not end with '/', got '${path}'`);\n }\n for (const param of pathParams) {\n if (!PARAM_PATTERN.test(param)) {\n throw new Error(`SubRouteRef path has invalid param, got '${param}'`);\n }\n }\n\n return OpaqueSubRouteRef.createInstance('v1', {\n T: undefined as unknown as TrimEmptyParams<\n MergeParams<Params, ParentParams>\n >,\n path: subPath,\n getParams() {\n return params;\n },\n getParent() {\n return parentRef;\n },\n getDescription() {\n return `at ${subPath} with parent ${internalParent.getDescription()}`;\n },\n toString() {\n return `subRouteRef{path='${subPath}',parent=${parentRef}}`;\n },\n });\n}\n"],"names":[],"mappings":";;;;AAqBA,MAAM,aAAA,GAAgB,OAAA;AAuFf,SAAS,kBAGd,MAAA,EAGkD;AAClD,EAAA,MAAM,EAAE,IAAA,EAAM,MAAA,EAAO,GAAI,MAAA;AAGzB,EAAA,MAAM,cAAA,GAAiB,kBAAkB,MAAA,CAAO,MAAM,IAClD,iBAAA,CAAkB,UAAA,CAAW,MAAM,CAAA,GACnC,MAAA;AACJ,EAAA,MAAM,SAAA,GAAY,cAAA,EAAgB,SAAA,EAAU,IAAM,MAAA;AAClD,EAAA,MAAM,cAAA,GAAiB,cAAA,CAAe,UAAA,CAAW,SAAS,CAAA;AAC1D,EAAA,MAAM,YAAA,GACJ,cAAA,EAAgB,SAAA,EAAU,IAAK,eAAe,SAAA,EAAU;AAC1D,EAAA,MAAM,UAAU,cAAA,GAAiB,CAAA,EAAG,eAAe,IAAI,CAAA,EAAG,IAAI,CAAA,CAAA,GAAK,IAAA;AAGnE,EAAA,MAAM,aAAa,IAAA,CAChB,KAAA,CAAM,GAAG,CAAA,CACT,OAAO,CAAA,CAAA,KAAK,CAAA,CAAE,UAAA,CAAW,GAAG,CAAC,CAAA,CAC7B,GAAA,CAAI,OAAK,CAAA,CAAE,SAAA,CAAU,CAAC,CAAC,CAAA;AAC1B,EAAA,MAAM,MAAA,GAAS,CAAC,GAAG,YAAA,EAAc,GAAG,UAAU,CAAA;AAE9C,EAAA,IAAI,aAAa,IAAA,CAAK,CAAA,CAAA,KAAK,WAAW,QAAA,CAAS,CAAW,CAAC,CAAA,EAAG;AAC5D,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA,EACF;AACA,EAAA,IAAI,CAAC,IAAA,CAAK,UAAA,CAAW,GAAG,CAAA,EAAG;AACzB,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,2CAAA,EAA8C,IAAI,CAAA,CAAA,CAAG,CAAA;AAAA,EACvE;AACA,EAAA,IAAI,IAAA,CAAK,QAAA,CAAS,GAAG,CAAA,EAAG;AACtB,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,6CAAA,EAAgD,IAAI,CAAA,CAAA,CAAG,CAAA;AAAA,EACzE;AACA,EAAA,KAAA,MAAW,SAAS,UAAA,EAAY;AAC9B,IAAA,IAAI,CAAC,aAAA,CAAc,IAAA,CAAK,KAAK,CAAA,EAAG;AAC9B,MAAA,MAAM,IAAI,KAAA,CAAM,CAAA,yCAAA,EAA4C,KAAK,CAAA,CAAA,CAAG,CAAA;AAAA,IACtE;AAAA,EACF;AAEA,EAAA,OAAO,iBAAA,CAAkB,eAAe,IAAA,EAAM;AAAA,IAC5C,CAAA,EAAG,MAAA;AAAA,IAGH,IAAA,EAAM,OAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,OAAO,MAAA;AAAA,IACT,CAAA;AAAA,IACA,SAAA,GAAY;AACV,MAAA,OAAO,SAAA;AAAA,IACT,CAAA;AAAA,IACA,cAAA,GAAiB;AACf,MAAA,OAAO,CAAA,GAAA,EAAM,OAAO,CAAA,aAAA,EAAgB,cAAA,CAAe,gBAAgB,CAAA,CAAA;AAAA,IACrE,CAAA;AAAA,IACA,QAAA,GAAW;AACT,MAAA,OAAO,CAAA,kBAAA,EAAqB,OAAO,CAAA,SAAA,EAAY,SAAS,CAAA,CAAA,CAAA;AAAA,IAC1D;AAAA,GACD,CAAA;AACH;;;;"}
@@ -344,7 +344,7 @@ type ExtensionArrayToMap<T extends ExtensionDefinition[], TId extends string, TO
344
344
  type MakeSortedExtensionsMap<UExtensions extends ExtensionDefinition, TId extends string> = ExtensionArrayToMap<SortExtensions<UnionToArray<UExtensions>>, TId>;
345
345
 
346
346
  /**
347
- * Descriptor of a route relative to an absolute {@link RouteRef}.
347
+ * Descriptor of a route relative to a {@link RouteRef} or another sub-route.
348
348
  *
349
349
  * @remarks
350
350
  *
@@ -406,7 +406,7 @@ type MakeSubRouteRef<Params extends {
406
406
  */
407
407
  declare function createSubRouteRef<Path extends string, ParentParams extends AnyRouteRefParams = never>(config: {
408
408
  path: Path;
409
- parent: RouteRef<ParentParams>;
409
+ parent: RouteRef<ParentParams> | SubRouteRef<ParentParams>;
410
410
  }): MakeSubRouteRef<PathParams<Path>, ParentParams>;
411
411
 
412
412
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/frontend-plugin-api",
3
- "version": "0.18.0-next.0",
3
+ "version": "0.18.0",
4
4
  "backstage": {
5
5
  "role": "web-library"
6
6
  },
@@ -52,18 +52,18 @@
52
52
  "test": "backstage-cli package test"
53
53
  },
54
54
  "dependencies": {
55
- "@backstage/config": "1.3.8",
56
- "@backstage/errors": "1.3.1",
57
- "@backstage/filter-predicates": "0.1.4",
58
- "@backstage/types": "1.2.2",
59
- "@backstage/version-bridge": "1.0.12",
55
+ "@backstage/config": "^1.3.8",
56
+ "@backstage/errors": "^1.3.1",
57
+ "@backstage/filter-predicates": "^0.1.4",
58
+ "@backstage/types": "^1.2.2",
59
+ "@backstage/version-bridge": "^1.0.12",
60
60
  "@standard-schema/spec": "^1.1.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@backstage/cli": "0.36.5-next.1",
64
- "@backstage/frontend-app-api": "0.16.7-next.1",
65
- "@backstage/frontend-test-utils": "0.6.3-next.1",
66
- "@backstage/test-utils": "1.7.21-next.1",
63
+ "@backstage/cli": "^0.36.5",
64
+ "@backstage/frontend-app-api": "^0.16.7",
65
+ "@backstage/frontend-test-utils": "^0.6.3",
66
+ "@backstage/test-utils": "^1.7.21",
67
67
  "@testing-library/jest-dom": "^6.0.0",
68
68
  "@testing-library/react": "^16.0.0",
69
69
  "@types/react": "^18.0.0",