@backstage/plugin-app 0.1.11 → 0.2.0-next.1
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 +38 -0
- package/dist/alpha/appModulePublicSignIn.esm.js +52 -0
- package/dist/alpha/appModulePublicSignIn.esm.js.map +1 -0
- package/dist/alpha.d.ts +54 -0
- package/dist/alpha.esm.js +2 -0
- package/dist/alpha.esm.js.map +1 -0
- package/dist/defaultApis.esm.js +214 -263
- package/dist/defaultApis.esm.js.map +1 -1
- package/dist/extensions/AnalyticsApi.esm.js +56 -0
- package/dist/extensions/AnalyticsApi.esm.js.map +1 -0
- package/dist/extensions/AppLanguageApi.esm.js +6 -7
- package/dist/extensions/AppLanguageApi.esm.js.map +1 -1
- package/dist/extensions/AppNav.esm.js +54 -55
- package/dist/extensions/AppNav.esm.js.map +1 -1
- package/dist/extensions/AppRoot.esm.js.map +1 -1
- package/dist/extensions/AppThemeApi.esm.js +8 -7
- package/dist/extensions/AppThemeApi.esm.js.map +1 -1
- package/dist/extensions/ComponentsApi.esm.js +8 -7
- package/dist/extensions/ComponentsApi.esm.js.map +1 -1
- package/dist/extensions/FeatureFlagsApi.esm.js +6 -8
- package/dist/extensions/FeatureFlagsApi.esm.js.map +1 -1
- package/dist/extensions/IconsApi.esm.js +8 -7
- package/dist/extensions/IconsApi.esm.js.map +1 -1
- package/dist/extensions/TranslationsApi.esm.js +4 -4
- package/dist/extensions/TranslationsApi.esm.js.map +1 -1
- package/dist/extensions/elements.esm.js +1 -1
- package/dist/extensions/elements.esm.js.map +1 -1
- package/dist/index.d.ts +84 -136
- package/dist/plugins/app/package.json.esm.js +23 -5
- package/dist/plugins/app/package.json.esm.js.map +1 -1
- package/package.json +41 -23
- package/dist/packages/app/src/components/Root/LogoFull.esm.js +0 -33
- package/dist/packages/app/src/components/Root/LogoFull.esm.js.map +0 -1
- package/dist/packages/app/src/components/Root/LogoIcon.esm.js +0 -33
- package/dist/packages/app/src/components/Root/LogoIcon.esm.js.map +0 -1
- package/dist/packages/core-app-api/src/apis/implementations/AnalyticsApi/NoOpAnalyticsApi.esm.js +0 -7
- package/dist/packages/core-app-api/src/apis/implementations/AnalyticsApi/NoOpAnalyticsApi.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @backstage/plugin-app
|
|
2
2
|
|
|
3
|
+
## 0.2.0-next.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 121899a: **BREAKING**: The `app-root-element` extension now only accepts `JSX.Element` in its `element` param, meaning overrides need to be updated.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- a08f95f: Added a new module for implementing public sign-in apps, exported as `appModulePublicSignIn` via the `/alpha` sub-path export. This replaces the `createPublicSignInApp` export from `@backstage/frontend-defaults`, which is now deprecated.
|
|
12
|
+
- 5d31d66: Updated the usage of the `RouterBlueprint` and `AppRootWrapperBlueprint` to use the lowercase `component` parameter
|
|
13
|
+
- 93b5e38: The default implementation of the Analytics API now collects and instantiates analytics implementations exposed via `AnalyticsImplementationBlueprint` extensions. If no such extensions are discovered, the API continues to do nothing with analytics events fired within Backstage. If multiple such extensions are discovered, every discovered implementation automatically receives analytics events.
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
- @backstage/frontend-plugin-api@0.11.0-next.1
|
|
16
|
+
- @backstage/core-components@0.17.5-next.1
|
|
17
|
+
- @backstage/core-plugin-api@1.10.9
|
|
18
|
+
- @backstage/integration-react@1.2.9
|
|
19
|
+
- @backstage/theme@0.6.8-next.0
|
|
20
|
+
- @backstage/types@1.2.1
|
|
21
|
+
- @backstage/plugin-permission-react@0.4.36
|
|
22
|
+
|
|
23
|
+
## 0.2.0-next.0
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- 29786f6: Updated the `app/nav` extension to use the new `NavContentBlueprint`, and removed support for extensions created with the now removed `NavLogoBlueprint`.
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- f2f133c: Internal update to use the new variant of `ApiBlueprint`.
|
|
32
|
+
- Updated dependencies
|
|
33
|
+
- @backstage/frontend-plugin-api@0.11.0-next.0
|
|
34
|
+
- @backstage/theme@0.6.8-next.0
|
|
35
|
+
- @backstage/core-components@0.17.5-next.0
|
|
36
|
+
- @backstage/core-plugin-api@1.10.9
|
|
37
|
+
- @backstage/integration-react@1.2.9
|
|
38
|
+
- @backstage/types@1.2.1
|
|
39
|
+
- @backstage/plugin-permission-react@0.4.36
|
|
40
|
+
|
|
3
41
|
## 0.1.11
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import appPlugin from '@backstage/plugin-app';
|
|
3
|
+
import { useAsync, useMountEffect } from '@react-hookz/web';
|
|
4
|
+
import { createFrontendModule, coreExtensionData, useApi, identityApiRef } from '@backstage/frontend-plugin-api';
|
|
5
|
+
|
|
6
|
+
function InternalCookieAuthRedirect() {
|
|
7
|
+
const identityApi = useApi(identityApiRef);
|
|
8
|
+
const [state, actions] = useAsync(async () => {
|
|
9
|
+
const { token } = await identityApi.getCredentials();
|
|
10
|
+
if (!token) {
|
|
11
|
+
throw new Error("Expected Backstage token in sign-in response");
|
|
12
|
+
}
|
|
13
|
+
return token;
|
|
14
|
+
});
|
|
15
|
+
useMountEffect(actions.execute);
|
|
16
|
+
if (state.status === "error" && state.error) {
|
|
17
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18
|
+
"An error occurred: ",
|
|
19
|
+
state.error.message
|
|
20
|
+
] });
|
|
21
|
+
}
|
|
22
|
+
if (state.status === "success" && state.result) {
|
|
23
|
+
return /* @__PURE__ */ jsxs(
|
|
24
|
+
"form",
|
|
25
|
+
{
|
|
26
|
+
ref: (form) => form?.submit(),
|
|
27
|
+
action: window.location.href,
|
|
28
|
+
method: "POST",
|
|
29
|
+
style: { visibility: "hidden" },
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsx("input", { type: "hidden", name: "type", value: "sign-in" }),
|
|
32
|
+
/* @__PURE__ */ jsx("input", { type: "hidden", name: "token", value: state.result }),
|
|
33
|
+
/* @__PURE__ */ jsx("input", { type: "submit", value: "Continue" })
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
const appModulePublicSignIn = createFrontendModule({
|
|
41
|
+
pluginId: "app",
|
|
42
|
+
extensions: [
|
|
43
|
+
appPlugin.getExtension("app/layout").override({
|
|
44
|
+
factory: () => [
|
|
45
|
+
coreExtensionData.reactElement(/* @__PURE__ */ jsx(InternalCookieAuthRedirect, {}))
|
|
46
|
+
]
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export { InternalCookieAuthRedirect, appModulePublicSignIn };
|
|
52
|
+
//# sourceMappingURL=appModulePublicSignIn.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appModulePublicSignIn.esm.js","sources":["../../src/alpha/appModulePublicSignIn.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 appPlugin from '@backstage/plugin-app';\nimport { useAsync, useMountEffect } from '@react-hookz/web';\nimport {\n coreExtensionData,\n createFrontendModule,\n identityApiRef,\n useApi,\n} from '@backstage/frontend-plugin-api';\n\n// This is a copy of the CookieAuthRedirect component from the auth-react\n// plugin, to avoid a dependency on that package. Long-term we want this to be\n// the only implementation and remove the one in auth-react once the old frontend system is gone.\n\n// TODO(Rugvip): Should this be part of the app plugin instead? since it owns the backend part of it.\n\n/** @internal */\nexport function InternalCookieAuthRedirect() {\n const identityApi = useApi(identityApiRef);\n\n const [state, actions] = useAsync(async () => {\n const { token } = await identityApi.getCredentials();\n if (!token) {\n throw new Error('Expected Backstage token in sign-in response');\n }\n return token;\n });\n\n useMountEffect(actions.execute);\n\n if (state.status === 'error' && state.error) {\n return <>An error occurred: {state.error.message}</>;\n }\n\n if (state.status === 'success' && state.result) {\n return (\n <form\n ref={form => form?.submit()}\n action={window.location.href}\n method=\"POST\"\n style={{ visibility: 'hidden' }}\n >\n <input type=\"hidden\" name=\"type\" value=\"sign-in\" />\n <input type=\"hidden\" name=\"token\" value={state.result} />\n <input type=\"submit\" value=\"Continue\" />\n </form>\n );\n }\n\n return null;\n}\n\n/**\n * This module is intended for use in public sign-in page apps, in the\n * `index-public-experimental.tsx` file.\n *\n * @remarks\n *\n * This module is used to enable the public sign-in flow where the build output\n * is split into one small publicly accessible app, and the full app protected\n * by auth.\n *\n * This module overrides the `app/layout` extension, which means that most\n * extension typically installed in an app will be ignored. However, you can\n * still for example install API and root element extensions.\n *\n * A typical setup of this app will only install a custom sign-in page.\n *\n * @example\n *\n *#### In `index-public-experimental.tsx`\n *\n *```ts\n *import { createApp } from '@backstage/frontend-defaults\n *import { appModulePublicSignIn } from '@backstage/plugin-app/alpha';\n *import { appModuleSignInPage } from './appModuleSignInPage';\n *\n *const app = createApp({\n * features: [appModuleSignInPage, appModulePublicSignIn],\n *});\n *```\n *\n *#### In `appModuleSignInPage.tsx`\n *\n *```tsx\n *import { createFrontendModule, SignInPageBlueprint } from '@backstage/frontend-plugin-api';\n *\n *export const appModuleSignInPage = createFrontendModule({\n * pluginId: 'app',\n * extensions: [\n * SignInPageBlueprint.make({\n * params: {\n * ...\n * }\n * }),\n * ],\n *})\n *```\n *\n * @alpha\n */\nexport const appModulePublicSignIn = createFrontendModule({\n pluginId: 'app',\n extensions: [\n appPlugin.getExtension('app/layout').override({\n factory: () => [\n coreExtensionData.reactElement(<InternalCookieAuthRedirect />),\n ],\n }),\n ],\n});\n"],"names":[],"mappings":";;;;;AAgCO,SAAS,0BAA6B,GAAA;AAC3C,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA;AAEzC,EAAA,MAAM,CAAC,KAAA,EAAO,OAAO,CAAA,GAAI,SAAS,YAAY;AAC5C,IAAA,MAAM,EAAE,KAAA,EAAU,GAAA,MAAM,YAAY,cAAe,EAAA;AACnD,IAAA,IAAI,CAAC,KAAO,EAAA;AACV,MAAM,MAAA,IAAI,MAAM,8CAA8C,CAAA;AAAA;AAEhE,IAAO,OAAA,KAAA;AAAA,GACR,CAAA;AAED,EAAA,cAAA,CAAe,QAAQ,OAAO,CAAA;AAE9B,EAAA,IAAI,KAAM,CAAA,MAAA,KAAW,OAAW,IAAA,KAAA,CAAM,KAAO,EAAA;AAC3C,IAAA,uBAAS,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,MAAA,qBAAA;AAAA,MAAoB,MAAM,KAAM,CAAA;AAAA,KAAQ,EAAA,CAAA;AAAA;AAGnD,EAAA,IAAI,KAAM,CAAA,MAAA,KAAW,SAAa,IAAA,KAAA,CAAM,MAAQ,EAAA;AAC9C,IACE,uBAAA,IAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,GAAA,EAAK,CAAQ,IAAA,KAAA,IAAA,EAAM,MAAO,EAAA;AAAA,QAC1B,MAAA,EAAQ,OAAO,QAAS,CAAA,IAAA;AAAA,QACxB,MAAO,EAAA,MAAA;AAAA,QACP,KAAA,EAAO,EAAE,UAAA,EAAY,QAAS,EAAA;AAAA,QAE9B,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,WAAM,IAAK,EAAA,QAAA,EAAS,IAAK,EAAA,MAAA,EAAO,OAAM,SAAU,EAAA,CAAA;AAAA,0BACjD,GAAA,CAAC,WAAM,IAAK,EAAA,QAAA,EAAS,MAAK,OAAQ,EAAA,KAAA,EAAO,MAAM,MAAQ,EAAA,CAAA;AAAA,0BACtD,GAAA,CAAA,OAAA,EAAA,EAAM,IAAK,EAAA,QAAA,EAAS,OAAM,UAAW,EAAA;AAAA;AAAA;AAAA,KACxC;AAAA;AAIJ,EAAO,OAAA,IAAA;AACT;AAmDO,MAAM,wBAAwB,oBAAqB,CAAA;AAAA,EACxD,QAAU,EAAA,KAAA;AAAA,EACV,UAAY,EAAA;AAAA,IACV,SAAU,CAAA,YAAA,CAAa,YAAY,CAAA,CAAE,QAAS,CAAA;AAAA,MAC5C,SAAS,MAAM;AAAA,QACb,iBAAkB,CAAA,YAAA,iBAAc,GAAA,CAAA,0BAAA,EAAA,EAA2B,CAAE;AAAA;AAC/D,KACD;AAAA;AAEL,CAAC;;;;"}
|
package/dist/alpha.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This module is intended for use in public sign-in page apps, in the
|
|
5
|
+
* `index-public-experimental.tsx` file.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
*
|
|
9
|
+
* This module is used to enable the public sign-in flow where the build output
|
|
10
|
+
* is split into one small publicly accessible app, and the full app protected
|
|
11
|
+
* by auth.
|
|
12
|
+
*
|
|
13
|
+
* This module overrides the `app/layout` extension, which means that most
|
|
14
|
+
* extension typically installed in an app will be ignored. However, you can
|
|
15
|
+
* still for example install API and root element extensions.
|
|
16
|
+
*
|
|
17
|
+
* A typical setup of this app will only install a custom sign-in page.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
*
|
|
21
|
+
*#### In `index-public-experimental.tsx`
|
|
22
|
+
*
|
|
23
|
+
*```ts
|
|
24
|
+
*import { createApp } from '@backstage/frontend-defaults
|
|
25
|
+
*import { appModulePublicSignIn } from '@backstage/plugin-app/alpha';
|
|
26
|
+
*import { appModuleSignInPage } from './appModuleSignInPage';
|
|
27
|
+
*
|
|
28
|
+
*const app = createApp({
|
|
29
|
+
* features: [appModuleSignInPage, appModulePublicSignIn],
|
|
30
|
+
*});
|
|
31
|
+
*```
|
|
32
|
+
*
|
|
33
|
+
*#### In `appModuleSignInPage.tsx`
|
|
34
|
+
*
|
|
35
|
+
*```tsx
|
|
36
|
+
*import { createFrontendModule, SignInPageBlueprint } from '@backstage/frontend-plugin-api';
|
|
37
|
+
*
|
|
38
|
+
*export const appModuleSignInPage = createFrontendModule({
|
|
39
|
+
* pluginId: 'app',
|
|
40
|
+
* extensions: [
|
|
41
|
+
* SignInPageBlueprint.make({
|
|
42
|
+
* params: {
|
|
43
|
+
* ...
|
|
44
|
+
* }
|
|
45
|
+
* }),
|
|
46
|
+
* ],
|
|
47
|
+
*})
|
|
48
|
+
*```
|
|
49
|
+
*
|
|
50
|
+
* @alpha
|
|
51
|
+
*/
|
|
52
|
+
declare const appModulePublicSignIn: _backstage_frontend_plugin_api.FrontendModule;
|
|
53
|
+
|
|
54
|
+
export { appModulePublicSignIn };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|