From b22c719651eb826070c19299b3a9a7a42a4a5c33 Mon Sep 17 00:00:00 2001 From: Bouncey Date: Thu, 4 Oct 2018 15:15:50 +0100 Subject: [PATCH] fix(source-plugin): Switch out gatsby-source-filesystem --- client/gatsby-config.js | 2 +- client/gatsby-node.js | 2 +- client/package-lock.json | 320 +++++++++--------- client/package.json | 4 +- .../fcc-source-challenges/gatsby-node.js | 2 +- client/utils/buildChallenges.js | 2 - netlify.toml | 2 +- 7 files changed, 171 insertions(+), 163 deletions(-) diff --git a/client/gatsby-config.js b/client/gatsby-config.js index 97f636f620..07acb9dfa3 100644 --- a/client/gatsby-config.js +++ b/client/gatsby-config.js @@ -32,7 +32,7 @@ module.exports = { } }, { - resolve: 'gatsby-source-filesystem', + resolve: '@freecodecamp/gatsby-source-filesystem', options: { name: 'introductions', path: path.resolve(__dirname, './src/pages') diff --git a/client/gatsby-node.js b/client/gatsby-node.js index 13a640a454..3f581d457e 100644 --- a/client/gatsby-node.js +++ b/client/gatsby-node.js @@ -1,6 +1,6 @@ require('dotenv').config(); -const { createFilePath } = require('gatsby-source-filesystem'); +const { createFilePath } = require('@freecodecamp/gatsby-source-filesystem'); const { dasherize } = require('./utils'); const { blockNameify } = require('./utils/blockNameify'); diff --git a/client/package-lock.json b/client/package-lock.json index b2557ef025..4b32010163 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -904,6 +904,171 @@ "prop-types": "^15.5.7" } }, + "@freecodecamp/gatsby-source-filesystem": { + "version": "2.0.1-beta.3", + "resolved": "https://registry.npmjs.org/@freecodecamp/gatsby-source-filesystem/-/gatsby-source-filesystem-2.0.1-beta.3.tgz", + "integrity": "sha512-5PzGLz2WniP8l77yfne3eHlu5KsalOv2J4/6zYPLX3ddfRi9bBLHKH15YPCSW25xMr9PZyZduDO5sYMZiJ09jw==", + "requires": { + "@babel/preset-env": "^7.0.0-beta.51", + "@babel/runtime": "7.0.0-beta.51", + "better-queue": "^3.8.7", + "bluebird": "^3.5.0", + "chokidar": "^1.7.0", + "fs-extra": "^5.0.0", + "got": "^7.1.0", + "md5-file": "^3.1.1", + "mime": "^2.2.0", + "pretty-bytes": "^4.0.2", + "slash": "^1.0.0", + "valid-url": "^1.0.9", + "xstate": "^3.1.0" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.0.0-beta.51.tgz", + "integrity": "sha1-SLjtGDBwNMZiD2Q1FGUMoszAFlo=", + "requires": { + "core-js": "^2.5.7", + "regenerator-runtime": "^0.11.1" + } + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "requires": { + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "requires": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "requires": { + "is-extglob": "^1.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "requires": { + "is-glob": "^2.0.0" + } + }, + "got": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", + "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "requires": { + "decompress-response": "^3.2.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-plain-obj": "^1.1.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "p-cancelable": "^0.3.0", + "p-timeout": "^1.1.1", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "url-parse-lax": "^1.0.0", + "url-to-options": "^1.0.1" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "^1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + } + } + }, "@freecodecamp/react-bootstrap": { "version": "0.32.3", "resolved": "https://registry.npmjs.org/@freecodecamp/react-bootstrap/-/react-bootstrap-0.32.3.tgz", @@ -7185,161 +7350,6 @@ "unist-util-visit": "^1.3.0" } }, - "gatsby-source-filesystem": { - "version": "2.0.1-rc.6", - "resolved": "https://registry.npmjs.org/gatsby-source-filesystem/-/gatsby-source-filesystem-2.0.1-rc.6.tgz", - "integrity": "sha512-uXA+CKy4LPzWztDu/29yOOjmsHhEAFsQmdOKHzuzT/prf4GRSJwl1lg+U96wGeb+jmOXGDCXD4rdW9nw4RhaIA==", - "requires": { - "@babel/runtime": "^7.0.0", - "better-queue": "^3.8.7", - "bluebird": "^3.5.0", - "chokidar": "^1.7.0", - "fs-extra": "^5.0.0", - "got": "^7.1.0", - "md5-file": "^3.1.1", - "mime": "^2.2.0", - "pretty-bytes": "^4.0.2", - "slash": "^1.0.0", - "valid-url": "^1.0.9", - "xstate": "^3.1.0" - }, - "dependencies": { - "anymatch": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", - "requires": { - "micromatch": "^2.1.5", - "normalize-path": "^2.0.0" - } - }, - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "requires": { - "arr-flatten": "^1.0.1" - } - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" - }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" - } - }, - "chokidar": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", - "requires": { - "anymatch": "^1.3.0", - "async-each": "^1.0.0", - "fsevents": "^1.0.0", - "glob-parent": "^2.0.0", - "inherits": "^2.0.1", - "is-binary-path": "^1.0.0", - "is-glob": "^2.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.0.0" - } - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "requires": { - "is-posix-bracket": "^0.1.0" - } - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "requires": { - "is-extglob": "^1.0.0" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "requires": { - "is-glob": "^2.0.0" - } - }, - "got": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", - "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", - "requires": { - "decompress-response": "^3.2.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "is-plain-obj": "^1.1.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", - "isurl": "^1.0.0-alpha5", - "lowercase-keys": "^1.0.0", - "p-cancelable": "^0.3.0", - "p-timeout": "^1.1.1", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "url-parse-lax": "^1.0.0", - "url-to-options": "^1.0.1" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "requires": { - "is-extglob": "^1.0.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" - } - } - } - }, "gatsby-transformer-remark": { "version": "2.1.1-rc.5", "resolved": "https://registry.npmjs.org/gatsby-transformer-remark/-/gatsby-transformer-remark-2.1.1-rc.5.tgz", diff --git a/client/package.json b/client/package.json index 8c93fb2b5d..dce74f516f 100644 --- a/client/package.json +++ b/client/package.json @@ -14,6 +14,7 @@ "@fortawesome/free-solid-svg-icons": "^5.2.0", "@fortawesome/react-fontawesome": "0.0.20", "@freecodecamp/curriculum": "^3.2.1", + "@freecodecamp/gatsby-source-filesystem": "^2.0.1-beta.3", "@freecodecamp/react-bootstrap": "^0.32.3", "@reach/router": "^1.1.1", "axios": "^0.18.0", @@ -29,7 +30,6 @@ "gatsby-plugin-react-helmet": "^3.0.0-rc.1", "gatsby-plugin-sitemap": "^2.0.0-rc.1", "gatsby-remark-prismjs": "^3.0.0-rc.2", - "gatsby-source-filesystem": "^2.0.1-rc.6", "gatsby-transformer-remark": "^2.1.1-rc.5", "lodash": "^4.17.10", "loop-protect": "^2.1.6", @@ -67,7 +67,7 @@ "license": "MIT", "scripts": { "prebuild": "npm run build:frame-runner && node ../tools/scripts/ensure-env.js", - "build": "gatsby build", + "build": "node --max_old_space_size=7168 node_modules/gatsby-cli build", "build:frame-runner": "webpack --env.production --config ./webpack-frame-runner.js", "predevelop": "npm run prebuild", "develop": "gatsby develop", diff --git a/client/plugins/fcc-source-challenges/gatsby-node.js b/client/plugins/fcc-source-challenges/gatsby-node.js index 12fd4f044a..dc6e709180 100644 --- a/client/plugins/fcc-source-challenges/gatsby-node.js +++ b/client/plugins/fcc-source-challenges/gatsby-node.js @@ -19,7 +19,7 @@ that delivers challenge files to the plugin .map(node => createNode(node)) ) .catch(e => - reporter.panic(`fcc-sourec-challenges + reporter.panic(`fcc-source-challenges ${e.message} diff --git a/client/utils/buildChallenges.js b/client/utils/buildChallenges.js index 5264ed06e2..04f240eaee 100644 --- a/client/utils/buildChallenges.js +++ b/client/utils/buildChallenges.js @@ -1,6 +1,4 @@ const { getChallengesForLang } = require('@freecodecamp/curriculum'); -const { from, of } = require('rxjs'); -const { map } = require('rxjs/operators'); const _ = require('lodash'); const utils = require('../utils'); diff --git a/netlify.toml b/netlify.toml index 6aef6e4df6..beb3157832 100644 --- a/netlify.toml +++ b/netlify.toml @@ -7,6 +7,6 @@ # This is the directory that you are publishing from (relative to root of your repo) publish = "client/public/" # This will be your default build command - command = "npm run bootstrap && cd ./client && npm run build" + command = "npm run bootstrap && cd ./client && npm i && npm run build" # This is where we will look for your lambda functions #functions = "project/functions/" \ No newline at end of file