@backstage-community/plugin-catalog-backend-module-scaffolder-relation-processor 2.0.0 → 2.0.2

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,17 @@
1
1
  # @backstage-community/plugin-catalog-backend-module-scaffolder-relation-processor
2
2
 
3
+ ## 2.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - b774194: Removed `export-dynamic` script and Janus IDP cli from the build process and npm release.
8
+
9
+ ## 2.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - d5bb854: Backstage version bump to v1.32.2
14
+
3
15
  ## 2.0.0
4
16
 
5
17
  ### Major Changes
@@ -0,0 +1,55 @@
1
+ 'use strict';
2
+
3
+ var catalogModel = require('@backstage/catalog-model');
4
+ var pluginCatalogNode = require('@backstage/plugin-catalog-node');
5
+ var relations = require('./relations.cjs.js');
6
+
7
+ class ScaffolderRelationEntityProcessor {
8
+ getProcessorName() {
9
+ return "ScaffolderRelationEntityProcessor";
10
+ }
11
+ async postProcessEntity(entity, _location, emit) {
12
+ const selfRef = catalogModel.getCompoundEntityRef(entity);
13
+ function doEmit(targets, context, outgoingRelation, incomingRelation) {
14
+ if (!targets) {
15
+ return;
16
+ }
17
+ for (const target of [targets].flat()) {
18
+ const targetRef = catalogModel.parseEntityRef(target, context);
19
+ emit(
20
+ pluginCatalogNode.processingResult.relation({
21
+ source: selfRef,
22
+ type: outgoingRelation,
23
+ target: {
24
+ kind: targetRef.kind,
25
+ namespace: targetRef.namespace,
26
+ name: targetRef.name
27
+ }
28
+ })
29
+ );
30
+ emit(
31
+ pluginCatalogNode.processingResult.relation({
32
+ source: {
33
+ kind: targetRef.kind,
34
+ namespace: targetRef.namespace,
35
+ name: targetRef.name
36
+ },
37
+ type: incomingRelation,
38
+ target: selfRef
39
+ })
40
+ );
41
+ }
42
+ }
43
+ const arbitraryEntity = entity;
44
+ doEmit(
45
+ arbitraryEntity.spec?.scaffoldedFrom,
46
+ { defaultKind: "Template", defaultNamespace: selfRef.namespace },
47
+ relations.RELATION_SCAFFOLDED_FROM,
48
+ relations.RELATION_SCAFFOLDER_OF
49
+ );
50
+ return entity;
51
+ }
52
+ }
53
+
54
+ exports.ScaffolderRelationEntityProcessor = ScaffolderRelationEntityProcessor;
55
+ //# sourceMappingURL=ScaffolderRelationEntityProcessor.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScaffolderRelationEntityProcessor.cjs.js","sources":["../src/ScaffolderRelationEntityProcessor.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 */\nimport {\n Entity,\n getCompoundEntityRef,\n parseEntityRef,\n} from '@backstage/catalog-model';\nimport type { LocationSpec } from '@backstage/plugin-catalog-common';\nimport {\n CatalogProcessor,\n CatalogProcessorEmit,\n processingResult,\n} from '@backstage/plugin-catalog-node';\n\nimport { RELATION_SCAFFOLDED_FROM, RELATION_SCAFFOLDER_OF } from './relations';\nimport type { ScaffoldedFromSpec } from './types';\n\n/** @public */\nexport class ScaffolderRelationEntityProcessor implements CatalogProcessor {\n getProcessorName(): string {\n return 'ScaffolderRelationEntityProcessor';\n }\n\n async postProcessEntity(\n entity: Entity,\n _location: LocationSpec,\n emit: CatalogProcessorEmit,\n ): Promise<Entity> {\n const selfRef = getCompoundEntityRef(entity);\n\n /**\n * Utilities\n */\n function doEmit(\n targets: string | string[] | undefined,\n context: { defaultKind?: string; defaultNamespace: string },\n outgoingRelation: string,\n incomingRelation: string,\n ): void {\n if (!targets) {\n return;\n }\n for (const target of [targets].flat()) {\n const targetRef = parseEntityRef(target, context);\n emit(\n processingResult.relation({\n source: selfRef,\n type: outgoingRelation,\n target: {\n kind: targetRef.kind,\n namespace: targetRef.namespace,\n name: targetRef.name,\n },\n }),\n );\n emit(\n processingResult.relation({\n source: {\n kind: targetRef.kind,\n namespace: targetRef.namespace,\n name: targetRef.name,\n },\n type: incomingRelation,\n target: selfRef,\n }),\n );\n }\n }\n\n /**\n * Emit relations for entities generated by templates (can be any entity type)\n */\n const arbitraryEntity = entity as Entity & Partial<ScaffoldedFromSpec>;\n doEmit(\n arbitraryEntity.spec?.scaffoldedFrom,\n { defaultKind: 'Template', defaultNamespace: selfRef.namespace },\n RELATION_SCAFFOLDED_FROM,\n RELATION_SCAFFOLDER_OF,\n );\n return entity;\n }\n}\n"],"names":["getCompoundEntityRef","parseEntityRef","processingResult","RELATION_SCAFFOLDED_FROM","RELATION_SCAFFOLDER_OF"],"mappings":";;;;;;AA+BO,MAAM,iCAA8D,CAAA;AAAA,EACzE,gBAA2B,GAAA;AACzB,IAAO,OAAA,mCAAA,CAAA;AAAA,GACT;AAAA,EAEA,MAAM,iBAAA,CACJ,MACA,EAAA,SAAA,EACA,IACiB,EAAA;AACjB,IAAM,MAAA,OAAA,GAAUA,kCAAqB,MAAM,CAAA,CAAA;AAK3C,IAAA,SAAS,MACP,CAAA,OAAA,EACA,OACA,EAAA,gBAAA,EACA,gBACM,EAAA;AACN,MAAA,IAAI,CAAC,OAAS,EAAA;AACZ,QAAA,OAAA;AAAA,OACF;AACA,MAAA,KAAA,MAAW,MAAU,IAAA,CAAC,OAAO,CAAA,CAAE,MAAQ,EAAA;AACrC,QAAM,MAAA,SAAA,GAAYC,2BAAe,CAAA,MAAA,EAAQ,OAAO,CAAA,CAAA;AAChD,QAAA,IAAA;AAAA,UACEC,mCAAiB,QAAS,CAAA;AAAA,YACxB,MAAQ,EAAA,OAAA;AAAA,YACR,IAAM,EAAA,gBAAA;AAAA,YACN,MAAQ,EAAA;AAAA,cACN,MAAM,SAAU,CAAA,IAAA;AAAA,cAChB,WAAW,SAAU,CAAA,SAAA;AAAA,cACrB,MAAM,SAAU,CAAA,IAAA;AAAA,aAClB;AAAA,WACD,CAAA;AAAA,SACH,CAAA;AACA,QAAA,IAAA;AAAA,UACEA,mCAAiB,QAAS,CAAA;AAAA,YACxB,MAAQ,EAAA;AAAA,cACN,MAAM,SAAU,CAAA,IAAA;AAAA,cAChB,WAAW,SAAU,CAAA,SAAA;AAAA,cACrB,MAAM,SAAU,CAAA,IAAA;AAAA,aAClB;AAAA,YACA,IAAM,EAAA,gBAAA;AAAA,YACN,MAAQ,EAAA,OAAA;AAAA,WACT,CAAA;AAAA,SACH,CAAA;AAAA,OACF;AAAA,KACF;AAKA,IAAA,MAAM,eAAkB,GAAA,MAAA,CAAA;AACxB,IAAA,MAAA;AAAA,MACE,gBAAgB,IAAM,EAAA,cAAA;AAAA,MACtB,EAAE,WAAA,EAAa,UAAY,EAAA,gBAAA,EAAkB,QAAQ,SAAU,EAAA;AAAA,MAC/DC,kCAAA;AAAA,MACAC,gCAAA;AAAA,KACF,CAAA;AACA,IAAO,OAAA,MAAA,CAAA;AAAA,GACT;AACF;;;;"}
package/dist/index.cjs.js CHANGED
@@ -2,82 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var backendPluginApi = require('@backstage/backend-plugin-api');
6
- var alpha = require('@backstage/plugin-catalog-node/alpha');
7
- var catalogModel = require('@backstage/catalog-model');
8
- var pluginCatalogNode = require('@backstage/plugin-catalog-node');
5
+ var relations = require('./relations.cjs.js');
6
+ var module$1 = require('./module.cjs.js');
7
+ var ScaffolderRelationEntityProcessor = require('./ScaffolderRelationEntityProcessor.cjs.js');
9
8
 
