@backstage/plugin-scaffolder 1.10.0 → 1.11.0-next.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 +28 -0
- package/alpha/package.json +1 -1
- package/dist/esm/{Router-77e86b6b.esm.js → Router-73a659c0.esm.js} +6 -13
- package/dist/esm/Router-73a659c0.esm.js.map +1 -0
- package/dist/esm/{default-40114591.esm.js → default-35e63cd4.esm.js} +2 -2
- package/dist/esm/{default-40114591.esm.js.map → default-35e63cd4.esm.js.map} +1 -1
- package/dist/esm/{index-4dbb353c.esm.js → index-42d9f897.esm.js} +14 -112
- package/dist/esm/index-42d9f897.esm.js.map +1 -0
- package/dist/esm/{index-690bf85d.esm.js → index-88194b1f.esm.js} +52 -6
- package/dist/esm/index-88194b1f.esm.js.map +1 -0
- package/dist/index.alpha.d.ts +14 -26
- package/dist/index.beta.d.ts +12 -24
- package/dist/index.d.ts +12 -24
- package/dist/index.esm.js +1 -1
- package/package.json +11 -11
- package/dist/esm/Router-77e86b6b.esm.js.map +0 -1
- package/dist/esm/index-4dbb353c.esm.js.map +0 -1
- package/dist/esm/index-690bf85d.esm.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EntityPicker,
|
|
1
|
+
import { E as EntityPicker, i as EntityPickerSchema, j as EntityNamePicker, k as entityNamePickerValidation, m as EntityNamePickerSchema, n as EntityTagsPicker, o as EntityTagsPickerSchema, R as RepoUrlPicker, p as repoPickerValidation, q as RepoUrlPickerSchema, O as OwnerPicker, t as OwnerPickerSchema, u as OwnedEntityPicker, w as OwnedEntityPickerSchema } from './index-42d9f897.esm.js';
|
|
2
2
|
|
|
3
3
|
const DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS = [
|
|
4
4
|
{
|
|
@@ -36,4 +36,4 @@ const DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS = [
|
|
|
36
36
|
];
|
|
37
37
|
|
|
38
38
|
export { DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS as D };
|
|
39
|
-
//# sourceMappingURL=default-
|
|
39
|
+
//# sourceMappingURL=default-35e63cd4.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-
|
|
1
|
+
{"version":3,"file":"default-35e63cd4.esm.js","sources":["../../src/extensions/default.ts"],"sourcesContent":["/*\n * Copyright 2021 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 */\nimport {\n EntityPicker,\n EntityPickerSchema,\n} from '../components/fields/EntityPicker/EntityPicker';\nimport {\n EntityNamePicker,\n EntityNamePickerSchema,\n} from '../components/fields/EntityNamePicker/EntityNamePicker';\nimport { entityNamePickerValidation } from '../components/fields/EntityNamePicker/validation';\nimport {\n EntityTagsPicker,\n EntityTagsPickerSchema,\n} from '../components/fields/EntityTagsPicker/EntityTagsPicker';\nimport {\n OwnerPicker,\n OwnerPickerSchema,\n} from '../components/fields/OwnerPicker/OwnerPicker';\nimport {\n RepoUrlPicker,\n RepoUrlPickerSchema,\n} from '../components/fields/RepoUrlPicker/RepoUrlPicker';\nimport { repoPickerValidation } from '../components/fields/RepoUrlPicker/validation';\nimport {\n OwnedEntityPicker,\n OwnedEntityPickerSchema,\n} from '../components/fields/OwnedEntityPicker/OwnedEntityPicker';\n\nexport const DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS = [\n {\n component: EntityPicker,\n name: 'EntityPicker',\n schema: EntityPickerSchema,\n },\n {\n component: EntityNamePicker,\n name: 'EntityNamePicker',\n validation: entityNamePickerValidation,\n schema: EntityNamePickerSchema,\n },\n {\n component: EntityTagsPicker,\n name: 'EntityTagsPicker',\n schema: EntityTagsPickerSchema,\n },\n {\n component: RepoUrlPicker,\n name: 'RepoUrlPicker',\n validation: repoPickerValidation,\n schema: RepoUrlPickerSchema,\n },\n {\n component: OwnerPicker,\n name: 'OwnerPicker',\n schema: OwnerPickerSchema,\n },\n {\n component: OwnedEntityPicker,\n name: 'OwnedEntityPicker',\n schema: OwnedEntityPickerSchema,\n },\n];\n"],"names":[],"mappings":";;AA0CO,MAAM,mCAAsC,GAAA;AAAA,EACjD;AAAA,IACE,SAAW,EAAA,YAAA;AAAA,IACX,IAAM,EAAA,cAAA;AAAA,IACN,MAAQ,EAAA,kBAAA;AAAA,GACV;AAAA,EACA;AAAA,IACE,SAAW,EAAA,gBAAA;AAAA,IACX,IAAM,EAAA,kBAAA;AAAA,IACN,UAAY,EAAA,0BAAA;AAAA,IACZ,MAAQ,EAAA,sBAAA;AAAA,GACV;AAAA,EACA;AAAA,IACE,SAAW,EAAA,gBAAA;AAAA,IACX,IAAM,EAAA,kBAAA;AAAA,IACN,MAAQ,EAAA,sBAAA;AAAA,GACV;AAAA,EACA;AAAA,IACE,SAAW,EAAA,aAAA;AAAA,IACX,IAAM,EAAA,eAAA;AAAA,IACN,UAAY,EAAA,oBAAA;AAAA,IACZ,MAAQ,EAAA,mBAAA;AAAA,GACV;AAAA,EACA;AAAA,IACE,SAAW,EAAA,WAAA;AAAA,IACX,IAAM,EAAA,aAAA;AAAA,IACN,MAAQ,EAAA,iBAAA;AAAA,GACV;AAAA,EACA;AAAA,IACE,SAAW,EAAA,iBAAA;AAAA,IACX,IAAM,EAAA,mBAAA;AAAA,IACN,MAAQ,EAAA,uBAAA;AAAA,GACV;AACF;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { parseEntityRef, KubernetesValidatorFunctions, RELATION_OWNED_BY, makeValidator
|
|
1
|
+
import { parseEntityRef, KubernetesValidatorFunctions, RELATION_OWNED_BY, makeValidator } from '@backstage/catalog-model';
|
|
2
2
|
import { ResponseError } from '@backstage/errors';
|
|
3
3
|
import qs from 'qs';
|
|
4
4
|
import ObservableImpl from 'zen-observable';
|
|
5
|
-
import { attachComponentData, useApi, identityApiRef, createExternalRouteRef, createRouteRef, createSubRouteRef, useRouteRef, useRouteRefParams, errorApiRef, AnalyticsContext, createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createRoutableExtension, alertApiRef, useApp } from '@backstage/core-plugin-api';
|
|
6
5
|
import { scmIntegrationsApiRef, scmAuthApiRef } from '@backstage/integration-react';
|
|
7
|
-
import { scaffolderApiRef as scaffolderApiRef$1, useTemplateSecrets as useTemplateSecrets$1,
|
|
6
|
+
import { scaffolderApiRef as scaffolderApiRef$1, useTemplateSecrets as useTemplateSecrets$1, createScaffolderFieldExtension as createScaffolderFieldExtension$1, ScaffolderFieldExtensions as ScaffolderFieldExtensions$1, createScaffolderLayout as createScaffolderLayout$1, ScaffolderLayouts as ScaffolderLayouts$1 } from '@backstage/plugin-scaffolder-react';
|
|
7
|
+
import { useApi, identityApiRef, createExternalRouteRef, createRouteRef, createSubRouteRef, createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createRoutableExtension, alertApiRef, useApp, useRouteRef, useRouteRefParams } from '@backstage/core-plugin-api';
|
|
8
8
|
import { catalogApiRef, humanizeEntityRef, useEntityTypeFilter, entityRouteRef } from '@backstage/plugin-catalog-react';
|
|
9
|
-
import { TextField, FormControl as FormControl$1,
|
|
9
|
+
import { TextField, FormControl as FormControl$1, Box, Typography, FormControlLabel, Checkbox, makeStyles, Grid, StepButton, Paper, Button, CircularProgress } from '@material-ui/core';
|
|
10
10
|
import FormControl from '@material-ui/core/FormControl';
|
|
11
11
|
import Autocomplete from '@material-ui/lab/Autocomplete';
|
|
12
12
|
import React, { useCallback, useEffect, useState, useMemo, useRef, memo } from 'react';
|
|
@@ -16,11 +16,11 @@ import zodToJsonSchema from 'zod-to-json-schema';
|
|
|
16
16
|
import FormHelperText from '@material-ui/core/FormHelperText';
|
|
17
17
|
import Input from '@material-ui/core/Input';
|
|
18
18
|
import InputLabel from '@material-ui/core/InputLabel';
|
|
19
|
-
import { Select, Progress,
|
|
19
|
+
import { Select, Progress, DismissableBanner, Link, Page, Header, Content, ErrorPage, LogViewer } from '@backstage/core-components';
|
|
20
20
|
import useDebounce from 'react-use/lib/useDebounce';
|
|
21
21
|
import useEffectOnce from 'react-use/lib/useEffectOnce';
|
|
22
22
|
import { Autocomplete as Autocomplete$1 } from '@material-ui/lab';
|
|
23
|
-
import { useNavigate
|
|
23
|
+
import { useNavigate } from 'react-router-dom';
|
|
24
24
|
import capitalize from 'lodash/capitalize';
|
|
25
25
|
import CheckBoxIcon from '@material-ui/icons/CheckBox';
|
|
26
26
|
import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';
|
|
@@ -34,7 +34,7 @@ import '@backstage/plugin-permission-react';
|
|
|
34
34
|
import Grid$1 from '@material-ui/core/Grid';
|
|
35
35
|
import Step from '@material-ui/core/Step';
|
|
36
36
|
import StepLabel from '@material-ui/core/StepLabel';
|
|
37
|
-
import Stepper
|
|
37
|
+
import Stepper from '@material-ui/core/Stepper';
|
|
38
38
|
import { makeStyles as makeStyles$1, createStyles } from '@material-ui/core/styles';
|
|
39
39
|
import Typography$1 from '@material-ui/core/Typography';
|
|
40
40
|
import Cancel from '@material-ui/icons/Cancel';
|
|
@@ -242,20 +242,6 @@ class ScaffolderClient {
|
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
const LAYOUTS_KEY = "scaffolder.layout.v1";
|
|
246
|
-
const LAYOUTS_WRAPPER_KEY = "scaffolder.layouts.wrapper.v1";
|
|
247
|
-
function createScaffolderLayout(options) {
|
|
248
|
-
return {
|
|
249
|
-
expose() {
|
|
250
|
-
const LayoutDataHolder = () => null;
|
|
251
|
-
attachComponentData(LayoutDataHolder, LAYOUTS_KEY, options);
|
|
252
|
-
return LayoutDataHolder;
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
const ScaffolderLayouts = () => null;
|
|
257
|
-
attachComponentData(ScaffolderLayouts, LAYOUTS_WRAPPER_KEY, true);
|
|
258
|
-
|
|
259
245
|
function makeFieldSchemaFromZod(returnSchema, uiOptionsSchema) {
|
|
260
246
|
return {
|
|
261
247
|
schema: {
|
|
@@ -1279,92 +1265,6 @@ const nextScaffolderTaskRouteRef = createSubRouteRef({
|
|
|
1279
1265
|
path: "/tasks/:taskId"
|
|
1280
1266
|
});
|
|
1281
1267
|
|
|
1282
|
-
const useStyles$2 = makeStyles(() => ({
|
|
1283
|
-
markdown: {
|
|
1284
|
-
/** to make the styles for React Markdown not leak into the description */
|
|
1285
|
-
"& :first-child": {
|
|
1286
|
-
marginTop: 0
|
|
1287
|
-
},
|
|
1288
|
-
"& :last-child": {
|
|
1289
|
-
marginBottom: 0
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
}));
|
|
1293
|
-
const useTemplateParameterSchema = (templateRef) => {
|
|
1294
|
-
const scaffolderApi = useApi(scaffolderApiRef$1);
|
|
1295
|
-
const { value, loading, error } = useAsync(
|
|
1296
|
-
() => scaffolderApi.getTemplateParameterSchema(templateRef),
|
|
1297
|
-
[scaffolderApi, templateRef]
|
|
1298
|
-
);
|
|
1299
|
-
return { manifest: value, loading, error };
|
|
1300
|
-
};
|
|
1301
|
-
const TemplateWizardPage = (props) => {
|
|
1302
|
-
var _a;
|
|
1303
|
-
const styles = useStyles$2();
|
|
1304
|
-
const rootRef = useRouteRef(nextRouteRef);
|
|
1305
|
-
const taskRoute = useRouteRef(scaffolderTaskRouteRef);
|
|
1306
|
-
const { secrets } = useTemplateSecrets$1();
|
|
1307
|
-
const scaffolderApi = useApi(scaffolderApiRef$1);
|
|
1308
|
-
const navigate = useNavigate();
|
|
1309
|
-
const { templateName, namespace } = useRouteRefParams(
|
|
1310
|
-
selectedTemplateRouteRef
|
|
1311
|
-
);
|
|
1312
|
-
const templateRef = stringifyEntityRef({
|
|
1313
|
-
kind: "Template",
|
|
1314
|
-
namespace,
|
|
1315
|
-
name: templateName
|
|
1316
|
-
});
|
|
1317
|
-
const errorApi = useApi(errorApiRef);
|
|
1318
|
-
const { loading, manifest, error } = useTemplateParameterSchema(templateRef);
|
|
1319
|
-
const onComplete = async (values) => {
|
|
1320
|
-
const { taskId } = await scaffolderApi.scaffold({
|
|
1321
|
-
templateRef,
|
|
1322
|
-
values,
|
|
1323
|
-
secrets
|
|
1324
|
-
});
|
|
1325
|
-
navigate(taskRoute({ taskId }));
|
|
1326
|
-
};
|
|
1327
|
-
useEffect(() => {
|
|
1328
|
-
if (error) {
|
|
1329
|
-
errorApi.post(new Error(`Failed to load template, ${error}`));
|
|
1330
|
-
}
|
|
1331
|
-
}, [error, errorApi]);
|
|
1332
|
-
if (error) {
|
|
1333
|
-
return /* @__PURE__ */ React.createElement(Navigate, { to: rootRef() });
|
|
1334
|
-
}
|
|
1335
|
-
return /* @__PURE__ */ React.createElement(AnalyticsContext, { attributes: { entityRef: templateRef } }, /* @__PURE__ */ React.createElement(Page, { themeId: "website" }, /* @__PURE__ */ React.createElement(
|
|
1336
|
-
Header,
|
|
1337
|
-
{
|
|
1338
|
-
pageTitleOverride: "Create a new component",
|
|
1339
|
-
title: "Create a new component",
|
|
1340
|
-
subtitle: "Create new software components using standard templates in your organization"
|
|
1341
|
-
}
|
|
1342
|
-
), /* @__PURE__ */ React.createElement(Content, null, loading && /* @__PURE__ */ React.createElement(Progress, null), manifest && /* @__PURE__ */ React.createElement(
|
|
1343
|
-
InfoCard,
|
|
1344
|
-
{
|
|
1345
|
-
title: manifest.title,
|
|
1346
|
-
subheader: /* @__PURE__ */ React.createElement(
|
|
1347
|
-
MarkdownContent,
|
|
1348
|
-
{
|
|
1349
|
-
className: styles.markdown,
|
|
1350
|
-
content: (_a = manifest.description) != null ? _a : "No description"
|
|
1351
|
-
}
|
|
1352
|
-
),
|
|
1353
|
-
noPadding: true,
|
|
1354
|
-
titleTypographyProps: { component: "h2" }
|
|
1355
|
-
},
|
|
1356
|
-
/* @__PURE__ */ React.createElement(
|
|
1357
|
-
Stepper,
|
|
1358
|
-
{
|
|
1359
|
-
manifest,
|
|
1360
|
-
extensions: props.customFieldExtensions,
|
|
1361
|
-
onComplete,
|
|
1362
|
-
FormProps: props.FormProps
|
|
1363
|
-
}
|
|
1364
|
-
)
|
|
1365
|
-
))));
|
|
1366
|
-
};
|
|
1367
|
-
|
|
1368
1268
|
const scaffolderPlugin = createPlugin({
|
|
1369
1269
|
id: "scaffolder",
|
|
1370
1270
|
apis: [
|
|
@@ -1427,7 +1327,7 @@ const OwnerPickerFieldExtension = scaffolderPlugin.provide(
|
|
|
1427
1327
|
const ScaffolderPage = scaffolderPlugin.provide(
|
|
1428
1328
|
createRoutableExtension({
|
|
1429
1329
|
name: "ScaffolderPage",
|
|
1430
|
-
component: () => import('./Router-
|
|
1330
|
+
component: () => import('./Router-73a659c0.esm.js').then((m) => m.Router),
|
|
1431
1331
|
mountPoint: rootRouteRef$1
|
|
1432
1332
|
})
|
|
1433
1333
|
);
|
|
@@ -1448,7 +1348,7 @@ const EntityTagsPickerFieldExtension = scaffolderPlugin.provide(
|
|
|
1448
1348
|
const NextScaffolderPage = scaffolderPlugin.provide(
|
|
1449
1349
|
createRoutableExtension({
|
|
1450
1350
|
name: "NextScaffolderPage",
|
|
1451
|
-
component: () => import('./index-
|
|
1351
|
+
component: () => import('./index-88194b1f.esm.js').then((m) => m.Router),
|
|
1452
1352
|
mountPoint: nextRouteRef
|
|
1453
1353
|
})
|
|
1454
1354
|
);
|
|
@@ -1773,7 +1673,7 @@ const TaskStatusStepper = memo(
|
|
|
1773
1673
|
const { steps, currentStepId, onUserStepChange } = props;
|
|
1774
1674
|
const classes = useStyles(props);
|
|
1775
1675
|
return /* @__PURE__ */ React.createElement("div", { className: classes.root }, /* @__PURE__ */ React.createElement(
|
|
1776
|
-
Stepper
|
|
1676
|
+
Stepper,
|
|
1777
1677
|
{
|
|
1778
1678
|
activeStep: steps.findIndex((s) => s.id === currentStepId),
|
|
1779
1679
|
orientation: "vertical",
|
|
@@ -1906,6 +1806,8 @@ const createScaffolderFieldExtension = createScaffolderFieldExtension$1;
|
|
|
1906
1806
|
const ScaffolderFieldExtensions = ScaffolderFieldExtensions$1;
|
|
1907
1807
|
const useTemplateSecrets = useTemplateSecrets$1;
|
|
1908
1808
|
const scaffolderApiRef = scaffolderApiRef$1;
|
|
1809
|
+
const createScaffolderLayout = createScaffolderLayout$1;
|
|
1810
|
+
const ScaffolderLayouts = ScaffolderLayouts$1;
|
|
1909
1811
|
|
|
1910
|
-
export {
|
|
1911
|
-
//# sourceMappingURL=index-
|
|
1812
|
+
export { EntityNamePickerFieldExtension as A, EntityTagsPickerFieldExtension as B, OwnerPickerFieldExtension as C, OwnedEntityPickerFieldExtension as D, EntityPicker as E, RepoUrlPickerFieldExtension as F, ScaffolderPage as G, scaffolderPlugin as H, nextScaffolderTaskRouteRef as I, makeFieldSchemaFromZod as J, EntityPickerFieldSchema as K, OwnerPickerFieldSchema as L, RepoUrlPickerFieldSchema as M, NextScaffolderPage as N, OwnerPicker as O, OwnedEntityPickerFieldSchema as P, EntityTagsPickerFieldSchema as Q, RepoUrlPicker as R, ScaffolderClient as S, TemplateTypePicker as T, rootRouteRef as U, createScaffolderFieldExtension as V, ScaffolderFieldExtensions as W, useTemplateSecrets as X, scaffolderApiRef as Y, createScaffolderLayout as Z, ScaffolderLayouts as _, actionsRouteRef as a, scaffolderListTaskRouteRef as b, scaffolderTaskRouteRef as c, rootRouteRef$1 as d, editRouteRef as e, TaskStatusStepper as f, TaskPageLinks as g, TaskPage as h, EntityPickerSchema as i, EntityNamePicker as j, entityNamePickerValidation as k, legacySelectedTemplateRouteRef as l, EntityNamePickerSchema as m, EntityTagsPicker as n, EntityTagsPickerSchema as o, repoPickerValidation as p, RepoUrlPickerSchema as q, registerComponentRouteRef as r, selectedTemplateRouteRef as s, OwnerPickerSchema as t, OwnedEntityPicker as u, viewTechDocRouteRef as v, OwnedEntityPickerSchema as w, nextSelectedTemplateRouteRef as x, nextRouteRef as y, EntityPickerFieldExtension as z };
|
|
1813
|
+
//# sourceMappingURL=index-42d9f897.esm.js.map
|