@depup/gatsby 5.16.1-depup.0
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/LICENSE +22 -0
- package/README.md +142 -0
- package/adapters.js +31 -0
- package/apis.json +73 -0
- package/cache-dir/.eslintrc.json +10 -0
- package/cache-dir/api-runner-browser-plugins.js +14 -0
- package/cache-dir/api-runner-browser.js +52 -0
- package/cache-dir/api-runner-ssr.js +88 -0
- package/cache-dir/api-ssr-docs.js +207 -0
- package/cache-dir/app.js +249 -0
- package/cache-dir/blank.css +0 -0
- package/cache-dir/commonjs/api-runner-browser-plugins.js +17 -0
- package/cache-dir/commonjs/api-runner-browser-plugins.js.map +1 -0
- package/cache-dir/commonjs/api-runner-browser.js +49 -0
- package/cache-dir/commonjs/api-runner-browser.js.map +1 -0
- package/cache-dir/commonjs/api-runner-ssr.js +88 -0
- package/cache-dir/commonjs/api-runner-ssr.js.map +1 -0
- package/cache-dir/commonjs/api-ssr-docs.js +210 -0
- package/cache-dir/commonjs/api-ssr-docs.js.map +1 -0
- package/cache-dir/commonjs/app.js +197 -0
- package/cache-dir/commonjs/app.js.map +1 -0
- package/cache-dir/commonjs/context-utils.js +25 -0
- package/cache-dir/commonjs/context-utils.js.map +1 -0
- package/cache-dir/commonjs/create-content-digest-browser-shim.js +4 -0
- package/cache-dir/commonjs/create-content-digest-browser-shim.js.map +1 -0
- package/cache-dir/commonjs/css-to-object.js +21 -0
- package/cache-dir/commonjs/css-to-object.js.map +1 -0
- package/cache-dir/commonjs/debug-log.js +11 -0
- package/cache-dir/commonjs/debug-log.js.map +1 -0
- package/cache-dir/commonjs/default-html.js +33 -0
- package/cache-dir/commonjs/default-html.js.map +1 -0
- package/cache-dir/commonjs/dev-loader.js +247 -0
- package/cache-dir/commonjs/dev-loader.js.map +1 -0
- package/cache-dir/commonjs/develop-static-entry.js +129 -0
- package/cache-dir/commonjs/develop-static-entry.js.map +1 -0
- package/cache-dir/commonjs/dummy.js +8 -0
- package/cache-dir/commonjs/dummy.js.map +1 -0
- package/cache-dir/commonjs/emitter.js +10 -0
- package/cache-dir/commonjs/emitter.js.map +1 -0
- package/cache-dir/commonjs/ensure-resources.js +107 -0
- package/cache-dir/commonjs/ensure-resources.js.map +1 -0
- package/cache-dir/commonjs/error-overlay-handler.js +35 -0
- package/cache-dir/commonjs/error-overlay-handler.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/accordion.js +80 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/accordion.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/build-error.js +44 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/build-error.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/code-frame.js +38 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/code-frame.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/dev-ssr-error.js +52 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/dev-ssr-error.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/error-boundary.js +31 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/error-boundary.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/getserverdata-error.js +47 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/getserverdata-error.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/graphql-errors.js +77 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/graphql-errors.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/hooks.js +93 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/hooks.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/overlay.js +147 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/overlay.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/runtime-errors.js +110 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/runtime-errors.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/use-id.js +50 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/use-id.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/focus-trap.js +2879 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/focus-trap.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/keys.js +84 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/keys.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/lock-body.js +48 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/lock-body.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/match.js +44 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/match.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/index.js +182 -0
- package/cache-dir/commonjs/fast-refresh-overlay/index.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/style.js +418 -0
- package/cache-dir/commonjs/fast-refresh-overlay/style.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/utils.js +75 -0
- package/cache-dir/commonjs/fast-refresh-overlay/utils.js.map +1 -0
- package/cache-dir/commonjs/find-path.js +145 -0
- package/cache-dir/commonjs/find-path.js.map +1 -0
- package/cache-dir/commonjs/gatsby-browser-entry.js +52 -0
- package/cache-dir/commonjs/gatsby-browser-entry.js.map +1 -0
- package/cache-dir/commonjs/head/components/fire-callback-in-effect.js +18 -0
- package/cache-dir/commonjs/head/components/fire-callback-in-effect.js.map +1 -0
- package/cache-dir/commonjs/head/components/head-components.js +72 -0
- package/cache-dir/commonjs/head/components/head-components.js.map +1 -0
- package/cache-dir/commonjs/head/constants.js +13 -0
- package/cache-dir/commonjs/head/constants.js.map +1 -0
- package/cache-dir/commonjs/head/head-export-handler-for-browser.js +144 -0
- package/cache-dir/commonjs/head/head-export-handler-for-browser.js.map +1 -0
- package/cache-dir/commonjs/head/head-export-handler-for-ssr.js +225 -0
- package/cache-dir/commonjs/head/head-export-handler-for-ssr.js.map +1 -0
- package/cache-dir/commonjs/head/utils.js +264 -0
- package/cache-dir/commonjs/head/utils.js.map +1 -0
- package/cache-dir/commonjs/loader.js +861 -0
- package/cache-dir/commonjs/loader.js.map +1 -0
- package/cache-dir/commonjs/loading-indicator/index.js +25 -0
- package/cache-dir/commonjs/loading-indicator/index.js.map +1 -0
- package/cache-dir/commonjs/loading-indicator/indicator.js +63 -0
- package/cache-dir/commonjs/loading-indicator/indicator.js.map +1 -0
- package/cache-dir/commonjs/loading-indicator/style.js +103 -0
- package/cache-dir/commonjs/loading-indicator/style.js.map +1 -0
- package/cache-dir/commonjs/navigation.js +260 -0
- package/cache-dir/commonjs/navigation.js.map +1 -0
- package/cache-dir/commonjs/normalize-page-path.js +22 -0
- package/cache-dir/commonjs/normalize-page-path.js.map +1 -0
- package/cache-dir/commonjs/page-renderer.js +59 -0
- package/cache-dir/commonjs/page-renderer.js.map +1 -0
- package/cache-dir/commonjs/pages.json +1 -0
- package/cache-dir/commonjs/polyfill-entry.js +7 -0
- package/cache-dir/commonjs/polyfill-entry.js.map +1 -0
- package/cache-dir/commonjs/prefetch.js +67 -0
- package/cache-dir/commonjs/prefetch.js.map +1 -0
- package/cache-dir/commonjs/production-app.js +256 -0
- package/cache-dir/commonjs/production-app.js.map +1 -0
- package/cache-dir/commonjs/public-page-renderer-dev.js +26 -0
- package/cache-dir/commonjs/public-page-renderer-dev.js.map +1 -0
- package/cache-dir/commonjs/public-page-renderer-prod.js +30 -0
- package/cache-dir/commonjs/public-page-renderer-prod.js.map +1 -0
- package/cache-dir/commonjs/public-page-renderer.js +11 -0
- package/cache-dir/commonjs/public-page-renderer.js.map +1 -0
- package/cache-dir/commonjs/query-result-store.js +160 -0
- package/cache-dir/commonjs/query-result-store.js.map +1 -0
- package/cache-dir/commonjs/react-dom-utils.js +34 -0
- package/cache-dir/commonjs/react-dom-utils.js.map +1 -0
- package/cache-dir/commonjs/react-lifecycles-compat.js +4 -0
- package/cache-dir/commonjs/react-lifecycles-compat.js.map +1 -0
- package/cache-dir/commonjs/redirect-utils.js +25 -0
- package/cache-dir/commonjs/redirect-utils.js.map +1 -0
- package/cache-dir/commonjs/redirects.json +1 -0
- package/cache-dir/commonjs/register-service-worker.js +66 -0
- package/cache-dir/commonjs/register-service-worker.js.map +1 -0
- package/cache-dir/commonjs/root.js +105 -0
- package/cache-dir/commonjs/root.js.map +1 -0
- package/cache-dir/commonjs/route-announcer-props.js +24 -0
- package/cache-dir/commonjs/route-announcer-props.js.map +1 -0
- package/cache-dir/commonjs/server-utils/writable-as-promise.js +42 -0
- package/cache-dir/commonjs/server-utils/writable-as-promise.js.map +1 -0
- package/cache-dir/commonjs/shadow-portal.js +36 -0
- package/cache-dir/commonjs/shadow-portal.js.map +1 -0
- package/cache-dir/commonjs/slice/context.js +15 -0
- package/cache-dir/commonjs/slice/context.js.map +1 -0
- package/cache-dir/commonjs/slice/inline-slice.js +34 -0
- package/cache-dir/commonjs/slice/inline-slice.js.map +1 -0
- package/cache-dir/commonjs/slice/server-slice-renderer.js +29 -0
- package/cache-dir/commonjs/slice/server-slice-renderer.js.map +1 -0
- package/cache-dir/commonjs/slice/server-slice.js +54 -0
- package/cache-dir/commonjs/slice/server-slice.js.map +1 -0
- package/cache-dir/commonjs/slice.js +124 -0
- package/cache-dir/commonjs/slice.js.map +1 -0
- package/cache-dir/commonjs/socketIo.js +62 -0
- package/cache-dir/commonjs/socketIo.js.map +1 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/child_process.js +8 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/child_process.js.map +1 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/fs.js +7 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/fs.js.map +1 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/http.js +9 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/http.js.map +1 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/http2.js +7 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/http2.js.map +1 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/https.js +9 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/https.js.map +1 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/tracking-unsafe-module-wrapper.js +55 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/tracking-unsafe-module-wrapper.js.map +1 -0
- package/cache-dir/commonjs/ssr-develop-static-entry.js +366 -0
- package/cache-dir/commonjs/ssr-develop-static-entry.js.map +1 -0
- package/cache-dir/commonjs/static-entry.js +544 -0
- package/cache-dir/commonjs/static-entry.js.map +1 -0
- package/cache-dir/commonjs/static-query.js +74 -0
- package/cache-dir/commonjs/static-query.js.map +1 -0
- package/cache-dir/commonjs/strip-prefix.js +22 -0
- package/cache-dir/commonjs/strip-prefix.js.map +1 -0
- package/cache-dir/context-utils.js +29 -0
- package/cache-dir/create-content-digest-browser-shim.js +1 -0
- package/cache-dir/css-to-object.js +19 -0
- package/cache-dir/debug-log.js +13 -0
- package/cache-dir/default-html.js +36 -0
- package/cache-dir/dev-loader.js +280 -0
- package/cache-dir/develop-static-entry.js +129 -0
- package/cache-dir/dummy.js +2 -0
- package/cache-dir/emitter.js +4 -0
- package/cache-dir/ensure-resources.js +119 -0
- package/cache-dir/error-overlay-handler.js +36 -0
- package/cache-dir/fast-refresh-overlay/components/accordion.js +83 -0
- package/cache-dir/fast-refresh-overlay/components/build-error.js +46 -0
- package/cache-dir/fast-refresh-overlay/components/code-frame.js +38 -0
- package/cache-dir/fast-refresh-overlay/components/dev-ssr-error.js +66 -0
- package/cache-dir/fast-refresh-overlay/components/error-boundary.js +28 -0
- package/cache-dir/fast-refresh-overlay/components/getserverdata-error.js +53 -0
- package/cache-dir/fast-refresh-overlay/components/graphql-errors.js +100 -0
- package/cache-dir/fast-refresh-overlay/components/hooks.js +102 -0
- package/cache-dir/fast-refresh-overlay/components/overlay.js +143 -0
- package/cache-dir/fast-refresh-overlay/components/runtime-errors.js +139 -0
- package/cache-dir/fast-refresh-overlay/components/use-id.js +56 -0
- package/cache-dir/fast-refresh-overlay/helpers/focus-trap.js +3561 -0
- package/cache-dir/fast-refresh-overlay/helpers/keys.js +80 -0
- package/cache-dir/fast-refresh-overlay/helpers/lock-body.js +52 -0
- package/cache-dir/fast-refresh-overlay/helpers/match.js +42 -0
- package/cache-dir/fast-refresh-overlay/index.js +147 -0
- package/cache-dir/fast-refresh-overlay/style.js +413 -0
- package/cache-dir/fast-refresh-overlay/utils.js +81 -0
- package/cache-dir/find-path.js +160 -0
- package/cache-dir/gatsby-browser-entry.js +27 -0
- package/cache-dir/head/components/fire-callback-in-effect.js +12 -0
- package/cache-dir/head/components/head-components.js +86 -0
- package/cache-dir/head/constants.js +15 -0
- package/cache-dir/head/head-export-handler-for-browser.js +170 -0
- package/cache-dir/head/head-export-handler-for-ssr.js +237 -0
- package/cache-dir/head/utils.js +287 -0
- package/cache-dir/loader.js +977 -0
- package/cache-dir/loading-indicator/index.js +19 -0
- package/cache-dir/loading-indicator/indicator.js +65 -0
- package/cache-dir/loading-indicator/style.js +99 -0
- package/cache-dir/navigation.js +257 -0
- package/cache-dir/normalize-page-path.js +17 -0
- package/cache-dir/page-renderer.js +59 -0
- package/cache-dir/page-ssr/index.d.ts +76 -0
- package/cache-dir/pages.json +1 -0
- package/cache-dir/polyfill-entry.js +5 -0
- package/cache-dir/prefetch.js +80 -0
- package/cache-dir/production-app.js +340 -0
- package/cache-dir/public-page-renderer-dev.js +21 -0
- package/cache-dir/public-page-renderer-prod.js +25 -0
- package/cache-dir/public-page-renderer.js +9 -0
- package/cache-dir/query-engine/index.d.ts +31 -0
- package/cache-dir/query-result-store.js +197 -0
- package/cache-dir/react-dom-utils.js +38 -0
- package/cache-dir/react-lifecycles-compat.js +1 -0
- package/cache-dir/redirect-utils.js +22 -0
- package/cache-dir/redirects.json +1 -0
- package/cache-dir/register-service-worker.js +64 -0
- package/cache-dir/root.js +147 -0
- package/cache-dir/route-announcer-props.js +18 -0
- package/cache-dir/server-utils/writable-as-promise.js +41 -0
- package/cache-dir/shadow-portal.js +28 -0
- package/cache-dir/slice/context.js +13 -0
- package/cache-dir/slice/inline-slice.js +34 -0
- package/cache-dir/slice/server-slice-renderer.js +28 -0
- package/cache-dir/slice/server-slice.js +52 -0
- package/cache-dir/slice.js +158 -0
- package/cache-dir/socketIo.js +58 -0
- package/cache-dir/ssr-builtin-trackers/child_process.js +4 -0
- package/cache-dir/ssr-builtin-trackers/fs.js +3 -0
- package/cache-dir/ssr-builtin-trackers/http.js +3 -0
- package/cache-dir/ssr-builtin-trackers/http2.js +3 -0
- package/cache-dir/ssr-builtin-trackers/https.js +3 -0
- package/cache-dir/ssr-builtin-trackers/tracking-unsafe-module-wrapper.js +64 -0
- package/cache-dir/ssr-develop-static-entry.js +428 -0
- package/cache-dir/static-entry.js +594 -0
- package/cache-dir/static-query.js +91 -0
- package/cache-dir/strip-prefix.js +20 -0
- package/changes.json +454 -0
- package/cli.js +3 -0
- package/dist/bin/gatsby.js +5 -0
- package/dist/bin/gatsby.js.map +1 -0
- package/dist/bootstrap/__mocks__/get-config/ts/gatsby-config.d.ts +3 -0
- package/dist/bootstrap/__mocks__/resolve-module-exports.d.ts +1 -0
- package/dist/bootstrap/create-graphql-runner.d.ts +10 -0
- package/dist/bootstrap/create-graphql-runner.js +71 -0
- package/dist/bootstrap/create-graphql-runner.js.map +1 -0
- package/dist/bootstrap/get-config-file.d.ts +4 -0
- package/dist/bootstrap/get-config-file.js +152 -0
- package/dist/bootstrap/get-config-file.js.map +1 -0
- package/dist/bootstrap/index.d.ts +12 -0
- package/dist/bootstrap/index.js +56 -0
- package/dist/bootstrap/index.js.map +1 -0
- package/dist/bootstrap/load-config/index.d.ts +7 -0
- package/dist/bootstrap/load-config/index.js +73 -0
- package/dist/bootstrap/load-config/index.js.map +1 -0
- package/dist/bootstrap/load-plugins/index.d.ts +3 -0
- package/dist/bootstrap/load-plugins/index.js +79 -0
- package/dist/bootstrap/load-plugins/index.js.map +1 -0
- package/dist/bootstrap/load-plugins/load-internal-plugins.d.ts +2 -0
- package/dist/bootstrap/load-plugins/load-internal-plugins.js +105 -0
- package/dist/bootstrap/load-plugins/load-internal-plugins.js.map +1 -0
- package/dist/bootstrap/load-plugins/process-plugin.d.ts +2 -0
- package/dist/bootstrap/load-plugins/process-plugin.js +81 -0
- package/dist/bootstrap/load-plugins/process-plugin.js.map +1 -0
- package/dist/bootstrap/load-plugins/resolve-plugin.d.ts +13 -0
- package/dist/bootstrap/load-plugins/resolve-plugin.js +75 -0
- package/dist/bootstrap/load-plugins/resolve-plugin.js.map +1 -0
- package/dist/bootstrap/load-plugins/types.d.ts +48 -0
- package/dist/bootstrap/load-plugins/types.js +4 -0
- package/dist/bootstrap/load-plugins/types.js.map +1 -0
- package/dist/bootstrap/load-plugins/utils/check-local-plugin.d.ts +8 -0
- package/dist/bootstrap/load-plugins/utils/check-local-plugin.js +38 -0
- package/dist/bootstrap/load-plugins/utils/check-local-plugin.js.map +1 -0
- package/dist/bootstrap/load-plugins/utils/create-hash.d.ts +1 -0
- package/dist/bootstrap/load-plugins/utils/create-hash.js +20 -0
- package/dist/bootstrap/load-plugins/utils/create-hash.js.map +1 -0
- package/dist/bootstrap/load-plugins/utils/create-id.d.ts +10 -0
- package/dist/bootstrap/load-plugins/utils/create-id.js +16 -0
- package/dist/bootstrap/load-plugins/utils/create-id.js.map +1 -0
- package/dist/bootstrap/load-plugins/utils/flatten-plugins.d.ts +2 -0
- package/dist/bootstrap/load-plugins/utils/flatten-plugins.js +41 -0
- package/dist/bootstrap/load-plugins/utils/flatten-plugins.js.map +1 -0
- package/dist/bootstrap/load-plugins/utils/get-api.d.ts +12 -0
- package/dist/bootstrap/load-plugins/utils/get-api.js +12 -0
- package/dist/bootstrap/load-plugins/utils/get-api.js.map +1 -0
- package/dist/bootstrap/load-plugins/utils/normalize.d.ts +5 -0
- package/dist/bootstrap/load-plugins/utils/normalize.js +33 -0
- package/dist/bootstrap/load-plugins/utils/normalize.js.map +1 -0
- package/dist/bootstrap/load-plugins/validate.d.ts +41 -0
- package/dist/bootstrap/load-plugins/validate.js +369 -0
- package/dist/bootstrap/load-plugins/validate.js.map +1 -0
- package/dist/bootstrap/load-themes/index.d.ts +17 -0
- package/dist/bootstrap/load-themes/index.js +186 -0
- package/dist/bootstrap/load-themes/index.js.map +1 -0
- package/dist/bootstrap/log-line-function.d.ts +0 -0
- package/dist/bootstrap/log-line-function.js +19 -0
- package/dist/bootstrap/log-line-function.js.map +1 -0
- package/dist/bootstrap/prefer-default.d.ts +1 -0
- package/dist/bootstrap/prefer-default.js +7 -0
- package/dist/bootstrap/prefer-default.js.map +1 -0
- package/dist/bootstrap/redirects-writer.d.ts +2 -0
- package/dist/bootstrap/redirects-writer.js +59 -0
- package/dist/bootstrap/redirects-writer.js.map +1 -0
- package/dist/bootstrap/remove-stale-jobs.d.ts +2 -0
- package/dist/bootstrap/remove-stale-jobs.js +31 -0
- package/dist/bootstrap/remove-stale-jobs.js.map +1 -0
- package/dist/bootstrap/requires-writer.d.ts +11 -0
- package/dist/bootstrap/requires-writer.js +260 -0
- package/dist/bootstrap/requires-writer.js.map +1 -0
- package/dist/bootstrap/resolve-js-file-path.d.ts +14 -0
- package/dist/bootstrap/resolve-js-file-path.js +58 -0
- package/dist/bootstrap/resolve-js-file-path.js.map +1 -0
- package/dist/bootstrap/resolve-module-exports.d.ts +20 -0
- package/dist/bootstrap/resolve-module-exports.js +188 -0
- package/dist/bootstrap/resolve-module-exports.js.map +1 -0
- package/dist/bootstrap/schema-hot-reloader.d.ts +3 -0
- package/dist/bootstrap/schema-hot-reloader.js +60 -0
- package/dist/bootstrap/schema-hot-reloader.js.map +1 -0
- package/dist/cache/cache-fs.d.ts +1 -0
- package/dist/cache/cache-fs.js +270 -0
- package/dist/cache/cache-fs.js.map +1 -0
- package/dist/cache/json-file-store.d.ts +8 -0
- package/dist/cache/json-file-store.js +144 -0
- package/dist/cache/json-file-store.js.map +1 -0
- package/dist/cache/wrap-callback.d.ts +0 -0
- package/dist/cache/wrap-callback.js +49 -0
- package/dist/cache/wrap-callback.js.map +1 -0
- package/dist/commands/build-html.d.ts +69 -0
- package/dist/commands/build-html.js +652 -0
- package/dist/commands/build-html.js.map +1 -0
- package/dist/commands/build-javascript.d.ts +4 -0
- package/dist/commands/build-javascript.js +18 -0
- package/dist/commands/build-javascript.js.map +1 -0
- package/dist/commands/build-utils.d.ts +8 -0
- package/dist/commands/build-utils.js +186 -0
- package/dist/commands/build-utils.js.map +1 -0
- package/dist/commands/build.d.ts +1 -0
- package/dist/commands/build.js +505 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/clean.d.ts +1 -0
- package/dist/commands/clean.js +29 -0
- package/dist/commands/clean.js.map +1 -0
- package/dist/commands/develop-process.d.ts +1 -0
- package/dist/commands/develop-process.js +120 -0
- package/dist/commands/develop-process.js.map +1 -0
- package/dist/commands/develop-static.d.ts +3 -0
- package/dist/commands/develop-static.js +22 -0
- package/dist/commands/develop-static.js.map +1 -0
- package/dist/commands/develop.d.ts +2 -0
- package/dist/commands/develop.js +273 -0
- package/dist/commands/develop.js.map +1 -0
- package/dist/commands/feedback.d.ts +1 -0
- package/dist/commands/feedback.js +17 -0
- package/dist/commands/feedback.js.map +1 -0
- package/dist/commands/repl.d.ts +1 -0
- package/dist/commands/repl.js +58 -0
- package/dist/commands/repl.js.map +1 -0
- package/dist/commands/serve.d.ts +1 -0
- package/dist/commands/serve.js +282 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/types.d.ts +54 -0
- package/dist/commands/types.js +23 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +7 -0
- package/dist/constants.js.map +1 -0
- package/dist/datastore/common/iterable.d.ts +51 -0
- package/dist/datastore/common/iterable.js +217 -0
- package/dist/datastore/common/iterable.js.map +1 -0
- package/dist/datastore/common/query.d.ts +69 -0
- package/dist/datastore/common/query.js +219 -0
- package/dist/datastore/common/query.js.map +1 -0
- package/dist/datastore/datastore.d.ts +2 -0
- package/dist/datastore/datastore.js +23 -0
- package/dist/datastore/datastore.js.map +1 -0
- package/dist/datastore/in-memory/in-memory-datastore.d.ts +2 -0
- package/dist/datastore/in-memory/in-memory-datastore.js +75 -0
- package/dist/datastore/in-memory/in-memory-datastore.js.map +1 -0
- package/dist/datastore/in-memory/indexing.d.ts +80 -0
- package/dist/datastore/in-memory/indexing.js +994 -0
- package/dist/datastore/in-memory/indexing.js.map +1 -0
- package/dist/datastore/in-memory/run-fast-filters.d.ts +27 -0
- package/dist/datastore/in-memory/run-fast-filters.js +276 -0
- package/dist/datastore/in-memory/run-fast-filters.js.map +1 -0
- package/dist/datastore/index.d.ts +20 -0
- package/dist/datastore/index.js +34 -0
- package/dist/datastore/index.js.map +1 -0
- package/dist/datastore/lmdb/lmdb-datastore.d.ts +14 -0
- package/dist/datastore/lmdb/lmdb-datastore.js +261 -0
- package/dist/datastore/lmdb/lmdb-datastore.js.map +1 -0
- package/dist/datastore/lmdb/query/common.d.ts +23 -0
- package/dist/datastore/lmdb/query/common.js +127 -0
- package/dist/datastore/lmdb/query/common.js.map +1 -0
- package/dist/datastore/lmdb/query/create-index.d.ts +25 -0
- package/dist/datastore/lmdb/query/create-index.js +239 -0
- package/dist/datastore/lmdb/query/create-index.js.map +1 -0
- package/dist/datastore/lmdb/query/filter-using-index.d.ts +43 -0
- package/dist/datastore/lmdb/query/filter-using-index.js +577 -0
- package/dist/datastore/lmdb/query/filter-using-index.js.map +1 -0
- package/dist/datastore/lmdb/query/run-query.d.ts +9 -0
- package/dist/datastore/lmdb/query/run-query.js +285 -0
- package/dist/datastore/lmdb/query/run-query.js.map +1 -0
- package/dist/datastore/lmdb/query/suggest-index.d.ts +15 -0
- package/dist/datastore/lmdb/query/suggest-index.js +93 -0
- package/dist/datastore/lmdb/query/suggest-index.js.map +1 -0
- package/dist/datastore/lmdb/updates/nodes-by-type.d.ts +3 -0
- package/dist/datastore/lmdb/updates/nodes-by-type.js +21 -0
- package/dist/datastore/lmdb/updates/nodes-by-type.js.map +1 -0
- package/dist/datastore/lmdb/updates/nodes.d.ts +5 -0
- package/dist/datastore/lmdb/updates/nodes.js +33 -0
- package/dist/datastore/lmdb/updates/nodes.js.map +1 -0
- package/dist/datastore/types.d.ts +47 -0
- package/dist/datastore/types.js +4 -0
- package/dist/datastore/types.js.map +1 -0
- package/dist/internal-plugins/bundle-optimisations/gatsby-node.js +42 -0
- package/dist/internal-plugins/bundle-optimisations/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/bundle-optimisations/index.js +3 -0
- package/dist/internal-plugins/bundle-optimisations/index.js.map +1 -0
- package/dist/internal-plugins/bundle-optimisations/package.json +10 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/fetch.js +4 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/fetch.js.map +1 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/no-op.js +3 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/no-op.js.map +1 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/object-assign.js +4 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/object-assign.js.map +1 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/whatwg-fetch.js +6 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/whatwg-fetch.js.map +1 -0
- package/dist/internal-plugins/dev-404-page/gatsby-node.js +30 -0
- package/dist/internal-plugins/dev-404-page/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/dev-404-page/index.js +3 -0
- package/dist/internal-plugins/dev-404-page/index.js.map +1 -0
- package/dist/internal-plugins/dev-404-page/package.json +11 -0
- package/dist/internal-plugins/dev-404-page/raw_dev-404-page.js +262 -0
- package/dist/internal-plugins/functions/api-function-webpack-loader.d.ts +3 -0
- package/dist/internal-plugins/functions/api-function-webpack-loader.js +74 -0
- package/dist/internal-plugins/functions/api-function-webpack-loader.js.map +1 -0
- package/dist/internal-plugins/functions/config.d.ts +20 -0
- package/dist/internal-plugins/functions/config.js +96 -0
- package/dist/internal-plugins/functions/config.js.map +1 -0
- package/dist/internal-plugins/functions/gatsby-node.d.ts +3 -0
- package/dist/internal-plugins/functions/gatsby-node.js +452 -0
- package/dist/internal-plugins/functions/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/functions/index.js +3 -0
- package/dist/internal-plugins/functions/index.js.map +1 -0
- package/dist/internal-plugins/functions/middleware.d.ts +11 -0
- package/dist/internal-plugins/functions/middleware.js +160 -0
- package/dist/internal-plugins/functions/middleware.js.map +1 -0
- package/dist/internal-plugins/functions/package.json +11 -0
- package/dist/internal-plugins/internal-data-bridge/gatsby-node.js +191 -0
- package/dist/internal-plugins/internal-data-bridge/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/internal-data-bridge/index.js +3 -0
- package/dist/internal-plugins/internal-data-bridge/index.js.map +1 -0
- package/dist/internal-plugins/internal-data-bridge/package.json +11 -0
- package/dist/internal-plugins/load-babel-config/gatsby-node.js +37 -0
- package/dist/internal-plugins/load-babel-config/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/load-babel-config/index.js +3 -0
- package/dist/internal-plugins/load-babel-config/index.js.map +1 -0
- package/dist/internal-plugins/load-babel-config/package.json +11 -0
- package/dist/internal-plugins/partytown/gatsby-browser.js +23 -0
- package/dist/internal-plugins/partytown/gatsby-browser.js.map +1 -0
- package/dist/internal-plugins/partytown/gatsby-node.d.ts +2 -0
- package/dist/internal-plugins/partytown/gatsby-node.js +60 -0
- package/dist/internal-plugins/partytown/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/partytown/gatsby-ssr.js +39 -0
- package/dist/internal-plugins/partytown/gatsby-ssr.js.map +1 -0
- package/dist/internal-plugins/partytown/index.js +3 -0
- package/dist/internal-plugins/partytown/index.js.map +1 -0
- package/dist/internal-plugins/partytown/package.json +12 -0
- package/dist/internal-plugins/partytown/proxy.d.ts +3 -0
- package/dist/internal-plugins/partytown/proxy.js +26 -0
- package/dist/internal-plugins/partytown/proxy.js.map +1 -0
- package/dist/internal-plugins/partytown/utils/get-forwards.d.ts +2 -0
- package/dist/internal-plugins/partytown/utils/get-forwards.js +8 -0
- package/dist/internal-plugins/partytown/utils/get-forwards.js.map +1 -0
- package/dist/internal-plugins/partytown/utils/inject-partytown-snippet.d.ts +2 -0
- package/dist/internal-plugins/partytown/utils/inject-partytown-snippet.js +28 -0
- package/dist/internal-plugins/partytown/utils/inject-partytown-snippet.js.map +1 -0
- package/dist/internal-plugins/prod-404-500/gatsby-node.js +50 -0
- package/dist/internal-plugins/prod-404-500/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/prod-404-500/index.js +3 -0
- package/dist/internal-plugins/prod-404-500/index.js.map +1 -0
- package/dist/internal-plugins/prod-404-500/package.json +11 -0
- package/dist/internal-plugins/webpack-theme-component-shadowing/create-page.js +31 -0
- package/dist/internal-plugins/webpack-theme-component-shadowing/create-page.js.map +1 -0
- package/dist/internal-plugins/webpack-theme-component-shadowing/gatsby-node.js +31 -0
- package/dist/internal-plugins/webpack-theme-component-shadowing/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/webpack-theme-component-shadowing/index.js +273 -0
- package/dist/internal-plugins/webpack-theme-component-shadowing/index.js.map +1 -0
- package/dist/internal-plugins/webpack-theme-component-shadowing/package.json +11 -0
- package/dist/internal.d.ts +5 -0
- package/dist/internal.js +34 -0
- package/dist/internal.js.map +1 -0
- package/dist/joi-schemas/joi.d.ts +5 -0
- package/dist/joi-schemas/joi.js +122 -0
- package/dist/joi-schemas/joi.js.map +1 -0
- package/dist/query/error-parser.d.ts +19 -0
- package/dist/query/error-parser.js +163 -0
- package/dist/query/error-parser.js.map +1 -0
- package/dist/query/file-parser.js +584 -0
- package/dist/query/file-parser.js.map +1 -0
- package/dist/query/graphql-errors-codeframe.d.ts +1 -0
- package/dist/query/graphql-errors-codeframe.js +20 -0
- package/dist/query/graphql-errors-codeframe.js.map +1 -0
- package/dist/query/graphql-errors.js +278 -0
- package/dist/query/graphql-errors.js.map +1 -0
- package/dist/query/graphql-runner.d.ts +39 -0
- package/dist/query/graphql-runner.js +221 -0
- package/dist/query/graphql-runner.js.map +1 -0
- package/dist/query/graphql-span-tracer.d.ts +19 -0
- package/dist/query/graphql-span-tracer.js +63 -0
- package/dist/query/graphql-span-tracer.js.map +1 -0
- package/dist/query/index.d.ts +32 -0
- package/dist/query/index.js +301 -0
- package/dist/query/index.js.map +1 -0
- package/dist/query/query-compiler.js +433 -0
- package/dist/query/query-compiler.js.map +1 -0
- package/dist/query/query-runner.d.ts +13 -0
- package/dist/query/query-runner.js +176 -0
- package/dist/query/query-runner.js.map +1 -0
- package/dist/query/query-watcher.d.ts +17 -0
- package/dist/query/query-watcher.js +250 -0
- package/dist/query/query-watcher.js.map +1 -0
- package/dist/query/transform-document.d.ts +6 -0
- package/dist/query/transform-document.js +131 -0
- package/dist/query/transform-document.js.map +1 -0
- package/dist/query/types.d.ts +35 -0
- package/dist/query/types.js +4 -0
- package/dist/query/types.js.map +1 -0
- package/dist/query/utils.d.ts +4 -0
- package/dist/query/utils.js +20 -0
- package/dist/query/utils.js.map +1 -0
- package/dist/redux/actions/add-page-dependency.d.ts +7 -0
- package/dist/redux/actions/add-page-dependency.js +52 -0
- package/dist/redux/actions/add-page-dependency.js.map +1 -0
- package/dist/redux/actions/index.d.ts +16 -0
- package/dist/redux/actions/index.js +21 -0
- package/dist/redux/actions/index.js.map +1 -0
- package/dist/redux/actions/internal.d.ts +124 -0
- package/dist/redux/actions/internal.js +394 -0
- package/dist/redux/actions/internal.js.map +1 -0
- package/dist/redux/actions/public.js +1354 -0
- package/dist/redux/actions/public.js.map +1 -0
- package/dist/redux/actions/restricted.d.ts +332 -0
- package/dist/redux/actions/restricted.js +521 -0
- package/dist/redux/actions/restricted.js.map +1 -0
- package/dist/redux/index.d.ts +20 -0
- package/dist/redux/index.js +125 -0
- package/dist/redux/index.js.map +1 -0
- package/dist/redux/persist.d.ts +5 -0
- package/dist/redux/persist.js +191 -0
- package/dist/redux/persist.js.map +1 -0
- package/dist/redux/plugin-runner.d.ts +1 -0
- package/dist/redux/plugin-runner.js +45 -0
- package/dist/redux/plugin-runner.js.map +1 -0
- package/dist/redux/reducers/adapter.d.ts +6 -0
- package/dist/redux/reducers/adapter.js +22 -0
- package/dist/redux/reducers/adapter.js.map +1 -0
- package/dist/redux/reducers/babelrc.d.ts +9 -0
- package/dist/redux/reducers/babelrc.js +104 -0
- package/dist/redux/reducers/babelrc.js.map +1 -0
- package/dist/redux/reducers/components-using-slices.d.ts +2 -0
- package/dist/redux/reducers/components-using-slices.js +15 -0
- package/dist/redux/reducers/components-using-slices.js.map +1 -0
- package/dist/redux/reducers/components.d.ts +2 -0
- package/dist/redux/reducers/components.js +104 -0
- package/dist/redux/reducers/components.js.map +1 -0
- package/dist/redux/reducers/config.d.ts +2 -0
- package/dist/redux/reducers/config.js +16 -0
- package/dist/redux/reducers/config.js.map +1 -0
- package/dist/redux/reducers/definitions.d.ts +2 -0
- package/dist/redux/reducers/definitions.js +14 -0
- package/dist/redux/reducers/definitions.js.map +1 -0
- package/dist/redux/reducers/flattened-plugins.d.ts +17 -0
- package/dist/redux/reducers/flattened-plugins.js +14 -0
- package/dist/redux/reducers/flattened-plugins.js.map +1 -0
- package/dist/redux/reducers/functions.d.ts +2 -0
- package/dist/redux/reducers/functions.js +14 -0
- package/dist/redux/reducers/functions.js.map +1 -0
- package/dist/redux/reducers/html.d.ts +25 -0
- package/dist/redux/reducers/html.js +384 -0
- package/dist/redux/reducers/html.js.map +1 -0
- package/dist/redux/reducers/index.d.ts +45 -0
- package/dist/redux/reducers/index.js +86 -0
- package/dist/redux/reducers/index.js.map +1 -0
- package/dist/redux/reducers/inference-metadata.d.ts +7 -0
- package/dist/redux/reducers/inference-metadata.js +174 -0
- package/dist/redux/reducers/inference-metadata.js.map +1 -0
- package/dist/redux/reducers/jobs.d.ts +5 -0
- package/dist/redux/reducers/jobs.js +65 -0
- package/dist/redux/reducers/jobs.js.map +1 -0
- package/dist/redux/reducers/jobsv2.d.ts +6 -0
- package/dist/redux/reducers/jobsv2.js +88 -0
- package/dist/redux/reducers/jobsv2.js.map +1 -0
- package/dist/redux/reducers/last-action.d.ts +2 -0
- package/dist/redux/reducers/last-action.js +7 -0
- package/dist/redux/reducers/last-action.js.map +1 -0
- package/dist/redux/reducers/node-manifest.d.ts +2 -0
- package/dist/redux/reducers/node-manifest.js +58 -0
- package/dist/redux/reducers/node-manifest.js.map +1 -0
- package/dist/redux/reducers/nodes-by-type.d.ts +2 -0
- package/dist/redux/reducers/nodes-by-type.js +53 -0
- package/dist/redux/reducers/nodes-by-type.js.map +1 -0
- package/dist/redux/reducers/nodes-touched.d.ts +3 -0
- package/dist/redux/reducers/nodes-touched.js +18 -0
- package/dist/redux/reducers/nodes-touched.js.map +1 -0
- package/dist/redux/reducers/nodes.d.ts +2 -0
- package/dist/redux/reducers/nodes.js +30 -0
- package/dist/redux/reducers/nodes.js.map +1 -0
- package/dist/redux/reducers/page-data-stats.d.ts +2 -0
- package/dist/redux/reducers/page-data-stats.js +15 -0
- package/dist/redux/reducers/page-data-stats.js.map +1 -0
- package/dist/redux/reducers/pages.d.ts +2 -0
- package/dist/redux/reducers/pages.js +43 -0
- package/dist/redux/reducers/pages.js.map +1 -0
- package/dist/redux/reducers/pending-page-data-writes.d.ts +5 -0
- package/dist/redux/reducers/pending-page-data-writes.js +66 -0
- package/dist/redux/reducers/pending-page-data-writes.js.map +1 -0
- package/dist/redux/reducers/program.d.ts +2 -0
- package/dist/redux/reducers/program.js +62 -0
- package/dist/redux/reducers/program.js.map +1 -0
- package/dist/redux/reducers/queries.d.ts +26 -0
- package/dist/redux/reducers/queries.js +403 -0
- package/dist/redux/reducers/queries.js.map +1 -0
- package/dist/redux/reducers/redirects.d.ts +2 -0
- package/dist/redux/reducers/redirects.js +39 -0
- package/dist/redux/reducers/redirects.js.map +1 -0
- package/dist/redux/reducers/remote-file-allowed-urls.d.ts +2 -0
- package/dist/redux/reducers/remote-file-allowed-urls.js +19 -0
- package/dist/redux/reducers/remote-file-allowed-urls.js.map +1 -0
- package/dist/redux/reducers/resolved-nodes.d.ts +2 -0
- package/dist/redux/reducers/resolved-nodes.js +45 -0
- package/dist/redux/reducers/resolved-nodes.js.map +1 -0
- package/dist/redux/reducers/schema-customization.d.ts +23 -0
- package/dist/redux/reducers/schema-customization.js +103 -0
- package/dist/redux/reducers/schema-customization.js.map +1 -0
- package/dist/redux/reducers/schema.d.ts +3 -0
- package/dist/redux/reducers/schema.js +17 -0
- package/dist/redux/reducers/schema.js.map +1 -0
- package/dist/redux/reducers/set-request-headers.d.ts +7 -0
- package/dist/redux/reducers/set-request-headers.js +24 -0
- package/dist/redux/reducers/set-request-headers.js.map +1 -0
- package/dist/redux/reducers/slices-by-template.d.ts +2 -0
- package/dist/redux/reducers/slices-by-template.js +16 -0
- package/dist/redux/reducers/slices-by-template.js.map +1 -0
- package/dist/redux/reducers/slices.d.ts +2 -0
- package/dist/redux/reducers/slices.js +22 -0
- package/dist/redux/reducers/slices.js.map +1 -0
- package/dist/redux/reducers/stateful-source-plugins.d.ts +5 -0
- package/dist/redux/reducers/stateful-source-plugins.js +20 -0
- package/dist/redux/reducers/stateful-source-plugins.js.map +1 -0
- package/dist/redux/reducers/static-queries-by-template.d.ts +2 -0
- package/dist/redux/reducers/static-queries-by-template.js +19 -0
- package/dist/redux/reducers/static-queries-by-template.js.map +1 -0
- package/dist/redux/reducers/static-query-components.d.ts +2 -0
- package/dist/redux/reducers/static-query-components.js +18 -0
- package/dist/redux/reducers/static-query-components.js.map +1 -0
- package/dist/redux/reducers/status.d.ts +7 -0
- package/dist/redux/reducers/status.js +57 -0
- package/dist/redux/reducers/status.js.map +1 -0
- package/dist/redux/reducers/telemetry.d.ts +2 -0
- package/dist/redux/reducers/telemetry.js +46 -0
- package/dist/redux/reducers/telemetry.js.map +1 -0
- package/dist/redux/reducers/type-owners.d.ts +5 -0
- package/dist/redux/reducers/type-owners.js +102 -0
- package/dist/redux/reducers/type-owners.js.map +1 -0
- package/dist/redux/reducers/visited-page.d.ts +2 -0
- package/dist/redux/reducers/visited-page.js +31 -0
- package/dist/redux/reducers/visited-page.js.map +1 -0
- package/dist/redux/reducers/webpack-compilation-hash.d.ts +2 -0
- package/dist/redux/reducers/webpack-compilation-hash.js +14 -0
- package/dist/redux/reducers/webpack-compilation-hash.js.map +1 -0
- package/dist/redux/reducers/webpack.d.ts +2 -0
- package/dist/redux/reducers/webpack.js +27 -0
- package/dist/redux/reducers/webpack.js.map +1 -0
- package/dist/redux/save-state.js +19 -0
- package/dist/redux/save-state.js.map +1 -0
- package/dist/redux/types.d.ts +1337 -0
- package/dist/redux/types.js +326 -0
- package/dist/redux/types.js.map +1 -0
- package/dist/schema/context.d.ts +14 -0
- package/dist/schema/context.js +38 -0
- package/dist/schema/context.js.map +1 -0
- package/dist/schema/extensions/index.js +205 -0
- package/dist/schema/extensions/index.js.map +1 -0
- package/dist/schema/graphql-engine/bootstrap.d.ts +2 -0
- package/dist/schema/graphql-engine/bootstrap.js +12 -0
- package/dist/schema/graphql-engine/bootstrap.js.map +1 -0
- package/dist/schema/graphql-engine/bundle-webpack.d.ts +5 -0
- package/dist/schema/graphql-engine/bundle-webpack.js +446 -0
- package/dist/schema/graphql-engine/bundle-webpack.js.map +1 -0
- package/dist/schema/graphql-engine/entry.d.ts +23 -0
- package/dist/schema/graphql-engine/entry.js +204 -0
- package/dist/schema/graphql-engine/entry.js.map +1 -0
- package/dist/schema/graphql-engine/lmdb-bundling-patch.d.ts +1 -0
- package/dist/schema/graphql-engine/lmdb-bundling-patch.js +72 -0
- package/dist/schema/graphql-engine/lmdb-bundling-patch.js.map +1 -0
- package/dist/schema/graphql-engine/platform-and-arch-check.d.ts +0 -0
- package/dist/schema/graphql-engine/platform-and-arch-check.js +6 -0
- package/dist/schema/graphql-engine/platform-and-arch-check.js.map +1 -0
- package/dist/schema/graphql-engine/print-plugins.d.ts +2 -0
- package/dist/schema/graphql-engine/print-plugins.js +145 -0
- package/dist/schema/graphql-engine/print-plugins.js.map +1 -0
- package/dist/schema/graphql-engine/sharp-bundling-patch.d.ts +1 -0
- package/dist/schema/graphql-engine/sharp-bundling-patch.js +8 -0
- package/dist/schema/graphql-engine/sharp-bundling-patch.js.map +1 -0
- package/dist/schema/graphql-engine/shims/gatsby-sharp.js +10 -0
- package/dist/schema/graphql-engine/shims/gatsby-sharp.js.map +1 -0
- package/dist/schema/graphql-engine/shims/no-op-module.js +3 -0
- package/dist/schema/graphql-engine/shims/no-op-module.js.map +1 -0
- package/dist/schema/graphql-engine/shims/ts-node.js +17 -0
- package/dist/schema/graphql-engine/shims/ts-node.js.map +1 -0
- package/dist/schema/graphql-engine/standalone-regenerate.d.ts +2 -0
- package/dist/schema/graphql-engine/standalone-regenerate.js +73 -0
- package/dist/schema/graphql-engine/standalone-regenerate.js.map +1 -0
- package/dist/schema/index.js +189 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/infer/add-inferred-fields.js +413 -0
- package/dist/schema/infer/add-inferred-fields.js.map +1 -0
- package/dist/schema/infer/build-example-data.d.ts +5 -0
- package/dist/schema/infer/build-example-data.js +199 -0
- package/dist/schema/infer/build-example-data.js.map +1 -0
- package/dist/schema/infer/index.js +121 -0
- package/dist/schema/infer/index.js.map +1 -0
- package/dist/schema/infer/inference-metadata.d.ts +72 -0
- package/dist/schema/infer/inference-metadata.js +280 -0
- package/dist/schema/infer/inference-metadata.js.map +1 -0
- package/dist/schema/infer/is-file.d.ts +1 -0
- package/dist/schema/infer/is-file.js +65 -0
- package/dist/schema/infer/is-file.js.map +1 -0
- package/dist/schema/infer/type-conflict-reporter.d.ts +28 -0
- package/dist/schema/infer/type-conflict-reporter.js +104 -0
- package/dist/schema/infer/type-conflict-reporter.js.map +1 -0
- package/dist/schema/node-model.js +784 -0
- package/dist/schema/node-model.js.map +1 -0
- package/dist/schema/print.d.ts +20 -0
- package/dist/schema/print.js +279 -0
- package/dist/schema/print.js.map +1 -0
- package/dist/schema/resolvers.d.ts +40 -0
- package/dist/schema/resolvers.js +569 -0
- package/dist/schema/resolvers.js.map +1 -0
- package/dist/schema/schema-composer.d.ts +3 -0
- package/dist/schema/schema-composer.js +31 -0
- package/dist/schema/schema-composer.js.map +1 -0
- package/dist/schema/schema.js +1295 -0
- package/dist/schema/schema.js.map +1 -0
- package/dist/schema/type-definitions.d.ts +47 -0
- package/dist/schema/type-definitions.js +4 -0
- package/dist/schema/type-definitions.js.map +1 -0
- package/dist/schema/types/built-in-types.d.ts +5 -0
- package/dist/schema/types/built-in-types.js +139 -0
- package/dist/schema/types/built-in-types.js.map +1 -0
- package/dist/schema/types/date.d.ts +37 -0
- package/dist/schema/types/date.js +225 -0
- package/dist/schema/types/date.js.map +1 -0
- package/dist/schema/types/derived-types.d.ts +45 -0
- package/dist/schema/types/derived-types.js +108 -0
- package/dist/schema/types/derived-types.js.map +1 -0
- package/dist/schema/types/filter.d.ts +12 -0
- package/dist/schema/types/filter.js +105 -0
- package/dist/schema/types/filter.js.map +1 -0
- package/dist/schema/types/media.d.ts +2 -0
- package/dist/schema/types/media.js +10 -0
- package/dist/schema/types/media.js.map +1 -0
- package/dist/schema/types/node-interface.d.ts +14 -0
- package/dist/schema/types/node-interface.js +103 -0
- package/dist/schema/types/node-interface.js.map +1 -0
- package/dist/schema/types/pagination.d.ts +16 -0
- package/dist/schema/types/pagination.js +198 -0
- package/dist/schema/types/pagination.js.map +1 -0
- package/dist/schema/types/remote-file-interface.d.ts +3 -0
- package/dist/schema/types/remote-file-interface.js +34 -0
- package/dist/schema/types/remote-file-interface.js.map +1 -0
- package/dist/schema/types/sort.d.ts +24 -0
- package/dist/schema/types/sort.js +178 -0
- package/dist/schema/types/sort.js.map +1 -0
- package/dist/schema/types/type-builders.d.ts +36 -0
- package/dist/schema/types/type-builders.js +61 -0
- package/dist/schema/types/type-builders.js.map +1 -0
- package/dist/schema/types/type-defs.js +86 -0
- package/dist/schema/types/type-defs.js.map +1 -0
- package/dist/schema/types/utils.d.ts +33 -0
- package/dist/schema/types/utils.js +153 -0
- package/dist/schema/types/utils.js.map +1 -0
- package/dist/schema/utils.d.ts +28 -0
- package/dist/schema/utils.js +149 -0
- package/dist/schema/utils.js.map +1 -0
- package/dist/services/build-schema.d.ts +2 -0
- package/dist/services/build-schema.js +24 -0
- package/dist/services/build-schema.js.map +1 -0
- package/dist/services/calculate-dirty-queries.d.ts +5 -0
- package/dist/services/calculate-dirty-queries.js +44 -0
- package/dist/services/calculate-dirty-queries.js.map +1 -0
- package/dist/services/create-pages.d.ts +5 -0
- package/dist/services/create-pages.js +108 -0
- package/dist/services/create-pages.js.map +1 -0
- package/dist/services/customize-schema.d.ts +2 -0
- package/dist/services/customize-schema.js +26 -0
- package/dist/services/customize-schema.js.map +1 -0
- package/dist/services/extract-queries.d.ts +2 -0
- package/dist/services/extract-queries.js +24 -0
- package/dist/services/extract-queries.js.map +1 -0
- package/dist/services/graphql-typegen.d.ts +2 -0
- package/dist/services/graphql-typegen.js +46 -0
- package/dist/services/graphql-typegen.js.map +1 -0
- package/dist/services/index.d.ts +19 -0
- package/dist/services/index.js +68 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/initialize.d.ts +14 -0
- package/dist/services/initialize.js +519 -0
- package/dist/services/initialize.js.map +1 -0
- package/dist/services/listen-for-mutations.d.ts +2 -0
- package/dist/services/listen-for-mutations.js +59 -0
- package/dist/services/listen-for-mutations.js.map +1 -0
- package/dist/services/listen-to-webpack.d.ts +3 -0
- package/dist/services/listen-to-webpack.js +17 -0
- package/dist/services/listen-to-webpack.js.map +1 -0
- package/dist/services/post-bootstrap.d.ts +2 -0
- package/dist/services/post-bootstrap.js +29 -0
- package/dist/services/post-bootstrap.js.map +1 -0
- package/dist/services/recompile.d.ts +3 -0
- package/dist/services/recompile.js +67 -0
- package/dist/services/recompile.js.map +1 -0
- package/dist/services/run-mutation-batch.d.ts +2 -0
- package/dist/services/run-mutation-batch.js +12 -0
- package/dist/services/run-mutation-batch.js.map +1 -0
- package/dist/services/run-page-queries.d.ts +2 -0
- package/dist/services/run-page-queries.js +38 -0
- package/dist/services/run-page-queries.js.map +1 -0
- package/dist/services/run-slice-queries.d.ts +2 -0
- package/dist/services/run-slice-queries.js +40 -0
- package/dist/services/run-slice-queries.js.map +1 -0
- package/dist/services/run-static-queries.d.ts +2 -0
- package/dist/services/run-static-queries.js +38 -0
- package/dist/services/run-static-queries.js.map +1 -0
- package/dist/services/source-nodes.d.ts +5 -0
- package/dist/services/source-nodes.js +47 -0
- package/dist/services/source-nodes.js.map +1 -0
- package/dist/services/start-webpack-server.d.ts +9 -0
- package/dist/services/start-webpack-server.js +103 -0
- package/dist/services/start-webpack-server.js.map +1 -0
- package/dist/services/types.d.ts +53 -0
- package/dist/services/types.js +4 -0
- package/dist/services/types.js.map +1 -0
- package/dist/services/write-out-redirects.d.ts +2 -0
- package/dist/services/write-out-redirects.js +20 -0
- package/dist/services/write-out-redirects.js.map +1 -0
- package/dist/services/write-out-requires.d.ts +2 -0
- package/dist/services/write-out-requires.js +27 -0
- package/dist/services/write-out-requires.js.map +1 -0
- package/dist/state-machines/data-layer/actions.d.ts +11 -0
- package/dist/state-machines/data-layer/actions.js +38 -0
- package/dist/state-machines/data-layer/actions.js.map +1 -0
- package/dist/state-machines/data-layer/index.d.ts +24 -0
- package/dist/state-machines/data-layer/index.js +152 -0
- package/dist/state-machines/data-layer/index.js.map +1 -0
- package/dist/state-machines/data-layer/services.d.ts +3 -0
- package/dist/state-machines/data-layer/services.js +14 -0
- package/dist/state-machines/data-layer/services.js.map +1 -0
- package/dist/state-machines/data-layer/types.d.ts +27 -0
- package/dist/state-machines/data-layer/types.js +4 -0
- package/dist/state-machines/data-layer/types.js.map +1 -0
- package/dist/state-machines/develop/actions.d.ts +68 -0
- package/dist/state-machines/develop/actions.js +259 -0
- package/dist/state-machines/develop/actions.js.map +1 -0
- package/dist/state-machines/develop/index.d.ts +5 -0
- package/dist/state-machines/develop/index.js +372 -0
- package/dist/state-machines/develop/index.js.map +1 -0
- package/dist/state-machines/develop/services.d.ts +3 -0
- package/dist/state-machines/develop/services.js +22 -0
- package/dist/state-machines/develop/services.js.map +1 -0
- package/dist/state-machines/index.d.ts +7 -0
- package/dist/state-machines/index.js +21 -0
- package/dist/state-machines/index.js.map +1 -0
- package/dist/state-machines/query-running/actions.d.ts +9 -0
- package/dist/state-machines/query-running/actions.js +55 -0
- package/dist/state-machines/query-running/actions.js.map +1 -0
- package/dist/state-machines/query-running/index.d.ts +7 -0
- package/dist/state-machines/query-running/index.js +142 -0
- package/dist/state-machines/query-running/index.js.map +1 -0
- package/dist/state-machines/query-running/services.d.ts +3 -0
- package/dist/state-machines/query-running/services.js +17 -0
- package/dist/state-machines/query-running/services.js.map +1 -0
- package/dist/state-machines/query-running/types.d.ts +26 -0
- package/dist/state-machines/query-running/types.js +4 -0
- package/dist/state-machines/query-running/types.js.map +1 -0
- package/dist/state-machines/waiting/actions.d.ts +11 -0
- package/dist/state-machines/waiting/actions.js +36 -0
- package/dist/state-machines/waiting/actions.js.map +1 -0
- package/dist/state-machines/waiting/index.d.ts +12 -0
- package/dist/state-machines/waiting/index.js +145 -0
- package/dist/state-machines/waiting/index.js.map +1 -0
- package/dist/state-machines/waiting/services.d.ts +3 -0
- package/dist/state-machines/waiting/services.js +10 -0
- package/dist/state-machines/waiting/services.js.map +1 -0
- package/dist/state-machines/waiting/types.d.ts +12 -0
- package/dist/state-machines/waiting/types.js +4 -0
- package/dist/state-machines/waiting/types.js.map +1 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/adapter/constants.d.ts +5 -0
- package/dist/utils/adapter/constants.js +31 -0
- package/dist/utils/adapter/constants.js.map +1 -0
- package/dist/utils/adapter/create-headers.d.ts +10 -0
- package/dist/utils/adapter/create-headers.js +94 -0
- package/dist/utils/adapter/create-headers.js.map +1 -0
- package/dist/utils/adapter/get-route-path.d.ts +3 -0
- package/dist/utils/adapter/get-route-path.js +22 -0
- package/dist/utils/adapter/get-route-path.js.map +1 -0
- package/dist/utils/adapter/init.d.ts +3 -0
- package/dist/utils/adapter/init.js +183 -0
- package/dist/utils/adapter/init.js.map +1 -0
- package/dist/utils/adapter/manager.d.ts +9 -0
- package/dist/utils/adapter/manager.js +554 -0
- package/dist/utils/adapter/manager.js.map +1 -0
- package/dist/utils/adapter/no-op-manager.d.ts +2 -0
- package/dist/utils/adapter/no-op-manager.js +18 -0
- package/dist/utils/adapter/no-op-manager.js.map +1 -0
- package/dist/utils/adapter/types.d.ts +282 -0
- package/dist/utils/adapter/types.js +4 -0
- package/dist/utils/adapter/types.js.map +1 -0
- package/dist/utils/api-browser-docs.d.ts +272 -0
- package/dist/utils/api-browser-docs.js +318 -0
- package/dist/utils/api-browser-docs.js.map +1 -0
- package/dist/utils/api-node-docs.d.ts +470 -0
- package/dist/utils/api-node-docs.js +519 -0
- package/dist/utils/api-node-docs.js.map +1 -0
- package/dist/utils/api-node-helpers-docs.js +322 -0
- package/dist/utils/api-node-helpers-docs.js.map +1 -0
- package/dist/utils/api-runner-error-parser.d.ts +5 -0
- package/dist/utils/api-runner-error-parser.js +63 -0
- package/dist/utils/api-runner-error-parser.js.map +1 -0
- package/dist/utils/api-runner-node.js +663 -0
- package/dist/utils/api-runner-node.js.map +1 -0
- package/dist/utils/app-data.d.ts +2 -0
- package/dist/utils/app-data.js +15 -0
- package/dist/utils/app-data.js.map +1 -0
- package/dist/utils/assert-store.d.ts +2 -0
- package/dist/utils/assert-store.js +12 -0
- package/dist/utils/assert-store.js.map +1 -0
- package/dist/utils/babel/babel-module-exports-helpers.d.ts +22 -0
- package/dist/utils/babel/babel-module-exports-helpers.js +48 -0
- package/dist/utils/babel/babel-module-exports-helpers.js.map +1 -0
- package/dist/utils/babel/babel-plugin-add-slice-placeholder-location.d.ts +10 -0
- package/dist/utils/babel/babel-plugin-add-slice-placeholder-location.js +48 -0
- package/dist/utils/babel/babel-plugin-add-slice-placeholder-location.js.map +1 -0
- package/dist/utils/babel/babel-plugin-remove-api.d.ts +5 -0
- package/dist/utils/babel/babel-plugin-remove-api.js +148 -0
- package/dist/utils/babel/babel-plugin-remove-api.js.map +1 -0
- package/dist/utils/babel/find-slices.d.ts +8 -0
- package/dist/utils/babel/find-slices.js +68 -0
- package/dist/utils/babel/find-slices.js.map +1 -0
- package/dist/utils/babel-loader-helpers.d.ts +19 -0
- package/dist/utils/babel-loader-helpers.js +158 -0
- package/dist/utils/babel-loader-helpers.js.map +1 -0
- package/dist/utils/babel-loader.d.ts +8 -0
- package/dist/utils/babel-loader.js +158 -0
- package/dist/utils/babel-loader.js.map +1 -0
- package/dist/utils/babel-parse-to-ast.d.ts +4 -0
- package/dist/utils/babel-parse-to-ast.js +34 -0
- package/dist/utils/babel-parse-to-ast.js.map +1 -0
- package/dist/utils/batcher.d.ts +15 -0
- package/dist/utils/batcher.js +46 -0
- package/dist/utils/batcher.js.map +1 -0
- package/dist/utils/browserslist.d.ts +2 -0
- package/dist/utils/browserslist.js +38 -0
- package/dist/utils/browserslist.js.map +1 -0
- package/dist/utils/cache-lmdb.d.ts +19 -0
- package/dist/utils/cache-lmdb.js +88 -0
- package/dist/utils/cache-lmdb.js.map +1 -0
- package/dist/utils/cache.d.ts +17 -0
- package/dist/utils/cache.js +77 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/call-deferred-api.d.ts +8 -0
- package/dist/utils/call-deferred-api.js +35 -0
- package/dist/utils/call-deferred-api.js.map +1 -0
- package/dist/utils/changed-pages.d.ts +6 -0
- package/dist/utils/changed-pages.js +45 -0
- package/dist/utils/changed-pages.js.map +1 -0
- package/dist/utils/clear-require-cache.d.ts +1 -0
- package/dist/utils/clear-require-cache.js +24 -0
- package/dist/utils/clear-require-cache.js.map +1 -0
- package/dist/utils/client-assets-for-template.d.ts +9 -0
- package/dist/utils/client-assets-for-template.js +141 -0
- package/dist/utils/client-assets-for-template.js.map +1 -0
- package/dist/utils/create-node-id.d.ts +24 -0
- package/dist/utils/create-node-id.js +67 -0
- package/dist/utils/create-node-id.js.map +1 -0
- package/dist/utils/create-schema-customization.d.ts +6 -0
- package/dist/utils/create-schema-customization.js +25 -0
- package/dist/utils/create-schema-customization.js.map +1 -0
- package/dist/utils/detect-node-mutations.d.ts +4 -0
- package/dist/utils/detect-node-mutations.js +134 -0
- package/dist/utils/detect-node-mutations.js.map +1 -0
- package/dist/utils/detect-port-in-use-and-prompt.d.ts +1 -0
- package/dist/utils/detect-port-in-use-and-prompt.js +31 -0
- package/dist/utils/detect-port-in-use-and-prompt.js.map +1 -0
- package/dist/utils/dev-ssr/parse-error.d.ts +22 -0
- package/dist/utils/dev-ssr/parse-error.js +119 -0
- package/dist/utils/dev-ssr/parse-error.js.map +1 -0
- package/dist/utils/dev-ssr/render-dev-html-child.d.ts +13 -0
- package/dist/utils/dev-ssr/render-dev-html-child.js +47 -0
- package/dist/utils/dev-ssr/render-dev-html-child.js.map +1 -0
- package/dist/utils/dev-ssr/render-dev-html.d.ts +23 -0
- package/dist/utils/dev-ssr/render-dev-html.js +227 -0
- package/dist/utils/dev-ssr/render-dev-html.js.map +1 -0
- package/dist/utils/develop-preload-headers.d.ts +7 -0
- package/dist/utils/develop-preload-headers.js +64 -0
- package/dist/utils/develop-preload-headers.js.map +1 -0
- package/dist/utils/did-you-mean.d.ts +3 -0
- package/dist/utils/did-you-mean.js +21 -0
- package/dist/utils/did-you-mean.js.map +1 -0
- package/dist/utils/engine-context.d.ts +5 -0
- package/dist/utils/engine-context.js +19 -0
- package/dist/utils/engine-context.js.map +1 -0
- package/dist/utils/engines-fs-provider.d.ts +9 -0
- package/dist/utils/engines-fs-provider.js +24 -0
- package/dist/utils/engines-fs-provider.js.map +1 -0
- package/dist/utils/engines-helpers.d.ts +10 -0
- package/dist/utils/engines-helpers.js +48 -0
- package/dist/utils/engines-helpers.js.map +1 -0
- package/dist/utils/ensure-file-content.d.ts +1 -0
- package/dist/utils/ensure-file-content.js +19 -0
- package/dist/utils/ensure-file-content.js.map +1 -0
- package/dist/utils/eslint/required.js +10 -0
- package/dist/utils/eslint/required.js.map +1 -0
- package/dist/utils/eslint-config.d.ts +3 -0
- package/dist/utils/eslint-config.js +136 -0
- package/dist/utils/eslint-config.js.map +1 -0
- package/dist/utils/eslint-rules/limited-exports-page-templates.d.ts +1 -0
- package/dist/utils/eslint-rules/limited-exports-page-templates.js +183 -0
- package/dist/utils/eslint-rules/limited-exports-page-templates.js.map +1 -0
- package/dist/utils/eslint-rules/no-anonymous-exports-page-templates.d.ts +1 -0
- package/dist/utils/eslint-rules/no-anonymous-exports-page-templates.js +75 -0
- package/dist/utils/eslint-rules/no-anonymous-exports-page-templates.js.map +1 -0
- package/dist/utils/eslint-rules-helpers.d.ts +4 -0
- package/dist/utils/eslint-rules-helpers.js +22 -0
- package/dist/utils/eslint-rules-helpers.js.map +1 -0
- package/dist/utils/express-middlewares.d.ts +4 -0
- package/dist/utils/express-middlewares.js +57 -0
- package/dist/utils/express-middlewares.js.map +1 -0
- package/dist/utils/extract-undefined-global.d.ts +4 -0
- package/dist/utils/extract-undefined-global.js +15 -0
- package/dist/utils/extract-undefined-global.js.map +1 -0
- package/dist/utils/fast-refresh-module.d.ts +22 -0
- package/dist/utils/fast-refresh-module.js +53 -0
- package/dist/utils/fast-refresh-module.js.map +1 -0
- package/dist/utils/feedback.d.ts +5 -0
- package/dist/utils/feedback.js +159 -0
- package/dist/utils/feedback.js.map +1 -0
- package/dist/utils/find-page-by-path.d.ts +2 -0
- package/dist/utils/find-page-by-path.js +96 -0
- package/dist/utils/find-page-by-path.js.map +1 -0
- package/dist/utils/flags.d.ts +41 -0
- package/dist/utils/flags.js +92 -0
- package/dist/utils/flags.js.map +1 -0
- package/dist/utils/gatsby-cloud-config.d.ts +4 -0
- package/dist/utils/gatsby-cloud-config.js +15 -0
- package/dist/utils/gatsby-cloud-config.js.map +1 -0
- package/dist/utils/gatsby-dependents.d.ts +8 -0
- package/dist/utils/gatsby-dependents.js +51 -0
- package/dist/utils/gatsby-dependents.js.map +1 -0
- package/dist/utils/gatsby-webpack-stats-extractor.d.ts +7 -0
- package/dist/utils/gatsby-webpack-stats-extractor.js +136 -0
- package/dist/utils/gatsby-webpack-stats-extractor.js.map +1 -0
- package/dist/utils/gatsby-webpack-virtual-modules.d.ts +6 -0
- package/dist/utils/gatsby-webpack-virtual-modules.js +45 -0
- package/dist/utils/gatsby-webpack-virtual-modules.js.map +1 -0
- package/dist/utils/get-cache.d.ts +2 -0
- package/dist/utils/get-cache.js +18 -0
- package/dist/utils/get-cache.js.map +1 -0
- package/dist/utils/get-latest-gatsby-files.d.ts +8 -0
- package/dist/utils/get-latest-gatsby-files.js +93 -0
- package/dist/utils/get-latest-gatsby-files.js.map +1 -0
- package/dist/utils/get-page-data.d.ts +3 -0
- package/dist/utils/get-page-data.js +88 -0
- package/dist/utils/get-page-data.js.map +1 -0
- package/dist/utils/get-public-path.d.ts +5 -0
- package/dist/utils/get-public-path.js +19 -0
- package/dist/utils/get-public-path.js.map +1 -0
- package/dist/utils/get-server-data.d.ts +19 -0
- package/dist/utils/get-server-data.js +29 -0
- package/dist/utils/get-server-data.js.map +1 -0
- package/dist/utils/get-ssl-cert.d.ts +9 -0
- package/dist/utils/get-ssl-cert.js +95 -0
- package/dist/utils/get-ssl-cert.js.map +1 -0
- package/dist/utils/get-static-dir.d.ts +12 -0
- package/dist/utils/get-static-dir.js +60 -0
- package/dist/utils/get-static-dir.js.map +1 -0
- package/dist/utils/get-value-at.d.ts +1 -0
- package/dist/utils/get-value-at.js +22 -0
- package/dist/utils/get-value-at.js.map +1 -0
- package/dist/utils/graphql-typegen/file-writes.d.ts +5 -0
- package/dist/utils/graphql-typegen/file-writes.js +63 -0
- package/dist/utils/graphql-typegen/file-writes.js.map +1 -0
- package/dist/utils/graphql-typegen/ts-codegen.d.ts +5 -0
- package/dist/utils/graphql-typegen/ts-codegen.js +136 -0
- package/dist/utils/graphql-typegen/ts-codegen.js.map +1 -0
- package/dist/utils/graphql-typegen/utils.d.ts +11 -0
- package/dist/utils/graphql-typegen/utils.js +70 -0
- package/dist/utils/graphql-typegen/utils.js.map +1 -0
- package/dist/utils/handle-flags.d.ts +8 -0
- package/dist/utils/handle-flags.js +212 -0
- package/dist/utils/handle-flags.js.map +1 -0
- package/dist/utils/import-gatsby-plugin.d.ts +11 -0
- package/dist/utils/import-gatsby-plugin.js +40 -0
- package/dist/utils/import-gatsby-plugin.js.map +1 -0
- package/dist/utils/is-32-bit-integer.d.ts +1 -0
- package/dist/utils/is-32-bit-integer.js +8 -0
- package/dist/utils/is-32-bit-integer.js.map +1 -0
- package/dist/utils/is-near-match.d.ts +1 -0
- package/dist/utils/is-near-match.js +10 -0
- package/dist/utils/is-near-match.js.map +1 -0
- package/dist/utils/jobs/manager.d.ts +34 -0
- package/dist/utils/jobs/manager.js +313 -0
- package/dist/utils/jobs/manager.js.map +1 -0
- package/dist/utils/jobs/types.d.ts +63 -0
- package/dist/utils/jobs/types.js +32 -0
- package/dist/utils/jobs/types.js.map +1 -0
- package/dist/utils/jobs/worker-messaging.d.ts +10 -0
- package/dist/utils/jobs/worker-messaging.js +114 -0
- package/dist/utils/jobs/worker-messaging.js.map +1 -0
- package/dist/utils/js-chunk-names.d.ts +1 -0
- package/dist/utils/js-chunk-names.js +72 -0
- package/dist/utils/js-chunk-names.js.map +1 -0
- package/dist/utils/loading-indicator.d.ts +3 -0
- package/dist/utils/loading-indicator.js +44 -0
- package/dist/utils/loading-indicator.js.map +1 -0
- package/dist/utils/local-eslint-config-finder.d.ts +1 -0
- package/dist/utils/local-eslint-config-finder.js +31 -0
- package/dist/utils/local-eslint-config-finder.js.map +1 -0
- package/dist/utils/merge-gatsby-config.d.ts +28 -0
- package/dist/utils/merge-gatsby-config.js +43 -0
- package/dist/utils/merge-gatsby-config.js.map +1 -0
- package/dist/utils/mett.d.ts +10 -0
- package/dist/utils/mett.js +42 -0
- package/dist/utils/mett.js.map +1 -0
- package/dist/utils/module-resolver.d.ts +2 -0
- package/dist/utils/module-resolver.js +24 -0
- package/dist/utils/module-resolver.js.map +1 -0
- package/dist/utils/node-manifest.d.ts +46 -0
- package/dist/utils/node-manifest.js +367 -0
- package/dist/utils/node-manifest.js.map +1 -0
- package/dist/utils/nodes.d.ts +13 -0
- package/dist/utils/nodes.js +62 -0
- package/dist/utils/nodes.js.map +1 -0
- package/dist/utils/normalize-path.d.ts +2 -0
- package/dist/utils/normalize-path.js +11 -0
- package/dist/utils/normalize-path.js.map +1 -0
- package/dist/utils/page-data-helpers.d.ts +23 -0
- package/dist/utils/page-data-helpers.js +76 -0
- package/dist/utils/page-data-helpers.js.map +1 -0
- package/dist/utils/page-data.d.ts +39 -0
- package/dist/utils/page-data.js +366 -0
- package/dist/utils/page-data.js.map +1 -0
- package/dist/utils/page-mode.d.ts +18 -0
- package/dist/utils/page-mode.js +124 -0
- package/dist/utils/page-mode.js.map +1 -0
- package/dist/utils/page-ssr-module/bundle-webpack.d.ts +18 -0
- package/dist/utils/page-ssr-module/bundle-webpack.js +209 -0
- package/dist/utils/page-ssr-module/bundle-webpack.js.map +1 -0
- package/dist/utils/page-ssr-module/entry.d.ts +61 -0
- package/dist/utils/page-ssr-module/entry.js +344 -0
- package/dist/utils/page-ssr-module/entry.js.map +1 -0
- package/dist/utils/page-ssr-module/lambda.d.ts +3 -0
- package/dist/utils/page-ssr-module/lambda.js +401 -0
- package/dist/utils/page-ssr-module/lambda.js.map +1 -0
- package/dist/utils/parcel/compile-gatsby-files.d.ts +26 -0
- package/dist/utils/parcel/compile-gatsby-files.js +271 -0
- package/dist/utils/parcel/compile-gatsby-files.js.map +1 -0
- package/dist/utils/path.d.ts +5 -0
- package/dist/utils/path.js +55 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/utils/prepare-regex.d.ts +1 -0
- package/dist/utils/prepare-regex.js +13 -0
- package/dist/utils/prepare-regex.js.map +1 -0
- package/dist/utils/prepare-urls.d.ts +7 -0
- package/dist/utils/prepare-urls.js +58 -0
- package/dist/utils/prepare-urls.js.map +1 -0
- package/dist/utils/print-instructions.d.ts +2 -0
- package/dist/utils/print-instructions.js +42 -0
- package/dist/utils/print-instructions.js.map +1 -0
- package/dist/utils/rank-route.d.ts +1 -0
- package/dist/utils/rank-route.js +26 -0
- package/dist/utils/rank-route.js.map +1 -0
- package/dist/utils/reach-router-add-basecontext-export-loader.d.ts +1 -0
- package/dist/utils/reach-router-add-basecontext-export-loader.js +23 -0
- package/dist/utils/reach-router-add-basecontext-export-loader.js.map +1 -0
- package/dist/utils/report-once.d.ts +1 -0
- package/dist/utils/report-once.js +17 -0
- package/dist/utils/report-once.js.map +1 -0
- package/dist/utils/sanitize-node.d.ts +12 -0
- package/dist/utils/sanitize-node.js +87 -0
- package/dist/utils/sanitize-node.js.map +1 -0
- package/dist/utils/show-experiment-notice.d.ts +6 -0
- package/dist/utils/show-experiment-notice.js +51 -0
- package/dist/utils/show-experiment-notice.js.map +1 -0
- package/dist/utils/slices/stitching.d.ts +4 -0
- package/dist/utils/slices/stitching.js +92 -0
- package/dist/utils/slices/stitching.js.map +1 -0
- package/dist/utils/slices.d.ts +2 -0
- package/dist/utils/slices.js +9 -0
- package/dist/utils/slices.js.map +1 -0
- package/dist/utils/source-nodes-api-runner.d.ts +8 -0
- package/dist/utils/source-nodes-api-runner.js +23 -0
- package/dist/utils/source-nodes-api-runner.js.map +1 -0
- package/dist/utils/source-nodes.d.ts +11 -0
- package/dist/utils/source-nodes.js +150 -0
- package/dist/utils/source-nodes.js.map +1 -0
- package/dist/utils/stack-trace-utils.d.ts +24 -0
- package/dist/utils/stack-trace-utils.js +113 -0
- package/dist/utils/stack-trace-utils.js.map +1 -0
- package/dist/utils/start-server.d.ts +22 -0
- package/dist/utils/start-server.js +722 -0
- package/dist/utils/start-server.js.map +1 -0
- package/dist/utils/state-machine-logging.d.ts +4 -0
- package/dist/utils/state-machine-logging.js +47 -0
- package/dist/utils/state-machine-logging.js.map +1 -0
- package/dist/utils/static-query-utils.d.ts +13 -0
- package/dist/utils/static-query-utils.js +57 -0
- package/dist/utils/static-query-utils.js.map +1 -0
- package/dist/utils/test-import-error.d.ts +1 -0
- package/dist/utils/test-import-error.js +18 -0
- package/dist/utils/test-import-error.js.map +1 -0
- package/dist/utils/tracer/index.d.ts +12 -0
- package/dist/utils/tracer/index.js +42 -0
- package/dist/utils/tracer/index.js.map +1 -0
- package/dist/utils/tracer/jaeger-local.d.ts +4 -0
- package/dist/utils/tracer/jaeger-local.js +32 -0
- package/dist/utils/tracer/jaeger-local.js.map +1 -0
- package/dist/utils/tracer/zipkin-local.d.ts +11 -0
- package/dist/utils/tracer/zipkin-local.js +87 -0
- package/dist/utils/tracer/zipkin-local.js.map +1 -0
- package/dist/utils/tracer/zipkin-types.d.js +14 -0
- package/dist/utils/tracer/zipkin-types.d.js.map +1 -0
- package/dist/utils/validate-component.d.ts +23 -0
- package/dist/utils/validate-component.js +99 -0
- package/dist/utils/validate-component.js.map +1 -0
- package/dist/utils/validate-engines/child.d.ts +1 -0
- package/dist/utils/validate-engines/child.js +74 -0
- package/dist/utils/validate-engines/child.js.map +1 -0
- package/dist/utils/validate-engines/index.d.ts +2 -0
- package/dist/utils/validate-engines/index.js +48 -0
- package/dist/utils/validate-engines/index.js.map +1 -0
- package/dist/utils/wait-until-jobs-complete.d.ts +2 -0
- package/dist/utils/wait-until-jobs-complete.js +30 -0
- package/dist/utils/wait-until-jobs-complete.js.map +1 -0
- package/dist/utils/webpack/bundle.d.ts +9 -0
- package/dist/utils/webpack/bundle.js +41 -0
- package/dist/utils/webpack/bundle.js.map +1 -0
- package/dist/utils/webpack/get-ssr-chunk-hashes.d.ts +9 -0
- package/dist/utils/webpack/get-ssr-chunk-hashes.js +55 -0
- package/dist/utils/webpack/get-ssr-chunk-hashes.js.map +1 -0
- package/dist/utils/webpack/loaders/client-components-requires-writer-loader.d.ts +1 -0
- package/dist/utils/webpack/loaders/client-components-requires-writer-loader.js +22 -0
- package/dist/utils/webpack/loaders/client-components-requires-writer-loader.js.map +1 -0
- package/dist/utils/webpack/loaders/partial-hydration-reference-loader.d.ts +1 -0
- package/dist/utils/webpack/loaders/partial-hydration-reference-loader.js +127 -0
- package/dist/utils/webpack/loaders/partial-hydration-reference-loader.js.map +1 -0
- package/dist/utils/webpack/loaders/webpack-remove-exports-loader.d.ts +1 -0
- package/dist/utils/webpack/loaders/webpack-remove-exports-loader.js +40 -0
- package/dist/utils/webpack/loaders/webpack-remove-exports-loader.js.map +1 -0
- package/dist/utils/webpack/plugins/cache-folder-resolver.d.ts +25 -0
- package/dist/utils/webpack/plugins/cache-folder-resolver.js +111 -0
- package/dist/utils/webpack/plugins/cache-folder-resolver.js.map +1 -0
- package/dist/utils/webpack/plugins/corejs-resolver.d.ts +12 -0
- package/dist/utils/webpack/plugins/corejs-resolver.js +66 -0
- package/dist/utils/webpack/plugins/corejs-resolver.js.map +1 -0
- package/dist/utils/webpack/plugins/force-css-hmr-for-edge-cases.d.ts +22 -0
- package/dist/utils/webpack/plugins/force-css-hmr-for-edge-cases.js +88 -0
- package/dist/utils/webpack/plugins/force-css-hmr-for-edge-cases.js.map +1 -0
- package/dist/utils/webpack/plugins/partial-hydration.d.ts +26 -0
- package/dist/utils/webpack/plugins/partial-hydration.js +362 -0
- package/dist/utils/webpack/plugins/partial-hydration.js.map +1 -0
- package/dist/utils/webpack/plugins/static-query-mapper.d.ts +13 -0
- package/dist/utils/webpack/plugins/static-query-mapper.js +235 -0
- package/dist/utils/webpack/plugins/static-query-mapper.js.map +1 -0
- package/dist/utils/webpack/plugins/webpack-logging.d.ts +12 -0
- package/dist/utils/webpack/plugins/webpack-logging.js +51 -0
- package/dist/utils/webpack/plugins/webpack-logging.js.map +1 -0
- package/dist/utils/webpack/utils/create-normalized-module-key.d.ts +12 -0
- package/dist/utils/webpack/utils/create-normalized-module-key.js +25 -0
- package/dist/utils/webpack/utils/create-normalized-module-key.js.map +1 -0
- package/dist/utils/webpack/utils/is-file-inside-compilations.d.ts +7 -0
- package/dist/utils/webpack/utils/is-file-inside-compilations.js +37 -0
- package/dist/utils/webpack/utils/is-file-inside-compilations.js.map +1 -0
- package/dist/utils/webpack-error-utils.d.ts +24 -0
- package/dist/utils/webpack-error-utils.js +112 -0
- package/dist/utils/webpack-error-utils.js.map +1 -0
- package/dist/utils/webpack-plugins.d.ts +46 -0
- package/dist/utils/webpack-plugins.js +61 -0
- package/dist/utils/webpack-plugins.js.map +1 -0
- package/dist/utils/webpack-status.d.ts +3 -0
- package/dist/utils/webpack-status.js +21 -0
- package/dist/utils/webpack-status.js.map +1 -0
- package/dist/utils/webpack-utils.d.ts +121 -0
- package/dist/utils/webpack-utils.js +574 -0
- package/dist/utils/webpack-utils.js.map +1 -0
- package/dist/utils/webpack.config.js +804 -0
- package/dist/utils/webpack.config.js.map +1 -0
- package/dist/utils/websocket-manager.d.ts +39 -0
- package/dist/utils/websocket-manager.js +183 -0
- package/dist/utils/websocket-manager.js.map +1 -0
- package/dist/utils/worker/child/index.d.ts +5 -0
- package/dist/utils/worker/child/index.js +35 -0
- package/dist/utils/worker/child/index.js.map +1 -0
- package/dist/utils/worker/child/load-config-and-plugins.d.ts +2 -0
- package/dist/utils/worker/child/load-config-and-plugins.js +28 -0
- package/dist/utils/worker/child/load-config-and-plugins.js.map +1 -0
- package/dist/utils/worker/child/queries.d.ts +7 -0
- package/dist/utils/worker/child/queries.js +84 -0
- package/dist/utils/worker/child/queries.js.map +1 -0
- package/dist/utils/worker/child/render-html.d.ts +49 -0
- package/dist/utils/worker/child/render-html.js +562 -0
- package/dist/utils/worker/child/render-html.js.map +1 -0
- package/dist/utils/worker/child/schema.d.ts +2 -0
- package/dist/utils/worker/child/schema.js +41 -0
- package/dist/utils/worker/child/schema.js.map +1 -0
- package/dist/utils/worker/child/state.d.ts +2 -0
- package/dist/utils/worker/child/state.js +13 -0
- package/dist/utils/worker/child/state.js.map +1 -0
- package/dist/utils/worker/messaging.d.ts +16 -0
- package/dist/utils/worker/messaging.js +9 -0
- package/dist/utils/worker/messaging.js.map +1 -0
- package/dist/utils/worker/pool.d.ts +10 -0
- package/dist/utils/worker/pool.js +122 -0
- package/dist/utils/worker/pool.js.map +1 -0
- package/dist/utils/worker/reporter.d.ts +3 -0
- package/dist/utils/worker/reporter.js +26 -0
- package/dist/utils/worker/reporter.js.map +1 -0
- package/dist/utils/worker/types.d.ts +3 -0
- package/dist/utils/worker/types.js +4 -0
- package/dist/utils/worker/types.js.map +1 -0
- package/graphql.d.ts +2 -0
- package/graphql.js +6 -0
- package/index.d.ts +1906 -0
- package/internal.d.ts +4 -0
- package/internal.js +5 -0
- package/ipc.json +3 -0
- package/package.json +744 -0
- package/reporter.d.ts +4 -0
- package/reporter.js +3 -0
- package/scripts/postinstall.js +7 -0
- package/utils.js +1 -0
- package/webpack.d.ts +3 -0
- package/webpack.js +3 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.eslintRequiredConfig = exports.eslintConfig = void 0;
|
|
6
|
+
var _path = _interopRequireDefault(require("path"));
|
|
7
|
+
const eslintRulePaths = _path.default.resolve(`${__dirname}/eslint-rules`);
|
|
8
|
+
const eslintRequirePreset = require.resolve(`./eslint/required`);
|
|
9
|
+
const eslintRequiredConfig = {
|
|
10
|
+
rulePaths: [eslintRulePaths],
|
|
11
|
+
useEslintrc: false,
|
|
12
|
+
allowInlineConfig: false,
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
emitWarning: true,
|
|
15
|
+
baseConfig: {
|
|
16
|
+
parser: require.resolve(`@babel/eslint-parser`),
|
|
17
|
+
parserOptions: {
|
|
18
|
+
ecmaVersion: 2020,
|
|
19
|
+
sourceType: `module`,
|
|
20
|
+
ecmaFeatures: {
|
|
21
|
+
jsx: true
|
|
22
|
+
},
|
|
23
|
+
// TODO proper check for custom babel & plugins config
|
|
24
|
+
// Currently when a babelrc is added to the project, it will override our babelOptions
|
|
25
|
+
babelOptions: {
|
|
26
|
+
presets: [require.resolve(`babel-preset-gatsby`)]
|
|
27
|
+
},
|
|
28
|
+
requireConfigFile: false
|
|
29
|
+
},
|
|
30
|
+
globals: {
|
|
31
|
+
graphql: true,
|
|
32
|
+
__PATH_PREFIX__: true,
|
|
33
|
+
__TRAILING_SLASH__: true,
|
|
34
|
+
__BASE_PATH__: true // this will rarely, if ever, be used by consumers
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
extends: [eslintRequirePreset]
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.eslintRequiredConfig = eslintRequiredConfig;
|
|
41
|
+
const eslintConfig = usingAutomaticJsxRuntime => {
|
|
42
|
+
return {
|
|
43
|
+
useEslintrc: false,
|
|
44
|
+
resolvePluginsRelativeTo: __dirname,
|
|
45
|
+
rulePaths: [eslintRulePaths],
|
|
46
|
+
baseConfig: {
|
|
47
|
+
globals: {
|
|
48
|
+
graphql: true,
|
|
49
|
+
__PATH_PREFIX__: true,
|
|
50
|
+
__TRAILING_SLASH__: true,
|
|
51
|
+
__BASE_PATH__: true // this will rarely, if ever, be used by consumers
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
extends: [require.resolve(`eslint-config-react-app`), eslintRequirePreset],
|
|
55
|
+
parser: require.resolve(`@babel/eslint-parser`),
|
|
56
|
+
parserOptions: {
|
|
57
|
+
ecmaVersion: 2020,
|
|
58
|
+
sourceType: `module`,
|
|
59
|
+
ecmaFeatures: {
|
|
60
|
+
jsx: true
|
|
61
|
+
},
|
|
62
|
+
// TODO proper check for custom babel & plugins config
|
|
63
|
+
// Currently when a babelrc is added to the project, it will override our babelOptions
|
|
64
|
+
babelOptions: {
|
|
65
|
+
presets: [require.resolve(`babel-preset-gatsby`)]
|
|
66
|
+
},
|
|
67
|
+
requireConfigFile: false
|
|
68
|
+
},
|
|
69
|
+
plugins: [],
|
|
70
|
+
rules: {
|
|
71
|
+
// New versions of react use a special jsx runtime that remove the requirement
|
|
72
|
+
// for having react in scope for jsx. Once the jsx runtime is backported to all
|
|
73
|
+
// versions of react we can make this always be `off`.
|
|
74
|
+
// I would also assume that eslint-config-react-app will switch their flag to `off`
|
|
75
|
+
// when jsx runtime is stable in all common versions of React.
|
|
76
|
+
"react/jsx-uses-react": usingAutomaticJsxRuntime ? `off` : `error`,
|
|
77
|
+
"react/react-in-jsx-scope": usingAutomaticJsxRuntime ? `off` : `error`,
|
|
78
|
+
"import/no-webpack-loader-syntax": [0],
|
|
79
|
+
"react/jsx-pascal-case": [`warn`, {
|
|
80
|
+
allowNamespace: true
|
|
81
|
+
}],
|
|
82
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/master/docs/rules
|
|
83
|
+
// "jsx-a11y/accessible-emoji": `warn`, Deprecated
|
|
84
|
+
"jsx-a11y/alt-text": `warn`,
|
|
85
|
+
"jsx-a11y/anchor-has-content": `warn`,
|
|
86
|
+
"jsx-a11y/anchor-is-valid": `warn`,
|
|
87
|
+
"jsx-a11y/aria-activedescendant-has-tabindex": `warn`,
|
|
88
|
+
"jsx-a11y/aria-props": `warn`,
|
|
89
|
+
"jsx-a11y/aria-proptypes": `warn`,
|
|
90
|
+
"jsx-a11y/aria-role": `warn`,
|
|
91
|
+
"jsx-a11y/aria-unsupported-elements": `warn`,
|
|
92
|
+
"jsx-a11y/autocomplete-valid": [`warn`, {
|
|
93
|
+
inputComponents: []
|
|
94
|
+
}],
|
|
95
|
+
"jsx-a11y/click-events-have-key-events": `warn`,
|
|
96
|
+
"jsx-a11y/control-has-associated-label": [`warn`, {
|
|
97
|
+
ignoreElements: [`audio`, `canvas`, `embed`, `input`, `textarea`, `tr`, `video`],
|
|
98
|
+
ignoreRoles: [`grid`, `listbox`, `menu`, `menubar`, `radiogroup`, `row`, `tablist`, `toolbar`, `tree`, `treegrid`],
|
|
99
|
+
includeRoles: [`alert`, `dialog`]
|
|
100
|
+
}],
|
|
101
|
+
"jsx-a11y/heading-has-content": `warn`,
|
|
102
|
+
"jsx-a11y/html-has-lang": `warn`,
|
|
103
|
+
"jsx-a11y/iframe-has-title": `warn`,
|
|
104
|
+
"jsx-a11y/img-redundant-alt": `warn`,
|
|
105
|
+
"jsx-a11y/interactive-supports-focus": [`warn`, {
|
|
106
|
+
tabbable: [`button`, `checkbox`, `link`, `progressbar`, `searchbox`, `slider`, `spinbutton`, `switch`, `textbox`]
|
|
107
|
+
}],
|
|
108
|
+
// "jsx-a11y/label-has-for": `warn`, was deprecated and replaced with jsx-a11y/has-associated-control in v6.1.0
|
|
109
|
+
"jsx-a11y/label-has-associated-control": `warn`,
|
|
110
|
+
"jsx-a11y/lang": `warn`,
|
|
111
|
+
"jsx-a11y/media-has-caption": `warn`,
|
|
112
|
+
"jsx-a11y/mouse-events-have-key-events": `warn`,
|
|
113
|
+
"jsx-a11y/no-access-key": `warn`,
|
|
114
|
+
"jsx-a11y/no-autofocus": `warn`,
|
|
115
|
+
"jsx-a11y/no-distracting-elements": `warn`,
|
|
116
|
+
"jsx-a11y/no-interactive-element-to-noninteractive-role": `warn`,
|
|
117
|
+
"jsx-a11y/no-noninteractive-element-interactions": [`warn`, {
|
|
118
|
+
body: [`onError`, `onLoad`],
|
|
119
|
+
iframe: [`onError`, `onLoad`],
|
|
120
|
+
img: [`onError`, `onLoad`]
|
|
121
|
+
}],
|
|
122
|
+
"jsx-a11y/no-noninteractive-element-to-interactive-role": `warn`,
|
|
123
|
+
"jsx-a11y/no-noninteractive-tabindex": `warn`,
|
|
124
|
+
// "jsx-a11y/no-onchange": `warn`, Deprecated
|
|
125
|
+
"jsx-a11y/no-redundant-roles": `warn`,
|
|
126
|
+
"jsx-a11y/no-static-element-interactions": `warn`,
|
|
127
|
+
"jsx-a11y/role-has-required-aria-props": `warn`,
|
|
128
|
+
"jsx-a11y/role-supports-aria-props": `warn`,
|
|
129
|
+
"jsx-a11y/scope": `warn`,
|
|
130
|
+
"jsx-a11y/tabindex-no-positive": `warn`
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
exports.eslintConfig = eslintConfig;
|
|
136
|
+
//# sourceMappingURL=eslint-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-config.js","names":["eslintRulePaths","path","resolve","__dirname","eslintRequirePreset","require","eslintRequiredConfig","rulePaths","useEslintrc","allowInlineConfig","emitWarning","baseConfig","parser","parserOptions","ecmaVersion","sourceType","ecmaFeatures","jsx","babelOptions","presets","requireConfigFile","globals","graphql","__PATH_PREFIX__","__TRAILING_SLASH__","__BASE_PATH__","extends","eslintConfig","usingAutomaticJsxRuntime","resolvePluginsRelativeTo","plugins","rules","allowNamespace","inputComponents","ignoreElements","ignoreRoles","includeRoles","tabbable","body","iframe","img"],"sources":["../../src/utils/eslint-config.ts"],"sourcesContent":["import { ESLint } from \"eslint\"\nimport path from \"path\"\n\nconst eslintRulePaths = path.resolve(`${__dirname}/eslint-rules`)\nconst eslintRequirePreset = require.resolve(`./eslint/required`)\n\nexport const eslintRequiredConfig: ESLint.Options = {\n rulePaths: [eslintRulePaths],\n useEslintrc: false,\n allowInlineConfig: false,\n // @ts-ignore\n emitWarning: true,\n baseConfig: {\n parser: require.resolve(`@babel/eslint-parser`),\n parserOptions: {\n ecmaVersion: 2020,\n sourceType: `module`,\n ecmaFeatures: {\n jsx: true,\n },\n // TODO proper check for custom babel & plugins config\n // Currently when a babelrc is added to the project, it will override our babelOptions\n babelOptions: {\n presets: [require.resolve(`babel-preset-gatsby`)],\n },\n requireConfigFile: false,\n },\n globals: {\n graphql: true,\n __PATH_PREFIX__: true,\n __TRAILING_SLASH__: true,\n __BASE_PATH__: true, // this will rarely, if ever, be used by consumers\n },\n extends: [eslintRequirePreset],\n },\n}\n\nexport const eslintConfig = (\n usingAutomaticJsxRuntime: boolean\n): ESLint.Options => {\n return {\n useEslintrc: false,\n resolvePluginsRelativeTo: __dirname,\n rulePaths: [eslintRulePaths],\n baseConfig: {\n globals: {\n graphql: true,\n __PATH_PREFIX__: true,\n __TRAILING_SLASH__: true,\n __BASE_PATH__: true, // this will rarely, if ever, be used by consumers\n },\n extends: [\n require.resolve(`eslint-config-react-app`),\n eslintRequirePreset,\n ],\n parser: require.resolve(`@babel/eslint-parser`),\n parserOptions: {\n ecmaVersion: 2020,\n sourceType: `module`,\n ecmaFeatures: {\n jsx: true,\n },\n // TODO proper check for custom babel & plugins config\n // Currently when a babelrc is added to the project, it will override our babelOptions\n babelOptions: {\n presets: [require.resolve(`babel-preset-gatsby`)],\n },\n requireConfigFile: false,\n },\n plugins: [],\n rules: {\n // New versions of react use a special jsx runtime that remove the requirement\n // for having react in scope for jsx. Once the jsx runtime is backported to all\n // versions of react we can make this always be `off`.\n // I would also assume that eslint-config-react-app will switch their flag to `off`\n // when jsx runtime is stable in all common versions of React.\n \"react/jsx-uses-react\": usingAutomaticJsxRuntime ? `off` : `error`,\n \"react/react-in-jsx-scope\": usingAutomaticJsxRuntime ? `off` : `error`,\n \"import/no-webpack-loader-syntax\": [0],\n \"react/jsx-pascal-case\": [\n `warn`,\n {\n allowNamespace: true,\n },\n ],\n // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/master/docs/rules\n // \"jsx-a11y/accessible-emoji\": `warn`, Deprecated\n \"jsx-a11y/alt-text\": `warn`,\n \"jsx-a11y/anchor-has-content\": `warn`,\n \"jsx-a11y/anchor-is-valid\": `warn`,\n \"jsx-a11y/aria-activedescendant-has-tabindex\": `warn`,\n \"jsx-a11y/aria-props\": `warn`,\n \"jsx-a11y/aria-proptypes\": `warn`,\n \"jsx-a11y/aria-role\": `warn`,\n \"jsx-a11y/aria-unsupported-elements\": `warn`,\n \"jsx-a11y/autocomplete-valid\": [\n `warn`,\n {\n inputComponents: [],\n },\n ],\n \"jsx-a11y/click-events-have-key-events\": `warn`,\n \"jsx-a11y/control-has-associated-label\": [\n `warn`,\n {\n ignoreElements: [\n `audio`,\n `canvas`,\n `embed`,\n `input`,\n `textarea`,\n `tr`,\n `video`,\n ],\n ignoreRoles: [\n `grid`,\n `listbox`,\n `menu`,\n `menubar`,\n `radiogroup`,\n `row`,\n `tablist`,\n `toolbar`,\n `tree`,\n `treegrid`,\n ],\n includeRoles: [`alert`, `dialog`],\n },\n ],\n \"jsx-a11y/heading-has-content\": `warn`,\n \"jsx-a11y/html-has-lang\": `warn`,\n \"jsx-a11y/iframe-has-title\": `warn`,\n \"jsx-a11y/img-redundant-alt\": `warn`,\n \"jsx-a11y/interactive-supports-focus\": [\n `warn`,\n {\n tabbable: [\n `button`,\n `checkbox`,\n `link`,\n `progressbar`,\n `searchbox`,\n `slider`,\n `spinbutton`,\n `switch`,\n `textbox`,\n ],\n },\n ],\n // \"jsx-a11y/label-has-for\": `warn`, was deprecated and replaced with jsx-a11y/has-associated-control in v6.1.0\n \"jsx-a11y/label-has-associated-control\": `warn`,\n \"jsx-a11y/lang\": `warn`,\n \"jsx-a11y/media-has-caption\": `warn`,\n \"jsx-a11y/mouse-events-have-key-events\": `warn`,\n \"jsx-a11y/no-access-key\": `warn`,\n \"jsx-a11y/no-autofocus\": `warn`,\n \"jsx-a11y/no-distracting-elements\": `warn`,\n \"jsx-a11y/no-interactive-element-to-noninteractive-role\": `warn`,\n \"jsx-a11y/no-noninteractive-element-interactions\": [\n `warn`,\n {\n body: [`onError`, `onLoad`],\n iframe: [`onError`, `onLoad`],\n img: [`onError`, `onLoad`],\n },\n ],\n \"jsx-a11y/no-noninteractive-element-to-interactive-role\": `warn`,\n \"jsx-a11y/no-noninteractive-tabindex\": `warn`,\n // \"jsx-a11y/no-onchange\": `warn`, Deprecated\n \"jsx-a11y/no-redundant-roles\": `warn`,\n \"jsx-a11y/no-static-element-interactions\": `warn`,\n \"jsx-a11y/role-has-required-aria-props\": `warn`,\n \"jsx-a11y/role-supports-aria-props\": `warn`,\n \"jsx-a11y/scope\": `warn`,\n \"jsx-a11y/tabindex-no-positive\": `warn`,\n },\n },\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _redux = require("../../redux");
|
|
4
|
+
var _eslintRulesHelpers = require("../eslint-rules-helpers");
|
|
5
|
+
const DEFAULT_GRAPHQL_TAG_NAME = `graphql`;
|
|
6
|
+
function isApiExport(node, name) {
|
|
7
|
+
var _node$declaration, _node$declaration$id, _node$declaration2;
|
|
8
|
+
// check for
|
|
9
|
+
// export function name() {}
|
|
10
|
+
// export async function name() {}
|
|
11
|
+
if (((_node$declaration = node.declaration) === null || _node$declaration === void 0 ? void 0 : _node$declaration.type) === `FunctionDeclaration` && ((_node$declaration$id = node.declaration.id) === null || _node$declaration$id === void 0 ? void 0 : _node$declaration$id.name) === name) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// check for
|
|
16
|
+
// export const name = () => {}
|
|
17
|
+
if (((_node$declaration2 = node.declaration) === null || _node$declaration2 === void 0 ? void 0 : _node$declaration2.type) === `VariableDeclaration`) {
|
|
18
|
+
for (const declaration of node.declaration.declarations) {
|
|
19
|
+
if (declaration.type === `VariableDeclarator` && declaration.id.type === `Identifier` && declaration.id.name === name) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (name === `Head`) {
|
|
25
|
+
var _node$declaration3, _node$declaration4, _node$declaration4$id, _node$declaration5, _node$declaration5$id;
|
|
26
|
+
// Head can be re-exported, Head can be class components - so the checks above are not sufficient,
|
|
27
|
+
// we need to be more permisive here
|
|
28
|
+
|
|
29
|
+
// class component
|
|
30
|
+
if (((_node$declaration3 = node.declaration) === null || _node$declaration3 === void 0 ? void 0 : _node$declaration3.type) === `ClassDeclaration` && ((_node$declaration4 = node.declaration) === null || _node$declaration4 === void 0 ? void 0 : (_node$declaration4$id = _node$declaration4.id) === null || _node$declaration4$id === void 0 ? void 0 : _node$declaration4$id.type) === `Identifier` && ((_node$declaration5 = node.declaration) === null || _node$declaration5 === void 0 ? void 0 : (_node$declaration5$id = _node$declaration5.id) === null || _node$declaration5$id === void 0 ? void 0 : _node$declaration5$id.name) === name) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// re-exports
|
|
35
|
+
if (node.source && node.specifiers.some(specifier => specifier.exported.name === name)) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
function hasOneValidNamedDeclaration(node, varName) {
|
|
42
|
+
// Checks for:
|
|
43
|
+
// const query = graphql``
|
|
44
|
+
// export { query }
|
|
45
|
+
if (node.type === `ExportNamedDeclaration` && node.declaration === null) {
|
|
46
|
+
// For export { foobar, query } the declaration will be null and specifiers exists
|
|
47
|
+
// For { foobar, query } it'll return true, for { query } it'll return false
|
|
48
|
+
// It will ignore any { default } declarations since these are allowed
|
|
49
|
+
const nonQueryExports = node.specifiers.some(e => varName ? e.exported.name !== varName && e.exported.name !== `default` : e.exported.name !== `default`);
|
|
50
|
+
return !nonQueryExports;
|
|
51
|
+
}
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
function isTemplateQuery(node, graphqlTagName, namespaceSpecifierName) {
|
|
55
|
+
var _node$declaration6, _node$declaration7;
|
|
56
|
+
// For export const query = 'foobar' the declaration exists with type 'VariableDeclaration'
|
|
57
|
+
|
|
58
|
+
// Checks for:
|
|
59
|
+
// export const query = graphql``
|
|
60
|
+
// This case only has one item in the declarations array
|
|
61
|
+
// For export const hello = 10, world = 'foo'
|
|
62
|
+
// The array will have two items. So use every() to check if only one item exists
|
|
63
|
+
// With TaggedTemplateExpression and "graphql" name
|
|
64
|
+
|
|
65
|
+
// In addition the declaration can also be a MemberExpression like
|
|
66
|
+
// Gatsby.graphql`` when the import happened with import * as Gatsby from "gatsby"
|
|
67
|
+
|
|
68
|
+
return node.type === `ExportNamedDeclaration` && ((_node$declaration6 = node.declaration) === null || _node$declaration6 === void 0 ? void 0 : _node$declaration6.type) === `VariableDeclaration` && ((_node$declaration7 = node.declaration) === null || _node$declaration7 === void 0 ? void 0 : _node$declaration7.declarations.every(el => {
|
|
69
|
+
var _el$init, _el$init2;
|
|
70
|
+
if ((el === null || el === void 0 ? void 0 : (_el$init = el.init) === null || _el$init === void 0 ? void 0 : _el$init.type) === `TaggedTemplateExpression` && el.init.tag.type === `Identifier`) {
|
|
71
|
+
return el.init.tag.name === graphqlTagName;
|
|
72
|
+
} else if ((el === null || el === void 0 ? void 0 : (_el$init2 = el.init) === null || _el$init2 === void 0 ? void 0 : _el$init2.type) === `TaggedTemplateExpression` && el.init.tag.type === `MemberExpression`) {
|
|
73
|
+
return el.init.tag.object.name === namespaceSpecifierName && el.init.tag.property.name === DEFAULT_GRAPHQL_TAG_NAME;
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
const limitedExports = {
|
|
79
|
+
meta: {
|
|
80
|
+
type: `problem`,
|
|
81
|
+
messages: {
|
|
82
|
+
limitedExportsPageTemplates: `In page templates only a default export of a valid React component and the named exports of a page query, getServerData, Head or config are allowed.
|
|
83
|
+
All other named exports will cause Fast Refresh to not preserve local component state and do a full refresh.
|
|
84
|
+
|
|
85
|
+
Please move your other named exports to another file. Also make sure that you only export page queries that use the "graphql" tag from "gatsby".
|
|
86
|
+
`
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
create: context => {
|
|
90
|
+
if (!(0, _eslintRulesHelpers.isPageTemplate)(_redux.store, context)) {
|
|
91
|
+
return {};
|
|
92
|
+
}
|
|
93
|
+
let queryVariableName = ``;
|
|
94
|
+
let graphqlTagName = ``;
|
|
95
|
+
let namespaceSpecifierName = ``;
|
|
96
|
+
return {
|
|
97
|
+
// const { graphql } = require('gatsby')
|
|
98
|
+
VariableDeclaration: node => {
|
|
99
|
+
// Check if require('gatsby')
|
|
100
|
+
const requiredFromGatsby = node.declarations.find(el => {
|
|
101
|
+
var _el$init3, _el$init3$arguments, _el$init3$arguments$, _el$init4, _el$init4$arguments, _el$init4$arguments$;
|
|
102
|
+
// Handle require(`gatsby`)
|
|
103
|
+
if (((_el$init3 = el.init) === null || _el$init3 === void 0 ? void 0 : (_el$init3$arguments = _el$init3.arguments) === null || _el$init3$arguments === void 0 ? void 0 : (_el$init3$arguments$ = _el$init3$arguments[0]) === null || _el$init3$arguments$ === void 0 ? void 0 : _el$init3$arguments$.type) === `TemplateLiteral`) {
|
|
104
|
+
var _arguments$;
|
|
105
|
+
return ((_arguments$ = el.init.arguments[0]) === null || _arguments$ === void 0 ? void 0 : _arguments$.quasis[0].value.raw) === `gatsby`;
|
|
106
|
+
}
|
|
107
|
+
return ((_el$init4 = el.init) === null || _el$init4 === void 0 ? void 0 : (_el$init4$arguments = _el$init4.arguments) === null || _el$init4$arguments === void 0 ? void 0 : (_el$init4$arguments$ = _el$init4$arguments[0]) === null || _el$init4$arguments$ === void 0 ? void 0 : _el$init4$arguments$.value) === `gatsby`;
|
|
108
|
+
});
|
|
109
|
+
if (requiredFromGatsby) {
|
|
110
|
+
var _id;
|
|
111
|
+
// Search for "graphql" in a const { graphql, Link } = require('gatsby')
|
|
112
|
+
const graphqlTagSpecifier = (_id = requiredFromGatsby.id) === null || _id === void 0 ? void 0 : _id.properties.find(el => el.key.name === DEFAULT_GRAPHQL_TAG_NAME);
|
|
113
|
+
if (graphqlTagSpecifier) {
|
|
114
|
+
graphqlTagName = graphqlTagSpecifier.value.name;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return undefined;
|
|
118
|
+
},
|
|
119
|
+
// import { graphql } from "gatsby"
|
|
120
|
+
ImportDeclaration: node => {
|
|
121
|
+
// Make sure that the specifier is imported from "gatsby"
|
|
122
|
+
if (node.source.value === `gatsby`) {
|
|
123
|
+
const graphqlTagSpecifier = node.specifiers.find(el => {
|
|
124
|
+
// We only want import { graphql } from "gatsby"
|
|
125
|
+
// Not import graphql from "gatsby"
|
|
126
|
+
if (el.type === `ImportSpecifier`) {
|
|
127
|
+
// Only get the specifier with the original name of "graphql"
|
|
128
|
+
return el.imported.name === DEFAULT_GRAPHQL_TAG_NAME;
|
|
129
|
+
}
|
|
130
|
+
// import * as Gatsby from "gatsby"
|
|
131
|
+
if (el.type === `ImportNamespaceSpecifier`) {
|
|
132
|
+
namespaceSpecifierName = el.local.name;
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
});
|
|
137
|
+
if (graphqlTagSpecifier) {
|
|
138
|
+
// The local.name handles the case for import { graphql as otherName }
|
|
139
|
+
// For normal import { graphql } the imported & local name are the same
|
|
140
|
+
graphqlTagName = graphqlTagSpecifier.local.name;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return undefined;
|
|
144
|
+
},
|
|
145
|
+
TaggedTemplateExpression: node => {
|
|
146
|
+
var _tag;
|
|
147
|
+
if (node.type === `TaggedTemplateExpression` && ((_tag = node.tag) === null || _tag === void 0 ? void 0 : _tag.name) === graphqlTagName) {
|
|
148
|
+
var _node$parent, _node$parent$id;
|
|
149
|
+
if (queryVariableName) {
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
152
|
+
// @ts-ignore
|
|
153
|
+
queryVariableName = (_node$parent = node.parent) === null || _node$parent === void 0 ? void 0 : (_node$parent$id = _node$parent.id) === null || _node$parent$id === void 0 ? void 0 : _node$parent$id.name;
|
|
154
|
+
}
|
|
155
|
+
return undefined;
|
|
156
|
+
},
|
|
157
|
+
ExportNamedDeclaration: node => {
|
|
158
|
+
if (hasOneValidNamedDeclaration(node, queryVariableName)) {
|
|
159
|
+
return undefined;
|
|
160
|
+
}
|
|
161
|
+
if (isTemplateQuery(node, graphqlTagName, namespaceSpecifierName)) {
|
|
162
|
+
return undefined;
|
|
163
|
+
}
|
|
164
|
+
if (isApiExport(node, `getServerData`)) {
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
if (isApiExport(node, `config`)) {
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
if (isApiExport(node, `Head`)) {
|
|
171
|
+
return undefined;
|
|
172
|
+
}
|
|
173
|
+
context.report({
|
|
174
|
+
node,
|
|
175
|
+
messageId: `limitedExportsPageTemplates`
|
|
176
|
+
});
|
|
177
|
+
return undefined;
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
module.exports = limitedExports;
|
|
183
|
+
//# sourceMappingURL=limited-exports-page-templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limited-exports-page-templates.js","names":["DEFAULT_GRAPHQL_TAG_NAME","isApiExport","node","name","declaration","type","id","declarations","source","specifiers","some","specifier","exported","hasOneValidNamedDeclaration","varName","nonQueryExports","e","isTemplateQuery","graphqlTagName","namespaceSpecifierName","every","el","init","tag","object","property","limitedExports","meta","messages","limitedExportsPageTemplates","create","context","isPageTemplate","store","queryVariableName","VariableDeclaration","requiredFromGatsby","find","arguments","quasis","value","raw","graphqlTagSpecifier","properties","key","undefined","ImportDeclaration","imported","local","TaggedTemplateExpression","parent","ExportNamedDeclaration","report","messageId","module","exports"],"sources":["../../../src/utils/eslint-rules/limited-exports-page-templates.ts"],"sourcesContent":["import { Rule } from \"eslint\"\nimport {\n Node,\n Identifier,\n ImportDeclaration,\n TaggedTemplateExpression,\n VariableDeclaration,\n CallExpression,\n Literal,\n TemplateLiteral,\n VariableDeclarator,\n ObjectPattern,\n AssignmentProperty,\n ExportNamedDeclaration,\n} from \"estree\"\nimport { store } from \"../../redux\"\nimport { isPageTemplate } from \"../eslint-rules-helpers\"\n\nconst DEFAULT_GRAPHQL_TAG_NAME = `graphql`\n\nfunction isApiExport(node: ExportNamedDeclaration, name: string): boolean {\n // check for\n // export function name() {}\n // export async function name() {}\n if (\n node.declaration?.type === `FunctionDeclaration` &&\n node.declaration.id?.name === name\n ) {\n return true\n }\n\n // check for\n // export const name = () => {}\n if (node.declaration?.type === `VariableDeclaration`) {\n for (const declaration of node.declaration.declarations) {\n if (\n declaration.type === `VariableDeclarator` &&\n declaration.id.type === `Identifier` &&\n declaration.id.name === name\n ) {\n return true\n }\n }\n }\n\n if (name === `Head`) {\n // Head can be re-exported, Head can be class components - so the checks above are not sufficient,\n // we need to be more permisive here\n\n // class component\n if (\n node.declaration?.type === `ClassDeclaration` &&\n node.declaration?.id?.type === `Identifier` &&\n node.declaration?.id?.name === name\n ) {\n return true\n }\n\n // re-exports\n if (\n node.source &&\n node.specifiers.some(specifier => specifier.exported.name === name)\n ) {\n return true\n }\n }\n\n return false\n}\n\nfunction hasOneValidNamedDeclaration(\n node: Node,\n varName: string | undefined\n): boolean {\n // Checks for:\n // const query = graphql``\n // export { query }\n if (node.type === `ExportNamedDeclaration` && node.declaration === null) {\n // For export { foobar, query } the declaration will be null and specifiers exists\n // For { foobar, query } it'll return true, for { query } it'll return false\n // It will ignore any { default } declarations since these are allowed\n const nonQueryExports = node.specifiers.some(e =>\n varName\n ? e.exported.name !== varName && e.exported.name !== `default`\n : e.exported.name !== `default`\n )\n return !nonQueryExports\n }\n\n return false\n}\n\nfunction isTemplateQuery(\n node: Node,\n graphqlTagName: string,\n namespaceSpecifierName: string\n): boolean {\n // For export const query = 'foobar' the declaration exists with type 'VariableDeclaration'\n\n // Checks for:\n // export const query = graphql``\n // This case only has one item in the declarations array\n // For export const hello = 10, world = 'foo'\n // The array will have two items. So use every() to check if only one item exists\n // With TaggedTemplateExpression and \"graphql\" name\n\n // In addition the declaration can also be a MemberExpression like\n // Gatsby.graphql`` when the import happened with import * as Gatsby from \"gatsby\"\n\n return (\n node.type === `ExportNamedDeclaration` &&\n node.declaration?.type === `VariableDeclaration` &&\n node.declaration?.declarations.every(el => {\n if (\n el?.init?.type === `TaggedTemplateExpression` &&\n el.init.tag.type === `Identifier`\n ) {\n return el.init.tag.name === graphqlTagName\n } else if (\n el?.init?.type === `TaggedTemplateExpression` &&\n el.init.tag.type === `MemberExpression`\n ) {\n return (\n (el.init.tag.object as Identifier).name === namespaceSpecifierName &&\n (el.init.tag.property as Identifier).name === DEFAULT_GRAPHQL_TAG_NAME\n )\n }\n return false\n })\n )\n}\n\nconst limitedExports: Rule.RuleModule = {\n meta: {\n type: `problem`,\n messages: {\n limitedExportsPageTemplates: `In page templates only a default export of a valid React component and the named exports of a page query, getServerData, Head or config are allowed.\n All other named exports will cause Fast Refresh to not preserve local component state and do a full refresh.\n\n Please move your other named exports to another file. Also make sure that you only export page queries that use the \"graphql\" tag from \"gatsby\".\n`,\n },\n },\n create: context => {\n if (!isPageTemplate(store, context)) {\n return {}\n }\n\n let queryVariableName: string | undefined = ``\n let graphqlTagName = ``\n let namespaceSpecifierName = ``\n\n return {\n // const { graphql } = require('gatsby')\n VariableDeclaration: (node): void => {\n // Check if require('gatsby')\n const requiredFromGatsby = (\n node as VariableDeclaration\n ).declarations.find(el => {\n // Handle require(`gatsby`)\n if (\n (el.init as CallExpression)?.arguments?.[0]?.type ===\n `TemplateLiteral`\n ) {\n return (\n ((el.init as CallExpression).arguments[0] as TemplateLiteral)\n ?.quasis[0].value.raw === `gatsby`\n )\n }\n\n return (\n ((el.init as CallExpression)?.arguments?.[0] as Literal)?.value ===\n `gatsby`\n )\n })\n\n if (requiredFromGatsby) {\n // Search for \"graphql\" in a const { graphql, Link } = require('gatsby')\n const graphqlTagSpecifier = (\n (requiredFromGatsby as VariableDeclarator).id as ObjectPattern\n )?.properties.find(\n el =>\n ((el as AssignmentProperty).key as Identifier).name ===\n DEFAULT_GRAPHQL_TAG_NAME\n )\n\n if (graphqlTagSpecifier) {\n graphqlTagName = (\n (graphqlTagSpecifier as AssignmentProperty).value as Identifier\n ).name\n }\n }\n\n return undefined\n },\n // import { graphql } from \"gatsby\"\n ImportDeclaration: (node): void => {\n // Make sure that the specifier is imported from \"gatsby\"\n if ((node as ImportDeclaration).source.value === `gatsby`) {\n const graphqlTagSpecifier = (\n node as ImportDeclaration\n ).specifiers.find(el => {\n // We only want import { graphql } from \"gatsby\"\n // Not import graphql from \"gatsby\"\n if (el.type === `ImportSpecifier`) {\n // Only get the specifier with the original name of \"graphql\"\n return el.imported.name === DEFAULT_GRAPHQL_TAG_NAME\n }\n // import * as Gatsby from \"gatsby\"\n if (el.type === `ImportNamespaceSpecifier`) {\n namespaceSpecifierName = el.local.name\n return false\n }\n return false\n })\n if (graphqlTagSpecifier) {\n // The local.name handles the case for import { graphql as otherName }\n // For normal import { graphql } the imported & local name are the same\n graphqlTagName = graphqlTagSpecifier.local.name\n }\n }\n return undefined\n },\n TaggedTemplateExpression: (node): void => {\n if (\n (node as TaggedTemplateExpression).type ===\n `TaggedTemplateExpression` &&\n ((node as TaggedTemplateExpression).tag as Identifier)?.name ===\n graphqlTagName\n ) {\n if (queryVariableName) {\n return undefined\n }\n // @ts-ignore\n queryVariableName = node.parent?.id?.name\n }\n\n return undefined\n },\n ExportNamedDeclaration: (node): void => {\n if (hasOneValidNamedDeclaration(node, queryVariableName)) {\n return undefined\n }\n\n if (isTemplateQuery(node, graphqlTagName, namespaceSpecifierName)) {\n return undefined\n }\n\n if (isApiExport(node, `getServerData`)) {\n return undefined\n }\n\n if (isApiExport(node, `config`)) {\n return undefined\n }\n\n if (isApiExport(node, `Head`)) {\n return undefined\n }\n\n context.report({\n node,\n messageId: `limitedExportsPageTemplates`,\n })\n\n return undefined\n },\n }\n },\n}\n\nmodule.exports = limitedExports\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _redux = require("../../redux");
|
|
4
|
+
var _eslintRulesHelpers = require("../eslint-rules-helpers");
|
|
5
|
+
const defs = {
|
|
6
|
+
ArrowFunctionExpression: {
|
|
7
|
+
messageId: `anonymousArrowFunction`
|
|
8
|
+
},
|
|
9
|
+
FunctionDeclaration: {
|
|
10
|
+
messageId: `anonymousFunctionDeclaration`,
|
|
11
|
+
forbid: node => !node.declaration.id
|
|
12
|
+
},
|
|
13
|
+
ClassDeclaration: {
|
|
14
|
+
messageId: `anonymousClass`,
|
|
15
|
+
forbid: node => !node.declaration.id
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const noAnonymousExports = {
|
|
19
|
+
meta: {
|
|
20
|
+
type: `problem`,
|
|
21
|
+
messages: {
|
|
22
|
+
anonymousArrowFunction: `Anonymous arrow functions cause Fast Refresh to not preserve local component state.
|
|
23
|
+
|
|
24
|
+
Please add a name to your function, for example:
|
|
25
|
+
|
|
26
|
+
Before:
|
|
27
|
+
export default () => {}
|
|
28
|
+
|
|
29
|
+
After:
|
|
30
|
+
const Named = () => {}
|
|
31
|
+
export default Named;
|
|
32
|
+
`,
|
|
33
|
+
anonymousFunctionDeclaration: `Anonymous function declarations cause Fast Refresh to not preserve local component state.
|
|
34
|
+
|
|
35
|
+
Please add a name to your function, for example:
|
|
36
|
+
|
|
37
|
+
Before:
|
|
38
|
+
export default function () {}
|
|
39
|
+
|
|
40
|
+
After:
|
|
41
|
+
export default function Named() {}
|
|
42
|
+
`,
|
|
43
|
+
anonymousClass: `Anonymous classes cause Fast Refresh to not preserve local component state.
|
|
44
|
+
|
|
45
|
+
Please add a name to your class, for example:
|
|
46
|
+
|
|
47
|
+
Before:
|
|
48
|
+
export default class extends Component {}
|
|
49
|
+
|
|
50
|
+
After:
|
|
51
|
+
export default class Named extends Component {}
|
|
52
|
+
`
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
create: context => {
|
|
56
|
+
if (!(0, _eslintRulesHelpers.isPageTemplate)(_redux.store, context)) {
|
|
57
|
+
return {};
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
ExportDefaultDeclaration: node => {
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
const type = node.declaration.type;
|
|
63
|
+
const def = defs[type];
|
|
64
|
+
if (def && (!def.forbid || def.forbid(node))) {
|
|
65
|
+
context.report({
|
|
66
|
+
node,
|
|
67
|
+
messageId: def.messageId
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
module.exports = noAnonymousExports;
|
|
75
|
+
//# sourceMappingURL=no-anonymous-exports-page-templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-anonymous-exports-page-templates.js","names":["defs","ArrowFunctionExpression","messageId","FunctionDeclaration","forbid","node","declaration","id","ClassDeclaration","noAnonymousExports","meta","type","messages","anonymousArrowFunction","anonymousFunctionDeclaration","anonymousClass","create","context","isPageTemplate","store","ExportDefaultDeclaration","def","report","module","exports"],"sources":["../../../src/utils/eslint-rules/no-anonymous-exports-page-templates.ts"],"sourcesContent":["import { Rule } from \"eslint\"\nimport { Node, ExportDefaultDeclaration } from \"estree\"\nimport { store } from \"../../redux\"\nimport { isPageTemplate } from \"../eslint-rules-helpers\"\n\nconst defs = {\n ArrowFunctionExpression: {\n messageId: `anonymousArrowFunction`,\n },\n FunctionDeclaration: {\n messageId: `anonymousFunctionDeclaration`,\n forbid: (node): boolean => !node.declaration.id,\n },\n ClassDeclaration: {\n messageId: `anonymousClass`,\n forbid: (node): boolean => !node.declaration.id,\n },\n}\n\nconst noAnonymousExports: Rule.RuleModule = {\n meta: {\n type: `problem`,\n messages: {\n anonymousArrowFunction: `Anonymous arrow functions cause Fast Refresh to not preserve local component state.\n\n Please add a name to your function, for example:\n\n Before:\n export default () => {}\n\n After:\n const Named = () => {}\n export default Named;\n`,\n anonymousFunctionDeclaration: `Anonymous function declarations cause Fast Refresh to not preserve local component state.\n\n Please add a name to your function, for example:\n\n Before:\n export default function () {}\n\n After:\n export default function Named() {}\n`,\n anonymousClass: `Anonymous classes cause Fast Refresh to not preserve local component state.\n\n Please add a name to your class, for example:\n\n Before:\n export default class extends Component {}\n\n After:\n export default class Named extends Component {}\n`,\n },\n },\n create: context => {\n if (!isPageTemplate(store, context)) {\n return {}\n }\n\n return {\n ExportDefaultDeclaration: (node: Node): void => {\n // @ts-ignore\n const type = node.declaration.type as ExportDefaultDeclaration[\"type\"]\n const def = defs[type]\n\n if (def && (!def.forbid || def.forbid(node))) {\n context.report({\n node,\n messageId: def.messageId,\n })\n }\n },\n }\n },\n}\n\nmodule.exports = noAnonymousExports\n"],"mappings":";;AAEA;AACA;AAEA,MAAMA,IAAI,GAAG;EACXC,uBAAuB,EAAE;IACvBC,SAAS,EAAG;EACd,CAAC;EACDC,mBAAmB,EAAE;IACnBD,SAAS,EAAG,8BAA6B;IACzCE,MAAM,EAAGC,IAAI,IAAc,CAACA,IAAI,CAACC,WAAW,CAACC;EAC/C,CAAC;EACDC,gBAAgB,EAAE;IAChBN,SAAS,EAAG,gBAAe;IAC3BE,MAAM,EAAGC,IAAI,IAAc,CAACA,IAAI,CAACC,WAAW,CAACC;EAC/C;AACF,CAAC;AAED,MAAME,kBAAmC,GAAG;EAC1CC,IAAI,EAAE;IACJC,IAAI,EAAG,SAAQ;IACfC,QAAQ,EAAE;MACRC,sBAAsB,EAAG;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;MACKC,4BAA4B,EAAG;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;MACKC,cAAc,EAAG;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACI;EACF,CAAC;EACDC,MAAM,EAAEC,OAAO,IAAI;IACjB,IAAI,CAAC,IAAAC,kCAAc,EAACC,YAAK,EAAEF,OAAO,CAAC,EAAE;MACnC,OAAO,CAAC,CAAC;IACX;IAEA,OAAO;MACLG,wBAAwB,EAAGf,IAAU,IAAW;QAC9C;QACA,MAAMM,IAAI,GAAGN,IAAI,CAACC,WAAW,CAACK,IAAwC;QACtE,MAAMU,GAAG,GAAGrB,IAAI,CAACW,IAAI,CAAC;QAEtB,IAAIU,GAAG,KAAK,CAACA,GAAG,CAACjB,MAAM,IAAIiB,GAAG,CAACjB,MAAM,CAACC,IAAI,CAAC,CAAC,EAAE;UAC5CY,OAAO,CAACK,MAAM,CAAC;YACbjB,IAAI;YACJH,SAAS,EAAEmB,GAAG,CAACnB;UACjB,CAAC,CAAC;QACJ;MACF;IACF,CAAC;EACH;AACF,CAAC;AAEDqB,MAAM,CAACC,OAAO,GAAGf,kBAAkB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.isPageTemplate = isPageTemplate;
|
|
5
|
+
exports.test = test;
|
|
6
|
+
var _gatsbyCoreUtils = require("gatsby-core-utils");
|
|
7
|
+
function isPageTemplate(s, c) {
|
|
8
|
+
const filename = c.getFilename();
|
|
9
|
+
if (!filename) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return s.getState().components.has((0, _gatsbyCoreUtils.slash)(filename));
|
|
13
|
+
}
|
|
14
|
+
function test(t) {
|
|
15
|
+
return Object.assign(t, {
|
|
16
|
+
parserOptions: {
|
|
17
|
+
sourceType: `module`,
|
|
18
|
+
ecmaVersion: 9
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=eslint-rules-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-rules-helpers.js","names":["isPageTemplate","s","c","filename","getFilename","getState","components","has","slash","test","t","Object","assign","parserOptions","sourceType","ecmaVersion"],"sources":["../../src/utils/eslint-rules-helpers.ts"],"sourcesContent":["import { Rule } from \"eslint\"\nimport { slash } from \"gatsby-core-utils\"\nimport { GatsbyReduxStore } from \"../redux\"\n\nexport function isPageTemplate(\n s: GatsbyReduxStore,\n c: Rule.RuleContext\n): boolean {\n const filename = c.getFilename()\n if (!filename) {\n return false\n }\n\n return s.getState().components.has(slash(filename))\n}\n\nexport function test(t): any {\n return Object.assign(t, {\n parserOptions: {\n sourceType: `module`,\n ecmaVersion: 9,\n },\n })\n}\n"],"mappings":";;;;;AACA;AAGO,SAASA,cAAc,CAC5BC,CAAmB,EACnBC,CAAmB,EACV;EACT,MAAMC,QAAQ,GAAGD,CAAC,CAACE,WAAW,EAAE;EAChC,IAAI,CAACD,QAAQ,EAAE;IACb,OAAO,KAAK;EACd;EAEA,OAAOF,CAAC,CAACI,QAAQ,EAAE,CAACC,UAAU,CAACC,GAAG,CAAC,IAAAC,sBAAK,EAACL,QAAQ,CAAC,CAAC;AACrD;AAEO,SAASM,IAAI,CAACC,CAAC,EAAO;EAC3B,OAAOC,MAAM,CAACC,MAAM,CAACF,CAAC,EAAE;IACtBG,aAAa,EAAE;MACbC,UAAU,EAAG,QAAO;MACpBC,WAAW,EAAE;IACf;EACF,CAAC,CAAC;AACJ"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TrailingSlash } from "gatsby-page-utils";
|
|
2
|
+
import express from "express";
|
|
3
|
+
import type { IGatsbyState } from "../redux/types";
|
|
4
|
+
export declare const configureTrailingSlash: (getState: () => IGatsbyState, option: TrailingSlash | undefined) => (req: express.Request, res: express.Response, next: express.NextFunction) => void;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.configureTrailingSlash = void 0;
|
|
5
|
+
var _findPageByPath = require("./find-page-by-path");
|
|
6
|
+
const configureTrailingSlash = (getState, option) => (req, res, next) => {
|
|
7
|
+
var _req$path$split, _req$path$split$pop;
|
|
8
|
+
const method = req.method.toLocaleLowerCase();
|
|
9
|
+
if (![`get`, `head`].includes(method)) {
|
|
10
|
+
next();
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (req !== null && req !== void 0 && (_req$path$split = req.path.split(`/`)) !== null && _req$path$split !== void 0 && (_req$path$split$pop = _req$path$split.pop()) !== null && _req$path$split$pop !== void 0 && _req$path$split$pop.includes(`.`)) {
|
|
14
|
+
// Path has an extension. Do not add slash.
|
|
15
|
+
next();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (req.path.length <= 1) {
|
|
19
|
+
next();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// check if it's Gatsby Page
|
|
24
|
+
const page = (0, _findPageByPath.findPageByPath)(getState(), req.path);
|
|
25
|
+
if (page) {
|
|
26
|
+
if (option === `never`) {
|
|
27
|
+
if (req.path.slice(-1) === `/` && page.path !== req.path) {
|
|
28
|
+
// Remove trailing slash
|
|
29
|
+
const query = req.url.slice(req.path.length);
|
|
30
|
+
res.redirect(301, req.path.slice(0, -1) + query);
|
|
31
|
+
return;
|
|
32
|
+
} else {
|
|
33
|
+
// express.static really doesn't like paths without trailing slashes
|
|
34
|
+
// so we "rewrite" request to look like request with trailing slash
|
|
35
|
+
// otherwise we'll have an infinite redirect loop. We did this because
|
|
36
|
+
// express.static automatically adds the redirect trailing slash then
|
|
37
|
+
const BASE = `http://localhost`;
|
|
38
|
+
const urlToMessWith = new URL(req.url, BASE);
|
|
39
|
+
urlToMessWith.pathname += `/`;
|
|
40
|
+
|
|
41
|
+
// The incoming req.url is relative, so we remove the base again
|
|
42
|
+
// we use new URL so that queries/hashes are handled automatically
|
|
43
|
+
req.url = urlToMessWith.toString().replace(BASE, ``);
|
|
44
|
+
}
|
|
45
|
+
} else if (option === `always`) {
|
|
46
|
+
if (req.path.slice(-1) !== `/` && page.path !== req.path) {
|
|
47
|
+
// Add trailing slash
|
|
48
|
+
const query = req.url.slice(req.path.length);
|
|
49
|
+
res.redirect(301, `${req.path}/${query}`);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
next();
|
|
55
|
+
};
|
|
56
|
+
exports.configureTrailingSlash = configureTrailingSlash;
|
|
57
|
+
//# sourceMappingURL=express-middlewares.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"express-middlewares.js","names":["configureTrailingSlash","getState","option","req","res","next","method","toLocaleLowerCase","includes","path","split","pop","length","page","findPageByPath","slice","query","url","redirect","BASE","urlToMessWith","URL","pathname","toString","replace"],"sources":["../../src/utils/express-middlewares.ts"],"sourcesContent":["import type { TrailingSlash } from \"gatsby-page-utils\"\nimport express from \"express\"\nimport type { IGatsbyState } from \"../redux/types\"\nimport { findPageByPath } from \"./find-page-by-path\"\n\nexport const configureTrailingSlash =\n (getState: () => IGatsbyState, option: TrailingSlash | undefined) =>\n (\n req: express.Request,\n res: express.Response,\n next: express.NextFunction\n ): void => {\n const method = req.method.toLocaleLowerCase()\n if (![`get`, `head`].includes(method)) {\n next()\n return\n }\n\n if (req?.path.split(`/`)?.pop()?.includes(`.`)) {\n // Path has an extension. Do not add slash.\n next()\n return\n }\n\n if (req.path.length <= 1) {\n next()\n return\n }\n\n // check if it's Gatsby Page\n const page = findPageByPath(getState(), req.path)\n\n if (page) {\n if (option === `never`) {\n if (req.path.slice(-1) === `/` && page.path !== req.path) {\n // Remove trailing slash\n const query = req.url.slice(req.path.length)\n res.redirect(301, req.path.slice(0, -1) + query)\n return\n } else {\n // express.static really doesn't like paths without trailing slashes\n // so we \"rewrite\" request to look like request with trailing slash\n // otherwise we'll have an infinite redirect loop. We did this because\n // express.static automatically adds the redirect trailing slash then\n const BASE = `http://localhost`\n const urlToMessWith = new URL(req.url, BASE)\n urlToMessWith.pathname += `/`\n\n // The incoming req.url is relative, so we remove the base again\n // we use new URL so that queries/hashes are handled automatically\n req.url = urlToMessWith.toString().replace(BASE, ``)\n }\n } else if (option === `always`) {\n if (req.path.slice(-1) !== `/` && page.path !== req.path) {\n // Add trailing slash\n const query = req.url.slice(req.path.length)\n res.redirect(301, `${req.path}/${query}`)\n return\n }\n }\n }\n\n next()\n }\n"],"mappings":";;;;AAGA;AAEO,MAAMA,sBAAsB,GACjC,CAACC,QAA4B,EAAEC,MAAiC,KAChE,CACEC,GAAoB,EACpBC,GAAqB,EACrBC,IAA0B,KACjB;EAAA;EACT,MAAMC,MAAM,GAAGH,GAAG,CAACG,MAAM,CAACC,iBAAiB,EAAE;EAC7C,IAAI,CAAC,CAAE,KAAI,EAAG,MAAK,CAAC,CAACC,QAAQ,CAACF,MAAM,CAAC,EAAE;IACrCD,IAAI,EAAE;IACN;EACF;EAEA,IAAIF,GAAG,aAAHA,GAAG,kCAAHA,GAAG,CAAEM,IAAI,CAACC,KAAK,CAAE,GAAE,CAAC,mEAApB,gBAAsBC,GAAG,EAAE,gDAA3B,oBAA6BH,QAAQ,CAAE,GAAE,CAAC,EAAE;IAC9C;IACAH,IAAI,EAAE;IACN;EACF;EAEA,IAAIF,GAAG,CAACM,IAAI,CAACG,MAAM,IAAI,CAAC,EAAE;IACxBP,IAAI,EAAE;IACN;EACF;;EAEA;EACA,MAAMQ,IAAI,GAAG,IAAAC,8BAAc,EAACb,QAAQ,EAAE,EAAEE,GAAG,CAACM,IAAI,CAAC;EAEjD,IAAII,IAAI,EAAE;IACR,IAAIX,MAAM,KAAM,OAAM,EAAE;MACtB,IAAIC,GAAG,CAACM,IAAI,CAACM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAM,GAAE,IAAIF,IAAI,CAACJ,IAAI,KAAKN,GAAG,CAACM,IAAI,EAAE;QACxD;QACA,MAAMO,KAAK,GAAGb,GAAG,CAACc,GAAG,CAACF,KAAK,CAACZ,GAAG,CAACM,IAAI,CAACG,MAAM,CAAC;QAC5CR,GAAG,CAACc,QAAQ,CAAC,GAAG,EAAEf,GAAG,CAACM,IAAI,CAACM,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAGC,KAAK,CAAC;QAChD;MACF,CAAC,MAAM;QACL;QACA;QACA;QACA;QACA,MAAMG,IAAI,GAAI,kBAAiB;QAC/B,MAAMC,aAAa,GAAG,IAAIC,GAAG,CAAClB,GAAG,CAACc,GAAG,EAAEE,IAAI,CAAC;QAC5CC,aAAa,CAACE,QAAQ,IAAK,GAAE;;QAE7B;QACA;QACAnB,GAAG,CAACc,GAAG,GAAGG,aAAa,CAACG,QAAQ,EAAE,CAACC,OAAO,CAACL,IAAI,EAAG,EAAC,CAAC;MACtD;IACF,CAAC,MAAM,IAAIjB,MAAM,KAAM,QAAO,EAAE;MAC9B,IAAIC,GAAG,CAACM,IAAI,CAACM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAM,GAAE,IAAIF,IAAI,CAACJ,IAAI,KAAKN,GAAG,CAACM,IAAI,EAAE;QACxD;QACA,MAAMO,KAAK,GAAGb,GAAG,CAACc,GAAG,CAACF,KAAK,CAACZ,GAAG,CAACM,IAAI,CAACG,MAAM,CAAC;QAC5CR,GAAG,CAACc,QAAQ,CAAC,GAAG,EAAG,GAAEf,GAAG,CAACM,IAAK,IAAGO,KAAM,EAAC,CAAC;QACzC;MACF;IACF;EACF;EAEAX,IAAI,EAAE;AACR,CAAC;AAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.extractUndefinedGlobal = extractUndefinedGlobal;
|
|
5
|
+
/**
|
|
6
|
+
* Extract undefined global variables used in server context from a reference error.
|
|
7
|
+
*/
|
|
8
|
+
function extractUndefinedGlobal(error) {
|
|
9
|
+
const match = error.message.match(/(window|document|localStorage|navigator|alert|location) is not defined/i);
|
|
10
|
+
if (match && match[1]) {
|
|
11
|
+
return match[1];
|
|
12
|
+
}
|
|
13
|
+
return ``;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=extract-undefined-global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-undefined-global.js","names":["extractUndefinedGlobal","error","match","message"],"sources":["../../src/utils/extract-undefined-global.ts"],"sourcesContent":["/**\n * Extract undefined global variables used in server context from a reference error.\n */\nexport function extractUndefinedGlobal(error: ReferenceError): string {\n const match = error.message.match(\n /(window|document|localStorage|navigator|alert|location) is not defined/i\n )\n\n if (match && match[1]) {\n return match[1]\n }\n\n return ``\n}\n"],"mappings":";;;;AAAA;AACA;AACA;AACO,SAASA,sBAAsB,CAACC,KAAqB,EAAU;EACpE,MAAMC,KAAK,GAAGD,KAAK,CAACE,OAAO,CAACD,KAAK,CAC/B,yEAAyE,CAC1E;EAED,IAAIA,KAAK,IAAIA,KAAK,CAAC,CAAC,CAAC,EAAE;IACrB,OAAOA,KAAK,CAAC,CAAC,CAAC;EACjB;EAEA,OAAQ,EAAC;AACX"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type Channel = "FAST_REFRESH";
|
|
2
|
+
type Event = [
|
|
3
|
+
Channel,
|
|
4
|
+
{
|
|
5
|
+
action: string;
|
|
6
|
+
payload?: any;
|
|
7
|
+
}
|
|
8
|
+
];
|
|
9
|
+
declare global {
|
|
10
|
+
interface Window {
|
|
11
|
+
_gatsbyEvents: Array<Event> | {
|
|
12
|
+
push: (event: Event) => void;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export declare function clearCompileError(): void;
|
|
17
|
+
export declare function clearRuntimeErrors(dismissOverlay: boolean): void;
|
|
18
|
+
export declare function showCompileError(message: any): void;
|
|
19
|
+
export declare function showRuntimeErrors(errors: any): void;
|
|
20
|
+
export declare function isWebpackCompileError(error: any): boolean;
|
|
21
|
+
export declare function handleRuntimeError(error: any): void;
|
|
22
|
+
export {};
|