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

Commit

Permalink
feat: add autogov processor, testing simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
dbhagen committed Nov 8, 2024
1 parent 96c7c27 commit 1764b17
Show file tree
Hide file tree
Showing 12 changed files with 889 additions and 13 deletions.
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

0 comments on commit 1764b17

Please sign in to comment.