Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

feat: add Autogov Processor #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backstage-plugin-module-autogov-processor/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
5 changes: 5 additions & 0 deletions backstage-plugin-module-autogov-processor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# @internal/backstage-plugin-catalog-backend-module-autogov-processor

The autogov-processor backend module for the catalog plugin.

_This plugin was created through the Backstage CLI_
55 changes: 55 additions & 0 deletions backstage-plugin-module-autogov-processor/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "@liatrio/backstage-plugin-module-autogov-processor",
"description": "The autogov-processor backend module for the catalog plugin.",
"version": "1.2.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/liatrio/backstage-github-autogov-plugin.git",
"directory": "backstage-plugin-autogov-common"
},
"backstage": {
"role": "backend-plugin-module",
"pluginId": "autogov-processor",
"pluginPackages": []
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/",
"access": "public"
},
"sideEffects": false,
"scripts": {
"start": "backstage-cli package start",
"build": "backstage-cli package build",
"lint": "backstage-cli package lint",
"lint:all": "yarn lint && yarn prettier:check",
"test": "backstage-cli package test",
"clean": "backstage-cli package clean",
"prepack": "backstage-cli package prepack",
"postpack": "backstage-cli package postpack",
"prettier:check": "npx --yes prettier --check .",
"prettier:fix": "npx --yes prettier --write .",
"tsc:full": "tsc --skipLibCheck true --incremental false",
"prepare": "husky"
},
"dependencies": {
"@backstage/backend-plugin-api": "^1.0.0",
"@backstage/catalog-model": "^1.7.0",
"@backstage/config": "^1.2.0",
"@backstage/integration": "^1.15.1",
"@backstage/plugin-catalog-node": "^1.13.1",
"@backstage/types": "^1.1.1",
"@liatrio/backstage-plugin-autogov-common": "^v1.2.4",
"node-fetch": "2"
},
"devDependencies": {
"@backstage/backend-test-utils": "^1.0.0",
"@backstage/cli": "^0.27.1",
"@types/node-fetch": "2"
},
"files": [
"dist"
]
}
8 changes: 8 additions & 0 deletions backstage-plugin-module-autogov-processor/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/***/
/**
* The autogov-processor backend module for the catalog plugin.
*
* @packageDocumentation
*/

export { catalogModuleAutogovProcessor as default } from './module';
28 changes: 28 additions & 0 deletions backstage-plugin-module-autogov-processor/src/module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import {
coreServices,
createBackendModule,
} from '@backstage/backend-plugin-api';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { AutogovProcessor } from './processor';

export const catalogModuleAutogovProcessor = createBackendModule({
pluginId: 'catalog',
moduleId: 'autogov-processor',
register(reg) {
reg.registerInit({
deps: {
catalog: catalogProcessingExtensionPoint,
config: coreServices.rootConfig,
logger: coreServices.logger,
},
async init({ catalog, config, logger }) {
logger.info('Initializing Autogov Processor');
catalog.addProcessor(
AutogovProcessor.fromConfig(config, {
logger,
}),
);
},
});
},
});
Loading
Loading