Skip to content

Commit

Permalink
Extract out image processing to util package gatsby-sharp
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Dec 28, 2016
1 parent 9f20185 commit 1f41853
Show file tree
Hide file tree
Showing 13 changed files with 2,437 additions and 62 deletions.
5 changes: 0 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ proved unpleasant as you had to build locally and commit the outputted
records.json which was confusing and annoying.
[PR](https://github.com/gatsbyjs/gatsby/pull/559)

### Changed
- Removed the package `sharp` as it's not used and is preventing Gatsby
1.0 from being installed on Windows.
[commit](https://github.com/gatsbyjs/gatsby/commit/34fff74e6fb3cae88010b42f74d784382ead4031)

## [1.0.0-alpha9] - 2016-11-04
### Added
- Put the routes module on `window` to support experimental idea. See
Expand Down
11 changes: 11 additions & 0 deletions packages/gatsby-parser-remark/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": [
["env", {
"targets": {
"node": 4.0
},
"debug": true,
}]
],
"plugins": ["transform-object-rest-spread"],
}
27 changes: 14 additions & 13 deletions packages/gatsby-parser-remark/package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
{
"name": "gatsby-parser-remark",
"version": "0.0.0",
"description": "Gatsby parser plugin for Remark",
"scripts": {
"build": "babel src --presets babel-preset-es2015 --out-dir .",
"watch": "babel -w src --presets babel-preset-es2015 --out-dir ."
},
"keywords": [
"gatsby",
"gatsby-plugin",
"remark",
"markdown"
],
"version": "0.0.0",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"license": "MIT",
"dependencies": {
"bluebird": "^3.4.6",
"gray-matter": "^2.1.0",
"unist-util-select": "^1.5.0"
},
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-preset-es2015": "^6.18.0"
"babel-plugin-transform-object-rest-spread": "^6.20.2",
"babel-preset-env": "^1.1.4"
},
"keywords": [
"gatsby",
"gatsby-plugin",
"markdown",
"remark"
],
"license": "MIT",
"scripts": {
"build": "babel src --out-dir .",
"watch": "babel -w src --out-dir ."
}
}
141 changes: 110 additions & 31 deletions packages/gatsby-parser-remark/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ babel-generator@^6.21.0:
lodash "^4.2.0"
source-map "^0.5.0"

babel-helper-builder-binary-assignment-operator-visitor@^6.8.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.18.0.tgz#8ae814989f7a53682152e3401a04fabd0bb333a6"
dependencies:
babel-helper-explode-assignable-expression "^6.18.0"
babel-runtime "^6.0.0"
babel-types "^6.18.0"

babel-helper-call-delegate@^6.18.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.18.0.tgz#05b14aafa430884b034097ef29e9f067ea4133bd"
Expand All @@ -177,6 +185,14 @@ babel-helper-define-map@^6.18.0, babel-helper-define-map@^6.8.0:
babel-types "^6.18.0"
lodash "^4.2.0"

babel-helper-explode-assignable-expression@^6.18.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.18.0.tgz#14b8e8c2d03ad735d4b20f1840b24cd1f65239fe"
dependencies:
babel-runtime "^6.0.0"
babel-traverse "^6.18.0"
babel-types "^6.18.0"

babel-helper-function-name@^6.18.0, babel-helper-function-name@^6.8.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.18.0.tgz#68ec71aeba1f3e28b2a6f0730190b754a9bf30e6"
Expand Down Expand Up @@ -216,6 +232,16 @@ babel-helper-regex@^6.8.0:
babel-types "^6.18.0"
lodash "^4.2.0"

babel-helper-remap-async-to-generator@^6.16.0:
version "6.20.3"
resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.20.3.tgz#9dd3b396f13e35ef63e538098500adc24c63c4e7"
dependencies:
babel-helper-function-name "^6.18.0"
babel-runtime "^6.20.0"
babel-template "^6.16.0"
babel-traverse "^6.20.0"
babel-types "^6.20.0"

babel-helper-replace-supers@^6.18.0, babel-helper-replace-supers@^6.8.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.18.0.tgz#28ec69877be4144dbd64f4cc3a337e89f29a924e"
Expand Down Expand Up @@ -246,6 +272,30 @@ babel-plugin-check-es2015-constants@^6.3.13:
dependencies:
babel-runtime "^6.0.0"

