@backstage/plugin-scaffolder 1.35.5-next.0 → 1.35.5-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 CHANGED
@@ -1,5 +1,28 @@
1
1
  # @backstage/plugin-scaffolder
2
2
 
3
+ ## 1.35.5-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - e27bd4e: Removed check for deprecated `bitbucket` integration from `repoPickerValidation` function used by the `RepoUrlPicker`, it now validates the `bitbucketServer` and `bitbucketCloud` integrations instead.
8
+ - Updated dependencies
9
+ - @backstage/catalog-client@1.14.0-next.1
10
+ - @backstage/plugin-catalog-react@2.1.0-next.1
11
+ - @backstage/plugin-scaffolder-react@1.19.8-next.1
12
+ - @backstage/integration@2.0.0-next.1
13
+ - @backstage/plugin-scaffolder-common@2.0.0-next.1
14
+ - @backstage/catalog-model@1.7.6
15
+ - @backstage/core-components@0.18.8-next.0
16
+ - @backstage/core-plugin-api@1.12.4-next.0
17
+ - @backstage/errors@1.2.7
18
+ - @backstage/frontend-plugin-api@0.14.2-next.0
19
+ - @backstage/integration-react@1.2.16-next.1
20
+ - @backstage/types@1.2.2
21
+ - @backstage/plugin-catalog-common@1.1.8
22
+ - @backstage/plugin-permission-react@0.4.41-next.0
23
+ - @backstage/plugin-techdocs-common@0.1.1
24
+ - @backstage/plugin-techdocs-react@1.3.9-next.0
25
+
3
26
  ## 1.35.5-next.0
4
27
 
5
28
  ### Patch Changes
@@ -2,11 +2,10 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import { PageBlueprint, createExtensionInput, NavItemBlueprint, ApiBlueprint, identityApiRef, fetchApiRef, discoveryApiRef } from '@backstage/frontend-plugin-api';
3
3
  import { rootRouteRef } from '../routes.esm.js';
4
4
  import CreateComponentIcon from '@material-ui/icons/AddCircleOutline';
5
- import { FormFieldBlueprint } from '@backstage/plugin-scaffolder-react/alpha';
5
+ import { formFieldsApiRef, FormFieldBlueprint } from '@backstage/plugin-scaffolder-react/alpha';
6
6
  import { scmIntegrationsApiRef } from '@backstage/integration-react';
7
7
  import { scaffolderApiRef } from '@backstage/plugin-scaffolder-react';
8
8
  import { ScaffolderClient } from '../api.esm.js';
9
- import { formFieldsApiRef } from './formFieldsApi.esm.js';
10
9
 