10
- const RELATION_SCAFFOLDER_OF = "scaffolderOf";
11
- const RELATION_SCAFFOLDED_FROM = "scaffoldedFrom";
12
9
 
13
- class ScaffolderRelationEntityProcessor {
14
- getProcessorName() {
15
- return "ScaffolderRelationEntityProcessor";
16
- }
17
- async postProcessEntity(entity, _location, emit) {
18
- const selfRef = catalogModel.getCompoundEntityRef(entity);
19
- function doEmit(targets, context, outgoingRelation, incomingRelation) {
20
- if (!targets) {
21
- return;
22
- }
23
- for (const target of [targets].flat()) {
24
- const targetRef = catalogModel.parseEntityRef(target, context);
25
- emit(
26
- pluginCatalogNode.processingResult.relation({
27
- source: selfRef,
28
- type: outgoingRelation,
29
- target: {
30
- kind: targetRef.kind,
31
- namespace: targetRef.namespace,
32
- name: targetRef.name
33
- }
34
- })
35
- );
36
- emit(
37
- pluginCatalogNode.processingResult.relation({
38
- source: {
39
- kind: targetRef.kind,
40
- namespace: targetRef.namespace,
41
- name: targetRef.name
42
- },
43
- type: incomingRelation,
44
- target: selfRef
45
- })
46
- );
47
- }
48
- }
49
- const arbitraryEntity = entity;
50
- doEmit(
51
- arbitraryEntity.spec?.scaffoldedFrom,
52
- { defaultKind: "Template", defaultNamespace: selfRef.namespace },
53
- RELATION_SCAFFOLDED_FROM,
54
- RELATION_SCAFFOLDER_OF
55
- );
56
- return entity;
57
- }
58
- }
59
10
 
