chore(learn): Merge learn in to the client app

This commit is contained in:
Bouncey
2018-09-30 11:37:19 +01:00
committed by Stuart Taylor
parent 9e869a46fc
commit 5b254f3ad6
320 changed files with 9820 additions and 27605 deletions

View File

@ -0,0 +1,27 @@
const { createChallengeNodes } = require('./create-Challenge-nodes');
exports.sourceNodes = ({ actions, reporter }, pluginOptions) => {
if (typeof pluginOptions.source !== 'function') {
reporter.panic(`
"source" is a required option for fcc-source-challenges. It must be a function
that delivers challenge files to the plugin
`);
}
// TODO: Add live seed updates
const { createNode } = actions;
const { source } = pluginOptions;
return source().subscribe(
challenges =>
challenges
.filter(challenge => challenge.superBlock !== 'Certificates')
.map(challenge => createChallengeNodes(challenge, reporter))
.map(node => createNode(node)),
e =>
reporter.panic(`fcc-sourec-challenges
${e.message}
`)
);
};