11
10
  const scaffolderPage = PageBlueprint.makeWithOverrides({
12
11
  inputs: {
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.esm.js","sources":["../../src/alpha/extensions.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 createExtensionInput,\n discoveryApiRef,\n fetchApiRef,\n identityApiRef,\n NavItemBlueprint,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport { rootRouteRef } from '../routes';\nimport CreateComponentIcon from '@material-ui/icons/AddCircleOutline';\nimport { FormFieldBlueprint } from '@backstage/plugin-scaffolder-react/alpha';\nimport { scmIntegrationsApiRef } from '@backstage/integration-react';\nimport { scaffolderApiRef } from '@backstage/plugin-scaffolder-react';\nimport { ScaffolderClient } from '../api';\nimport { formFieldsApiRef } from './formFieldsApi';\n\nexport const scaffolderPage = PageBlueprint.makeWithOverrides({\n inputs: {\n formFields: createExtensionInput([\n FormFieldBlueprint.dataRefs.formFieldLoader,\n ]),\n },\n factory(originalFactory, { apis, inputs }) {\n const formFieldsApi = apis.get(formFieldsApiRef);\n\n return originalFactory({\n routeRef: rootRouteRef,\n path: '/create',\n loader: async () => {\n // Merge form fields from the API with old-style direct attachments\n const apiFormFields = (await formFieldsApi?.loadFormFields()) ?? [];\n const formFieldLoaders = inputs.formFields.map(output =>\n output.get(FormFieldBlueprint.dataRefs.formFieldLoader),\n );\n\n // Resolve direct attachments and combine with API form fields\n const loadedFormFields = await Promise.all(\n formFieldLoaders.map(loader => loader()),\n );\n const formFields = [...apiFormFields, ...loadedFormFields];\n\n return import('../components/Router/Router').then(m => (\n <m.InternalRouter formFields={formFields} />\n ));\n },\n });\n },\n});\n\nexport const scaffolderNavItem = NavItemBlueprint.make({\n params: {\n routeRef: rootRouteRef,\n title: 'Create...',\n icon: CreateComponentIcon,\n },\n});\n\nexport const repoUrlPickerFormField = FormFieldBlueprint.make({\n name: 'repo-url-picker',\n params: {\n field: () => import('./fields/RepoUrlPicker').then(m => m.RepoUrlPicker),\n },\n});\n\nexport const entityNamePickerFormField = FormFieldBlueprint.make({\n name: 'entity-name-picker',\n params: {\n field: () =>\n import('./fields/EntityNamePicker').then(m => m.EntityNamePicker),\n },\n});\n\nexport const entityPickerFormField = FormFieldBlueprint.make({\n name: 'entity-picker',\n params: {\n field: () => import('./fields/EntityPicker').then(m => m.EntityPicker),\n },\n});\n\nexport const ownerPickerFormField = FormFieldBlueprint.make({\n name: 'owner-picker',\n params: {\n field: () => import('./fields/OwnerPicker').then(m => m.OwnerPicker),\n },\n});\n\nexport const entityTagsPickerFormField = FormFieldBlueprint.make({\n name: 'entity-tags-picker',\n params: {\n field: () =>\n import('./fields/EntityTagsPicker').then(m => m.EntityTagsPicker),\n },\n});\n\nexport const multiEntityPickerFormField = FormFieldBlueprint.make({\n name: 'multi-entity-picker',\n params: {\n field: () =>\n import('./fields/MultiEntityPicker').then(m => m.MultiEntityPicker),\n },\n});\n\nexport const myGroupsPickerFormField = FormFieldBlueprint.make({\n name: 'my-groups-picker',\n params: {\n field: () => import('./fields/MyGroupsPicker').then(m => m.MyGroupsPicker),\n },\n});\n\nexport const ownedEntityPickerFormField = FormFieldBlueprint.make({\n name: 'owned-entity-picker',\n params: {\n field: () =>\n import('./fields/OwnedEntityPicker').then(m => m.OwnedEntityPicker),\n },\n});\n\nexport const repoBranchPickerFormField = FormFieldBlueprint.make({\n name: 'repo-branch-picker',\n params: {\n field: () =>\n import('./fields/RepoBranchPicker').then(m => m.RepoBranchPicker),\n },\n});\n\nexport const repoOwnerPickerFormField = FormFieldBlueprint.make({\n name: 'repo-owner-picker',\n params: {\n field: () =>\n import('./fields/RepoOwnerPicker').then(m => m.RepoOwnerPicker),\n },\n});\n\nexport const scaffolderApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: scaffolderApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n scmIntegrationsApi: scmIntegrationsApiRef,\n fetchApi: fetchApiRef,\n identityApi: identityApiRef,\n },\n factory: ({ discoveryApi, scmIntegrationsApi, fetchApi, identityApi }) =>\n new ScaffolderClient({\n discoveryApi,\n scmIntegrationsApi,\n fetchApi,\n identityApi,\n }),\n }),\n});\n"],"names":[],"mappings":";;;;;;;;;;AAiCO,MAAM,cAAA,GAAiB,cAAc,iBAAA,CAAkB;AAAA,EAC5D,MAAA,EAAQ;AAAA,IACN,YAAY,oBAAA,CAAqB;AAAA,MAC/B,mBAAmB,QAAA,CAAS;AAAA,KAC7B;AAAA,GACH;AAAA,EACA,OAAA,CAAQ,eAAA,EAAiB,EAAE,IAAA,EAAM,QAAO,EAAG;AACzC,IAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,GAAA,CAAI,gBAAgB,CAAA;AAE/C,IAAA,OAAO,eAAA,CAAgB;AAAA,MACrB,QAAA,EAAU,YAAA;AAAA,MACV,IAAA,EAAM,SAAA;AAAA,MACN,QAAQ,YAAY;AAElB,QAAA,MAAM,aAAA,GAAiB,MAAM,aAAA,EAAe,cAAA,MAAqB,EAAC;AAClE,QAAA,MAAM,gBAAA,GAAmB,OAAO,UAAA,CAAW,GAAA;AAAA,UAAI,CAAA,MAAA,KAC7C,MAAA,CAAO,GAAA,CAAI,kBAAA,CAAmB,SAAS,eAAe;AAAA,SACxD;AAGA,QAAA,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AAAA;AAEtE,CAAC;AAEM,MAAM,wBAAA,GAA2B,mBAAmB,IAAA,CAAK;AAAA,EAC9D,IAAA,EAAM,mBAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,KAAA,EAAO,MACL,OAAO,iCAA0B,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,eAAe;AAAA;AAEpE,CAAC;AAEM,MAAM,aAAA,GAAgB,aAAa,IAAA,CAAK;AAAA,EAC7C,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,gBAAA;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,YAAA,EAAc,eAAA;AAAA,MACd,kBAAA,EAAoB,qBAAA;AAAA,MACpB,QAAA,EAAU,WAAA;AAAA,MACV,WAAA,EAAa;AAAA,KACf;AAAA,IACA,OAAA,EAAS,CAAC,EAAE,YAAA,EAAc,oBAAoB,QAAA,EAAU,WAAA,EAAY,KAClE,IAAI,gBAAA,CAAiB;AAAA,MACnB,YAAA;AAAA,MACA,kBAAA;AAAA,MACA,QAAA;AAAA,MACA;AAAA,KACD;AAAA,GACJ;AACL,CAAC;;;;"}
1
+ {"version":3,"file":"extensions.esm.js","sources":["../../src/alpha/extensions.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 createExtensionInput,\n discoveryApiRef,\n fetchApiRef,\n identityApiRef,\n NavItemBlueprint,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport { rootRouteRef } from '../routes';\nimport CreateComponentIcon from '@material-ui/icons/AddCircleOutline';\nimport {\n FormFieldBlueprint,\n formFieldsApiRef,\n} from '@backstage/plugin-scaffolder-react/alpha';\nimport { scmIntegrationsApiRef } from '@backstage/integration-react';\nimport { scaffolderApiRef } from '@backstage/plugin-scaffolder-react';\nimport { ScaffolderClient } from '../api';\n\nexport const scaffolderPage = PageBlueprint.makeWithOverrides({\n inputs: {\n formFields: createExtensionInput([\n FormFieldBlueprint.dataRefs.formFieldLoader,\n ]),\n },\n factory(originalFactory, { apis, inputs }) {\n const formFieldsApi = apis.get(formFieldsApiRef);\n\n return originalFactory({\n routeRef: rootRouteRef,\n path: '/create',\n loader: async () => {\n // Merge form fields from the API with old-style direct attachments\n const apiFormFields = (await formFieldsApi?.loadFormFields()) ?? [];\n const formFieldLoaders = inputs.formFields.map(output =>\n output.get(FormFieldBlueprint.dataRefs.formFieldLoader),\n );\n\n // Resolve direct attachments and combine with API form fields\n const loadedFormFields = await Promise.all(\n formFieldLoaders.map(loader => loader()),\n );\n const formFields = [...apiFormFields, ...loadedFormFields];\n\n return import('../components/Router/Router').then(m => (\n <m.InternalRouter formFields={formFields} />\n ));\n },\n });\n },\n});\n\nexport const scaffolderNavItem = NavItemBlueprint.make({\n params: {\n routeRef: rootRouteRef,\n title: 'Create...',\n icon: CreateComponentIcon,\n },\n});\n\nexport const repoUrlPickerFormField = FormFieldBlueprint.make({\n name: 'repo-url-picker',\n params: {\n field: () => import('./fields/RepoUrlPicker').then(m => m.RepoUrlPicker),\n },\n});\n\nexport const entityNamePickerFormField = FormFieldBlueprint.make({\n name: 'entity-name-picker',\n params: {\n field: () =>\n import('./fields/EntityNamePicker').then(m => m.EntityNamePicker),\n },\n});\n\nexport const entityPickerFormField = FormFieldBlueprint.make({\n name: 'entity-picker',\n params: {\n field: () => import('./fields/EntityPicker').then(m => m.EntityPicker),\n },\n});\n\nexport const ownerPickerFormField = FormFieldBlueprint.make({\n name: 'owner-picker',\n params: {\n field: () => import('./fields/OwnerPicker').then(m => m.OwnerPicker),\n },\n});\n\nexport const entityTagsPickerFormField = FormFieldBlueprint.make({\n name: 'entity-tags-picker',\n params: {\n field: () =>\n import('./fields/EntityTagsPicker').then(m => m.EntityTagsPicker),\n },\n});\n\nexport const multiEntityPickerFormField = FormFieldBlueprint.make({\n name: 'multi-entity-picker',\n params: {\n field: () =>\n import('./fields/MultiEntityPicker').then(m => m.MultiEntityPicker),\n },\n});\n\nexport const myGroupsPickerFormField = FormFieldBlueprint.make({\n name: 'my-groups-picker',\n params: {\n field: () => import('./fields/MyGroupsPicker').then(m => m.MyGroupsPicker),\n },\n});\n\nexport const ownedEntityPickerFormField = FormFieldBlueprint.make({\n name: 'owned-entity-picker',\n params: {\n field: () =>\n import('./fields/OwnedEntityPicker').then(m => m.OwnedEntityPicker),\n },\n});\n\nexport const repoBranchPickerFormField = FormFieldBlueprint.make({\n name: 'repo-branch-picker',\n params: {\n field: () =>\n import('./fields/RepoBranchPicker').then(m => m.RepoBranchPicker),\n },\n});\n\nexport const repoOwnerPickerFormField = FormFieldBlueprint.make({\n name: 'repo-owner-picker',\n params: {\n field: () =>\n import('./fields/RepoOwnerPicker').then(m => m.RepoOwnerPicker),\n },\n});\n\nexport const scaffolderApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: scaffolderApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n scmIntegrationsApi: scmIntegrationsApiRef,\n fetchApi: fetchApiRef,\n identityApi: identityApiRef,\n },\n factory: ({ discoveryApi, scmIntegrationsApi, fetchApi, identityApi }) =>\n new ScaffolderClient({\n discoveryApi,\n scmIntegrationsApi,\n fetchApi,\n identityApi,\n }),\n }),\n});\n"],"names":[],"mappings":";;;;;;;;;AAmCO,MAAM,cAAA,GAAiB,cAAc,iBAAA,CAAkB;AAAA,EAC5D,MAAA,EAAQ;AAAA,IACN,YAAY,oBAAA,CAAqB;AAAA,MAC/B,mBAAmB,QAAA,CAAS;AAAA,KAC7B;AAAA,GACH;AAAA,EACA,OAAA,CAAQ,eAAA,EAAi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
2
- import { FormFieldBlueprint } from '@backstage/plugin-scaffolder-react/alpha';
1
+ import { ApiBlueprint, createExtensionInput } from '@backstage/frontend-plugin-api';
2
+ import { FormFieldBlueprint, formFieldsApiRef } from '@backstage/plugin-scaffolder-react/alpha';
3
+ export { formFieldsApiRef } from '@backstage/plugin-scaffolder-react/alpha';
3
4
  import { OpaqueFormField } from '../packages/scaffolder-internal/src/wiring/InternalFormField.esm.js';
4
5
  import '../packages/scaffolder-internal/src/wiring/InternalFormDecorator.esm.js';
5
6
 
6
- const formFieldsApiRef = createApiRef({
7
- id: "plugin.scaffolder.form-fields-loader"
8
- });
9
7
  const formFieldsApi = ApiBlueprint.makeWithOverrides({
10
8
  name: "form-fields",
11
9
  inputs: {
@@ -37,5 +35,5 @@ const formFieldsApi = ApiBlueprint.makeWithOverrides({
37
35
  }
38
36
  });
39
37
 
40
- export { formFieldsApi, formFieldsApiRef };
38
+ export { formFieldsApi };
41
39
  //# sourceMappingURL=formFieldsApi.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formFieldsApi.esm.js","sources":["../../src/alpha/formFieldsApi.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 createApiRef,\n createExtensionInput,\n} from '@backstage/frontend-plugin-api';\nimport {\n FormFieldBlueprint,\n type FormField,\n} from '@backstage/plugin-scaffolder-react/alpha';\nimport { OpaqueFormField } from '@internal/scaffolder';\n\n/** @alpha */\nexport interface ScaffolderFormFieldsApi {\n loadFormFields(): Promise<FormField[]>;\n}\n\n/** @alpha */\nconst formFieldsApiRef = createApiRef<ScaffolderFormFieldsApi>({\n id: 'plugin.scaffolder.form-fields-loader',\n});\n\nexport const formFieldsApi = ApiBlueprint.makeWithOverrides({\n name: 'form-fields',\n inputs: {\n formFields: createExtensionInput([\n FormFieldBlueprint.dataRefs.formFieldLoader,\n ]),\n },\n factory(originalFactory, { inputs }) {\n const formFieldLoaders = inputs.formFields.map(e =>\n e.get(FormFieldBlueprint.dataRefs.formFieldLoader),\n );\n\n return originalFactory(defineParams =>\n defineParams({\n api: formFieldsApiRef,\n deps: {},\n factory: () => ({\n async loadFormFields() {\n const formFields = await Promise.all(\n formFieldLoaders.map(loader => loader()),\n );\n\n const internalFormFields = formFields.map(\n OpaqueFormField.toInternal,\n );\n\n return internalFormFields;\n },\n }),\n }),\n );\n },\n});\n\nexport { formFieldsApiRef };\n"],"names":[],"mappings":";;;;;AAiCA,MAAM,mBAAmB,YAAA,CAAsC;AAAA,EAC7D,EAAA,EAAI;AACN,CAAC;AAEM,MAAM,aAAA,GAAgB,aAAa,iBAAA,CAAkB;AAAA,EAC1D,IAAA,EAAM,aAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,YAAY,oBAAA,CAAqB;AAAA,MAC/B,mBAAmB,QAAA,CAAS;AAAA,KAC7B;AAAA,GACH;AAAA,EACA,OAAA,CAAQ,eAAA,EAAiB,EAAE,MAAA,EAAO,EAAG;AACnC,IAAA,MAAM,gBAAA,GAAmB,OAAO,UAAA,CAAW,GAAA;AAAA,MAAI,CAAA,CAAA,KAC7C,CAAA,CAAE,GAAA,CAAI,kBAAA,CAAmB,SAAS,eAAe;AAAA,KACnD;AAEA,IAAA,OAAO,eAAA;AAAA,MAAgB,kBACrB,YAAA,CAAa;AAAA,QACX,GAAA,EAAK,gBAAA;AAAA,QACL,MAAM,EAAC;AAAA,QACP,SAAS,OAAO;AAAA,UACd,MAAM,cAAA,GAAiB;AACrB,YAAA,MAAM,UAAA,GAAa,MAAM,OAAA,CAAQ,GAAA;AAAA,cAC/B,gBAAA,CAAiB,GAAA,CAAI,CAAA,MAAA,KAAU,MAAA,EAAQ;AAAA,aACzC;AAEA,YAAA,MAAM,qBAAqB,UAAA,CAAW,GAAA;AAAA,cACpC,eAAA,CAAgB;AAAA,aAClB;AAEA,YAAA,OAAO,kBAAA;AAAA,UACT;AAAA,SACF;AAAA,OACD;AAAA,KACH;AAAA,EACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"formFieldsApi.esm.js","sources":["../../src/alpha/formFieldsApi.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 createExtensionInput,\n} from '@backstage/frontend-plugin-api';\nimport {\n FormFieldBlueprint,\n formFieldsApiRef,\n} from '@backstage/plugin-scaffolder-react/alpha';\nimport { OpaqueFormField } from '@internal/scaffolder';\n\nexport const formFieldsApi = ApiBlueprint.makeWithOverrides({\n name: 'form-fields',\n inputs: {\n formFields: createExtensionInput([\n FormFieldBlueprint.dataRefs.formFieldLoader,\n ]),\n },\n factory(originalFactory, { inputs }) {\n const formFieldLoaders = inputs.formFields.map(e =>\n e.get(FormFieldBlueprint.dataRefs.formFieldLoader),\n );\n\n return originalFactory(defineParams =>\n defineParams({\n api: formFieldsApiRef,\n deps: {},\n factory: () => ({\n async loadFormFields() {\n const formFields = await Promise.all(\n formFieldLoaders.map(loader => loader()),\n );\n\n const internalFormFields = formFields.map(\n OpaqueFormField.toInternal,\n );\n\n return internalFormFields;\n },\n }),\n }),\n );\n },\n});\n\nexport {\n formFieldsApiRef,\n type ScaffolderFormFieldsApi,\n} from '@backstage/plugin-scaffolder-react/alpha';\n"],"names":[],"mappings":";;;;;;AA0BO,MAAM,aAAA,GAAgB,aAAa,iBAAA,CAAkB;AAAA,EAC1D,IAAA,EAAM,aAAA;AAAA,EACN,MAAA,EAAQ;AAAA,IACN,YAAY,oBAAA,CAAqB;AAAA,MAC/B,mBAAmB,QAAA,CAAS;AAAA,KAC7B;AAAA,GACH;AAAA,EACA,OAAA,CAAQ,eAAA,EAAiB,EAAE,MAAA,EAAO,EAAG;AACnC,IAAA,MAAM,gBAAA,GAAmB,OAAO,UAAA,CAAW,GAAA;AAAA,MAAI,CAAA,CAAA,KAC7C,CAAA,CAAE,GAAA,CAAI,kBAAA,CAAmB,SAAS,eAAe;AAAA,KACnD;AAEA,IAAA,OAAO,eAAA;AAAA,MAAgB,kBACrB,YAAA,CAAa;AAAA,QACX,GAAA,EAAK,gBAAA;AAAA,QACL,MAAM,EAAC;AAAA,QACP,SAAS,OAAO;AAAA,UACd,MAAM,cAAA,GAAiB;AACrB,YAAA,MAAM,UAAA,GAAa,MAAM,OAAA,CAAQ,GAAA;AAAA,cAC/B,gBAAA,CAAiB,GAAA,CAAI,CAAA,MAAA,KAAU,MAAA,EAAQ;AAAA,aACzC;AAEA,YAAA,MAAM,qBAAqB,UAAA,CAAW,GAAA;AAAA,cACpC,eAAA,CAAgB;AAAA,aAClB;AAEA,YAAA,OAAO,kBAAA;AAAA,UACT;AAAA,SACF;AAAA,OACD;AAAA,KACH;AAAA,EACF;AACF,CAAC;;;;"}
package/dist/alpha.d.ts CHANGED
@@ -5,7 +5,8 @@ import { TemplateGroupFilter, FieldExtensionOptions, ReviewStepProps, LayoutOpti
5
5
  import { FormProps as FormProps$2 } from '@rjsf/core';
6
6
  import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
7
7
  import * as _backstage_plugin_scaffolder_react_alpha from '@backstage/plugin-scaffolder-react/alpha';
8
- import { ScaffolderFormDecorator, FormField } from '@backstage/plugin-scaffolder-react/alpha';
8
+ import { ScaffolderFormDecorator } from '@backstage/plugin-scaffolder-react/alpha';
9
+ export { ScaffolderFormFieldsApi, formFieldsApiRef } from '@backstage/plugin-scaffolder-react/alpha';
9
10
  import * as _backstage_core_components from '@backstage/core-components';
10
11
  import * as _backstage_catalog_model from '@backstage/catalog-model';
11
12
  import * as _backstage_filter_predicates from '@backstage/filter-predicates';
@@ -290,13 +291,6 @@ declare const formDecoratorsApi: _backstage_frontend_plugin_api.OverridableExten
290
291
  params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
291
292
  }>;
292
293
 
293
- /** @alpha */
294
- interface ScaffolderFormFieldsApi {
295
- loadFormFields(): Promise<FormField[]>;
296
- }
297
- /** @alpha */
298
- declare const formFieldsApiRef: _backstage_frontend_plugin_api.ApiRef<ScaffolderFormFieldsApi>;
299
-
300
294
  /** @alpha */
301
295
  declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin<{
302
296
  root: _backstage_core_plugin_api.RouteRef<undefined>;
@@ -552,5 +546,5 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
552
546
  }>;
553
547
  }>;
554
548
 
555
- export { DefaultScaffolderFormDecoratorsApi, _default as default, formDecoratorsApi, formDecoratorsApiRef, formFieldsApiRef, scaffolderTranslationRef };
556
- export type { FormProps, ScaffolderCustomFieldExplorerClassKey, ScaffolderFormDecoratorsApi, ScaffolderFormFieldsApi, ScaffolderTemplateEditorClassKey, ScaffolderTemplateFormPreviewerClassKey, TemplateListPageProps, TemplateWizardPageProps };
549
+ export { DefaultScaffolderFormDecoratorsApi, _default as default, formDecoratorsApi, formDecoratorsApiRef, scaffolderTranslationRef };
550
+ export type { FormProps, ScaffolderCustomFieldExplorerClassKey, ScaffolderFormDecoratorsApi, ScaffolderTemplateEditorClassKey, ScaffolderTemplateFormPreviewerClassKey, TemplateListPageProps, TemplateWizardPageProps };
package/dist/alpha.esm.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export { scaffolderTranslationRef } from './translation.esm.js';
2
2
  export { formDecoratorsApiRef } from './alpha/api/ref.esm.js';
3
3
  export { DefaultScaffolderFormDecoratorsApi, formDecoratorsApi } from './alpha/api/FormDecoratorsApi.esm.js';
4
- export { formFieldsApiRef } from './alpha/formFieldsApi.esm.js';
4
+ import './alpha/formFieldsApi.esm.js';
5
5
  export { default } from './alpha/plugin.esm.js';
6
+ export { formFieldsApiRef } from '@backstage/plugin-scaffolder-react/alpha';
6
7
  //# sourceMappingURL=alpha.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -9,8 +9,9 @@ const repoPickerValidation = (value, validation, context) => {
9
9
  "Incomplete repository location provided, host not provided"
10
10
  );
11
11
  } else {
12
- if (integrationApi?.byHost(host)?.type === "bitbucket") {
13
- if (host === "bitbucket.org" && !searchParams.get("workspace")) {
12
+ const integrationType = integrationApi?.byHost(host)?.type;
13
+ if (integrationType === "bitbucketCloud" || integrationType === "bitbucketServer") {
14
+ if (integrationType === "bitbucketCloud" && !searchParams.get("workspace")) {
14
15
  validation.addError(
15
16
  "Incomplete repository location provided, workspace not provided"
16
17
  );
@@ -20,7 +21,7 @@ const repoPickerValidation = (value, validation, context) => {
20
21
  "Incomplete repository location provided, project not provided"
21
22
  );
22
23
  }
23
- } else if (integrationApi?.byHost(host)?.type === "azure") {
24
+ } else if (integrationType === "azure") {
24
25
  if (!searchParams.get("project")) {
25
26
  validation.addError(
26
27
  "Incomplete repository location provided, project not provided"
@@ -1 +1 @@
1
- {"version":3,"file":"validation.esm.js","sources":["../../../../src/components/fields/RepoUrlPicker/validation.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 */\n\nimport { FieldValidation } from '@rjsf/utils';\nimport { ApiHolder } from '@backstage/core-plugin-api';\nimport { scmIntegrationsApiRef } from '@backstage/integration-react';\n\n/**\n * The validation function for the `repoUrl` that is returned from the\n * field extension. Ensures that you have all the required fields filled for\n * the different providers that exist.\n * @public\n */\nexport const repoPickerValidation = (\n value: string,\n validation: FieldValidation,\n context: { apiHolder: ApiHolder },\n) => {\n try {\n const { host, searchParams } = new URL(`https://${value}`);\n\n const integrationApi = context.apiHolder.get(scmIntegrationsApiRef);\n\n if (!host) {\n validation.addError(\n 'Incomplete repository location provided, host not provided',\n );\n } else {\n if (integrationApi?.byHost(host)?.type === 'bitbucket') {\n // workspace is only applicable for bitbucket cloud\n if (host === 'bitbucket.org' && !searchParams.get('workspace')) {\n validation.addError(\n 'Incomplete repository location provided, workspace not provided',\n );\n }\n\n if (!searchParams.get('project')) {\n validation.addError(\n 'Incomplete repository location provided, project not provided',\n );\n }\n } else if (integrationApi?.byHost(host)?.type === 'azure') {\n if (!searchParams.get('project')) {\n validation.addError(\n 'Incomplete repository location provided, project not provided',\n );\n }\n }\n // For anything other than bitbucket, azure, and gerrit\n else if (integrationApi?.byHost(host)?.type !== 'gerrit') {\n if (!searchParams.get('owner')) {\n validation.addError(\n 'Incomplete repository location provided, owner not provided',\n );\n }\n }\n\n // Do this for all hosts\n if (!searchParams.get('repo')) {\n validation.addError(\n 'Incomplete repository location provided, repo not provided',\n );\n }\n }\n } catch {\n validation.addError('Unable to parse the Repository URL');\n }\n};\n"],"names":[],"mappings":";;AA0BO,M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AAA,UAAA,CAAW,QAAA;AAAA,UACT;AAAA,SACF;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAA,CAAA,MAAQ;AACN,IAAA,UAAA,CAAW,SAAS,oCAAoC,CAAA;AAAA,EAC1D;AACF;;;;"}
1
+ {"version":3,"file":"validation.esm.js","sources":["../../../../src/components/fields/RepoUrlPicker/validation.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 */\n\nimport { FieldValidation } from '@rjsf/utils';\nimport { ApiHolder } from '@backstage/core-plugin-api';\nimport { scmIntegrationsApiRef } from '@backstage/integration-react';\n\n/**\n * The validation function for the `repoUrl` that is returned from the\n * field extension. Ensures that you have all the required fields filled for\n * the different providers that exist.\n * @public\n */\nexport const repoPickerValidation = (\n value: string,\n validation: FieldValidation,\n context: { apiHolder: ApiHolder },\n) => {\n try {\n const { host, searchParams } = new URL(`https://${value}`);\n\n const integrationApi = context.apiHolder.get(scmIntegrationsApiRef);\n\n if (!host) {\n validation.addError(\n 'Incomplete repository location provided, host not provided',\n );\n } else {\n const integrationType = integrationApi?.byHost(host)?.type;\n if (\n integrationType === 'bitbucketCloud' ||\n integrationType === 'bitbucketServer'\n ) {\n // workspace is only applicable for bitbucket cloud\n if (\n integrationType === 'bitbucketCloud' &&\n !searchParams.get('workspace')\n ) {\n validation.addError(\n 'Incomplete repository location provided, workspace not provided',\n );\n }\n\n if (!searchParams.get('project')) {\n validation.addError(\n 'Incomplete repository location provided, project not provided',\n );\n }\n } else if (integrationType === 'azure') {\n if (!searchParams.get('project')) {\n validation.addError(\n 'Incomplete repository location provided, project not provided',\n );\n }\n }\n // For anything other than bitbucket, azure, and gerrit\n else if (integrationApi?.byHost(host)?.type !== 'gerrit') {\n if (!searchParams.get('owner')) {\n validation.addError(\n 'Incomplete repository location provided, owner not provided',\n );\n }\n }\n\n // Do this for all hosts\n if (!searchParams.get('repo')) {\n validation.addError(\n 'Incomplete repository location provided, repo not provided',\n );\n }\n }\n } catch {\n validation.addError('Unable to parse the Repository URL');\n }\n};\n"],"names":[],"mappings":";;AA0BO,MAAM,oBAAA,GAAuB,CAClC,KAAA,EACA,UAAA,EACA,OAAA,KACG;AACH,EAAA,IAAI;AACF,IAAA,MAAM,EAAE,MAAM,YAAA,EAAa,GAAI,IAAI,GAAA,CAAI,CAAA,QAAA,EAAW,KAAK,CAAA,CAAE,CAAA;AAEzD,IAAA,MAAM,cAAA,GAAiB,OAAA,CAAQ,SAAA,CAAU,GAAA,CAAI,qBAAqB,CAAA;AAElE,IAAA,IAAI,CAAC,IAAA,EAAM;AACT,MAAA,UAAA,CAAW,QAAA;AAAA,QACT;AAAA,OACF;AAAA,IACF,CAAA,MAAO;AACL,MAAA,MAAM,eAAA,GAAkB,cAAA,EAAgB,MAAA,CAAO,IAAI,CAAA,EAAG,IAAA;AACtD,MAAA,IACE,eAAA,KAAoB,gBAAA,IACpB,eAAA,KAAoB,iBAAA,EACpB;AAEA,QAAA,IACE,oBAAoB,gBAAA,IACpB,CAAC,YAAA,CAAa,GAAA,CAAI,WAAW,CAAA,EAC7B;AACA,UAAA,UAAA,CAAW,QAAA;AAAA,YACT;AAAA,WACF;AAAA,QACF;AAEA,QAAA,IAAI,CAAC,YAAA,CAAa,GAAA,CAAI,SAAS,CAAA,EAAG;AAChC,UAAA,UAAA,CAAW,QAAA;AAAA,YACT;AAAA,WACF;AAAA,QACF;AAAA,MACF,CAAA,MAAA,IAAW,oBAAoB,OAAA,EAAS;AACtC,QAAA,IAAI,CAAC,YAAA,CAAa,GAAA,CAAI,SAAS,CAAA,EAAG;AAChC,UAAA,UAAA,CAAW,QAAA;AAAA,YACT;AAAA,WACF;AAAA,QACF;AAAA,MACF,WAES,cAAA,EAAgB,MAAA,CAAO,IAAI,CAAA,EAAG,SAAS,QAAA,EAAU;AACxD,QAAA,IAAI,CAAC,YAAA,CAAa,GAAA,CAAI,OAAO,CAAA,EAAG;AAC9B,UAAA,UAAA,CAAW,QAAA;AAAA,YACT;AAAA,WACF;AAAA,QACF;AAAA,MACF;AAGA,MAAA,IAAI,CAAC,YAAA,CAAa,GAAA,CAAI,MAAM,CAAA,EAAG;AAC7B,QAAA,UAAA,CAAW,QAAA;AAAA,UACT;AAAA,SACF;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAA,CAAA,MAAQ;AACN,IAAA,UAAA,CAAW,SAAS,oCAAoC,CAAA;AAAA,EAC1D;AACF;;;;"}
@@ -1,5 +1,5 @@
1
1
  var name = "@backstage/plugin-scaffolder";
2
- var version = "1.35.5-next.0";
2
+ var version = "1.35.5-next.1";
3
3
  var description = "The Backstage plugin that helps you create new things";
4
4
  var backstage = {
5
5
  role: "frontend-plugin",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder",
3
- "version": "1.35.5-next.0",
3
+ "version": "1.35.5-next.1",
4
4
  "description": "The Backstage plugin that helps you create new things",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin",
@@ -70,19 +70,19 @@
70
70
  "test": "backstage-cli package test"
71
71
  },
72
72
  "dependencies": {
73
- "@backstage/catalog-client": "1.13.1-next.0",
73
+ "@backstage/catalog-client": "1.14.0-next.1",
74
74
  "@backstage/catalog-model": "1.7.6",
75
75
  "@backstage/core-components": "0.18.8-next.0",
76
76
  "@backstage/core-plugin-api": "1.12.4-next.0",
77
77
  "@backstage/errors": "1.2.7",
78
78
  "@backstage/frontend-plugin-api": "0.14.2-next.0",
79
- "@backstage/integration": "1.21.0-next.0",
80
- "@backstage/integration-react": "1.2.16-next.0",
79
+ "@backstage/integration": "2.0.0-next.1",
80
+ "@backstage/integration-react": "1.2.16-next.1",
81
81
  "@backstage/plugin-catalog-common": "1.1.8",
82
- "@backstage/plugin-catalog-react": "2.0.1-next.0",
82
+ "@backstage/plugin-catalog-react": "2.1.0-next.1",
83
83
  "@backstage/plugin-permission-react": "0.4.41-next.0",
84
- "@backstage/plugin-scaffolder-common": "1.7.7-next.0",
85
- "@backstage/plugin-scaffolder-react": "1.19.8-next.0",
84
+ "@backstage/plugin-scaffolder-common": "2.0.0-next.1",
85
+ "@backstage/plugin-scaffolder-react": "1.19.8-next.1",
86
86
  "@backstage/plugin-techdocs-common": "0.1.1",
87
87
  "@backstage/plugin-techdocs-react": "1.3.9-next.0",
88
88
  "@backstage/types": "1.2.2",
@@ -117,13 +117,13 @@
117
117
  "zod-to-json-schema": "^3.25.1"
118
118
  },
119
119
  "devDependencies": {
120
- "@backstage/cli": "0.35.5-next.0",
120
+ "@backstage/cli": "0.36.0-next.1",
121
121
  "@backstage/core-app-api": "1.19.6-next.0",
122
- "@backstage/dev-utils": "1.1.21-next.0",
123
- "@backstage/frontend-test-utils": "0.5.1-next.0",
124
- "@backstage/plugin-catalog": "1.33.1-next.0",
122
+ "@backstage/dev-utils": "1.1.21-next.1",
123
+ "@backstage/frontend-test-utils": "0.5.1-next.1",
124
+ "@backstage/plugin-catalog": "1.34.0-next.1",
125
125
  "@backstage/plugin-permission-common": "0.9.6",
126
- "@backstage/plugin-techdocs": "1.17.1-next.0",
126
+ "@backstage/plugin-techdocs": "1.17.1-next.1",
127
127
  "@backstage/test-utils": "1.7.16-next.0",
128
128
  "@testing-library/dom": "^10.0.0",
129
129
  "@testing-library/jest-dom": "^6.0.0",