├── site ├── .cache │ ├── redirects.json │ ├── match-paths.json │ ├── react-lifecycles-compat.js │ ├── __tests__ │ │ ├── .babelrc │ │ ├── strip-prefix.js │ │ ├── minimal-config.js │ │ ├── error-overlay-handler.js │ │ └── find-page.js │ ├── commonjs │ │ ├── react-lifecycles-compat.js │ │ ├── create-react-context.js │ │ ├── emitter.js │ │ ├── strip-prefix.js │ │ ├── public-page-renderer.js │ │ ├── api-runner-browser-plugins.js │ │ ├── public-page-renderer-dev.js │ │ ├── public-page-renderer-prod.js │ │ ├── api-runner-ssr.js │ │ ├── error-overlay-handler.js │ │ ├── default-html.js │ │ ├── page-renderer.js │ │ ├── find-page.js │ │ ├── api-runner-browser.js │ │ ├── prefetch.js │ │ ├── app.js │ │ ├── register-service-worker.js │ │ ├── gatsby-browser-entry.js │ │ └── json-store.js │ ├── create-react-context.js │ ├── emitter.js │ ├── redux.state │ ├── caches │ │ └── gatsby-mdx │ │ │ └── mdx-scopes-dir │ │ │ └── 1970366a8c100bb8e42caab4bfa24659.js │ ├── .eslintrc.json │ ├── strip-prefix.js │ ├── public-page-renderer.js │ ├── api-runner-browser-plugins.js │ ├── public-page-renderer-dev.js │ ├── public-page-renderer-prod.js │ ├── test-require-error.js │ ├── error-overlay-handler.js │ ├── default-html.js │ ├── page-renderer.js │ ├── sync-requires.js │ ├── find-page.js │ ├── api-runner-browser.js │ ├── prefetch.js │ ├── async-requires.js │ ├── pages.json │ ├── app.js │ ├── api-runner-ssr.js │ ├── data.json │ ├── gatsby-browser-entry.js │ ├── register-service-worker.js │ ├── json-store.js │ ├── root.js │ └── socketIo.js ├── public │ ├── static │ │ └── d │ │ │ ├── 51 │ │ │ └── path---blog-post-5-ebc-968-wZ7vlPNzPF86uJKDhZAVCufUMCw.json │ │ │ ├── 73 │ │ │ └── path---blog-index-201-2c5-6xrNRK5rBfqAwq3hMe4DwBluAaU.json │ │ │ ├── 140 │ │ │ └── path---index-6a9-0SUcWyAf8ecbYDsMhQkEfPzV8.json │ │ │ ├── 246 │ │ │ └── path---checkout-success-57-c-858-0SUcWyAf8ecbYDsMhQkEfPzV8.json │ │ │ ├── 293 │ │ │ └── path---blog-post-6-6-dc-86f-m0xl1g5KuUWAsQazaROBdvdB0No.json │ │ │ ├── 313 │ │ │ └── path---blog-post-2-803-bf5-oxae3s4XpLTg41lu5UtFD8Q6WU.json │ │ │ ├── 315 │ │ │ └── path---checkout-canceled-6-c-7-1d6-0SUcWyAf8ecbYDsMhQkEfPzV8.json │ │ │ ├── 336 │ │ │ └── path---blog-post-4-0-fa-b7f-DwwlUSCeX03yIQfCUOtjsx60.json │ │ │ ├── 870 │ │ │ └── path---blog-post-1-a-99-95a-s7uSyAfaaIjIFs6jbkFodyeNvW8.json │ │ │ ├── 893 │ │ │ └── path---dev-404-page-5-f-9-fab-h5NiDujvwl0d6zFRvrZ9jUfSzc0.json │ │ │ ├── 902 │ │ │ └── path---blog-post-3-8-d-2-2d7-Uc6BiNjrHBYaJGWpPsAHh4QZ7c4.json │ │ │ ├── 2649804226.json │ │ │ └── 305859193.json │ └── index.html ├── .prettierrc.js ├── blog │ ├── post1.mdx │ ├── post4.mdx │ ├── post5.mdx │ ├── post6.mdx │ ├── post2.mdx │ └── post3.mdx ├── tsconfig.json ├── gatsby-config.js ├── package.json └── .eslintrc.js ├── .gitignore ├── packages ├── gatsby-theme-west-egg │ ├── index.js │ ├── .gitignore │ ├── src │ │ ├── @types │ │ │ └── gatsby-theme-west-egg │ │ │ │ └── index.d.ts │ │ ├── pages │ │ │ ├── checkout │ │ │ │ ├── canceled.tsx │ │ │ │ └── success.tsx │ │ │ ├── blogIndex.tsx │ │ │ └── index.tsx │ │ └── components │ │ │ └── posts-page-layout.tsx │ ├── .prettierrc.js │ ├── tsconfig.json │ ├── README.md │ ├── gatsby-config.js │ ├── gatsby-node.js │ ├── package.json │ └── .eslintrc.js ├── gatsby-theme-west-egg-blog │ ├── index.js │ ├── src │ │ ├── pages │ │ │ └── index.mdx │ │ └── components │ │ │ └── posts-page-layout.js │ ├── gatsby-config.js │ └── package.json ├── gatsby-theme-west-egg-core │ ├── .gitignore │ ├── index.js │ ├── .prettierrc.js │ ├── src │ │ ├── @types │ │ │ └── gatsby-theme-west-egg-core │ │ │ │ └── index.d.ts │ │ ├── utils │ │ │ └── Utilities.ts │ │ └── components │ │ │ └── SEO.tsx │ ├── gatsby-node.js │ ├── tsconfig.json │ ├── gatsby-config.js │ ├── package.json │ └── .eslintrc.js ├── gatsby-theme-west-egg-stripe-cart │ ├── .gitignore │ ├── index.js │ ├── .prettierrc.js │ ├── src │ │ ├── pages │ │ │ └── checkout │ │ │ │ ├── success.tsx │ │ │ │ └── canceled.tsx │ │ ├── utils │ │ │ ├── hooks.ts │ │ │ └── MetadataProvider.tsx │ │ ├── @types │ │ │ └── gatsby-theme-west-egg-stripe-cart │ │ │ │ └── index.d.ts │ │ └── components │ │ │ └── StripeCheckout.tsx │ ├── tsconfig.json │ ├── gatsby-config.js │ ├── README.md │ ├── package.json │ └── .eslintrc.js ├── gatsby-theme-west-egg-style │ ├── .gitignore │ ├── public │ │ ├── chunk-map.json │ │ ├── pages-manifest-0d02b77c37c76bc79313.js.map │ │ ├── pages-manifest-0d02b77c37c76bc79313.js │ │ ├── webpack.stats.json │ │ └── webpack-runtime-4112d92f6d890538b818.js │ ├── global.d.ts │ ├── readmeImages │ │ └── west-egg-style-example.PNG │ ├── src │ │ ├── utils │ │ │ ├── colors.ts │ │ │ └── hooks.ts │ │ └── components │ │ │ ├── Hero.tsx │ │ │ ├── Footer.tsx │ │ │ ├── Content.tsx │ │ │ ├── Grid.tsx │ │ │ ├── Header.tsx │ │ │ ├── Text.tsx │ │ │ ├── Container.tsx │ │ │ └── Box.tsx │ ├── dist │ │ ├── utils │ │ │ ├── colors.d.ts │ │ │ ├── hooks.d.ts │ │ │ ├── colors.js.map │ │ │ ├── colors.js │ │ │ ├── hooks.js.map │ │ │ └── hooks.js │ │ └── components │ │ │ ├── Title.d.ts │ │ │ ├── Title.js.map │ │ │ ├── Box.d.ts │ │ │ ├── Box.js.map │ │ │ ├── Button.d.ts │ │ │ ├── Title.js │ │ │ ├── Button.js.map │ │ │ └── Box.js │ ├── .prettierrc.js │ ├── index.js │ ├── gatsby-browser.js │ ├── tsconfig.json │ ├── gastby-config.js │ ├── README.md │ ├── package.json │ └── .eslintrc.js └── gatsby-theme-west-egg-sanity │ ├── sanity-studio │ ├── plugins │ │ └── .gitkeep │ ├── config │ │ ├── @sanity │ │ │ └── data-aspects.json │ │ └── .checksums │ ├── static │ │ ├── .gitkeep │ │ └── favicon.ico │ ├── schemas │ │ ├── category.js │ │ ├── author.js │ │ ├── schema.js │ │ ├── post.js │ │ └── blockContent.js │ ├── sanity.json │ ├── README.md │ └── package.json │ └── package.json ├── package.json └── README.md /site/.cache/redirects.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /site/.cache/match-paths.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .env.* -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg/index.js: -------------------------------------------------------------------------------- 1 | // no-op -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-blog/index.js: -------------------------------------------------------------------------------- 1 | // no-op -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-core/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .env.* -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-stripe-cart/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .env.* 3 | dist -------------------------------------------------------------------------------- /site/.cache/react-lifecycles-compat.js: -------------------------------------------------------------------------------- 1 | exports.polyfill = Component => Component 2 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-core/index.js: -------------------------------------------------------------------------------- 1 | export {default as SEO} from './src/components/SEO'; -------------------------------------------------------------------------------- /site/.cache/__tests__/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["babel-preset-gatsby"] 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | readmeImages/ 4 | .cache/ 5 | public -------------------------------------------------------------------------------- /site/.cache/commonjs/react-lifecycles-compat.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | exports.polyfill = Component => Component; -------------------------------------------------------------------------------- /site/.cache/create-react-context.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | 3 | export default React.createContext 4 | -------------------------------------------------------------------------------- /site/.cache/emitter.js: -------------------------------------------------------------------------------- 1 | import mitt from "mitt" 2 | 3 | const emitter = mitt() 4 | export default emitter 5 | -------------------------------------------------------------------------------- /site/.cache/redux.state: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/molebox/gatsby-theme-west-egg/HEAD/site/.cache/redux.state -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-sanity/sanity-studio/plugins/.gitkeep: -------------------------------------------------------------------------------- 1 | User-specific packages can be placed here 2 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-sanity/sanity-studio/config/@sanity/data-aspects.json: -------------------------------------------------------------------------------- 1 | { 2 | "listOptions": {} 3 | } 4 | -------------------------------------------------------------------------------- /site/public/static/d/140/path---index-6a9-0SUcWyAf8ecbYDsMhQkEfPzV8.json: -------------------------------------------------------------------------------- 1 | {"pageContext":{"isCreatedByStatefulCreatePages":true}} -------------------------------------------------------------------------------- /site/public/static/d/246/path---checkout-success-57-c-858-0SUcWyAf8ecbYDsMhQkEfPzV8.json: -------------------------------------------------------------------------------- 1 | {"pageContext":{"isCreatedByStatefulCreatePages":true}} -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-blog/src/pages/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Default Post in theme 3 | --- 4 | 5 | # The default post in the theme 6 | -------------------------------------------------------------------------------- /site/.cache/caches/gatsby-mdx/mdx-scopes-dir/1970366a8c100bb8e42caab4bfa24659.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | export default { 3 | React 4 | }; -------------------------------------------------------------------------------- /site/public/static/d/315/path---checkout-canceled-6-c-7-1d6-0SUcWyAf8ecbYDsMhQkEfPzV8.json: -------------------------------------------------------------------------------- 1 | {"pageContext":{"isCreatedByStatefulCreatePages":true}} -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-sanity/sanity-studio/static/.gitkeep: -------------------------------------------------------------------------------- 1 | Files placed here will be served by the Sanity server under the `/static`-prefix 2 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/public/chunk-map.json: -------------------------------------------------------------------------------- 1 | {"app":["/app-95ae1fab5f2ef03e4c7f.js"],"pages-manifest":["/pages-manifest-0d02b77c37c76bc79313.js"]} -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/global.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*module.css' { 2 | const content: {[className: string]: string}; 3 | export = content; 4 | } -------------------------------------------------------------------------------- /site/public/static/d/2649804226.json: -------------------------------------------------------------------------------- 1 | {"data":{"site":{"siteMetadata":{"STRIPE_API_KEY":"pk_test_sCZdKKv3RLpcLwCLybjQVKQE004MOo7pXE","siteUrl":"http://localhost:8000"}}}} -------------------------------------------------------------------------------- /site/.cache/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true 4 | }, 5 | "globals": { 6 | "__PATH_PREFIX__": false, 7 | "___emitter": false 8 | } 9 | } -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-sanity/sanity-studio/config/.checksums: -------------------------------------------------------------------------------- 1 | { 2 | "#": "Used by Sanity to keep track of configuration file checksums, do not delete or modify!" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-stripe-cart/index.js: -------------------------------------------------------------------------------- 1 | // exported components that can be edited by the consuming site 2 | export {default as StripeCheckout} from './src/components/StripeCheckout'; -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-blog/src/components/posts-page-layout.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default ({children}) => ( 4 |
5 | {children} 6 |
7 | ) -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/public/pages-manifest-0d02b77c37c76bc79313.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"pages-manifest-0d02b77c37c76bc79313.js","sourceRoot":""} -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-sanity/sanity-studio/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/molebox/gatsby-theme-west-egg/HEAD/packages/gatsby-theme-west-egg-sanity/sanity-studio/static/favicon.ico -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/readmeImages/west-egg-style-example.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/molebox/gatsby-theme-west-egg/HEAD/packages/gatsby-theme-west-egg-style/readmeImages/west-egg-style-example.PNG -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-sanity/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gatsby-theme-west-egg-sanity", 3 | "version": "0.0.1", 4 | "description": "A sanity theme", 5 | "main": "index.js", 6 | "license": "MIT" 7 | } 8 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg/src/@types/gatsby-theme-west-egg/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.mdx' { 2 | let MDXComponent: (props: any) => JSX.Element; 3 | export default MDXComponent; 4 | } 5 | 6 | declare module 'gatsby-mdx/mdx-renderer'; -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/public/pages-manifest-0d02b77c37c76bc79313.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[1],{140:function(p){p.exports={pages:[],dataPaths:{}}}}]); 2 | //# sourceMappingURL=pages-manifest-0d02b77c37c76bc79313.js.map -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/src/utils/colors.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * The base brand colors, can be imported and changed 3 | */ 4 | export default { 5 | primary: '#173F5F', 6 | secondary: '#2acdc1', 7 | light: '#D7F3FF', 8 | accent: '#E19F20', 9 | }; 10 | -------------------------------------------------------------------------------- /site/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "printWidth":120, 3 | "tabWidth":2, 4 | "useTabs":true, 5 | "semi":true, 6 | "singleQuote":true, 7 | "trailingComma":"es5", 8 | "bracketSpacing":true, 9 | "jsxBracketSameLine":false, 10 | "arrowParens":"always" 11 | } -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/dist/utils/colors.d.ts: -------------------------------------------------------------------------------- 1 | declare const _default: { 2 | primary: string; 3 | secondary: string; 4 | light: string; 5 | accent: string; 6 | }; 7 | /** 8 | * The base brand colors, can be imported and changed 9 | */ 10 | export default _default; 11 | -------------------------------------------------------------------------------- /site/.cache/strip-prefix.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Remove a prefix from a string. Return the input string if the given prefix 3 | * isn't found. 4 | */ 5 | 6 | export default (str, prefix = ``) => { 7 | if (str.substr(0, prefix.length) === prefix) return str.slice(prefix.length) 8 | return str 9 | } 10 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg/src/pages/checkout/canceled.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | export default () => ( 4 |
11 |

Purchase Canceled!

