From 62b917f41b415c62dde5cf2080ea9b14bcc322df Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 28 Apr 2020 22:53:59 +0200 Subject: [PATCH] chore(scaffolder): fixing linting issues in the repo --- plugins/scaffolder-backend/.eslintrc.js | 1 + plugins/scaffolder-backend/src/index.ts | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/plugins/scaffolder-backend/.eslintrc.js b/plugins/scaffolder-backend/.eslintrc.js index f50d2c3749..56b9c0bb2e 100644 --- a/plugins/scaffolder-backend/.eslintrc.js +++ b/plugins/scaffolder-backend/.eslintrc.js @@ -1,5 +1,6 @@ module.exports = { extends: [require.resolve('@backstage/cli/config/eslint')], + ignorePatterns: ['sample-templates/'], rules: { 'no-console': 0, // Permitted in console programs 'new-cap': ['error', { capIsNew: false }], // Because Express constructs things e.g. like 'const r = express.Router()' diff --git a/plugins/scaffolder-backend/src/index.ts b/plugins/scaffolder-backend/src/index.ts index b1d5683aa4..8c790c51f9 100644 --- a/plugins/scaffolder-backend/src/index.ts +++ b/plugins/scaffolder-backend/src/index.ts @@ -30,5 +30,15 @@ export const createScaffolder = (config?: TemplaterConfig & StorageConfig) => { res.status(200).json(templates); }); + router.post('/v1/job/create', async (_, res) => { + // TODO(blam): Actually make this function work' + + const mock = 'templateid'; + res.status(201).json({ accepted: true }); + + const path = await store.prepare(mock); + await templater.run({ directory: path, values: { componentId: 'test' } }); + }); + return router; };