@backstage/plugin-scaffolder 1.27.4-next.2 → 1.27.5-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 CHANGED
@@ -1,5 +1,55 @@
1
1
  # @backstage/plugin-scaffolder
2
2
 
3
+ ## 1.27.5-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 3107f1f: Fixed a bug in the BitbucketRepoBranchPicker component that crashed the scaffolder
8
+ - 3edf7e7: Add schema output return type to the `makeFieldSchema` function return
9
+ - Updated dependencies
10
+ - @backstage/plugin-scaffolder-react@1.14.4-next.0
11
+ - @backstage/frontend-plugin-api@0.9.5-next.0
12
+ - @backstage/catalog-client@1.9.1
13
+ - @backstage/catalog-model@1.7.3
14
+ - @backstage/core-compat-api@0.3.6-next.0
15
+ - @backstage/core-components@0.16.3
16
+ - @backstage/core-plugin-api@1.10.3
17
+ - @backstage/errors@1.2.7
18
+ - @backstage/integration@1.16.1
19
+ - @backstage/integration-react@1.2.3
20
+ - @backstage/types@1.2.1
21
+ - @backstage/plugin-catalog-common@1.1.3
22
+ - @backstage/plugin-catalog-react@1.15.2-next.0
23
+ - @backstage/plugin-permission-react@0.4.30
24
+ - @backstage/plugin-scaffolder-common@1.5.9
25
+
26
+ ## 1.27.4
27
+
28
+ ### Patch Changes
29
+
30
+ - d8f9079: Updated dependency `@rjsf/utils` to `5.23.2`.
31
+ Updated dependency `@rjsf/core` to `5.23.2`.
32
+ Updated dependency `@rjsf/material-ui` to `5.23.2`.
33
+ Updated dependency `@rjsf/validator-ajv8` to `5.23.2`.
34
+ - 4756287: Added support for `FormDecoratorBlueprint` to create form decorators in the Scaffolder plugin
35
+ - 3f09ef4: Fix issue with `secrets` not being forwarded properly to the backend when creating a task
36
+ - Updated dependencies
37
+ - @backstage/plugin-catalog-react@1.15.1
38
+ - @backstage/plugin-scaffolder-react@1.14.3
39
+ - @backstage/frontend-plugin-api@0.9.4
40
+ - @backstage/core-plugin-api@1.10.3
41
+ - @backstage/types@1.2.1
42
+ - @backstage/core-components@0.16.3
43
+ - @backstage/integration@1.16.1
44
+ - @backstage/catalog-client@1.9.1
45
+ - @backstage/catalog-model@1.7.3
46
+ - @backstage/core-compat-api@0.3.5
47
+ - @backstage/errors@1.2.7
48
+ - @backstage/integration-react@1.2.3
49
+ - @backstage/plugin-catalog-common@1.1.3
50
+ - @backstage/plugin-permission-react@0.4.30
51
+ - @backstage/plugin-scaffolder-common@1.5.9
52
+
3
53
  ## 1.27.4-next.2
4
54
 
5
55
  ### Patch Changes