12 |
13 | ); 14 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "printWidth":120, 3 | "tabWidth":2, 4 | "useTabs":true, 5 | "semi":true, 6 | "singleQuote":true, 7 | "trailingComma":"es5", 8 | "bracketSpacing":true, 9 | "jsxBracketSameLine":false, 10 | "arrowParens":"always" 11 | } -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-core/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "printWidth":120, 3 | "tabWidth":2, 4 | "useTabs":true, 5 | "semi":true, 6 | "singleQuote":true, 7 | "trailingComma":"es5", 8 | "bracketSpacing":true, 9 | "jsxBracketSameLine":false, 10 | "arrowParens":"always" 11 | } -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "printWidth":120, 3 | "tabWidth":2, 4 | "useTabs":true, 5 | "semi":true, 6 | "singleQuote":true, 7 | "trailingComma":"es5", 8 | "bracketSpacing":true, 9 | "jsxBracketSameLine":false, 10 | "arrowParens":"always" 11 | } -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/dist/utils/hooks.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Hook to provide media query to css elements. 3 | * Pass in the breakpoint and get back the media query 4 | * @param breakpoint A breakpoint represented as a string value 5 | */ 6 | export declare function useBreakPoint(breakpoint: string): string | undefined; 7 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg/src/pages/checkout/success.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | export default () => ( 4 |
11 |

Success from the master theme!!

12 |
13 | ); 14 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gatsby-theme-west-egg-medley", 3 | "version": "0.0.1", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "private": true, 7 | "keywords": [ 8 | "gatsby", 9 | "gatsby-theme", 10 | "react" 11 | ], 12 | "workspaces": [ 13 | "site", 14 | "packages/*" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-stripe-cart/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "printWidth":120, 3 | "tabWidth":2, 4 | "useTabs":true, 5 | "semi":true, 6 | "singleQuote":true, 7 | "trailingComma":"es5", 8 | "bracketSpacing":true, 9 | "jsxBracketSameLine":false, 10 | "arrowParens":"always" 11 | } -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/dist/utils/colors.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/utils/colors.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,oBAAoB;AACpB,sBAAsB;AACtB,kBAAkB;AAClB,mBAAmB;AACnB,IAAI;AAEJ;;GAEG;AACH,eAAe;IACd,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,SAAS;IACpB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;CACjB,CAAC"} -------------------------------------------------------------------------------- /site/.cache/commonjs/create-react-context.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 4 | 5 | exports.__esModule = true; 6 | exports.default = void 0; 7 | 8 | var _react = _interopRequireDefault(require("react")); 9 | 10 | var _default = _react.default.createContext; 11 | exports.default = _default; -------------------------------------------------------------------------------- /site/.cache/commonjs/emitter.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 4 | 5 | exports.__esModule = true; 6 | exports.default = void 0; 7 | 8 | var _mitt = _interopRequireDefault(require("mitt")); 9 | 10 | const emitter = (0, _mitt.default)(); 11 | var _default = emitter; 12 | exports.default = _default; -------------------------------------------------------------------------------- /site/public/static/d/305859193.json: -------------------------------------------------------------------------------- 1 | {"data":{"site":{"siteMetadata":{"title":"Hungry Bear Studio Gatsby West Egg Theme","description":"West egg gatsby theme package. Comes with style theme, stripe cart theme, mdx blog and core themes. You can shadow any component if you want to edit how it works, or you can just import them and put them to use!","author":"Hungry Bear Studio","twitter":"@studio_hungry"}}}} -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-sanity/sanity-studio/schemas/category.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: 'category', 3 | title: 'Category', 4 | type: 'document', 5 | fields: [ 6 | { 7 | name: 'title', 8 | title: 'Title', 9 | type: 'string' 10 | }, 11 | { 12 | name: 'description', 13 | title: 'Description', 14 | type: 'text' 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /site/public/static/d/893/path---dev-404-page-5-f-9-fab-h5NiDujvwl0d6zFRvrZ9jUfSzc0.json: -------------------------------------------------------------------------------- 1 | {"data":{"allSitePage":{"nodes":[{"path":"/blog/post1/"},{"path":"/blog/post3/"},{"path":"/blog/post2/"},{"path":"/blog/post4/"},{"path":"/blog/post6/"},{"path":"/blog/post5/"},{"path":"/"},{"path":"/checkout/canceled/"},{"path":"/checkout/success/"},{"path":"/blogIndex/"}]}},"pageContext":{"isCreatedByStatefulCreatePages":true}} -------------------------------------------------------------------------------- /site/.cache/public-page-renderer.js: -------------------------------------------------------------------------------- 1 | const preferDefault = m => (m && m.default) || m 2 | 3 | if (process.env.BUILD_STAGE === `develop`) { 4 | module.exports = preferDefault(require(`./public-page-renderer-dev`)) 5 | } else if (process.env.BUILD_STAGE === `build-javascript`) { 6 | module.exports = preferDefault(require(`./public-page-renderer-prod`)) 7 | } else { 8 | module.exports = () => null 9 | } 10 | -------------------------------------------------------------------------------- /site/.cache/commonjs/strip-prefix.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | exports.__esModule = true; 4 | exports.default = void 0; 5 | 6 | /** 7 | * Remove a prefix from a string. Return the input string if the given prefix 8 | * isn't found. 9 | */ 10 | var _default = (str, prefix = ``) => { 11 | if (str.substr(0, prefix.length) === prefix) return str.slice(prefix.length); 12 | return str; 13 | }; 14 | 15 | exports.default = _default; -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-stripe-cart/src/pages/checkout/success.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | export default () => ( 4 |
11 |

Success!

12 |
override me as im not pretty...
13 |
to do that you have to shadow me in your site, or theme.
14 |
15 | ); 16 | -------------------------------------------------------------------------------- /site/.cache/commonjs/public-page-renderer.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const preferDefault = m => m && m.default || m; 4 | 5 | if (process.env.BUILD_STAGE === `develop`) { 6 | module.exports = preferDefault(require(`./public-page-renderer-dev`)); 7 | } else if (process.env.BUILD_STAGE === `build-javascript`) { 8 | module.exports = preferDefault(require(`./public-page-renderer-prod`)); 9 | } else { 10 | module.exports = () => null; 11 | } -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-stripe-cart/src/pages/checkout/canceled.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | export default () => ( 4 |
11 |

Purchase Canceled!

12 |
override me as im not pretty...
13 |
to do that you have to shadow me in your site, or theme.
14 |
15 | ); 16 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/dist/utils/colors.js: -------------------------------------------------------------------------------- 1 | // interface Colors { 2 | // primary: string; 3 | // secondary: string; 4 | // light: string; 5 | // accent: string; 6 | // } 7 | /** 8 | * The base brand colors, can be imported and changed 9 | */ 10 | export default { 11 | primary: '#173F5F', 12 | secondary: '#2acdc1', 13 | light: '#D7F3FF', 14 | accent: '#E19F20', 15 | }; 16 | //# sourceMappingURL=colors.js.map -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/src/components/Hero.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { jsx, css } from '@emotion/core'; 3 | 4 | const hero = css` 5 | grid-area: hero; 6 | `; 7 | 8 | interface HeroProps { 9 | children: React.ReactNode; 10 | } 11 | 12 | /** 13 | * A hero component. Part of the containers grid 14 | */ 15 | export default ({children}: HeroProps) => ( 16 |
17 | {children} 18 |
19 | ) 20 | -------------------------------------------------------------------------------- /site/.cache/commonjs/api-runner-browser-plugins.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | // During bootstrap, we write requires at top of this file which looks 4 | // basically like: 5 | // module.exports = [ 6 | // { 7 | // plugin: require("/path/to/plugin1/gatsby-browser.js"), 8 | // options: { ... }, 9 | // }, 10 | // { 11 | // plugin: require("/path/to/plugin2/gatsby-browser.js"), 12 | // options: { ... }, 13 | // }, 14 | // ] 15 | module.exports = []; -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/src/components/Footer.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { jsx, css } from '@emotion/core'; 3 | 4 | const footer = css` 5 | grid-area: footer; 6 | margin: 1rem; 7 | `; 8 | 9 | interface FooterProps { 10 | children: React.ReactNode; 11 | } 12 | 13 | /** 14 | * A footer component. Part of the containers grid 15 | */ 16 | export default ({children}: FooterProps) => ( 17 |
18 | {children} 19 |
20 | ) -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/src/components/Content.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { jsx, css } from '@emotion/core'; 3 | 4 | const content = css` 5 | grid-area: content; 6 | margin: 1rem; 7 | `; 8 | 9 | interface ContentProps { 10 | children: React.ReactNode; 11 | } 12 | 13 | /** 14 | * A content component. Part of the containers grid 15 | */ 16 | export default ({children}: ContentProps) => ( 17 |
18 | {children} 19 |
20 | ) -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-stripe-cart/src/utils/hooks.ts: -------------------------------------------------------------------------------- 1 | import { graphql, useStaticQuery } from 'gatsby'; 2 | 3 | /** 4 | * Hook to provide the site meta data. 5 | * Provides STRIPE_API_KEY and siteUrl 6 | */ 7 | export const useSiteMetadata = () => { 8 | const { site } = useStaticQuery( 9 | graphql` 10 | query { 11 | site { 12 | siteMetadata { 13 | STRIPE_API_KEY 14 | siteUrl 15 | } 16 | } 17 | } 18 | ` 19 | ); 20 | return site.siteMetadata; 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-blog/gatsby-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | { 4 | resolve: 'gatsby-mdx', 5 | options: { 6 | defaultLayouts: { 7 | default: require.resolve('./src/components/posts-page-layout.js') 8 | } 9 | } 10 | }, 11 | { 12 | resolve: 'gatsby-plugin-page-creator', 13 | options: { 14 | path: `${__dirname}/src/pages` 15 | } 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /site/blog/post1.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Post 1 3 | author: Rich Haines 4 | date: "2019-05-28" 5 | --- 6 | # My first post about nothing 7 | 8 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -------------------------------------------------------------------------------- /site/blog/post4.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Post 4 3 | author: Rich Haines 4 | date: "2019-05-28" 5 | --- 6 | # My forth post about nothing! 7 | 8 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -------------------------------------------------------------------------------- /site/blog/post5.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Post 5" 3 | author: "Rich Haines" 4 | date: "2019-05-28" 5 | --- 6 | 7 | # This is post number 5! 8 | 9 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -------------------------------------------------------------------------------- /site/blog/post6.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Post 6" 3 | author: "Rich Haines" 4 | date: "2019-05-28" 5 | --- 6 | 7 | # This is post number 6! 8 | 9 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-sanity/sanity-studio/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "project": { 4 | "name": "gatsby-theme-west-egg-sanity" 5 | }, 6 | "api": { 7 | "projectId": "vffw4e9h", 8 | "dataset": "west-egg-blog" 9 | }, 10 | "plugins": [ 11 | "@sanity/base", 12 | "@sanity/components", 13 | "@sanity/default-layout", 14 | "@sanity/default-login", 15 | "@sanity/desk-tool" 16 | ], 17 | "parts": [ 18 | { 19 | "name": "part:@sanity/base/schema", 20 | "path": "./schemas/schema.js" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/dist/components/Title.d.ts: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | interface TitleProps { 3 | fontSize?: string; 4 | fontWeight?: string; 5 | children: React.ReactNode; 6 | } 7 | declare const _default: ({ fontSize, fontWeight, children }: TitleProps) => JSX.Element; 8 | /** 9 | * A configurable title 10 | * @param fontSize Optional font size - defaults to 3rem 11 | * @param fontWeight Optional font weight (300,400,400i,700) - defaults to 300 12 | * @param children The contents of the title 13 | */ 14 | export default _default; 15 | -------------------------------------------------------------------------------- /site/.cache/api-runner-browser-plugins.js: -------------------------------------------------------------------------------- 1 | module.exports = [{ 2 | plugin: require('D:/HUNGRYBEARSTUDIO/GATSBY-THEMES/gastby-theme-west-egg/packages/gatsby-theme-west-egg-style/gatsby-browser.js'), 3 | options: {"plugins":[]}, 4 | },{ 5 | plugin: require('D:/HUNGRYBEARSTUDIO/GATSBY-THEMES/gastby-theme-west-egg/node_modules/gatsby-mdx/gatsby-browser.js'), 6 | options: {"plugins":[],"defaultLayouts":{"default":"D:\\HUNGRYBEARSTUDIO\\GATSBY-THEMES\\gastby-theme-west-egg\\packages\\gatsby-theme-west-egg-blog\\src\\components\\posts-page-layout.js"}}, 7 | }] 8 | -------------------------------------------------------------------------------- /site/blog/post2.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Post 2" 3 | author: "Rich Haines" 4 | date: "2019-05-28" 5 | --- 6 | 7 | # My second post about nothing 8 | 9 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -------------------------------------------------------------------------------- /site/blog/post3.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Post 3" 3 | author: "Rich Haines" 4 | date: "2019-05-28" 5 | --- 6 | 7 | # My third post about nothing!! 8 | 9 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-core/src/@types/gatsby-theme-west-egg-core/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'gatsby-theme-west-egg-core' { 2 | /** 3 | * An SEO component which places typical site information in the sites head 4 | */ 5 | export const SEO: () => JSX.Element; 6 | 7 | interface Sitemetadata { 8 | title: string; 9 | description: string; 10 | author: string; 11 | twitter: string; 12 | } 13 | /** 14 | * Hook to provide the site meta data. 15 | * Provides title, description and author 16 | */ 17 | export const useSiteMetadata: () => Sitemetadata; 18 | } 19 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/dist/components/Title.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Title.js","sourceRoot":"","sources":["../../src/components/Title.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAQpC;;;;;GAKG;AACH,gBAAe,UAAC,EAA8C;QAA5C,sBAAQ,EAAE,0BAAU,EAAE,sBAAQ;IAAmB,OAAA,CAClE,6BACC,GAAG,EAAE,GAAG,6YAAA,uDAEQ,EAA+B,gDAEjC,EAA4B,4FAIhC,EAAc,yHAKvB,KAXe,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,EAEjC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAIhC,MAAM,CAAC,OAAO,KAOvB,QAAQ,CACJ,CACN;AAnBkE,CAmBlE,EAAC"} -------------------------------------------------------------------------------- /site/.cache/public-page-renderer-dev.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import PropTypes from "prop-types" 3 | 4 | import loader from "./loader" 5 | import JSONStore from "./json-store" 6 | 7 | const DevPageRenderer = ({ location }) => { 8 | const pageResources = loader.getResourcesForPathnameSync(location.pathname) 9 | return React.createElement(JSONStore, { 10 | location, 11 | pageResources, 12 | }) 13 | } 14 | 15 | DevPageRenderer.propTypes = { 16 | location: PropTypes.shape({ 17 | pathname: PropTypes.string.isRequired, 18 | }).isRequired, 19 | } 20 | 21 | export default DevPageRenderer 22 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/public/webpack.stats.json: -------------------------------------------------------------------------------- 1 | {"errors":[],"warnings":[],"namedChunkGroups":{"app":{"chunks":[2,0],"assets":["webpack-runtime-4112d92f6d890538b818.js","webpack-runtime-4112d92f6d890538b818.js.map","app-95ae1fab5f2ef03e4c7f.js","app-95ae1fab5f2ef03e4c7f.js.map"],"children":{},"childAssets":{}},"pages-manifest":{"chunks":[1],"assets":["pages-manifest-0d02b77c37c76bc79313.js","pages-manifest-0d02b77c37c76bc79313.js.map"],"children":{},"childAssets":{}}},"assetsByChunkName":{"app":["webpack-runtime-4112d92f6d890538b818.js","app-95ae1fab5f2ef03e4c7f.js"],"pages-manifest":["pages-manifest-0d02b77c37c76bc79313.js"]}} -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-stripe-cart/src/utils/MetadataProvider.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { useSiteMetadata } from './hooks'; 3 | 4 | type Metadata = { 5 | STRIPE_API_KEY: string; 6 | siteUrl: string; 7 | } 8 | 9 | export const MetadataContext = React.createContext(undefined); 10 | 11 | export const MetadataProvider = ({children}: any) => { 12 | const { STRIPE_API_KEY, siteUrl } = useSiteMetadata(); 13 | return ( 14 | 15 | {children} 16 | 17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-core/gatsby-node.js: -------------------------------------------------------------------------------- 1 | 2 | const fs = require("fs"); 3 | const mkdirp = require("mkdirp"); 4 | const path = require("path"); 5 | 6 | /* Check that the folders used by source-filesystem plugin exist. 7 | * If they do not, they will be created. 8 | */ 9 | 10 | exports.onPreBootstrap = ({ store, reporter }) => { 11 | const { program } = store.getState(); 12 | 13 | const dirs = [ 14 | path.join(program.directory, "blog/"), 15 | ]; 16 | 17 | dirs.forEach(dir => { 18 | if (!fs.existsSync(dir)) { 19 | reporter.log(`creating the ${dir} directory`); 20 | mkdirp.sync(dir); 21 | } 22 | }); 23 | }; -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/index.js: -------------------------------------------------------------------------------- 1 | // exported components that can be edited by the consuming site 2 | export {default as Text} from './src/components/Text'; 3 | export {default as Box} from './src/components/Box'; 4 | export {default as Button} from './src/components/Button'; 5 | export {default as Grid} from './src/components/Grid'; 6 | export {default as Container} from './src/components/Container'; 7 | export {default as Header} from './src/components/Header'; 8 | export {default as Hero} from './src/components/Hero'; 9 | export {default as Content} from './src/components/Content'; 10 | export {default as Footer} from './src/components/Footer'; -------------------------------------------------------------------------------- /site/public/index.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-core/src/utils/Utilities.ts: -------------------------------------------------------------------------------- 1 | import { graphql, useStaticQuery } from 'gatsby'; 2 | 3 | interface Sitemetadata { 4 | title: string; 5 | description: string; 6 | author: string; 7 | twitter: string; 8 | } 9 | 10 | /** 11 | * Hook to provide the site meta data. 12 | * Provides title, description and author 13 | */ 14 | export function useSiteMetadata(): Sitemetadata { 15 | const { site } = useStaticQuery( 16 | graphql` 17 | query SITE_METADATA_QUERY { 18 | site { 19 | siteMetadata { 20 | title 21 | description 22 | author 23 | twitter 24 | } 25 | } 26 | } 27 | ` 28 | ); 29 | return site.siteMetadata; 30 | } 31 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/dist/utils/hooks.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/utils/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,IAAM,WAAW,GAAgB;IAChC,WAAW,EAAE,KAAK;IAClB,WAAW,EAAE,KAAK;IAClB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,MAAM;CACb,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,UAAkB;IACzC,IAAA,8BAAmE,EAAlE,UAAE,EAAE,qBAA8D,CAAC;IAE1E,KAAK,CAAC,SAAS,CAAC;QACf,IAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAC,GAAG,IAAK,OAAA,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,EAAvB,CAAuB,CAAC,CAAC;QAExE,IAAA;;;;;;iBAAM,CAKN;QACP,aAAa,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO,EAAE,CAAC;AACX,CAAC"} -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/gatsby-browser.js: -------------------------------------------------------------------------------- 1 | // import * as React from 'react'; 2 | // import { Global, css } from '@emotion/core' 3 | 4 | // export const wrapRootElement = ({ element }) => { 5 | // return ( 6 | // <> 7 | // 21 | // {element} 22 | // 23 | // ); 24 | // } -------------------------------------------------------------------------------- /site/.cache/public-page-renderer-prod.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import PropTypes from "prop-types" 3 | 4 | import InternalPageRenderer from "./page-renderer" 5 | import loader from "./loader" 6 | 7 | const ProdPageRenderer = ({ location }) => { 8 | const pageResources = loader.getResourcesForPathnameSync(location.pathname) 9 | if (!pageResources) { 10 | return null 11 | } 12 | 13 | return React.createElement(InternalPageRenderer, { 14 | location, 15 | pageResources, 16 | ...pageResources.json, 17 | }) 18 | } 19 | 20 | ProdPageRenderer.propTypes = { 21 | location: PropTypes.shape({ 22 | pathname: PropTypes.string.isRequired, 23 | }).isRequired, 24 | } 25 | 26 | export default ProdPageRenderer 27 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-blog/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gatsby-theme-west-egg-blog", 3 | "version": "0.0.1", 4 | "description": "A blog theme", 5 | "main": "index.js", 6 | "author": "Hungry Bear Studio ", 7 | "license": "MIT", 8 | "private": false, 9 | "devDependencies": { 10 | "gatsby": "^2.7.1", 11 | "react": "^16.8.6", 12 | "react-dom": "^16.8.6" 13 | }, 14 | "peerDependencies": { 15 | "gatsby": "^2.7.1", 16 | "react": "^16.8.6", 17 | "react-dom": "^16.8.6" 18 | }, 19 | "dependencies": { 20 | "@mdx-js/mdx": "^1.0.0-rc.4", 21 | "@mdx-js/react": "^1.0.0-rc.5", 22 | "gatsby-mdx": "^0.6.3", 23 | "gatsby-plugin-page-creator": "^2.0.13" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /site/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "./dist/", 4 | "baseUrl": "./src", 5 | "sourceMap": true, 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "importHelpers": true, 10 | "noUnusedLocals": true, 11 | "noUnusedParameters": true, 12 | "module": "esnext", 13 | "moduleResolution": "node", 14 | "target": "es5", 15 | "lib": ["dom", "es5", "es2015", "es2016", "es2018"], 16 | "jsx": "react", 17 | "allowJs": true, 18 | "alwaysStrict": true, 19 | "forceConsistentCasingInFileNames": true, 20 | "strict": true, 21 | "esModuleInterop": true, 22 | "incremental": true 23 | }, 24 | "include": [ 25 | "./src/**/*" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /site/.cache/__tests__/strip-prefix.js: -------------------------------------------------------------------------------- 1 | const stripPrefix = require(`../strip-prefix`).default 2 | 3 | describe(`strip-prefix`, () => { 4 | it(`strips a prefix`, () => { 5 | expect(stripPrefix(`/foo/bar/`, `/foo`)).toBe(`/bar/`) 6 | }) 7 | 8 | it(`strips first instance only`, () => { 9 | expect(stripPrefix(`/foo/foo/bar/`, `/foo`)).toBe(`/foo/bar/`) 10 | }) 11 | 12 | it(`ignores prefix appearing elsewhere in the string`, () => { 13 | expect(stripPrefix(`/foo/bar/`, `bar`)).toBe(`/foo/bar/`) 14 | }) 15 | 16 | it(`ignores a non-existent prefix`, () => { 17 | expect(stripPrefix(`/bar`, `/foo`)).toBe(`/bar`) 18 | }) 19 | 20 | it(`returns input str if no prefix is provided`, () => { 21 | expect(stripPrefix(`/bar`)).toBe(`/bar`) 22 | }) 23 | }) 24 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "./dist/", 4 | "baseUrl": "./src", 5 | "sourceMap": true, 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "importHelpers": true, 10 | "noUnusedLocals": true, 11 | "noUnusedParameters": true, 12 | "module": "esnext", 13 | "moduleResolution": "node", 14 | "target": "es5", 15 | "lib": ["dom", "es5", "es2015", "es2016", "es2018"], 16 | "jsx": "react", 17 | "allowJs": true, 18 | "alwaysStrict": true, 19 | "forceConsistentCasingInFileNames": true, 20 | "strict": true, 21 | "esModuleInterop": true, 22 | "incremental": true 23 | }, 24 | "include": [ 25 | "./src/**/*" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/src/components/Grid.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { jsx, css } from '@emotion/core'; 3 | 4 | interface GridProps { 5 | elements: React.ReactNode[]; 6 | } 7 | 8 | /** 9 | * A responsive container to display elements in a grid format 10 | * @param elements An array of elements to be displayed in the conatiner 11 | * @returns A responsive grid of elements 12 | */ 13 | export default ({ elements }: GridProps) => { 14 | 15 | return ( 16 |
27 | {elements.map((element) => element)} 28 |
29 | ) 30 | } 31 | -------------------------------------------------------------------------------- /site/.cache/test-require-error.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | exports.__esModule = true; 4 | exports.default = void 0; 5 | 6 | // This module is also copied into the .cache directory some modules copied there 7 | // from cache-dir can also use this module. 8 | var _default = (moduleName, err) => { 9 | // PnP will return the following code when a require is allowed per the 10 | // dependency tree rules but the requested file doesn't exist 11 | if (err.code === `QUALIFIED_PATH_RESOLUTION_FAILED`) { 12 | return true; 13 | } 14 | 15 | const regex = new RegExp(`Error: Cannot find module\\s.${moduleName.replace(/[-/\\^$*+?.()|[\]{}]/g, `\\$&`)}`); 16 | const firstLine = err.toString().split(`\n`)[0]; 17 | return regex.test(firstLine); 18 | }; 19 | 20 | exports.default = _default; 21 | //# sourceMappingURL=test-require-error.js.map -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gatsby-theme-west-egg 2 | 3 | A Gatsby theme package built with Emotion and Typescript consisting of: 4 | 5 | - [Style theme](https://www.npmjs.com/package/gatsby-theme-west-egg-style) 6 | - Blog theme 7 | - Stripe Cart theme 8 | - Sanity.io studio - WIP 9 | - [Master theme](https://www.npmjs.com/package/gatsby-theme-west-egg) 10 | 11 | View the theme in the wild: [hungrybearstudio.com](https://www.hungrybearstudio.com/) 12 | 13 | Current status: WIP 14 | 15 | ## Built With 16 | 17 | - [Gatsby](https://www.gatsbyjs.org/) 18 | - [Emotion](https://emotion.sh/docs/introduction) 19 | - [Stripe Checkout](https://stripe.com/en-se) 20 | - [TypeScript](https://www.typescriptlang.org/) 21 | 22 | ## Authors 23 | 24 | - **Rich Haines** - _Hungry Bear Studio_ 25 | 26 | ## License 27 | 28 | This project is licensed under the MIT License 29 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-sanity/sanity-studio/README.md: -------------------------------------------------------------------------------- 1 | # Sanity Blogging Content Studio 2 | 3 | Congratulations, you have now installed the Sanity Content Studio, an open source real-time content editing environment connected to the Sanity backend. 4 | 5 | Now you can do the following things: 6 | 7 | - [Read “getting started” in the docs](https://www.sanity.io/docs/introduction/getting-started?utm_source=readme) 8 | - Check out the example frontend: [React/Next.js](https://github.com/sanity-io/tutorial-sanity-blog-react-next) 9 | - [Read the blog post about this template](https://www.sanity.io/blog/build-your-own-blog-with-sanity-and-next-js?utm_source=readme) 10 | - [Join the community Slack](https://slack.sanity.io/?utm_source=readme) 11 | - [Extend and build plugins](https://www.sanity.io/docs/content-studio/extending?utm_source=readme) 12 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/dist/components/Box.d.ts: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | export interface BoxProps { 3 | noBackground?: boolean; 4 | noBorder?: boolean; 5 | children: React.ReactNode; 6 | color?: string; 7 | height?: string; 8 | width?: string; 9 | rounded?: boolean; 10 | } 11 | declare const _default: ({ children, noBackground, noBorder, color, height, width, rounded }: BoxProps) => JSX.Element; 12 | /** 13 | * A configurable box 14 | * @param noBackground Choose if the box should have no background color 15 | * @param noBorder Choose if the box should have no border 16 | * @param color Supply your own color for the background 17 | * @param height Optional box height 18 | * @param width Optional box width 19 | * @param children The contents of the box 20 | */ 21 | export default _default; 22 | -------------------------------------------------------------------------------- /site/.cache/__tests__/minimal-config.js: -------------------------------------------------------------------------------- 1 | const path = require(`path`) 2 | const child = require(`child_process`) 3 | 4 | it(`Builds cache-dir with minimal config`, done => { 5 | const args = [ 6 | require.resolve(`@babel/cli/bin/babel.js`), 7 | path.join(__dirname, `..`), 8 | `--config-file`, 9 | path.join(__dirname, `.babelrc`), 10 | `--ignore`, 11 | `**/__tests__`, 12 | ] 13 | 14 | const spawn = child.spawn(process.execPath, args) 15 | 16 | let stderr = `` 17 | let stdout = `` 18 | 19 | spawn.stderr.on(`data`, function(chunk) { 20 | stderr += chunk 21 | }) 22 | 23 | spawn.stdout.on(`data`, function(chunk) { 24 | stdout += chunk 25 | }) 26 | 27 | spawn.on(`close`, function() { 28 | expect(stderr).toEqual(``) 29 | expect(stdout).not.toEqual(``) 30 | done() 31 | }) 32 | }, 30000) 33 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/src/components/Header.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { jsx, css } from '@emotion/core'; 3 | 4 | interface HeaderProps { 5 | children: React.ReactNode; 6 | twoColumn?: boolean; 7 | } 8 | 9 | /** 10 | * A header component. Part of the containers grid 11 | * @param children The contents of the header, can include buttons 12 | * @param twoColumn Boolean, decides if header is split into two columns or not 13 | */ 14 | export default ({children, twoColumn}: HeaderProps) => ( 15 |
26 | {children} 27 |
28 | ) -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "./dist", 4 | "baseUrl": "./src", 5 | "sourceMap": true, 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "importHelpers": true, 10 | "noUnusedLocals": true, 11 | "noUnusedParameters": true, 12 | "module": "esnext", 13 | "moduleResolution": "node", 14 | "target": "es5", 15 | "lib": ["dom", "es5", "es2015", "es2016", "es2018"], 16 | "jsx": "react", 17 | // "allowJs": true, 18 | "alwaysStrict": true, 19 | "forceConsistentCasingInFileNames": true, 20 | "strict": true, 21 | "esModuleInterop": true, 22 | "declaration": true 23 | }, 24 | "include": [ 25 | "./src/**/*" 26 | ], 27 | "exclude": [ 28 | "node_modules", 29 | "dist" 30 | ] 31 | } -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-sanity/sanity-studio/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gatsbythemewesteggsanity", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "package.json", 7 | "author": "Hungry Bear Studio ", 8 | "license": "UNLICENSED", 9 | "scripts": { 10 | "start": "sanity start", 11 | "test": "sanity check" 12 | }, 13 | "keywords": [ 14 | "sanity" 15 | ], 16 | "dependencies": { 17 | "@sanity/base": "^0.140.17", 18 | "@sanity/components": "^0.140.25", 19 | "@sanity/core": "^0.140.25", 20 | "@sanity/default-layout": "^0.140.25", 21 | "@sanity/default-login": "^0.140.15", 22 | "@sanity/desk-tool": "^0.140.25", 23 | "prop-types": "^15.6", 24 | "react": "^16.2", 25 | "react-dom": "^16.2" 26 | }, 27 | "devDependencies": {} 28 | } 29 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "./dist", 4 | "baseUrl": "./src", 5 | "sourceMap": true, 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "importHelpers": true, 10 | "noUnusedLocals": true, 11 | "noUnusedParameters": true, 12 | "module": "esnext", 13 | "moduleResolution": "node", 14 | "target": "es5", 15 | "lib": ["dom", "es5", "es2015", "es2016", "es2018"], 16 | "jsx": "react", 17 | // "allowJs": true, 18 | "alwaysStrict": true, 19 | "forceConsistentCasingInFileNames": true, 20 | "strict": true, 21 | "esModuleInterop": true, 22 | "declaration": true 23 | }, 24 | "include": [ 25 | "./src/**/*" 26 | ], 27 | "exclude": [ 28 | "node_modules", 29 | "dist" 30 | ] 31 | } -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-stripe-cart/src/@types/gatsby-theme-west-egg-stripe-cart/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'gatsby-theme-west-egg-stripe-cart' { 2 | 3 | interface Stripe { 4 | button: JSX.Element; 5 | sku: string; 6 | quantity: number; 7 | } 8 | 9 | /** 10 | * A Stripe checkout form. When submitted the user will be redirected to the stripe checkout. 11 | * Upon completion of purchase the user will be redirected back to your website. 12 | * 13 | * @example } sku="sku_123" quantity={1}/> 14 | * @param button A custom button element to submit the form 15 | * @param sku A product stock keeping unit 16 | * @param quantity The quantity to be included in the checkout 17 | */ 18 | export const StripeCheckout: (props: Stripe) => JSX.Element; 19 | } -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-stripe-cart/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "./dist", 4 | "baseUrl": "./src", 5 | "sourceMap": true, 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "importHelpers": true, 10 | "noUnusedLocals": true, 11 | "noUnusedParameters": true, 12 | "module": "esnext", 13 | "moduleResolution": "node", 14 | "target": "es5", 15 | "lib": ["dom", "es5", "es2015", "es2016", "es2018"], 16 | "jsx": "react", 17 | // "allowJs": true, 18 | "alwaysStrict": true, 19 | "forceConsistentCasingInFileNames": true, 20 | "strict": true, 21 | "esModuleInterop": true, 22 | "declaration": true 23 | }, 24 | "include": [ 25 | "./src/**/*" 26 | ], 27 | "exclude": [ 28 | "node_modules", 29 | "dist", 30 | "./src/pages" 31 | ] 32 | } -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-core/src/components/SEO.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import Helmet from 'react-helmet'; 3 | import { useSiteMetadata } from '../utils/Utilities'; 4 | 5 | /** 6 | * An SEO component which places typical site information in the sites head 7 | */ 8 | export default () => { 9 | const { title, description, twitter } = useSiteMetadata(); 10 | 11 | return ( 12 | 13 | 14 | {title && } 15 | {description && } 16 | 17 | {twitter && } 18 | {title && } 19 | {description && } 20 | 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/dist/components/Box.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Box.js","sourceRoot":"","sources":["../../src/components/Box.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAYpC;;;;;;;;GAQG;AACH,gBAAe,UAAC,EAA4E;QAA1E,sBAAQ,EAAE,8BAAY,EAAE,sBAAQ,EAAE,gBAAK,EAAE,kBAAM,EAAE,gBAAK,EAAE,oBAAO;IAChF,OAAO,CACN,6BACC,GAAG,EAAE,GAAG,iqBAAA,iDAEG,EAAwB,oBACzB,EAAsB,6MAQV,EAAiD,yDAEpD,EAAsB,uMASzB,EAA2B,GAAI,EAAc,8BAC1C,EAAsB,qBAExC,KAvBU,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EACzB,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAQV,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAEpD,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EASzB,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAI,MAAM,CAAC,OAAO,EAC1C,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG;QAIzC,6BAAK,SAAS,EAAC,WAAW,GAAG;QAC7B,6BAAK,SAAS,EAAC,QAAQ,IAAE,QAAQ,CAAO,CACnC,CACN,CAAC;AACH,CAAC,EAAC"} -------------------------------------------------------------------------------- /site/.cache/commonjs/public-page-renderer-dev.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 4 | 5 | exports.__esModule = true; 6 | exports.default = void 0; 7 | 8 | var _react = _interopRequireDefault(require("react")); 9 | 10 | var _propTypes = _interopRequireDefault(require("prop-types")); 11 | 12 | var _loader = _interopRequireDefault(require("./loader")); 13 | 14 | var _jsonStore = _interopRequireDefault(require("./json-store")); 15 | 16 | const DevPageRenderer = ({ 17 | location 18 | }) => { 19 | const pageResources = _loader.default.getResourcesForPathnameSync(location.pathname); 20 | 21 | return _react.default.createElement(_jsonStore.default, { 22 | location, 23 | pageResources 24 | }); 25 | }; 26 | 27 | DevPageRenderer.propTypes = { 28 | location: _propTypes.default.shape({ 29 | pathname: _propTypes.default.string.isRequired 30 | }).isRequired 31 | }; 32 | var _default = DevPageRenderer; 33 | exports.default = _default; -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-sanity/sanity-studio/schemas/author.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: 'author', 3 | title: 'Author', 4 | type: 'document', 5 | fields: [ 6 | { 7 | name: 'name', 8 | title: 'Name', 9 | type: 'string' 10 | }, 11 | { 12 | name: 'slug', 13 | title: 'Slug', 14 | type: 'slug', 15 | options: { 16 | source: 'name', 17 | maxLength: 96 18 | } 19 | }, 20 | { 21 | name: 'image', 22 | title: 'Image', 23 | type: 'image', 24 | options: { 25 | hotspot: true 26 | } 27 | }, 28 | { 29 | name: 'bio', 30 | title: 'Bio', 31 | type: 'array', 32 | of: [ 33 | { 34 | title: 'Block', 35 | type: 'block', 36 | styles: [{title: 'Normal', value: 'normal'}], 37 | lists: [] 38 | } 39 | ] 40 | } 41 | ], 42 | preview: { 43 | select: { 44 | title: 'name', 45 | media: 'image' 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/dist/utils/hooks.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | var breakpoints = { 3 | smallMobile: '300', 4 | largeMobile: '480', 5 | small: '500', 6 | medium: '768', 7 | large: '1130', 8 | }; 9 | /** 10 | * Hook to provide media query to css elements. 11 | * Pass in the breakpoint and get back the media query 12 | * @param breakpoint A breakpoint represented as a string value 13 | */ 14 | export function useBreakPoint(breakpoint) { 15 | var _a = React.useState(undefined), bp = _a[0], setBreakpoint = _a[1]; 16 | React.useEffect(function () { 17 | var bpArray = Object.keys(breakpoints).map(function (key) { return [key, breakpoints[key]]; }); 18 | var result = bpArray.reduce(function (acc, _a) { 19 | var name = _a[0], size = _a[1]; 20 | if (breakpoint === name) { 21 | return acc.concat(["@media (max-width: " + size + "px)"]); 22 | } 23 | return acc; 24 | }, [])[0]; 25 | setBreakpoint(result); 26 | }, [breakpoint]); 27 | return bp; 28 | } 29 | //# sourceMappingURL=hooks.js.map -------------------------------------------------------------------------------- /site/.cache/commonjs/public-page-renderer-prod.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 4 | 5 | exports.__esModule = true; 6 | exports.default = void 0; 7 | 8 | var _react = _interopRequireDefault(require("react")); 9 | 10 | var _propTypes = _interopRequireDefault(require("prop-types")); 11 | 12 | var _pageRenderer = _interopRequireDefault(require("./page-renderer")); 13 | 14 | var _loader = _interopRequireDefault(require("./loader")); 15 | 16 | const ProdPageRenderer = ({ 17 | location 18 | }) => { 19 | const pageResources = _loader.default.getResourcesForPathnameSync(location.pathname); 20 | 21 | if (!pageResources) { 22 | return null; 23 | } 24 | 25 | return _react.default.createElement(_pageRenderer.default, Object.assign({ 26 | location, 27 | pageResources 28 | }, pageResources.json)); 29 | }; 30 | 31 | ProdPageRenderer.propTypes = { 32 | location: _propTypes.default.shape({ 33 | pathname: _propTypes.default.string.isRequired 34 | }).isRequired 35 | }; 36 | var _default = ProdPageRenderer; 37 | exports.default = _default; -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-sanity/sanity-studio/schemas/schema.js: -------------------------------------------------------------------------------- 1 | // First, we must import the schema creator 2 | import createSchema from 'part:@sanity/base/schema-creator' 3 | 4 | // Then import schema types from any plugins that might expose them 5 | import schemaTypes from 'all:part:@sanity/base/schema-type' 6 | 7 | // We import object and document schemas 8 | import blockContent from './blockContent' 9 | import category from './category' 10 | import post from './post' 11 | import author from './author' 12 | 13 | // Then we give our schema to the builder and provide the result to Sanity 14 | export default createSchema({ 15 | // We name our schema 16 | name: 'default', 17 | // Then proceed to concatenate our our document type 18 | // to the ones provided by any plugins that are installed 19 | types: schemaTypes.concat([ 20 | // The following are document types which will appear 21 | // in the studio. 22 | post, 23 | author, 24 | category, 25 | // When added to this list, object types can be used as 26 | // { type: 'typename' } in other document schemas 27 | blockContent 28 | ]) 29 | }) 30 | -------------------------------------------------------------------------------- /site/.cache/error-overlay-handler.js: -------------------------------------------------------------------------------- 1 | import * as ErrorOverlay from "react-error-overlay" 2 | 3 | // Report runtime errors 4 | ErrorOverlay.startReportingRuntimeErrors({ 5 | onError: () => {}, 6 | filename: `/commons.js`, 7 | }) 8 | ErrorOverlay.setEditorHandler(errorLocation => 9 | window.fetch( 10 | `/__open-stack-frame-in-editor?fileName=` + 11 | window.encodeURIComponent(errorLocation.fileName) + 12 | `&lineNumber=` + 13 | window.encodeURIComponent(errorLocation.lineNumber || 1) 14 | ) 15 | ) 16 | 17 | const errorMap = {} 18 | 19 | const handleErrorOverlay = () => { 20 | const errors = Object.values(errorMap) 21 | if (errors.length > 0) { 22 | const errorMsg = errors.join(`\n\n`) 23 | ErrorOverlay.reportBuildError(errorMsg) 24 | } else { 25 | ErrorOverlay.dismissBuildError() 26 | } 27 | } 28 | 29 | export const clearError = errorID => { 30 | delete errorMap[errorID] 31 | handleErrorOverlay() 32 | } 33 | 34 | export const reportError = (errorID, error) => { 35 | if (error) { 36 | errorMap[errorID] = error 37 | } 38 | handleErrorOverlay() 39 | } 40 | 41 | export { errorMap } 42 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/src/components/Text.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { jsx, css } from '@emotion/core'; 3 | import colors from '../utils/colors'; 4 | 5 | interface TextProps { 6 | fontSize?: string; 7 | fontWeight?: string; 8 | children: React.ReactNode; 9 | color?: string; 10 | } 11 | 12 | /** 13 | * A configurable text 14 | * @param fontSize Optional font size - defaults to 3rem 15 | * @param fontWeight Optional font weight (300,400,400i,700) - defaults to 300 16 | * @param children The contents of the text 17 | * @param color Optional color for the text 18 | */ 19 | export default ({ fontSize, fontWeight, children, color }: TextProps) => ( 20 |
36 | {children} 37 |
38 | ); 39 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/src/utils/hooks.ts: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | interface BreakPoints { 4 | smallMobile: string; 5 | largeMobile: string; 6 | small: string; 7 | medium: string; 8 | large: string; 9 | [key: string]: string; 10 | } 11 | 12 | const breakpoints: BreakPoints = { 13 | smallMobile: '300', 14 | largeMobile: '480', 15 | small: '500', 16 | medium: '768', 17 | large: '1130', 18 | }; 19 | 20 | /** 21 | * Hook to provide media query to css elements. 22 | * Pass in the breakpoint and get back the media query 23 | * @param breakpoint A breakpoint represented as a string value 24 | */ 25 | export function useBreakPoint(breakpoint: string) { 26 | const [bp, setBreakpoint] = React.useState(undefined); 27 | 28 | React.useEffect(() => { 29 | const bpArray = Object.keys(breakpoints).map((key) => [key, breakpoints[key]]); 30 | 31 | const [result] = bpArray.reduce((acc, [name, size]) => { 32 | if (breakpoint === name) { 33 | return [...acc, `@media (max-width: ${size}px)`]; 34 | } 35 | return acc; 36 | }, []); 37 | setBreakpoint(result); 38 | }, [breakpoint]); 39 | 40 | return bp; 41 | } 42 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/dist/components/Button.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const buttonBorderLeft: import("@emotion/utils").SerializedStyles; 3 | export declare const buttonBorderRight: import("@emotion/utils").SerializedStyles; 4 | export declare const buttonBorderTop: import("@emotion/utils").SerializedStyles; 5 | export declare const buttonBorderBottom: import("@emotion/utils").SerializedStyles; 6 | export declare const buttonDark: import("@emotion/utils").SerializedStyles; 7 | export declare const buttonBorder: import("@emotion/utils").SerializedStyles; 8 | export declare const button: import("@emotion/utils").SerializedStyles; 9 | declare type Type = 'submit' | 'reset'; 10 | interface ButtonProps { 11 | text: string; 12 | onClick?: () => void; 13 | type?: Type; 14 | disabled?: boolean; 15 | } 16 | declare const _default: ({ text, onClick, type, disabled }: ButtonProps) => JSX.Element; 17 | /** 18 | * A button with an off center foreground shadow 19 | * 20 | * The button is built with a natural 1.5rem margin 21 | * 22 | * @param text The buttons text 23 | * @param onClick The onClick event of the button - optional 24 | */ 25 | export default _default; 26 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg/src/components/posts-page-layout.tsx: -------------------------------------------------------------------------------- 1 | // src/components/posts-page-layout.js 2 | import * as React from "react"; 3 | import { graphql, Link } from "gatsby"; 4 | import MDXRenderer from "gatsby-mdx/mdx-renderer"; 5 | import { Container, Text, Header, Button, Hero } from 'gatsby-theme-west-egg-style'; 6 | 7 | function PageTemplate({ data: { mdx }}: any) { 8 | return ( 9 | 10 |
11 | {mdx.frontmatter.title} 12 |
20 | 21 |
24 |
25 | 26 | {mdx.code.body} 27 | 28 |
29 | ); 30 | } 31 | export const pageQuery = graphql` 32 | query BlogPostQuery($id: String) { 33 | mdx(id: { eq: $id }) { 34 | id 35 | frontmatter { 36 | title 37 | } 38 | code { 39 | body 40 | } 41 | } 42 | } 43 | `; 44 | export default PageTemplate -------------------------------------------------------------------------------- /site/.cache/default-html.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import PropTypes from "prop-types" 3 | 4 | export default function HTML(props) { 5 | return ( 6 | 7 | 8 | 9 | 10 | 14 | {props.headComponents} 15 | 16 | 17 | {props.preBodyComponents} 18 | 21 |
26 | {props.postBodyComponents} 27 | 28 | 29 | ) 30 | } 31 | 32 | HTML.propTypes = { 33 | htmlAttributes: PropTypes.object, 34 | headComponents: PropTypes.array, 35 | bodyAttributes: PropTypes.object, 36 | preBodyComponents: PropTypes.array, 37 | body: PropTypes.string, 38 | postBodyComponents: PropTypes.array, 39 | } 40 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/src/components/Container.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { jsx, css } from '@emotion/core'; 3 | 4 | interface ContainerProps { 5 | children: React.ReactNode[]; 6 | customGrid?: string; 7 | } 8 | 9 | /** 10 | * A container component that sets a grid layout 11 | * @param children The children elements for the grid 12 | * @param customGrid Optional custom grid layout 13 | * @example default grid layout: 14 | display: grid; 15 | grid-template-columns: .2fr 2fr .2fr; 16 | grid-template-rows: .5fr 1fr .5fr; 17 | 18 | grid-template-areas: 19 | ". header ." 20 | ". hero ." 21 | ". content ." 22 | ". footer ."; 23 | 24 | height: 100vh; 25 | grid-gap: 2rem; 26 | */ 27 | export default ({children, customGrid}: ContainerProps) => ( 28 |
44 | {children} 45 |
46 | ) -------------------------------------------------------------------------------- /site/.cache/page-renderer.js: -------------------------------------------------------------------------------- 1 | import React, { createElement } from "react" 2 | import PropTypes from "prop-types" 3 | import { publicLoader } from "./loader" 4 | import { apiRunner } from "./api-runner-browser" 5 | 6 | // Renders page 7 | class PageRenderer extends React.Component { 8 | render() { 9 | const props = { 10 | ...this.props, 11 | pathContext: this.props.pageContext, 12 | } 13 | 14 | const [replacementElement] = apiRunner(`replaceComponentRenderer`, { 15 | props: this.props, 16 | loader: publicLoader, 17 | }) 18 | 19 | const pageElement = 20 | replacementElement || 21 | createElement(this.props.pageResources.component, { 22 | ...props, 23 | key: this.props.pageResources.page.path, 24 | }) 25 | 26 | const wrappedPage = apiRunner( 27 | `wrapPageElement`, 28 | { element: pageElement, props }, 29 | pageElement, 30 | ({ result }) => { 31 | return { element: result, props } 32 | } 33 | ).pop() 34 | 35 | return wrappedPage 36 | } 37 | } 38 | 39 | PageRenderer.propTypes = { 40 | location: PropTypes.object.isRequired, 41 | pageResources: PropTypes.object.isRequired, 42 | data: PropTypes.object, 43 | pageContext: PropTypes.object.isRequired, 44 | } 45 | 46 | export default PageRenderer 47 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/gastby-config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const pkg = require('./package.json'); 3 | 4 | module.exports = (options) => { 5 | const {} = options; 6 | 7 | return { 8 | plugins: [ 9 | { 10 | resolve: "gatsby-plugin-page-creator", 11 | options: { 12 | path: path.join(__dirname, "src", "pages"), 13 | }, 14 | }, 15 | { 16 | resolve: "gatsby-source-filesystem", 17 | options: { 18 | path: path.join(__dirname, "src", "pages"), 19 | }, 20 | }, 21 | { 22 | resolve: 'gatsby-plugin-compile-es6-packages', 23 | options: { 24 | modules: [pkg.name] 25 | } 26 | }, 27 | { 28 | resolve: 'gatsby-plugin-google-fonts', 29 | options: { 30 | fonts: [ 31 | `Montserrat`, 32 | `source sans pro\:300,400,400i,700` 33 | ] 34 | } 35 | }, 36 | 'gatsby-plugin-emotion', 37 | 'gatsby-plugin-typescript', 38 | 'gatsby-plugin-emotion' 39 | ] 40 | } 41 | } -------------------------------------------------------------------------------- /site/.cache/commonjs/api-runner-ssr.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | // During bootstrap, we write requires at top of this file which looks like: 4 | // var plugins = [ 5 | // { 6 | // plugin: require("/path/to/plugin1/gatsby-ssr.js"), 7 | // options: { ... }, 8 | // }, 9 | // { 10 | // plugin: require("/path/to/plugin2/gatsby-ssr.js"), 11 | // options: { ... }, 12 | // }, 13 | // ] 14 | const apis = require(`./api-ssr-docs`); // Run the specified API in any plugins that have implemented it 15 | 16 | 17 | module.exports = (api, args, defaultReturn, argTransform) => { 18 | if (!apis[api]) { 19 | console.log(`This API doesn't exist`, api); 20 | } // Run each plugin in series. 21 | // eslint-disable-next-line no-undef 22 | 23 | 24 | let results = plugins.map(plugin => { 25 | if (!plugin.plugin[api]) { 26 | return undefined; 27 | } 28 | 29 | const result = plugin.plugin[api](args, plugin.options); 30 | 31 | if (result && argTransform) { 32 | args = argTransform({ 33 | args, 34 | result 35 | }); 36 | } 37 | 38 | return result; 39 | }); // Filter out undefined results. 40 | 41 | results = results.filter(result => typeof result !== `undefined`); 42 | 43 | if (results.length > 0) { 44 | return results; 45 | } else { 46 | return [defaultReturn]; 47 | } 48 | }; -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-core/gatsby-config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const pkg = require('./package.json'); 3 | 4 | module.exports = (options) => { 5 | const {title, description, author, twitter, siteUrl} = options; 6 | 7 | return { 8 | siteMetadata: { 9 | title, 10 | description, 11 | author, 12 | siteUrl, 13 | twitter 14 | }, 15 | plugins: [ 16 | 'gatsby-plugin-react-helmet', 17 | 'gatsby-plugin-sharp', 18 | 'gatsby-transformer-sharp', 19 | // { 20 | // resolve: "gatsby-plugin-page-creator", 21 | // options: { 22 | // path: path.join(__dirname, "src", "pages"), 23 | // }, 24 | // }, 25 | // { 26 | // resolve: "gatsby-source-filesystem", 27 | // options: { 28 | // path: path.join(__dirname, "src", "pages"), 29 | // }, 30 | // }, 31 | { 32 | resolve: 'gatsby-plugin-compile-es6-packages', 33 | options: { 34 | modules: [pkg.name] 35 | } 36 | }, 37 | 'gatsby-plugin-sitemap', 38 | 'gatsby-plugin-typescript' 39 | ] 40 | } 41 | } -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg/README.md: -------------------------------------------------------------------------------- 1 | # gatsby-theme-west-egg 2 | 3 | A Gatsby theme package built with Emotion and Typescript consisting of: 4 | 5 | - Style theme 6 | - Mdx blog theme: WIP 7 | - Stripe cart theme 8 | - Core theme 9 | 10 | ``` 11 | module.exports = { 12 | 13 | __experimentalThemes: [ 14 | { 15 | resolve: 'gatsby-theme-west-egg', 16 | options: { 17 | STRIPE_API_KEY: process.env.STRIPE_API_KEY, 18 | STRIPE_SECRET_KEY: process.env.STRIPE_SECRET_KEY, 19 | title: 'Hungry Bear Studio Gatsby Theme Package', 20 | description: 'West egg gatsby theme package. Comes with style theme, stripe cart theme, blog and core themes.', 21 | author: 'Hungry Bear Studio', 22 | twitter: '@studio_hungry', 23 | siteUrl: 'http://localhost:8000' 24 | } 25 | } 26 | ], 27 | } 28 | ``` 29 | 30 | Create a blog folder at the root of your site and add your mdx files there. 31 | 32 | Current status: WIP 33 | 34 | ## Built With 35 | 36 | - [Gatbsy](https://www.gatsbyjs.org/) 37 | - [Emotion](https://emotion.sh/docs/introduction) 38 | - [Stripe Checkout](https://stripe.com/en-se) 39 | - [TypeScript](https://www.typescriptlang.org/) 40 | 41 | ## Authors 42 | 43 | - **Rich Haines** - _Hungry Bear Studio_ 44 | 45 | ## License 46 | 47 | This project is licensed under the MIT License 48 | -------------------------------------------------------------------------------- /site/.cache/commonjs/error-overlay-handler.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); 4 | 5 | exports.__esModule = true; 6 | exports.errorMap = exports.reportError = exports.clearError = void 0; 7 | 8 | var ErrorOverlay = _interopRequireWildcard(require("react-error-overlay")); 9 | 10 | // Report runtime errors 11 | ErrorOverlay.startReportingRuntimeErrors({ 12 | onError: () => {}, 13 | filename: `/commons.js` 14 | }); 15 | ErrorOverlay.setEditorHandler(errorLocation => window.fetch(`/__open-stack-frame-in-editor?fileName=` + window.encodeURIComponent(errorLocation.fileName) + `&lineNumber=` + window.encodeURIComponent(errorLocation.lineNumber || 1))); 16 | const errorMap = {}; 17 | exports.errorMap = errorMap; 18 | 19 | const handleErrorOverlay = () => { 20 | const errors = Object.values(errorMap); 21 | 22 | if (errors.length > 0) { 23 | const errorMsg = errors.join(`\n\n`); 24 | ErrorOverlay.reportBuildError(errorMsg); 25 | } else { 26 | ErrorOverlay.dismissBuildError(); 27 | } 28 | }; 29 | 30 | const clearError = errorID => { 31 | delete errorMap[errorID]; 32 | handleErrorOverlay(); 33 | }; 34 | 35 | exports.clearError = clearError; 36 | 37 | const reportError = (errorID, error) => { 38 | if (error) { 39 | errorMap[errorID] = error; 40 | } 41 | 42 | handleErrorOverlay(); 43 | }; 44 | 45 | exports.reportError = reportError; -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-stripe-cart/gatsby-config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const pkg = require('./package.json'); 3 | 4 | module.exports = (options) => { 5 | const {STRIPE_API_KEY, STRIPE_SECRET_KEY, siteUrl} = options; 6 | 7 | return { 8 | siteMetadata: { 9 | STRIPE_API_KEY, 10 | siteUrl 11 | }, 12 | plugins: [ 13 | 'gatsby-plugin-stripe', 14 | { 15 | resolve: `gatsby-source-stripe`, 16 | options: { 17 | objects: ['Sku'], 18 | secretKey: STRIPE_SECRET_KEY, 19 | downloadFiles: true, 20 | auth: false, 21 | } 22 | }, 23 | { 24 | resolve: `gatsby-source-filesystem`, 25 | options: { 26 | name: `images`, 27 | path: `${__dirname}/src/images/`, 28 | }, 29 | }, 30 | { 31 | resolve: "gatsby-plugin-page-creator", 32 | options: { 33 | path: path.join(__dirname, "src", "pages"), 34 | }, 35 | }, 36 | { 37 | resolve: `gatsby-source-filesystem`, 38 | options: { 39 | name: `pages`, 40 | path: `${__dirname}/src/pages/`, 41 | }, 42 | }, 43 | { 44 | resolve: 'gatsby-plugin-compile-es6-packages', 45 | options: { 46 | modules: [pkg.name] 47 | } 48 | } 49 | ] 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/dist/components/Title.js: -------------------------------------------------------------------------------- 1 | import * as tslib_1 from "tslib"; 2 | import * as React from 'react'; 3 | import colors from '../utils/colors'; 4 | import { css } from '@emotion/core'; 5 | /** 6 | * A configurable title 7 | * @param fontSize Optional font size - defaults to 3rem 8 | * @param fontWeight Optional font weight (300,400,400i,700) - defaults to 300 9 | * @param children The contents of the title 10 | */ 11 | export default (function (_a) { 12 | var fontSize = _a.fontSize, fontWeight = _a.fontWeight, children = _a.children; 13 | return (React.createElement("div", { css: css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n\t\t\tfont-family: Montserrat;\n\t\t\tfont-weight: ", ";\n\t\t\tline-height: 110%;\n\t\t\tfont-size: ", ";\n\t\t\tletter-spacing: 2px;\n\t\t\tmargin: 0 0 12px 0;\n\t\t\tpadding: 0;\n\t\t\tcolor: ", ";\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tword-wrap: break-word;\n\t\t"], ["\n\t\t\tfont-family: Montserrat;\n\t\t\tfont-weight: ", ";\n\t\t\tline-height: 110%;\n\t\t\tfont-size: ", ";\n\t\t\tletter-spacing: 2px;\n\t\t\tmargin: 0 0 12px 0;\n\t\t\tpadding: 0;\n\t\t\tcolor: ", ";\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tword-wrap: break-word;\n\t\t"])), fontWeight ? fontWeight : '300', fontSize ? fontSize : '3rem', colors.primary) }, children)); 14 | }); 15 | var templateObject_1; 16 | //# sourceMappingURL=Title.js.map -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-sanity/sanity-studio/schemas/post.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: 'post', 3 | title: 'Post', 4 | type: 'document', 5 | fields: [ 6 | { 7 | name: 'title', 8 | title: 'Title', 9 | type: 'string' 10 | }, 11 | { 12 | name: 'slug', 13 | title: 'Slug', 14 | type: 'slug', 15 | options: { 16 | source: 'title', 17 | maxLength: 96 18 | } 19 | }, 20 | { 21 | name: 'author', 22 | title: 'Author', 23 | type: 'reference', 24 | to: {type: 'author'} 25 | }, 26 | { 27 | name: 'mainImage', 28 | title: 'Main image', 29 | type: 'image', 30 | options: { 31 | hotspot: true 32 | } 33 | }, 34 | { 35 | name: 'categories', 36 | title: 'Categories', 37 | type: 'array', 38 | of: [{type: 'reference', to: {type: 'category'}}] 39 | }, 40 | { 41 | name: 'publishedAt', 42 | title: 'Published at', 43 | type: 'datetime' 44 | }, 45 | { 46 | name: 'body', 47 | title: 'Body', 48 | type: 'blockContent' 49 | } 50 | ], 51 | 52 | preview: { 53 | select: { 54 | title: 'title', 55 | author: 'author.name', 56 | media: 'mainImage' 57 | }, 58 | prepare(selection) { 59 | const {author} = selection 60 | return Object.assign({}, selection, { 61 | subtitle: author && `by ${author}` 62 | }) 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /site/.cache/sync-requires.js: -------------------------------------------------------------------------------- 1 | const { hot } = require("react-hot-loader/root") 2 | 3 | // prefer default export if available 4 | const preferDefault = m => m && m.default || m 5 | 6 | 7 | exports.components = { 8 | "component---packages-gatsby-theme-west-egg-src-components-posts-page-layout-tsx": hot(preferDefault(require("D:\\HUNGRYBEARSTUDIO\\GATSBY-THEMES\\gastby-theme-west-egg\\packages\\gatsby-theme-west-egg\\src\\components\\posts-page-layout.tsx"))), 9 | "component---cache-dev-404-page-js": hot(preferDefault(require("D:\\HUNGRYBEARSTUDIO\\GATSBY-THEMES\\gastby-theme-west-egg\\site\\.cache\\dev-404-page.js"))), 10 | "component---packages-gatsby-theme-west-egg-src-pages-index-tsx": hot(preferDefault(require("D:\\HUNGRYBEARSTUDIO\\GATSBY-THEMES\\gastby-theme-west-egg\\packages\\gatsby-theme-west-egg\\src\\pages\\index.tsx"))), 11 | "component---packages-gatsby-theme-west-egg-src-pages-checkout-canceled-tsx": hot(preferDefault(require("D:\\HUNGRYBEARSTUDIO\\GATSBY-THEMES\\gastby-theme-west-egg\\packages\\gatsby-theme-west-egg\\src\\pages\\checkout\\canceled.tsx"))), 12 | "component---packages-gatsby-theme-west-egg-src-pages-checkout-success-tsx": hot(preferDefault(require("D:\\HUNGRYBEARSTUDIO\\GATSBY-THEMES\\gastby-theme-west-egg\\packages\\gatsby-theme-west-egg\\src\\pages\\checkout\\success.tsx"))), 13 | "component---packages-gatsby-theme-west-egg-src-pages-blog-index-tsx": hot(preferDefault(require("D:\\HUNGRYBEARSTUDIO\\GATSBY-THEMES\\gastby-theme-west-egg\\packages\\gatsby-theme-west-egg\\src\\pages\\blogIndex.tsx"))) 14 | } 15 | 16 | -------------------------------------------------------------------------------- /site/.cache/commonjs/default-html.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 4 | 5 | exports.__esModule = true; 6 | exports.default = HTML; 7 | 8 | var _react = _interopRequireDefault(require("react")); 9 | 10 | var _propTypes = _interopRequireDefault(require("prop-types")); 11 | 12 | function HTML(props) { 13 | return _react.default.createElement("html", props.htmlAttributes, _react.default.createElement("head", null, _react.default.createElement("meta", { 14 | charSet: "utf-8" 15 | }), _react.default.createElement("meta", { 16 | httpEquiv: "x-ua-compatible", 17 | content: "ie=edge" 18 | }), _react.default.createElement("meta", { 19 | name: "viewport", 20 | content: "width=device-width, initial-scale=1, shrink-to-fit=no" 21 | }), props.headComponents), _react.default.createElement("body", props.bodyAttributes, props.preBodyComponents, _react.default.createElement("noscript", { 22 | key: "noscript", 23 | id: "gatsby-noscript" 24 | }, "This app works best with JavaScript enabled."), _react.default.createElement("div", { 25 | key: `body`, 26 | id: "___gatsby", 27 | dangerouslySetInnerHTML: { 28 | __html: props.body 29 | } 30 | }), props.postBodyComponents)); 31 | } 32 | 33 | HTML.propTypes = { 34 | htmlAttributes: _propTypes.default.object, 35 | headComponents: _propTypes.default.array, 36 | bodyAttributes: _propTypes.default.object, 37 | preBodyComponents: _propTypes.default.array, 38 | body: _propTypes.default.string, 39 | postBodyComponents: _propTypes.default.array 40 | }; -------------------------------------------------------------------------------- /site/.cache/find-page.js: -------------------------------------------------------------------------------- 1 | // TODO add tests especially for handling prefixed links. 2 | import { match as matchPath } from "@reach/router/lib/utils" 3 | import stripPrefix from "./strip-prefix" 4 | 5 | const pageCache = {} 6 | 7 | export default (pages, pathPrefix = ``) => rawPathname => { 8 | let pathname = decodeURIComponent(rawPathname) 9 | 10 | // Remove the pathPrefix from the pathname. 11 | let trimmedPathname = stripPrefix(pathname, pathPrefix) 12 | 13 | // Remove any hashfragment 14 | if (trimmedPathname.split(`#`).length > 1) { 15 | trimmedPathname = trimmedPathname 16 | .split(`#`) 17 | .slice(0, -1) 18 | .join(``) 19 | } 20 | 21 | // Remove search query 22 | if (trimmedPathname.split(`?`).length > 1) { 23 | trimmedPathname = trimmedPathname 24 | .split(`?`) 25 | .slice(0, -1) 26 | .join(``) 27 | } 28 | 29 | if (pageCache[trimmedPathname]) { 30 | return pageCache[trimmedPathname] 31 | } 32 | 33 | let foundPage 34 | // Array.prototype.find is not supported in IE so we use this somewhat odd 35 | // work around. 36 | pages.some(page => { 37 | let pathToMatch = page.matchPath ? page.matchPath : page.path 38 | if (matchPath(pathToMatch, trimmedPathname)) { 39 | foundPage = page 40 | pageCache[trimmedPathname] = page 41 | return true 42 | } 43 | 44 | // Finally, try and match request with default document. 45 | if (matchPath(`${page.path}index.html`, trimmedPathname)) { 46 | foundPage = page 47 | pageCache[trimmedPathname] = page 48 | return true 49 | } 50 | 51 | return false 52 | }) 53 | 54 | return foundPage 55 | } 56 | -------------------------------------------------------------------------------- /site/gatsby-config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const pkg = require('./package.json'); 3 | let activeEnv = 4 | process.env.GATSBY_ACTIVE_ENV || process.env.NODE_ENV || "development" 5 | 6 | require("dotenv").config({ 7 | path: `.env.${activeEnv}`, 8 | }) 9 | 10 | module.exports = { 11 | __experimentalThemes: [ 12 | { 13 | resolve: 'gatsby-theme-west-egg', 14 | options: { 15 | STRIPE_API_KEY: process.env.STRIPE_API_KEY, 16 | STRIPE_SECRET_KEY: process.env.STRIPE_SECRET_KEY, 17 | title: 'Hungry Bear Studio Gatsby West Egg Theme', 18 | description: 'West egg gatsby theme package. Comes with style theme, stripe cart theme, mdx blog and core themes. You can shadow any component if you want to edit how it works, or you can just import them and put them to use!', 19 | author: 'Hungry Bear Studio', 20 | twitter: '@studio_hungry', 21 | siteUrl: 'http://localhost:8000' 22 | } 23 | }, 24 | 'gatsby-theme-west-egg-style' 25 | ], 26 | plugins: [ 27 | // { 28 | // resolve: "gatsby-plugin-page-creator", 29 | // options: { 30 | // path: path.join(__dirname, "src", "pages"), 31 | // }, 32 | // }, 33 | // { 34 | // resolve: 'gatsby-plugin-compile-es6-packages', 35 | // options: { 36 | // modules: [pkg.name] 37 | // } 38 | // }, 39 | 'gatsby-plugin-emotion', 40 | 'gatsby-plugin-typescript' 41 | ] 42 | } -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/dist/components/Button.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,GAAG,EAAC,MAAM,eAAe,CAAC;AAClC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,IAAM,gBAAgB,GAAG,GAAG,4IAAA,iEAKlC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,iBAAiB,GAAG,GAAG,0IAAA,+DAKnC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,eAAe,GAAG,GAAG,yIAAA,8DAKjC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,kBAAkB,GAAG,GAAG,6IAAA,kEAKpC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,UAAU,GAAG,GAAG,uKAAA,sCAEL,EAAgB,wCAG3B,EAAgB,UAE5B,KALuB,MAAM,CAAC,SAAS,EAG3B,MAAM,CAAC,SAAS,CAE5B,CAAC;AAEF,MAAM,CAAC,IAAM,YAAY,GAAG,GAAG,yRAAA,+CAET,EAAc,6JAKnC,KALqB,MAAM,CAAC,OAAO,CAKnC,CAAC;AAEF,MAAM,CAAC,IAAM,MAAM,GAAG,GAAG,g8CAAA,6QAeH,EAAgB,ySAahB,EAAc,qFAMzB,EAAc,oTAYrB,EAAU,uHAUQ,EAAY,gDAGvB,EAAc,wDAKpB,EAAgB,2BAGhB,EAAiB,sFAMjB,EAAe,2BAGf,EAAkB,uDAGrB,KAhEoB,MAAM,CAAC,SAAS,EAahB,MAAM,CAAC,OAAO,EAMzB,MAAM,CAAC,OAAO,EAYrB,UAAU,EAUQ,MAAM,CAAC,KAAK,EAGvB,MAAM,CAAC,OAAO,EAKpB,gBAAgB,EAGhB,iBAAiB,EAMjB,eAAe,EAGf,kBAAkB,CAGrB,CAAC;AAWH;;;;;;;GAOG;AACH,gBAAe,UAAC,EAA4C;QAA3C,cAAI,EAAE,oBAAO,EAAE,cAAI,EAAE,sBAAQ;IAAmB,OAAA,CAE/D,6BACE,GAAG,EAAE;YACL,OAAO,EAAE,MAAM;YACf,MAAM,EAAE,QAAQ;SACf;QAED,gCAAQ,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,gBAAc,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM;YAC/F,6BAAK,SAAS,EAAC,QAAQ,GAAE;YACzB,6BAAK,SAAS,EAAC,KAAK;gBAChB,6BAAK,SAAS,EAAC,OAAO,IAAE,IAAI,CAAO;gBACnC,6BAAK,GAAG,EAAE,YAAY,GAAG;gBACzB,6BAAK,GAAG,EAAE,gBAAgB,GAAG;gBAC7B,6BAAK,GAAG,EAAE,YAAY,GAAG;gBACzB,6BAAK,GAAG,EAAE,eAAe,GAAG;gBAC5B,6BAAK,GAAG,EAAE,YAAY,GAAG;gBACzB,6BAAK,GAAG,EAAE,iBAAiB,GAAG;gBAC9B,6BAAK,GAAG,EAAE,YAAY,GAAG;gBACzB,6BAAK,GAAG,EAAE,kBAAkB,GAAG,CAC7B,CACD,CACL,CACP;AAvBgE,CAuBhE,EAAC"} -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg/gatsby-config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const pkg = require('./package.json'); 3 | 4 | module.exports = (options) => { 5 | const { 6 | STRIPE_API_KEY, 7 | STRIPE_SECRET_KEY, 8 | title, 9 | description, 10 | author, 11 | twitter, 12 | siteUrl 13 | } = options; 14 | 15 | return { 16 | __experimentalThemes: [ 17 | 'gatsby-theme-west-egg-style', 18 | 'gatsby-theme-west-egg-blog', 19 | { 20 | resolve: 'gatsby-theme-west-egg-core', 21 | options: { 22 | title, 23 | description, 24 | author, 25 | siteUrl, 26 | twitter 27 | } 28 | }, 29 | { 30 | resolve: 'gatsby-theme-west-egg-stripe-cart', 31 | options: { 32 | STRIPE_API_KEY, 33 | STRIPE_SECRET_KEY, 34 | siteUrl 35 | } 36 | } 37 | ], 38 | plugins: [ 39 | { 40 | resolve: 'gatsby-plugin-page-creator', 41 | options: { 42 | path: `${__dirname}/src/pages` 43 | } 44 | }, 45 | { 46 | resolve: 'gatsby-source-filesystem', 47 | options: { 48 | name: 'blog', 49 | path: 'blog' 50 | } 51 | }, 52 | { 53 | resolve: 'gatsby-plugin-google-fonts', 54 | options: { 55 | fonts: [ 56 | `Montserrat`, 57 | `source sans pro\:300,400,400i,700` 58 | ] 59 | } 60 | }, 61 | { 62 | resolve: 'gatsby-plugin-compile-es6-packages', 63 | options: { 64 | modules: [pkg.name] 65 | } 66 | }, 67 | ] 68 | } 69 | } -------------------------------------------------------------------------------- /site/.cache/api-runner-browser.js: -------------------------------------------------------------------------------- 1 | const plugins = require(`./api-runner-browser-plugins`) 2 | const { 3 | getResourcesForPathname, 4 | getResourcesForPathnameSync, 5 | getResourceURLsForPathname, 6 | } = require(`./loader`).publicLoader 7 | 8 | exports.apiRunner = (api, args = {}, defaultReturn, argTransform) => { 9 | // Hooks for gatsby-cypress's API handler 10 | if (process.env.CYPRESS_SUPPORT) { 11 | if (window.___apiHandler) { 12 | window.___apiHandler(api) 13 | } else if (window.___resolvedAPIs) { 14 | window.___resolvedAPIs.push(api) 15 | } else { 16 | window.___resolvedAPIs = [api] 17 | } 18 | } 19 | 20 | let results = plugins.map(plugin => { 21 | if (!plugin.plugin[api]) { 22 | return undefined 23 | } 24 | 25 | args.getResourcesForPathnameSync = getResourcesForPathnameSync 26 | args.getResourcesForPathname = getResourcesForPathname 27 | args.getResourceURLsForPathname = getResourceURLsForPathname 28 | 29 | const result = plugin.plugin[api](args, plugin.options) 30 | if (result && argTransform) { 31 | args = argTransform({ args, result, plugin }) 32 | } 33 | return result 34 | }) 35 | 36 | // Filter out undefined results. 37 | results = results.filter(result => typeof result !== `undefined`) 38 | 39 | if (results.length > 0) { 40 | return results 41 | } else if (defaultReturn) { 42 | return [defaultReturn] 43 | } else { 44 | return [] 45 | } 46 | } 47 | 48 | exports.apiRunnerAsync = (api, args, defaultReturn) => 49 | plugins.reduce( 50 | (previous, next) => 51 | next.plugin[api] 52 | ? previous.then(() => next.plugin[api](args, next.options)) 53 | : previous, 54 | Promise.resolve() 55 | ) 56 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/src/components/Box.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { jsx, css } from '@emotion/core' 3 | import colors from '../utils/colors'; 4 | 5 | export interface BoxProps { 6 | noBackground?: boolean; 7 | noBorder?: boolean; 8 | children: React.ReactNode; 9 | color?: string; 10 | height?: string; 11 | width?: string; 12 | rounded?: boolean; 13 | } 14 | 15 | /** 16 | * A configurable box 17 | * @param noBackground Choose if the box should have no background color 18 | * @param noBorder Choose if the box should have no border 19 | * @param color Supply your own color for the background 20 | * @param height Optional box height 21 | * @param width Optional box width 22 | * @param children The contents of the box 23 | * @param rounded Give the box rounded corners 24 | */ 25 | export default ({ children, noBackground, noBorder, color, height, width, rounded }: BoxProps) => { 26 | return ( 27 |
55 |
56 |
{children}
57 |
58 | ); 59 | }; 60 | -------------------------------------------------------------------------------- /site/.cache/commonjs/page-renderer.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 4 | 5 | var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); 6 | 7 | exports.__esModule = true; 8 | exports.default = void 0; 9 | 10 | var _react = _interopRequireWildcard(require("react")); 11 | 12 | var _propTypes = _interopRequireDefault(require("prop-types")); 13 | 14 | var _loader = require("./loader"); 15 | 16 | var _apiRunnerBrowser = require("./api-runner-browser"); 17 | 18 | // Renders page 19 | class PageRenderer extends _react.default.Component { 20 | render() { 21 | const props = Object.assign({}, this.props, { 22 | pathContext: this.props.pageContext 23 | }); 24 | 25 | const _apiRunner = (0, _apiRunnerBrowser.apiRunner)(`replaceComponentRenderer`, { 26 | props: this.props, 27 | loader: _loader.publicLoader 28 | }), 29 | replacementElement = _apiRunner[0]; 30 | 31 | const pageElement = replacementElement || (0, _react.createElement)(this.props.pageResources.component, Object.assign({}, props, { 32 | key: this.props.pageResources.page.path 33 | })); 34 | const wrappedPage = (0, _apiRunnerBrowser.apiRunner)(`wrapPageElement`, { 35 | element: pageElement, 36 | props 37 | }, pageElement, ({ 38 | result 39 | }) => { 40 | return { 41 | element: result, 42 | props 43 | }; 44 | }).pop(); 45 | return wrappedPage; 46 | } 47 | 48 | } 49 | 50 | PageRenderer.propTypes = { 51 | location: _propTypes.default.object.isRequired, 52 | pageResources: _propTypes.default.object.isRequired, 53 | data: _propTypes.default.object, 54 | pageContext: _propTypes.default.object.isRequired 55 | }; 56 | var _default = PageRenderer; 57 | exports.default = _default; -------------------------------------------------------------------------------- /site/.cache/commonjs/find-page.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 4 | 5 | exports.__esModule = true; 6 | exports.default = void 0; 7 | 8 | var _utils = require("@reach/router/lib/utils"); 9 | 10 | var _stripPrefix = _interopRequireDefault(require("./strip-prefix")); 11 | 12 | // TODO add tests especially for handling prefixed links. 13 | const pageCache = {}; 14 | 15 | var _default = (pages, pathPrefix = ``) => rawPathname => { 16 | let pathname = decodeURIComponent(rawPathname); // Remove the pathPrefix from the pathname. 17 | 18 | let trimmedPathname = (0, _stripPrefix.default)(pathname, pathPrefix); // Remove any hashfragment 19 | 20 | if (trimmedPathname.split(`#`).length > 1) { 21 | trimmedPathname = trimmedPathname.split(`#`).slice(0, -1).join(``); 22 | } // Remove search query 23 | 24 | 25 | if (trimmedPathname.split(`?`).length > 1) { 26 | trimmedPathname = trimmedPathname.split(`?`).slice(0, -1).join(``); 27 | } 28 | 29 | if (pageCache[trimmedPathname]) { 30 | return pageCache[trimmedPathname]; 31 | } 32 | 33 | let foundPage; // Array.prototype.find is not supported in IE so we use this somewhat odd 34 | // work around. 35 | 36 | pages.some(page => { 37 | let pathToMatch = page.matchPath ? page.matchPath : page.path; 38 | 39 | if ((0, _utils.match)(pathToMatch, trimmedPathname)) { 40 | foundPage = page; 41 | pageCache[trimmedPathname] = page; 42 | return true; 43 | } // Finally, try and match request with default document. 44 | 45 | 46 | if ((0, _utils.match)(`${page.path}index.html`, trimmedPathname)) { 47 | foundPage = page; 48 | pageCache[trimmedPathname] = page; 49 | return true; 50 | } 51 | 52 | return false; 53 | }); 54 | return foundPage; 55 | }; 56 | 57 | exports.default = _default; -------------------------------------------------------------------------------- /site/.cache/commonjs/api-runner-browser.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const plugins = require(`./api-runner-browser-plugins`); 4 | 5 | const _require$publicLoader = require(`./loader`).publicLoader, 6 | getResourcesForPathname = _require$publicLoader.getResourcesForPathname, 7 | getResourcesForPathnameSync = _require$publicLoader.getResourcesForPathnameSync, 8 | getResourceURLsForPathname = _require$publicLoader.getResourceURLsForPathname; 9 | 10 | exports.apiRunner = (api, args = {}, defaultReturn, argTransform) => { 11 | // Hooks for gatsby-cypress's API handler 12 | if (process.env.CYPRESS_SUPPORT) { 13 | if (window.___apiHandler) { 14 | window.___apiHandler(api); 15 | } else if (window.___resolvedAPIs) { 16 | window.___resolvedAPIs.push(api); 17 | } else { 18 | window.___resolvedAPIs = [api]; 19 | } 20 | } 21 | 22 | let results = plugins.map(plugin => { 23 | if (!plugin.plugin[api]) { 24 | return undefined; 25 | } 26 | 27 | args.getResourcesForPathnameSync = getResourcesForPathnameSync; 28 | args.getResourcesForPathname = getResourcesForPathname; 29 | args.getResourceURLsForPathname = getResourceURLsForPathname; 30 | const result = plugin.plugin[api](args, plugin.options); 31 | 32 | if (result && argTransform) { 33 | args = argTransform({ 34 | args, 35 | result, 36 | plugin 37 | }); 38 | } 39 | 40 | return result; 41 | }); // Filter out undefined results. 42 | 43 | results = results.filter(result => typeof result !== `undefined`); 44 | 45 | if (results.length > 0) { 46 | return results; 47 | } else if (defaultReturn) { 48 | return [defaultReturn]; 49 | } else { 50 | return []; 51 | } 52 | }; 53 | 54 | exports.apiRunnerAsync = (api, args, defaultReturn) => plugins.reduce((previous, next) => next.plugin[api] ? previous.then(() => next.plugin[api](args, next.options)) : previous, Promise.resolve()); -------------------------------------------------------------------------------- /site/.cache/__tests__/error-overlay-handler.js: -------------------------------------------------------------------------------- 1 | import "@babel/polyfill" 2 | const { 3 | reportError, 4 | clearError, 5 | errorMap, 6 | } = require(`../error-overlay-handler`) 7 | 8 | import * as ErrorOverlay from "react-error-overlay" 9 | 10 | jest.mock(`react-error-overlay`, () => { 11 | return { 12 | reportBuildError: jest.fn(), 13 | dismissBuildError: jest.fn(), 14 | startReportingRuntimeErrors: jest.fn(), 15 | setEditorHandler: jest.fn(), 16 | } 17 | }) 18 | 19 | beforeEach(() => { 20 | ErrorOverlay.reportBuildError.mockClear() 21 | ErrorOverlay.dismissBuildError.mockClear() 22 | }) 23 | 24 | describe(`errorOverlayHandler`, () => { 25 | describe(`clearError()`, () => { 26 | beforeEach(() => { 27 | reportError(`foo`, `error`) 28 | reportError(`bar`, `error`) 29 | }) 30 | afterAll(() => { 31 | clearError(`foo`) 32 | clearError(`bar`) 33 | }) 34 | it(`should clear specific error type`, () => { 35 | expect(Object.keys(errorMap)).toHaveLength(2) 36 | clearError(`foo`) 37 | expect(Object.keys(errorMap)).toHaveLength(1) 38 | expect(ErrorOverlay.dismissBuildError).not.toHaveBeenCalled() 39 | }) 40 | 41 | it(`should call ErrorOverlay to dismiss build errors`, () => { 42 | clearError(`foo`) 43 | clearError(`bar`) 44 | expect(ErrorOverlay.dismissBuildError).toHaveBeenCalled() 45 | }) 46 | }) 47 | describe(`reportErrorOverlay()`, () => { 48 | it(`should not add error if it's empty and not call ErrorOverlay`, () => { 49 | reportError(`foo`, null) 50 | expect(Object.keys(errorMap)).toHaveLength(0) 51 | expect(ErrorOverlay.reportBuildError).not.toHaveBeenCalled() 52 | }) 53 | it(`should add error if it has a truthy value and call ErrorOverlay`, () => { 54 | reportError(`foo`, `bar`) 55 | expect(Object.keys(errorMap)).toHaveLength(1) 56 | expect(ErrorOverlay.reportBuildError).toHaveBeenCalled() 57 | }) 58 | }) 59 | }) 60 | -------------------------------------------------------------------------------- /site/public/static/d/73/path---blog-index-201-2c5-6xrNRK5rBfqAwq3hMe4DwBluAaU.json: -------------------------------------------------------------------------------- 1 | {"data":{"allMdx":{"edges":[{"node":{"id":"174bbb13-0db6-56c8-8a4f-6215e81de398","excerpt":"My first post about nothing Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore…","frontmatter":{"title":"Post 1","author":"Rich Haines","date":"2019-05-28"},"fields":{"slug":"/blog/post1/"}}},{"node":{"id":"f37765e5-31ac-5363-af43-cf74e94972d3","excerpt":"My third post about nothing!! Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore…","frontmatter":{"title":"Post 3","author":"Rich Haines","date":"2019-05-28"},"fields":{"slug":"/blog/post3/"}}},{"node":{"id":"c4dff721-17f7-5e57-836a-456634bff041","excerpt":"My second post about nothing Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore…","frontmatter":{"title":"Post 2","author":"Rich Haines","date":"2019-05-28"},"fields":{"slug":"/blog/post2/"}}},{"node":{"id":"e762d1e2-ffef-5746-9ef2-b2df31d74929","excerpt":"My forth post about nothing! Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore…","frontmatter":{"title":"Post 4","author":"Rich Haines","date":"2019-05-28"},"fields":{"slug":"/blog/post4/"}}},{"node":{"id":"f8ea507a-7d2e-571f-bc6b-63b2f4c6b6f2","excerpt":"This is post number 6! Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna…","frontmatter":{"title":"Post 6","author":"Rich Haines","date":"2019-05-28"},"fields":{"slug":"/blog/post6/"}}},{"node":{"id":"d5cd3a30-0dca-5170-a6c0-2aca62951b4d","excerpt":"This is post number 5! Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna…","frontmatter":{"title":"Post 5","author":"Rich Haines","date":"2019-05-28"},"fields":{"slug":"/blog/post5/"}}}]}},"pageContext":{"isCreatedByStatefulCreatePages":true}} -------------------------------------------------------------------------------- /site/.cache/prefetch.js: -------------------------------------------------------------------------------- 1 | const support = function(feature) { 2 | if (typeof document === `undefined`) { 3 | return false 4 | } 5 | const fakeLink = document.createElement(`link`) 6 | try { 7 | if (fakeLink.relList && typeof fakeLink.relList.supports === `function`) { 8 | return fakeLink.relList.supports(feature) 9 | } 10 | } catch (err) { 11 | return false 12 | } 13 | return false 14 | } 15 | 16 | const linkPrefetchStrategy = function(url) { 17 | return new Promise((resolve, reject) => { 18 | if (typeof document === `undefined`) { 19 | reject() 20 | return 21 | } 22 | 23 | const link = document.createElement(`link`) 24 | link.setAttribute(`rel`, `prefetch`) 25 | link.setAttribute(`href`, url) 26 | 27 | link.onload = resolve 28 | link.onerror = reject 29 | 30 | const parentElement = 31 | document.getElementsByTagName(`head`)[0] || 32 | document.getElementsByName(`script`)[0].parentNode 33 | parentElement.appendChild(link) 34 | }) 35 | } 36 | 37 | const xhrPrefetchStrategy = function(url) { 38 | return new Promise((resolve, reject) => { 39 | const req = new XMLHttpRequest() 40 | req.open(`GET`, url, true) 41 | req.withCredentials = true 42 | 43 | req.onload = () => { 44 | if (req.status === 200) { 45 | resolve() 46 | } else { 47 | reject() 48 | } 49 | } 50 | 51 | req.send(null) 52 | }) 53 | } 54 | 55 | const supportedPrefetchStrategy = support(`prefetch`) 56 | ? linkPrefetchStrategy 57 | : xhrPrefetchStrategy 58 | 59 | const preFetched = {} 60 | 61 | const prefetch = function(url) { 62 | return new Promise(resolve => { 63 | if (preFetched[url]) { 64 | resolve() 65 | return 66 | } 67 | 68 | supportedPrefetchStrategy(url) 69 | .then(() => { 70 | resolve() 71 | preFetched[url] = true 72 | }) 73 | .catch(() => {}) // 404s are logged to the console anyway 74 | }) 75 | } 76 | 77 | export default prefetch 78 | -------------------------------------------------------------------------------- /site/.cache/async-requires.js: -------------------------------------------------------------------------------- 1 | // prefer default export if available 2 | const preferDefault = m => m && m.default || m 3 | 4 | exports.components = { 5 | "component---packages-gatsby-theme-west-egg-src-components-posts-page-layout-tsx": () => import("D:\\HUNGRYBEARSTUDIO\\GATSBY-THEMES\\gastby-theme-west-egg\\packages\\gatsby-theme-west-egg\\src\\components\\posts-page-layout.tsx" /* webpackChunkName: "component---packages-gatsby-theme-west-egg-src-components-posts-page-layout-tsx" */), 6 | "component---cache-dev-404-page-js": () => import("D:\\HUNGRYBEARSTUDIO\\GATSBY-THEMES\\gastby-theme-west-egg\\site\\.cache\\dev-404-page.js" /* webpackChunkName: "component---cache-dev-404-page-js" */), 7 | "component---packages-gatsby-theme-west-egg-src-pages-index-tsx": () => import("D:\\HUNGRYBEARSTUDIO\\GATSBY-THEMES\\gastby-theme-west-egg\\packages\\gatsby-theme-west-egg\\src\\pages\\index.tsx" /* webpackChunkName: "component---packages-gatsby-theme-west-egg-src-pages-index-tsx" */), 8 | "component---packages-gatsby-theme-west-egg-src-pages-checkout-canceled-tsx": () => import("D:\\HUNGRYBEARSTUDIO\\GATSBY-THEMES\\gastby-theme-west-egg\\packages\\gatsby-theme-west-egg\\src\\pages\\checkout\\canceled.tsx" /* webpackChunkName: "component---packages-gatsby-theme-west-egg-src-pages-checkout-canceled-tsx" */), 9 | "component---packages-gatsby-theme-west-egg-src-pages-checkout-success-tsx": () => import("D:\\HUNGRYBEARSTUDIO\\GATSBY-THEMES\\gastby-theme-west-egg\\packages\\gatsby-theme-west-egg\\src\\pages\\checkout\\success.tsx" /* webpackChunkName: "component---packages-gatsby-theme-west-egg-src-pages-checkout-success-tsx" */), 10 | "component---packages-gatsby-theme-west-egg-src-pages-blog-index-tsx": () => import("D:\\HUNGRYBEARSTUDIO\\GATSBY-THEMES\\gastby-theme-west-egg\\packages\\gatsby-theme-west-egg\\src\\pages\\blogIndex.tsx" /* webpackChunkName: "component---packages-gatsby-theme-west-egg-src-pages-blog-index-tsx" */) 11 | } 12 | 13 | exports.data = () => import(/* webpackChunkName: "pages-manifest" */ "D:\\HUNGRYBEARSTUDIO\\GATSBY-THEMES\\gastby-theme-west-egg\\site\\.cache\\data.json") 14 | 15 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg/src/pages/blogIndex.tsx: -------------------------------------------------------------------------------- 1 | // src/pages/index.js 2 | import * as React from 'react' 3 | import { Link, graphql } from 'gatsby' 4 | import { Container, Header, Text, Box, Grid, Hero, Button, Content, Footer } from 'gatsby-theme-west-egg-style'; 5 | import colors from 'gatsby-theme-west-egg-style/src/utils/colors'; 6 | 7 | const layout = `display: grid; 8 | grid-template-columns: .2fr 2fr .2fr; 9 | grid-template-rows: .5fr 1fr 1fr; 10 | 11 | grid-template-areas: 12 | ". header ." 13 | ". hero ."; 14 | 15 | height: 100vh; 16 | margin: 1rem; 17 | grid-gap: 2rem;` 18 | 19 | const isOdd = (number: number) => number % 2; 20 | 21 | const BlogIndex = ({ data }: any) => { 22 | const { edges: posts } = data.allMdx 23 | 24 | const blogs = posts.map(({ node: post }: any, index: number) => ( 25 | 26 | 27 | {post.frontmatter.title} 28 | 29 |
30 | {post.frontmatter.author} - {post.frontmatter.date} 31 |
32 |
33 | )); 34 | 35 | return ( 36 | 37 |
38 | 39 | West Egg Blog 40 | 41 | 42 |
45 | 46 | 47 | 48 |
49 | ) 50 | } 51 | export const pageQuery = graphql` 52 | query blogIndex { 53 | allMdx { 54 | edges { 55 | node { 56 | id 57 | excerpt 58 | frontmatter { 59 | title 60 | author 61 | date 62 | } 63 | fields { 64 | slug 65 | } 66 | } 67 | } 68 | } 69 | } 70 | ` 71 | export default BlogIndex -------------------------------------------------------------------------------- /site/.cache/commonjs/prefetch.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | exports.__esModule = true; 4 | exports.default = void 0; 5 | 6 | const support = function support(feature) { 7 | if (typeof document === `undefined`) { 8 | return false; 9 | } 10 | 11 | const fakeLink = document.createElement(`link`); 12 | 13 | try { 14 | if (fakeLink.relList && typeof fakeLink.relList.supports === `function`) { 15 | return fakeLink.relList.supports(feature); 16 | } 17 | } catch (err) { 18 | return false; 19 | } 20 | 21 | return false; 22 | }; 23 | 24 | const linkPrefetchStrategy = function linkPrefetchStrategy(url) { 25 | return new Promise((resolve, reject) => { 26 | if (typeof document === `undefined`) { 27 | reject(); 28 | return; 29 | } 30 | 31 | const link = document.createElement(`link`); 32 | link.setAttribute(`rel`, `prefetch`); 33 | link.setAttribute(`href`, url); 34 | link.onload = resolve; 35 | link.onerror = reject; 36 | const parentElement = document.getElementsByTagName(`head`)[0] || document.getElementsByName(`script`)[0].parentNode; 37 | parentElement.appendChild(link); 38 | }); 39 | }; 40 | 41 | const xhrPrefetchStrategy = function xhrPrefetchStrategy(url) { 42 | return new Promise((resolve, reject) => { 43 | const req = new XMLHttpRequest(); 44 | req.open(`GET`, url, true); 45 | req.withCredentials = true; 46 | 47 | req.onload = () => { 48 | if (req.status === 200) { 49 | resolve(); 50 | } else { 51 | reject(); 52 | } 53 | }; 54 | 55 | req.send(null); 56 | }); 57 | }; 58 | 59 | const supportedPrefetchStrategy = support(`prefetch`) ? linkPrefetchStrategy : xhrPrefetchStrategy; 60 | const preFetched = {}; 61 | 62 | const prefetch = function prefetch(url) { 63 | return new Promise(resolve => { 64 | if (preFetched[url]) { 65 | resolve(); 66 | return; 67 | } 68 | 69 | supportedPrefetchStrategy(url).then(() => { 70 | resolve(); 71 | preFetched[url] = true; 72 | }).catch(() => {}); // 404s are logged to the console anyway 73 | }); 74 | }; 75 | 76 | var _default = prefetch; 77 | exports.default = _default; -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-stripe-cart/README.md: -------------------------------------------------------------------------------- 1 | # gatsby-theme-west-egg-stripe-cart 2 | 3 | A Gatsby theme for a stripe checkout. Register an account at [Stripe](https://stripe.com/en-se) 4 | 5 | Add to your Gatsby sites gatsby-config.js just like you would with a plugin. The `STRIPE_API_KEY`, `STRIPE_SECRET_KEY` and `siteUrl` are passed in as options from the consuming theme. 6 | 7 | ``` 8 | module.exports = { 9 | 10 | __experimentalThemes: [ 11 | 'gatsby-theme-west-egg-style', 12 | { 13 | resolve: 'gatsby-theme-west-egg-stripe-cart', 14 | options: { 15 | STRIPE_API_KEY, 16 | STRIPE_SECRET_KEY, 17 | siteUrl 18 | } 19 | } 20 | ], 21 | } 22 | ``` 23 | 24 | Example usage: 25 | 26 | ``` 27 | import { StripeCheckout } from 'gatsby-theme-west-egg-stripe-cart'; 28 | 29 | } 31 | sku='sku_123' 32 | quantity={1} 33 | /> 34 | ``` 35 | 36 | The component takes a custom button as its form submit which enables you to style it which ever way you wish, it only requires that you provide its type as 'submit'. 37 | 38 | In addition the component requires you to provide the products sku (which can be taken from your products in your stripe dashboard) and the quantity of items to purchase. 39 | 40 | Once the user clicks the button to make a purchase they are redirected to the stripe checkout where they can fill out their card details and complete their purchase. Upon completion the user is redirected back to your gatsby site. 41 | 42 | This theme provides two base components (success/canceled) which you should shadow and style yourself. These components should be placed in a checkout folder inside your src/pages folder: 43 | 44 | ``` 45 | src/pages/checkout/success 46 | src/pages/checkout/canceled 47 | ``` 48 | 49 | Current status: WIP 50 | 51 | ## Built With 52 | 53 | - [Gatbsy](https://www.gatsbyjs.org/) 54 | - [Stripe](https://stripe.com/en-se) 55 | - [TypeScript](https://www.typescriptlang.org/) 56 | 57 | ## Authors 58 | 59 | - **Rich Haines** - _Hungry Bear Studio_ 60 | 61 | ## License 62 | 63 | This project is licensed under the MIT License 64 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-sanity/sanity-studio/schemas/blockContent.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is the schema definition for the rich text fields used for 3 | * for this blog studio. When you import it in schemas.js it can be 4 | * reused in other parts of the studio with: 5 | * { 6 | * name: 'someName', 7 | * title: 'Some title', 8 | * type: 'blockContent' 9 | * } 10 | */ 11 | export default { 12 | title: 'Block Content', 13 | name: 'blockContent', 14 | type: 'array', 15 | of: [ 16 | { 17 | title: 'Block', 18 | type: 'block', 19 | // Styles let you set what your user can mark up blocks with. These 20 | // corrensponds with HTML tags, but you can set any title or value 21 | // you want and decide how you want to deal with it where you want to 22 | // use your content. 23 | styles: [ 24 | {title: 'Normal', value: 'normal'}, 25 | {title: 'H1', value: 'h1'}, 26 | {title: 'H2', value: 'h2'}, 27 | {title: 'H3', value: 'h3'}, 28 | {title: 'H4', value: 'h4'}, 29 | {title: 'Quote', value: 'blockquote'} 30 | ], 31 | lists: [{title: 'Bullet', value: 'bullet'}], 32 | // Marks let you mark up inline text in the block editor. 33 | marks: { 34 | // Decorators usually describe a single property – e.g. a typographic 35 | // preference or highlighting by editors. 36 | decorators: [{title: 'Strong', value: 'strong'}, {title: 'Emphasis', value: 'em'}], 37 | // Annotations can be any object structure – e.g. a link or a footnote. 38 | annotations: [ 39 | { 40 | title: 'URL', 41 | name: 'link', 42 | type: 'object', 43 | fields: [ 44 | { 45 | title: 'URL', 46 | name: 'href', 47 | type: 'url' 48 | } 49 | ] 50 | } 51 | ] 52 | } 53 | }, 54 | // You can add additional types here. Note that you can't use 55 | // primitive types such as 'string' and 'number' in the same array 56 | // as a block type. 57 | { 58 | type: 'image', 59 | options: {hotspot: true} 60 | } 61 | ] 62 | } 63 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg/gatsby-node.js: -------------------------------------------------------------------------------- 1 | // gatsby-node.js 2 | const { createFilePath } = require("gatsby-source-filesystem"); 3 | // in gatsby-node.js 4 | const path = require("path"); 5 | 6 | // Here we're adding extra stuff to the "node" (like the slug) 7 | // so we can query later for all blogs and get their slug 8 | exports.onCreateNode = ({ node, actions, getNode }) => { 9 | const { createNodeField } = actions 10 | if (node.internal.type === 'Mdx') { 11 | const value = createFilePath({ node, getNode }) 12 | createNodeField({ 13 | // Individual MDX node 14 | node, 15 | // Name of the field you are adding 16 | name: 'slug', 17 | // Generated value based on filepath with "blog" prefix 18 | value: `/blog${value}` 19 | }) 20 | } 21 | } 22 | 23 | exports.createPages = ({ graphql, actions }) => { 24 | // Destructure the createPage function from the actions object 25 | const { createPage } = actions; 26 | return new Promise((resolve, reject) => { 27 | resolve( 28 | graphql( 29 | ` 30 | { 31 | allMdx { 32 | edges { 33 | node { 34 | id 35 | fields { 36 | slug 37 | } 38 | } 39 | } 40 | } 41 | } 42 | ` 43 | ).then(result => { 44 | // this is some boilerlate to handle errors 45 | if (result.errors) { 46 | console.error(result.errors); 47 | reject(result.errors); 48 | } 49 | // We'll call `createPage` for each result 50 | result.data.allMdx.edges.forEach(({ node }) => { 51 | createPage({ 52 | // This is the slug we created before 53 | // (or `node.frontmatter.slug`) 54 | path: node.fields.slug, 55 | // This component will wrap our MDX content 56 | component: require.resolve(`./src/components/posts-page-layout.tsx`), 57 | // We can use the values in this context in 58 | // our page layout component 59 | context: { id: node.id } 60 | }); 61 | }); 62 | }) 63 | ); 64 | }); 65 | }; -------------------------------------------------------------------------------- /site/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "site", 3 | "version": "0.0.1", 4 | "description": "An exmaple site combining the themes", 5 | "main": "gatsby-config.js", 6 | "license": "MIT", 7 | "keywords": [ 8 | "gatsby", 9 | "gatsby-theme", 10 | "react" 11 | ], 12 | "scripts": { 13 | "develop": "gatsby develop", 14 | "build": "gatsby build", 15 | "clean": "gatsby clean", 16 | "lint": "./node_modules/.bin/eslint \"src/**/*.{ts,tsx,js}\"", 17 | "eslint-check-rules": "./node_modules/.bin/eslint --print-config . | eslint-config-prettier-check", 18 | "pretty-check": "prettier --check \"src/**/*.{ts,tsx,js}\"", 19 | "pretty": "prettier --write \"src/**/*.{ts,tsx,js}\"" 20 | }, 21 | "husky": { 22 | "hooks": { 23 | "pre-push": "yarn lint && pretty", 24 | "pre-commit": "lint-staged" 25 | } 26 | }, 27 | "lint-staged": { 28 | "src/**/*.{js,ts,tsx}": [ 29 | "yarn pretty-check", 30 | "git add" 31 | ] 32 | }, 33 | "dependencies": { 34 | "@emotion/core": "^10.0.10", 35 | "@emotion/styled": "^10.0.10", 36 | "gatsby": "^2.4.2", 37 | "gatsby-plugin-compile-es6-packages": "^1.1.0", 38 | "gatsby-plugin-emotion": "^4.0.6", 39 | "gatsby-plugin-page-creator": "^2.0.12", 40 | "gatsby-plugin-typescript": "^2.0.13", 41 | "gatsby-theme-west-egg": "*", 42 | "gatsby-theme-west-egg-style": "*", 43 | "react": "^16.8.6", 44 | "react-dom": "^16.8.6" 45 | }, 46 | "devDependencies": { 47 | "@types/react": "^16.8.17", 48 | "@types/react-dom": "^16.8.4", 49 | "@typescript-eslint/eslint-plugin": "^1.7.0", 50 | "@typescript-eslint/parser": "^1.7.0", 51 | "eslint": "^5.16.0", 52 | "eslint-config-prettier": "^4.2.0", 53 | "eslint-loader": "^2.1.2", 54 | "eslint-plugin-import": "^2.17.2", 55 | "eslint-plugin-no-null": "^1.0.2", 56 | "eslint-plugin-prefer-arrow": "^1.1.5", 57 | "eslint-plugin-prettier": "^3.0.1", 58 | "eslint-plugin-promise": "^4.1.1", 59 | "eslint-plugin-react": "^7.13.0", 60 | "eslint-plugin-react-hooks": "^1.6.0", 61 | "husky": "^2.2.0", 62 | "lint-staged": "^8.1.6", 63 | "prettier": "^1.17.0", 64 | "typescript": "^3.4.5" 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /site/.cache/__tests__/find-page.js: -------------------------------------------------------------------------------- 1 | const pageFinderFactory = require(`../find-page`).default 2 | 3 | let findPage 4 | 5 | describe(`find-page`, () => { 6 | beforeEach(() => { 7 | const newPages = [ 8 | { 9 | path: `/about/`, 10 | componentChunkName: `page-component---src-pages-test-js`, 11 | jsonName: `about.json`, 12 | }, 13 | { 14 | path: `/about/me/`, 15 | componentChunkName: `page-component---src-pages-test-js`, 16 | jsonName: `about-me.json`, 17 | }, 18 | { 19 | path: `/about/the best/`, 20 | componentChunkName: `page-component---src-pages-test-js`, 21 | jsonName: `the-best.json`, 22 | }, 23 | { 24 | path: `/app/`, 25 | matchPath: `/app/*`, 26 | componentChunkName: `page-component---src-pages-app-js`, 27 | jsonName: `app.json`, 28 | }, 29 | ] 30 | findPage = pageFinderFactory(newPages) 31 | }) 32 | 33 | it(`can find a page`, () => { 34 | expect(findPage(`/about/`).path).toBe(`/about/`) 35 | expect(findPage(`/about/me/`).path).toBe(`/about/me/`) 36 | }) 37 | 38 | it(`can find a page with space in its path`, () => { 39 | expect(findPage(`/about/the best/`).path).toBe(`/about/the best/`) 40 | expect(findPage(`/about/the%20best/`).path).toBe(`/about/the best/`) 41 | }) 42 | 43 | it(`can find a client only path`, () => { 44 | expect(findPage(`/about/super-duper/`)).toBeUndefined() 45 | expect(findPage(`/app/client/only/path`).path).toBe(`/app/`) 46 | }) 47 | 48 | it(`can find links with hashes`, () => { 49 | expect(findPage(`/about/me/#hashtagawesome`).path).toBe(`/about/me/`) 50 | }) 51 | 52 | it(`can find links with search query`, () => { 53 | expect(findPage(`/about/me/?query=awesome`).path).toBe(`/about/me/`) 54 | }) 55 | 56 | it(`handles finding prefixed links`, () => { 57 | const newPages = [ 58 | { 59 | path: `/about/`, 60 | componentChunkName: `page-component---src-pages-test-js`, 61 | jsonName: `about.json`, 62 | }, 63 | ] 64 | const findPage2 = pageFinderFactory(newPages, `/my-test-prefix`) 65 | expect(findPage2(`/my-test-prefix/about/`).path).toBe(`/about/`) 66 | }) 67 | }) 68 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-stripe-cart/src/components/StripeCheckout.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import {MetadataContext, MetadataProvider} from '../utils/MetadataProvider'; 3 | 4 | interface Stripe { 5 | button: JSX.Element; 6 | sku: string; 7 | quantity: number; 8 | } 9 | 10 | const StripeButton = ({ button, sku, quantity }: Stripe) => { 11 | const metadata = React.useContext(MetadataContext); 12 | 13 | if (!metadata) { 14 | return

make an error component to handle this stuff

; 15 | } 16 | 17 | let stripe: any; 18 | const { STRIPE_API_KEY, siteUrl } = metadata; 19 | 20 | React.useEffect(() => { 21 | stripe = Stripe(STRIPE_API_KEY); 22 | }, []); 23 | 24 | return ( 25 |
{ 27 | e.preventDefault(); 28 | stripe && 29 | stripe 30 | .redirectToCheckout({ 31 | items: [{ sku, quantity }], 32 | 33 | // Note that it is not guaranteed your customers will be redirected to this 34 | // URL *100%* of the time, it's possible that they could e.g. close the 35 | // tab between form submission and the redirect. 36 | successUrl: `${siteUrl}/checkout/success`, 37 | cancelUrl: `${siteUrl}/checkout/canceled`, 38 | }) 39 | .then((result: any) => { 40 | console.log({ result }); 41 | if (result.error) { 42 | console.log(result.error.message); 43 | // If `redirectToCheckout` fails due to a browser or network 44 | // error, handle the error -- toast ? 45 | } 46 | }); 47 | }} 48 | > 49 | {button} 50 |
51 | ); 52 | }; 53 | 54 | /** 55 | * A Stripe checkout form. When submitted the user will be redirected to the stripe checkout. 56 | * Upon completion of purchase the user will be redirected back to your website. 57 | * 58 | * @example } sku="sku_123" quantity={1}/> 59 | * @param button A custom button element to submit the form 60 | * @param sku A product stock keeping unit 61 | * @param quantity The quantity to be included in the checkout 62 | */ 63 | export default ({ button, sku, quantity }: Stripe) => ( 64 | 65 | 70 | 71 | ) -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/public/webpack-runtime-4112d92f6d890538b818.js: -------------------------------------------------------------------------------- 1 | !function(e){function r(r){for(var n,i,a=r[0],c=r[1],f=r[2],p=0,s=[];p { 17 | // Hook up the client to socket.io on server 18 | const socket = socketIo() 19 | if (socket) { 20 | socket.on(`reload`, () => { 21 | window.location.reload() 22 | }) 23 | } 24 | 25 | /** 26 | * Service Workers are persistent by nature. They stick around, 27 | * serving a cached version of the site if they aren't removed. 28 | * This is especially frustrating when you need to test the 29 | * production build on your local machine. 30 | * 31 | * Let's warn if we find service workers in development. 32 | */ 33 | if (`serviceWorker` in navigator) { 34 | navigator.serviceWorker.getRegistrations().then(registrations => { 35 | if (registrations.length > 0) 36 | console.warn( 37 | `Warning: found one or more service workers present.`, 38 | `If your site isn't behaving as expected, you might want to remove these.`, 39 | registrations 40 | ) 41 | }) 42 | } 43 | 44 | const rootElement = document.getElementById(`___gatsby`) 45 | 46 | const renderer = apiRunner( 47 | `replaceHydrateFunction`, 48 | undefined, 49 | ReactDOM.render 50 | )[0] 51 | 52 | loader.addPagesArray(pages) 53 | loader.addDevRequires(syncRequires) 54 | Promise.all([ 55 | loader.getResourcesForPathname(`/dev-404-page/`), 56 | loader.getResourcesForPathname(`/404.html`), 57 | loader.getResourcesForPathname(window.location.pathname), 58 | ]).then(() => { 59 | const preferDefault = m => (m && m.default) || m 60 | let Root = preferDefault(require(`./root`)) 61 | domReady(() => { 62 | renderer(, rootElement, () => { 63 | postInitialRenderWork() 64 | apiRunner(`onInitialClientRender`) 65 | }) 66 | }) 67 | }) 68 | }) 69 | -------------------------------------------------------------------------------- /site/.cache/api-runner-ssr.js: -------------------------------------------------------------------------------- 1 | var plugins = [{ 2 | plugin: require('D:/HUNGRYBEARSTUDIO/GATSBY-THEMES/gastby-theme-west-egg/node_modules/gatsby-mdx/gatsby-ssr'), 3 | options: {"plugins":[],"defaultLayouts":{"default":"D:\\HUNGRYBEARSTUDIO\\GATSBY-THEMES\\gastby-theme-west-egg\\packages\\gatsby-theme-west-egg-blog\\src\\components\\posts-page-layout.js"}}, 4 | },{ 5 | plugin: require('D:/HUNGRYBEARSTUDIO/GATSBY-THEMES/gastby-theme-west-egg/node_modules/gatsby-plugin-react-helmet/gatsby-ssr'), 6 | options: {"plugins":[]}, 7 | },{ 8 | plugin: require('D:/HUNGRYBEARSTUDIO/GATSBY-THEMES/gastby-theme-west-egg/node_modules/gatsby-plugin-sitemap/gatsby-ssr'), 9 | options: {"plugins":[]}, 10 | },{ 11 | plugin: require('D:/HUNGRYBEARSTUDIO/GATSBY-THEMES/gastby-theme-west-egg/node_modules/gatsby-plugin-stripe/gatsby-ssr'), 12 | options: {"plugins":[]}, 13 | },{ 14 | plugin: require('D:/HUNGRYBEARSTUDIO/GATSBY-THEMES/gastby-theme-west-egg/node_modules/gatsby-plugin-google-fonts/gatsby-ssr'), 15 | options: {"plugins":[],"fonts":["Montserrat","source sans pro:300,400,400i,700"]}, 16 | }] 17 | // During bootstrap, we write requires at top of this file which looks like: 18 | // var plugins = [ 19 | // { 20 | // plugin: require("/path/to/plugin1/gatsby-ssr.js"), 21 | // options: { ... }, 22 | // }, 23 | // { 24 | // plugin: require("/path/to/plugin2/gatsby-ssr.js"), 25 | // options: { ... }, 26 | // }, 27 | // ] 28 | 29 | const apis = require(`./api-ssr-docs`) 30 | 31 | // Run the specified API in any plugins that have implemented it 32 | module.exports = (api, args, defaultReturn, argTransform) => { 33 | if (!apis[api]) { 34 | console.log(`This API doesn't exist`, api) 35 | } 36 | 37 | // Run each plugin in series. 38 | // eslint-disable-next-line no-undef 39 | let results = plugins.map(plugin => { 40 | if (!plugin.plugin[api]) { 41 | return undefined 42 | } 43 | const result = plugin.plugin[api](args, plugin.options) 44 | if (result && argTransform) { 45 | args = argTransform({ args, result }) 46 | } 47 | return result 48 | }) 49 | 50 | // Filter out undefined results. 51 | results = results.filter(result => typeof result !== `undefined`) 52 | 53 | if (results.length > 0) { 54 | return results 55 | } else { 56 | return [defaultReturn] 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-stripe-cart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gatsby-theme-west-egg-stripe-cart", 3 | "version": "0.0.1", 4 | "description": "A base shopping cart theme", 5 | "main": "./src/index.js", 6 | "types": "./src/@types/gatsby-theme-west-egg-stripe-cart/index.d.ts", 7 | "license": "MIT", 8 | "keywords": [ 9 | "gatsby", 10 | "gatsby-theme", 11 | "react", 12 | "cart", 13 | "ecommerce" 14 | ], 15 | "scripts": { 16 | "develop": "gatsby develop", 17 | "build": "gatsby build", 18 | "clean": "gatsby clean", 19 | "lint": "./node_modules/.bin/eslint \"src/**/*.{ts,tsx,js}\"", 20 | "eslint-check-rules": "./node_modules/.bin/eslint --print-config . | eslint-config-prettier-check", 21 | "pretty-check": "prettier --check \"src/**/*.{ts,tsx,js}\"", 22 | "pretty": "prettier --write \"src/**/*.{ts,tsx,js}\"" 23 | }, 24 | "husky": { 25 | "hooks": { 26 | "pre-push": "yarn lint && yarn pretty", 27 | "pre-commit": "lint-staged" 28 | } 29 | }, 30 | "lint-staged": { 31 | "src/**/*.{js,ts,tsx}": [ 32 | "yarn pretty-check", 33 | "git add" 34 | ] 35 | }, 36 | "devDependencies": { 37 | "@types/react": "^16.8.17", 38 | "@types/react-dom": "^16.8.4", 39 | "@types/stripe-checkout": "^1.0.3", 40 | "@typescript-eslint/eslint-plugin": "^1.8.0", 41 | "@typescript-eslint/parser": "^1.8.0", 42 | "eslint": "^5.16.0", 43 | "eslint-config-prettier": "^4.2.0", 44 | "eslint-loader": "^2.1.2", 45 | "eslint-plugin-import": "^2.17.2", 46 | "eslint-plugin-no-null": "^1.0.2", 47 | "eslint-plugin-prefer-arrow": "^1.1.5", 48 | "eslint-plugin-prettier": "^3.0.1", 49 | "eslint-plugin-promise": "^4.1.1", 50 | "eslint-plugin-react": "^7.13.0", 51 | "eslint-plugin-react-hooks": "^1.6.0", 52 | "gatsby": "^2.4.2", 53 | "husky": "^2.2.0", 54 | "lint-staged": "^8.1.6", 55 | "prettier": "^1.17.0", 56 | "react": "^16.8.6", 57 | "react-dom": "^16.8.6", 58 | "typescript": "^3.4.5" 59 | }, 60 | "peerDependencies": { 61 | "gatsby": "^2.4.2", 62 | "react": "^16.8.6", 63 | "react-dom": "^16.8.6" 64 | }, 65 | "dependencies": { 66 | "gatsby-plugin-compile-es6-packages": "^1.1.0", 67 | "gatsby-plugin-page-creator": "^2.0.12", 68 | "gatsby-plugin-stripe": "^1.2.0", 69 | "gatsby-source-filesystem": "^2.0.36", 70 | "gatsby-source-stripe": "^2.2.2" 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/README.md: -------------------------------------------------------------------------------- 1 | # gatsby-theme-west-egg-style 2 | 3 | A Gatsby theme that provides a set of styled components. 4 | 5 | Add to your Gatsby sites gatsby-config.js just like you would with a plugin. 6 | 7 | ``` 8 | module.exports = { 9 | 10 | __experimentalThemes: ['gatsby-theme-west-egg-style'] 11 | } 12 | ``` 13 | 14 | Example usage: 15 | 16 | ``` 17 | import React from 'react'; 18 | import {Box, Title, Button, Grid, Container, Header, Hero, Content, Footer} from 'gatsby-theme-west-egg-style'; 19 | import colors from 'gatsby-theme-west-egg-style/src/utils/colors'; 20 | 21 | const boxes = [ 22 | 23 | Box 1 24 | , 25 | 26 | Box 2 27 | , 28 |
79 | 80 | 81 | 82 | {description} 83 | 84 | 85 | 86 | 87 | 88 |
89 | 90 | {twitter} 91 | 92 |
93 | 94 | ); 95 | }; 96 | -------------------------------------------------------------------------------- /site/.cache/commonjs/app.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); 4 | 5 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 6 | 7 | var _react = _interopRequireDefault(require("react")); 8 | 9 | var _reactDom = _interopRequireDefault(require("react-dom")); 10 | 11 | var _domready = _interopRequireDefault(require("@mikaelkristiansson/domready")); 12 | 13 | var _socketIo = _interopRequireDefault(require("./socketIo")); 14 | 15 | var _emitter = _interopRequireDefault(require("./emitter")); 16 | 17 | var _apiRunnerBrowser = require("./api-runner-browser"); 18 | 19 | var _loader = _interopRequireWildcard(require("./loader")); 20 | 21 | var _syncRequires = _interopRequireDefault(require("./sync-requires")); 22 | 23 | var _pages = _interopRequireDefault(require("./pages.json")); 24 | 25 | window.___emitter = _emitter.default; 26 | (0, _loader.setApiRunnerForLoader)(_apiRunnerBrowser.apiRunner); // Let the site/plugins run code very early. 27 | 28 | (0, _apiRunnerBrowser.apiRunnerAsync)(`onClientEntry`).then(() => { 29 | // Hook up the client to socket.io on server 30 | const socket = (0, _socketIo.default)(); 31 | 32 | if (socket) { 33 | socket.on(`reload`, () => { 34 | window.location.reload(); 35 | }); 36 | } 37 | /** 38 | * Service Workers are persistent by nature. They stick around, 39 | * serving a cached version of the site if they aren't removed. 40 | * This is especially frustrating when you need to test the 41 | * production build on your local machine. 42 | * 43 | * Let's warn if we find service workers in development. 44 | */ 45 | 46 | 47 | if (`serviceWorker` in navigator) { 48 | navigator.serviceWorker.getRegistrations().then(registrations => { 49 | if (registrations.length > 0) console.warn(`Warning: found one or more service workers present.`, `If your site isn't behaving as expected, you might want to remove these.`, registrations); 50 | }); 51 | } 52 | 53 | const rootElement = document.getElementById(`___gatsby`); 54 | const renderer = (0, _apiRunnerBrowser.apiRunner)(`replaceHydrateFunction`, undefined, _reactDom.default.render)[0]; 55 | 56 | _loader.default.addPagesArray(_pages.default); 57 | 58 | _loader.default.addDevRequires(_syncRequires.default); 59 | 60 | Promise.all([_loader.default.getResourcesForPathname(`/dev-404-page/`), _loader.default.getResourcesForPathname(`/404.html`), _loader.default.getResourcesForPathname(window.location.pathname)]).then(() => { 61 | const preferDefault = m => m && m.default || m; 62 | 63 | let Root = preferDefault(require(`./root`)); 64 | (0, _domready.default)(() => { 65 | renderer(_react.default.createElement(Root, null), rootElement, () => { 66 | (0, _loader.postInitialRenderWork)(); 67 | (0, _apiRunnerBrowser.apiRunner)(`onInitialClientRender`); 68 | }); 69 | }); 70 | }); 71 | }); -------------------------------------------------------------------------------- /site/.cache/register-service-worker.js: -------------------------------------------------------------------------------- 1 | import { apiRunner } from "./api-runner-browser" 2 | 3 | if ( 4 | window.location.protocol !== `https:` && 5 | window.location.hostname !== `localhost` 6 | ) { 7 | console.error( 8 | `Service workers can only be used over HTTPS, or on localhost for development` 9 | ) 10 | } else if (`serviceWorker` in navigator) { 11 | navigator.serviceWorker 12 | .register(`${__BASE_PATH__}/sw.js`) 13 | .then(function(reg) { 14 | reg.addEventListener(`updatefound`, () => { 15 | apiRunner(`onServiceWorkerUpdateFound`, { serviceWorker: reg }) 16 | // The updatefound event implies that reg.installing is set; see 17 | // https://w3c.github.io/ServiceWorker/#service-worker-registration-updatefound-event 18 | const installingWorker = reg.installing 19 | console.log(`installingWorker`, installingWorker) 20 | installingWorker.addEventListener(`statechange`, () => { 21 | switch (installingWorker.state) { 22 | case `installed`: 23 | if (navigator.serviceWorker.controller) { 24 | // At this point, the old content will have been purged and the fresh content will 25 | // have been added to the cache. 26 | 27 | // We set a flag so Gatsby Link knows to refresh the page on next navigation attempt 28 | window.___swUpdated = true 29 | // We call the onServiceWorkerUpdateReady API so users can show update prompts. 30 | apiRunner(`onServiceWorkerUpdateReady`, { serviceWorker: reg }) 31 | 32 | // If resources failed for the current page, reload. 33 | if (window.___failedResources) { 34 | console.log(`resources failed, SW updated - reloading`) 35 | window.location.reload() 36 | } 37 | } else { 38 | // At this point, everything has been precached. 39 | // It's the perfect time to display a "Content is cached for offline use." message. 40 | console.log(`Content is now available offline!`) 41 | 42 | // Post to service worker that install is complete. 43 | // Delay to allow time for the event listener to be added -- 44 | // otherwise fetch is called too soon and resources aren't cached. 45 | apiRunner(`onServiceWorkerInstalled`, { serviceWorker: reg }) 46 | } 47 | break 48 | 49 | case `redundant`: 50 | console.error(`The installing service worker became redundant.`) 51 | apiRunner(`onServiceWorkerRedundant`, { serviceWorker: reg }) 52 | break 53 | 54 | case `activated`: 55 | apiRunner(`onServiceWorkerActive`, { serviceWorker: reg }) 56 | break 57 | } 58 | }) 59 | }) 60 | }) 61 | .catch(function(e) { 62 | console.error(`Error during service worker registration:`, e) 63 | }) 64 | } 65 | -------------------------------------------------------------------------------- /site/.cache/json-store.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | 3 | import PageRenderer from "./page-renderer" 4 | import { StaticQueryContext } from "gatsby" 5 | import { 6 | getStaticQueryData, 7 | getPageQueryData, 8 | registerPath as socketRegisterPath, 9 | unregisterPath as socketUnregisterPath, 10 | } from "./socketIo" 11 | 12 | if (process.env.NODE_ENV === `production`) { 13 | throw new Error( 14 | `It appears like Gatsby is misconfigured. JSONStore is Gatsby internal ` + 15 | `development-only component and should never be used in production.\n\n` + 16 | `Unless your site has a complex or custom webpack/Gatsby ` + 17 | `configuration this is likely a bug in Gatsby. ` + 18 | `Please report this at https://github.com/gatsbyjs/gatsby/issues ` + 19 | `with steps to reproduce this error.` 20 | ) 21 | } 22 | 23 | const getPathFromProps = props => 24 | props.pageResources && props.pageResources.page 25 | ? props.pageResources.page.path 26 | : undefined 27 | 28 | class JSONStore extends React.Component { 29 | constructor(props) { 30 | super(props) 31 | this.state = { 32 | staticQueryData: getStaticQueryData(), 33 | pageQueryData: getPageQueryData(), 34 | path: null, 35 | } 36 | } 37 | 38 | handleMittEvent = (type, event) => { 39 | this.setState({ 40 | staticQueryData: getStaticQueryData(), 41 | pageQueryData: getPageQueryData(), 42 | }) 43 | } 44 | 45 | componentDidMount() { 46 | socketRegisterPath(getPathFromProps(this.props)) 47 | ___emitter.on(`*`, this.handleMittEvent) 48 | } 49 | 50 | componentWillUnmount() { 51 | socketUnregisterPath(this.state.path) 52 | ___emitter.off(`*`, this.handleMittEvent) 53 | } 54 | 55 | static getDerivedStateFromProps(props, state) { 56 | const newPath = getPathFromProps(props) 57 | if (newPath !== state.path) { 58 | socketUnregisterPath(state.path) 59 | socketRegisterPath(newPath) 60 | return { 61 | path: newPath, 62 | } 63 | } 64 | 65 | return null 66 | } 67 | 68 | shouldComponentUpdate(nextProps, nextState) { 69 | // We want to update this component when: 70 | // - location changed 71 | // - page data for path changed 72 | // - static query results changed 73 | 74 | return ( 75 | this.props.location !== nextProps.location || 76 | this.state.path !== nextState.path || 77 | this.state.pageQueryData[nextState.path] !== 78 | nextState.pageQueryData[nextState.path] || 79 | this.state.staticQueryData !== nextState.staticQueryData 80 | ) 81 | } 82 | 83 | render() { 84 | const data = this.state.pageQueryData[getPathFromProps(this.props)] 85 | // eslint-disable-next-line 86 | if (!data) { 87 | return
88 | } 89 | 90 | return ( 91 | 92 | 93 | 94 | ) 95 | } 96 | } 97 | 98 | export default JSONStore 99 | -------------------------------------------------------------------------------- /site/.cache/commonjs/register-service-worker.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _apiRunnerBrowser = require("./api-runner-browser"); 4 | 5 | if (window.location.protocol !== `https:` && window.location.hostname !== `localhost`) { 6 | console.error(`Service workers can only be used over HTTPS, or on localhost for development`); 7 | } else if (`serviceWorker` in navigator) { 8 | navigator.serviceWorker.register(`${__BASE_PATH__}/sw.js`).then(function (reg) { 9 | reg.addEventListener(`updatefound`, () => { 10 | (0, _apiRunnerBrowser.apiRunner)(`onServiceWorkerUpdateFound`, { 11 | serviceWorker: reg 12 | }); // The updatefound event implies that reg.installing is set; see 13 | // https://w3c.github.io/ServiceWorker/#service-worker-registration-updatefound-event 14 | 15 | const installingWorker = reg.installing; 16 | console.log(`installingWorker`, installingWorker); 17 | installingWorker.addEventListener(`statechange`, () => { 18 | switch (installingWorker.state) { 19 | case `installed`: 20 | if (navigator.serviceWorker.controller) { 21 | // At this point, the old content will have been purged and the fresh content will 22 | // have been added to the cache. 23 | // We set a flag so Gatsby Link knows to refresh the page on next navigation attempt 24 | window.___swUpdated = true; // We call the onServiceWorkerUpdateReady API so users can show update prompts. 25 | 26 | (0, _apiRunnerBrowser.apiRunner)(`onServiceWorkerUpdateReady`, { 27 | serviceWorker: reg 28 | }); // If resources failed for the current page, reload. 29 | 30 | if (window.___failedResources) { 31 | console.log(`resources failed, SW updated - reloading`); 32 | window.location.reload(); 33 | } 34 | } else { 35 | // At this point, everything has been precached. 36 | // It's the perfect time to display a "Content is cached for offline use." message. 37 | console.log(`Content is now available offline!`); // Post to service worker that install is complete. 38 | // Delay to allow time for the event listener to be added -- 39 | // otherwise fetch is called too soon and resources aren't cached. 40 | 41 | (0, _apiRunnerBrowser.apiRunner)(`onServiceWorkerInstalled`, { 42 | serviceWorker: reg 43 | }); 44 | } 45 | 46 | break; 47 | 48 | case `redundant`: 49 | console.error(`The installing service worker became redundant.`); 50 | (0, _apiRunnerBrowser.apiRunner)(`onServiceWorkerRedundant`, { 51 | serviceWorker: reg 52 | }); 53 | break; 54 | 55 | case `activated`: 56 | (0, _apiRunnerBrowser.apiRunner)(`onServiceWorkerActive`, { 57 | serviceWorker: reg 58 | }); 59 | break; 60 | } 61 | }); 62 | }); 63 | }).catch(function (e) { 64 | console.error(`Error during service worker registration:`, e); 65 | }); 66 | } -------------------------------------------------------------------------------- /site/.cache/commonjs/gatsby-browser-entry.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); 4 | 5 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 6 | 7 | exports.__esModule = true; 8 | exports.graphql = graphql; 9 | exports.useStaticQuery = exports.StaticQuery = exports.StaticQueryContext = void 0; 10 | 11 | var _react = _interopRequireDefault(require("react")); 12 | 13 | var _propTypes = _interopRequireDefault(require("prop-types")); 14 | 15 | var _gatsbyLink = _interopRequireWildcard(require("gatsby-link")); 16 | 17 | exports.Link = _gatsbyLink.default; 18 | exports.withPrefix = _gatsbyLink.withPrefix; 19 | exports.withAssetPrefix = _gatsbyLink.withAssetPrefix; 20 | exports.navigate = _gatsbyLink.navigate; 21 | exports.push = _gatsbyLink.push; 22 | exports.replace = _gatsbyLink.replace; 23 | exports.navigateTo = _gatsbyLink.navigateTo; 24 | exports.parsePath = _gatsbyLink.parsePath; 25 | 26 | var _publicPageRenderer = _interopRequireDefault(require("./public-page-renderer")); 27 | 28 | exports.PageRenderer = _publicPageRenderer.default; 29 | 30 | const StaticQueryContext = _react.default.createContext({}); 31 | 32 | exports.StaticQueryContext = StaticQueryContext; 33 | 34 | const StaticQuery = props => _react.default.createElement(StaticQueryContext.Consumer, null, staticQueryData => { 35 | if (props.data || staticQueryData[props.query] && staticQueryData[props.query].data) { 36 | return (props.render || props.children)(props.data ? props.data.data : staticQueryData[props.query].data); 37 | } else { 38 | return _react.default.createElement("div", null, "Loading (StaticQuery)"); 39 | } 40 | }); 41 | 42 | exports.StaticQuery = StaticQuery; 43 | 44 | const useStaticQuery = query => { 45 | if (typeof _react.default.useContext !== `function` && process.env.NODE_ENV === `development`) { 46 | throw new Error(`You're likely using a version of React that doesn't support Hooks\n` + `Please update React and ReactDOM to 16.8.0 or later to use the useStaticQuery hook.`); 47 | } 48 | 49 | const context = _react.default.useContext(StaticQueryContext); 50 | 51 | if (context[query] && context[query].data) { 52 | return context[query].data; 53 | } else { 54 | throw new Error(`The result of this StaticQuery could not be fetched.\n\n` + `This is likely a bug in Gatsby and if refreshing the page does not fix it, ` + `please open an issue in https://github.com/gatsbyjs/gatsby/issues`); 55 | } 56 | }; 57 | 58 | exports.useStaticQuery = useStaticQuery; 59 | StaticQuery.propTypes = { 60 | data: _propTypes.default.object, 61 | query: _propTypes.default.string.isRequired, 62 | render: _propTypes.default.func, 63 | children: _propTypes.default.func 64 | }; 65 | 66 | function graphql() { 67 | throw new Error(`It appears like Gatsby is misconfigured. Gatsby related \`graphql\` calls ` + `are supposed to only be evaluated at compile time, and then compiled away. ` + `Unfortunately, something went wrong and the query was left in the compiled code.\n\n` + `Unless your site has a complex or custom babel/Gatsby configuration this is likely a bug in Gatsby.`); 68 | } -------------------------------------------------------------------------------- /site/.cache/root.js: -------------------------------------------------------------------------------- 1 | import React, { createElement } from "react" 2 | import { Router } from "@reach/router" 3 | import { ScrollContext } from "gatsby-react-router-scroll" 4 | 5 | import { 6 | shouldUpdateScroll, 7 | init as navigationInit, 8 | RouteUpdates, 9 | } from "./navigation" 10 | import { apiRunner } from "./api-runner-browser" 11 | import loader from "./loader" 12 | import JSONStore from "./json-store" 13 | import EnsureResources from "./ensure-resources" 14 | 15 | import { reportError, clearError } from "./error-overlay-handler" 16 | 17 | if (window.__webpack_hot_middleware_reporter__ !== undefined) { 18 | const overlayErrorID = `webpack` 19 | // Report build errors 20 | window.__webpack_hot_middleware_reporter__.useCustomOverlay({ 21 | showProblems(type, obj) { 22 | if (type !== `errors`) { 23 | clearError(overlayErrorID) 24 | return 25 | } 26 | reportError(overlayErrorID, obj[0]) 27 | }, 28 | clear() { 29 | clearError(overlayErrorID) 30 | }, 31 | }) 32 | } 33 | 34 | navigationInit() 35 | 36 | class RouteHandler extends React.Component { 37 | render() { 38 | let { location } = this.props 39 | 40 | // check if page exists - in dev pages are sync loaded, it's safe to use 41 | // loader.getPage 42 | let page = loader.getPage(location.pathname) 43 | 44 | if (page) { 45 | return ( 46 | 47 | {locationAndPageResources => ( 48 | 49 | 53 | 54 | 55 | 56 | )} 57 | 58 | ) 59 | } else { 60 | const dev404PageResources = loader.getResourcesForPathnameSync( 61 | `/dev-404-page/` 62 | ) 63 | const real404PageResources = loader.getResourcesForPathnameSync( 64 | `/404.html` 65 | ) 66 | let custom404 67 | if (real404PageResources) { 68 | custom404 = ( 69 | 70 | ) 71 | } 72 | 73 | return ( 74 | 75 | 80 | 81 | ) 82 | } 83 | } 84 | } 85 | 86 | const Root = () => 87 | createElement( 88 | Router, 89 | { 90 | basepath: __BASE_PATH__, 91 | }, 92 | createElement(RouteHandler, { path: `/*` }) 93 | ) 94 | 95 | // Let site, plugins wrap the site e.g. for Redux. 96 | const WrappedRoot = apiRunner( 97 | `wrapRootElement`, 98 | { element: }, 99 | , 100 | ({ result, plugin }) => { 101 | return { element: result } 102 | } 103 | ).pop() 104 | 105 | export default () => WrappedRoot 106 | -------------------------------------------------------------------------------- /site/.cache/commonjs/json-store.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 4 | 5 | exports.__esModule = true; 6 | exports.default = void 0; 7 | 8 | var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); 9 | 10 | var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); 11 | 12 | var _react = _interopRequireDefault(require("react")); 13 | 14 | var _pageRenderer = _interopRequireDefault(require("./page-renderer")); 15 | 16 | var _gatsby = require("gatsby"); 17 | 18 | var _socketIo = require("./socketIo"); 19 | 20 | if (process.env.NODE_ENV === `production`) { 21 | throw new Error(`It appears like Gatsby is misconfigured. JSONStore is Gatsby internal ` + `development-only component and should never be used in production.\n\n` + `Unless your site has a complex or custom webpack/Gatsby ` + `configuration this is likely a bug in Gatsby. ` + `Please report this at https://github.com/gatsbyjs/gatsby/issues ` + `with steps to reproduce this error.`); 22 | } 23 | 24 | const getPathFromProps = props => props.pageResources && props.pageResources.page ? props.pageResources.page.path : undefined; 25 | 26 | class JSONStore extends _react.default.Component { 27 | constructor(props) { 28 | super(props); 29 | (0, _defineProperty2.default)(this, "handleMittEvent", (type, event) => { 30 | this.setState({ 31 | staticQueryData: (0, _socketIo.getStaticQueryData)(), 32 | pageQueryData: (0, _socketIo.getPageQueryData)() 33 | }); 34 | }); 35 | this.state = { 36 | staticQueryData: (0, _socketIo.getStaticQueryData)(), 37 | pageQueryData: (0, _socketIo.getPageQueryData)(), 38 | path: null 39 | }; 40 | } 41 | 42 | componentDidMount() { 43 | (0, _socketIo.registerPath)(getPathFromProps(this.props)); 44 | 45 | ___emitter.on(`*`, this.handleMittEvent); 46 | } 47 | 48 | componentWillUnmount() { 49 | (0, _socketIo.unregisterPath)(this.state.path); 50 | 51 | ___emitter.off(`*`, this.handleMittEvent); 52 | } 53 | 54 | static getDerivedStateFromProps(props, state) { 55 | const newPath = getPathFromProps(props); 56 | 57 | if (newPath !== state.path) { 58 | (0, _socketIo.unregisterPath)(state.path); 59 | (0, _socketIo.registerPath)(newPath); 60 | return { 61 | path: newPath 62 | }; 63 | } 64 | 65 | return null; 66 | } 67 | 68 | shouldComponentUpdate(nextProps, nextState) { 69 | // We want to update this component when: 70 | // - location changed 71 | // - page data for path changed 72 | // - static query results changed 73 | return this.props.location !== nextProps.location || this.state.path !== nextState.path || this.state.pageQueryData[nextState.path] !== nextState.pageQueryData[nextState.path] || this.state.staticQueryData !== nextState.staticQueryData; 74 | } 75 | 76 | render() { 77 | const data = this.state.pageQueryData[getPathFromProps(this.props)]; // eslint-disable-next-line 78 | 79 | if (!data) { 80 | return _react.default.createElement("div", null); 81 | } 82 | 83 | return _react.default.createElement(_gatsby.StaticQueryContext.Provider, { 84 | value: this.state.staticQueryData 85 | }, _react.default.createElement(_pageRenderer.default, (0, _extends2.default)({}, this.props, data))); 86 | } 87 | 88 | } 89 | 90 | var _default = JSONStore; 91 | exports.default = _default; -------------------------------------------------------------------------------- /site/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | "browser": true, 4 | "es6": true 5 | }, 6 | extends: ["plugin:import/typescript", "prettier/@typescript-eslint", "plugin:prettier/recommended", "prettier", "prettier/react"], 7 | globals: { 8 | Atomics: "readonly", 9 | SharedArrayBuffer: "readonly", 10 | process: true, 11 | logger: true 12 | }, 13 | parser: "@typescript-eslint/parser", 14 | parserOptions: { 15 | ecmaFeatures: { 16 | jsx: true 17 | }, 18 | ecmaVersion: 2018, 19 | sourceType: "module", 20 | project: "./tsconfig.json" 21 | }, 22 | settings: { 23 | react: { 24 | version: "detect" 25 | } 26 | }, 27 | plugins: ["react", "react-hooks", "@typescript-eslint", "prefer-arrow", "promise", "no-null", "import", "prettier"], 28 | rules: { 29 | "prettier/prettier": "error", 30 | "@typescript-eslint/ban-types": [ 31 | "warn", 32 | { 33 | "types": { 34 | "Object": "Use {} instead", 35 | "String": { 36 | "message": "Use string instead", 37 | "fixWith": "string" 38 | } 39 | } 40 | } 41 | ], 42 | "@typescript-eslint/prefer-for-of": "error", 43 | "@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "no-public" }], 44 | "@typescript-eslint/no-inferrable-types": ["error", { "ignoreParameters": true, "ignoreProperties": true }], 45 | "no-param-reassign": 0, 46 | "@typescript-eslint/no-var-requires": 0, 47 | "prefer-arrow/prefer-arrow-functions": 0, 48 | "@typescript-eslint/promise-function-async": 0, 49 | "@typescript-eslint/unified-signatures": "error", 50 | "@typescript-eslint/await-thenable": "error", 51 | "no-restricted-imports": "error", 52 | "no-new-wrappers": "error", 53 | "@typescript-eslint/no-for-in-array": "error", 54 | "no-template-curly-in-string": "error", 55 | "@typescript-eslint/no-object-literal-type-assertion": "error", 56 | "no-return-await": "error", 57 | "no-throw-literal": "error", 58 | "@typescript-eslint/no-this-alias": 0, 59 | "@typescript-eslint/no-extraneous-class": "error", 60 | "prefer-object-spread": "error", 61 | "@typescript-eslint/no-require-imports": 0, 62 | "@typescript-eslint/array-type": ["error", "array-simple"], 63 | "@typescript-eslint/prefer-function-type": "error", 64 | "@typescript-eslint/explicit-function-return-type": 0, 65 | "no-undef-init": "error", 66 | "@typescript-eslint/no-unnecessary-qualifier": "warn", 67 | "jsx-alignment": true, 68 | "jsx-boolean-value": [true, "never"], 69 | "jsx-curly-spacing": [true, "never"], 70 | "jsx-equals-spacing": [true, "never"], 71 | "jsx-key": true, 72 | "jsx-no-bind": true, 73 | "jsx-no-lambda": true, 74 | "jsx-no-string-ref": true, 75 | "jsx-self-close": true, 76 | "jsx-space-before-trailing-slash": true, 77 | "jsx-wrap-multiline": [ 78 | true, 79 | { 80 | "declaration": "parens", 81 | "assignment": "parens", 82 | "return": "parens", 83 | "arrow": "parens-new-line", 84 | "condition": "ignore", 85 | "logical": "ignore", 86 | "prop": "ignore" 87 | } 88 | ], 89 | "import/no-cycle": ["error", { "maxDepth": 1 }], 90 | "import/no-self-import": "error", 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | "browser": true, 4 | "es6": true 5 | }, 6 | extends: ["plugin:import/typescript", "prettier/@typescript-eslint", "plugin:prettier/recommended", "prettier", "prettier/react"], 7 | globals: { 8 | Atomics: "readonly", 9 | SharedArrayBuffer: "readonly", 10 | process: true, 11 | logger: true 12 | }, 13 | parser: "@typescript-eslint/parser", 14 | parserOptions: { 15 | ecmaFeatures: { 16 | jsx: true 17 | }, 18 | ecmaVersion: 2018, 19 | sourceType: "module", 20 | project: "./tsconfig.json" 21 | }, 22 | settings: { 23 | react: { 24 | version: "detect" 25 | } 26 | }, 27 | plugins: ["react", "react-hooks", "@typescript-eslint", "prefer-arrow", "promise", "no-null", "import", "prettier"], 28 | rules: { 29 | "prettier/prettier": "error", 30 | "@typescript-eslint/ban-types": [ 31 | "warn", 32 | { 33 | "types": { 34 | "Object": "Use {} instead", 35 | "String": { 36 | "message": "Use string instead", 37 | "fixWith": "string" 38 | } 39 | } 40 | } 41 | ], 42 | "@typescript-eslint/prefer-for-of": "error", 43 | "@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "no-public" }], 44 | "@typescript-eslint/no-inferrable-types": ["error", { "ignoreParameters": true, "ignoreProperties": true }], 45 | "no-param-reassign": 0, 46 | "@typescript-eslint/no-var-requires": 0, 47 | "prefer-arrow/prefer-arrow-functions": 0, 48 | "@typescript-eslint/promise-function-async": 0, 49 | "@typescript-eslint/unified-signatures": "error", 50 | "@typescript-eslint/await-thenable": "error", 51 | "no-restricted-imports": "error", 52 | "no-new-wrappers": "error", 53 | "@typescript-eslint/no-for-in-array": "error", 54 | "no-template-curly-in-string": "error", 55 | "@typescript-eslint/no-object-literal-type-assertion": "error", 56 | "no-return-await": "error", 57 | "no-throw-literal": "error", 58 | "@typescript-eslint/no-this-alias": 0, 59 | "@typescript-eslint/no-extraneous-class": "error", 60 | "prefer-object-spread": "error", 61 | "@typescript-eslint/no-require-imports": 0, 62 | "@typescript-eslint/array-type": ["error", "array-simple"], 63 | "@typescript-eslint/prefer-function-type": "error", 64 | "@typescript-eslint/explicit-function-return-type": 0, 65 | "no-undef-init": "error", 66 | "@typescript-eslint/no-unnecessary-qualifier": "warn", 67 | "jsx-alignment": true, 68 | "jsx-boolean-value": [true, "never"], 69 | "jsx-curly-spacing": [true, "never"], 70 | "jsx-equals-spacing": [true, "never"], 71 | "jsx-key": true, 72 | "jsx-no-bind": true, 73 | "jsx-no-lambda": true, 74 | "jsx-no-string-ref": true, 75 | "jsx-self-close": true, 76 | "jsx-space-before-trailing-slash": true, 77 | "jsx-wrap-multiline": [ 78 | true, 79 | { 80 | "declaration": "parens", 81 | "assignment": "parens", 82 | "return": "parens", 83 | "arrow": "parens-new-line", 84 | "condition": "ignore", 85 | "logical": "ignore", 86 | "prop": "ignore" 87 | } 88 | ], 89 | "import/no-cycle": ["error", { "maxDepth": 1 }], 90 | "import/no-self-import": "error", 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-core/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | "browser": true, 4 | "es6": true 5 | }, 6 | extends: ["plugin:import/typescript", "prettier/@typescript-eslint", "plugin:prettier/recommended", "prettier", "prettier/react"], 7 | globals: { 8 | Atomics: "readonly", 9 | SharedArrayBuffer: "readonly", 10 | process: true, 11 | logger: true 12 | }, 13 | parser: "@typescript-eslint/parser", 14 | parserOptions: { 15 | ecmaFeatures: { 16 | jsx: true 17 | }, 18 | ecmaVersion: 2018, 19 | sourceType: "module", 20 | project: "./tsconfig.json" 21 | }, 22 | settings: { 23 | react: { 24 | version: "detect" 25 | } 26 | }, 27 | plugins: ["react", "react-hooks", "@typescript-eslint", "prefer-arrow", "promise", "no-null", "import", "prettier"], 28 | rules: { 29 | "prettier/prettier": "error", 30 | "@typescript-eslint/ban-types": [ 31 | "warn", 32 | { 33 | "types": { 34 | "Object": "Use {} instead", 35 | "String": { 36 | "message": "Use string instead", 37 | "fixWith": "string" 38 | } 39 | } 40 | } 41 | ], 42 | "@typescript-eslint/prefer-for-of": "error", 43 | "@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "no-public" }], 44 | "@typescript-eslint/no-inferrable-types": ["error", { "ignoreParameters": true, "ignoreProperties": true }], 45 | "no-param-reassign": 0, 46 | "@typescript-eslint/no-var-requires": 0, 47 | "prefer-arrow/prefer-arrow-functions": 0, 48 | "@typescript-eslint/promise-function-async": 0, 49 | "@typescript-eslint/unified-signatures": "error", 50 | "@typescript-eslint/await-thenable": "error", 51 | "no-restricted-imports": "error", 52 | "no-new-wrappers": "error", 53 | "@typescript-eslint/no-for-in-array": "error", 54 | "no-template-curly-in-string": "error", 55 | "@typescript-eslint/no-object-literal-type-assertion": "error", 56 | "no-return-await": "error", 57 | "no-throw-literal": "error", 58 | "@typescript-eslint/no-this-alias": 0, 59 | "@typescript-eslint/no-extraneous-class": "error", 60 | "prefer-object-spread": "error", 61 | "@typescript-eslint/no-require-imports": 0, 62 | "@typescript-eslint/array-type": ["error", "array-simple"], 63 | "@typescript-eslint/prefer-function-type": "error", 64 | "@typescript-eslint/explicit-function-return-type": 0, 65 | "no-undef-init": "error", 66 | "@typescript-eslint/no-unnecessary-qualifier": "warn", 67 | "jsx-alignment": true, 68 | "jsx-boolean-value": [true, "never"], 69 | "jsx-curly-spacing": [true, "never"], 70 | "jsx-equals-spacing": [true, "never"], 71 | "jsx-key": true, 72 | "jsx-no-bind": true, 73 | "jsx-no-lambda": true, 74 | "jsx-no-string-ref": true, 75 | "jsx-self-close": true, 76 | "jsx-space-before-trailing-slash": true, 77 | "jsx-wrap-multiline": [ 78 | true, 79 | { 80 | "declaration": "parens", 81 | "assignment": "parens", 82 | "return": "parens", 83 | "arrow": "parens-new-line", 84 | "condition": "ignore", 85 | "logical": "ignore", 86 | "prop": "ignore" 87 | } 88 | ], 89 | "import/no-cycle": ["error", { "maxDepth": 1 }], 90 | "import/no-self-import": "error", 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-style/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | "browser": true, 4 | "es6": true 5 | }, 6 | extends: ["plugin:import/typescript", "prettier/@typescript-eslint", "plugin:prettier/recommended", "prettier", "prettier/react"], 7 | globals: { 8 | Atomics: "readonly", 9 | SharedArrayBuffer: "readonly", 10 | process: true, 11 | logger: true 12 | }, 13 | parser: "@typescript-eslint/parser", 14 | parserOptions: { 15 | ecmaFeatures: { 16 | jsx: true 17 | }, 18 | ecmaVersion: 2018, 19 | sourceType: "module", 20 | project: "./tsconfig.json" 21 | }, 22 | settings: { 23 | react: { 24 | version: "detect" 25 | } 26 | }, 27 | plugins: ["react", "react-hooks", "@typescript-eslint", "prefer-arrow", "promise", "no-null", "import", "prettier"], 28 | rules: { 29 | "prettier/prettier": "error", 30 | "@typescript-eslint/ban-types": [ 31 | "warn", 32 | { 33 | "types": { 34 | "Object": "Use {} instead", 35 | "String": { 36 | "message": "Use string instead", 37 | "fixWith": "string" 38 | } 39 | } 40 | } 41 | ], 42 | "@typescript-eslint/prefer-for-of": "error", 43 | "@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "no-public" }], 44 | "@typescript-eslint/no-inferrable-types": ["error", { "ignoreParameters": true, "ignoreProperties": true }], 45 | "no-param-reassign": 0, 46 | "@typescript-eslint/no-var-requires": 0, 47 | "prefer-arrow/prefer-arrow-functions": 0, 48 | "@typescript-eslint/promise-function-async": 0, 49 | "@typescript-eslint/unified-signatures": "error", 50 | "@typescript-eslint/await-thenable": "error", 51 | "no-restricted-imports": "error", 52 | "no-new-wrappers": "error", 53 | "@typescript-eslint/no-for-in-array": "error", 54 | "no-template-curly-in-string": "error", 55 | "@typescript-eslint/no-object-literal-type-assertion": "error", 56 | "no-return-await": "error", 57 | "no-throw-literal": "error", 58 | "@typescript-eslint/no-this-alias": 0, 59 | "@typescript-eslint/no-extraneous-class": "error", 60 | "prefer-object-spread": "error", 61 | "@typescript-eslint/no-require-imports": 0, 62 | "@typescript-eslint/array-type": ["error", "array-simple"], 63 | "@typescript-eslint/prefer-function-type": "error", 64 | "@typescript-eslint/explicit-function-return-type": 0, 65 | "no-undef-init": "error", 66 | "@typescript-eslint/no-unnecessary-qualifier": "warn", 67 | "jsx-alignment": true, 68 | "jsx-boolean-value": [true, "never"], 69 | "jsx-curly-spacing": [true, "never"], 70 | "jsx-equals-spacing": [true, "never"], 71 | "jsx-key": true, 72 | "jsx-no-bind": true, 73 | "jsx-no-lambda": true, 74 | "jsx-no-string-ref": true, 75 | "jsx-self-close": true, 76 | "jsx-space-before-trailing-slash": true, 77 | "jsx-wrap-multiline": [ 78 | true, 79 | { 80 | "declaration": "parens", 81 | "assignment": "parens", 82 | "return": "parens", 83 | "arrow": "parens-new-line", 84 | "condition": "ignore", 85 | "logical": "ignore", 86 | "prop": "ignore" 87 | } 88 | ], 89 | "import/no-cycle": ["error", { "maxDepth": 1 }], 90 | "import/no-self-import": "error", 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /packages/gatsby-theme-west-egg-stripe-cart/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | "browser": true, 4 | "es6": true 5 | }, 6 | extends: ["plugin:import/typescript", "prettier/@typescript-eslint", "plugin:prettier/recommended", "prettier", "prettier/react"], 7 | globals: { 8 | Atomics: "readonly", 9 | SharedArrayBuffer: "readonly", 10 | process: true, 11 | logger: true 12 | }, 13 | parser: "@typescript-eslint/parser", 14 | parserOptions: { 15 | ecmaFeatures: { 16 | jsx: true 17 | }, 18 | ecmaVersion: 2018, 19 | sourceType: "module", 20 | project: "./tsconfig.json" 21 | }, 22 | settings: { 23 | react: { 24 | version: "detect" 25 | } 26 | }, 27 | plugins: ["react", "react-hooks", "@typescript-eslint", "prefer-arrow", "promise", "no-null", "import", "prettier"], 28 | rules: { 29 | "prettier/prettier": "error", 30 | "@typescript-eslint/ban-types": [ 31 | "warn", 32 | { 33 | "types": { 34 | "Object": "Use {} instead", 35 | "String": { 36 | "message": "Use string instead", 37 | "fixWith": "string" 38 | } 39 | } 40 | } 41 | ], 42 | "@typescript-eslint/prefer-for-of": "error", 43 | "@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "no-public" }], 44 | "@typescript-eslint/no-inferrable-types": ["error", { "ignoreParameters": true, "ignoreProperties": true }], 45 | "no-param-reassign": 0, 46 | "@typescript-eslint/no-var-requires": 0, 47 | "prefer-arrow/prefer-arrow-functions": 0, 48 | "@typescript-eslint/promise-function-async": 0, 49 | "@typescript-eslint/unified-signatures": "error", 50 | "@typescript-eslint/await-thenable": "error", 51 | "no-restricted-imports": "error", 52 | "no-new-wrappers": "error", 53 | "@typescript-eslint/no-for-in-array": "error", 54 | "no-template-curly-in-string": "error", 55 | "@typescript-eslint/no-object-literal-type-assertion": "error", 56 | "no-return-await": "error", 57 | "no-throw-literal": "error", 58 | "@typescript-eslint/no-this-alias": 0, 59 | "@typescript-eslint/no-extraneous-class": "error", 60 | "prefer-object-spread": "error", 61 | "@typescript-eslint/no-require-imports": 0, 62 | "@typescript-eslint/array-type": ["error", "array-simple"], 63 | "@typescript-eslint/prefer-function-type": "error", 64 | "@typescript-eslint/explicit-function-return-type": 0, 65 | "no-undef-init": "error", 66 | "@typescript-eslint/no-unnecessary-qualifier": "warn", 67 | "jsx-alignment": true, 68 | "jsx-boolean-value": [true, "never"], 69 | "jsx-curly-spacing": [true, "never"], 70 | "jsx-equals-spacing": [true, "never"], 71 | "jsx-key": true, 72 | "jsx-no-bind": true, 73 | "jsx-no-lambda": true, 74 | "jsx-no-string-ref": true, 75 | "jsx-self-close": true, 76 | "jsx-space-before-trailing-slash": true, 77 | "jsx-wrap-multiline": [ 78 | true, 79 | { 80 | "declaration": "parens", 81 | "assignment": "parens", 82 | "return": "parens", 83 | "arrow": "parens-new-line", 84 | "condition": "ignore", 85 | "logical": "ignore", 86 | "prop": "ignore" 87 | } 88 | ], 89 | "import/no-cycle": ["error", { "maxDepth": 1 }], 90 | "import/no-self-import": "error", 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /site/.cache/socketIo.js: -------------------------------------------------------------------------------- 1 | import { reportError, clearError } from "./error-overlay-handler" 2 | 3 | let socket = null 4 | 5 | let staticQueryData = {} 6 | let pageQueryData = {} 7 | let isInitialized = false 8 | 9 | export const getStaticQueryData = () => staticQueryData 10 | export const getPageQueryData = () => pageQueryData 11 | export const getIsInitialized = () => isInitialized 12 | 13 | export default function socketIo() { 14 | if (process.env.NODE_ENV !== `production`) { 15 | if (!socket) { 16 | // Try to initialize web socket if we didn't do it already 17 | try { 18 | // eslint-disable-next-line no-undef 19 | socket = io() 20 | 21 | const didDataChange = (msg, queryData) => 22 | !(msg.payload.id in queryData) || 23 | JSON.stringify(msg.payload.result) !== 24 | JSON.stringify(queryData[msg.payload.id]) 25 | 26 | socket.on(`message`, msg => { 27 | if (msg.type === `staticQueryResult`) { 28 | if (didDataChange(msg, staticQueryData)) { 29 | staticQueryData = { 30 | ...staticQueryData, 31 | [msg.payload.id]: msg.payload.result, 32 | } 33 | } 34 | } else if (msg.type === `pageQueryResult`) { 35 | if (didDataChange(msg, pageQueryData)) { 36 | pageQueryData = { 37 | ...pageQueryData, 38 | [msg.payload.id]: msg.payload.result, 39 | } 40 | } 41 | } else if (msg.type === `overlayError`) { 42 | if (msg.payload.message) { 43 | reportError(msg.payload.id, msg.payload.message) 44 | } else { 45 | clearError(msg.payload.id) 46 | } 47 | } 48 | if (msg.type && msg.payload) { 49 | ___emitter.emit(msg.type, msg.payload) 50 | } 51 | }) 52 | } catch (err) { 53 | console.error(`Could not connect to socket.io on dev server.`) 54 | } 55 | } 56 | return socket 57 | } else { 58 | return null 59 | } 60 | } 61 | 62 | const inFlightGetPageDataPromiseCache = {} 63 | function getPageData(pathname) { 64 | if (inFlightGetPageDataPromiseCache[pathname]) { 65 | return inFlightGetPageDataPromiseCache[pathname] 66 | } else { 67 | inFlightGetPageDataPromiseCache[pathname] = new Promise(resolve => { 68 | if (pageQueryData[pathname]) { 69 | delete inFlightGetPageDataPromiseCache[pathname] 70 | resolve(pageQueryData[pathname]) 71 | } else { 72 | const onPageDataCallback = msg => { 73 | if (msg.type === `pageQueryResult` && msg.payload.id === pathname) { 74 | socket.off(`message`, onPageDataCallback) 75 | delete inFlightGetPageDataPromiseCache[pathname] 76 | resolve(pageQueryData[pathname]) 77 | } 78 | } 79 | socket.on(`message`, onPageDataCallback) 80 | 81 | socket.emit(`getDataForPath`, pathname) 82 | } 83 | }) 84 | } 85 | return inFlightGetPageDataPromiseCache[pathname] 86 | } 87 | 88 | // Tell websocket-manager.js the new path we're on. 89 | // This will help the backend prioritize queries for this 90 | // path. 91 | function registerPath(path) { 92 | socket.emit(`registerPath`, path) 93 | } 94 | 95 | // Unregister the former path 96 | function unregisterPath(path) { 97 | socket.emit(`unregisterPath`, path) 98 | } 99 | 100 | export { getPageData, registerPath, unregisterPath } 101 | --------------------------------------------------------------------------------