60
- const catalogModuleScaffolderRelationProcessor = backendPluginApi.createBackendModule({
61
- pluginId: "catalog",
62
- moduleId: "scaffolder-relation-processor",
63
- register(env) {
64
- env.registerInit({
65
- deps: {
66
- catalog: alpha.catalogProcessingExtensionPoint,
67
- logger: backendPluginApi.coreServices.logger
68
- },
69
- async init({ catalog, logger }) {
70
- logger.debug(
71
- "Registering the scaffolder-relation-processor catalog module"
72
- );
73
- catalog.addProcessor(new ScaffolderRelationEntityProcessor());
74
- }
75
- });
76
- }
77
- });
78
-
79
- exports.RELATION_SCAFFOLDED_FROM = RELATION_SCAFFOLDED_FROM;
80
- exports.RELATION_SCAFFOLDER_OF = RELATION_SCAFFOLDER_OF;
81
- exports.ScaffolderRelationEntityProcessor = ScaffolderRelationEntityProcessor;
82
- exports.default = catalogModuleScaffolderRelationProcessor;
11
+ exports.RELATION_SCAFFOLDED_FROM = relations.RELATION_SCAFFOLDED_FROM;
12
+ exports.RELATION_SCAFFOLDER_OF = relations.RELATION_SCAFFOLDER_OF;
13
+ exports.default = module$1.catalogModuleScaffolderRelationProcessor;
14
+ exports.ScaffolderRelationEntityProcessor = ScaffolderRelationEntityProcessor.ScaffolderRelationEntityProcessor;
83
15
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/relations.ts","../src/ScaffolderRelationEntityProcessor.ts","../src/module.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\n/**\n * A relation from a scaffolder template entity to the entity it generated.\n * Reverse direction of {@link RELATION_SCAFFOLDED_FROM}\n *\n * @public\n */\nexport const RELATION_SCAFFOLDER_OF = 'scaffolderOf';\n\n/**\n * A relation of an entity generated from a scaffolder template entity\n * Reverse direction of {@link RELATION_SCAFFOLDER_OF}\n *\n * @public\n */\nexport const RELATION_SCAFFOLDED_FROM = 'scaffoldedFrom';\n","/*\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 */\nimport {\n Entity,\n getCompoundEntityRef,\n parseEntityRef,\n} from '@backstage/catalog-model';\nimport type { LocationSpec } from '@backstage/plugin-catalog-common';\nimport {\n CatalogProcessor,\n CatalogProcessorEmit,\n processingResult,\n} from '@backstage/plugin-catalog-node';\n\nimport { RELATION_SCAFFOLDED_FROM, RELATION_SCAFFOLDER_OF } from './relations';\nimport type { ScaffoldedFromSpec } from './types';\n\n/** @public */\nexport class ScaffolderRelationEntityProcessor implements CatalogProcessor {\n getProcessorName(): string {\n return 'ScaffolderRelationEntityProcessor';\n }\n\n async postProcessEntity(\n entity: Entity,\n _location: LocationSpec,\n emit: CatalogProcessorEmit,\n ): Promise<Entity> {\n const selfRef = getCompoundEntityRef(entity);\n\n /**\n * Utilities\n */\n function doEmit(\n targets: string | string[] | undefined,\n context: { defaultKind?: string; defaultNamespace: string },\n outgoingRelation: string,\n incomingRelation: string,\n ): void {\n if (!targets) {\n return;\n }\n for (const target of [targets].flat()) {\n const targetRef = parseEntityRef(target, context);\n emit(\n processingResult.relation({\n source: selfRef,\n type: outgoingRelation,\n target: {\n kind: targetRef.kind,\n namespace: targetRef.namespace,\n name: targetRef.name,\n },\n }),\n );\n emit(\n processingResult.relation({\n source: {\n kind: targetRef.kind,\n namespace: targetRef.namespace,\n name: targetRef.name,\n },\n type: incomingRelation,\n target: selfRef,\n }),\n );\n }\n }\n\n /**\n * Emit relations for entities generated by templates (can be any entity type)\n */\n const arbitraryEntity = entity as Entity & Partial<ScaffoldedFromSpec>;\n doEmit(\n arbitraryEntity.spec?.scaffoldedFrom,\n { defaultKind: 'Template', defaultNamespace: selfRef.namespace },\n RELATION_SCAFFOLDED_FROM,\n RELATION_SCAFFOLDER_OF,\n );\n return entity;\n }\n}\n","/*\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 */\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';\n\nimport { ScaffolderRelationEntityProcessor } from './ScaffolderRelationEntityProcessor';\n\n/**\n * Catalog processor that adds link relation between scaffolder templates and their generated entities\n *\n * @public\n */\nexport const catalogModuleScaffolderRelationProcessor = createBackendModule({\n pluginId: 'catalog',\n moduleId: 'scaffolder-relation-processor',\n register(env) {\n env.registerInit({\n deps: {\n catalog: catalogProcessingExtensionPoint,\n logger: coreServices.logger,\n },\n async init({ catalog, logger }) {\n logger.debug(\n 'Registering the scaffolder-relation-processor catalog module',\n );\n catalog.addProcessor(new ScaffolderRelationEntityProcessor());\n },\n });\n },\n});\n"],"names":["getCompoundEntityRef","parseEntityRef","processingResult","createBackendModule","catalogProcessingExtensionPoint","coreServices"],"mappings":";;;;;;;;;AAsBO,MAAM,sBAAyB,GAAA,eAAA;AAQ/B,MAAM,wBAA2B,GAAA;;ACCjC,MAAM,iCAA8D,CAAA;AAAA,EACzE,gBAA2B,GAAA;AACzB,IAAO,OAAA,mCAAA,CAAA;AAAA,GACT;AAAA,EAEA,MAAM,iBAAA,CACJ,MACA,EAAA,SAAA,EACA,IACiB,EAAA;AACjB,IAAM,MAAA,OAAA,GAAUA,kCAAqB,MAAM,CAAA,CAAA;AAK3C,IAAA,SAAS,MACP,CAAA,OAAA,EACA,OACA,EAAA,gBAAA,EACA,gBACM,EAAA;AACN,MAAA,IAAI,CAAC,OAAS,EAAA;AACZ,QAAA,OAAA;AAAA,OACF;AACA,MAAA,KAAA,MAAW,MAAU,IAAA,CAAC,OAAO,CAAA,CAAE,MAAQ,EAAA;AACrC,QAAM,MAAA,SAAA,GAAYC,2BAAe,CAAA,MAAA,EAAQ,OAAO,CAAA,CAAA;AAChD,QAAA,IAAA;AAAA,UACEC,mCAAiB,QAAS,CAAA;AAAA,YACxB,MAAQ,EAAA,OAAA;AAAA,YACR,IAAM,EAAA,gBAAA;AAAA,YACN,MAAQ,EAAA;AAAA,cACN,MAAM,SAAU,CAAA,IAAA;AAAA,cAChB,WAAW,SAAU,CAAA,SAAA;AAAA,cACrB,MAAM,SAAU,CAAA,IAAA;AAAA,aAClB;AAAA,WACD,CAAA;AAAA,SACH,CAAA;AACA,QAAA,IAAA;AAAA,UACEA,mCAAiB,QAAS,CAAA;AAAA,YACxB,MAAQ,EAAA;AAAA,cACN,MAAM,SAAU,CAAA,IAAA;AAAA,cAChB,WAAW,SAAU,CAAA,SAAA;AAAA,cACrB,MAAM,SAAU,CAAA,IAAA;AAAA,aAClB;AAAA,YACA,IAAM,EAAA,gBAAA;AAAA,YACN,MAAQ,EAAA,OAAA;AAAA,WACT,CAAA;AAAA,SACH,CAAA;AAAA,OACF;AAAA,KACF;AAKA,IAAA,MAAM,eAAkB,GAAA,MAAA,CAAA;AACxB,IAAA,MAAA;AAAA,MACE,gBAAgB,IAAM,EAAA,cAAA;AAAA,MACtB,EAAE,WAAA,EAAa,UAAY,EAAA,gBAAA,EAAkB,QAAQ,SAAU,EAAA;AAAA,MAC/D,wBAAA;AAAA,MACA,sBAAA;AAAA,KACF,CAAA;AACA,IAAO,OAAA,MAAA,CAAA;AAAA,GACT;AACF;;AClEO,MAAM,2CAA2CC,oCAAoB,CAAA;AAAA,EAC1E,QAAU,EAAA,SAAA;AAAA,EACV,QAAU,EAAA,+BAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,OAAS,EAAAC,qCAAA;AAAA,QACT,QAAQC,6BAAa,CAAA,MAAA;AAAA,OACvB;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,OAAA,EAAS,QAAU,EAAA;AAC9B,QAAO,MAAA,CAAA,KAAA;AAAA,UACL,8DAAA;AAAA,SACF,CAAA;AACA,QAAQ,OAAA,CAAA,YAAA,CAAa,IAAI,iCAAA,EAAmC,CAAA,CAAA;AAAA,OAC9D;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ var backendPluginApi = require('@backstage/backend-plugin-api');
4
+ var alpha = require('@backstage/plugin-catalog-node/alpha');
5
+ var ScaffolderRelationEntityProcessor = require('./ScaffolderRelationEntityProcessor.cjs.js');
6
+
7
+ const catalogModuleScaffolderRelationProcessor = backendPluginApi.createBackendModule({
8
+ pluginId: "catalog",
9
+ moduleId: "scaffolder-relation-processor",
10
+ register(env) {
11
+ env.registerInit({
12
+ deps: {
13
+ catalog: alpha.catalogProcessingExtensionPoint,
14
+ logger: backendPluginApi.coreServices.logger
15
+ },
16
+ async init({ catalog, logger }) {
17
+ logger.debug(
18
+ "Registering the scaffolder-relation-processor catalog module"
19
+ );
20
+ catalog.addProcessor(new ScaffolderRelationEntityProcessor.ScaffolderRelationEntityProcessor());
21
+ }
22
+ });
23
+ }
24
+ });
25
+
26
+ exports.catalogModuleScaffolderRelationProcessor = catalogModuleScaffolderRelationProcessor;
27
+ //# sourceMappingURL=module.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.cjs.js","sources":["../src/module.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 */\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';\n\nimport { ScaffolderRelationEntityProcessor } from './ScaffolderRelationEntityProcessor';\n\n/**\n * Catalog processor that adds link relation between scaffolder templates and their generated entities\n *\n * @public\n */\nexport const catalogModuleScaffolderRelationProcessor = createBackendModule({\n pluginId: 'catalog',\n moduleId: 'scaffolder-relation-processor',\n register(env) {\n env.registerInit({\n deps: {\n catalog: catalogProcessingExtensionPoint,\n logger: coreServices.logger,\n },\n async init({ catalog, logger }) {\n logger.debug(\n 'Registering the scaffolder-relation-processor catalog module',\n );\n catalog.addProcessor(new ScaffolderRelationEntityProcessor());\n },\n });\n },\n});\n"],"names":["createBackendModule","catalogProcessingExtensionPoint","coreServices","ScaffolderRelationEntityProcessor"],"mappings":";;;;;;AA4BO,MAAM,2CAA2CA,oCAAoB,CAAA;AAAA,EAC1E,QAAU,EAAA,SAAA;AAAA,EACV,QAAU,EAAA,+BAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,OAAS,EAAAC,qCAAA;AAAA,QACT,QAAQC,6BAAa,CAAA,MAAA;AAAA,OACvB;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,OAAA,EAAS,QAAU,EAAA;AAC9B,QAAO,MAAA,CAAA,KAAA;AAAA,UACL,8DAAA;AAAA,SACF,CAAA;AACA,QAAQ,OAAA,CAAA,YAAA,CAAa,IAAIC,mEAAA,EAAmC,CAAA,CAAA;AAAA,OAC9D;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;"}
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ const RELATION_SCAFFOLDER_OF = "scaffolderOf";
4
+ const RELATION_SCAFFOLDED_FROM = "scaffoldedFrom";
5
+
6
+ exports.RELATION_SCAFFOLDED_FROM = RELATION_SCAFFOLDED_FROM;
7
+ exports.RELATION_SCAFFOLDER_OF = RELATION_SCAFFOLDER_OF;
8
+ //# sourceMappingURL=relations.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relations.cjs.js","sources":["../src/relations.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\n/**\n * A relation from a scaffolder template entity to the entity it generated.\n * Reverse direction of {@link RELATION_SCAFFOLDED_FROM}\n *\n * @public\n */\nexport const RELATION_SCAFFOLDER_OF = 'scaffolderOf';\n\n/**\n * A relation of an entity generated from a scaffolder template entity\n * Reverse direction of {@link RELATION_SCAFFOLDER_OF}\n *\n * @public\n */\nexport const RELATION_SCAFFOLDED_FROM = 'scaffoldedFrom';\n"],"names":[],"mappings":";;AAsBO,MAAM,sBAAyB,GAAA,eAAA;AAQ/B,MAAM,wBAA2B,GAAA;;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage-community/plugin-catalog-backend-module-scaffolder-relation-processor",
3
3
  "description": "The scaffolder-relation-processor backend module for the catalog plugin.",
