@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,261 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.getDefaultDbPath = getDefaultDbPath;
|
|
5
|
+
exports.setupLmdbStore = setupLmdbStore;
|
|
6
|
+
var _lmdb = require("lmdb");
|
|
7
|
+
var _nodes = require("./updates/nodes");
|
|
8
|
+
var _nodesByType = require("./updates/nodes-by-type");
|
|
9
|
+
var _redux = require("../../redux");
|
|
10
|
+
var _iterable = require("../common/iterable");
|
|
11
|
+
var _runQuery = require("./query/run-query");
|
|
12
|
+
var _runFastFilters = require("../in-memory/run-fast-filters");
|
|
13
|
+
const lmdbDatastore = {
|
|
14
|
+
getNode,
|
|
15
|
+
getTypes,
|
|
16
|
+
countNodes,
|
|
17
|
+
iterateNodes,
|
|
18
|
+
iterateNodesByType,
|
|
19
|
+
updateDataStore,
|
|
20
|
+
ready,
|
|
21
|
+
runQuery,
|
|
22
|
+
// deprecated:
|
|
23
|
+
getNodes,
|
|
24
|
+
getNodesByType
|
|
25
|
+
};
|
|
26
|
+
const preSyncDeletedNodeIdsCache = new Set();
|
|
27
|
+
function getDefaultDbPath() {
|
|
28
|
+
var _process$env$FORCE_TE;
|
|
29
|
+
const dbFileName = process.env.NODE_ENV === `test` ? `test-datastore-${
|
|
30
|
+
// FORCE_TEST_DATABASE_ID will be set if this gets executed in worker context
|
|
31
|
+
// when running jest tests. JEST_WORKER_ID will be set when this gets executed directly
|
|
32
|
+
// in test context (jest will use jest-worker internally).
|
|
33
|
+
(_process$env$FORCE_TE = process.env.FORCE_TEST_DATABASE_ID) !== null && _process$env$FORCE_TE !== void 0 ? _process$env$FORCE_TE : process.env.JEST_WORKER_ID}` : `datastore`;
|
|
34
|
+
return process.cwd() + `/.cache/data/` + dbFileName;
|
|
35
|
+
}
|
|
36
|
+
let fullDbPath;
|
|
37
|
+
let rootDb;
|
|
38
|
+
let databases;
|
|
39
|
+
|
|
40
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
41
|
+
|
|
42
|
+
function getRootDb() {
|
|
43
|
+
if (!rootDb) {
|
|
44
|
+
if (!fullDbPath) {
|
|
45
|
+
throw new Error(`LMDB path is not set!`);
|
|
46
|
+
}
|
|
47
|
+
if (!globalThis.__GATSBY_OPEN_ROOT_LMDBS) {
|
|
48
|
+
globalThis.__GATSBY_OPEN_ROOT_LMDBS = new Map();
|
|
49
|
+
}
|
|
50
|
+
rootDb = globalThis.__GATSBY_OPEN_ROOT_LMDBS.get(fullDbPath);
|
|
51
|
+
if (rootDb) {
|
|
52
|
+
return rootDb;
|
|
53
|
+
}
|
|
54
|
+
rootDb = (0, _lmdb.open)({
|
|
55
|
+
name: `root`,
|
|
56
|
+
path: fullDbPath,
|
|
57
|
+
compression: true
|
|
58
|
+
});
|
|
59
|
+
globalThis.__GATSBY_OPEN_ROOT_LMDBS.set(fullDbPath, rootDb);
|
|
60
|
+
}
|
|
61
|
+
return rootDb;
|
|
62
|
+
}
|
|
63
|
+
function getDatabases() {
|
|
64
|
+
if (!databases) {
|
|
65
|
+
// __GATSBY_OPEN_LMDBS tracks if we already opened given db in this process
|
|
66
|
+
// In `gatsby serve` case we might try to open it twice - once for engines
|
|
67
|
+
// and second to get access to `SitePage` nodes (to power trailing slashes
|
|
68
|
+
// redirect middleware). This ensure there is single instance within a process.
|
|
69
|
+
// Using more instances seems to cause weird random errors.
|
|
70
|
+
if (!globalThis.__GATSBY_OPEN_LMDBS) {
|
|
71
|
+
globalThis.__GATSBY_OPEN_LMDBS = new Map();
|
|
72
|
+
}
|
|
73
|
+
databases = globalThis.__GATSBY_OPEN_LMDBS.get(fullDbPath);
|
|
74
|
+
if (databases) {
|
|
75
|
+
return databases;
|
|
76
|
+
}
|
|
77
|
+
const rootDb = getRootDb();
|
|
78
|
+
databases = {
|
|
79
|
+
nodes: rootDb.openDB({
|
|
80
|
+
name: `nodes`,
|
|
81
|
+
// FIXME: sharedStructuresKey breaks tests - probably need some cleanup for it on DELETE_CACHE
|
|
82
|
+
// sharedStructuresKey: Symbol.for(`structures`),
|
|
83
|
+
// @ts-ignore
|
|
84
|
+
cache: {
|
|
85
|
+
// expirer: false disables LRU part and only take care of WeakRefs
|
|
86
|
+
// this way we don't retain nodes strongly, but will continue to
|
|
87
|
+
// reuse them if they are loaded already
|
|
88
|
+
expirer: false
|
|
89
|
+
}
|
|
90
|
+
}),
|
|
91
|
+
nodesByType: rootDb.openDB({
|
|
92
|
+
name: `nodesByType`,
|
|
93
|
+
dupSort: true
|
|
94
|
+
}),
|
|
95
|
+
metadata: rootDb.openDB({
|
|
96
|
+
name: `metadata`,
|
|
97
|
+
useVersions: true
|
|
98
|
+
}),
|
|
99
|
+
indexes: rootDb.openDB({
|
|
100
|
+
name: `indexes`
|
|
101
|
+
// TODO: use dupSort when this is ready: https://github.com/DoctorEvidence/lmdb-store/issues/66
|
|
102
|
+
// dupSort: true
|
|
103
|
+
})
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
globalThis.__GATSBY_OPEN_LMDBS.set(fullDbPath, databases);
|
|
107
|
+
}
|
|
108
|
+
return databases;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @deprecated
|
|
113
|
+
*/
|
|
114
|
+
function getNodes() {
|
|
115
|
+
// const start = performance.now()
|
|
116
|
+
const result = Array.from(iterateNodes());
|
|
117
|
+
// const timeTotal = performance.now() - start
|
|
118
|
+
// console.warn(
|
|
119
|
+
// `getNodes() is deprecated, use iterateNodes() instead; ` +
|
|
120
|
+
// `array length: ${result.length}; time(ms): ${timeTotal}`
|
|
121
|
+
// )
|
|
122
|
+
return result !== null && result !== void 0 ? result : [];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @deprecated
|
|
127
|
+
*/
|
|
128
|
+
function getNodesByType(type) {
|
|
129
|
+
// const start = performance.now()
|
|
130
|
+
const result = Array.from(iterateNodesByType(type));
|
|
131
|
+
// const timeTotal = performance.now() - start
|
|
132
|
+
// console.warn(
|
|
133
|
+
// `getNodesByType() is deprecated, use iterateNodesByType() instead; ` +
|
|
134
|
+
// `array length: ${result.length}; time(ms): ${timeTotal}`
|
|
135
|
+
// )
|
|
136
|
+
return result !== null && result !== void 0 ? result : [];
|
|
137
|
+
}
|
|
138
|
+
function iterateNodes() {
|
|
139
|
+
// Additionally fetching items by id to leverage lmdb-store cache
|
|
140
|
+
const nodesDb = getDatabases().nodes;
|
|
141
|
+
return new _iterable.GatsbyIterable(nodesDb.getKeys({
|
|
142
|
+
snapshot: false
|
|
143
|
+
}).map(nodeId => typeof nodeId === `string` ? getNode(nodeId) : undefined).filter(Boolean));
|
|
144
|
+
}
|
|
145
|
+
function iterateNodesByType(type) {
|
|
146
|
+
const nodesByType = getDatabases().nodesByType;
|
|
147
|
+
return new _iterable.GatsbyIterable(nodesByType.getValues(type).map(nodeId => getNode(nodeId)).filter(Boolean));
|
|
148
|
+
}
|
|
149
|
+
function getNode(id) {
|
|
150
|
+
if (!id || preSyncDeletedNodeIdsCache.has(id)) {
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
const {
|
|
154
|
+
nodes
|
|
155
|
+
} = getDatabases();
|
|
156
|
+
return nodes.get(id);
|
|
157
|
+
}
|
|
158
|
+
function getTypes() {
|
|
159
|
+
return getDatabases().nodesByType.getKeys({}).asArray;
|
|
160
|
+
}
|
|
161
|
+
function countNodes(typeName) {
|
|
162
|
+
if (!typeName) {
|
|
163
|
+
const stats = getDatabases().nodes.getStats();
|
|
164
|
+
return Math.max(Number(stats.entryCount) - preSyncDeletedNodeIdsCache.size, 0); // FIXME: add -1 when restoring shared structures key
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const {
|
|
168
|
+
nodesByType
|
|
169
|
+
} = getDatabases();
|
|
170
|
+
return nodesByType.getValuesCount(typeName);
|
|
171
|
+
}
|
|
172
|
+
async function runQuery(args) {
|
|
173
|
+
if (process.env.GATSBY_EXPERIMENTAL_LMDB_INDEXES) {
|
|
174
|
+
return await (0, _runQuery.doRunQuery)({
|
|
175
|
+
datastore: lmdbDatastore,
|
|
176
|
+
databases: getDatabases(),
|
|
177
|
+
...args
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
return Promise.resolve((0, _runFastFilters.runFastFiltersAndSort)(args));
|
|
181
|
+
}
|
|
182
|
+
let lastOperationPromise = Promise.resolve();
|
|
183
|
+
function updateDataStore(action) {
|
|
184
|
+
switch (action.type) {
|
|
185
|
+
case `DELETE_CACHE`:
|
|
186
|
+
{
|
|
187
|
+
const dbs = getDatabases();
|
|
188
|
+
// Force sync commit
|
|
189
|
+
dbs.nodes.transactionSync(() => {
|
|
190
|
+
dbs.nodes.clearSync();
|
|
191
|
+
dbs.nodesByType.clearSync();
|
|
192
|
+
dbs.metadata.clearSync();
|
|
193
|
+
dbs.indexes.clearSync();
|
|
194
|
+
});
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
case `SET_PROGRAM`:
|
|
198
|
+
{
|
|
199
|
+
// TODO: remove this when we have support for incremental indexes in lmdb
|
|
200
|
+
clearIndexes();
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
case `CREATE_NODE`:
|
|
204
|
+
case `DELETE_NODE`:
|
|
205
|
+
case `ADD_FIELD_TO_NODE`:
|
|
206
|
+
case `ADD_CHILD_NODE_TO_PARENT_NODE`:
|
|
207
|
+
case `MATERIALIZE_PAGE_MODE`:
|
|
208
|
+
{
|
|
209
|
+
var _action$payload;
|
|
210
|
+
const dbs = getDatabases();
|
|
211
|
+
const operationPromise = Promise.all([(0, _nodes.updateNodes)(dbs.nodes, action), (0, _nodesByType.updateNodesByType)(dbs.nodesByType, action)]);
|
|
212
|
+
lastOperationPromise = operationPromise;
|
|
213
|
+
|
|
214
|
+
// if create is used in the same transaction as delete we should remove it from cache
|
|
215
|
+
if (action.type === `CREATE_NODE`) {
|
|
216
|
+
preSyncDeletedNodeIdsCache.delete(action.payload.id);
|
|
217
|
+
}
|
|
218
|
+
if (action.type === `DELETE_NODE` && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.id) {
|
|
219
|
+
preSyncDeletedNodeIdsCache.add(action.payload.id);
|
|
220
|
+
operationPromise.then(() => {
|
|
221
|
+
// only clear if no other operations have been done in the meantime
|
|
222
|
+
if (lastOperationPromise === operationPromise) {
|
|
223
|
+
preSyncDeletedNodeIdsCache.clear();
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function clearIndexes() {
|
|
231
|
+
const dbs = getDatabases();
|
|
232
|
+
dbs.nodes.transactionSync(() => {
|
|
233
|
+
dbs.metadata.clearSync();
|
|
234
|
+
dbs.indexes.clearSync();
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Resolves when all the data is synced
|
|
240
|
+
*/
|
|
241
|
+
async function ready() {
|
|
242
|
+
await lastOperationPromise;
|
|
243
|
+
}
|
|
244
|
+
function setupLmdbStore({
|
|
245
|
+
dbPath = getDefaultDbPath()
|
|
246
|
+
} = {}) {
|
|
247
|
+
fullDbPath = dbPath;
|
|
248
|
+
(0, _redux.replaceReducer)({
|
|
249
|
+
nodes: (state = new Map(), action) => action.type === `DELETE_CACHE` ? new Map() : state,
|
|
250
|
+
nodesByType: (state = new Map(), action) => action.type === `DELETE_CACHE` ? new Map() : state
|
|
251
|
+
});
|
|
252
|
+
_redux.emitter.on(`*`, action => {
|
|
253
|
+
if (action) {
|
|
254
|
+
updateDataStore(action);
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
// TODO: remove this when we have support for incremental indexes in lmdb
|
|
258
|
+
clearIndexes();
|
|
259
|
+
return lmdbDatastore;
|
|
260
|
+
}
|
|
261
|
+
//# sourceMappingURL=lmdb-datastore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lmdb-datastore.js","names":["lmdbDatastore","getNode","getTypes","countNodes","iterateNodes","iterateNodesByType","updateDataStore","ready","runQuery","getNodes","getNodesByType","preSyncDeletedNodeIdsCache","Set","getDefaultDbPath","dbFileName","process","env","NODE_ENV","FORCE_TEST_DATABASE_ID","JEST_WORKER_ID","cwd","fullDbPath","rootDb","databases","getRootDb","Error","globalThis","__GATSBY_OPEN_ROOT_LMDBS","Map","get","open","name","path","compression","set","getDatabases","__GATSBY_OPEN_LMDBS","nodes","openDB","cache","expirer","nodesByType","dupSort","metadata","useVersions","indexes","result","Array","from","type","nodesDb","GatsbyIterable","getKeys","snapshot","map","nodeId","undefined","filter","Boolean","getValues","id","has","asArray","typeName","stats","getStats","Math","max","Number","entryCount","size","getValuesCount","args","GATSBY_EXPERIMENTAL_LMDB_INDEXES","doRunQuery","datastore","Promise","resolve","runFastFiltersAndSort","lastOperationPromise","action","dbs","transactionSync","clearSync","clearIndexes","operationPromise","all","updateNodes","updateNodesByType","delete","payload","add","then","clear","setupLmdbStore","dbPath","replaceReducer","state","emitter","on"],"sources":["../../../src/datastore/lmdb/lmdb-datastore.ts"],"sourcesContent":["import { RootDatabase, open, ArrayLikeIterable } from \"lmdb\"\n// import { performance } from \"perf_hooks\"\nimport { ActionsUnion, IGatsbyNode } from \"../../redux/types\"\nimport { updateNodes } from \"./updates/nodes\"\nimport { updateNodesByType } from \"./updates/nodes-by-type\"\nimport { IDataStore, ILmdbDatabases, IQueryResult } from \"../types\"\nimport { emitter, replaceReducer } from \"../../redux\"\nimport { GatsbyIterable } from \"../common/iterable\"\nimport { doRunQuery } from \"./query/run-query\"\nimport {\n IRunFilterArg,\n runFastFiltersAndSort,\n} from \"../in-memory/run-fast-filters\"\n\nconst lmdbDatastore = {\n getNode,\n getTypes,\n countNodes,\n iterateNodes,\n iterateNodesByType,\n updateDataStore,\n ready,\n runQuery,\n\n // deprecated:\n getNodes,\n getNodesByType,\n}\n\nconst preSyncDeletedNodeIdsCache = new Set()\n\nexport function getDefaultDbPath(): string {\n const dbFileName =\n process.env.NODE_ENV === `test`\n ? `test-datastore-${\n // FORCE_TEST_DATABASE_ID will be set if this gets executed in worker context\n // when running jest tests. JEST_WORKER_ID will be set when this gets executed directly\n // in test context (jest will use jest-worker internally).\n process.env.FORCE_TEST_DATABASE_ID ?? process.env.JEST_WORKER_ID\n }`\n : `datastore`\n\n return process.cwd() + `/.cache/data/` + dbFileName\n}\n\nlet fullDbPath\nlet rootDb\nlet databases\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace NodeJS {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n interface Global {\n __GATSBY_OPEN_LMDBS?: Map<string, ILmdbDatabases>\n __GATSBY_OPEN_ROOT_LMDBS?: Map<string, RootDatabase>\n }\n }\n}\n\nfunction getRootDb(): RootDatabase {\n if (!rootDb) {\n if (!fullDbPath) {\n throw new Error(`LMDB path is not set!`)\n }\n\n if (!globalThis.__GATSBY_OPEN_ROOT_LMDBS) {\n globalThis.__GATSBY_OPEN_ROOT_LMDBS = new Map()\n }\n rootDb = globalThis.__GATSBY_OPEN_ROOT_LMDBS.get(fullDbPath)\n if (rootDb) {\n return rootDb\n }\n\n rootDb = open({\n name: `root`,\n path: fullDbPath,\n compression: true,\n })\n\n globalThis.__GATSBY_OPEN_ROOT_LMDBS.set(fullDbPath, rootDb)\n }\n return rootDb\n}\n\nfunction getDatabases(): ILmdbDatabases {\n if (!databases) {\n // __GATSBY_OPEN_LMDBS tracks if we already opened given db in this process\n // In `gatsby serve` case we might try to open it twice - once for engines\n // and second to get access to `SitePage` nodes (to power trailing slashes\n // redirect middleware). This ensure there is single instance within a process.\n // Using more instances seems to cause weird random errors.\n if (!globalThis.__GATSBY_OPEN_LMDBS) {\n globalThis.__GATSBY_OPEN_LMDBS = new Map()\n }\n databases = globalThis.__GATSBY_OPEN_LMDBS.get(fullDbPath)\n if (databases) {\n return databases\n }\n\n const rootDb = getRootDb()\n databases = {\n nodes: rootDb.openDB({\n name: `nodes`,\n // FIXME: sharedStructuresKey breaks tests - probably need some cleanup for it on DELETE_CACHE\n // sharedStructuresKey: Symbol.for(`structures`),\n // @ts-ignore\n cache: {\n // expirer: false disables LRU part and only take care of WeakRefs\n // this way we don't retain nodes strongly, but will continue to\n // reuse them if they are loaded already\n expirer: false,\n },\n }),\n nodesByType: rootDb.openDB({\n name: `nodesByType`,\n dupSort: true,\n }),\n metadata: rootDb.openDB({\n name: `metadata`,\n useVersions: true,\n }),\n indexes: rootDb.openDB({\n name: `indexes`,\n // TODO: use dupSort when this is ready: https://github.com/DoctorEvidence/lmdb-store/issues/66\n // dupSort: true\n }),\n }\n globalThis.__GATSBY_OPEN_LMDBS.set(fullDbPath, databases)\n }\n return databases\n}\n\n/**\n * @deprecated\n */\nfunction getNodes(): Array<IGatsbyNode> {\n // const start = performance.now()\n const result = Array.from<IGatsbyNode>(iterateNodes())\n // const timeTotal = performance.now() - start\n // console.warn(\n // `getNodes() is deprecated, use iterateNodes() instead; ` +\n // `array length: ${result.length}; time(ms): ${timeTotal}`\n // )\n return result ?? []\n}\n\n/**\n * @deprecated\n */\nfunction getNodesByType(type: string): Array<IGatsbyNode> {\n // const start = performance.now()\n const result = Array.from<IGatsbyNode>(iterateNodesByType(type))\n // const timeTotal = performance.now() - start\n // console.warn(\n // `getNodesByType() is deprecated, use iterateNodesByType() instead; ` +\n // `array length: ${result.length}; time(ms): ${timeTotal}`\n // )\n return result ?? []\n}\n\nfunction iterateNodes(): GatsbyIterable<IGatsbyNode> {\n // Additionally fetching items by id to leverage lmdb-store cache\n const nodesDb = getDatabases().nodes\n return new GatsbyIterable(\n nodesDb\n .getKeys({ snapshot: false })\n .map(nodeId => (typeof nodeId === `string` ? getNode(nodeId) : undefined))\n .filter(Boolean) as ArrayLikeIterable<IGatsbyNode>\n )\n}\n\nfunction iterateNodesByType(type: string): GatsbyIterable<IGatsbyNode> {\n const nodesByType = getDatabases().nodesByType\n return new GatsbyIterable(\n nodesByType\n .getValues(type)\n .map(nodeId => getNode(nodeId))\n .filter(Boolean) as ArrayLikeIterable<IGatsbyNode>\n )\n}\n\nfunction getNode(id: string): IGatsbyNode | undefined {\n if (!id || preSyncDeletedNodeIdsCache.has(id)) {\n return undefined\n }\n\n const { nodes } = getDatabases()\n return nodes.get(id)\n}\n\nfunction getTypes(): Array<string> {\n return getDatabases().nodesByType.getKeys({}).asArray\n}\n\nfunction countNodes(typeName?: string): number {\n if (!typeName) {\n const stats = getDatabases().nodes.getStats() as { entryCount: number }\n return Math.max(\n Number(stats.entryCount) - preSyncDeletedNodeIdsCache.size,\n 0\n ) // FIXME: add -1 when restoring shared structures key\n }\n\n const { nodesByType } = getDatabases()\n return nodesByType.getValuesCount(typeName)\n}\n\nasync function runQuery(args: IRunFilterArg): Promise<IQueryResult> {\n if (process.env.GATSBY_EXPERIMENTAL_LMDB_INDEXES) {\n return await doRunQuery({\n datastore: lmdbDatastore,\n databases: getDatabases(),\n ...args,\n })\n }\n return Promise.resolve(runFastFiltersAndSort(args))\n}\n\nlet lastOperationPromise: Promise<any> = Promise.resolve()\n\nfunction updateDataStore(action: ActionsUnion): void {\n switch (action.type) {\n case `DELETE_CACHE`: {\n const dbs = getDatabases()\n // Force sync commit\n dbs.nodes.transactionSync(() => {\n dbs.nodes.clearSync()\n dbs.nodesByType.clearSync()\n dbs.metadata.clearSync()\n dbs.indexes.clearSync()\n })\n break\n }\n case `SET_PROGRAM`: {\n // TODO: remove this when we have support for incremental indexes in lmdb\n clearIndexes()\n break\n }\n case `CREATE_NODE`:\n case `DELETE_NODE`:\n case `ADD_FIELD_TO_NODE`:\n case `ADD_CHILD_NODE_TO_PARENT_NODE`:\n case `MATERIALIZE_PAGE_MODE`: {\n const dbs = getDatabases()\n const operationPromise = Promise.all([\n updateNodes(dbs.nodes, action),\n updateNodesByType(dbs.nodesByType, action),\n ])\n lastOperationPromise = operationPromise\n\n // if create is used in the same transaction as delete we should remove it from cache\n if (action.type === `CREATE_NODE`) {\n preSyncDeletedNodeIdsCache.delete(action.payload.id)\n }\n\n if (action.type === `DELETE_NODE` && action.payload?.id) {\n preSyncDeletedNodeIdsCache.add(action.payload.id)\n operationPromise.then(() => {\n // only clear if no other operations have been done in the meantime\n if (lastOperationPromise === operationPromise) {\n preSyncDeletedNodeIdsCache.clear()\n }\n })\n }\n }\n }\n}\n\nfunction clearIndexes(): void {\n const dbs = getDatabases()\n dbs.nodes.transactionSync(() => {\n dbs.metadata.clearSync()\n dbs.indexes.clearSync()\n })\n}\n\n/**\n * Resolves when all the data is synced\n */\nasync function ready(): Promise<void> {\n await lastOperationPromise\n}\n\nexport function setupLmdbStore({\n dbPath = getDefaultDbPath(),\n}: { dbPath?: string } = {}): IDataStore {\n fullDbPath = dbPath\n\n replaceReducer({\n nodes: (state = new Map(), action) =>\n action.type === `DELETE_CACHE` ? new Map() : state,\n nodesByType: (state = new Map(), action) =>\n action.type === `DELETE_CACHE` ? new Map() : state,\n })\n emitter.on(`*`, action => {\n if (action) {\n updateDataStore(action)\n }\n })\n // TODO: remove this when we have support for incremental indexes in lmdb\n clearIndexes()\n return lmdbDatastore\n}\n"],"mappings":";;;;;AAAA;AAGA;AACA;AAEA;AACA;AACA;AACA;A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,KAC/BA,MAAM,CAAC/B,IAAI,KAAM,cAAa,GAAG,IAAIrB,GAAG,EAAE,GAAGqE,KAAK;IACpDxD,WAAW,EAAE,CAACwD,KAAK,GAAG,IAAIrE,GAAG,EAAE,EAAEoD,MAAM,KACrCA,MAAM,CAAC/B,IAAI,KAAM,cAAa,GAAG,IAAIrB,GAAG,EAAE,GAAGqE;EACjD,CAAC,CAAC;EACFC,cAAO,CAACC,EAAE,CAAE,GAAE,EAAEnB,MAAM,IAAI;IACxB,IAAIA,MAAM,EAAE;MACV1E,eAAe,CAAC0E,MAAM,CAAC;IACzB;EACF,CAAC,CAAC;EACF;EACAI,YAAY,EAAE;EACd,OAAOpF,aAAa;AACtB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IDbFilterStatement } from "../../common/query";
|
|
2
|
+
import { IGatsbyNode } from "../../../redux/types";
|
|
3
|
+
export declare function isDesc(sortOrder: "asc" | "desc" | "ASC" | "DESC" | boolean | void): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Given dotted field selector (e.g. `foo.bar`) returns a plain list of values matching this selector.
|
|
6
|
+
* It is possible that the path maps to several values when one of the intermediate values is an array.
|
|
7
|
+
*
|
|
8
|
+
* Example node:
|
|
9
|
+
* {
|
|
10
|
+
* foo: [{ bar: `bar1`}, { bar: `bar2` }]
|
|
11
|
+
* }
|
|
12
|
+
*
|
|
13
|
+
* In this case resolveFieldValue([`foo`, `bar`], node) returns [`bar1`, `bar2`]
|
|
14
|
+
*
|
|
15
|
+
* When `resolvedNodeFields` argument is passed the function first looks for values in this object
|
|
16
|
+
* and only looks in the node if the value is not found in `resolvedNodeFields`
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveFieldValue(dottedFieldPath: string | Array<string>, nodeOrThunk: IGatsbyNode | (() => IGatsbyNode), resolvedNodeFields?: {
|
|
19
|
+
[field: string]: unknown;
|
|
20
|
+
}): unknown;
|
|
21
|
+
export declare function matchesFilter(filter: IDbFilterStatement, fieldValue: unknown): boolean;
|
|
22
|
+
export declare function cartesianProduct(...arr: Array<Array<any>>): Array<any>;
|
|
23
|
+
export declare function compareKey(a: unknown, b: unknown): number;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.cartesianProduct = cartesianProduct;
|
|
5
|
+
exports.compareKey = compareKey;
|
|
6
|
+
exports.isDesc = isDesc;
|
|
7
|
+
exports.matchesFilter = matchesFilter;
|
|
8
|
+
exports.resolveFieldValue = resolveFieldValue;
|
|
9
|
+
var _query = require("../../common/query");
|
|
10
|
+
var _getValueAt = require("../../../utils/get-value-at");
|
|
11
|
+
function isDesc(sortOrder) {
|
|
12
|
+
return sortOrder === `desc` || sortOrder === `DESC` || sortOrder === false;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Given dotted field selector (e.g. `foo.bar`) returns a plain list of values matching this selector.
|
|
17
|
+
* It is possible that the path maps to several values when one of the intermediate values is an array.
|
|
18
|
+
*
|
|
19
|
+
* Example node:
|
|
20
|
+
* {
|
|
21
|
+
* foo: [{ bar: `bar1`}, { bar: `bar2` }]
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* In this case resolveFieldValue([`foo`, `bar`], node) returns [`bar1`, `bar2`]
|
|
25
|
+
*
|
|
26
|
+
* When `resolvedNodeFields` argument is passed the function first looks for values in this object
|
|
27
|
+
* and only looks in the node if the value is not found in `resolvedNodeFields`
|
|
28
|
+
*/
|
|
29
|
+
function resolveFieldValue(dottedFieldPath, nodeOrThunk, resolvedNodeFields) {
|
|
30
|
+
let result;
|
|
31
|
+
if (resolvedNodeFields) {
|
|
32
|
+
result = (0, _getValueAt.getValueAt)(resolvedNodeFields, dottedFieldPath);
|
|
33
|
+
}
|
|
34
|
+
if (typeof result !== `undefined`) {
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
const node = typeof nodeOrThunk === `function` ? nodeOrThunk() : nodeOrThunk;
|
|
38
|
+
return (0, _getValueAt.getValueAt)(node, dottedFieldPath);
|
|
39
|
+
}
|
|
40
|
+
function matchesFilter(filter, fieldValue) {
|
|
41
|
+
switch (filter.comparator) {
|
|
42
|
+
case _query.DbComparator.EQ:
|
|
43
|
+
return filter.value === null ? filter.value == fieldValue : filter.value === fieldValue;
|
|
44
|
+
case _query.DbComparator.IN:
|
|
45
|
+
{
|
|
46
|
+
const arr = Array.isArray(filter.value) ? filter.value : [filter.value];
|
|
47
|
+
return arr.some(v => v === null ? v == fieldValue : v === fieldValue);
|
|
48
|
+
}
|
|
49
|
+
case _query.DbComparator.GT:
|
|
50
|
+
return compareKey(fieldValue, filter.value) > 0;
|
|
51
|
+
case _query.DbComparator.GTE:
|
|
52
|
+
return compareKey(fieldValue, filter.value) >= 0;
|
|
53
|
+
case _query.DbComparator.LT:
|
|
54
|
+
return compareKey(fieldValue, filter.value) < 0;
|
|
55
|
+
case _query.DbComparator.LTE:
|
|
56
|
+
return compareKey(fieldValue, filter.value) <= 0;
|
|
57
|
+
case _query.DbComparator.NE:
|
|
58
|
+
case _query.DbComparator.NIN:
|
|
59
|
+
{
|
|
60
|
+
const arr = Array.isArray(filter.value) ? filter.value : [filter.value];
|
|
61
|
+
return arr.every(v => v === null ? v != fieldValue : v !== fieldValue);
|
|
62
|
+
}
|
|
63
|
+
case _query.DbComparator.REGEX:
|
|
64
|
+
{
|
|
65
|
+
if (typeof fieldValue !== `undefined` && filter.value instanceof RegExp) {
|
|
66
|
+
return filter.value.test(String(fieldValue));
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
function cartesianProduct(...arr) {
|
|
74
|
+
return arr.reduce((a, b) => a.flatMap(d => b.map(e => [...d, e])), [[]]);
|
|
75
|
+
}
|
|
76
|
+
const typeOrder = {
|
|
77
|
+
symbol: 0,
|
|
78
|
+
undefined: 1,
|
|
79
|
+
boolean: 2,
|
|
80
|
+
number: 3,
|
|
81
|
+
string: 4
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// Note: this is a copy of this function from lmdb-store:
|
|
85
|
+
// https://github.com/DoctorEvidence/lmdb-store/blob/e1e53d6d2012ec22071a8fb7fa3b47f8886b22d2/index.js#L1259-L1300
|
|
86
|
+
// We need it here to avoid imports from "lmdb-store" while it is not a direct dependency
|
|
87
|
+
// FIXME: replace with an import in v4
|
|
88
|
+
function compareKey(a, b) {
|
|
89
|
+
// compare with type consistency that matches ordered-binary
|
|
90
|
+
if (typeof a == `object`) {
|
|
91
|
+
if (!a) {
|
|
92
|
+
return b == null ? 0 : -1;
|
|
93
|
+
}
|
|
94
|
+
if (a[`compare`]) {
|
|
95
|
+
if (b == null) {
|
|
96
|
+
return 1;
|
|
97
|
+
} else if (typeof b === `object` && b !== null && b[`compare`]) {
|
|
98
|
+
return a[`compare`](b);
|
|
99
|
+
} else {
|
|
100
|
+
return -1;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
let arrayComparison;
|
|
104
|
+
if (b instanceof Array) {
|
|
105
|
+
let i = 0;
|
|
106
|
+
while ((arrayComparison = compareKey(a[i], b[i])) == 0 && i <= a[`length`]) {
|
|
107
|
+
i++;
|
|
108
|
+
}
|
|
109
|
+
return arrayComparison;
|
|
110
|
+
}
|
|
111
|
+
arrayComparison = compareKey(a[0], b);
|
|
112
|
+
if (arrayComparison == 0 && a[`length`] > 1) return 1;
|
|
113
|
+
return arrayComparison;
|
|
114
|
+
} else if (typeof a == typeof b) {
|
|
115
|
+
if (typeof a === `symbol` && typeof b === `symbol`) {
|
|
116
|
+
a = Symbol.keyFor(a);
|
|
117
|
+
b = Symbol.keyFor(b);
|
|
118
|
+
}
|
|
119
|
+
return a < b ? -1 : a === b ? 0 : 1;
|
|
120
|
+
} else if (typeof b == `object`) {
|
|
121
|
+
if (b instanceof Array) return -compareKey(b, a);
|
|
122
|
+
return 1;
|
|
123
|
+
} else {
|
|
124
|
+
return typeOrder[typeof a] < typeOrder[typeof b] ? -1 : 1;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","names":["isDesc","sortOrder","resolveFieldValue","dottedFieldPath","nodeOrThunk","resolvedNodeFields","result","getValueAt","node","matchesFilter","filter","fieldValue","comparator","DbComparator","EQ","value","IN","arr","Array","isArray","some","v","GT","compareKey","GTE","LT","LTE","NE","NIN","every","REGEX","RegExp","test","String","cartesianProduct","reduce","a","b","flatMap","d","map","e","typeOrder","symbol","undefined","boolean","number","string","arrayComparison","i","Symbol","keyFor"],"sources":["../../../../src/datastore/lmdb/query/common.ts"],"sourcesContent":["import { DbComparator, IDbFilterStatement } from \"../../common/query\"\nimport { IGatsbyNode } from \"../../../redux/types\"\nimport { getValueAt } from \"../../../utils/get-value-at\"\n\nexport function isDesc(\n sortOrder: \"asc\" | \"desc\" | \"ASC\" | \"DESC\" | boolean | void\n): boolean {\n return sortOrder === `desc` || sortOrder === `DESC` || sortOrder === false\n}\n\n/**\n * Given dotted field selector (e.g. `foo.bar`) returns a plain list of values matching this selector.\n * It is possible that the path maps to several values when one of the intermediate values is an array.\n *\n * Example node:\n * {\n * foo: [{ bar: `bar1`}, { bar: `bar2` }]\n * }\n *\n * In this case resolveFieldValue([`foo`, `bar`], node) returns [`bar1`, `bar2`]\n *\n * When `resolvedNodeFields` argument is passed the function first looks for values in this object\n * and only looks in the node if the value is not found in `resolvedNodeFields`\n */\nexport function resolveFieldValue(\n dottedFieldPath: string | Array<string>,\n nodeOrThunk: IGatsbyNode | (() => IGatsbyNode),\n resolvedNodeFields?: { [field: string]: unknown }\n): unknown {\n let result\n if (resolvedNodeFields) {\n result = getValueAt(resolvedNodeFields, dottedFieldPath)\n }\n if (typeof result !== `undefined`) {\n return result\n }\n const node = typeof nodeOrThunk === `function` ? nodeOrThunk() : nodeOrThunk\n return getValueAt(node, dottedFieldPath)\n}\n\nexport function matchesFilter(\n filter: IDbFilterStatement,\n fieldValue: unknown\n): boolean {\n switch (filter.comparator) {\n case DbComparator.EQ:\n return filter.value === null\n ? filter.value == fieldValue\n : filter.value === fieldValue\n case DbComparator.IN: {\n const arr = Array.isArray(filter.value) ? filter.value : [filter.value]\n return arr.some(v => (v === null ? v == fieldValue : v === fieldValue))\n }\n case DbComparator.GT:\n return compareKey(fieldValue, filter.value) > 0\n case DbComparator.GTE:\n return compareKey(fieldValue, filter.value) >= 0\n case DbComparator.LT:\n return compareKey(fieldValue, filter.value) < 0\n case DbComparator.LTE:\n return compareKey(fieldValue, filter.value) <= 0\n case DbComparator.NE:\n case DbComparator.NIN: {\n const arr = Array.isArray(filter.value) ? filter.value : [filter.value]\n return arr.every(v => (v === null ? v != fieldValue : v !== fieldValue))\n }\n case DbComparator.REGEX: {\n if (typeof fieldValue !== `undefined` && filter.value instanceof RegExp) {\n return filter.value.test(String(fieldValue))\n }\n return false\n }\n }\n return false\n}\n\nexport function cartesianProduct(...arr: Array<Array<any>>): Array<any> {\n return arr.reduce((a, b) => a.flatMap(d => b.map(e => [...d, e])), [[]])\n}\n\nconst typeOrder = {\n symbol: 0,\n undefined: 1,\n boolean: 2,\n number: 3,\n string: 4,\n}\n\n// Note: this is a copy of this function from lmdb-store:\n// https://github.com/DoctorEvidence/lmdb-store/blob/e1e53d6d2012ec22071a8fb7fa3b47f8886b22d2/index.js#L1259-L1300\n// We need it here to avoid imports from \"lmdb-store\" while it is not a direct dependency\n// FIXME: replace with an import in v4\nexport function compareKey(a: unknown, b: unknown): number {\n // compare with type consistency that matches ordered-binary\n if (typeof a == `object`) {\n if (!a) {\n return b == null ? 0 : -1\n }\n if (a[`compare`]) {\n if (b == null) {\n return 1\n } else if (typeof b === `object` && b !== null && b[`compare`]) {\n return a[`compare`](b)\n } else {\n return -1\n }\n }\n let arrayComparison\n if (b instanceof Array) {\n let i = 0\n while (\n (arrayComparison = compareKey(a[i], b[i])) == 0 &&\n i <= a[`length`]\n ) {\n i++\n }\n return arrayComparison\n }\n arrayComparison = compareKey(a[0], b)\n if (arrayComparison == 0 && a[`length`] > 1) return 1\n return arrayComparison\n } else if (typeof a == typeof b) {\n if (typeof a === `symbol` && typeof b === `symbol`) {\n a = Symbol.keyFor(a)\n b = Symbol.keyFor(b)\n }\n return (a as any) < (b as any) ? -1 : a === b ? 0 : 1\n } else if (typeof b == `object`) {\n if (b instanceof Array) return -compareKey(b, a)\n return 1\n } else {\n return typeOrder[typeof a] < typeOrder[typeof b] ? -1 : 1\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAEA;AAEO,SAASA,MAAM,CACpBC,SAA2D,EAClD;EACT,OAAOA,SAAS,KAAM,MAAK,IAAIA,SAAS,KAAM,MAAK,IAAIA,SAAS,KAAK,KAAK;AAC5E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,iBAAiB,CAC/BC,eAAuC,EACvCC,WAA8C,EAC9CC,kBAAiD,EACxC;EACT,IAAIC,MAAM;EACV,IAAID,kBAAkB,EAAE;IACtBC,MAAM,GAAG,IAAAC,sBAAU,EAACF,kBAAkB,EAAEF,eAAe,CAAC;EAC1D;EACA,IAAI,OAAOG,MAAM,KAAM,WAAU,EAAE;IACjC,OAAOA,MAAM;EACf;EACA,MAAME,IAAI,GAAG,OAAOJ,WAAW,KAAM,UAAS,GAAGA,WAAW,EAAE,GAAGA,WAAW;EAC5E,OAAO,IAAAG,sBAAU,EAACC,IAAI,EAAEL,eAAe,CAAC;AAC1C;AAEO,SAASM,aAAa,CAC3BC,MAA0B,EAC1BC,UAAmB,EACV;EACT,QAAQD,MAAM,CAACE,UAAU;IACvB,KAAKC,mBAAY,CAACC,EAAE;MAClB,OAAOJ,MAAM,CAACK,KAAK,KAAK,IAAI,GACxBL,MAAM,CAACK,KAAK,IAAIJ,UAAU,GAC1BD,MAAM,CAACK,KAA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,CAAC,CAAC,EAAEZ,CAAC,CAACY,CAAC,CAAC,CAAC,KAAK,CAAC,IAC/CA,CAAC,IAAIb,CAAC,CAAE,QAAO,CAAC,EAChB;QACAa,CAAC,EAAE;MACL;MACA,OAAOD,eAAe;IACxB;IACAA,eAAe,GAAGzB,UAAU,CAACa,CAAC,CAAC,CAAC,CAAC,EAAEC,CAAC,CAAC;IACrC,IAAIW,eAAe,IAAI,CAAC,IAAIZ,CAAC,CAAE,QAAO,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACrD,OAAOY,eAAe;EACxB,CAAC,MAAM,IAAI,OAAOZ,CAAC,IAAI,OAAOC,CAAC,EAAE;IAC/B,IAAI,OAAOD,CAAC,KAAM,QAAO,IAAI,OAAOC,CAAC,KAAM,QAAO,EAAE;MAClDD,CAAC,GAAGc,MAAM,CAACC,MAAM,CAACf,CAAC,CAAC;MACpBC,CAAC,GAAGa,MAAM,CAACC,MAAM,CAACd,CAAC,CAAC;IACtB;IACA,OAAQD,CAAC,GAAYC,CAAS,GAAG,CAAC,CAAC,GAAGD,CAAC,KAAKC,CAAC,GAAG,CAAC,GAAG,CAAC;EACvD,CAAC,MAAM,IAAI,OAAOA,CAAC,IAAK,QAAO,EAAE;IAC/B,IAAIA,CAAC,YAAYnB,KAAK,EAAE,OAAO,CAACK,UAAU,CAACc,CAAC,EAAED,CAAC,CAAC;IAChD,OAAO,CAAC;EACV,CAAC,MAAM;IACL,OAAOM,SAAS,CAAC,OAAON,CAAC,CAAC,GAAGM,SAAS,CAAC,OAAOL,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;EAC3D;AACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IDataStore, ILmdbDatabases } from "../../types";
|
|
2
|
+
interface IIndexingContext {
|
|
3
|
+
databases: ILmdbDatabases;
|
|
4
|
+
datastore: IDataStore;
|
|
5
|
+
}
|
|
6
|
+
export type IndexFields = Map<string, number>;
|
|
7
|
+
export interface IIndexMetadata {
|
|
8
|
+
state: "ready" | "building" | "stale" | "error" | "initial";
|
|
9
|
+
error?: string;
|
|
10
|
+
typeName: string;
|
|
11
|
+
keyPrefix: number | string;
|
|
12
|
+
keyFields: Array<[fieldName: string, orderDirection: number]>;
|
|
13
|
+
multiKeyFields: Array<string>;
|
|
14
|
+
stats: {
|
|
15
|
+
keyCount: number;
|
|
16
|
+
itemCount: number;
|
|
17
|
+
maxKeysPerItem: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare const undefinedSymbol: unique symbol;
|
|
21
|
+
export type IndexFieldValue = number | string | boolean | null | typeof undefinedSymbol | Array<IndexFieldValue>;
|
|
22
|
+
export type IndexKey = Array<IndexFieldValue>;
|
|
23
|
+
export declare function createIndex(context: IIndexingContext, typeName: string, indexFields: IndexFields): Promise<IIndexMetadata>;
|
|
24
|
+
export declare function getIndexMetadata(context: IIndexingContext, typeName: string, indexFields: IndexFields, assertReady?: boolean): IIndexMetadata;
|
|
25
|
+
export {};
|