gatsby 2.19.45 → 2.19.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/bootstrap/index.js +3 -1
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/commands/build-utils.js +25 -21
- package/dist/commands/build-utils.js.map +1 -1
- package/dist/commands/build.js +10 -17
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/develop.js +2 -2
- package/dist/commands/develop.js.map +1 -1
- package/dist/redux/actions/public.js +3 -1
- package/dist/redux/actions/public.js.map +1 -1
- package/dist/schema/types/built-in-types.js +6 -7
- package/dist/schema/types/built-in-types.js.map +1 -1
- package/dist/utils/api-browser-docs.js +1 -1
- package/dist/utils/api-browser-docs.js.map +1 -1
- package/dist/utils/create-schema-customization.js +12 -7
- package/dist/utils/create-schema-customization.js.map +1 -1
- package/dist/utils/feedback.js +17 -9
- package/dist/utils/feedback.js.map +1 -1
- package/dist/utils/tracer/index.js +18 -16
- package/dist/utils/tracer/index.js.map +1 -1
- package/dist/utils/webpack-error-utils.js +9 -2
- package/dist/utils/webpack-error-utils.js.map +1 -1
- package/dist/utils/webpack-plugins.js +10 -5
- package/dist/utils/webpack-plugins.js.map +1 -1
- package/dist/utils/webpack-utils.js +8 -8
- package/dist/utils/webpack-utils.js.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +11 -11
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.builtInTypeDefinitions = void 0;
|
|
5
|
+
|
|
6
|
+
var _graphql = require("graphql");
|
|
6
7
|
|
|
7
8
|
const fileType = `
|
|
8
9
|
type File implements Node @infer {
|
|
@@ -84,9 +85,7 @@ const sitePageType = `
|
|
|
84
85
|
}
|
|
85
86
|
`;
|
|
86
87
|
|
|
87
|
-
const builtInTypeDefinitions = () => [fileType, directoryType, sitePageType].map(type => parse(type));
|
|
88
|
+
const builtInTypeDefinitions = () => [fileType, directoryType, sitePageType].map(type => (0, _graphql.parse)(type));
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
builtInTypeDefinitions
|
|
91
|
-
};
|
|
90
|
+
exports.builtInTypeDefinitions = builtInTypeDefinitions;
|
|
92
91
|
//# sourceMappingURL=built-in-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schema/types/built-in-types.
|
|
1
|
+
{"version":3,"sources":["../../../src/schema/types/built-in-types.ts"],"names":["fileType","directoryType","sitePageType","builtInTypeDefinitions","map","type"],"mappings":";;;;;AAAA;;AAEA,MAAMA,QAAQ,GAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAlB;AAoCA,MAAMC,aAAa,GAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAvB;AAoCA,MAAMC,YAAY,GAAI;;;;;;;;CAAtB;;AAUO,MAAMC,sBAAsB,GAAG,MACpC,CAACH,QAAD,EAAWC,aAAX,EAA0BC,YAA1B,EAAwCE,GAAxC,CAA4CC,IAAI,IAAI,oBAAMA,IAAN,CAApD,CADK","sourcesContent":["import { parse, DocumentNode } from \"graphql\"\n\nconst fileType = `\n type File implements Node @infer {\n sourceInstanceName: String!\n absolutePath: String!\n relativePath: String!\n extension: String!\n size: Int!\n prettySize: String!\n modifiedTime: Date! @dateformat\n accessTime: Date! @dateformat\n changeTime: Date! @dateformat\n birthTime: Date! @dateformat\n root: String!\n dir: String!\n base: String!\n ext: String!\n name: String!\n relativeDirectory: String!\n dev: Int!\n mode: Int!\n nlink: Int!\n uid: Int!\n gid: Int!\n rdev: Int!\n ino: Float!\n atimeMs: Float!\n mtimeMs: Float!\n ctimeMs: Float!\n atime: Date! @dateformat\n mtime: Date! @dateformat\n ctime: Date! @dateformat\n birthtime: Date @deprecated(reason: \"Use \\`birthTime\\` instead\")\n birthtimeMs: Float @deprecated(reason: \"Use \\`birthTime\\` instead\")\n }\n`\n\nconst directoryType = `\n type Directory implements Node @infer {\n sourceInstanceName: String!\n absolutePath: String!\n relativePath: String!\n extension: String!\n size: Int!\n prettySize: String!\n modifiedTime: Date! @dateformat\n accessTime: Date! @dateformat\n changeTime: Date! @dateformat\n birthTime: Date! @dateformat\n root: String!\n dir: String!\n base: String!\n ext: String!\n name: String!\n relativeDirectory: String!\n dev: Int!\n mode: Int!\n nlink: Int!\n uid: Int!\n gid: Int!\n rdev: Int!\n ino: Float!\n atimeMs: Float!\n mtimeMs: Float!\n ctimeMs: Float!\n atime: Date! @dateformat\n mtime: Date! @dateformat\n ctime: Date! @dateformat\n birthtime: Date @deprecated(reason: \"Use \\`birthTime\\` instead\")\n birthtimeMs: Float @deprecated(reason: \"Use \\`birthTime\\` instead\")\n }\n`\n\nconst sitePageType = `\n type SitePage implements Node @infer {\n path: String!\n component: String!\n internalComponentName: String!\n componentChunkName: String!\n matchPath: String\n }\n`\n\nexport const builtInTypeDefinitions = (): DocumentNode[] =>\n [fileType, directoryType, sitePageType].map(type => parse(type))\n"],"file":"built-in-types.js"}
|
|
@@ -60,7 +60,7 @@ exports.onPreRouteUpdate = true;
|
|
|
60
60
|
|
|
61
61
|
exports.onRouteUpdateDelayed = true;
|
|
62
62
|
/**
|
|
63
|
-
* Called when the user changes routes
|
|
63
|
+
* Called when the user changes routes, including on the initial load of the app
|
|
64
64
|
* @param {object} $0
|
|
65
65
|
* @param {object} $0.location A location object
|
|
66
66
|
* @param {object|null} $0.prevLocation The previous location object
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/api-browser-docs.js"],"names":["exports","onClientEntry","onInitialClientRender","onPreRouteUpdate","onRouteUpdateDelayed","onRouteUpdate","shouldUpdateScroll","registerServiceWorker","replaceComponentRenderer","wrapPageElement","wrapRootElement","onPrefetchPathname","onPostPrefetchPathname","disableCorePrefetching","replaceHydrateFunction","onServiceWorkerInstal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AO,CAACmB,wBAAR,GAAmC,IAAnC","sourcesContent":["/**\n * This argument is empty. This is for consistency so `pluginOptions` is always second argument.\n * @typedef {undefined} emptyArg\n */\n\n/**\n * Object containing options defined in `gatsby-config.js`\n * @typedef {object} pluginOptions\n */\n\n/**\n * Called when the Gatsby browser runtime first starts.\n * @param {emptyArg} _\n * @param {pluginOptions} pluginOptions\n * @example\n * exports.onClientEntry = () => {\n * console.log(\"We've started!\")\n * callAnalyticsAPI()\n * }\n */\nexports.onClientEntry = true\n\n/**\n * Called when the initial (but not subsequent) render of Gatsby App is done on the client.\n * @param {emptyArg} _\n * @param {pluginOptions} pluginOptions\n * @example\n * exports.onInitialClientRender = () => {\n * console.log(\"ReactDOM.render has executed\")\n * }\n */\nexports.onInitialClientRender = true\n\n/**\n * Called when changing location is started.\n * @param {object} $0\n * @param {object} $0.location A location object\n * @param {object|null} $0.prevLocation The previous location object\n * @param {pluginOptions} pluginOptions\n * @example\n * exports.onPreRouteUpdate = ({ location, prevLocation }) => {\n * console.log(\"Gatsby started to change location to\", location.pathname)\n * console.log(\"Gatsby started to change location from\", prevLocation ? prevLocation.pathname : null)\n * }\n */\nexports.onPreRouteUpdate = true\n\n/**\n * Called when changing location is longer than 1 second.\n * @param {object} $0\n * @param {object} $0.location A location object\n * @param {object} $0.action The \"action\" that caused the route change\n * @param {pluginOptions} pluginOptions\n * @example\n * exports.onRouteUpdateDelayed = () => {\n * console.log(\"We can show loading indicator now\")\n * }\n */\nexports.onRouteUpdateDelayed = true\n\n/**\n * Called when the user changes routes\n * @param {object} $0\n * @param {object} $0.location A location object\n * @param {object|null} $0.prevLocation The previous location object\n * @param {pluginOptions} pluginOptions\n * @example\n * exports.onRouteUpdate = ({ location, prevLocation }) => {\n * console.log('new pathname', location.pathname)\n * console.log('old pathname', prevLocation ? prevLocation.pathname : null)\n * }\n */\nexports.onRouteUpdate = true\n\n/**\n * Allows a plugin to influence scrolling behavior on navigation.\n * Default behavior is persisting last known scrolling positions and scrolling back to them on navigation.\n * Plugins can also override this and return an Array of coordinates or an element name to scroll to.\n * @param {object} $0\n * @param {object} $0.prevRouterProps The previous state of the router before the route change.\n * @param {object} $0.routerProps The current state of the router.\n * @param {string} $0.pathname The new pathname (for backwards compatibility with v1).\n * @param {function} $0.getSavedScrollPosition Takes a location and returns the\n * coordinates of the last scroll position for that location, or `null`. Gatsby\n * saves scroll positions for each route in `SessionStorage`, so they are\n * available after page reload.\n * @returns {(boolean|string|Array)} Should return either an [x, y] Array of\n * coordinates to scroll to, a string of the `id` or `name` of an element to\n * scroll to, `false` to not update the scroll position, or `true` for the\n * default behavior.\n * @param {pluginOptions} pluginOptions\n * @example\n * exports.shouldUpdateScroll = ({\n * routerProps: { location },\n * getSavedScrollPosition\n * }) => {\n * const currentPosition = getSavedScrollPosition(location)\n * const queriedPosition = getSavedScrollPosition({ pathname: `/random` })\n *\n * window.scrollTo(...(currentPosition || [0, 0]))\n *\n * return false\n * }\n */\nexports.shouldUpdateScroll = true\n\n/**\n * Allow a plugin to register a Service Worker. Should be a function that returns true.\n * @param {emptyArg} _\n * @param {pluginOptions} pluginOptions\n * @returns {boolean} Should Gatsby register `/sw.js` service worker\n * @example\n * exports.registerServiceWorker = () => true\n */\nexports.registerServiceWorker = true\n\n/**\n * Allow a plugin to replace the page component renderer.\n * @deprecated Use [wrapPageElement](#wrapPageElement) to decorate page element.\n * @param {object} $0\n * @param {object} $0.props The props of the page.\n * @param {object} $0.loader The gatsby loader.\n * @param {pluginOptions} pluginOptions\n * @returns {ReactNode} Replaced default page renderer\n */\nexports.replaceComponentRenderer = true\n\n/**\n * Allow a plugin to wrap the page element.\n *\n * This is useful for setting wrapper components around pages that won't get\n * unmounted on page changes. For setting Provider components, use [wrapRootElement](#wrapRootElement).\n *\n * _Note:_\n * There is an equivalent hook in Gatsby's [SSR API](/docs/ssr-apis/#wrapPageElement).\n * It is recommended to use both APIs together.\n * For example usage, check out [Using i18n](https://github.com/gatsbyjs/gatsby/tree/master/examples/using-i18n).\n * @param {object} $0\n * @param {ReactNode} $0.element The \"Page\" React Element built by Gatsby.\n * @param {object} $0.props Props object used by page.\n * @param {pluginOptions} pluginOptions\n * @returns {ReactNode} Wrapped element\n * @example\n * const React = require(\"react\")\n * const Layout = require(\"./src/components/layout\").default\n *\n * exports.wrapPageElement = ({ element, props }) => {\n * // props provide same data to Layout as Page element will get\n * // including location, data, etc - you don't need to pass it\n * return <Layout {...props}>{element}</Layout>\n * }\n */\nexports.wrapPageElement = true\n\n/**\n * Allow a plugin to wrap the root element.\n *\n * This is useful to set up any Provider components that will wrap your application.\n * For setting persistent UI elements around pages use [wrapPageElement](#wrapPageElement).\n *\n * _Note:_\n * There is an equivalent hook in Gatsby's [SSR API](/docs/ssr-apis/#wrapRootElement).\n * It is recommended to use both APIs together.\n * For example usage, check out [Using redux](https://github.com/gatsbyjs/gatsby/tree/master/examples/using-redux).\n * @param {object} $0\n * @param {ReactNode} $0.element The \"Root\" React Element built by Gatsby.\n * @param {pluginOptions} pluginOptions\n * @returns {ReactNode} Wrapped element\n * @example\n * const React = require(\"react\")\n * const { Provider } = require(\"react-redux\")\n *\n * const createStore = require(\"./src/state/createStore\")\n * const store = createStore()\n *\n * exports.wrapRootElement = ({ element }) => {\n * return (\n * <Provider store={store}>\n * {element}\n * </Provider>\n * )\n * }\n */\nexports.wrapRootElement = true\n\n/**\n * Called when prefetching for a pathname is triggered. Allows\n * for plugins with custom prefetching logic.\n * @param {object} $0\n * @param {string} $0.pathname The pathname whose resources should now be prefetched\n * @param {function} $0.loadPage Function for fetching resources related to pathname\n * @param {pluginOptions} pluginOptions\n */\nexports.onPrefetchPathname = true\n\n/**\n * Called when prefetching for a pathname is successful. Allows\n * for plugins with custom prefetching logic.\n * @param {object} $0\n * @param {string} $0.pathname The pathname whose resources have now been prefetched\n * @param {pluginOptions} pluginOptions\n */\nexports.onPostPrefetchPathname = true\n\n/**\n * Plugins can take over prefetching logic. If they do, they should call this\n * to disable the now duplicate core prefetching logic.\n * @param {emptyArg} _\n * @param {pluginOptions} pluginOptions\n * @returns {boolean} Should disable core prefetching\n * @example\n * exports.disableCorePrefetching = () => true\n */\nexports.disableCorePrefetching = true\n\n/**\n * Allow a plugin to replace the `ReactDOM.render`/`ReactDOM.hydrate` function call by a custom renderer.\n * @param {emptyArg} _\n * @param {pluginOptions} pluginOptions\n * @returns {Function} This method should return a function with same signature as `ReactDOM.render()`\n *\n * _Note:_ it's very important to call the `callback` after rendering, otherwise Gatsby will not be able to call `onInitialClientRender`\n * @example\n * exports.replaceHydrateFunction = () => {\n * return (element, container, callback) => {\n * console.log(\"rendering!\");\n * ReactDOM.render(element, container, callback);\n * };\n * };\n */\nexports.replaceHydrateFunction = true\n\n/**\n * Inform plugins when a service worker has been installed.\n * @param {object} $0\n * @param {object} $0.serviceWorker The service worker instance.\n * @param {pluginOptions} pluginOptions\n */\nexports.onServiceWorkerInstalled = true\n\n/**\n * Inform plugins of when a service worker has an update available.\n * @param {object} $0\n * @param {object} $0.serviceWorker The service worker instance.\n * @param {pluginOptions} pluginOptions\n */\nexports.onServiceWorkerUpdateFound = true\n\n/**\n * Inform plugins when a service worker has been updated in the background\n * and the page is ready to reload to apply changes.\n * @param {object} $0\n * @param {object} $0.serviceWorker The service worker instance.\n * @param {pluginOptions} pluginOptions\n */\nexports.onServiceWorkerUpdateReady = true\n\n/**\n * Inform plugins when a service worker has become active.\n * @param {object} $0\n * @param {object} $0.serviceWorker The service worker instance.\n * @param {pluginOptions} pluginOptions\n */\nexports.onServiceWorkerActive = true\n\n/**\n * Inform plugins when a service worker is redundant.\n * @param {object} $0\n * @param {object} $0.serviceWorker The service worker instance.\n * @param {pluginOptions} pluginOptions\n */\nexports.onServiceWorkerRedundant = true\n"],"file":"api-browser-docs.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/api-browser-docs.js"],"names":["exports","onClientEntry","onInitialClientRender","onPreRouteUpdate","onRouteUpdateDelayed","onRouteUpdate","shouldUpdateScroll","registerServiceWorker","replaceComponentRenderer","wrapPageElement","wrapRootElement","onPrefetchPathname","onPostPrefetchPathname","disableCorePrefetching","replaceHydrateFunction","onServiceWorkerInstalled","onServiceWorkerUpdateFound","onServiceWorkerUpdateReady","onServiceWorkerActive","onServiceWorkerRedundant"],"mappings":";;AAAA;;;;;AAKA;;;;;AAKA;;;;;;;;;;AAUAA,OAAO,CAACC,aAAR,GAAwB,IAAxB;AAEA;;;;;;;;;;AASAD,OAAO,CAACE,qBAAR,GAAgC,IAAhC;AAEA;;;;;;;;;;;;;AAYAF,OAAO,CAACG,gBAAR,GAA2B,IAA3B;AAEA;;;;;;;;;;;;AAWAH,OAAO,CAACI,oBAAR,GAA+B,IAA/B;AAEA;;;;;;;;;;;;;AAYAJ,OAAO,CAACK,aAAR,GAAwB,IAAxB;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BAL,OAAO,CAACM,kBAAR,GAA6B,IAA7B;AAEA;;;;;;;;;AAQAN,OAAO,CAACO,qBAAR,GAAgC,IAAhC;AAEA;;;;;;;;;;AASAP,OAAO,CAACQ,wBAAR,GAAmC,IAAnC;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBAR,OAAO,CAACS,eAAR,GAA0B,IAA1B;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BAT,OAAO,CAACU,eAAR,GAA0B,IAA1B;AAEA;;;;;;;;;AAQAV,OAAO,CAACW,kBAAR,GAA6B,IAA7B;AAEA;;;;;;;;AAOAX,OAAO,CAACY,sBAAR,GAAiC,IAAjC;AAEA;;;;;;;;;;AASAZ,OAAO,CAACa,sBAAR,GAAiC,IAAjC;AAEA;;;;;;;;;;;;;;;;AAeAb,OAAO,CAACc,sBAAR,GAAiC,IAAjC;AAEA;;;;;;;AAMAd,OAAO,CAACe,wBAAR,GAAmC,IAAnC;AAEA;;;;;;;AAMAf,OAAO,CAACgB,0BAAR,GAAqC,IAArC;AAEA;;;;;;;;AAOAhB,OAAO,CAACiB,0BAAR,GAAqC,IAArC;AAEA;;;;;;;AAMAjB,OAAO,CAACkB,qBAAR,GAAgC,IAAhC;AAEA;;;;;;;AAMAlB,OAAO,CAACmB,wBAAR,GAAmC,IAAnC","sourcesContent":["/**\n * This argument is empty. This is for consistency so `pluginOptions` is always second argument.\n * @typedef {undefined} emptyArg\n */\n\n/**\n * Object containing options defined in `gatsby-config.js`\n * @typedef {object} pluginOptions\n */\n\n/**\n * Called when the Gatsby browser runtime first starts.\n * @param {emptyArg} _\n * @param {pluginOptions} pluginOptions\n * @example\n * exports.onClientEntry = () => {\n * console.log(\"We've started!\")\n * callAnalyticsAPI()\n * }\n */\nexports.onClientEntry = true\n\n/**\n * Called when the initial (but not subsequent) render of Gatsby App is done on the client.\n * @param {emptyArg} _\n * @param {pluginOptions} pluginOptions\n * @example\n * exports.onInitialClientRender = () => {\n * console.log(\"ReactDOM.render has executed\")\n * }\n */\nexports.onInitialClientRender = true\n\n/**\n * Called when changing location is started.\n * @param {object} $0\n * @param {object} $0.location A location object\n * @param {object|null} $0.prevLocation The previous location object\n * @param {pluginOptions} pluginOptions\n * @example\n * exports.onPreRouteUpdate = ({ location, prevLocation }) => {\n * console.log(\"Gatsby started to change location to\", location.pathname)\n * console.log(\"Gatsby started to change location from\", prevLocation ? prevLocation.pathname : null)\n * }\n */\nexports.onPreRouteUpdate = true\n\n/**\n * Called when changing location is longer than 1 second.\n * @param {object} $0\n * @param {object} $0.location A location object\n * @param {object} $0.action The \"action\" that caused the route change\n * @param {pluginOptions} pluginOptions\n * @example\n * exports.onRouteUpdateDelayed = () => {\n * console.log(\"We can show loading indicator now\")\n * }\n */\nexports.onRouteUpdateDelayed = true\n\n/**\n * Called when the user changes routes, including on the initial load of the app\n * @param {object} $0\n * @param {object} $0.location A location object\n * @param {object|null} $0.prevLocation The previous location object\n * @param {pluginOptions} pluginOptions\n * @example\n * exports.onRouteUpdate = ({ location, prevLocation }) => {\n * console.log('new pathname', location.pathname)\n * console.log('old pathname', prevLocation ? prevLocation.pathname : null)\n * }\n */\nexports.onRouteUpdate = true\n\n/**\n * Allows a plugin to influence scrolling behavior on navigation.\n * Default behavior is persisting last known scrolling positions and scrolling back to them on navigation.\n * Plugins can also override this and return an Array of coordinates or an element name to scroll to.\n * @param {object} $0\n * @param {object} $0.prevRouterProps The previous state of the router before the route change.\n * @param {object} $0.routerProps The current state of the router.\n * @param {string} $0.pathname The new pathname (for backwards compatibility with v1).\n * @param {function} $0.getSavedScrollPosition Takes a location and returns the\n * coordinates of the last scroll position for that location, or `null`. Gatsby\n * saves scroll positions for each route in `SessionStorage`, so they are\n * available after page reload.\n * @returns {(boolean|string|Array)} Should return either an [x, y] Array of\n * coordinates to scroll to, a string of the `id` or `name` of an element to\n * scroll to, `false` to not update the scroll position, or `true` for the\n * default behavior.\n * @param {pluginOptions} pluginOptions\n * @example\n * exports.shouldUpdateScroll = ({\n * routerProps: { location },\n * getSavedScrollPosition\n * }) => {\n * const currentPosition = getSavedScrollPosition(location)\n * const queriedPosition = getSavedScrollPosition({ pathname: `/random` })\n *\n * window.scrollTo(...(currentPosition || [0, 0]))\n *\n * return false\n * }\n */\nexports.shouldUpdateScroll = true\n\n/**\n * Allow a plugin to register a Service Worker. Should be a function that returns true.\n * @param {emptyArg} _\n * @param {pluginOptions} pluginOptions\n * @returns {boolean} Should Gatsby register `/sw.js` service worker\n * @example\n * exports.registerServiceWorker = () => true\n */\nexports.registerServiceWorker = true\n\n/**\n * Allow a plugin to replace the page component renderer.\n * @deprecated Use [wrapPageElement](#wrapPageElement) to decorate page element.\n * @param {object} $0\n * @param {object} $0.props The props of the page.\n * @param {object} $0.loader The gatsby loader.\n * @param {pluginOptions} pluginOptions\n * @returns {ReactNode} Replaced default page renderer\n */\nexports.replaceComponentRenderer = true\n\n/**\n * Allow a plugin to wrap the page element.\n *\n * This is useful for setting wrapper components around pages that won't get\n * unmounted on page changes. For setting Provider components, use [wrapRootElement](#wrapRootElement).\n *\n * _Note:_\n * There is an equivalent hook in Gatsby's [SSR API](/docs/ssr-apis/#wrapPageElement).\n * It is recommended to use both APIs together.\n * For example usage, check out [Using i18n](https://github.com/gatsbyjs/gatsby/tree/master/examples/using-i18n).\n * @param {object} $0\n * @param {ReactNode} $0.element The \"Page\" React Element built by Gatsby.\n * @param {object} $0.props Props object used by page.\n * @param {pluginOptions} pluginOptions\n * @returns {ReactNode} Wrapped element\n * @example\n * const React = require(\"react\")\n * const Layout = require(\"./src/components/layout\").default\n *\n * exports.wrapPageElement = ({ element, props }) => {\n * // props provide same data to Layout as Page element will get\n * // including location, data, etc - you don't need to pass it\n * return <Layout {...props}>{element}</Layout>\n * }\n */\nexports.wrapPageElement = true\n\n/**\n * Allow a plugin to wrap the root element.\n *\n * This is useful to set up any Provider components that will wrap your application.\n * For setting persistent UI elements around pages use [wrapPageElement](#wrapPageElement).\n *\n * _Note:_\n * There is an equivalent hook in Gatsby's [SSR API](/docs/ssr-apis/#wrapRootElement).\n * It is recommended to use both APIs together.\n * For example usage, check out [Using redux](https://github.com/gatsbyjs/gatsby/tree/master/examples/using-redux).\n * @param {object} $0\n * @param {ReactNode} $0.element The \"Root\" React Element built by Gatsby.\n * @param {pluginOptions} pluginOptions\n * @returns {ReactNode} Wrapped element\n * @example\n * const React = require(\"react\")\n * const { Provider } = require(\"react-redux\")\n *\n * const createStore = require(\"./src/state/createStore\")\n * const store = createStore()\n *\n * exports.wrapRootElement = ({ element }) => {\n * return (\n * <Provider store={store}>\n * {element}\n * </Provider>\n * )\n * }\n */\nexports.wrapRootElement = true\n\n/**\n * Called when prefetching for a pathname is triggered. Allows\n * for plugins with custom prefetching logic.\n * @param {object} $0\n * @param {string} $0.pathname The pathname whose resources should now be prefetched\n * @param {function} $0.loadPage Function for fetching resources related to pathname\n * @param {pluginOptions} pluginOptions\n */\nexports.onPrefetchPathname = true\n\n/**\n * Called when prefetching for a pathname is successful. Allows\n * for plugins with custom prefetching logic.\n * @param {object} $0\n * @param {string} $0.pathname The pathname whose resources have now been prefetched\n * @param {pluginOptions} pluginOptions\n */\nexports.onPostPrefetchPathname = true\n\n/**\n * Plugins can take over prefetching logic. If they do, they should call this\n * to disable the now duplicate core prefetching logic.\n * @param {emptyArg} _\n * @param {pluginOptions} pluginOptions\n * @returns {boolean} Should disable core prefetching\n * @example\n * exports.disableCorePrefetching = () => true\n */\nexports.disableCorePrefetching = true\n\n/**\n * Allow a plugin to replace the `ReactDOM.render`/`ReactDOM.hydrate` function call by a custom renderer.\n * @param {emptyArg} _\n * @param {pluginOptions} pluginOptions\n * @returns {Function} This method should return a function with same signature as `ReactDOM.render()`\n *\n * _Note:_ it's very important to call the `callback` after rendering, otherwise Gatsby will not be able to call `onInitialClientRender`\n * @example\n * exports.replaceHydrateFunction = () => {\n * return (element, container, callback) => {\n * console.log(\"rendering!\");\n * ReactDOM.render(element, container, callback);\n * };\n * };\n */\nexports.replaceHydrateFunction = true\n\n/**\n * Inform plugins when a service worker has been installed.\n * @param {object} $0\n * @param {object} $0.serviceWorker The service worker instance.\n * @param {pluginOptions} pluginOptions\n */\nexports.onServiceWorkerInstalled = true\n\n/**\n * Inform plugins of when a service worker has an update available.\n * @param {object} $0\n * @param {object} $0.serviceWorker The service worker instance.\n * @param {pluginOptions} pluginOptions\n */\nexports.onServiceWorkerUpdateFound = true\n\n/**\n * Inform plugins when a service worker has been updated in the background\n * and the page is ready to reload to apply changes.\n * @param {object} $0\n * @param {object} $0.serviceWorker The service worker instance.\n * @param {pluginOptions} pluginOptions\n */\nexports.onServiceWorkerUpdateReady = true\n\n/**\n * Inform plugins when a service worker has become active.\n * @param {object} $0\n * @param {object} $0.serviceWorker The service worker instance.\n * @param {pluginOptions} pluginOptions\n */\nexports.onServiceWorkerActive = true\n\n/**\n * Inform plugins when a service worker is redundant.\n * @param {object} $0\n * @param {object} $0.serviceWorker The service worker instance.\n * @param {pluginOptions} pluginOptions\n */\nexports.onServiceWorkerRedundant = true\n"],"file":"api-browser-docs.js"}
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} = require(`../redux`);
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.createSchemaCustomization = void 0;
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
var _apiRunnerNode = _interopRequireDefault(require("./api-runner-node"));
|
|
9
|
+
|
|
10
|
+
var _redux = require("../redux");
|
|
11
|
+
|
|
12
|
+
const createSchemaCustomization = async ({
|
|
10
13
|
refresh = false,
|
|
11
14
|
parentSpan
|
|
12
15
|
}) => {
|
|
13
16
|
if (refresh) {
|
|
14
|
-
store.dispatch({
|
|
17
|
+
_redux.store.dispatch({
|
|
15
18
|
type: `CLEAR_SCHEMA_CUSTOMIZATION`
|
|
16
19
|
});
|
|
17
20
|
}
|
|
18
21
|
|
|
19
|
-
await
|
|
22
|
+
await (0, _apiRunnerNode.default)(`createSchemaCustomization`, {
|
|
20
23
|
parentSpan,
|
|
21
24
|
traceId: !refresh ? `initial-createSchemaCustomization` : `refresh-createSchemaCustomization`
|
|
22
25
|
});
|
|
23
26
|
};
|
|
27
|
+
|
|
28
|
+
exports.createSchemaCustomization = createSchemaCustomization;
|
|
24
29
|
//# sourceMappingURL=create-schema-customization.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/create-schema-customization.
|
|
1
|
+
{"version":3,"sources":["../../src/utils/create-schema-customization.ts"],"names":["createSchemaCustomization","refresh","parentSpan","store","dispatch","type","traceId"],"mappings":";;;;;;;AAAA;;AACA;;AAGO,MAAMA,yBAAyB,GAAG,OAAO;AAC9CC,EAAAA,OAAO,GAAG,KADoC;AAE9CC,EAAAA;AAF8C,CAAP,KAMpB;AACnB,MAAID,OAAJ,EAAa;AACXE,iBAAMC,QAAN,CAAe;AAAEC,MAAAA,IAAI,EAAG;AAAT,KAAf;AACD;;AACD,QAAM,4BAAe,2BAAf,EAA2C;AAC/CH,IAAAA,UAD+C;AAE/CI,IAAAA,OAAO,EAAE,CAACL,OAAD,GACJ,mCADI,GAEJ;AAJ0C,GAA3C,CAAN;AAMD,CAhBM","sourcesContent":["import apiRunnerNode from \"./api-runner-node\"\nimport { store } from \"../redux\"\nimport { Span } from \"opentracing\"\n\nexport const createSchemaCustomization = async ({\n refresh = false,\n parentSpan,\n}: {\n refresh?: boolean\n parentSpan?: Span\n}): Promise<void> => {\n if (refresh) {\n store.dispatch({ type: `CLEAR_SCHEMA_CUSTOMIZATION` })\n }\n await apiRunnerNode(`createSchemaCustomization`, {\n parentSpan,\n traceId: !refresh\n ? `initial-createSchemaCustomization`\n : `refresh-createSchemaCustomization`,\n })\n}\n"],"file":"create-schema-customization.js"}
|
package/dist/utils/feedback.js
CHANGED
|
@@ -31,7 +31,18 @@ function showFeedbackRequest() {
|
|
|
31
31
|
_reporter.default.log(`\n\nHello! Will you help Gatsby improve by taking a four question survey?\nIt takes less than five minutes and your ideas and feedback will be very helpful.`);
|
|
32
32
|
|
|
33
33
|
_reporter.default.log(`\nGive us your feedback here: https://gatsby.dev/feedback\n\n`);
|
|
34
|
-
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const randomChanceToBeTrue = () => {
|
|
37
|
+
// This is spreading the request volume over the quarter.
|
|
38
|
+
// We are grabbing a randomNumber within the spread of a first day
|
|
39
|
+
// of a quarter, to the last day
|
|
40
|
+
const currentQuarter = Math.floor((new Date().getMonth() + 3) / 3);
|
|
41
|
+
const randomNumber = Math.floor(Math.random() * ( // One quarter year in days (roughly)
|
|
42
|
+
30 * 3));
|
|
43
|
+
const randomNumberWithinQuarter = randomNumber * currentQuarter;
|
|
44
|
+
return randomNumberWithinQuarter === (0, _getDayOfYear.default)(new Date());
|
|
45
|
+
}; // We are only showing feedback requests to users in if they pass a few checks:
|
|
35
46
|
// 1. They pass a Math.random() check. This is a skateboard version of not sending out all requests in one day.
|
|
36
47
|
// 2. They haven't disabled the feedback mechanism
|
|
37
48
|
// 3. They don't have the environment variable to disable feedback present
|
|
@@ -41,15 +52,12 @@ function showFeedbackRequest() {
|
|
|
41
52
|
|
|
42
53
|
async function userPassesFeedbackRequestHeuristic() {
|
|
43
54
|
// Heuristic 1
|
|
44
|
-
//
|
|
45
|
-
// We
|
|
46
|
-
// of
|
|
47
|
-
const
|
|
48
|
-
const randomNumber = Math.floor(Math.random() * ( // One quarter year in days (roughly)
|
|
49
|
-
30 * 3));
|
|
50
|
-
const randomNumberWithinQuarter = randomNumber * currentQuarter;
|
|
55
|
+
// We originally wrote this to have a single chance of hitting.
|
|
56
|
+
// We wanted to up the chance by 5x, so this is our crude - temporary -
|
|
57
|
+
// way of giving the user 5 chances to passing.
|
|
58
|
+
const randomlyPassingHeuristic = randomChanceToBeTrue() || randomChanceToBeTrue() || randomChanceToBeTrue() || randomChanceToBeTrue() || randomChanceToBeTrue();
|
|
51
59
|
|
|
52
|
-
if (
|
|
60
|
+
if (!randomlyPassingHeuristic) {
|
|
53
61
|
return false;
|
|
54
62
|
} // Heuristic 2
|
|
55
63
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/feedback.ts"],"names":["feedbackKey","lastDateKey","setFeedbackDisabledValue","enabled","set","showFeedbackRequest","Date","now","report","log","
|
|
1
|
+
{"version":3,"sources":["../../src/utils/feedback.ts"],"names":["feedbackKey","lastDateKey","setFeedbackDisabledValue","enabled","set","showFeedbackRequest","Date","now","report","log","randomChanceToBeTrue","currentQuarter","Math","floor","getMonth","randomNumber","random","randomNumberWithinQuarter","userPassesFeedbackRequestHeuristic","randomlyPassingHeuristic","get","process","env","GATSBY_FEEDBACK_DISABLED","lastDateValue","lastDate","monthsSinceLastRequest","versionPoints","split","latestVersionPoints","e","versionsMatchOnMajorAndMinor"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA,MAAMA,WAAW,GAAI,mBAArB;AACA,MAAMC,WAAW,GA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AAG,uCAAiBJ,GAAjB,CAAqBnB,WAArB,CAAtB,CA3B2E,CA4B3E;AACA;AACA;;AACA,MAAIuB,aAAJ,EAAmB;AACjB,UAAMC,QAAQ,GAAG,IAAInB,IAAJ,CAASkB,aAAT,CAAjB;AACA,UAAME,sBAAsB,GAAGD,QAAQ,CAACX,QAAT,KAAsB,IAAIR,IAAJ,GAAWQ,QAAX,EAArD;;AAEA,QAAIY,sBAAsB,GAAG,CAA7B,EAAgC;AAC9B,aAAO,KAAP;AACD;AACF,GAtC0E,CAwC3E;;;AACA,QAAMC,aAAa,GAAG,yCAAmBC,KAAnB,CAA0B,GAA1B,CAAtB;AACA,MAAIC,mBAA6B,GAAG,EAApC;;AACA,MAAI;AACFA,IAAAA,mBAAmB,GAAG,CAAC,MAAM,4BAAe,QAAf,CAAP,EAAgCD,KAAhC,CAAuC,GAAvC,CAAtB;AACD,GAFD,CAEE,OAAOE,CAAP,EAAU,CAKX,CALC,CACA;AACA;AACA;AACA;AAGF;AACA;AACA;;;AACA,QAAMC,4BAA4B,GAChCJ,aAAa,CAAC,CAAD,CAAb,KAAqBE,mBAAmB,CAAC,CAAD,CAAxC,IACAF,aAAa,CAAC,CAAD,CAAb,KAAqBE,mBAAmB,CAAC,CAAD,CAF1C;;AAIA,MAAIE,4BAA4B,KAAK,KAArC,EAA4C;AAC1C,WAAO,KAAP;AACD,GA7D0E,CA+D3E;AACA;;;AACA,SAAO,IAAP;AACD","sourcesContent":["import report from \"gatsby-cli/lib/reporter\"\nimport { getConfigStore, getGatsbyVersion } from \"gatsby-core-utils\"\nimport latestVersion from \"latest-version\"\nimport getDayOfYear from \"date-fns/getDayOfYear\"\n\nconst feedbackKey = `feedback.disabled`\nconst lastDateKey = `feedback.lastRequestDate`\n\n// This function is designed to be used by `gatsby feedback --disable`\n// and `gatsby feedback --enable`. This key is used to determine\n// if a user is allowed to be solicited for feedback\nexport function setFeedbackDisabledValue(enabled: boolean): void {\n getConfigStore().set(feedbackKey, enabled)\n}\n\n// Print the feedback request to the user\nexport function showFeedbackRequest(): void {\n getConfigStore().set(lastDateKey, Date.now())\n report.log(\n `\\n\\nHello! Will you help Gatsby improve by taking a four question survey?\\nIt takes less than five minutes and your ideas and feedback will be very helpful.`\n )\n report.log(`\\nGive us your feedback here: https://gatsby.dev/feedback\\n\\n`)\n}\n\nconst randomChanceToBeTrue = (): boolean => {\n // This is spreading the request volume over the quarter.\n // We are grabbing a randomNumber within the spread of a first day\n // of a quarter, to the last day\n const currentQuarter = Math.floor((new Date().getMonth() + 3) / 3)\n const randomNumber = Math.floor(\n Math.random() *\n // One quarter year in days (roughly)\n (30 * 3)\n )\n const randomNumberWithinQuarter = randomNumber * currentQuarter\n\n return randomNumberWithinQuarter === getDayOfYear(new Date())\n}\n\n// We are only showing feedback requests to users in if they pass a few checks:\n// 1. They pass a Math.random() check. This is a skateboard version of not sending out all requests in one day.\n// 2. They haven't disabled the feedback mechanism\n// 3. They don't have the environment variable to disable feedback present\n// 4. It's been at least 3 months since the last feedback request\n// 5. They are on the most recent version of Gatsby\nexport async function userPassesFeedbackRequestHeuristic(): Promise<boolean> {\n // Heuristic 1\n // We originally wrote this to have a single chance of hitting.\n // We wanted to up the chance by 5x, so this is our crude - temporary -\n // way of giving the user 5 chances to passing.\n const randomlyPassingHeuristic =\n randomChanceToBeTrue() ||\n randomChanceToBeTrue() ||\n randomChanceToBeTrue() ||\n randomChanceToBeTrue() ||\n randomChanceToBeTrue()\n\n if (!randomlyPassingHeuristic) {\n return false\n }\n\n // Heuristic 2\n if (getConfigStore().get(feedbackKey) === true) {\n return false\n }\n\n // Heuristic 3\n if (process.env.GATSBY_FEEDBACK_DISABLED === `1`) {\n return false\n }\n\n // Heuristic 4\n const lastDateValue = getConfigStore().get(lastDateKey)\n // 4.a if the user has never received the feedback request, this is undefined\n // Which is effectively a pass, because it's been ~infinity~ since they last\n // received a request from us.\n if (lastDateValue) {\n const lastDate = new Date(lastDateValue)\n const monthsSinceLastRequest = lastDate.getMonth() - new Date().getMonth()\n\n if (monthsSinceLastRequest < 3) {\n return false\n }\n }\n\n // Heuristic 5\n const versionPoints = getGatsbyVersion().split(`.`)\n let latestVersionPoints: string[] = []\n try {\n latestVersionPoints = (await latestVersion(`gatsby`)).split(`.`)\n } catch (e) {\n // do nothing.\n // if the request fails, then we should just not show the feedback request\n // because this in theory could happen often and we don't want to be spammy.\n // In this case, we are guaranteed to have `versionsMatchOnMajorAndMinor` === false\n }\n\n // Since we push versions very frequently. So thinking that users will\n // be on the latest patch is potentially unrealistic. So we are just\n // comparing on major and minor version points.\n const versionsMatchOnMajorAndMinor =\n versionPoints[0] === latestVersionPoints[0] &&\n versionPoints[1] === latestVersionPoints[1]\n\n if (versionsMatchOnMajorAndMinor === false) {\n return false\n }\n\n // If all of the above passed, then the user is able to be prompted\n // for feedback\n return true\n}\n"],"file":"feedback.js"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
slash
|
|
5
|
-
} = require(`gatsby-core-utils`);
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.stopTracer = exports.initTracer = void 0;
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
var _gatsbyCoreUtils = require("gatsby-core-utils");
|
|
9
|
+
|
|
10
|
+
var _path = _interopRequireDefault(require("path"));
|
|
11
|
+
|
|
12
|
+
var _opentracing = require("opentracing");
|
|
10
13
|
|
|
11
14
|
let tracerProvider;
|
|
12
15
|
/**
|
|
@@ -19,29 +22,28 @@ let tracerProvider;
|
|
|
19
22
|
* exits
|
|
20
23
|
*/
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
const initTracer = tracerFile => {
|
|
23
26
|
let tracer;
|
|
24
27
|
|
|
25
28
|
if (tracerFile) {
|
|
26
|
-
const resolvedPath = slash(
|
|
29
|
+
const resolvedPath = (0, _gatsbyCoreUtils.slash)(_path.default.resolve(tracerFile));
|
|
27
30
|
tracerProvider = require(resolvedPath);
|
|
28
31
|
tracer = tracerProvider.create();
|
|
29
32
|
} else {
|
|
30
|
-
tracer = new
|
|
33
|
+
tracer = new _opentracing.Tracer(); // Noop
|
|
31
34
|
}
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
(0, _opentracing.initGlobalTracer)(tracer);
|
|
34
37
|
return tracer;
|
|
35
|
-
}
|
|
38
|
+
};
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
exports.initTracer = initTracer;
|
|
41
|
+
|
|
42
|
+
const stopTracer = async () => {
|
|
38
43
|
if (tracerProvider && tracerProvider.stop) {
|
|
39
44
|
await tracerProvider.stop();
|
|
40
45
|
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
module.exports = {
|
|
44
|
-
initTracer,
|
|
45
|
-
stopTracer
|
|
46
46
|
};
|
|
47
|
+
|
|
48
|
+
exports.stopTracer = stopTracer;
|
|
47
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/tracer/index.
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/tracer/index.ts"],"names":["tracerProvider","initTracer","tracerFile","tracer","resolvedPath","path","resolve","require","create","Tracer","stopTracer","stop"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAIA,cAAJ;AAEA;;;;;;;;;;AASO,MAAMC,UAAU,GAAIC,UAAD,IAAgC;AACxD,MAAIC,MAAJ;;AACA,MAAID,UAAJ,EAAgB;AACd,UAAME,YAAY,GAAG,4BAAMC,cAAKC,OAAL,CAAaJ,UAAb,CAAN,CAArB;AACAF,IAAAA,cAAc,GAAGO,OAAO,CAACH,YAAD,CAAxB;AACAD,IAAAA,MAAM,GAAGH,cAAc,CAACQ,MAAf,EAAT;AACD,GAJD,MAIO;AACLL,IAAAA,MAAM,GAAG,IAAIM,mBAAJ,EAAT,CADK,CACiB;AACvB;;AAED,qCAAiBN,MAAjB;AAEA,SAAOA,MAAP;AACD,CAbM;;;;AAeA,MAAMO,UAAU,GAAG,YAA2B;AACnD,MAAIV,cAAc,IAAIA,cAAc,CAACW,IAArC,EAA2C;AACzC,UAAMX,cAAc,CAACW,IAAf,EAAN;AACD;AACF,CAJM","sourcesContent":["import { slash } from \"gatsby-core-utils\"\nimport path from \"path\"\nimport { Tracer, initGlobalTracer } from \"opentracing\"\n\nlet tracerProvider\n\n/**\n * tracerFile should be a js file that exports two functions.\n *\n * `create` - Create and return an open-tracing compatible tracer. See\n * https://github.com/opentracing/opentracing-javascript/blob/master/src/tracer.ts\n *\n * `stop` - Run any tracer cleanup required before the node.js process\n * exits\n */\nexport const initTracer = (tracerFile: string): Tracer => {\n let tracer: Tracer\n if (tracerFile) {\n const resolvedPath = slash(path.resolve(tracerFile))\n tracerProvider = require(resolvedPath)\n tracer = tracerProvider.create()\n } else {\n tracer = new Tracer() // Noop\n }\n\n initGlobalTracer(tracer)\n\n return tracer\n}\n\nexport const stopTracer = async (): Promise<void> => {\n if (tracerProvider && tracerProvider.stop) {\n await tracerProvider.stop()\n }\n}\n"],"file":"index.js"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.reportWebpackWarnings = exports.structureWebpackErrors = void 0;
|
|
5
|
+
|
|
3
6
|
const reporter = require(`gatsby-cli/lib/reporter`);
|
|
4
7
|
|
|
5
8
|
const stageCodeToReadableLabel = {
|
|
@@ -30,7 +33,7 @@ const transformWebpackError = (stage, webpackError) => {
|
|
|
30
33
|
};
|
|
31
34
|
};
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
const structureWebpackErrors = (stage, webpackError) => {
|
|
34
37
|
if (Array.isArray(webpackError)) {
|
|
35
38
|
return webpackError.map(e => transformWebpackError(stage, e));
|
|
36
39
|
}
|
|
@@ -38,7 +41,9 @@ exports.structureWebpackErrors = (stage, webpackError) => {
|
|
|
38
41
|
return transformWebpackError(stage, webpackError);
|
|
39
42
|
};
|
|
40
43
|
|
|
41
|
-
exports.
|
|
44
|
+
exports.structureWebpackErrors = structureWebpackErrors;
|
|
45
|
+
|
|
46
|
+
const reportWebpackWarnings = stats => {
|
|
42
47
|
stats.compilation.warnings.forEach(webpackWarning => {
|
|
43
48
|
if (webpackWarning.warning) {
|
|
44
49
|
// grab inner Exception if it exists
|
|
@@ -48,4 +53,6 @@ exports.reportWebpackWarnings = stats => {
|
|
|
48
53
|
}
|
|
49
54
|
});
|
|
50
55
|
};
|
|
56
|
+
|
|
57
|
+
exports.reportWebpackWarnings = reportWebpackWarnings;
|
|
51
58
|
//# sourceMappingURL=webpack-error-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/webpack-error-utils.
|
|
1
|
+
{"version":3,"sources":["../../src/utils/webpack-error-utils.ts"],"names":["reporter","require","stageCodeToReadableLabel","develop","transformWebpackError","stage","webpackError","id","filePath","module","resource","location","error","loc","start","undefined","context","stageLabel","message","structureWebpackErrors","Array","isArray","map","e","reportWebpackWarnings","stats","compilation","warnings","forEach","webpackWarning","warning","warn","toString"],"mappings":";;;;;AAAA,MAAMA,QAAQ,GAAGC,OAAO,CAAE,yBAAF,CAAxB;;AAGA,MAAMC,wBAAwB,GAAG;AAC/B,sBAAqB,+BADU;AAE/B,gBAAe,uBAFgB;AAG/BC,EAAAA,OAAO,EAAG;AAHqB,CAAjC;;AAqBA,MAAMC,qBAAqB,GAAG,CAC5BC,KAD4B,EAE5BC,YAF4B,KAGC;AAAA;;AAC7B,SAAO;AACLC,IAAAA,EAAE,EAAG,OADA;AAELC,IAAAA,QAAQ,EAAEF,YAAF,aAAEA,YAAF,+CAAEA,YAAY,CAAEG,MAAhB,yDAAE,qBAAsBC,QAF3B;AAGLC,IAAAA,QAAQ,EACN,CAAAL,YAAY,SAAZ,IAAAA,YAAY,WAAZ,qCAAAA,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gatsby-cli/lib/reporter`)\nimport { Stats } from \"webpack\"\n\nconst stageCodeToReadableLabel = {\n \"build-javascript\": `Generating JavaScript bundles`,\n \"build-html\": `Generating SSR bundle`,\n develop: `Generating development JavaScript bundle`,\n} as const\n\ntype Stage = keyof typeof stageCodeToReadableLabel\ntype StageLabel = typeof stageCodeToReadableLabel[Stage]\n\ninterface ITransformedWebpackError {\n id: \"98123\"\n filePath?: string\n location?: {\n start: string\n }\n context: {\n stage: Stage\n stageLabel: StageLabel\n message?: string\n }\n}\nconst transformWebpackError = (\n stage: keyof typeof stageCodeToReadableLabel,\n webpackError: any\n): ITransformedWebpackError => {\n return {\n id: `98123`,\n filePath: webpackError?.module?.resource,\n location:\n webpackError?.module?.resource && webpackError?.error?.loc\n ? {\n start: webpackError.error.loc,\n }\n : undefined,\n context: {\n stage,\n stageLabel: stageCodeToReadableLabel[stage],\n message: webpackError?.error?.message || webpackError?.message,\n },\n\n // We use original error to display stack trace for the most part.\n // In case of webpack error stack will include internals of webpack\n // or one of loaders (for example babel-loader) and doesn't provide\n // much value to user, so it's purposely omitted.\n // error: webpackError?.error || webpackError,\n }\n}\n\nexport const structureWebpackErrors = (\n stage: Stage,\n webpackError: any\n): ITransformedWebpackError[] | ITransformedWebpackError => {\n if (Array.isArray(webpackError)) {\n return webpackError.map(e => transformWebpackError(stage, e))\n }\n\n return transformWebpackError(stage, webpackError)\n}\n\nexport const reportWebpackWarnings = (stats: Stats): void => {\n stats.compilation.warnings.forEach(webpackWarning => {\n if (webpackWarning.warning) {\n // grab inner Exception if it exists\n reporter.warn(webpackWarning.warning.toString())\n } else {\n reporter.warn(webpackWarning.message)\n }\n })\n}\n"],"file":"webpack-error-utils.js"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.builtinPlugins = void 0;
|
|
7
|
+
|
|
8
|
+
var _webpack = _interopRequireDefault(require("webpack"));
|
|
4
9
|
|
|
5
10
|
const plugin = (name, optimize) => {
|
|
6
|
-
const
|
|
7
|
-
return (...args) => new
|
|
11
|
+
const WebpackPlugin = (optimize ? _webpack.default.optimize : _webpack.default)[name];
|
|
12
|
+
return (...args) => new WebpackPlugin(...args);
|
|
8
13
|
};
|
|
9
14
|
|
|
10
|
-
const
|
|
15
|
+
const builtinPlugins = {
|
|
11
16
|
normalModuleReplacement: plugin(`NormalModuleReplacementPlugin`),
|
|
12
17
|
contextReplacement: plugin(`ContextReplacementPlugin`),
|
|
13
18
|
ignore: plugin(`IgnorePlugin`),
|
|
@@ -52,5 +57,5 @@ const plugins = {
|
|
|
52
57
|
occurrenceOrder: plugin(`OccurrenceOrderPlugin`, true),
|
|
53
58
|
moduleConcatenation: plugin(`ModuleConcatenationPlugin`, true)
|
|
54
59
|
};
|
|
55
|
-
|
|
60
|
+
exports.builtinPlugins = builtinPlugins;
|
|
56
61
|
//# sourceMappingURL=webpack-plugins.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/webpack-plugins.
|
|
1
|
+
{"version":3,"sources":["../../src/utils/webpack-plugins.ts"],"names":["plugin","name","optimize","WebpackPlugin","webpack","args","builtinPlugins","normalModuleReplacement","contextReplacement","ignore","watchIgnore","banner","prefetch","automaticPrefetch","define","provide","hotModuleReplacement","sourceMapDevTool","evalSourceMapDevTool","evalDevToolModule","cache","extendedAPI","externals","jsonpTemplate","libraryTemplate","loaderTarget","memoryOutputFile","progress","setVarMainTemplate","umdMainTemplate","noErrors","noEmitOnErrors","newWatching","environment","dll","dllReference","loaderOptions","namedModules","namedChunks","hashedModuleIds","moduleFilenameH","aggressiveMerging","aggressiveSplitting","splitChunks","chunkModuleIdRange","dedupe","limitChunkCount","minChunkSize","occurrenceOrder","moduleConcatenation"],"mappings":";;;;;;;AAAA;;AAEA,MAAMA,M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B,EAAE5C,MAAM,CAAE,0BAAF,EAA6B,IAA7B,CAvCE;AAwC5B6C,EAAAA,MAAM,EAAE7C,MAAM,CAAE,cAAF,EAAiB,IAAjB,CAxCc;AAyC5B8C,EAAAA,eAAe,EAAE9C,MAAM,CAAE,uBAAF,EAA0B,IAA1B,CAzCK;AA0C5B+C,EAAAA,YAAY,EAAE/C,MAAM,CAAE,oBAAF,EAAuB,IAAvB,CA1CQ;AA2C5BgD,EAAAA,eAAe,EAAEhD,MAAM,CAAE,uBAAF,EAA0B,IAA1B,CA3CK;AA4C5BiD,EAAAA,mBAAmB,EAAEjD,MAAM,CAAE,2BAAF,EAA8B,IAA9B;AA5CC,CAAvB","sourcesContent":["import webpack, { Plugin } from \"webpack\"\n\nconst plugin = (name: string, optimize?: boolean): Plugin => {\n const WebpackPlugin = (optimize ? webpack.optimize : webpack)[name]\n return (...args: any): Plugin => new WebpackPlugin(...args)\n}\n\nexport const builtinPlugins = {\n normalModuleReplacement: plugin(`NormalModuleReplacementPlugin`),\n contextReplacement: plugin(`ContextReplacementPlugin`),\n ignore: plugin(`IgnorePlugin`),\n watchIgnore: plugin(`WatchIgnorePlugin`),\n banner: plugin(`BannerPlugin`),\n prefetch: plugin(`PrefetchPlugin`),\n automaticPrefetch: plugin(`AutomaticPrefetchPlugin`),\n define: plugin(`DefinePlugin`),\n provide: plugin(`ProvidePlugin`),\n hotModuleReplacement: plugin(`HotModuleReplacementPlugin`),\n sourceMapDevTool: plugin(`SourceMapDevToolPlugin`),\n evalSourceMapDevTool: plugin(`EvalSourceMapDevToolPlugin`),\n evalDevToolModule: plugin(`EvalDevToolModulePlugin`),\n cache: plugin(`CachePlugin`),\n extendedAPI: plugin(`ExtendedAPIPlugin`),\n externals: plugin(`ExternalsPlugin`),\n jsonpTemplate: plugin(`JsonpTemplatePlugin`),\n libraryTemplate: plugin(`LibraryTemplatePlugin`),\n loaderTarget: plugin(`LoaderTargetPlugin`),\n memoryOutputFile: plugin(`MemoryOutputFileSystem`),\n progress: plugin(`ProgressPlugin`),\n setVarMainTemplate: plugin(`SetVarMainTemplatePlugin`),\n umdMainTemplate: plugin(`UmdMainTemplatePlugin`),\n noErrors: plugin(`NoErrorsPlugin`),\n noEmitOnErrors: plugin(`NoEmitOnErrorsPlugin`),\n newWatching: plugin(`NewWatchingPlugin`),\n environment: plugin(`EnvironmentPlugin`),\n dll: plugin(`DllPlugin`),\n dllReference: plugin(`DllReferencePlugin`),\n loaderOptions: plugin(`LoaderOptionsPlugin`),\n namedModules: plugin(`NamedModulesPlugin`),\n namedChunks: plugin(`NamedChunksPlugin`),\n hashedModuleIds: plugin(`HashedModuleIdsPlugin`),\n moduleFilenameH: plugin(`ModuleFilenameHelpers`),\n\n aggressiveMerging: plugin(`AggressiveMergingPlugin`, true),\n aggressiveSplitting: plugin(`AggressiveSplittingPlugin`, true),\n splitChunks: plugin(`SplitChunks`, true),\n chunkModuleIdRange: plugin(`ChunkModuleIdRangePlugin`, true),\n dedupe: plugin(`DedupePlugin`, true),\n limitChunkCount: plugin(`LimitChunkCountPlugin`, true),\n minChunkSize: plugin(`MinChunkSizePlugin`, true),\n occurrenceOrder: plugin(`OccurrenceOrderPlugin`, true),\n moduleConcatenation: plugin(`ModuleConcatenationPlugin`, true),\n}\n"],"file":"webpack-plugins.js"}
|
|
@@ -4,6 +4,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
|
|
5
5
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
6
6
|
|
|
7
|
+
var _webpackPlugins = require("./webpack-plugins");
|
|
8
|
+
|
|
7
9
|
const autoprefixer = require(`autoprefixer`);
|
|
8
10
|
|
|
9
11
|
const flexbugs = require(`postcss-flexbugs-fixes`);
|
|
@@ -22,8 +24,6 @@ const GatsbyWebpackStatsExtractor = require(`./gatsby-webpack-stats-extractor`);
|
|
|
22
24
|
|
|
23
25
|
const GatsbyWebpackEslintGraphqlSchemaReload = require(`./gatsby-webpack-eslint-graphql-schema-reload-plugin`);
|
|
24
26
|
|
|
25
|
-
const builtinPlugins = require(`./webpack-plugins`);
|
|
26
|
-
|
|
27
27
|
const eslintConfig = require(`./eslint-config`);
|
|
28
28
|
|
|
29
29
|
/**
|
|
@@ -40,13 +40,13 @@ module.exports = async ({
|
|
|
40
40
|
const isSSR = stage.includes(`html`);
|
|
41
41
|
|
|
42
42
|
const makeExternalOnly = original => (options = {}) => {
|
|
43
|
-
|
|
43
|
+
const rule = original(options);
|
|
44
44
|
rule.include = vendorRegex;
|
|
45
45
|
return rule;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
const makeInternalOnly = original => (options = {}) => {
|
|
49
|
-
|
|
49
|
+
const rule = original(options);
|
|
50
50
|
rule.exclude = vendorRegex;
|
|
51
51
|
return rule;
|
|
52
52
|
};
|
|
@@ -184,7 +184,7 @@ module.exports = async ({
|
|
|
184
184
|
*/
|
|
185
185
|
|
|
186
186
|
{
|
|
187
|
-
|
|
187
|
+
const js = (_ref = {}) => {
|
|
188
188
|
let {
|
|
189
189
|
modulesThatUseGatsby = []
|
|
190
190
|
} = _ref,
|
|
@@ -218,7 +218,7 @@ module.exports = async ({
|
|
|
218
218
|
*/
|
|
219
219
|
|
|
220
220
|
{
|
|
221
|
-
|
|
221
|
+
const dependencies = ({
|
|
222
222
|
modulesThatUseGatsby = []
|
|
223
223
|
} = {}) => {
|
|
224
224
|
const jsOptions = {
|
|
@@ -262,7 +262,7 @@ module.exports = async ({
|
|
|
262
262
|
rules.dependencies = dependencies;
|
|
263
263
|
}
|
|
264
264
|
{
|
|
265
|
-
|
|
265
|
+
const eslint = schema => {
|
|
266
266
|
return {
|
|
267
267
|
enforce: `pre`,
|
|
268
268
|
test: /\.jsx?$/,
|
|
@@ -396,7 +396,7 @@ module.exports = async ({
|
|
|
396
396
|
* Plugins
|
|
397
397
|
*/
|
|
398
398
|
|
|
399
|
-
const plugins = Object.assign({}, builtinPlugins);
|
|
399
|
+
const plugins = Object.assign({}, _webpackPlugins.builtinPlugins);
|
|
400
400
|
/**
|
|
401
401
|
* Minify JavaScript code without regard for IE8. Attempts
|
|
402
402
|
* to parallelize the work to save time. Generally only add in Production
|