): (
WrappedComponent: React_2.ComponentType
,
) => {
(props: React_2.PropsWithChildren>): JSX.Element;
diff --git a/packages/core-plugin-api/package.json b/packages/core-plugin-api/package.json
index 374c158d57..a0057c1b0c 100644
--- a/packages/core-plugin-api/package.json
+++ b/packages/core-plugin-api/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/core-plugin-api",
"description": "Core API used by Backstage plugins",
- "version": "0.1.4",
+ "version": "0.1.5",
"private": false,
"publishConfig": {
"access": "public",
@@ -29,10 +29,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/config": "^0.1.3",
+ "@backstage/config": "^0.1.6",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
- "@types/react": "^16.9",
+ "@types/react": "*",
"history": "^5.0.0",
"prop-types": "^15.7.2",
"react": "^16.12.0",
@@ -41,8 +41,8 @@
"zen-observable": "^0.8.15"
},
"devDependencies": {
- "@backstage/cli": "^0.7.6",
- "@backstage/core-app-api": "^0.1.6",
+ "@backstage/cli": "^0.7.7",
+ "@backstage/core-app-api": "^0.1.7",
"@backstage/test-utils": "^0.1.16",
"@backstage/test-utils-core": "^0.1.1",
"@testing-library/jest-dom": "^5.10.1",
diff --git a/packages/core-plugin-api/src/apis/system/helpers.ts b/packages/core-plugin-api/src/apis/system/helpers.ts
index 8e84dd6c09..547d583482 100644
--- a/packages/core-plugin-api/src/apis/system/helpers.ts
+++ b/packages/core-plugin-api/src/apis/system/helpers.ts
@@ -24,7 +24,7 @@ import { ApiRef, ApiFactory, TypesToApiRefs } from './types';
export function createApiFactory<
Api,
Impl extends Api,
- Deps extends { [name in string]: unknown }
+ Deps extends { [name in string]: unknown },
>(factory: ApiFactory): ApiFactory;
export function createApiFactory(
api: ApiRef,
@@ -33,7 +33,7 @@ export function createApiFactory(
export function createApiFactory<
Api,
Impl extends Api,
- Deps extends { [name in string]: unknown }
+ Deps extends { [name in string]: unknown },
>(
factory: ApiFactory | ApiRef,
instance?: Impl,
diff --git a/packages/core-plugin-api/src/apis/system/types.ts b/packages/core-plugin-api/src/apis/system/types.ts
index e805b6f255..a97d29fdaa 100644
--- a/packages/core-plugin-api/src/apis/system/types.ts
+++ b/packages/core-plugin-api/src/apis/system/types.ts
@@ -36,7 +36,7 @@ export type ApiHolder = {
export type ApiFactory<
Api,
Impl extends Api,
- Deps extends { [name in string]: unknown }
+ Deps extends { [name in string]: unknown },
> = {
api: ApiRef;
deps: TypesToApiRefs;
diff --git a/packages/core-plugin-api/src/app/useApp.tsx b/packages/core-plugin-api/src/app/useApp.tsx
index 1d17fb2d0f..aa323db4e2 100644
--- a/packages/core-plugin-api/src/app/useApp.tsx
+++ b/packages/core-plugin-api/src/app/useApp.tsx
@@ -18,9 +18,8 @@ import { useVersionedContext } from '../lib/versionedValues';
import { AppContext as AppContextV1 } from './types';
export const useApp = (): AppContextV1 => {
- const versionedContext = useVersionedContext<{ 1: AppContextV1 }>(
- 'app-context',
- );
+ const versionedContext =
+ useVersionedContext<{ 1: AppContextV1 }>('app-context');
const appContext = versionedContext.atVersion(1);
if (!appContext) {
throw new Error('AppContext v1 not available');
diff --git a/packages/core-plugin-api/src/extensions/extensions.tsx b/packages/core-plugin-api/src/extensions/extensions.tsx
index 5142dccc55..73b927afc8 100644
--- a/packages/core-plugin-api/src/extensions/extensions.tsx
+++ b/packages/core-plugin-api/src/extensions/extensions.tsx
@@ -33,7 +33,7 @@ type ComponentLoader =
// ComponentType inserts children as an optional prop whether the inner component accepts it or not,
// making it impossible to make the usage of children type safe.
export function createRoutableExtension<
- T extends (props: any) => JSX.Element | null
+ T extends (props: any) => JSX.Element | null,
>(options: {
component: () => Promise;
mountPoint: RouteRef;
@@ -91,7 +91,7 @@ export function createRoutableExtension<
// ComponentType inserts children as an optional prop whether the inner component accepts it or not,
// making it impossible to make the usage of children type safe.
export function createComponentExtension<
- T extends (props: any) => JSX.Element | null
+ T extends (props: any) => JSX.Element | null,
>(options: { component: ComponentLoader }): Extension {
const { component } = options;
return createReactExtension({ component });
@@ -101,7 +101,7 @@ export function createComponentExtension<
// ComponentType inserts children as an optional prop whether the inner component accepts it or not,
// making it impossible to make the usage of children type safe.
export function createReactExtension<
- T extends (props: any) => JSX.Element | null
+ T extends (props: any) => JSX.Element | null,
>(options: {
component: ComponentLoader;
data?: Record;
@@ -111,9 +111,9 @@ export function createReactExtension<
let Component: T;
if ('lazy' in options.component) {
const lazyLoader = options.component.lazy;
- Component = (lazy(() =>
+ Component = lazy(() =>
lazyLoader().then(component => ({ default: component })),
- ) as unknown) as T;
+ ) as unknown as T;
} else {
Component = options.component.sync;
}
diff --git a/packages/core-plugin-api/src/lib/versionedValues.ts b/packages/core-plugin-api/src/lib/versionedValues.ts
index a7b7d8e3b7..7686842ecd 100644
--- a/packages/core-plugin-api/src/lib/versionedValues.ts
+++ b/packages/core-plugin-api/src/lib/versionedValues.ts
@@ -32,7 +32,7 @@ export type VersionedValue = {
* Creates a container for a map of versioned values that implements VersionedValue.
*/
export function createVersionedValueMap<
- Versions extends { [version: number]: any }
+ Versions extends { [version: number]: any },
>(versions: Versions): VersionedValue {
Object.freeze(versions);
return {
@@ -43,7 +43,7 @@ export function createVersionedValueMap<
}
export function useVersionedContext<
- Versions extends { [version in number]: any }
+ Versions extends { [version in number]: any },
>(key: string): VersionedValue {
const versionedValue = useContext(
getGlobalSingleton>>(key),
diff --git a/packages/core-plugin-api/src/plugin/Plugin.tsx b/packages/core-plugin-api/src/plugin/Plugin.tsx
index abf4bfa35c..53a53b76d0 100644
--- a/packages/core-plugin-api/src/plugin/Plugin.tsx
+++ b/packages/core-plugin-api/src/plugin/Plugin.tsx
@@ -26,8 +26,9 @@ import { AnyApiFactory } from '../apis';
export class PluginImpl<
Routes extends AnyRoutes,
- ExternalRoutes extends AnyExternalRoutes
-> implements BackstagePlugin {
+ ExternalRoutes extends AnyExternalRoutes,
+> implements BackstagePlugin
+{
private storedOutput?: PluginOutput[];
constructor(private readonly config: PluginConfig) {}
@@ -81,7 +82,7 @@ export class PluginImpl<
export function createPlugin<
Routes extends AnyRoutes = {},
- ExternalRoutes extends AnyExternalRoutes = {}
+ ExternalRoutes extends AnyExternalRoutes = {},
>(
config: PluginConfig,
): BackstagePlugin {
diff --git a/packages/core-plugin-api/src/plugin/types.ts b/packages/core-plugin-api/src/plugin/types.ts
index 23ff4594a5..b3e1043efd 100644
--- a/packages/core-plugin-api/src/plugin/types.ts
+++ b/packages/core-plugin-api/src/plugin/types.ts
@@ -42,7 +42,7 @@ export type AnyExternalRoutes = { [name: string]: ExternalRouteRef };
export type BackstagePlugin<
Routes extends AnyRoutes = {},
- ExternalRoutes extends AnyExternalRoutes = {}
+ ExternalRoutes extends AnyExternalRoutes = {},
> = {
getId(): string;
output(): PluginOutput[];
@@ -54,7 +54,7 @@ export type BackstagePlugin<
export type PluginConfig<
Routes extends AnyRoutes,
- ExternalRoutes extends AnyExternalRoutes
+ ExternalRoutes extends AnyExternalRoutes,
> = {
id: string;
apis?: Iterable;
diff --git a/packages/core-plugin-api/src/routing/ExternalRouteRef.ts b/packages/core-plugin-api/src/routing/ExternalRouteRef.ts
index 348c78220f..401e34773c 100644
--- a/packages/core-plugin-api/src/routing/ExternalRouteRef.ts
+++ b/packages/core-plugin-api/src/routing/ExternalRouteRef.ts
@@ -24,8 +24,9 @@ import {
export class ExternalRouteRefImpl<
Params extends AnyParams,
- Optional extends boolean
-> implements ExternalRouteRef {
+ Optional extends boolean,
+> implements ExternalRouteRef
+{
readonly [routeRefType] = 'external';
constructor(
@@ -42,7 +43,7 @@ export class ExternalRouteRefImpl<
export function createExternalRouteRef<
Params extends { [param in ParamKey]: string },
Optional extends boolean = false,
- ParamKey extends string = never
+ ParamKey extends string = never,
>(options: {
/**
* An identifier for this route, used to identify it in error messages
diff --git a/packages/core-plugin-api/src/routing/RouteRef.ts b/packages/core-plugin-api/src/routing/RouteRef.ts
index 0239b57c25..31dd9ef518 100644
--- a/packages/core-plugin-api/src/routing/RouteRef.ts
+++ b/packages/core-plugin-api/src/routing/RouteRef.ts
@@ -32,7 +32,8 @@ export type RouteRefConfig = {
};
export class RouteRefImpl
- implements RouteRef {
+ implements RouteRef
+{
readonly [routeRefType] = 'absolute';
constructor(
@@ -70,7 +71,7 @@ export function createRouteRef<
// ParamKey is here to make sure the Params type properly has its keys narrowed down
// to only the elements of params. Defaulting to never makes sure we end up with
// Param = {} if the params array is empty.
- ParamKey extends string = never
+ ParamKey extends string = never,
>(config: {
/** The id of the route ref, used to identify it when printed */
id?: string;
diff --git a/packages/core-plugin-api/src/routing/SubRouteRef.ts b/packages/core-plugin-api/src/routing/SubRouteRef.ts
index f7e5cf0bc5..6b329dfd42 100644
--- a/packages/core-plugin-api/src/routing/SubRouteRef.ts
+++ b/packages/core-plugin-api/src/routing/SubRouteRef.ts
@@ -27,7 +27,8 @@ import {
const PARAM_PATTERN = /^\w+$/;
export class SubRouteRefImpl
- implements SubRouteRef {
+ implements SubRouteRef
+{
readonly [routeRefType] = 'sub';
constructor(
@@ -55,7 +56,7 @@ type PathParams = { [name in ParamNames]: string };
*/
type MergeParams<
P1 extends { [param in string]: string },
- P2 extends AnyParams
+ P2 extends AnyParams,
> = (P1[keyof P1] extends never ? {} : P1) & (P2 extends undefined ? {} : P2);
/**
@@ -64,14 +65,14 @@ type MergeParams<
*/
type MakeSubRouteRef<
Params extends { [param in string]: string },
- ParentParams extends AnyParams
+ ParentParams extends AnyParams,
> = keyof Params & keyof ParentParams extends never
? SubRouteRef>>
: never;
export function createSubRouteRef<
Path extends string,
- ParentParams extends AnyParams = never
+ ParentParams extends AnyParams = never,
>(config: {
id: string;
path: Path;
diff --git a/packages/core-plugin-api/src/routing/types.ts b/packages/core-plugin-api/src/routing/types.ts
index 9ea1e3ff0d..5afcc72265 100644
--- a/packages/core-plugin-api/src/routing/types.ts
+++ b/packages/core-plugin-api/src/routing/types.ts
@@ -21,9 +21,8 @@ export type AnyParams = { [param in string]: string } | undefined;
export type ParamKeys = keyof Params extends never
? []
: (keyof Params)[];
-export type OptionalParams<
- Params extends { [param in string]: string }
-> = Params[keyof Params] extends never ? undefined : Params;
+export type OptionalParams =
+ Params[keyof Params] extends never ? undefined : Params;
// The extra TS magic here is to require a single params argument if the RouteRef
// had at least one param defined, but require 0 arguments if there are no params defined.
@@ -65,7 +64,7 @@ export type SubRouteRef = {
export type ExternalRouteRef<
Params extends AnyParams = any,
- Optional extends boolean = any
+ Optional extends boolean = any,
> = {
readonly [routeRefType]: 'external';
diff --git a/packages/core-plugin-api/src/routing/useRouteRef.tsx b/packages/core-plugin-api/src/routing/useRouteRef.tsx
index 4447759b99..ed261489a4 100644
--- a/packages/core-plugin-api/src/routing/useRouteRef.tsx
+++ b/packages/core-plugin-api/src/routing/useRouteRef.tsx
@@ -48,9 +48,8 @@ export function useRouteRef(
| ExternalRouteRef,
): RouteFunc | undefined {
const sourceLocation = useLocation();
- const versionedContext = useVersionedContext<{ 1: RouteResolver }>(
- 'routing-context',
- );
+ const versionedContext =
+ useVersionedContext<{ 1: RouteResolver }>('routing-context');
const resolver = versionedContext.atVersion(1);
const routeFunc = useMemo(
() => resolver && resolver.resolve(routeRef, sourceLocation),
diff --git a/packages/create-app/CHANGELOG.md b/packages/create-app/CHANGELOG.md
index ba2fbeebfc..318c508211 100644
--- a/packages/create-app/CHANGELOG.md
+++ b/packages/create-app/CHANGELOG.md
@@ -1,5 +1,18 @@
# @backstage/create-app
+## 0.3.34
+
+### Patch Changes
+
+- c189c5da5: fix typo in the comments of EntityPage component
+- 48ea3d25b: The recommended value for a `backstage.io/techdocs-ref` annotation is now
+ `dir:.`, indicating "documentation source files are located in the same
+ directory relative to the catalog entity." Note that `url:` values
+ are still supported.
+- 98dda80b4: Update `techdocs.generators` with the latest `techdocs.generator` config in `app-config.yaml`. See
+ https://backstage.io/docs/features/techdocs/configuration for reference and relevant PR
+ https://github.com/backstage/backstage/pull/6071/files for the changes.
+
## 0.3.33
### Patch Changes
diff --git a/packages/create-app/package.json b/packages/create-app/package.json
index 4a5d7b18f1..130c69603a 100644
--- a/packages/create-app/package.json
+++ b/packages/create-app/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/create-app",
"description": "Create app package for Backstage",
- "version": "0.3.33",
+ "version": "0.3.34",
"private": false,
"publishConfig": {
"access": "public"
@@ -39,7 +39,6 @@
"devDependencies": {
"@types/fs-extra": "^9.0.1",
"@types/inquirer": "^7.3.1",
- "@types/react-dev-utils": "^9.0.4",
"@types/recursive-readdir": "^2.2.0",
"ts-node": "^10.0.0"
},
diff --git a/packages/create-app/templates/default-app/.prettierignore b/packages/create-app/templates/default-app/.prettierignore
new file mode 100644
index 0000000000..dfb0f1cd11
--- /dev/null
+++ b/packages/create-app/templates/default-app/.prettierignore
@@ -0,0 +1,4 @@
+dist
+dist-types
+coverage
+.vscode
diff --git a/packages/create-app/templates/default-app/README.md b/packages/create-app/templates/default-app/README.md
index 07cf6fd136..8c7c4373fe 100644
--- a/packages/create-app/templates/default-app/README.md
+++ b/packages/create-app/templates/default-app/README.md
@@ -7,4 +7,4 @@ To start the app, run:
```sh
yarn install
yarn dev
-```
\ No newline at end of file
+```
diff --git a/packages/create-app/templates/default-app/app-config.yaml.hbs b/packages/create-app/templates/default-app/app-config.yaml.hbs
index dc296e5e62..9c35c58c33 100644
--- a/packages/create-app/templates/default-app/app-config.yaml.hbs
+++ b/packages/create-app/templates/default-app/app-config.yaml.hbs
@@ -32,9 +32,9 @@ backend:
user: ${POSTGRES_USER}
password: ${POSTGRES_PASSWORD}
# https://node-postgres.com/features/ssl
- #ssl: require # see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require)
- #ca: # if you have a CA file and want to verify it you can uncomment this section
- # $file: /ca/server.crt
+ # ssl: require # see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require)
+ # ca: # if you have a CA file and want to verify it you can uncomment this section
+ # $file: /ca/server.crt
{{/if}}
cache:
store: memory
diff --git a/packages/create-app/templates/default-app/catalog-info.yaml.hbs b/packages/create-app/templates/default-app/catalog-info.yaml.hbs
index 265864e235..e01ce8f756 100644
--- a/packages/create-app/templates/default-app/catalog-info.yaml.hbs
+++ b/packages/create-app/templates/default-app/catalog-info.yaml.hbs
@@ -5,8 +5,8 @@ metadata:
description: An example of a Backstage application.
# Example for optional annotations
# annotations:
- # github.com/project-slug: backstage/backstage
- # backstage.io/techdocs-ref: dir:.
+ # github.com/project-slug: backstage/backstage
+ # backstage.io/techdocs-ref: dir:.
spec:
type: website
owner: john@example.com
diff --git a/packages/create-app/templates/default-app/package.json.hbs b/packages/create-app/templates/default-app/package.json.hbs
index 7ae86c0fbc..3f913102cb 100644
--- a/packages/create-app/templates/default-app/package.json.hbs
+++ b/packages/create-app/templates/default-app/package.json.hbs
@@ -19,6 +19,7 @@
"test:all": "lerna run test -- --coverage",
"lint": "lerna run lint --since origin/master --",
"lint:all": "lerna run lint --",
+ "prettier:check": "prettier --check .",
"create-plugin": "backstage-cli create-plugin --scope internal --no-private",
"remove-plugin": "backstage-cli remove-plugin"
},
@@ -37,7 +38,7 @@
"@spotify/prettier-config": "^7.0.0",
"concurrently": "^6.0.0",
"lerna": "^4.0.0",
- "prettier": "^1.19.1"
+ "prettier": "^2.3.2"
},
"prettier": "@spotify/prettier-config",
"lint-staged": {
diff --git a/packages/create-app/templates/default-app/packages/app/package.json.hbs b/packages/create-app/templates/default-app/packages/app/package.json.hbs
index 219f503aa0..c443b45dc7 100644
--- a/packages/create-app/templates/default-app/packages/app/package.json.hbs
+++ b/packages/create-app/templates/default-app/packages/app/package.json.hbs
@@ -38,7 +38,7 @@
"@testing-library/user-event": "^12.0.7",
"@types/jest": "^26.0.7",
"@types/node": "^14.14.32",
- "@types/react-dom": "^16.9.8",
+ "@types/react-dom": "*",
"cross-env": "^7.0.0",
"cypress": "^7.3.0",
"eslint-plugin-cypress": "^2.10.3",
diff --git a/packages/create-app/templates/default-app/packages/app/public/index.html b/packages/create-app/templates/default-app/packages/app/public/index.html
index 5653173480..b93896c6da 100644
--- a/packages/create-app/templates/default-app/packages/app/public/index.html
+++ b/packages/create-app/templates/default-app/packages/app/public/index.html
@@ -65,7 +65,7 @@
<% } %>
-
+