@@ -1,3 +1,7 @@
1
+ import { ApiBlueprint, createExtensionInput, createApiFactory } from '@backstage/frontend-plugin-api';
2
+ import { formDecoratorsApiRef } from './ref.esm.js';
3
+ import { FormDecoratorBlueprint } from '@backstage/plugin-scaffolder-react/alpha';
4
+
1
5
  class DefaultScaffolderFormDecoratorsApi {
2
6
  constructor(options) {
3
7
  this.options = options;
@@ -11,6 +15,28 @@ class DefaultScaffolderFormDecoratorsApi {
11
15
  return this.options.decorators;
12
16
  }
13
17
  }
18
+ const formDecoratorsApi = ApiBlueprint.makeWithOverrides({
19
+ name: "form-decorators",
20
+ inputs: {
21
+ formDecorators: createExtensionInput([
22
+ FormDecoratorBlueprint.dataRefs.formDecoratorLoader
23
+ ])
24
+ },
25
+ factory(originalFactory, { inputs }) {
26
+ const formDecorators = inputs.formDecorators.map(
27
+ (e) => e.get(FormDecoratorBlueprint.dataRefs.formDecoratorLoader)
28
+ );
29
+ return originalFactory({
30
+ factory: createApiFactory({
31
+ api: formDecoratorsApiRef,
32
+ deps: {},
33
+ factory: () => DefaultScaffolderFormDecoratorsApi.create({
34
+ decorators: formDecorators
35
+ })
36
+ })
37
+ });
38
+ }
39
+ });
14
40
 
15
- export { DefaultScaffolderFormDecoratorsApi };
41
+ export { DefaultScaffolderFormDecoratorsApi, formDecoratorsApi };
16
42
  //# sourceMappingURL=FormDecoratorsApi.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormDecoratorsApi.esm.js","sources":["../../../src/alpha/api/FormDecoratorsApi.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { ScaffolderFormDecoratorsApi } from './types';\nimport { ScaffolderFormDecorator } from '@backstage/plugin-scaffolder-react/alpha';\n\n/** @alpha */\nexport class DefaultScaffolderFormDecoratorsApi\n implements ScaffolderFormDecoratorsApi\n{\n private constructor(\n private readonly options: {\n decorators: Array<ScaffolderFormDecorator>;\n },\n ) {}\n\n static create(options?: { decorators: ScaffolderFormDecorator[] }) {\n return new DefaultScaffolderFormDecoratorsApi(\n options ?? { decorators: [] },\n );\n }\n\n async getFormDecorators(): Promise<ScaffolderFormDecorator[]> {\n return this.options.decorators;\n }\n}\n"],"names":[],"mappings":"AAoBO,MAAM,kCAEb,CAAA;AAAA,EACU,YACW,OAGjB,EAAA;AAHiB,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAAA;AAGhB,EAEH,OAAO,OAAO,OAAqD,EAAA;AACjE,IAAA,OAAO,IAAI,kCAAA;AAAA,MACT,OAAW,IAAA,EAAE,UAAY,EAAA,EAAG;AAAA,KAC9B;AAAA;AACF,EAEA,MAAM,iBAAwD,GAAA;AAC5D,IAAA,OAAO,KAAK,OAAQ,CAAA,UAAA;AAAA;AAExB;;;;"}
1
+ {"version":3,"file":"FormDecoratorsApi.esm.js","sources":["../../../src/alpha/api/FormDecoratorsApi.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {\n ApiBlueprint,\n createApiFactory,\n createExtensionInput,\n} from '@backstage/frontend-plugin-api';\nimport { ScaffolderFormDecoratorsApi } from './types';\nimport { ScaffolderFormDecorator } from '@backstage/plugin-scaffolder-react/alpha';\nimport { formDecoratorsApiRef } from './ref';\nimport { FormDecoratorBlueprint } from '@backstage/plugin-scaffolder-react/alpha';\n\n/** @alpha */\nexport class DefaultScaffolderFormDecoratorsApi\n implements ScaffolderFormDecoratorsApi\n{\n private constructor(\n private readonly options: {\n decorators: Array<ScaffolderFormDecorator>;\n },\n ) {}\n\n static create(options?: { decorators: ScaffolderFormDecorator[] }) {\n return new DefaultScaffolderFormDecoratorsApi(\n options ?? { decorators: [] },\n );\n }\n\n async getFormDecorators(): Promise<ScaffolderFormDecorator[]> {\n return this.options.decorators;\n }\n}\n\n/** @alpha */\nexport const formDecoratorsApi = ApiBlueprint.makeWithOverrides({\n name: 'form-decorators',\n inputs: {\n formDecorators: createExtensionInput([\n FormDecoratorBlueprint.dataRefs.formDecoratorLoader,\n ]),\n },\n factory(originalFactory, { inputs }) {\n const formDecorators = inputs.formDecorators.map(e =>\n e.get(FormDecoratorBlueprint.dataRefs.formDecoratorLoader),\n );\n\n return originalFactory({\n factory: createApiFactory({\n api: formDecoratorsApiRef,\n deps: {},\n factory: () =>\n DefaultScaffolderFormDecoratorsApi.create({\n decorators: formDecorators,\n }),\n }),\n });\n },\n});\n"],"names":[],"mappings":";;;;AA2BO,MAAM,kCAEb,CAAA;AAAA,EACU,YACW,OAGjB,EAAA;AAHiB,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAAA;AAGhB,EAEH,OAAO,OAAO,OAAqD,EAAA;AACjE,IAAA,OAAO,IAAI,kCAAA;AAAA,MACT,OAAW,IAAA,EAAE,UAAY,EAAA,EAAG;AAAA,KAC9B;AAAA;AACF,EAEA,MAAM,iBAAwD,GAAA;AAC5D,IAAA,OAAO,KAAK,OAAQ,CAAA,UAAA;AAAA;AAExB;AAGa,MAAA,iBAAA,GAAoB,aAAa,iBAAkB,CAAA;AAAA,EAC9D,IAAM,EAAA,iBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,gBAAgB,oBAAqB,CAAA;AAAA,MACnC,uBAAuB,QAAS,CAAA;AAAA,KACjC;AAAA,GACH;AAAA,EACA,OAAQ,CAAA,eAAA,EAAiB,EAAE,MAAA,EAAU,EAAA;AACnC,IAAM,MAAA,cAAA,GAAiB,OAAO,cAAe,CAAA,GAAA;AAAA,MAAI,CAC/C,CAAA,KAAA,CAAA,CAAE,GAAI,CAAA,sBAAA,CAAuB,SAAS,mBAAmB;AAAA,KAC3D;AAEA,IAAA,OAAO,eAAgB,CAAA;AAAA,MACrB,SAAS,gBAAiB,CAAA;AAAA,QACxB,GAAK,EAAA,oBAAA;AAAA,QACL,MAAM,EAAC;AAAA,QACP,OAAA,EAAS,MACP,kCAAA,CAAmC,MAAO,CAAA;AAAA,UACxC,UAAY,EAAA;AAAA,SACb;AAAA,OACJ;AAAA,KACF,CAAA;AAAA;AAEL,CAAC;;;;"}
@@ -3,6 +3,8 @@ import { createFrontendPlugin } from '@backstage/frontend-plugin-api';
3
3
  import { rootRouteRef, selectedTemplateRouteRef, scaffolderTaskRouteRef, actionsRouteRef, scaffolderListTaskRouteRef, editRouteRef, registerComponentRouteRef, viewTechDocRouteRef } from '../routes.esm.js';
4
4
  import { scaffolderApi, scaffolderPage, scaffolderNavItem, repoUrlPickerFormField } from './extensions.esm.js';
5
5
  import { formFieldsApi } from '@backstage/plugin-scaffolder-react/alpha';
6
+ import './api/ref.esm.js';
7
+ import { formDecoratorsApi } from './api/FormDecoratorsApi.esm.js';
6
8
 
7
9
  var plugin = createFrontendPlugin({
8
10
  id: "scaffolder",
@@ -22,6 +24,7 @@ var plugin = createFrontendPlugin({
22
24
  scaffolderApi,
23
25
  scaffolderPage,
24
26
  scaffolderNavItem,
27
+ formDecoratorsApi,
25
28
  formFieldsApi,
26
29
  repoUrlPickerFormField
27
30
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 { convertLegacyRouteRefs } from '@backstage/core-compat-api';\nimport { createFrontendPlugin } from '@backstage/frontend-plugin-api';\nimport {\n rootRouteRef,\n actionsRouteRef,\n editRouteRef,\n registerComponentRouteRef,\n scaffolderListTaskRouteRef,\n scaffolderTaskRouteRef,\n selectedTemplateRouteRef,\n viewTechDocRouteRef,\n} from '../routes';\nimport {\n repoUrlPickerFormField,\n scaffolderNavItem,\n scaffolderPage,\n scaffolderApi,\n} from './extensions';\nimport { formFieldsApi } from '@backstage/plugin-scaffolder-react/alpha';\n\n/** @alpha */\nexport default createFrontendPlugin({\n id: 'scaffolder',\n routes: convertLegacyRouteRefs({\n root: rootRouteRef,\n selectedTemplate: selectedTemplateRouteRef,\n ongoingTask: scaffolderTaskRouteRef,\n actions: actionsRouteRef,\n listTasks: scaffolderListTaskRouteRef,\n edit: editRouteRef,\n }),\n externalRoutes: convertLegacyRouteRefs({\n registerComponent: registerComponentRouteRef,\n viewTechDoc: viewTechDocRouteRef,\n }),\n extensions: [\n scaffolderApi,\n scaffolderPage,\n scaffolderNavItem,\n formFieldsApi,\n repoUrlPickerFormField,\n ],\n});\n"],"names":[],"mappings":";;;;;;AAqCA,aAAe,oBAAqB,CAAA;AAAA,EAClC,EAAI,EAAA,YAAA;AAAA,EACJ,QAAQ,sBAAuB,CAAA;AAAA,IAC7B,IAAM,EAAA,YAAA;AAAA,IACN,gBAAkB,EAAA,wBAAA;AAAA,IAClB,WAAa,EAAA,sBAAA;AAAA,IACb,OAAS,EAAA,eAAA;AAAA,IACT,SAAW,EAAA,0BAAA;AAAA,IACX,IAAM,EAAA;AAAA,GACP,CAAA;AAAA,EACD,gBAAgB,sBAAuB,CAAA;AAAA,IACrC,iBAAmB,EAAA,yBAAA;AAAA,IACnB,WAAa,EAAA;AAAA,GACd,CAAA;AAAA,EACD,UAAY,EAAA;AAAA,IACV,aAAA;AAAA,IACA,cAAA;AAAA,IACA,iBAAA;AAAA,IACA,aAAA;AAAA,IACA;AAAA;AAEJ,CAAC,CAAA;;;;"}
1
+ {"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 { convertLegacyRouteRefs } from '@backstage/core-compat-api';\nimport { createFrontendPlugin } from '@backstage/frontend-plugin-api';\nimport {\n rootRouteRef,\n actionsRouteRef,\n editRouteRef,\n registerComponentRouteRef,\n scaffolderListTaskRouteRef,\n scaffolderTaskRouteRef,\n selectedTemplateRouteRef,\n viewTechDocRouteRef,\n} from '../routes';\nimport {\n repoUrlPickerFormField,\n scaffolderNavItem,\n scaffolderPage,\n scaffolderApi,\n} from './extensions';\nimport { formFieldsApi } from '@backstage/plugin-scaffolder-react/alpha';\nimport { formDecoratorsApi } from './api';\n\n/** @alpha */\nexport default createFrontendPlugin({\n id: 'scaffolder',\n routes: convertLegacyRouteRefs({\n root: rootRouteRef,\n selectedTemplate: selectedTemplateRouteRef,\n ongoingTask: scaffolderTaskRouteRef,\n actions: actionsRouteRef,\n listTasks: scaffolderListTaskRouteRef,\n edit: editRouteRef,\n }),\n externalRoutes: convertLegacyRouteRefs({\n registerComponent: registerComponentRouteRef,\n viewTechDoc: viewTechDocRouteRef,\n }),\n extensions: [\n scaffolderApi,\n scaffolderPage,\n scaffolderNavItem,\n formDecoratorsApi,\n formFieldsApi,\n repoUrlPickerFormField,\n ],\n});\n"],"names":[],"mappings":";;;;;;;;AAsCA,aAAe,oBAAqB,CAAA;AAAA,EAClC,EAAI,EAAA,YAAA;AAAA,EACJ,QAAQ,sBAAuB,CAAA;AAAA,IAC7B,IAAM,EAAA,YAAA;AAAA,IACN,gBAAkB,EAAA,wBAAA;AAAA,IAClB,WAAa,EAAA,sBAAA;AAAA,IACb,OAAS,EAAA,eAAA;AAAA,IACT,SAAW,EAAA,0BAAA;AAAA,IACX,IAAM,EAAA;AAAA,GACP,CAAA;AAAA,EACD,gBAAgB,sBAAuB,CAAA;AAAA,IACrC,iBAAmB,EAAA,yBAAA;AAAA,IACnB,WAAa,EAAA;AAAA,GACd,CAAA;AAAA,EACD,UAAY,EAAA;AAAA,IACV,aAAA;AAAA,IACA,cAAA;AAAA,IACA,iBAAA;AAAA,IACA,iBAAA;AAAA,IACA,aAAA;AAAA,IACA;AAAA;AAEJ,CAAC,CAAA;;;;"}
package/dist/alpha.d.ts CHANGED
@@ -6,6 +6,7 @@ import { TemplateGroupFilter, FieldExtensionOptions, ReviewStepProps, LayoutOpti
6
6
  import { FormProps as FormProps$2 } from '@rjsf/core';
7
7
  import * as _backstage_core_plugin_api_alpha from '@backstage/core-plugin-api/alpha';
8
8
  import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
9
+ import * as _backstage_plugin_scaffolder_react_alpha from '@backstage/plugin-scaffolder-react/alpha';
9
10
  import { ScaffolderFormDecorator } from '@backstage/plugin-scaffolder-react/alpha';
10
11
  export { ScaffolderFormFieldsApi, formFieldsApiRef } from '@backstage/plugin-scaffolder-react/alpha';
11
12
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
@@ -243,6 +244,23 @@ declare class DefaultScaffolderFormDecoratorsApi implements ScaffolderFormDecora
243
244
  }): DefaultScaffolderFormDecoratorsApi;
244
245
  getFormDecorators(): Promise<ScaffolderFormDecorator[]>;
245
246
  }
247
+ /** @alpha */
248
+ declare const formDecoratorsApi: _backstage_frontend_plugin_api.ExtensionDefinition<{
249
+ config: {};
250
+ configInput: {};
251
+ output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
252
+ inputs: {
253
+ formDecorators: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<ScaffolderFormDecorator, "scaffolder.form-decorator-loader", {}>, {
254
+ singleton: false;
255
+ optional: false;
256
+ }>;
257
+ };
258
+ kind: "api";
259
+ name: "form-decorators";
260
+ params: {
261
+ factory: _backstage_frontend_plugin_api.AnyApiFactory;
262
+ };
263
+ }>;
246
264
 
247
265
  /*
248
266
  * Copyright 2024 The Backstage Authors
@@ -299,6 +317,22 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
299
317
  factory: _backstage_frontend_plugin_api.AnyApiFactory;
300
318
  };
301
319
  }>;
320
+ "api:scaffolder/form-decorators": _backstage_frontend_plugin_api.ExtensionDefinition<{
321
+ config: {};
322
+ configInput: {};
323
+ output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
324
+ inputs: {
325
+ formDecorators: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_plugin_scaffolder_react_alpha.ScaffolderFormDecorator, "scaffolder.form-decorator-loader", {}>, {
326
+ singleton: false;
327
+ optional: false;
328
+ }>;
329
+ };
330
+ kind: "api";
331
+ name: "form-decorators";
332
+ params: {
333
+ factory: _backstage_frontend_plugin_api.AnyApiFactory;
334
+ };
335
+ }>;
302
336
  "page:scaffolder": _backstage_frontend_plugin_api.ExtensionDefinition<{
303
337
  kind: "page";
304
338
  name: undefined;
@@ -359,4 +393,4 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
359
393
  }>;
360
394
  }>;
361
395
 
362
- export { DefaultScaffolderFormDecoratorsApi, type FormProps, type ScaffolderCustomFieldExplorerClassKey, type ScaffolderFormDecoratorsApi, type ScaffolderTemplateEditorClassKey, type ScaffolderTemplateFormPreviewerClassKey, type TemplateListPageProps, type TemplateWizardPageProps, _default as default, formDecoratorsApiRef, scaffolderTranslationRef };
396
+ export { DefaultScaffolderFormDecoratorsApi, type FormProps, type ScaffolderCustomFieldExplorerClassKey, type ScaffolderFormDecoratorsApi, type ScaffolderTemplateEditorClassKey, type ScaffolderTemplateFormPreviewerClassKey, type TemplateListPageProps, type TemplateWizardPageProps, _default as default, formDecoratorsApi, formDecoratorsApiRef, scaffolderTranslationRef };
package/dist/alpha.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { scaffolderTranslationRef } from './translation.esm.js';
2
2
  export { formDecoratorsApiRef } from './alpha/api/ref.esm.js';
3
- export { DefaultScaffolderFormDecoratorsApi } from './alpha/api/FormDecoratorsApi.esm.js';
3
+ export { DefaultScaffolderFormDecoratorsApi, formDecoratorsApi } from './alpha/api/FormDecoratorsApi.esm.js';
4
4
  export { formFieldsApiRef } from '@backstage/plugin-scaffolder-react/alpha';
5
5
  export { default } from './alpha/plugin.esm.js';
6
6
  //# sourceMappingURL=alpha.esm.js.map
@@ -28,7 +28,7 @@ const BitbucketRepoBranchPicker = ({
28
28
  context: { workspace, repository },
29
29
  provider: "bitbucket-cloud"
30
30
  }).then(({ results }) => {
31
- setAvailableBranches(results.map((r) => r.title));
31
+ setAvailableBranches(results.map((r) => r.id));
32
32
  }).catch(() => {
33
33
  setAvailableBranches([]);
34
34
  });
@@ -1 +1 @@
1
- {"version":3,"file":"BitbucketRepoBranchPicker.esm.js","sources":["../../../../src/components/fields/RepoBranchPicker/BitbucketRepoBranchPicker.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 { useApi } from '@backstage/core-plugin-api';\nimport { scaffolderApiRef } from '@backstage/plugin-scaffolder-react';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport TextField from '@material-ui/core/TextField';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport React, { useCallback, useState } from 'react';\nimport useDebounce from 'react-use/esm/useDebounce';\nimport { BaseRepoBranchPickerProps } from './types';\n\n/**\n * The underlying component that is rendered in the form for the `BitbucketRepoBranchPicker`\n * field extension.\n *\n * @public\n *\n */\nexport const BitbucketRepoBranchPicker = ({\n onChange,\n state,\n rawErrors,\n accessToken,\n required,\n}: BaseRepoBranchPickerProps<{\n accessToken?: string;\n}>) => {\n const { host, workspace, repository, branch } = state;\n\n const [availableBranches, setAvailableBranches] = useState<string[]>([]);\n\n const scaffolderApi = useApi(scaffolderApiRef);\n\n const updateAvailableBranches = useCallback(() => {\n if (\n !scaffolderApi.autocomplete ||\n !workspace ||\n !repository ||\n !accessToken ||\n host !== 'bitbucket.org'\n ) {\n setAvailableBranches([]);\n return;\n }\n\n scaffolderApi\n .autocomplete({\n token: accessToken,\n resource: 'branches',\n context: { workspace, repository },\n provider: 'bitbucket-cloud',\n })\n .then(({ results }) => {\n setAvailableBranches(results.map(r => r.title!));\n })\n .catch(() => {\n setAvailableBranches([]);\n });\n }, [host, workspace, repository, accessToken, scaffolderApi]);\n\n useDebounce(updateAvailableBranches, 500, [updateAvailableBranches]);\n\n return (\n <FormControl\n margin=\"normal\"\n required={required}\n error={rawErrors?.length > 0 && !branch}\n >\n <Autocomplete\n value={branch}\n onChange={(_, newValue) => {\n onChange({ branch: newValue || '' });\n }}\n options={availableBranches}\n renderInput={params => (\n <TextField {...params} label=\"Branch\" required={required} />\n )}\n freeSolo\n autoSelect\n />\n <FormHelperText>The branch of the repository</FormHelperText>\n </FormControl>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAiCO,MAAM,4BAA4B,CAAC;AAAA,EACxC,QAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,WAAA;AAAA,EACA;AACF,CAEO,KAAA;AACL,EAAA,MAAM,EAAE,IAAA,EAAM,SAAW,EAAA,UAAA,EAAY,QAAW,GAAA,KAAA;AAEhD,EAAA,MAAM,CAAC,iBAAmB,EAAA,oBAAoB,CAAI,GAAA,QAAA,CAAmB,EAAE,CAAA;AAEvE,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAE7C,EAAM,MAAA,uBAAA,GAA0B,YAAY,MAAM;AAChD,IACE,IAAA,CAAC,aAAc,CAAA,YAAA,IACf,CAAC,SAAA,IACD,CAAC,UACD,IAAA,CAAC,WACD,IAAA,IAAA,KAAS,eACT,EAAA;AACA,MAAA,oBAAA,CAAqB,EAAE,CAAA;AACvB,MAAA;AAAA;AAGF,IAAA,aAAA,CACG,YAAa,CAAA;AAAA,MACZ,KAAO,EAAA,WAAA;AAAA,MACP,QAAU,EAAA,UAAA;AAAA,MACV,OAAA,EAAS,EAAE,SAAA,EAAW,UAAW,EAAA;AAAA,MACjC,QAAU,EAAA;AAAA,KACX,CACA,CAAA,IAAA,CAAK,CAAC,EAAE,SAAc,KAAA;AACrB,MAAA,oBAAA,CAAqB,OAAQ,CAAA,GAAA,CAAI,CAAK,CAAA,KAAA,CAAA,CAAE,KAAM,CAAC,CAAA;AAAA,KAChD,CACA,CAAA,KAAA,CAAM,MAAM;AACX,MAAA,oBAAA,CAAqB,EAAE,CAAA;AAAA,KACxB,CAAA;AAAA,KACF,CAAC,IAAA,EAAM,WAAW,UAAY,EAAA,WAAA,EAAa,aAAa,CAAC,CAAA;AAE5D,EAAA,WAAA,CAAY,uBAAyB,EAAA,GAAA,EAAK,CAAC,uBAAuB,CAAC,CAAA;AAEnE,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,MAAO,EAAA,QAAA;AAAA,MACP,QAAA;AAAA,MACA,KAAO,EAAA,SAAA,EAAW,MAAS,GAAA,CAAA,IAAK,CAAC;AAAA,KAAA;AAAA,oBAEjC,KAAA,CAAA,aAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,KAAO,EAAA,MAAA;AAAA,QACP,QAAA,EAAU,CAAC,CAAA,EAAG,QAAa,KAAA;AACzB,UAAA,QAAA,CAAS,EAAE,MAAA,EAAQ,QAAY,IAAA,EAAA,EAAI,CAAA;AAAA,SACrC;AAAA,QACA,OAAS,EAAA,iBAAA;AAAA,QACT,WAAA,EAAa,4BACV,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAW,GAAG,MAAQ,EAAA,KAAA,EAAM,UAAS,QAAoB,EAAA,CAAA;AAAA,QAE5D,QAAQ,EAAA,IAAA;AAAA,QACR,UAAU,EAAA;AAAA;AAAA,KACZ;AAAA,oBACA,KAAA,CAAA,aAAA,CAAC,sBAAe,8BAA4B;AAAA,GAC9C;AAEJ;;;;"}
1
+ {"version":3,"file":"BitbucketRepoBranchPicker.esm.js","sources":["../../../../src/components/fields/RepoBranchPicker/BitbucketRepoBranchPicker.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 { useApi } from '@backstage/core-plugin-api';\nimport { scaffolderApiRef } from '@backstage/plugin-scaffolder-react';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport TextField from '@material-ui/core/TextField';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport React, { useCallback, useState } from 'react';\nimport useDebounce from 'react-use/esm/useDebounce';\nimport { BaseRepoBranchPickerProps } from './types';\n\n/**\n * The underlying component that is rendered in the form for the `BitbucketRepoBranchPicker`\n * field extension.\n *\n * @public\n *\n */\nexport const BitbucketRepoBranchPicker = ({\n onChange,\n state,\n rawErrors,\n accessToken,\n required,\n}: BaseRepoBranchPickerProps<{\n accessToken?: string;\n}>) => {\n const { host, workspace, repository, branch } = state;\n\n const [availableBranches, setAvailableBranches] = useState<string[]>([]);\n\n const scaffolderApi = useApi(scaffolderApiRef);\n\n const updateAvailableBranches = useCallback(() => {\n if (\n !scaffolderApi.autocomplete ||\n !workspace ||\n !repository ||\n !accessToken ||\n host !== 'bitbucket.org'\n ) {\n setAvailableBranches([]);\n return;\n }\n\n scaffolderApi\n .autocomplete({\n token: accessToken,\n resource: 'branches',\n context: { workspace, repository },\n provider: 'bitbucket-cloud',\n })\n .then(({ results }) => {\n setAvailableBranches(results.map(r => r.id));\n })\n .catch(() => {\n setAvailableBranches([]);\n });\n }, [host, workspace, repository, accessToken, scaffolderApi]);\n\n useDebounce(updateAvailableBranches, 500, [updateAvailableBranches]);\n\n return (\n <FormControl\n margin=\"normal\"\n required={required}\n error={rawErrors?.length > 0 && !branch}\n >\n <Autocomplete\n value={branch}\n onChange={(_, newValue) => {\n onChange({ branch: newValue || '' });\n }}\n options={availableBranches}\n renderInput={params => (\n <TextField {...params} label=\"Branch\" required={required} />\n )}\n freeSolo\n autoSelect\n />\n <FormHelperText>The branch of the repository</FormHelperText>\n </FormControl>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAiCO,MAAM,4BAA4B,CAAC;AAAA,EACxC,QAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,WAAA;AAAA,EACA;AACF,CAEO,KAAA;AACL,EAAA,MAAM,EAAE,IAAA,EAAM,SAAW,EAAA,UAAA,EAAY,QAAW,GAAA,KAAA;AAEhD,EAAA,MAAM,CAAC,iBAAmB,EAAA,oBAAoB,CAAI,GAAA,QAAA,CAAmB,EAAE,CAAA;AAEvE,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAE7C,EAAM,MAAA,uBAAA,GAA0B,YAAY,MAAM;AAChD,IACE,IAAA,CAAC,aAAc,CAAA,YAAA,IACf,CAAC,SAAA,IACD,CAAC,UACD,IAAA,CAAC,WACD,IAAA,IAAA,KAAS,eACT,EAAA;AACA,MAAA,oBAAA,CAAqB,EAAE,CAAA;AACvB,MAAA;AAAA;AAGF,IAAA,aAAA,CACG,YAAa,CAAA;AAAA,MACZ,KAAO,EAAA,WAAA;AAAA,MACP,QAAU,EAAA,UAAA;AAAA,MACV,OAAA,EAAS,EAAE,SAAA,EAAW,UAAW,EAAA;AAAA,MACjC,QAAU,EAAA;AAAA,KACX,CACA,CAAA,IAAA,CAAK,CAAC,EAAE,SAAc,KAAA;AACrB,MAAA,oBAAA,CAAqB,OAAQ,CAAA,GAAA,CAAI,CAAK,CAAA,KAAA,CAAA,CAAE,EAAE,CAAC,CAAA;AAAA,KAC5C,CACA,CAAA,KAAA,CAAM,MAAM;AACX,MAAA,oBAAA,CAAqB,EAAE,CAAA;AAAA,KACxB,CAAA;AAAA,KACF,CAAC,IAAA,EAAM,WAAW,UAAY,EAAA,WAAA,EAAa,aAAa,CAAC,CAAA;AAE5D,EAAA,WAAA,CAAY,uBAAyB,EAAA,GAAA,EAAK,CAAC,uBAAuB,CAAC,CAAA;AAEnE,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,MAAO,EAAA,QAAA;AAAA,MACP,QAAA;AAAA,MACA,KAAO,EAAA,SAAA,EAAW,MAAS,GAAA,CAAA,IAAK,CAAC;AAAA,KAAA;AAAA,oBAEjC,KAAA,CAAA,aAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,KAAO,EAAA,MAAA;AAAA,QACP,QAAA,EAAU,CAAC,CAAA,EAAG,QAAa,KAAA;AACzB,UAAA,QAAA,CAAS,EAAE,MAAA,EAAQ,QAAY,IAAA,EAAA,EAAI,CAAA;AAAA,SACrC;AAAA,QACA,OAAS,EAAA,iBAAA;AAAA,QACT,WAAA,EAAa,4BACV,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAW,GAAG,MAAQ,EAAA,KAAA,EAAM,UAAS,QAAoB,EAAA,CAAA;AAAA,QAE5D,QAAQ,EAAA,IAAA;AAAA,QACR,UAAU,EAAA;AAAA;AAAA,KACZ;AAAA,oBACA,KAAA,CAAA,aAAA,CAAC,sBAAe,8BAA4B;AAAA,GAC9C;AAEJ;;;;"}
@@ -8,7 +8,8 @@ function makeFieldSchemaFromZod(returnSchema, uiOptionsSchema) {
8
8
  },
9
9
  type: null,
10
10
  uiOptionsType: null,
11
- TProps: void 0
11
+ TProps: void 0,
12
+ TOutput: void 0
12
13
  };
13
14
  }
14
15
 
@@ -1 +1 @@
1
- {"version":3,"file":"utils.esm.js","sources":["../../../src/components/fields/utils.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { JSONSchema7 } from 'json-schema';\nimport { z } from 'zod';\nimport zodToJsonSchema from 'zod-to-json-schema';\nimport { FieldSchema as FieldSchemaType } from '@backstage/plugin-scaffolder-react';\n\n/**\n * @public\n * @deprecated - import from {@link @backstage/plugin-scaffolder-react#FieldSchema} instead\n */\nexport interface FieldSchema<T, P> extends FieldSchemaType<T, P> {}\n\n/**\n * @public\n * @deprecated use `makeFieldSchema` instead\n * Utility function to convert zod return and UI options schemas to a\n * CustomFieldExtensionSchema with FieldExtensionComponentProps type inference\n */\n\nexport function makeFieldSchemaFromZod<\n TReturnSchema extends z.ZodType,\n TUiOptionsSchema extends z.ZodType = z.ZodType<any, any, {}>,\n>(\n returnSchema: TReturnSchema,\n uiOptionsSchema?: TUiOptionsSchema,\n): FieldSchema<\n TReturnSchema extends z.ZodType<any, any, infer IReturn> ? IReturn : never,\n TUiOptionsSchema extends z.ZodType<any, any, infer IUiOptions>\n ? IUiOptions\n : never\n> {\n return {\n schema: {\n returnValue: zodToJsonSchema(returnSchema) as JSONSchema7,\n uiOptions: uiOptionsSchema\n ? (zodToJsonSchema(uiOptionsSchema) as JSONSchema7)\n : undefined,\n },\n type: null as any,\n uiOptionsType: null as any,\n TProps: undefined as any,\n };\n}\n"],"names":[],"mappings":";;AAiCgB,SAAA,sBAAA,CAId,cACA,eAMA,EAAA;AACA,EAAO,OAAA;AAAA,IACL,MAAQ,EAAA;AAAA,MACN,WAAA,EAAa,gBAAgB,YAAY,CAAA;AAAA,MACzC,SAAW,EAAA,eAAA,GACN,eAAgB,CAAA,eAAe,CAChC,GAAA,KAAA;AAAA,KACN;AAAA,IACA,IAAM,EAAA,IAAA;AAAA,IACN,aAAe,EAAA,IAAA;AAAA,IACf,MAAQ,EAAA,KAAA;AAAA,GACV;AACF;;;;"}
1
+ {"version":3,"file":"utils.esm.js","sources":["../../../src/components/fields/utils.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { JSONSchema7 } from 'json-schema';\nimport { z } from 'zod';\nimport zodToJsonSchema from 'zod-to-json-schema';\nimport { FieldSchema as FieldSchemaType } from '@backstage/plugin-scaffolder-react';\n\n/**\n * @public\n * @deprecated - import from {@link @backstage/plugin-scaffolder-react#FieldSchema} instead\n */\nexport interface FieldSchema<T, P> extends FieldSchemaType<T, P> {}\n\n/**\n * @public\n * @deprecated use `makeFieldSchema` instead\n * Utility function to convert zod return and UI options schemas to a\n * CustomFieldExtensionSchema with FieldExtensionComponentProps type inference\n */\n\nexport function makeFieldSchemaFromZod<\n TReturnSchema extends z.ZodType,\n TUiOptionsSchema extends z.ZodType = z.ZodType<any, any, {}>,\n>(\n returnSchema: TReturnSchema,\n uiOptionsSchema?: TUiOptionsSchema,\n): FieldSchema<\n TReturnSchema extends z.ZodType<any, any, infer IReturn> ? IReturn : never,\n TUiOptionsSchema extends z.ZodType<any, any, infer IUiOptions>\n ? IUiOptions\n : never\n> {\n return {\n schema: {\n returnValue: zodToJsonSchema(returnSchema) as JSONSchema7,\n uiOptions: uiOptionsSchema\n ? (zodToJsonSchema(uiOptionsSchema) as JSONSchema7)\n : undefined,\n },\n type: null as any,\n uiOptionsType: null as any,\n TProps: undefined as any,\n TOutput: undefined as any,\n };\n}\n"],"names":[],"mappings":";;AAiCgB,SAAA,sBAAA,CAId,cACA,eAMA,EAAA;AACA,EAAO,OAAA;AAAA,IACL,MAAQ,EAAA;AAAA,MACN,WAAA,EAAa,gBAAgB,YAAY,CAAA;AAAA,MACzC,SAAW,EAAA,eAAA,GACN,eAAgB,CAAA,eAAe,CAChC,GAAA,KAAA;AAAA,KACN;AAAA,IACA,IAAM,EAAA,IAAA;AAAA,IACN,aAAe,EAAA,IAAA;AAAA,IACf,MAAQ,EAAA,KAAA,CAAA;AAAA,IACR,OAAS,EAAA,KAAA;AAAA,GACX;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder",
3
- "version": "1.27.4-next.2",
3
+ "version": "1.27.5-next.0",
4
4
  "description": "The Backstage plugin that helps you create new things",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin",
@@ -67,21 +67,21 @@
67
67
  "test": "backstage-cli package test"
68
68
  },
69
69
  "dependencies": {
70
- "@backstage/catalog-client": "1.9.1-next.0",
71
- "@backstage/catalog-model": "1.7.3-next.0",
72
- "@backstage/core-compat-api": "0.3.5-next.0",
73
- "@backstage/core-components": "0.16.3-next.0",
74
- "@backstage/core-plugin-api": "1.10.3-next.0",
75
- "@backstage/errors": "1.2.7-next.0",
76
- "@backstage/frontend-plugin-api": "0.9.4-next.0",
77
- "@backstage/integration": "1.16.1-next.0",
78
- "@backstage/integration-react": "1.2.3-next.0",
79
- "@backstage/plugin-catalog-common": "1.1.3-next.0",
80
- "@backstage/plugin-catalog-react": "1.15.1-next.1",
81
- "@backstage/plugin-permission-react": "0.4.30-next.0",
82
- "@backstage/plugin-scaffolder-common": "1.5.9-next.0",
83
- "@backstage/plugin-scaffolder-react": "1.14.3-next.2",
84
- "@backstage/types": "1.2.1-next.0",
70
+ "@backstage/catalog-client": "1.9.1",
71
+ "@backstage/catalog-model": "1.7.3",
72
+ "@backstage/core-compat-api": "0.3.6-next.0",
73
+ "@backstage/core-components": "0.16.3",
74
+ "@backstage/core-plugin-api": "1.10.3",
75
+ "@backstage/errors": "1.2.7",
76
+ "@backstage/frontend-plugin-api": "0.9.5-next.0",
77
+ "@backstage/integration": "1.16.1",
78
+ "@backstage/integration-react": "1.2.3",
79
+ "@backstage/plugin-catalog-common": "1.1.3",
80
+ "@backstage/plugin-catalog-react": "1.15.2-next.0",
81
+ "@backstage/plugin-permission-react": "0.4.30",
82
+ "@backstage/plugin-scaffolder-common": "1.5.9",
83
+ "@backstage/plugin-scaffolder-react": "1.14.4-next.0",
84
+ "@backstage/types": "1.2.1",
85
85
  "@codemirror/language": "^6.0.0",
86
86
  "@codemirror/legacy-modes": "^6.1.0",
87
87
  "@codemirror/view": "^6.0.0",
@@ -114,12 +114,12 @@
114
114
  "zod-to-json-schema": "^3.20.4"
115
115
  },
116
116
  "devDependencies": {
117
- "@backstage/cli": "0.29.5-next.1",
118
- "@backstage/core-app-api": "1.15.4-next.0",
119
- "@backstage/dev-utils": "1.1.6-next.1",
120
- "@backstage/plugin-catalog": "1.26.1-next.1",
121
- "@backstage/plugin-permission-common": "0.8.4-next.0",
122
- "@backstage/test-utils": "1.7.4-next.0",
117
+ "@backstage/cli": "0.30.0-next.0",
118
+ "@backstage/core-app-api": "1.15.4",
119
+ "@backstage/dev-utils": "1.1.7-next.0",
120
+ "@backstage/plugin-catalog": "1.26.2-next.0",
121
+ "@backstage/plugin-permission-common": "0.8.4",
122
+ "@backstage/test-utils": "1.7.4",
123
123
  "@testing-library/dom": "^10.0.0",
124
124
  "@testing-library/jest-dom": "^6.0.0",
125
125
  "@testing-library/react": "^16.0.0",