babel-plugin-syntax-async-functions@^6.8.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95"

babel-plugin-syntax-exponentiation-operator@^6.8.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de"

babel-plugin-syntax-object-rest-spread@^6.8.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5"

babel-plugin-syntax-trailing-function-commas@^6.13.0:
version "6.20.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.20.0.tgz#442835e19179f45b87e92d477d70b9f1f18b5c4f"

babel-plugin-transform-async-to-generator@^6.8.0:
version "6.16.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.16.0.tgz#19ec36cb1486b59f9f468adfa42ce13908ca2999"
dependencies:
babel-helper-remap-async-to-generator "^6.16.0"
babel-plugin-syntax-async-functions "^6.8.0"
babel-runtime "^6.0.0"

babel-plugin-transform-es2015-arrow-functions@^6.3.13:
version "6.8.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.8.0.tgz#5b63afc3181bdc9a8c4d481b5a4f3f7d7fef3d9d"
Expand All @@ -258,7 +308,7 @@ babel-plugin-transform-es2015-block-scoped-functions@^6.3.13:
dependencies:
babel-runtime "^6.0.0"

babel-plugin-transform-es2015-block-scoping@^6.18.0:
babel-plugin-transform-es2015-block-scoping@^6.6.0:
version "6.21.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.21.0.tgz#e840687f922e70fb2c42bb13501838c174a115ed"
dependencies:
Expand All @@ -268,7 +318,7 @@ babel-plugin-transform-es2015-block-scoping@^6.18.0:
babel-types "^6.21.0"
lodash "^4.2.0"

babel-plugin-transform-es2015-classes@^6.18.0:
babel-plugin-transform-es2015-classes@^6.6.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.18.0.tgz#ffe7a17321bf83e494dcda0ae3fc72df48ffd1d9"
dependencies:
Expand All @@ -290,7 +340,7 @@ babel-plugin-transform-es2015-computed-properties@^6.3.13:
babel-runtime "^6.0.0"
babel-template "^6.8.0"

babel-plugin-transform-es2015-destructuring@^6.18.0:
babel-plugin-transform-es2015-destructuring@^6.6.0:
version "6.19.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.19.0.tgz#ff1d911c4b3f4cab621bd66702a869acd1900533"
dependencies:
Expand All @@ -303,13 +353,13 @@ babel-plugin-transform-es2015-duplicate-keys@^6.6.0:
babel-runtime "^6.0.0"
babel-types "^6.8.0"

babel-plugin-transform-es2015-for-of@^6.18.0:
babel-plugin-transform-es2015-for-of@^6.6.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.18.0.tgz#4c517504db64bf8cfc119a6b8f177211f2028a70"
dependencies:
babel-runtime "^6.0.0"

babel-plugin-transform-es2015-function-name@^6.9.0:
babel-plugin-transform-es2015-function-name@^6.3.13:
version "6.9.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.9.0.tgz#8c135b17dbd064e5bba56ec511baaee2fca82719"
dependencies:
Expand All @@ -323,15 +373,15 @@ babel-plugin-transform-es2015-literals@^6.3.13:
dependencies:
babel-runtime "^6.0.0"

babel-plugin-transform-es2015-modules-amd@^6.18.0:
babel-plugin-transform-es2015-modules-amd@^6.18.0, babel-plugin-transform-es2015-modules-amd@^6.8.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.18.0.tgz#49a054cbb762bdf9ae2d8a807076cfade6141e40"
dependencies:
babel-plugin-transform-es2015-modules-commonjs "^6.18.0"
babel-runtime "^6.0.0"
babel-template "^6.8.0"

babel-plugin-transform-es2015-modules-commonjs@^6.18.0:
babel-plugin-transform-es2015-modules-commonjs@^6.18.0, babel-plugin-transform-es2015-modules-commonjs@^6.6.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.18.0.tgz#c15ae5bb11b32a0abdcc98a5837baa4ee8d67bcc"
dependencies:
Expand All @@ -340,15 +390,15 @@ babel-plugin-transform-es2015-modules-commonjs@^6.18.0:
babel-template "^6.16.0"
babel-types "^6.18.0"