4
- "version": "2.0.0",
4
+ "version": "2.0.2",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -20,6 +20,7 @@
20
20
  },
21
21
  "exports": {
22
22
  ".": {
23
+ "backstage": "@backstage/BackendFeature",
23
24
  "require": "./dist/index.cjs.js",
24
25
  "types": "./dist/index.d.ts",
25
26
  "default": "./dist/index.cjs.js"
@@ -34,26 +35,20 @@
34
35
  "clean": "backstage-cli package clean",
35
36
  "prepack": "backstage-cli package prepack",
36
37
  "postpack": "backstage-cli package postpack",
37
- "postversion": "yarn run export-dynamic",
38
- "export-dynamic": "janus-cli package export-dynamic-plugin --no-embed-as-dependencies",
39
38
  "tsc": "tsc"
40
39
  },
41
40
  "dependencies": {
42
- "@backstage/backend-plugin-api": "^1.0.0",
41
+ "@backstage/backend-plugin-api": "^1.0.1",
43
42
  "@backstage/catalog-model": "^1.7.0",
44
- "@backstage/plugin-catalog-node": "^1.13.0"
43
+ "@backstage/plugin-catalog-node": "^1.13.1"
45
44
  },
46
45
  "devDependencies": {
47
- "@backstage/backend-test-utils": "^1.0.0",
48
- "@backstage/cli": "^0.27.1",
49
- "@backstage/plugin-catalog-common": "^1.1.0",
50
- "@janus-idp/cli": "1.13.1"
46
+ "@backstage/backend-test-utils": "^1.0.2",
47
+ "@backstage/cli": "^0.28.0",
48
+ "@backstage/plugin-catalog-common": "^1.1.0"
51
49
  },
52
50
  "files": [
53
- "dist",
54
51
  "config.d.ts",
55
- "dist-dynamic/*.*",
56
- "dist-dynamic/dist/**",
57
- "dist-dynamic/alpha/*"
52
+ "dist"
58
53
  ]
59
54
  }
