diff --git a/.circleci/config.yml b/.circleci/config.yml index 8578ce44d3a81..872b4b161cf1e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -139,15 +139,10 @@ commands: default: "" steps: - checkout - # In case of failure, add these steps again. Cache probably got deleted - #- <<: *restore_cache - #- <<: *install_node_modules - #- <<: *persist_cache - unless: condition: << parameters.skip_file_change_test >> steps: - run: ./scripts/assert-changed-files.sh "<< parameters.trigger_pattern >>|<< parameters.test_path >>/*" - - when: condition: << parameters.slices >> steps: diff --git a/.cursorignore b/.cursorignore new file mode 100644 index 0000000000000..6f9f00ff49135 --- /dev/null +++ b/.cursorignore @@ -0,0 +1 @@ +# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv) diff --git a/.eslintrc.js b/.eslintrc.js index 5651d964f0b4c..6d5a9f69095d1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -120,16 +120,10 @@ module.exports = { plugins: [`@typescript-eslint/eslint-plugin`], extends: [`plugin:@typescript-eslint/recommended`], rules: { - // We should absolutely avoid using ts-ignore, but it's not always possible. - // particular when a dependencies types are incorrect. "@typescript-eslint/ban-ts-comment": [ `warn`, { "ts-ignore": `allow-with-description` }, ], - // This rule is great. It helps us not throw on types for areas that are - // easily inferrable. However we have a desire to have all function inputs - // and outputs declaratively typed. So this let's us ignore the parameters - // inferrable lint. "@typescript-eslint/no-inferrable-types": [ `error`, { ignoreParameters: true }, @@ -149,7 +143,6 @@ module.exports = { }, ], camelcase: `off`, - // TODO: These rules allow a lot of stuff and don't really enforce. If we want to apply our styleguide, we'd need to fix a lot of stuff "@typescript-eslint/naming-convention": [ `error`, { @@ -207,20 +200,8 @@ module.exports = { prefix: [`I`], }, ], - // This rule tries to prevent using `require()`. However in node code, - // there are times where this makes sense. And it specifically is causing - // problems in our tests where we often want this functionality for module - // mocking. At this point it's easier to have it off and just encourage - // using top-level imports via code reviews. "@typescript-eslint/no-var-requires": `off`, "@typescript-eslint/no-extra-semi": `off`, - // This rule ensures that typescript types do not have semicolons - // at the end of their lines, since our prettier setup is to have no semicolons - // e.g., - // interface Foo { - // - baz: string; - // + baz: string - // } "@typescript-eslint/member-delimiter-style": [ `error`, { @@ -230,13 +211,7 @@ module.exports = { }, ], "@typescript-eslint/no-empty-function": `off`, - // This ensures that we always type the return type of functions - // a high level focus of our TS setup is typing fn inputs and outputs. "@typescript-eslint/explicit-function-return-type": `error`, - // This forces us to use interfaces over types aliases for object definitions. - // Type is still useful for opaque types - // e.g., - // type UUID = string "@typescript-eslint/consistent-type-definitions": [ `error`, `interface`, @@ -245,9 +220,6 @@ module.exports = { `error`, { functions: false }, ], - // Allows us to write unions like `type Foo = "baz" | "bar"` - // otherwise eslint will want to switch the strings to backticks, - // which then crashes the ts compiler quotes: `off`, "@typescript-eslint/quotes": [ 2, @@ -256,8 +228,6 @@ module.exports = { avoidEscape: true, }, ], - // bump to @typescript-eslint/parser started showing Flow related errors in ts(x) files - // so disabling them in .ts(x) files "flowtype/no-types-missing-file-annotation": `off`, "@typescript-eslint/array-type": [`error`, { default: `generic` }], }, diff --git a/format:code b/format:code new file mode 100644 index 0000000000000..3735aae143ab6 --- /dev/null +++ b/format:code @@ -0,0 +1,1046 @@ +> npm run lint:code -- --fix + + +> l> l> l> l> l> l> l> l> l> l> l> l> l> l> l> l> et . --fix + +============= + +WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estWARNING: You are currently running a version of TypeScript which is not oPESCRIPT VERSIONS: >=3.3.1 <5.1.0 + +YOUR TYPESCRIPT VERSION: 5.1.6 + +Please only submit bug reports when using the officially supported version. + +============= + +> format:other +> npm run prettier -- --write + + +> prettier +> prettier "**/*.{md,css,scss,yaml,yml}" --writ> prettier "**/*.{md,css,scss,yaml,yml}" --writ> prettier "**/*.{md,css,scss,yaml,yml}" --writ> prettier "**/*.{md,css,scss,yaml,yml}" --writ> prettier "**/*.{md,css,scss,yaml,yml}" --writ2ms +.github/actions/high-priority-prs/README.md 12ms +.github/ISSUE_TEMPLATE/BUG_REPORT.yml 6ms +.github/ISSUE_TEMPLATE/config.yml 2ms +.github/ISSUE_TEMPLATE/DOCUMENTATION.yml 2ms +.github/PULL_REQUEST_TEMPLATE.md 1ms +.github/workflows/schedule-stale.yml 3ms +.gitpod.yml 2ms +benchmarks/create-pages/README.md 2ms +benchmarks/docker-runner/README.md 20ms +benchmarks/gabe-csv-markdown/README.md 4ms +benchmarks/gabe-csv-text/README.md 4ms +benchmarks/gabe-fs-markdown-images/README.md 13ms +benchmarks/gabe-fs-markdown-route-api/README.md 4ms +benchmarks/gabe-fs-markdown/README.md 4ms +benchmarks/gabe-fs-mdx/README.md 3ms +benchmarks/gabe-fs-mdx/styles.css 20ms +benchmarks/gabe-fs-text/README.md 4ms +benchmarks/gabe-json-text/README.md 4ms +benchmarks/gabe-yaml-text/README.md 4ms +benchmarks/image-processing/README.md 3ms +benchmarks/image-processing/src/components/layout.css 38ms +benchmarks/markdown_id/content/blog/hello-world/index.md 4ms +benchmarks/markdown_id/content/blog/my-second-post/index.md 3ms +benchmarks/markdown_id/content/blog/new-beginnings/index.md 20ms +benchmarks/markdown_id/README.md 5ms +benchmarks/markdown_slug/content/blog/hello-world/index.md 4ms +benchmarks/markdown_slug/content/blog/my-second-post/index.md 3ms +benchmarks/markdown_slug/content/blog/new-beginnings/index.md 18ms +benchmarks/markdown_slug/README.md 3ms +benchmarks/markdown_table/README.md 4ms +benchmarks/md/README.md 1ms +benchmarks/md/styles.css 1ms +benchmarks/mdx/README.md 2ms +benchmarks/mdx/styles.css 1ms +benchmarks/plugin-manifest/README.md 2ms +benchmarks/query-filters-sort/README.md 7ms +benchmarks/query/README.md 2ms +benchmarks/query/recording.md 4ms +benchmarks/README.md 1ms +benchmarks/source-agilitycms/CODE_OF_CONDUCT.md 9ms +benchmarks/source-agilitycms/README.md 3ms +benchmarks/source-agilitycms/src/components/LayoutTemplate.css 12ms +benchmarks/source-agilitycms/src/components/PreviewBar.css 2ms +benchmarks/source-agilitycms/src/modules/PostDetails.css 1ms +benchmarks/source-agilitycms/src/modules/PostListing.css 2ms +benchmarks/source-contentful/README.md 5ms +benchmarks/source-cosmicjs/README.md 3ms +benchmarks/source-cosmicjs/src/styles.css 1ms +benchmarks/source-datocms/README.md 2ms +benchmarks/source-datocms/styles.css 1ms +benchmarks/source-drupal/README.md 1ms +benchmarks/source-drupal/styles.css 1ms +benchmarks/source-flotiq/README.md 3ms +benchmarks/source-flotiq/src/styles/styles.css 1ms +benchmarks/source-kontent/README.md 1ms +benchmarks/source-kontent/styles.css 1ms +benchmarks/source-sanity/README.md 2ms +benchmarks/source-sanity/styles.css 0ms +benchmarks/source-strapi/README.md 1ms +benchmarks/source-wordpress/README.md 1ms +benchmarks/source-wordpress/styles.css 1ms +CHANGELOG.md 3ms +CODE_OF_CONDUCT.md 1ms +CONTRIBUTING.md 1ms +docs/accessibility-statement.md 12ms +docs/contributing/blog-contributions.md 14ms +docs/contributing/code-contributions.md 22ms +docs/contributing/code-of-conduct.md 9ms +docs/contributing/contributor-swag.md 7ms +docs/contributing/docs-contributions/docs-components.md 60ms +docs/contributing/docs-contributions/docs-structure.md 8ms +docs/contributing/docs-contributions/docs-writing-process.md 17ms +docs/contributing/docs-contributions/how-to-write-a-conceptual-guide.md 5ms +docs/contributing/docs-contributions/how-to-write-a-how-to-guide.md 15ms +docs/contributing/docs-contributions/how-to-write-a-plugin-readme.md 8ms +docs/contributing/docs-contributions/how-to-write-a-reference-guide.md 12ms +docs/contributing/docs-contributions/how-to-write-a-starter-readme.md 2ms +docs/contributing/docs-contributions/how-to-write-a-tutorial.md 16ms +docs/contributing/docs-contributions/index.md 44ms +docs/contributing/gatsby-governance-model.md 34ms +docs/contributing/gatsby-style-guide.md 55ms +docs/contributing/how-to-file-an-issue.md 5ms +docs/contributing/how-to-make-a-reproducible-test-case.md 10ms +docs/contributing/how-to-open-a-pull-request.md 26ms +docs/contributing/index.md 20ms +docs/contributing/rfc-process.md 21ms +docs/docs/ab-testing.md 4ms +docs/docs/adding-a-list-of-markdown-blog-posts.md 5ms +docs/docs/adding-a-shopping-cart-with-snipcart.md 24ms +docs/docs/adding-app-and-website-functionality.md 21ms +docs/docs/adding-pagination.md 5ms +docs/docs/adding-react-components.md 13ms +docs/docs/adding-redux-store.md 3ms +docs/docs/adding-search-with-algolia.md 35ms +docs/docs/adding-search-with-js-search.md 17ms +docs/docs/adding-tags-and-categories-to-blog-posts.md 24ms +docs/docs/api-proxy.md 5ms +docs/docs/build-caching.md 10ms +docs/docs/building-a-contact-form.md 45ms +docs/docs/building-an-ecommerce-site-with-shopify.md 15ms +docs/docs/cheat-sheet.md 19ms +docs/docs/cli-feedback.md 2ms +docs/docs/conceptual/building-with-components.md 8ms +docs/docs/conceptual/choosing-a-cms.md 17ms +docs/docs/conceptual/content-sync.md 10ms +docs/docs/conceptual/data-fetching.md 22ms +docs/docs/conceptual/gatsby-core-philosophy.md 34ms +docs/docs/conceptual/gatsby-for-ecommerce.md 37ms +docs/docs/conceptual/gatsby-jargon.md 25ms +docs/docs/conceptual/gatsby-lifecycle-apis.md 10ms +docs/docs/conceptual/graphql-concepts.md 31ms +docs/docs/conceptual/how-shadowing-works.md 47ms +docs/docs/conceptual/image-plugin-architecture.md 30ms +docs/docs/conceptual/making-your-site-accessible.md 15ms +docs/docs/conceptual/overview-of-the-gatsby-build-process.md 34ms +docs/docs/conceptual/partial-hydration.md 14ms +docs/docs/conceptual/plugins-themes-and-starters.md 21ms +docs/docs/conceptual/react-hydration.md 23ms +docs/docs/conceptual/rendering-options.md 23ms +docs/docs/conceptual/security-in-gatsby.md 26ms +docs/docs/conceptual/using-gatsby-image.md 19ms +docs/docs/content-and-data.md 4ms +docs/docs/creating-a-local-plugin.md 10ms +docs/docs/creating-a-starter.md 17ms +docs/docs/creating-and-modifying-pages.md 20ms +docs/docs/creating-dynamic-navigation.md 18ms +docs/docs/creating-plugins.md 3ms +docs/docs/creating-prefixed-404-pages-for-different-languages.md 4ms +docs/docs/creating-slugs-for-pages.md 2ms +docs/docs/css-libraries-and-frameworks.md 2ms +docs/docs/custom-html.md 6ms +docs/docs/debugging-async-lifecycles.md 5ms +docs/docs/debugging-cache-issues.md 3ms +docs/docs/debugging-html-builds.md 14ms +docs/docs/debugging-incremental-builds.md 14ms +docs/docs/debugging-the-build-process.md 20ms +docs/docs/debugging.md 2ms +docs/docs/gatsby-internals-terminology.md 13ms +docs/docs/glossary.md 56ms +docs/docs/glossary/build.md 6ms +docs/docs/glossary/content-delivery-network.md 8ms +docs/docs/glossary/continuous-deployment.md 6ms +docs/docs/glossary/headless-cms.md 8ms +docs/docs/glossary/headless-wordpress.md 10ms +docs/docs/glossary/infrastructure-as-code.md 5ms +docs/docs/glossary/jamstack.md 11ms +docs/docs/glossary/jsx.md 6ms +docs/docs/glossary/markdown.md 8ms +docs/docs/glossary/mdx.md 8ms +docs/docs/glossary/node.md 6ms +docs/docs/glossary/npm.md 8ms +docs/docs/glossary/progressive-enhancement.md 7ms +docs/docs/glossary/react.md 6ms +docs/docs/glossary/server-side-rendering.md 9ms +docs/docs/glossary/static-site-generator.md 8ms +docs/docs/glossary/webpack.md 7ms +docs/docs/glossary/wpgraphql.md 11ms +docs/docs/glossary/yarn.md 11ms +docs/docs/graphql-reference.md 44ms +docs/docs/graphql.md 5ms +docs/docs/guides.md 2ms +docs/docs/how-code-splitting-works.md 32ms +docs/docs/how-to/adding-common-features/add-404-page.md 4ms +docs/docs/how-to/adding-common-features/add-500-page.md 2ms +docs/docs/how-to/adding-common-features/adding-an-rss-feed.md 12ms +docs/docs/how-to/adding-common-features/adding-analytics.md 4ms +docs/docs/how-to/adding-common-features/adding-comments.md 13ms +docs/docs/how-to/adding-common-features/adding-forms.md 13ms +docs/docs/how-to/adding-common-features/adding-page-transitions-with-plugin-transition-link.md 16ms +docs/docs/how-to/adding-common-features/adding-search.md 9ms +docs/docs/how-to/adding-common-features/adding-seo-component.md 12ms +docs/docs/how-to/adding-common-features/building-a-site-with-authentication.md 16ms +docs/docs/how-to/adding-common-features/creating-a-sitemap.md 3ms +docs/docs/how-to/adding-common-features/localization-i18n.md 9ms +docs/docs/how-to/adding-common-features/processing-payments-with-stripe.md 9ms +docs/docs/how-to/cloud/adding-a-custom-domain.md 11ms +docs/docs/how-to/cloud/configuring-log-drains.md 11ms +docs/docs/how-to/cloud/create-a-deploy-to-gatsby-cloud-button.md 3ms +docs/docs/how-to/cloud/create-site-from-repository.md 9ms +docs/docs/how-to/cloud/create-site-from-template.md 6ms +docs/docs/how-to/cloud/deploying-functions-on-gatsby-cloud.md 5ms +docs/docs/how-to/cloud/deploying-to-fastly.md 10ms +docs/docs/how-to/cloud/deploying-to-firebase.md 7ms +docs/docs/how-to/cloud/deploying-to-gatsby-cloud-hosting.md 4ms +docs/docs/how-to/cloud/managing-invoices-and-payments.md 5ms +docs/docs/how-to/cloud/managing-workspace-members.md 5ms +docs/docs/how-to/cloud/new-account-signup.md 2ms +docs/docs/how-to/cloud/npm-7-peer-dependencies.md 2ms +docs/docs/how-to/cloud/outgoing-notifications.md 8ms +docs/docs/how-to/cloud/set-node-version.md 4ms +docs/docs/how-to/cloud/slices-optimization.md 2ms +docs/docs/how-to/cloud/unified-hosting.md 5ms +docs/docs/how-to/cloud/working-with-redirects-and-rewrites.md 24ms +docs/docs/how-to/custom-configuration/add-custom-webpack-config.md 15ms +docs/docs/how-to/custom-configuration/babel.md 5ms +docs/docs/how-to/custom-configuration/browser-support.md 4ms +docs/docs/how-to/custom-configuration/es-modules.md 9ms +docs/docs/how-to/custom-configuration/eslint.md 7ms +docs/docs/how-to/custom-configuration/typescript.md 107ms +docs/docs/how-to/images-and-media/importing-assets-into-files.md 15ms +docs/docs/how-to/images-and-media/importing-media-content.md 7ms +docs/docs/how-to/images-and-media/preprocessing-external-images.md 17ms +docs/docs/how-to/images-and-media/static-folder.md 10ms +docs/docs/how-to/images-and-media/using-cloudinary-image-service.md 18ms +docs/docs/how-to/images-and-media/using-gatsby-image.md 18ms +docs/docs/how-to/images-and-media/using-gatsby-plugin-image.md 40ms +docs/docs/how-to/images-and-media/working-with-gifs.md 5ms +docs/docs/how-to/images-and-media/working-with-images-in-markdown.md 17ms +docs/docs/how-to/images-and-media/working-with-video.md 19ms +docs/docs/how-to/local-development/configuring-ca-certificates.md 5ms +docs/docs/how-to/local-development/debugging-missing-data.md 9ms +docs/docs/how-to/local-development/environment-variables.md 8ms +docs/docs/how-to/local-development/gatsby-on-linux.md 17ms +docs/docs/how-to/local-development/gatsby-on-windows.md 11ms +docs/docs/how-to/local-development/graphql-typegen.md 23ms +docs/docs/how-to/local-development/javascript-tooling.md 4ms +docs/docs/how-to/local-development/running-a-gatsby-preview-server.md 5ms +docs/docs/how-to/local-development/starters.md 5ms +docs/docs/how-to/local-development/troubleshooting-common-errors.md 41ms +docs/docs/how-to/performance/add-a-manifest-file.md 5ms +docs/docs/how-to/performance/add-offline-support-with-a-service-worker.md 8ms +docs/docs/how-to/performance/audit-with-lighthouse.md 10ms +docs/docs/how-to/performance/improving-build-performance.md 27ms +docs/docs/how-to/performance/improving-site-performance.md 47ms +docs/docs/how-to/performance/partial-hydration.md 16ms +docs/docs/how-to/performance/resolving-out-of-memory-issues.md 23ms +docs/docs/how-to/performance/using-slices.md 13ms +docs/docs/how-to/plugins-and-themes/adding-gatsby-image-support.md 29ms +docs/docs/how-to/plugins-and-themes/building-themes.md 10ms +docs/docs/how-to/plugins-and-themes/configuring-usage-with-plugin-options.md 18ms +docs/docs/how-to/plugins-and-themes/converting-a-starter.md 12ms +docs/docs/how-to/plugins-and-themes/creating-a-generic-plugin.md 7ms +docs/docs/how-to/plugins-and-themes/creating-a-transformer-plugin.md 16ms +docs/docs/how-to/plugins-and-themes/maintaining-a-plugin.md 9ms +docs/docs/how-to/plugins-and-themes/naming-a-plugin.md 5ms +docs/docs/how-to/plugins-and-themes/shadowing.md 16ms +docs/docs/how-to/plugins-and-themes/submit-to-plugin-library.md 4ms +docs/docs/how-to/plugins-and-themes/theme-composition.md 3ms +docs/docs/how-to/plugins-and-themes/theme-conventions.md 10ms +docs/docs/how-to/plugins-and-themes/using-a-gatsby-theme.md 6ms +docs/docs/how-to/plugins-and-themes/using-a-plugin-in-your-site.md 8ms +docs/docs/how-to/previews-deploys-hosting/adapters.md 4ms +docs/docs/how-to/previews-deploys-hosting/asset-prefix.md 11ms +docs/docs/how-to/previews-deploys-hosting/caching.md 9ms +docs/docs/how-to/previews-deploys-hosting/creating-an-adapter.md 32ms +docs/docs/how-to/previews-deploys-hosting/deploying-to-aws-amplify.md 4ms +docs/docs/how-to/previews-deploys-hosting/deploying-to-azure.md 5ms +docs/docs/how-to/previews-deploys-hosting/deploying-to-firebase.md 7ms +docs/docs/how-to/previews-deploys-hosting/deploying-to-gatsby-cloud.md 5ms +docs/docs/how-to/previews-deploys-hosting/deploying-to-gitlab-pages.md 10ms +docs/docs/how-to/previews-deploys-hosting/deploying-to-heroku.md 4ms +docs/docs/how-to/previews-deploys-hosting/deploying-to-iis.md 4ms +docs/docs/how-to/previews-deploys-hosting/deploying-to-netlify.md 4ms +docs/docs/how-to/previews-deploys-hosting/deploying-to-other-services.md 2ms +docs/docs/how-to/previews-deploys-hosting/deploying-to-s3-cloudfront.md 11ms +docs/docs/how-to/previews-deploys-hosting/deploying-to-vercel.md 3ms +docs/docs/how-to/previews-deploys-hosting/headers.md 12ms +docs/docs/how-to/previews-deploys-hosting/how-gatsby-works-with-github-pages.md 13ms +docs/docs/how-to/previews-deploys-hosting/path-prefix.md 10ms +docs/docs/how-to/previews-deploys-hosting/zero-configuration-deployments.md 5ms +docs/docs/how-to/querying-data/page-query.md 12ms +docs/docs/how-to/querying-data/running-queries-with-graphiql.md 8ms +docs/docs/how-to/querying-data/static-query.md 3ms +docs/docs/how-to/querying-data/use-static-query.md 7ms +docs/docs/how-to/querying-data/using-gatsby-without-graphql.md 12ms +docs/docs/how-to/rendering-options/using-deferred-static-generation.md 15ms +docs/docs/how-to/rendering-options/using-server-side-rendering.md 8ms +docs/docs/how-to/routing/adding-markdown-pages.md 11ms +docs/docs/how-to/routing/client-only-routes-and-user-authentication.md 13ms +docs/docs/how-to/routing/creating-routes.md 4ms +docs/docs/how-to/routing/customizing-components.md 5ms +docs/docs/how-to/routing/layout-components.md 8ms +docs/docs/how-to/routing/mdx.md 37ms +docs/docs/how-to/routing/migrate-remark-to-mdx.md 8ms +docs/docs/how-to/routing/scroll-restoration.md 6ms +docs/docs/how-to/sourcing-data/headless-cms.md 9ms +docs/docs/how-to/sourcing-data/sourcing-from-contentful.md 8ms +docs/docs/how-to/sourcing-data/sourcing-from-databases.md 2ms +docs/docs/how-to/sourcing-data/sourcing-from-drupal.md 9ms +docs/docs/how-to/sourcing-data/sourcing-from-hosted-services.md 3ms +docs/docs/how-to/sourcing-data/sourcing-from-json-or-yaml.md 14ms +docs/docs/how-to/sourcing-data/sourcing-from-kontent-ai.md 20ms +docs/docs/how-to/sourcing-data/sourcing-from-netlify-cms.md 25ms +docs/docs/how-to/sourcing-data/sourcing-from-prismic.md 25ms +docs/docs/how-to/sourcing-data/sourcing-from-private-apis.md 8ms +docs/docs/how-to/sourcing-data/sourcing-from-the-filesystem.md 10ms +docs/docs/how-to/sourcing-data/sourcing-from-wordpress.md 15ms +docs/docs/how-to/styling/built-in-css.md 5ms +docs/docs/how-to/styling/bulma.md 4ms +docs/docs/how-to/styling/css-in-js.md 7ms +docs/docs/how-to/styling/css-modules.md 8ms +docs/docs/how-to/styling/emotion.md 6ms +docs/docs/how-to/styling/global-css.md 13ms +docs/docs/how-to/styling/other-css-frameworks.md 15ms +docs/docs/how-to/styling/post-css.md 5ms +docs/docs/how-to/styling/sass.md 7ms +docs/docs/how-to/styling/styled-components.md 9ms +docs/docs/how-to/styling/tailwind-css.md 4ms +docs/docs/how-to/styling/theme-ui.md 15ms +docs/docs/how-to/styling/using-local-fonts.md 7ms +docs/docs/how-to/styling/using-web-fonts.md 6ms +docs/docs/how-to/testing/ab-testing-with-google-analytics-and-netlify.md 17ms +docs/docs/how-to/testing/end-to-end-testing.md 11ms +docs/docs/how-to/testing/testing-components-with-graphql.md 11ms +docs/docs/how-to/testing/testing-css-in-js.md 10ms +docs/docs/how-to/testing/testing-react-components.md 6ms +docs/docs/how-to/testing/unit-testing.md 17ms +docs/docs/how-to/testing/visual-testing-with-storybook.md 11ms +docs/docs/html-generation.md 12ms +docs/docs/images-and-files.md 2ms +docs/docs/internal-data-bridge.md 5ms +docs/docs/linking-between-pages.md 7ms +docs/docs/local-https.md 12ms +docs/docs/location-data-from-props.md 7ms +docs/docs/modifying-a-starter.md 15ms +docs/docs/multi-core-builds.md 5ms +docs/docs/node-creation.md 17ms +docs/docs/performance-tracing.md 18ms +docs/docs/plugins.md 5ms +docs/docs/porting-an-html-site-to-gatsby.md 29ms +docs/docs/porting-from-create-react-app-to-gatsby.md 30ms +docs/docs/porting-to-gatsby.md 3ms +docs/docs/preoptimizing-images.md 5ms +docs/docs/production-app.md 19ms +docs/docs/profiling-site-performance-with-react-profiler.md 8ms +docs/docs/programmatically-create-pages-from-data.md 9ms +docs/docs/progressive-web-app.md 9ms +docs/docs/query-filters.md 30ms +docs/docs/quick-start.md 6ms +docs/docs/reach-router-and-gatsby.md 4ms +docs/docs/reference/built-in-components/gatsby-head.md 14ms +docs/docs/reference/built-in-components/gatsby-image.md 31ms +docs/docs/reference/built-in-components/gatsby-link.md 23ms +docs/docs/reference/built-in-components/gatsby-plugin-image.md 56ms +docs/docs/reference/built-in-components/gatsby-script.md 36ms +docs/docs/reference/built-in-components/gatsby-slice.md 23ms +docs/docs/reference/cloud/apex-and-subdomains.md 8ms +docs/docs/reference/cloud/build-and-preview-webhooks.md 6ms +docs/docs/reference/cloud/build-logs.md 5ms +docs/docs/reference/cloud/cms-previews.md 8ms +docs/docs/reference/cloud/gatsby-cloud-environment-variables.md 5ms +docs/docs/reference/cloud/hosting-and-data-source-integrations.md 5ms +docs/docs/reference/cloud/managing-environment-variables.md 7ms +docs/docs/reference/cloud/monorepos.md 7ms +docs/docs/reference/cloud/platform-limits.md 11ms +docs/docs/reference/cloud/production-builds-and-pull-request-builds.md 7ms +docs/docs/reference/cloud/quick-connect.md 6ms +docs/docs/reference/cloud/supported-git-providers.md 3ms +docs/docs/reference/cloud/valhalla-content-hub.md 17ms +docs/docs/reference/cloud/what-is-gatsby-cloud.md 7ms +docs/docs/reference/config-files/actions.md 4ms +docs/docs/reference/config-files/gatsby-browser.md 4ms +docs/docs/reference/config-files/gatsby-config.md 32ms +docs/docs/reference/config-files/gatsby-node.md 7ms +docs/docs/reference/config-files/gatsby-provision.md 10ms +docs/docs/reference/config-files/gatsby-ssr.md 4ms +docs/docs/reference/config-files/node-api-helpers.md 3ms +docs/docs/reference/functions/getting-started.md 10ms +docs/docs/reference/functions/middleware-and-helpers.md 11ms +docs/docs/reference/functions/routing.md 3ms +docs/docs/reference/gatsby-cli.md 19ms +docs/docs/reference/gatsby-project-structure.md 10ms +docs/docs/reference/graphql-data-layer/graphql-api.md 21ms +docs/docs/reference/graphql-data-layer/node-interface.md 10ms +docs/docs/reference/graphql-data-layer/node-model.md 2ms +docs/docs/reference/graphql-data-layer/schema-customization.md 66ms +docs/docs/reference/graphql-data-layer/using-graphql-fragments.md 6ms +docs/docs/reference/local-development/fast-refresh.md 16ms +docs/docs/reference/markdown-syntax.md 17ms +docs/docs/reference/release-notes/gatsby-version-support.md 7ms +docs/docs/reference/release-notes/image-migration-guide.md 30ms +docs/docs/reference/release-notes/migrating-from-v0-to-v1.md 27ms +docs/docs/reference/release-notes/migrating-from-v1-to-v2.md 64ms +docs/docs/reference/release-notes/migrating-from-v2-to-v3.md 55ms +docs/docs/reference/release-notes/migrating-from-v3-to-v4.md 60ms +docs/docs/reference/release-notes/migrating-from-v4-to-v5.md 42ms +docs/docs/reference/release-notes/migrating-source-plugin-from-v3-to-v4.md 14ms +docs/docs/reference/release-notes/upgrade-gatsby-and-dependencies.md 12ms +docs/docs/reference/release-notes/v1-release-notes.md 1ms +docs/docs/reference/release-notes/v2-release-notes.md 1ms +docs/docs/reference/release-notes/v2.26/index.md 21ms +docs/docs/reference/release-notes/v2.27/index.md 20ms +docs/docs/reference/release-notes/v2.28/index.md 23ms +docs/docs/reference/release-notes/v2.29/index.md 25ms +docs/docs/reference/release-notes/v2.30/index.md 24ms +docs/docs/reference/release-notes/v2.31/index.md 32ms +docs/docs/reference/release-notes/v2.32/index.md 15ms +docs/docs/reference/release-notes/v3.0/index.md 46ms +docs/docs/reference/release-notes/v3.1/index.md 16ms +docs/docs/reference/release-notes/v3.10/index.md 16ms +docs/docs/reference/release-notes/v3.11/index.md 7ms +docs/docs/reference/release-notes/v3.12/index.md 14ms +docs/docs/reference/release-notes/v3.13/index.md 17ms +docs/docs/reference/release-notes/v3.14/index.md 20ms +docs/docs/reference/release-notes/v3.2/index.md 15ms +docs/docs/reference/release-notes/v3.3/index.md 18ms +docs/docs/reference/release-notes/v3.4/index.md 18ms +docs/docs/reference/release-notes/v3.5/index.md 17ms +docs/docs/reference/release-notes/v3.6/index.md 14ms +docs/docs/reference/release-notes/v3.7/index.md 19ms +docs/docs/reference/release-notes/v3.8/index.md 13ms +docs/docs/reference/release-notes/v3.9/index.md 12ms +docs/docs/reference/release-notes/v4.0/index.md 31ms +docs/docs/reference/release-notes/v4.1/index.md 16ms +docs/docs/reference/release-notes/v4.10/index.md 13ms +docs/docs/reference/release-notes/v4.11/index.md 10ms +docs/docs/reference/release-notes/v4.12/index.md 7ms +docs/docs/reference/release-notes/v4.13/index.md 8ms +docs/docs/reference/release-notes/v4.14/index.md 17ms +docs/docs/reference/release-notes/v4.15/index.md 10ms +docs/docs/reference/release-notes/v4.16/index.md 12ms +docs/docs/reference/release-notes/v4.17/index.md 9ms +docs/docs/reference/release-notes/v4.18/index.md 10ms +docs/docs/reference/release-notes/v4.19/index.md 10ms +docs/docs/reference/release-notes/v4.2/index.md 11ms +docs/docs/reference/release-notes/v4.20/index.md 12ms +docs/docs/reference/release-notes/v4.21/index.md 17ms +docs/docs/reference/release-notes/v4.22/index.md 14ms +docs/docs/reference/release-notes/v4.23/index.md 14ms +docs/docs/reference/release-notes/v4.24/index.md 14ms +docs/docs/reference/release-notes/v4.3/index.md 8ms +docs/docs/reference/release-notes/v4.4/index.md 10ms +docs/docs/reference/release-notes/v4.5/index.md 20ms +docs/docs/reference/release-notes/v4.6/index.md 13ms +docs/docs/reference/release-notes/v4.7/index.md 15ms +docs/docs/reference/release-notes/v4.8/index.md 15ms +docs/docs/reference/release-notes/v4.9/index.md 8ms +docs/docs/reference/release-notes/v5.0/index.md 40ms +docs/docs/reference/release-notes/v5.1/index.md 9ms +docs/docs/reference/release-notes/v5.10/index.md 7ms +docs/docs/reference/release-notes/v5.11/index.md 9ms +docs/docs/reference/release-notes/v5.12/index.md 11ms +docs/docs/reference/release-notes/v5.13/index.md 15ms +docs/docs/reference/release-notes/v5.2/index.md 8ms +docs/docs/reference/release-notes/v5.3/index.md 13ms +docs/docs/reference/release-notes/v5.4/index.md 7ms +docs/docs/reference/release-notes/v5.5/index.md 14ms +docs/docs/reference/release-notes/v5.6/index.md 10ms +docs/docs/reference/release-notes/v5.7/index.md 4ms +docs/docs/reference/release-notes/v5.8/index.md 5ms +docs/docs/reference/release-notes/v5.9/index.md 12ms +docs/docs/reference/rendering-options/deferred-static-generation.md 14ms +docs/docs/reference/rendering-options/server-side-rendering.md 11ms +docs/docs/reference/routing/creating-routes.md 17ms +docs/docs/reference/routing/file-system-route-api.md 30ms +docs/docs/refreshing-content.md 3ms +docs/docs/resource-handling-and-service-workers.md 20ms +docs/docs/schema-generation.md 13ms +docs/docs/schema-inference.md 33ms +docs/docs/schema-sift.md 2ms +docs/docs/sourcing-from-agilitycms.md 25ms +docs/docs/sourcing-from-builder-io.md 5ms +docs/docs/sourcing-from-buttercms.md 34ms +docs/docs/sourcing-from-contentstack.md 12ms +docs/docs/sourcing-from-etsy.md 15ms +docs/docs/sourcing-from-flotiq.md 18ms +docs/docs/sourcing-from-forestry.md 15ms +docs/docs/sourcing-from-gentics-mesh.md 12ms +docs/docs/sourcing-from-ghost.md 8ms +docs/docs/sourcing-from-graphcms.md 15ms +docs/docs/sourcing-from-sanity.md 22ms +docs/docs/sourcing-from-woocommerce.md 11ms +docs/docs/starters.md 11ms +docs/docs/styling.md 4ms +docs/docs/telemetry.md 10ms +docs/docs/theme-api.md 19ms +docs/docs/themes.md 3ms +docs/docs/themes/using-multiple-gatsby-themes.md 3ms +docs/docs/themes/what-are-gatsby-themes.md 10ms +docs/docs/upgrading-node-js.md 9ms +docs/docs/using-client-side-only-packages.md 9ms +docs/docs/using-typography-js.md 9ms +docs/docs/why-gatsby-uses-graphql.md 26ms +docs/docs/write-pages.md 15ms +docs/README.md 1ms +docs/tutorial/authentication-tutorial.md 12ms +docs/tutorial/blog-netlify-cms-tutorial/index.md 12ms +docs/tutorial/building-a-theme.md 54ms +docs/tutorial/e-commerce-with-datocms-and-snipcart/index.md 46ms +docs/tutorial/ecommerce-tutorial/index.md 28ms +docs/tutorial/plugin-and-theme-tutorials.md 3ms +docs/tutorial/prismic-source-graphql-tutorial.md 22ms +docs/tutorial/remark-plugin-tutorial.md 24ms +docs/tutorial/using-a-theme.md 14ms +docs/tutorial/using-multiple-themes-together.md 17ms +docs/tutorial/wordpress-image-tutorial.md 15ms +docs/tutorial/wordpress-source-plugin-tutorial.md 25ms +e2e-tests/adapters/README.md 5ms +e2e-tests/adapters/src/pages/index.css 2ms +e2e-tests/contentful/README.md 1ms +e2e-tests/development-runtime/content/2018-12-14-hello-world.md 1ms +e2e-tests/development-runtime/content/md-image.md 1ms +e2e-tests/development-runtime/README.md 12ms +e2e-tests/development-runtime/src/components/layout.css 24ms +e2e-tests/development-runtime/src/pages/styling/css-modules.module.css 0ms +e2e-tests/development-runtime/src/pages/styling/not-visited-plain-css-not-imported-initially.css 1ms +e2e-tests/development-runtime/src/pages/styling/not-visited-plain-css.css 1ms +e2e-tests/development-runtime/src/pages/styling/plain-css-not-imported-initially.css 0ms +e2e-tests/development-runtime/src/pages/styling/plain-css.css 0ms +e2e-tests/development-runtime/src/pages/styling/sass-plain.scss 0ms +e2e-tests/development-runtime/src/pages/styling/sass.module.scss 1ms +e2e-tests/development-runtime/src/test-files/input.yaml 0ms +e2e-tests/development-runtime/static/used-by-head-function-export-basic.css 0ms +e2e-tests/development-runtime/static/used-by-head-function-export-dsg.css 0ms +e2e-tests/development-runtime/static/used-by-head-function-export-query.css 0ms +e2e-tests/development-runtime/static/used-by-head-function-export-ssr.css 0ms +e2e-tests/mdx/src/posts/my-blog.md 1ms +e2e-tests/path-prefix/README.md 1ms +e2e-tests/path-prefix/src/components/layout.css 20ms +e2e-tests/production-runtime/plugins/gatsby-plugin-global-style/index.css 1ms +e2e-tests/production-runtime/README.md 1ms +e2e-tests/production-runtime/src/components/layout.css 19ms +e2e-tests/production-runtime/src/index.css 2ms +e2e-tests/production-runtime/src/pages/styling/css-modules.module.css 1ms +e2e-tests/production-runtime/src/pages/styling/plain-css.css 1ms +e2e-tests/production-runtime/src/pages/styling/sass-plain.scss 1ms +e2e-tests/production-runtime/src/pages/styling/sass.module.scss 1ms +e2e-tests/production-runtime/static/used-by-head-function-export-basic.css 1ms +e2e-tests/production-runtime/static/used-by-head-function-export-dsg.css 1ms +e2e-tests/production-runtime/static/used-by-head-function-export-query.css 1ms +e2e-tests/production-runtime/static/used-by-head-function-export-ssr.css 0ms +e2e-tests/README.md 3ms +e2e-tests/themes/development-runtime/README.md 1ms +e2e-tests/themes/gatsby-theme-about/README.md 1ms +e2e-tests/themes/production-runtime/README.md 0ms +e2e-tests/trailing-slash/global.css 2ms +e2e-tests/trailing-slash/README.md 2ms +e2e-tests/visual-regression/README.md 3ms +e2e-tests/visual-regression/src/components/layout.css 18ms +examples/client-only-paths/README.md 1ms +examples/client-only-paths/src/pages/main.css 2ms +examples/creating-source-plugins/api/README.md 1ms +examples/creating-source-plugins/example-site/README.md 0ms +examples/creating-source-plugins/README.md 9ms +examples/creating-source-plugins/source-plugin/README.md 1ms +examples/data-fetching/README.md 1ms +examples/data-fetching/src/components/layout.css 19ms +examples/ecommerce-tutorial-with-stripe/README.md 2ms +examples/ecommerce-tutorial-with-stripe/src/components/layout.css 21ms +examples/feed/posts/2017-03-09-first-post.md 9ms +examples/feed/posts/2017-05-22-second-post.md 9ms +examples/feed/README.md 1ms +examples/functions-airtable-form/README.md 5ms +examples/functions-auth0/README.md 6ms +examples/functions-auth0/src/styles/site.css 1ms +examples/functions-basic-form/README.md 2ms +examples/functions-google-gmail/README.md 5ms +examples/functions-google-gmail/src/pages/index.css 1ms +examples/functions-google-oauth/README.md 6ms +examples/functions-google-oauth/src/pages/app.module.scss 1ms +examples/functions-google-oauth/src/pages/auth-redirect.module.scss 1ms +examples/functions-google-oauth/src/pages/index.module.scss 3ms +examples/functions-google-sheets/README.md 5ms +examples/functions-google-sheets/src/pages/index.css 1ms +examples/functions-hello-world/README.md 2ms +examples/functions-sendgrid-email/README.md 4ms +examples/functions-twilio-text/README.md 4ms +examples/functions-twilio-text/src/pages/index.css 1ms +examples/gatsbygram/README.md 1ms +examples/graphql-reference/content/authors/author.yaml 0ms +examples/graphql-reference/content/blog/Break-with-a-Banshee/index.md 3ms +examples/graphql-reference/content/blog/Childrens-Anthology-of-Monsters/index.md 3ms +examples/graphql-reference/content/blog/Fantastic-Beasts-and-where-to-find-them/index.md 4ms +examples/graphql-reference/content/blog/History-of-Magic/index.md 4ms +examples/graphql-reference/content/blog/Hogwarts-A-History/index.md 4ms +examples/graphql-reference/content/blog/Omens-Oracles-and-the-Goat/index.md 3ms +examples/graphql-reference/content/blog/Tales-of-Beedle-the-Bard/index.md 3ms +examples/graphql-reference/content/queries.md 6ms +examples/graphql-reference/README.md 1ms +examples/hn/README.md 1ms +examples/hn/src/css/news.css 14ms +examples/image-processing/README.md 1ms +examples/README.md 4ms +examples/recipe-createPage/README.md 0ms +examples/route-api/blog/2020-10-01-the-original.md 4ms +examples/route-api/blog/2020-10-02-chestnut.md 3ms +examples/route-api/parks/park.yaml 2ms +examples/route-api/products/product.yaml 1ms +examples/route-api/README.md 2ms +examples/route-api/styles.css 2ms +examples/simple-auth/README.md 2ms +examples/simple-auth/src/components/Form/form.module.css 1ms +examples/simple-auth/src/components/Header/header.module.css 1ms +examples/simple-auth/src/components/Layout/global.css 1ms +examples/simple-auth/src/components/Layout/main.module.css 1ms +examples/simple-auth/src/components/Status/status.module.css 1ms +examples/simple-auth/src/components/View/view.module.css 0ms +examples/sitemap/posts/2017-03-09-first-post.md 7ms +examples/sitemap/posts/2017-05-22-second-post.md 9ms +examples/sitemap/README.md 0ms +examples/styleguide/README.md 1ms +examples/styleguide/src/components/Button/README.md 2ms +examples/styleguide/src/templates/ComponentPage/components/ComponentPreview/editor.css 1ms +examples/styleguide/src/templates/ComponentPage/components/ComponentPreview/prism-theme.css 4ms +examples/using-asciidoc/README.md 1ms +examples/using-contentful/README.md 1ms +examples/using-css-modules/README.md 1ms +examples/using-css-modules/src/styles/another-page.module.css 1ms +examples/using-css-modules/src/styles/index.module.css 0ms +examples/using-css-modules/src/styles/sass.module.scss 1ms +examples/using-csv/README.md 0ms +examples/using-cypress/README.md 1ms +examples/using-cypress/src/components/layout.css 18ms +examples/using-drupal/README.md 1ms +examples/using-emotion-prismjs/README.md 1ms +examples/using-emotion-prismjs/src/pages/2017-10-16-code-highlighting/index.md 3ms +examples/using-emotion-prismjs/src/pages/2017-10-17-code-highlighting-with-line-highlight/index.md 3ms +examples/using-emotion/README.md 1ms +examples/using-excel/README.md 1ms +examples/using-faker/README.md 0ms +examples/using-faker/src/layouts/index.css 19ms +examples/using-faker/src/pages/index.css 1ms +examples/using-fragments/README.md 1ms +examples/using-gatsby-head/README.md 1ms +examples/using-gatsby-image/content/unsplash-images.yaml 3ms +examples/using-gatsby-image/plugins/gatsby-source-remote-images/README.md 1ms +examples/using-gatsby-image/README.md 1ms +examples/using-gatsby-image/src/pages/art-direction.css 1ms +examples/using-gatsby-script/README.md 1ms +examples/using-gatsby-script/src/styles/common.css 1ms +examples/using-gatsby-source-graphql/README.md 1ms +examples/using-gatsby-with-json-yaml/content/index.yaml 3ms +examples/using-gatsby-with-json-yaml/content/My-YAML-Content.yaml 1ms +examples/using-gatsby-with-json-yaml/README.md 2ms +examples/using-gatsby-without-graphql/README.md 3ms +examples/using-graphql-typegen/README.md 2ms +examples/using-graphql-typegen/src/layout.css 7ms +examples/using-hjson/README.md 1ms +examples/using-i18n/README.md 4ms +examples/using-i18n/src/global.css 2ms +examples/using-javascript-transforms/README.md 4ms +examples/using-javascript-transforms/src/articles/2017-01-22-a-first-post/index.md 9ms +examples/using-javascript-transforms/src/articles/2017-03-09-choropleth-on-d3v4/_choropleth.md 10ms +examples/using-javascript-transforms/src/articles/2017-03-09-choropleth-on-d3v4/style.scss 2ms +examples/using-javascript-transforms/src/articles/2017-05-30-choropleth-on-d3v4-alternate/_choropleth.md 8ms +examples/using-javascript-transforms/src/articles/2017-05-30-choropleth-on-d3v4-alternate/style.scss 2ms +examples/using-javascript-transforms/src/components/SiteLinks/style.css 1ms +examples/using-javascript-transforms/src/components/SiteNav/style.css 1ms +examples/using-javascript-transforms/src/mainPages/404.md 1ms +examples/using-javascript-transforms/src/mainPages/about.md 1ms +examples/using-javascript-transforms/src/static/css/base.scss 1ms +examples/using-javascript-transforms/src/static/fonts/fontawesome/style.css 92ms +examples/using-jest/README.md 1ms +examples/using-jest/src/components/layout.css 19ms +examples/using-js-search/README.md 2ms +examples/using-jss/README.md 1ms +examples/using-loadable-components/README.md 11ms +examples/using-loadable-components/src/components/layout.css 17ms +examples/using-local-plugins/README.md 3ms +examples/using-markdown-pages/README.md 1ms +examples/using-markdown-pages/src/components/layout.css 19ms +examples/using-markdown-pages/src/markdown-pages/post-1.md 1ms +examples/using-markdown-pages/src/markdown-pages/post-2.md 1ms +examples/using-mdx/README.md 4ms +examples/using-mdx/src/components/layout.css 18ms +examples/using-medium/README.md 1ms +examples/using-mobx/readme.md 3ms +examples/using-mongodb/README.md 1ms +examples/using-multiple-local-plugins/gatsby-site-using-local-plugins/README.md 0ms +examples/using-multiple-local-plugins/gatsby-site-using-local-plugins/src/components/layout.css 3ms +examples/using-multiple-local-plugins/README.md 7ms +examples/using-multiple-themes/README.md 4ms +examples/using-page-loading-indicator/README.md 2ms +examples/using-page-transitions/README.md 1ms +examples/using-page-transitions/src/layouts/layout.css 18ms +examples/using-path-prefix/README.md 1ms +examples/using-plugin-options/README.md 3ms +examples/using-plugin-options/src/components/layout.css 2ms +examples/using-prefetching-preloading-modules/README.md 1ms +examples/using-prefetching-preloading-modules/src/pages/style.css 1ms +examples/using-reach-skip-nav/README.md 12ms +examples/using-reach-skip-nav/src/components/header.css 1ms +examples/using-reach-skip-nav/src/components/layout.css 3ms +examples/using-redirects/README.md 1ms +examples/using-redirects/src/components/layout.css 17ms +examples/using-redirects/src/components/selected.css 0ms +examples/using-redux-w-interaction-code-splitting/README.md 4ms +examples/using-redux-w-interaction-code-splitting/src/components/layout.css 18ms +examples/using-redux-w-page-code-splitting/README.md 2ms +examples/using-redux-w-page-code-splitting/src/components/layout.css 18ms +examples/using-redux/README.md 1ms +examples/using-remark-copy-linked-files/README.md 1ms +examples/using-remark-copy-linked-files/src/pages/2017-11-13-gatsby-remark-copy-linked-files/index.md 7ms +examples/using-remark/README.md 1ms +examples/using-remark/src/pages/2016-04-15---hello-world-kitchen-sink/index.md 18ms +examples/using-remark/src/pages/2017-01-02---responsive-images-and-iframes/index.md 5ms +examples/using-remark/src/pages/2017-03-21---copy-linked-files-intercepting-local-links/index.md 3ms +examples/using-remark/src/pages/2017-04-04---code-and-syntax-highlighting/index.md 9ms +examples/using-remark/src/pages/2017-04-05---embed-snippets/index.md 5ms +examples/using-remark/src/pages/2017-08-07---katex/index.md 3ms +examples/using-remark/src/pages/2017-11-14---excerpts/index.md 3ms +examples/using-remark/src/pages/2018-01-27---custom-components/index.md 25ms +examples/using-remark/src/pages/2019-02-06---graphviz/index.md 6ms +examples/using-remark/src/pages/author.yaml 0ms +examples/using-remark/src/pages/examples/example---custom-separator/index.md 3ms +examples/using-remark/src/pages/examples/example---no-separator/index.md 2ms +examples/using-sass/README.md 1ms +examples/using-sass/src/styles/_variables.scss 0ms +examples/using-sass/src/styles/main.scss 1ms +examples/using-shopify/README.md 10ms +examples/using-shopify/src/components/image-picker.module.css 1ms +examples/using-shopify/src/components/layout.css 20ms +examples/using-shopify/src/components/product-list.module.css 1ms +examples/using-shopify/src/components/product.module.css 1ms +examples/using-sqip/src/index.css 22ms +examples/using-styled-components/README.md 1ms +examples/using-styled-jsx/README.md 1ms +examples/using-styletron/README.md 1ms +examples/using-stylus/README.md 2ms +examples/using-type-definitions/README.md 11ms +examples/using-type-definitions/src/components/layout.css 18ms +examples/using-typescript/README.md 1ms +examples/using-typescript/styles.css 1ms +examples/using-vanilla-extract/README.md 1ms +examples/using-video/README.md 1ms +GOVERNANCE.md 1ms +integration-tests/artifacts/css-to-inline.css 1ms +integration-tests/artifacts/imported.css 1ms +integration-tests/artifacts/README.md 2ms +integration-tests/functions/README.md 2ms +integration-tests/gatsby-pipeline/README.md 2ms +integration-tests/gatsby-pipeline/src/components/layout.css 19ms +integration-tests/gatsby-source-wordpress/docker-compose.yml 2ms +integration-tests/head-function-export/README.md 2ms +integration-tests/images/README.md 1ms +integration-tests/lmdb-regeneration/README.md 1ms +integration-tests/long-term-caching/README.md 3ms +integration-tests/README.md 2ms +integration-tests/ssr/README.md 0ms +integration-tests/ssr/sample.css 0ms +integration-tests/ssr/src/styles/tailwind.css 0ms +integration-tests/ssr/src/test.css 0ms +integration-tests/structured-logging/README.md 1ms +packages/babel-plugin-remove-graphql-queries/CHANGELOG.md 47ms +packages/babel-preset-gatsby-package/CHANGELOG.md 34ms +packages/babel-preset-gatsby-package/README.md 3ms +packages/babel-preset-gatsby/CHANGELOG.md 46ms +packages/babel-preset-gatsby/README.md 5ms +packages/create-gatsby/CHANGELOG.md 43ms +packages/create-gatsby/README.md 4ms +packages/create-gatsby/stubs/tailwindcss/global.css 1ms +packages/gatsby-adapter-netlify/CHANGELOG.md 9ms +packages/gatsby-adapter-netlify/README.md 11ms +packages/gatsby-cli/CHANGELOG.md 189ms +packages/gatsby-cli/README.md 17ms +packages/gatsby-codemods/CHANGELOG.md 50ms +packages/gatsby-codemods/README.md 11ms +packages/gatsby-core-utils/CHANGELOG.md 66ms +packages/gatsby-core-utils/README.md 12ms +packages/gatsby-cypress/CHANGELOG.md 34ms +packages/gatsby-cypress/README.md 6ms +packages/gatsby-design-tokens/CHANGELOG.md 41ms +packages/gatsby-design-tokens/README.md 15ms +packages/gatsby-dev-cli/CHANGELOG.md 62ms +packages/gatsby-dev-cli/README.md 7ms +packages/gatsby-graphiql-explorer/CHANGELOG.md 45ms +packages/gatsby-graphiql-explorer/README.md 2ms +packages/gatsby-graphiql-explorer/src/app.css 2ms +packages/gatsby-legacy-polyfills/CHANGELOG.md 28ms +packages/gatsby-legacy-polyfills/README.md 1ms +packages/gatsby-link/.eslintrc.yaml 1ms +packages/gatsby-link/CHANGELOG.md 54ms +packages/gatsby-link/README.md 1ms +packages/gatsby-page-utils/CHANGELOG.md 47ms +packages/gatsby-page-utils/README.md 5ms +packages/gatsby-parcel-config/CHANGELOG.md 13ms +packages/gatsby-parcel-config/README.md 1ms +packages/gatsby-parcel-namer-relative-to-cwd/CHANGELOG.md 8ms +packages/gatsby-parcel-namer-relative-to-cwd/README.md 3ms +packages/gatsby-plugin-benchmark-reporting/CHANGELOG.md 33ms +packages/gatsby-plugin-benchmark-reporting/README.md 3ms +packages/gatsby-plugin-canonical-urls/CHANGELOG.md 33ms +packages/gatsby-plugin-canonical-urls/README.md 4ms +packages/gatsby-plugin-catch-links/.eslintrc.yaml 1ms +packages/gatsby-plugin-catch-links/CHANGELOG.md 46ms +packages/gatsby-plugin-catch-links/README.md 4ms +packages/gatsby-plugin-coffeescript/CHANGELOG.md 32ms +packages/gatsby-plugin-coffeescript/README.md 4ms +packages/gatsby-plugin-cxs/CHANGELOG.md 32ms +packages/gatsby-plugin-cxs/README.md 2ms +packages/gatsby-plugin-emotion/CHANGELOG.md 38ms +packages/gatsby-plugin-emotion/README.md 5ms +packages/gatsby-plugin-facebook-analytics/CHANGELOG.md 33ms +packages/gatsby-plugin-facebook-analytics/README.md 3ms +packages/gatsby-plugin-feed/CHANGELOG.md 44ms +packages/gatsby-plugin-feed/README.md 6ms +packages/gatsby-plugin-flow/CHANGELOG.md 35ms +packages/gatsby-plugin-flow/README.md 3ms +packages/gatsby-plugin-fullstory/CHANGELOG.md 44ms +packages/gatsby-plugin-fullstory/README.md 2ms +packages/gatsby-plugin-gatsby-cloud/CHANGELOG.md 51ms +packages/gatsby-plugin-gatsby-cloud/README.md 10ms +packages/gatsby-plugin-google-analytics/CHANGELOG.md 45ms +packages/gatsby-plugin-google-analytics/README.md 20ms +packages/gatsby-plugin-google-gtag/CHANGELOG.md 40ms +packages/gatsby-plugin-google-gtag/README.md 12ms +packages/gatsby-plugin-google-tagmanager/CHANGELOG.md 40ms +packages/gatsby-plugin-google-tagmanager/README.md 9ms +packages/gatsby-plugin-image/CHANGELOG.md 75ms +packages/gatsby-plugin-image/README.md 21ms +packages/gatsby-plugin-jss/CHANGELOG.md 32ms +packages/gatsby-plugin-jss/README.md 2ms +packages/gatsby-plugin-layout/CHANGELOG.md 34ms +packages/gatsby-plugin-layout/README.md 17ms +packages/gatsby-plugin-less/CHANGELOG.md 37ms +packages/gatsby-plugin-less/README.md 10ms +packages/gatsby-plugin-lodash/CHANGELOG.md 32ms +packages/gatsby-plugin-lodash/README.md 3ms +packages/gatsby-plugin-manifest/CHANGELOG.md 64ms +packages/gatsby-plugin-manifest/README.md 39ms +packages/gatsby-plugin-mdx/CHANGELOG.md 81ms +packages/gatsby-plugin-mdx/README.md 47ms +packages/gatsby-plugin-no-sourcemaps/CHANGELOG.md 22ms +packages/gatsby-plugin-no-sourcemaps/README.md 2ms +packages/gatsby-plugin-nprogress/CHANGELOG.md 33ms +packages/gatsby-plugin-nprogress/README.md 2ms +packages/gatsby-plugin-offline/CHANGELOG.md 67ms +packages/gatsby-plugin-offline/README.md 15ms +packages/gatsby-plugin-page-creator/CHANGELOG.md 60ms +packages/gatsby-plugin-page-creator/README.md 10ms +packages/gatsby-plugin-postcss/CHANGELOG.md 40ms +packages/gatsby-plugin-postcss/README.md 4ms +packages/gatsby-plugin-preact/CHANGELOG.md 43ms +packages/gatsby-plugin-preact/README.md 2ms +packages/gatsby-plugin-preload-fonts/CHANGELOG.md 43ms +packages/gatsby-plugin-preload-fonts/README.md 13ms +packages/gatsby-plugin-react-css-modules/CHANGELOG.md 33ms +packages/gatsby-plugin-react-css-modules/README.md 3ms +packages/gatsby-plugin-react-helmet/CHANGELOG.md 35ms +packages/gatsby-plugin-react-helmet/README.md 6ms +packages/gatsby-plugin-sass/CHANGELOG.md 49ms +packages/gatsby-plugin-sass/README.md 11ms +packages/gatsby-plugin-schema-snapshot/CHANGELOG.md 20ms +packages/gatsby-plugin-schema-snapshot/README.md 2ms +packages/gatsby-plugin-sharp/CHANGELOG.md 104ms +packages/gatsby-plugin-sharp/README.md 30ms +packages/gatsby-plugin-sitemap/CHANGELOG.md 44ms +packages/gatsby-plugin-sitemap/README.md 17ms +packages/gatsby-plugin-styled-components/CHANGELOG.md 35ms +packages/gatsby-plugin-styled-components/README.md 4ms +packages/gatsby-plugin-styled-jsx/CHANGELOG.md 31ms +packages/gatsby-plugin-styled-jsx/README.md 3ms +packages/gatsby-plugin-styletron/CHANGELOG.md 34ms +packages/gatsby-plugin-styletron/README.md 4ms +packages/gatsby-plugin-stylus/CHANGELOG.md 35ms +packages/gatsby-plugin-stylus/README.md 3ms +packages/gatsby-plugin-subfont/CHANGELOG.md 32ms +packages/gatsby-plugin-subfont/README.md 4ms +packages/gatsby-plugin-twitter/CHANGELOG.md 34ms +packages/gatsby-plugin-twitter/README.md 4ms +packages/gatsby-plugin-typescript/CHANGELOG.md 47ms +packages/gatsby-plugin-typescript/README.md 7ms +packages/gatsby-plugin-typography/CHANGELOG.md 38ms +packages/gatsby-plugin-typography/README.md 5ms +packages/gatsby-plugin-utils/CHANGELOG.md 42ms +packages/gatsby-plugin-utils/README.md 7ms +packages/gatsby-react-router-scroll/.eslintrc.yaml 1ms +packages/gatsby-react-router-scroll/CHANGELOG.md 41ms +packages/gatsby-react-router-scroll/README.md 2ms +packages/gatsby-remark-autolink-headers/CHANGELOG.md 42ms +packages/gatsby-remark-autolink-headers/README.md 8ms +packages/gatsby-remark-code-repls/CHANGELOG.md 36ms +packages/gatsby-remark-code-repls/README.md 10ms +packages/gatsby-remark-copy-linked-files/CHANGELOG.md 48ms +packages/gatsby-remark-copy-linked-files/README.md 13ms +packages/gatsby-remark-custom-blocks/CHANGELOG.md 40ms +packages/gatsby-remark-custom-blocks/README.md 12ms +packages/gatsby-remark-embed-snippet/CHANGELOG.md 39ms +packages/gatsby-remark-embed-snippet/README.md 29ms +packages/gatsby-remark-graphviz/CHANGELOG.md 36ms +packages/gatsby-remark-graphviz/README.md 5ms +packages/gatsby-remark-images-contentful/CHANGELOG.md 48ms +packages/gatsby-remark-images-contentful/README.md 8ms +packages/gatsby-remark-images/CHANGELOG.md 66ms +packages/gatsby-remark-images/README.md 19ms +packages/gatsby-remark-katex/CHANGELOG.md 34ms +packages/gatsby-remark-katex/README.md 5ms +packages/gatsby-remark-prismjs/CHANGELOG.md 43ms +packages/gatsby-remark-prismjs/README.md 30ms +packages/gatsby-remark-responsive-iframe/CHANGELOG.md 40ms +packages/gatsby-remark-responsive-iframe/README.md 3ms +packages/gatsby-remark-smartypants/CHANGELOG.md 30ms +packages/gatsby-remark-smartypants/README.md 3ms +packages/gatsby-script/.eslintrc.yaml 0ms +packages/gatsby-script/CHANGELOG.md 11ms +packages/gatsby-script/README.md 5ms +packages/gatsby-sharp/CHANGELOG.md 14ms +packages/gatsby-source-contentful/CHANGELOG.md 154ms +packages/gatsby-source-contentful/README.md 51ms +packages/gatsby-source-drupal/CHANGELOG.md 108ms +packages/gatsby-source-drupal/README.md 45ms +packages/gatsby-source-faker/CHANGELOG.md 34ms +packages/gatsby-source-faker/README.md 2ms +packages/gatsby-source-filesystem/CHANGELOG.md 79ms +packages/gatsby-source-filesystem/README.md 23ms +packages/gatsby-source-graphql/CHANGELOG.md 49ms +packages/gatsby-source-graphql/README.md 27ms +packages/gatsby-source-hacker-news/CHANGELOG.md 33ms +packages/gatsby-source-hacker-news/README.md 2ms +packages/gatsby-source-lever/CHANGELOG.md 35ms +packages/gatsby-source-lever/README.md 5ms +packages/gatsby-source-medium/CHANGELOG.md 33ms +packages/gatsby-source-medium/README.md 4ms +packages/gatsby-source-mongodb/CHANGELOG.md 38ms +packages/gatsby-source-mongodb/README.md 12ms +packages/gatsby-source-npm-package-search/CHANGELOG.md 34ms +packages/gatsby-source-npm-package-search/README.md 2ms +packages/gatsby-source-shopify/CHANGELOG.md 77ms +packages/gatsby-source-shopify/README.md 29ms +packages/gatsby-source-wikipedia/CHANGELOG.md 30ms +packages/gatsby-source-wikipedia/README.md 2ms +packages/gatsby-source-wordpress/ARCHITECTURE.md 42ms +packages/gatsby-source-wordpress/CHANGELOG.md 135ms +packages/gatsby-source-wordpress/docs/community-and-support.md 2ms +packages/gatsby-source-wordpress/docs/contributing.md 2ms +packages/gatsby-source-wordpress/docs/debugging-and-troubleshooting.md 26ms +packages/gatsby-source-wordpress/docs/features/caching.md 8ms +packages/gatsby-source-wordpress/docs/features/compatibility-api.md 2ms +packages/gatsby-source-wordpress/docs/features/gatsby-link.md 3ms +packages/gatsby-source-wordpress/docs/features/graphql-wordpress-and-gatsby.md 16ms +packages/gatsby-source-wordpress/docs/features/index.md 2ms +packages/gatsby-source-wordpress/docs/features/limit-nodes-during-development.md 3ms +packages/gatsby-source-wordpress/docs/features/media-item-processing.md 12ms +packages/gatsby-source-wordpress/docs/features/preview.md 14ms +packages/gatsby-source-wordpress/docs/features/security.md 5ms +packages/gatsby-source-wordpress/docs/getting-started.md 6ms +packages/gatsby-source-wordpress/docs/hosting.md 6ms +packages/gatsby-source-wordpress/docs/migrating-from-other-wp-source-plugins.md 11ms +packages/gatsby-source-wordpress/docs/plugin-options.md 70ms +packages/gatsby-source-wordpress/docs/problems-with-gatsby-source-graphql.md 5ms +packages/gatsby-source-wordpress/docs/problems-with-v3.md 9ms +packages/gatsby-source-wordpress/docs/tests.md 3ms +packages/gatsby-source-wordpress/docs/themes-starters-examples.md 2ms +packages/gatsby-source-wordpress/docs/tutorials/building-a-new-site-wordpress-and-gatsby.md 17ms +packages/gatsby-source-wordpress/docs/tutorials/configuring-previews-legacy.md 7ms +packages/gatsby-source-wordpress/docs/tutorials/configuring-wp-gatsby.md 12ms +packages/gatsby-source-wordpress/docs/tutorials/creating-a-new-site-from-a-starter.md 12ms +packages/gatsby-source-wordpress/docs/tutorials/index.md 2ms +packages/gatsby-source-wordpress/docs/tutorials/querying-data.md 37ms +packages/gatsby-source-wordpress/docs/tutorials/transforming-data.md 9ms +packages/gatsby-source-wordpress/docs/tutorials/using-advanced-custom-fields.md 10ms +packages/gatsby-source-wordpress/docs/tutorials/using-self-signed-certificates.md 1ms +packages/gatsby-source-wordpress/docs/tutorials/using-wordpress-menus.md 16ms +packages/gatsby-source-wordpress/docs/usage-with-popular-wp-graphql-extensions.md 3ms +packages/gatsby-source-wordpress/docs/why-use-this-plugin.md 7ms +packages/gatsby-source-wordpress/README.md 3ms +packages/gatsby-source-wordpress/src/steps/preview/preview.md 19ms +packages/gatsby-telemetry/CHANGELOG.md 63ms +packages/gatsby-telemetry/README.md 3ms +packages/gatsby-transformer-asciidoc/CHANGELOG.md 33ms +packages/gatsby-transformer-asciidoc/README.md 11ms +packages/gatsby-transformer-csv/CHANGELOG.md 35ms +packages/gatsby-transformer-csv/README.md 15ms +packages/gatsby-transformer-documentationjs/CHANGELOG.md 40ms +packages/gatsby-transformer-documentationjs/README.md 3ms +packages/gatsby-transformer-excel/CHANGELOG.md 38ms +packages/gatsby-transformer-excel/README.md 9ms +packages/gatsby-transformer-hjson/CHANGELOG.md 35ms +packages/gatsby-transformer-hjson/README.md 8ms +packages/gatsby-transformer-javascript-frontmatter/CHANGELOG.md 37ms +packages/gatsby-transformer-javascript-frontmatter/README.md 9ms +packages/gatsby-transformer-javascript-static-exports/CHANGELOG.md 33ms +packages/gatsby-transformer-javascript-static-exports/README.md 6ms +packages/gatsby-transformer-json/CHANGELOG.md 37ms +packages/gatsby-transformer-json/README.md 15ms +packages/gatsby-transformer-pdf/CHANGELOG.md 33ms +packages/gatsby-transformer-pdf/README.md 3ms +packages/gatsby-transformer-react-docgen/CHANGELOG.md 64ms +packages/gatsby-transformer-react-docgen/README.md 10ms +packages/gatsby-transformer-remark/CHANGELOG.md 103ms +packages/gatsby-transformer-remark/README.md 20ms +packages/gatsby-transformer-screenshot/CHANGELOG.md 61ms +packages/gatsby-transformer-screenshot/lambda/README.md 2ms +packages/gatsby-transformer-screenshot/README.md 8ms +packages/gatsby-transformer-sharp/CHANGELOG.md 74ms +packages/gatsby-transformer-sharp/README.md 9ms +packages/gatsby-transformer-sqip/CHANGELOG.md 71ms +packages/gatsby-transformer-sqip/README.md 12ms +packages/gatsby-transformer-toml/CHANGELOG.md 32ms +packages/gatsby-transformer-toml/README.md 4ms +packages/gatsby-transformer-xml/CHANGELOG.md 32ms +packages/gatsby-transformer-xml/README.md 5ms +packages/gatsby-transformer-yaml/CHANGELOG.md 33ms +packages/gatsby-transformer-yaml/README.md 15ms +packages/gatsby-worker/CHANGELOG.md 21ms +packages/gatsby-worker/README.md 20ms +packages/gatsby/cache-dir/blank.css 1ms +packages/gatsby/CHANGELOG.md 963ms +packages/gatsby/README.md 16ms +packages/gatsby/src/datastore/lmdb/query/README.md 31ms +peril/README.md 6ms +README.md 15ms +scripts/create-release-notes.template.md 2ms +scripts/gatsby-changelog-generator/README.md 5ms +SECURITY.md 2ms +starters/blog/content/blog/hello-world/index.md 9ms +starters/blog/content/blog/my-second-post/index.md 2ms +starters/blog/content/blog/new-beginnings/index.md 15ms +starters/blog/README.md 11ms +starters/blog/src/normalize.css 4ms +starters/blog/src/style.css 10ms +starters/default/README.md 12ms +starters/default/src/components/index.module.css 2ms +starters/default/src/components/layout.css 5ms +starters/gatsby-starter-minimal-ts/README.md 2ms +starters/gatsby-starter-minimal/README.md 3ms +starters/gatsby-starter-plugin/README.md 15ms +starters/gatsby-starter-theme-workspace/example/README.md 1ms +starters/gatsby-starter-theme-workspace/gatsby-theme-minimal/README.md 3ms +starters/gatsby-starter-theme-workspace/README.md 4ms +starters/gatsby-starter-wordpress-blog/README.md 13ms +starters/gatsby-starter-wordpress-blog/src/normalize.css 6ms +starters/gatsby-starter-wordpress-blog/src/style.css 13ms +starters/hello-world/README.md 12ms +starters/README-template.md 14ms +starters/README.md 8ms +types/gatsby-monorepo/readme.md 1ms +^[[B +> lint +> npm-run-all --continue-on-error -p lint:code lint:other --fix + +ERROR: Invalid Option:  + + + diff --git a/npm b/npm new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/package.json b/package.json index de50e89781a0f..077deb722a88d 100644 --- a/package.json +++ b/package.json @@ -131,4 +131,4 @@ "resolutions": { "@babel/plugin-transform-modules-commonjs": "7.18.6" } -} +} \ No newline at end of file diff --git a/packages/gatsby-plugin-manifest/src/gatsby-node.js b/packages/gatsby-plugin-manifest/src/gatsby-node.js index 7230197641c03..e68594ba9b307 100644 --- a/packages/gatsby-plugin-manifest/src/gatsby-node.js +++ b/packages/gatsby-plugin-manifest/src/gatsby-node.js @@ -1,27 +1,19 @@ -import * as fs from "fs" -import * as path from "path" -// TODO(v5): use gatsby/sharp -import getSharpInstance from "./safe-sharp" -import { createContentDigest, slash } from "gatsby-core-utils" -import { defaultIcons, addDigestToPath, favicons } from "./common" -import { doesIconExist } from "./node-helpers" +const fs = require(`fs`) +const path = require(`path`) +const getSharpInstance = require(`./safe-sharp`) +const { createContentDigest, slash } = require(`gatsby-core-utils`) +const { defaultIcons, addDigestToPath, favicons } = require(`./common`) +const { doesIconExist } = require(`./node-helpers`) -import pluginOptionsSchema from "./pluginOptionsSchema" +const pluginOptionsSchema = require(`./pluginOptionsSchema`) async function generateIcon(icon, srcIcon) { const imgPath = path.join(`public`, icon.src) - // console.log(`generating icon: `, icon.src) - // if (fs.existsSync(imgPath)) { - // console.log(`icon already Exists, not regenerating`) - // return true - // } - const size = parseInt(icon.sizes.substring(0, icon.sizes.lastIndexOf(`x`))) - - // For vector graphics, instruct sharp to use a pixel density - // suitable for the resolution we're rasterizing to. - // For pixel graphics sources this has no effect. - // Sharp accept density from 1 to 2400 + const size = parseInt( + icon.sizes.substring(0, icon.sizes.lastIndexOf(`x`)), + 10 + ) const density = Math.min(2400, Math.max(1, size)) const sharp = await getSharpInstance() @@ -38,7 +30,7 @@ async function generateIcon(icon, srcIcon) { async function checkCache(cache, icon, srcIcon, srcIconDigest, callback) { const cacheKey = createContentDigest(`${icon.src}${srcIcon}${srcIconDigest}`) - const created = cache.get(cacheKey, srcIcon) + const created = cache.get(cacheKey) if (!created) { cache.set(cacheKey, true) @@ -53,26 +45,26 @@ async function checkCache(cache, icon, srcIcon, srcIconDigest, callback) { exports.pluginOptionsSchema = pluginOptionsSchema -/** - * Setup pluginOption defaults - * TODO: Remove once pluginOptionsSchema is stable - */ exports.onPreInit = (_, pluginOptions) => { - pluginOptions.cache_busting_mode = pluginOptions.cache_busting_mode ?? `query` - pluginOptions.include_favicon = pluginOptions.include_favicon ?? true - pluginOptions.legacy = pluginOptions.legacy ?? true - pluginOptions.theme_color_in_head = pluginOptions.theme_color_in_head ?? true - pluginOptions.cacheDigest = null - - if (pluginOptions.cache_busting_mode !== `none` && pluginOptions.icon) { - pluginOptions.cacheDigest = createContentDigest( - fs.readFileSync(pluginOptions.icon) - ) + const defaultOptions = { + cache_busting_mode: `query`, + include_favicon: true, + legacy: true, + theme_color_in_head: true, + cacheDigest: null, } + + const options = { ...defaultOptions, ...pluginOptions } + + if (options.cache_busting_mode !== `none` && options.icon) { + options.cacheDigest = createContentDigest(fs.readFileSync(options.icon)) + } + + Object.assign(pluginOptions, options) } exports.onPostBootstrap = async ( - { reporter, parentSpan, basePath }, + { reporter, parentSpan, basePath, assetPrefix, pathPrefix }, { localize, ...manifest } ) => { const activity = reporter.activityTimer(`Build manifest and related icons`, { @@ -83,59 +75,105 @@ exports.onPostBootstrap = async ( const cache = new Map() - await makeManifest({ cache, reporter, pluginOptions: manifest, basePath }) + const validatePrefix = (prefix, name) => { + if (typeof prefix !== `string`) { + return `` + } + if (!prefix.trim().startsWith(`/`)) { + reporter.warn(`${name} should start with '/'`) + } + return prefix.trim() + } + + const validateOptions = options => { + if (!options || typeof options !== `object` || !options.icon) { + throw new Error( + `pluginOptions must be an object and include an "icon" property` + ) + } + } + + const createManifestArgs = ({ + cache, + reporter, + manifest, + basePath, + assetPrefix, + pathPrefix, + }) => { + validateOptions(manifest) + return { + cache, + reporter, + pluginOptions: manifest, + basePath, + assetPrefix: validatePrefix(assetPrefix, `assetPrefix`), + pathPrefix: validatePrefix(pathPrefix, `pathPrefix`), + } + } + + try { + await makeManifest( + createManifestArgs({ + cache, + reporter, + manifest, + basePath, + assetPrefix, + pathPrefix, + }) + ) + } catch (error) { + reporter.panic(`Error in onPostBootstrap: `, error) + } if (Array.isArray(localize)) { const locales = [...localize] await Promise.all( - locales.map(locale => { + locales.map(async locale => { let cacheModeOverride = {} - /* localization requires unique filenames for output files if a different src Icon is defined. - otherwise one language would override anothers icons in automatic mode. - */ - if (locale.hasOwnProperty(`icon`) && !locale.hasOwnProperty(`icons`)) { - // console.debug(`OVERRIDING CACHE BUSTING`, locale) + if (locale.icon && !locale.icons) { cacheModeOverride = { cache_busting_mode: `name` } } - return makeManifest({ - cache, - reporter, - pluginOptions: { - ...manifest, - ...locale, - ...cacheModeOverride, - }, - shouldLocalize: true, - basePath, - }) + const localizedManifest = { + ...manifest, + ...locale, + ...cacheModeOverride, + } + + const validatedAssetPrefix = validatePrefix(assetPrefix, `assetPrefix`) + const validatedPathPrefix = validatePrefix(pathPrefix, `pathPrefix`) + + try { + await makeManifest({ + cache, + reporter, + pluginOptions: localizedManifest, + shouldLocalize: true, + basePath, + assetPrefix: validatedAssetPrefix, + pathPrefix: validatedPathPrefix, + }) + } catch (error) { + reporter.panic(`Error in onPostBootstrap (localized): `, error) + } }) ) } + activity.end() } -/** - * The complete Triforce, or one or more components of the Triforce. - * @typedef {Object} makeManifestArgs - * @property {Object} cache - from gatsby-node api - * @property {Object} reporter - from gatsby-node api - * @property {Object} pluginOptions - from gatsby-node api/gatsby config - * @property {boolean?} shouldLocalize - * @property {string?} basePath - string of base path frpvided by gatsby node - */ - -/** - * Build manifest - * @param {makeManifestArgs} - */ const makeManifest = async ({ cache, reporter, pluginOptions, shouldLocalize = false, basePath = ``, + assetPrefix = ``, + pathPrefix = ``, }) => { const { icon, ...manifest } = pluginOptions const suffix = @@ -143,7 +181,6 @@ const makeManifest = async ({ const faviconIsEnabled = pluginOptions.include_favicon ?? true - // Delete options we won't pass to the manifest.webmanifest. delete manifest.plugins delete manifest.legacy delete manifest.theme_color_in_head @@ -153,12 +190,10 @@ const makeManifest = async ({ delete manifest.include_favicon delete manifest.cacheDigest - // If icons are not manually defined, use the default icon set. if (!manifest.icons) { manifest.icons = [...defaultIcons] } - // Specify extra options for each icon (if requested). if (pluginOptions.icon_options) { manifest.icons = manifest.icons.map(icon => { return { @@ -167,24 +202,29 @@ const makeManifest = async ({ } }) } + const iconPaths = manifest.icons.map(icon => { + return { + dir: path.resolve(`public`, path.dirname(icon.src)), + src: icon.src, + } + }) - // Determine destination path for icons. - const paths = {} - manifest.icons.forEach(icon => { - const iconPath = path.join(`public`, path.dirname(icon.src)) - if (!paths[iconPath]) { - const exists = fs.existsSync(iconPath) - // create destination directory if it doesn't exist - if (!exists) { - fs.mkdirSync(iconPath, { recursive: true }) - } - paths[iconPath] = true + const uniqueIconDirs = Array.from(new Set(iconPaths.map(icon => icon.dir))) + + const createDirectory = dir => { + fs.mkdirSync(dir, { recursive: true }) + } + + uniqueIconDirs.forEach(dir => { + try { + createDirectory(dir) + } catch (error) { + reporter.error(`Failed to create directory at ${dir}: ${error.message}`) + throw error } }) - // Only auto-generate icons if a src icon is defined. if (typeof icon !== `undefined`) { - // Check if the icon exists if (!doesIconExist(icon)) { throw new Error( `icon (${icon}) does not exist as defined in gatsby-config.js. Make sure the file exists relative to the root of the site.` @@ -203,7 +243,6 @@ const makeManifest = async ({ ) } - // add cache busting const cacheMode = typeof pluginOptions.cache_busting_mode !== `undefined` ? pluginOptions.cache_busting_mode @@ -211,12 +250,7 @@ const makeManifest = async ({ const iconDigest = createContentDigest(fs.readFileSync(icon)) - /** - * Given an array of icon configs, generate the various output sizes from - * the source icon image. - */ - async function processIconSet(iconSet) { - // if cacheBusting is being done via url query icons must be generated before cache busting runs + const processIconSet = async iconSet => { if (cacheMode === `query`) { for (const dstIcon of iconSet) { await checkCache(cache, dstIcon, icon, iconDigest, generateIcon) @@ -231,7 +265,6 @@ const makeManifest = async ({ }) } - // if file names are being modified by cacheBusting icons must be generated after cache busting runs if (cacheMode !== `query`) { for (const dstIcon of iconSet) { await checkCache(cache, dstIcon, icon, iconDigest, generateIcon) @@ -243,8 +276,6 @@ const makeManifest = async ({ manifest.icons = await processIconSet(manifest.icons) - // If favicon is enabled, apply the same caching policy and generate - // the resized image(s) if (faviconIsEnabled) { await processIconSet(favicons) @@ -254,31 +285,92 @@ const makeManifest = async ({ } } - // Fix #18497 by prefixing paths - manifest.icons = manifest.icons.map(icon => { - return { - ...icon, - src: slash(path.join(basePath, icon.src)), - } - }) + const prefixPath = src => + slash([assetPrefix, pathPrefix, basePath, src].filter(Boolean).join(`/`)) + + manifest.icons = Array.isArray(manifest.icons) + ? manifest.icons.reduce((valid, icon) => { + if (icon?.src) { + valid.push({ ...icon, src: prefixPath(icon.src) }) + } else { + reporter.warn(`Skipping invalid icon:`, icon) + } + return valid + }, []) + : [] + if (manifest.icons.length > 0) { + const iconCount = manifest.icons.length + const iconWord = iconCount === 1 ? `icon` : `icons` + reporter.info(`Processed ${iconCount} ${iconWord}.`) + } else { + reporter.warn(`No valid icons found in manifest.`) + } if (manifest.start_url) { - manifest.start_url = path.posix.join(basePath, manifest.start_url) + manifest.start_url = slash( + [assetPrefix, pathPrefix, basePath, manifest.start_url] + .filter(Boolean) + .join(`/`) + ) + } else { + reporter.warn(`manifest.start_url is not defined`) } - // Write manifest - fs.writeFileSync( - path.join(`public`, `manifest${suffix}.webmanifest`), - JSON.stringify(manifest) - ) + const manifestPath = path.join(`public`, `manifest${suffix}.webmanifest`) + + const writeManifest = async () => { + try { + await fs.promises.mkdir(path.dirname(manifestPath), { recursive: true }) + + const optimizedManifest = JSON.stringify(manifest) + await fs.promises.writeFile(manifestPath, optimizedManifest, `utf8`) + + reporter.success(`Manifest written to ${manifestPath}`) + + const criticalFields = [ + `name`, + `short_name`, + `start_url`, + `display`, + `background_color`, + `theme_color`, + ] + const missingFields = criticalFields.filter(field => !manifest[field]) + + if (missingFields.length) { + reporter.warn( + `Missing critical fields in manifest: ${missingFields.join(`, `)}` + ) + } + + if (!manifest.icons || manifest.icons.length === 0) { + reporter.warn(`No icons defined in manifest.`) + } else { + const iconSizes = manifest.icons.map(icon => parseInt(icon.sizes)) + if (!iconSizes.includes(192) || !iconSizes.includes(512)) { + reporter.warn( + `Manifest should include at least 192x192 and 512x512 icons` + ) + } + } + } catch (error) { + reporter.panicOnBuild(`Failed to write manifest: ${error.message}`) + } + } + + await writeManifest() } -exports.onCreateWebpackConfig = ({ actions, plugins }, pluginOptions) => { +const { DefinePlugin } = require(`webpack`) + +exports.onCreateWebpackConfig = ({ actions }, pluginOptions) => { + const hasLocalization = Boolean( + pluginOptions.localize && pluginOptions.localize.length + ) actions.setWebpackConfig({ plugins: [ - plugins.define({ - __MANIFEST_PLUGIN_HAS_LOCALISATION__: - pluginOptions.localize && pluginOptions.localize.length, + new DefinePlugin({ + __MANIFEST_PLUGIN_HAS_LOCALIZATION__: JSON.stringify(hasLocalization), }), ], }) diff --git a/packages/gatsby-plugin-offline/src/gatsby-browser.js b/packages/gatsby-plugin-offline/src/gatsby-browser.js index 8285b08d6bcb2..a74e3aaf3ba94 100644 --- a/packages/gatsby-plugin-offline/src/gatsby-browser.js +++ b/packages/gatsby-plugin-offline/src/gatsby-browser.js @@ -107,3 +107,14 @@ exports.onRouteUpdate = ({ location, getResourceURLsForPathname }) => { exports.onPostPrefetchPathname = ({ pathname, getResourceURLsForPathname }) => { setPathResources(pathname, getResourceURLsForPathname) } + +export const onServiceWorkerUpdateReady = () => { + const answer = window.confirm( + `This application has been updated. ` + + `Reload to display the latest version?` + ) + + if (answer === true) { + window.location.reload() + } +} diff --git a/packages/gatsby-plugin-offline/src/gatsby-node.js b/packages/gatsby-plugin-offline/src/gatsby-node.js index a392d03412f0d..4c959e6c47743 100644 --- a/packages/gatsby-plugin-offline/src/gatsby-node.js +++ b/packages/gatsby-plugin-offline/src/gatsby-node.js @@ -1,13 +1,11 @@ -// use `let` to workaround https://github.com/jhnns/rewire/issues/144 -/* eslint-disable prefer-const */ -let fs = require(`fs`) -let workboxBuild = require(`workbox-build`) +const fs = require(`fs`) +const workboxBuild = require(`workbox-build`) const path = require(`path`) const { slash } = require(`gatsby-core-utils`) const glob = require(`glob`) const _ = require(`lodash`) -let getResourcesFromHTML = require(`./get-resources-from-html`) +const getResourcesFromHTML = require(`./get-resources-from-html`) exports.onPreBootstrap = ({ cache }) => { const appShellSourcePath = path.join(__dirname, `app-shell.js`) @@ -220,49 +218,3 @@ exports.onPostBuild = ( ) }) } - -const MATCH_ALL_KEYS = /^/ -exports.pluginOptionsSchema = function ({ Joi }) { - // These are the options of the v3: https://www.gatsbyjs.com/plugins/gatsby-plugin-offline/#available-options - return Joi.object({ - precachePages: Joi.array() - .items(Joi.string()) - .description( - `An array of pages whose resources should be precached by the service worker, using an array of globs` - ), - appendScript: Joi.string().description( - `A file (path) to be appended at the end of the generated service worker` - ), - debug: Joi.boolean().description( - `Specifies whether Workbox should show debugging output in the browser console at runtime. When undefined, defaults to showing debug messages on localhost only` - ), - workboxConfig: Joi.object({ - importWorkboxFrom: Joi.string(), - globDirectory: Joi.string(), - globPatterns: Joi.array().items(Joi.string()), - modifyURLPrefix: Joi.object().pattern(MATCH_ALL_KEYS, Joi.string()), - cacheId: Joi.string(), - dontCacheBustURLsMatching: Joi.object().instance(RegExp), - maximumFileSizeToCacheInBytes: Joi.number(), - runtimeCaching: Joi.array().items( - Joi.object({ - urlPattern: Joi.object().instance(RegExp), - handler: Joi.string().valid( - `StaleWhileRevalidate`, - `CacheFirst`, - `NetworkFirst`, - `NetworkOnly`, - `CacheOnly` - ), - options: Joi.object({ - networkTimeoutSeconds: Joi.number(), - }), - }) - ), - skipWaiting: Joi.boolean(), - clientsClaim: Joi.boolean(), - }) - .description(`Overrides workbox configuration. Helpful documentation: https://www.gatsbyjs.com/plugins/gatsby-plugin-offline/#overriding-workbox-configuration - `), - }) -} diff --git a/yarnrun b/yarnrun new file mode 100644 index 0000000000000..e69de29bb2d1d