babel-plugin-transform-es2015-modules-systemjs@^6.18.0:
babel-plugin-transform-es2015-modules-systemjs@^6.12.0:
version "6.19.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.19.0.tgz#50438136eba74527efa00a5b0fefaf1dc4071da6"
dependencies:
babel-helper-hoist-variables "^6.18.0"
babel-runtime "^6.11.6"
babel-template "^6.14.0"

babel-plugin-transform-es2015-modules-umd@^6.18.0:
babel-plugin-transform-es2015-modules-umd@^6.12.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.18.0.tgz#23351770ece5c1f8e83ed67cb1d7992884491e50"
dependencies:
Expand All @@ -363,7 +413,7 @@ babel-plugin-transform-es2015-object-super@^6.3.13:
babel-helper-replace-supers "^6.8.0"
babel-runtime "^6.0.0"

babel-plugin-transform-es2015-parameters@^6.18.0:
babel-plugin-transform-es2015-parameters@^6.6.0:
version "6.21.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.21.0.tgz#46a655e6864ef984091448cdf024d87b60b2a7d8"
dependencies:
Expand All @@ -374,7 +424,7 @@ babel-plugin-transform-es2015-parameters@^6.18.0:
babel-traverse "^6.21.0"
babel-types "^6.21.0"

babel-plugin-transform-es2015-shorthand-properties@^6.18.0:
babel-plugin-transform-es2015-shorthand-properties@^6.3.13:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.18.0.tgz#e2ede3b7df47bf980151926534d1dd0cbea58f43"
dependencies:
Expand All @@ -401,7 +451,7 @@ babel-plugin-transform-es2015-template-literals@^6.6.0:
dependencies:
babel-runtime "^6.0.0"

babel-plugin-transform-es2015-typeof-symbol@^6.18.0:
babel-plugin-transform-es2015-typeof-symbol@^6.6.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.18.0.tgz#0b14c48629c90ff47a0650077f6aa699bee35798"
dependencies:
Expand All @@ -415,7 +465,22 @@ babel-plugin-transform-es2015-unicode-regex@^6.3.13:
babel-runtime "^6.0.0"
regexpu-core "^2.0.0"

babel-plugin-transform-regenerator@^6.16.0:
babel-plugin-transform-exponentiation-operator@^6.8.0:
version "6.8.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.8.0.tgz#db25742e9339eade676ca9acec46f955599a68a4"
dependencies:
babel-helper-builder-binary-assignment-operator-visitor "^6.8.0"
babel-plugin-syntax-exponentiation-operator "^6.8.0"
babel-runtime "^6.0.0"

babel-plugin-transform-object-rest-spread@^6.20.2:
version "6.20.2"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.20.2.tgz#e816c55bba77b14c16365d87e2ae48c8fd18fc2e"
dependencies:
babel-plugin-syntax-object-rest-spread "^6.8.0"
babel-runtime "^6.20.0"

babel-plugin-transform-regenerator@^6.6.0:
version "6.21.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.21.0.tgz#75d0c7e7f84f379358f508451c68a2c5fa5a9703"
dependencies:
Expand All @@ -436,34 +501,38 @@ babel-polyfill@^6.16.0:
core-js "^2.4.0"
regenerator-runtime "^0.10.0"