@@ -1,46 +0,0 @@
1
- {
2
- "name": "@backstage-community/plugin-catalog-backend-module-scaffolder-relation-processor-dynamic",
3
- "description": "The scaffolder-relation-processor backend module for the catalog plugin.",
4
- "version": "1.2.9",
5
- "main": "./dist/index.cjs.js",
6
- "types": "src/index.ts",
7
- "license": "Apache-2.0",
8
- "publishConfig": {
9
- "access": "public"
10
- },
11
- "repository": {
12
- "type": "git",
13
- "url": "https://github.com/backstage/community-plugins",
14
- "directory": "workspaces/scaffolder-relation-processor/plugins/catalog-backend-module-scaffolder-relation-processor"
15
- },
16
- "backstage": {
17
- "role": "backend-plugin-module",
18
- "pluginId": "scaffolder-relation-processor",
19
- "pluginPackage": "@backstage-community/plugin-catalog-backend-module-scaffolder-relation-processor"
20
- },
21
- "exports": {
22
- ".": {
23
- "require": "./dist/index.cjs.js",
24
- "default": "./dist/index.cjs.js"
25
- },
26
- "./package.json": "./package.json"
27
- },
28
- "files": [
29
- "dist",
30
- "config.d.ts"
31
- ],
32
- "bundleDependencies": true,
33
- "peerDependencies": {
34
- "@backstage/backend-plugin-api": "^1.0.0",
35
- "@backstage/catalog-model": "^1.7.0",
36
- "@backstage/plugin-catalog-node": "^1.13.0"
37
- },
38
- "overrides": {
39
- "@aws-sdk/util-utf8-browser": {
40
- "@smithy/util-utf8": "^2.0.0"
41
- }
42
- },
43
- "resolutions": {
44
- "@aws-sdk/util-utf8-browser": "npm:@smithy/util-utf8@~2"
45
- }
46
- }
@@ -1,15 +0,0 @@
1
- # This file is generated by running "yarn install" inside your project.
2
- # Manual changes might be lost - proceed with caution!
3
-
4
- __metadata:
5
- version: 6
6
-
7
- "@backstage-community/plugin-catalog-backend-module-scaffolder-relation-processor-dynamic@workspace:.":
8
- version: 0.0.0-use.local
9
- resolution: "@backstage-community/plugin-catalog-backend-module-scaffolder-relation-processor-dynamic@workspace:."
10
- peerDependencies:
11
- "@backstage/backend-plugin-api": ^1.0.0
12
- "@backstage/catalog-model": ^1.7.0
13
- "@backstage/plugin-catalog-node": ^1.13.0
14
- languageName: unknown
15
- linkType: soft