Clean master commit

This commit is contained in:
Lachlan Kermode
2018-10-31 19:35:15 +00:00
commit 2cbfbc33ef
24 changed files with 5400 additions and 0 deletions

28
src/lib/blueprinters.js Normal file
View File

@@ -0,0 +1,28 @@
import path from "path";
import fs from "fs";
const REL_PATH_TO_BPS = "../blueprinters";
const allBps = {};
export const defaultBlueprint = {
name: null,
id: null,
dialects: ["rest"], // supported dialects, can (eventually) be multiple
routes: {}
};
export const defaultRoute = {
options: {
fragment: true
},
data: []
};
// import all default exports from 'blueprinters' folder
const normalizedPath = path.join(__dirname, REL_PATH_TO_BPS);
fs.readdirSync(normalizedPath).forEach(file => {
const bpName = file.replace(".js", "");
allBps[bpName] = require(`${REL_PATH_TO_BPS}/${file}`).default;
});
module.exports = allBps;