babel-preset-es2015@^6.18.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.18.0.tgz#b8c70df84ec948c43dcf2bf770e988eb7da88312"
babel-preset-env@^1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.1.4.tgz#d876f9fcff5fe0612db3dcbc0c87503b41d4873f"
dependencies:
babel-plugin-check-es2015-constants "^6.3.13"
babel-plugin-syntax-trailing-function-commas "^6.13.0"
babel-plugin-transform-async-to-generator "^6.8.0"
babel-plugin-transform-es2015-arrow-functions "^6.3.13"
babel-plugin-transform-es2015-block-scoped-functions "^6.3.13"
babel-plugin-transform-es2015-block-scoping "^6.18.0"
babel-plugin-transform-es2015-classes "^6.18.0"
babel-plugin-transform-es2015-block-scoping "^6.6.0"
babel-plugin-transform-es2015-classes "^6.6.0"
babel-plugin-transform-es2015-computed-properties "^6.3.13"
babel-plugin-transform-es2015-destructuring "^6.18.0"
babel-plugin-transform-es2015-destructuring "^6.6.0"
babel-plugin-transform-es2015-duplicate-keys "^6.6.0"
babel-plugin-transform-es2015-for-of "^6.18.0"
babel-plugin-transform-es2015-function-name "^6.9.0"
babel-plugin-transform-es2015-for-of "^6.6.0"
babel-plugin-transform-es2015-function-name "^6.3.13"
babel-plugin-transform-es2015-literals "^6.3.13"
babel-plugin-transform-es2015-modules-amd "^6.18.0"
babel-plugin-transform-es2015-modules-commonjs "^6.18.0"
babel-plugin-transform-es2015-modules-systemjs "^6.18.0"
babel-plugin-transform-es2015-modules-umd "^6.18.0"
babel-plugin-transform-es2015-modules-amd "^6.8.0"
babel-plugin-transform-es2015-modules-commonjs "^6.6.0"
babel-plugin-transform-es2015-modules-systemjs "^6.12.0"
babel-plugin-transform-es2015-modules-umd "^6.12.0"
babel-plugin-transform-es2015-object-super "^6.3.13"
babel-plugin-transform-es2015-parameters "^6.18.0"
babel-plugin-transform-es2015-shorthand-properties "^6.18.0"
babel-plugin-transform-es2015-parameters "^6.6.0"
babel-plugin-transform-es2015-shorthand-properties "^6.3.13"
babel-plugin-transform-es2015-spread "^6.3.13"
babel-plugin-transform-es2015-sticky-regex "^6.3.13"
babel-plugin-transform-es2015-template-literals "^6.6.0"
babel-plugin-transform-es2015-typeof-symbol "^6.18.0"
babel-plugin-transform-es2015-typeof-symbol "^6.6.0"
babel-plugin-transform-es2015-unicode-regex "^6.3.13"
babel-plugin-transform-regenerator "^6.16.0"
babel-plugin-transform-exponentiation-operator "^6.8.0"
babel-plugin-transform-regenerator "^6.6.0"
browserslist "^1.4.0"

babel-register@^6.18.0:
version "6.18.0"
Expand Down Expand Up @@ -494,7 +563,7 @@ babel-template@^6.14.0, babel-template@^6.15.0, babel-template@^6.16.0, babel-te
babylon "^6.11.0"
lodash "^4.2.0"

babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.21.0:
babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.20.0, babel-traverse@^6.21.0:
version "6.21.0"
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.21.0.tgz#69c6365804f1a4f69eb1213f85b00a818b8c21ad"
dependencies:
Expand All @@ -508,7 +577,7 @@ babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.21.0:
invariant "^2.2.0"
lodash "^4.2.0"

babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.21.0, babel-types@^6.8.0, babel-types@^6.9.0:
babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.20.0, babel-types@^6.21.0, babel-types@^6.8.0, babel-types@^6.9.0:
version "6.21.0"
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.21.0.tgz#314b92168891ef6d3806b7f7a917fdf87c11a4b2"
dependencies:
Expand Down Expand Up @@ -570,10 +639,20 @@ braces@^1.8.2:
preserve "^0.2.0"
repeat-element "^1.1.2"

browserslist@^1.4.0:
version "1.5.1"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.5.1.tgz#67c3f2a1a6ad174cd01d25d2362e6e6083b26986"
dependencies:
caniuse-db "^1.0.30000601"

buffer-shims@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51"

caniuse-db@^1.0.30000601:
version "1.0.30000602"
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000602.tgz#06b2cbfb6c3aeef7ddb18cd588043549ad1a2d4e"

caseless@~0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7"
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-parser-sharp/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports.modifyAST = ({ args }) => (
File[extension="tif"],
File[extension="tiff"],
File[extension="gif"],
File[extension="svg"],
File[extension="svg"]
`)
files.forEach((file) => {
const imageNode = {
Expand Down
10 changes: 10 additions & 0 deletions packages/gatsby-sharp/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
["env", {
"targets": {
"node": 4.0
},
}]
],
"plugins": ["transform-object-rest-spread"],
}
Loading

0 comments on commit 1f41853

Please sign in to comment.