diff --git a/integration-tests/plugin-fastify/.gitignore b/integration-tests/plugin-fastify/.gitignore deleted file mode 100644 index 9adea5029..000000000 --- a/integration-tests/plugin-fastify/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -node_modules/ -.cache/ -public - - -.env* \ No newline at end of file diff --git a/integration-tests/plugin-fastify/CHANGELOG.md b/integration-tests/plugin-fastify/CHANGELOG.md deleted file mode 100644 index 5d3deb29e..000000000 --- a/integration-tests/plugin-fastify/CHANGELOG.md +++ /dev/null @@ -1,151 +0,0 @@ -# test-fastify-gatsby - -## 1.0.19 - -### Patch Changes - -- [#467](https://github.com/gatsby-uc/plugins/pull/467) [`e7f1d20`](https://github.com/gatsby-uc/plugins/commit/e7f1d20bb7c91e6b5890c1c7655fcc77afbd39f8) Thanks [@renovate](https://github.com/apps/renovate)! - chore(integration-tests): update integration tests - -- Updated dependencies [[`4759545`](https://github.com/gatsby-uc/plugins/commit/475954526a982c149696255f7ddfb3dba60e17b5), [`3ff08a8`](https://github.com/gatsby-uc/plugins/commit/3ff08a8bcd712a9728a009e42e48a092251a1b01), [`2579b64`](https://github.com/gatsby-uc/plugins/commit/2579b64b1bbf62df71fd3717486c600161f8b307), [`67b7397`](https://github.com/gatsby-uc/plugins/commit/67b73976f7606fed7653e26150d4a7bab092935f), [`3731300`](https://github.com/gatsby-uc/plugins/commit/3731300946af4aeed7caf052cea62886941f8c82)]: - - gatsby-plugin-fastify@0.13.4 - -## 1.0.18 - -### Patch Changes - -- [#462](https://github.com/gatsby-uc/plugins/pull/462) [`a4e6768`](https://github.com/gatsby-uc/plugins/commit/a4e6768b601581df831fc8e446b9ef7e464bfebf) Thanks [@renovate](https://github.com/apps/renovate)! - chore(integration-tests): update dependency @babel/core to ^7.23.7 - -- Updated dependencies [[`c43c4d8`](https://github.com/gatsby-uc/plugins/commit/c43c4d86a4d787415b7efd830b9b1620ae4df989), [`f334dd4`](https://github.com/gatsby-uc/plugins/commit/f334dd4a79868cef3dc03534baa27e95e36760c8)]: - - gatsby-plugin-fastify@0.13.3 - -## 1.0.17 - -### Patch Changes - -- [#461](https://github.com/gatsby-uc/plugins/pull/461) [`caf7d4f`](https://github.com/gatsby-uc/plugins/commit/caf7d4feb52b9ca062b0d78883659d62e86243f4) Thanks [@moonmeister](https://github.com/moonmeister)! - Updated can-i-use database - -- [#461](https://github.com/gatsby-uc/plugins/pull/461) [`caf7d4f`](https://github.com/gatsby-uc/plugins/commit/caf7d4feb52b9ca062b0d78883659d62e86243f4) Thanks [@moonmeister](https://github.com/moonmeister)! - - Updated testing and runners to latest Node 20 LTS. - - Updated to latests Yarn v4 and corepack for management of packageManager. Please run `corepack enable` to use the correct version of `yarn`. - - Updated dependencies. - - Updated prettier and associated formatting. - - Update TypeScript versions used to latest. -- Updated dependencies [[`caf7d4f`](https://github.com/gatsby-uc/plugins/commit/caf7d4feb52b9ca062b0d78883659d62e86243f4), [`caf7d4f`](https://github.com/gatsby-uc/plugins/commit/caf7d4feb52b9ca062b0d78883659d62e86243f4), [`b7b48b7`](https://github.com/gatsby-uc/plugins/commit/b7b48b781885a7b0378bb44f18ee18b0733a3981), [`6a313dc`](https://github.com/gatsby-uc/plugins/commit/6a313dca5b1f7f71a2a7ef8c19aef7e72e5f7445), [`caf7d4f`](https://github.com/gatsby-uc/plugins/commit/caf7d4feb52b9ca062b0d78883659d62e86243f4)]: - - gatsby-plugin-fastify@0.13.2 - -## 1.0.16 - -### Patch Changes - -- [#415](https://github.com/gatsby-uc/plugins/pull/415) [`f176155`](https://github.com/gatsby-uc/plugins/commit/f176155ca410ffe9bca73ce2472d62f90758de9d) Thanks [@renovate](https://github.com/apps/renovate)! - chore(integration-tests): update integration tests - -- Updated dependencies [[`04a77c7`](https://github.com/gatsby-uc/plugins/commit/04a77c7697eff0e4955096e9c2b58241d5eb8e75), [`c6b3c08`](https://github.com/gatsby-uc/plugins/commit/c6b3c084c542b24ed0e953005f394fdb62396465), [`23f9fba`](https://github.com/gatsby-uc/plugins/commit/23f9fba42e854a86874545c4fce2be2858133c5f), [`badae40`](https://github.com/gatsby-uc/plugins/commit/badae403b130fd3bdf8d706c540d14de884c8490)]: - - gatsby-plugin-fastify@0.13.0 - -## 1.0.15 - -### Patch Changes - -- [#379](https://github.com/gatsby-uc/plugins/pull/379) [`e0c9ee3`](https://github.com/gatsby-uc/plugins/commit/e0c9ee3b591bd87a407de9580d9e3ba5fd0eac62) Thanks [@renovate](https://github.com/apps/renovate)! - chore(integration-tests): update integration tests - -- Updated dependencies [[`d578b78`](https://github.com/gatsby-uc/plugins/commit/d578b7896f804716a4c2222385c19be11c27bdf4), [`9da9a23`](https://github.com/gatsby-uc/plugins/commit/9da9a23a13343ca52cf32aa98105cb2f597a2f07), [`07bbfa7`](https://github.com/gatsby-uc/plugins/commit/07bbfa7c434b8543a7d15c5f2e87ac48705aa593)]: - - gatsby-plugin-fastify@0.12.4 - -## 1.0.14 - -### Patch Changes - -- [#311](https://github.com/gatsby-uc/plugins/pull/311) [`b7df7b2`](https://github.com/gatsby-uc/plugins/commit/b7df7b2a2ae97f55cb0025bdb12b5b52e4e7bcd3) Thanks [@renovate](https://github.com/apps/renovate)! - chore(integration-tests): update integration tests - -- Updated dependencies [[`8fd9b57`](https://github.com/gatsby-uc/plugins/commit/8fd9b577189c98ddbacc0afb37a3cf3d756ea199), [`3c854d0`](https://github.com/gatsby-uc/plugins/commit/3c854d0fd7c4bb81c894a08d6dca0ca2c18f7025), [`60fecbc`](https://github.com/gatsby-uc/plugins/commit/60fecbc600ce57bf82887a78f4e4d9a430b35f00)]: - - gatsby-plugin-fastify@0.11.1 - -## 1.0.13 - -### Patch Changes - -- Updated dependencies [[`4c1365d`](https://github.com/gatsby-uc/plugins/commit/4c1365d639ecb1f0409d72db4e15593706d82639)]: - - gatsby-plugin-fastify@0.7.4 - -## 1.0.12 - -### Patch Changes - -- Updated dependencies [[`a3c5e55`](https://github.com/gatsby-uc/plugins/commit/a3c5e55542ad0b3dd97afcc04d686a00d44bdbe3), [`1d9f473`](https://github.com/gatsby-uc/plugins/commit/1d9f4732872028be5cd8e77e7af15c478d392311)]: - - gatsby-plugin-fastify@0.7.3 - -## 1.0.11 - -### Patch Changes - -- Updated dependencies [[`5d1f1bf`](https://github.com/gatsby-uc/plugins/commit/5d1f1bf7989c119540760dc40ae7bc4dcf822836)]: - - gatsby-plugin-fastify@0.7.2 - -## 1.0.10 - -### Patch Changes - -- Updated dependencies [[`331bf7d`](https://github.com/gatsby-uc/plugins/commit/331bf7d2464701f8dab39c8e680efa3c996f056b)]: - - gatsby-plugin-fastify@0.7.1 - -## 1.0.9 - -### Patch Changes - -- Updated dependencies [[`e93dc62`](https://github.com/gatsby-uc/plugins/commit/e93dc62044ce2ac2069d80c339247901b4416ece), [`e93dc62`](https://github.com/gatsby-uc/plugins/commit/e93dc62044ce2ac2069d80c339247901b4416ece), [`acbf356`](https://github.com/gatsby-uc/plugins/commit/acbf356b305eff55f4ef96c77fbb47b2360319da)]: - - gatsby-plugin-fastify@0.7.0 - -## 1.0.8 - -### Patch Changes - -- Updated dependencies [[`529590e`](https://github.com/gatsby-uc/plugins/commit/529590eb9e83ec4188ad9ef23eca9c9d14fb8729)]: - - gatsby-plugin-fastify@0.6.1 - -## 1.0.7 - -### Patch Changes - -- Updated dependencies [[`e736248`](https://github.com/gatsby-uc/plugins/commit/e736248513e6bdbeb29cbedd06b79ed40ac0294f), [`e736248`](https://github.com/gatsby-uc/plugins/commit/e736248513e6bdbeb29cbedd06b79ed40ac0294f), [`e736248`](https://github.com/gatsby-uc/plugins/commit/e736248513e6bdbeb29cbedd06b79ed40ac0294f), [`e736248`](https://github.com/gatsby-uc/plugins/commit/e736248513e6bdbeb29cbedd06b79ed40ac0294f), [`e736248`](https://github.com/gatsby-uc/plugins/commit/e736248513e6bdbeb29cbedd06b79ed40ac0294f)]: - - gatsby-plugin-fastify@0.6.0 - -## 1.0.6 - -### Patch Changes - -- Updated dependencies [[`fec2c31`](https://github.com/gatsby-uc/plugins/commit/fec2c31d1d64a51d6b99297ff0c1345ec2f4bad3), [`09bb2c2`](https://github.com/gatsby-uc/plugins/commit/09bb2c272f7127a732e1ad54d2b8fb38db054523)]: - - gatsby-plugin-fastify@0.5.0 - -## 1.0.5 - -### Patch Changes - -- Updated dependencies [[`7007934`](https://github.com/gatsby-uc/plugins/commit/700793427bf754a8449717179d51dabe76096d81)]: - - gatsby-plugin-fastify@0.4.5 - -## 1.0.4 - -### Patch Changes - -- Updated dependencies [[`5529aad`](https://github.com/gatsby-uc/plugins/commit/5529aadf0f65c4b0c193131d606c3ce7d8d06651)]: - - gatsby-plugin-fastify@0.4.4 - -## 1.0.3 - -### Patch Changes - -- Updated dependencies [[`eb12e74`](https://github.com/gatsby-uc/plugins/commit/eb12e74e05268ee7778f00711772749cd7d8ab6c), [`80aa8f3`](https://github.com/gatsby-uc/plugins/commit/80aa8f39c79bed433b47dad39810767710d0bdd2)]: - - gatsby-plugin-fastify@0.4.3 - -## 1.0.2 - -### Patch Changes - -- Updated dependencies [[`30f7ac4`](https://github.com/gatsby-uc/plugins/commit/30f7ac4bb5c39374b79ed900b3aab60f9c44774a)]: - - gatsby-plugin-fastify@0.4.2 - -## 1.0.1 - -### Patch Changes - -- Updated dependencies [[`79a49d6`](https://github.com/gatsby-uc/plugins/commit/79a49d63ef6fbb9ad997545e9e692f16b9e04ec3)]: - - gatsby-plugin-fastify@0.4.1 diff --git a/integration-tests/plugin-fastify/README.md b/integration-tests/plugin-fastify/README.md deleted file mode 100644 index 2f8181922..000000000 --- a/integration-tests/plugin-fastify/README.md +++ /dev/null @@ -1,54 +0,0 @@ -

- - Gatsby - -

-

- Gatsby minimal starter -

- -## πŸš€ Quick start - -1. **Create a Gatsby site.** - - Use the Gatsby CLI to create a new site, specifying the minimal starter. - - ```shell - # create a new Gatsby site using the minimal starter - npm init gatsby - ``` - -2. **Start developing.** - - Navigate into your new site’s directory and start it up. - - ```shell - cd my-gatsby-site/ - npm run develop - ``` - -3. **Open the code and start customizing!** - - Your site is now running at http://localhost:8000! - - Edit `src/pages/index.js` to see your site update in real-time! - -4. **Learn more** - - - [Documentation](https://www.gatsbyjs.com/docs/?utm_source=starter&utm_medium=readme&utm_campaign=minimal-starter) - - - [Tutorials](https://www.gatsbyjs.com/tutorial/?utm_source=starter&utm_medium=readme&utm_campaign=minimal-starter) - - - [Guides](https://www.gatsbyjs.com/tutorial/?utm_source=starter&utm_medium=readme&utm_campaign=minimal-starter) - - - [API Reference](https://www.gatsbyjs.com/docs/api-reference/?utm_source=starter&utm_medium=readme&utm_campaign=minimal-starter) - - - [Plugin Library](https://www.gatsbyjs.com/plugins?utm_source=starter&utm_medium=readme&utm_campaign=minimal-starter) - - - [Cheat Sheet](https://www.gatsbyjs.com/docs/cheat-sheet/?utm_source=starter&utm_medium=readme&utm_campaign=minimal-starter) - -## πŸš€ Quick start (Gatsby Cloud) - -Deploy this starter with one click on [Gatsby Cloud](https://www.gatsbyjs.com/cloud/): - -[Deploy to Gatsby Cloud](https://www.gatsbyjs.com/dashboard/deploynow?url=https://github.com/gatsbyjs/gatsby-starter-minimal) diff --git a/integration-tests/plugin-fastify/benchmark.js b/integration-tests/plugin-fastify/benchmark.js deleted file mode 100644 index c525df798..000000000 --- a/integration-tests/plugin-fastify/benchmark.js +++ /dev/null @@ -1,229 +0,0 @@ -const Benchmark = require("benchmark"); -const { - getServerConfig, - setConfig, - ConfigKeyEnum, - getConfig, -} = require("gatsby-plugin-fastify/utils/config"); -const { serveGatsby } = require("gatsby-plugin-fastify/plugins/gatsby"); -const Fastify = require("fastify"); - -Benchmark.options.minSamples = 500; -const suite = Benchmark.Suite(); - -function createCliConfig({ host, port, logLevel, open }) { - return { - host, - h: host, - port, - p: port, - logLevel, - l: logLevel, - open, - o: open, - }; -} - -setConfig( - ConfigKeyEnum.CLI, - createCliConfig({ - port: 3001, - host: "127.0.0.1", - logLevel: "fatal", - open: false, - }), -); - -const serverConfig = getServerConfig(); -setConfig(ConfigKeyEnum.SERVER, serverConfig); - -function expectResp(def, path, code = 200) { - return (res) => { - if (res.statusCode !== code) { - console.log(`Expected status code ${code}, got ${res.statusCode} from ${path}`); - process.exit(1); - } - def.resolve(); - }; -} - -(async () => { - const { - cli: { logLevel }, - } = getConfig(); - const server = Fastify({ - ignoreTrailingSlash: true, - logger: { - level: logLevel, - transport: { - target: "pino-pretty", - options: { - translateTime: "HH:MM:ss Z", - ignore: "pid,hostname", - }, - }, - }, - disableRequestLogging: ["trace", "debug"].includes(logLevel) ? false : true, - }); - - await server.register(serveGatsby, { prefix: "" }); - - console.log("server is ready"); - - suite - .add("Serve SSG HTML file from root", { - defer: true, - fn: (def) => { - server - .inject({ - method: "GET", - url: "/", - }) - .then(expectResp(def, "/")); - }, - }) - .add("Serve SSG HTML from path", { - defer: true, - fn: (def) => { - server - .inject({ - method: "GET", - url: "/posts/page-1/", - timeout: 10000, - }) - .then(expectResp(def, "/posts/page-1/")); - }, - }) - .add("Serve SSG `page-data.json` from path", { - defer: true, - fn: (def) => { - server - .inject({ - method: "GET", - url: "/page-data/posts/page-1/page-data.json", - }) - .then(expectResp(def, "/page-data/posts/page-1/page-data.json")); - }, - }) - .add("Serve CSR", { - defer: true, - fn: (def) => { - server - .inject({ - method: "GET", - url: "/app/", - }) - .then(expectResp(def, "/app")); - }, - }) - .add("Serve SSR HTML", { - defer: true, - fn: (def) => { - server - .inject({ - method: "GET", - url: "/ssr", - hostname: "localhost:3001", - }) - .then(expectResp(def, "/ssr")); - }, - }) - .add("Serve DSG HTML", { - defer: true, - fn: (def) => { - server - .inject({ - method: "GET", - url: "/generated/page-6", - }) - .then(expectResp(def, "/generated/page-6")); - }, - }) - .add("Serve DSG/SSR page-data.json", { - defer: true, - fn: (def) => { - server - .inject({ - method: "GET", - url: "/page-data/generated/page-6/page-data.json", - }) - .then(expectResp(def, "/page-data/generated/page-6/page-data.json")); - }, - }) - .add("Serve 404", { - defer: true, - fn: (def) => { - server - .inject({ - method: "GET", - url: "/nonExistentRoute", - }) - .then(expectResp(def, "/nonExistentRoute", 404)); - }, - }) - .add("Serve 500", { - defer: true, - fn: (def) => { - server - .inject({ - method: "GET", - url: "/ssrBad/", - }) - .then(expectResp(def, "/ssrBad/", 500)); - }, - }) - .add("Serve Redirect", { - defer: true, - fn: (def) => { - server - .inject({ - method: "GET", - url: "/perm-redirect/", - }) - .then(expectResp(def, "/perm-redirect/", 301)); - }, - }) - .add("Serve Reverse Proxy", { - defer: true, - fn: (def) => { - server - .inject({ - method: "GET", - url: "/example-proxy/", - }) - .then(expectResp(def, "/example-proxy/", 200)); - }, - }) - .add("Serve Function", { - defer: true, - fn: (def) => { - server - .inject({ - method: "GET", - url: "/api/test", - }) - .then(expectResp(def, "/api/test", 200)); - }, - }) - .add("Serve Splat Function", { - defer: true, - fn: (def) => { - server - .inject({ - method: "GET", - url: "/api/test1/thisShouldWork", - }) - .then(expectResp(def, "/api/test1/thisShouldWork", 200)); - }, - }) - .on("cycle", function (event) { - console.log(String(event.target)); - }) - .on("complete", () => { - console.log("complete"); - server.close().then(() => { - console.log("server closed"); - }); - }) - .run(); -})(); diff --git a/integration-tests/plugin-fastify/gatsby-config.js b/integration-tests/plugin-fastify/gatsby-config.js deleted file mode 100644 index b1d6a2957..000000000 --- a/integration-tests/plugin-fastify/gatsby-config.js +++ /dev/null @@ -1,44 +0,0 @@ -module.exports = { - pathPrefix: "stuff", - siteMetadata: { - title: "Test Gatsby", - siteUrl: "http://localhost:8080/", - }, - plugins: [ - "gatsby-plugin-postcss", - "gatsby-plugin-image", - { - resolve: "gatsby-plugin-manifest", - options: { - icon: "src/images/icon.png", - }, - }, - "gatsby-plugin-sharp", - "gatsby-transformer-sharp", - { - resolve: "gatsby-source-filesystem", - options: { - name: "images", - path: "./src/images/", - }, - __key: "images", - }, - { - resolve: `gatsby-plugin-fastify`, - options: {}, - }, - "gatsby-plugin-sitemap", - { - resolve: `gatsby-source-faker`, - // derive schema from faker's options - options: { - schema: { - lorem: ["words", "paragraphs", "slug"], - name: ["firstName", "lastName"], - }, - count: 3, // how many fake objects you need - type: "NameData", // Name of the graphql query node - }, - }, - ], -}; diff --git a/integration-tests/plugin-fastify/gatsby-node.ts b/integration-tests/plugin-fastify/gatsby-node.ts deleted file mode 100644 index bd9a2d2c5..000000000 --- a/integration-tests/plugin-fastify/gatsby-node.ts +++ /dev/null @@ -1,182 +0,0 @@ -import path from "path"; -import type { GatsbyNode } from "gatsby"; - -export const createPages: GatsbyNode["createPages"] = async (gatsbyUtilities) => { - const { - actions: { createRedirect, createPage }, - graphql, - } = gatsbyUtilities; - - const result = await graphql(` - query fakerQuery { - allNameData { - nodes { - lorem { - paragraphs - slug - words - } - name { - lastName - firstName - } - } - } - } - `); - - const fakerPostTemplate = path.resolve(`src/templates/fakerPost.js`); - const fakerPostArchive = path.resolve(`src/templates/fakerArchive.js`); - - createPage({ - path: `/faker/`, - component: fakerPostArchive, - defer: true, - context: { - //@ts-ignore - posts: result.data.allNameData.nodes, - }, - }); - //@ts-ignore - result.data.allNameData.nodes.forEach((node) => { - createPage({ - path: `/faker/${node.lorem.slug}`, - component: fakerPostTemplate, - defer: true, - context: { - slug: node.lorem.slug, - }, - }); - }); - - for (let i = 1; i <= 10; i++) { - createPage({ - path: `/generated/page-${i}`, - component: path.resolve(`./src/templates/example.js`), - defer: i <= 5 ? false : true, - context: { - pageNumber: i, - }, - }); - } - - createRedirect({ - fromPath: "/perm-redirect", - toPath: "/posts/page-1", - isPermanent: true, - }); - createRedirect({ - fromPath: "/temp-redirect", - toPath: "/posts/page-2", - isPermanent: false, - }); - createRedirect({ - fromPath: "/alt-redirect", - toPath: "/posts/page-3", - statusCode: 301, - }); - - createRedirect({ - fromPath: "/example-proxy", - toPath: "http://example.com", - statusCode: 200, - }); - - createRedirect({ - fromPath: "/example-proxy-star/*", - toPath: "http://example.com/*", - statusCode: 200, - }); - - createRedirect({ - fromPath: "/redirect/:letter", - toPath: "/app/:letter", - }); - createRedirect({ - fromPath: "/redirect-query?letter=:letter", - toPath: "/app/:letter", - }); - createRedirect({ - fromPath: "/redirect-query-query?letter=:letter", - toPath: "/app?letter=:letter", - }); - createRedirect({ - fromPath: "/redirect-all/*", - toPath: "/app/*", - }); - createRedirect({ - fromPath: "/redirect-all2/*", - toPath: "/app/", - }); - createRedirect({ - fromPath: "/redirect-weird/:path/*", - toPath: "/app/:path/*", - }); - createRedirect({ - fromPath: "/redirect-query-specific?id=1", - toPath: "file1.pdf", - }); - createRedirect({ - fromPath: "/redirect-query-specific?id=2", - toPath: "/file2.pdf", - }); - createRedirect({ - fromPath: "/redirect-query-specific?id=2&letter=:letter", - toPath: "/app/:letter/file2.pdf", - }); - createRedirect({ - fromPath: "/wiki/category/url", - toPath: "https://en.wikipedia.org/wiki/Category:URL", - }); - createRedirect({ - fromPath: "/wiki/category/:category", - toPath: "https://en.wikipedia.org/wiki/Category::category", - }); - createRedirect({ - fromPath: "/wiki/:namespace/:value", - toPath: "https://en.wikipedia.org/wiki/:namespace::value", - }); - createRedirect({ - fromPath: "/Category::URL", - toPath: "/wiki/Category:URL", - }); - createRedirect({ - fromPath: "/some/:thing/all", - toPath: "/something::thing/*", - }); - createRedirect({ - fromPath: "/google/*", - toPath: "https://google.com/search?q=*", - }); -}; - -export const createSchemaCustomization: GatsbyNode["createSchemaCustomization"] = ({ - actions, - schema, -}) => { - actions.createTypes( - schema.buildObjectType({ - name: `TestImage`, - fields: { - title: "String", - }, - interfaces: [`Node`, `RemoteFile`], - }), - ); -}; - -export const sourceNodes: GatsbyNode["sourceNodes"] = async ({ actions }) => { - actions.createNode({ - id: `test-image`, - url: "https://images.unsplash.com/photo-1650247452475-b5866374545d?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb", - mimeType: "image/jpeg", - title: "test image", - filename: "indonesia.jpg", - width: 2666, - height: 3996, - internal: { - type: `TestImage`, - contentDigest: `test-image`, - }, - }); -}; diff --git a/integration-tests/plugin-fastify/package.json b/integration-tests/plugin-fastify/package.json deleted file mode 100644 index e7dad120d..000000000 --- a/integration-tests/plugin-fastify/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "test-plugin-fastify", - "version": "1.0.19", - "private": true, - "description": "Gatsby starter and test site for gatsby-plugin-fastify", - "author": "Alex Moon", - "keywords": [ - "gatsby" - ], - "scripts": { - "benchmark": "node benchmark.js", - "develop": "gatsby develop", - "start": "gserve", - "build": "gatsby build", - "serve": "gatsby serve", - "clean": "gatsby clean", - "build:deps": "cd ../../packages/gatsby-plugin-fastify && yarn build", - "postinstall": "[[ x\"${GATSBY_CLOUD}\" == \"x\" ]] || yarn build:deps" - }, - "dependencies": { - "fastify": "^4.28.1", - "gatsby": "^5.13.7", - "gatsby-plugin-fastify": "*", - "gatsby-plugin-image": "^3.13.1", - "gatsby-plugin-manifest": "^5.13.1", - "gatsby-plugin-postcss": "^6.13.1", - "gatsby-plugin-sharp": "^5.13.1", - "gatsby-plugin-sitemap": "^6.13.1", - "gatsby-source-faker": "^5.13.1", - "gatsby-source-filesystem": "^5.13.1", - "gatsby-transformer-sharp": "^5.13.1", - "postcss": "^8.4.47", - "react": "^18.3.1", - "react-dom": "^18.3.1" - }, - "devDependencies": { - "@babel/core": "^7.25.8", - "@babel/preset-typescript": "^7.25.7", - "babel-loader": "^9.2.1", - "babel-preset-gatsby": "^3.13.2", - "benchmark": "^2.1.4" - } -} diff --git a/integration-tests/plugin-fastify/src/api/splat/[splat].js b/integration-tests/plugin-fastify/src/api/splat/[splat].js deleted file mode 100644 index af5029990..000000000 --- a/integration-tests/plugin-fastify/src/api/splat/[splat].js +++ /dev/null @@ -1,3 +0,0 @@ -export default function handler(req, res) { - res.code(200).send({ splat: req.params.splat }); -} diff --git a/integration-tests/plugin-fastify/src/api/test.js b/integration-tests/plugin-fastify/src/api/test.js deleted file mode 100644 index dddd50e2a..000000000 --- a/integration-tests/plugin-fastify/src/api/test.js +++ /dev/null @@ -1,272 +0,0 @@ -const responseData = [ - { - _id: "612d652f43f0c05240ed09b1", - index: 0, - guid: "ced90cbd-3fad-4c66-bd8d-678eebb3f319", - isActive: true, - balance: "$3,289.14", - picture: "http://placehold.it/32x32", - age: 34, - eyeColor: "blue", - name: "Mcclure Cohen", - gender: "male", - company: "ONTALITY", - email: "mcclurecohen@ontality.com", - phone: "+1 (876) 555-3658", - address: "933 Conklin Avenue, Joes, Indiana, 9109", - about: - "Do labore fugiat exercitation esse commodo dolor voluptate proident ullamco mollit eu. Dolor aliqua incididunt ex consectetur qui labore in laborum dolore mollit fugiat. Occaecat nisi ea nulla deserunt dolore aliqua consequat ipsum fugiat aliqua est sunt anim cillum. Nulla culpa dolore reprehenderit quis aliquip.\r\n", - registered: "2016-03-02T03:01:11 +08:00", - latitude: -13.438572, - longitude: 116.414307, - tags: ["Lorem", "dolore", "anim", "mollit", "ullamco", "magna", "elit"], - friends: [ - { - id: 0, - name: "Burnett Farley", - }, - { - id: 1, - name: "Glenn Osborn", - }, - { - id: 2, - name: "Berry Schwartz", - }, - ], - greeting: "Hello, Mcclure Cohen! You have 7 unread messages.", - favoriteFruit: "banana", - }, - { - _id: "612d652f366d8330fa996824", - index: 1, - guid: "7101122e-8cea-4a02-b1b8-ae910c0802af", - isActive: false, - balance: "$3,387.50", - picture: "http://placehold.it/32x32", - age: 32, - eyeColor: "blue", - name: "Geneva Valdez", - gender: "female", - company: "LIQUICOM", - email: "genevavaldez@liquicom.com", - phone: "+1 (974) 495-2314", - address: "615 Waldorf Court, Belleview, New Jersey, 4579", - about: - "Sint anim sunt enim ea ea exercitation officia adipisicing aute. Cillum aliquip dolor mollit sunt sint. Sint excepteur sit ut eu culpa aute voluptate est non est sint do nostrud ut. Nostrud officia amet consectetur exercitation aliquip nulla occaecat. Irure voluptate aute irure quis aute ipsum.\r\n", - registered: "2019-10-23T07:06:59 +07:00", - latitude: 4.157784, - longitude: 79.800439, - tags: ["Lorem", "enim", "sint", "commodo", "minim", "tempor", "consectetur"], - friends: [ - { - id: 0, - name: "Teri Crane", - }, - { - id: 1, - name: "Colleen Burns", - }, - { - id: 2, - name: "Pierce Stafford", - }, - ], - greeting: "Hello, Geneva Valdez! You have 5 unread messages.", - favoriteFruit: "banana", - }, - { - _id: "612d652fac8efd8e645f7305", - index: 2, - guid: "9e49d2b8-2684-4a2b-8d34-2db63470105e", - isActive: true, - balance: "$1,648.73", - picture: "http://placehold.it/32x32", - age: 39, - eyeColor: "green", - name: "Beth Pitts", - gender: "female", - company: "QUIZKA", - email: "bethpitts@quizka.com", - phone: "+1 (967) 452-3934", - address: "209 Elm Avenue, Soham, South Dakota, 6752", - about: - "Excepteur est et cupidatat id nisi quis occaecat est non cillum. Dolore aliquip elit aliquip exercitation anim ad aliqua sint enim mollit anim. Nulla veniam amet labore consectetur nulla non culpa laboris non ea. Irure fugiat fugiat reprehenderit aute labore. Commodo enim velit sit sunt in eu adipisicing proident aliqua sit officia. Et cupidatat mollit est voluptate adipisicing ullamco ullamco. Elit in sint velit laboris fugiat.\r\n", - registered: "2018-07-10T08:23:13 +07:00", - latitude: -41.232792, - longitude: 14.620843, - tags: ["ipsum", "voluptate", "reprehenderit", "fugiat", "nulla", "elit", "dolore"], - friends: [ - { - id: 0, - name: "Rosa Case", - }, - { - id: 1, - name: "Charlene Wilkinson", - }, - { - id: 2, - name: "Wilcox Shannon", - }, - ], - greeting: "Hello, Beth Pitts! You have 4 unread messages.", - favoriteFruit: "apple", - }, - { - _id: "612d652f86b888292e0537ea", - index: 3, - guid: "ae58b78c-46a4-4a09-b636-d86ebc84870c", - isActive: false, - balance: "$1,820.92", - picture: "http://placehold.it/32x32", - age: 38, - eyeColor: "blue", - name: "Mack Parker", - gender: "male", - company: "GRONK", - email: "mackparker@gronk.com", - phone: "+1 (942) 455-3698", - address: "340 Village Court, Spokane, Iowa, 7827", - about: - "Officia occaecat eu duis officia amet in ea ad mollit ut. Mollit non anim ex do. In esse commodo esse ullamco irure laborum officia enim deserunt et. Ut adipisicing aliqua qui anim fugiat duis magna culpa aliqua nisi ex tempor Lorem cupidatat. Aute Lorem ut fugiat reprehenderit fugiat velit. Eu occaecat esse sit anim ad.\r\n", - registered: "2017-10-26T05:06:57 +07:00", - latitude: 62.176215, - longitude: 50.081649, - tags: ["eiusmod", "esse", "adipisicing", "deserunt", "minim", "dolor", "sint"], - friends: [ - { - id: 0, - name: "Corinne Cleveland", - }, - { - id: 1, - name: "Janell Stevenson", - }, - { - id: 2, - name: "Ruiz Dalton", - }, - ], - greeting: "Hello, Mack Parker! You have 5 unread messages.", - favoriteFruit: "banana", - }, - { - _id: "612d652f918c5464a5d1badc", - index: 4, - guid: "16de477f-8260-4dbf-803a-0b9af672a7a3", - isActive: false, - balance: "$2,015.74", - picture: "http://placehold.it/32x32", - age: 40, - eyeColor: "brown", - name: "Benton Garza", - gender: "male", - company: "CODACT", - email: "bentongarza@codact.com", - phone: "+1 (978) 544-3959", - address: "723 Linden Street, Loma, Hawaii, 2183", - about: - "Veniam voluptate eiusmod est exercitation magna dolor cillum veniam. Anim culpa veniam adipisicing consequat sint adipisicing. Minim velit eu tempor enim nulla enim adipisicing id elit irure ex. Voluptate duis cupidatat fugiat amet dolore veniam. Adipisicing ad occaecat velit cillum.\r\n", - registered: "2016-05-12T08:32:44 +07:00", - latitude: 41.639383, - longitude: -33.102296, - tags: ["excepteur", "et", "duis", "velit", "laboris", "pariatur", "dolor"], - friends: [ - { - id: 0, - name: "Ryan Waters", - }, - { - id: 1, - name: "Robbie Rosario", - }, - { - id: 2, - name: "Gracie Freeman", - }, - ], - greeting: "Hello, Benton Garza! You have 1 unread messages.", - favoriteFruit: "strawberry", - }, - { - _id: "612d652f1dd2eb98a16e0a3d", - index: 5, - guid: "856875e2-24fa-426c-a1cd-5447ea2abeb9", - isActive: false, - balance: "$1,889.99", - picture: "http://placehold.it/32x32", - age: 37, - eyeColor: "brown", - name: "Tommie Durham", - gender: "female", - company: "EVIDENDS", - email: "tommiedurham@evidends.com", - phone: "+1 (866) 570-3407", - address: "694 Barlow Drive, Lithium, Tennessee, 1100", - about: - "Enim nostrud ea ea quis. Commodo commodo reprehenderit ea minim officia enim. Velit laboris incididunt commodo esse commodo ea excepteur in deserunt deserunt. Fugiat ad exercitation aliqua minim ea sunt pariatur est commodo sunt nisi ex. Ipsum ad enim ut et culpa pariatur.\r\n", - registered: "2018-03-01T06:21:31 +08:00", - latitude: 52.298302, - longitude: -22.076203, - tags: ["laboris", "labore", "officia", "in", "est", "deserunt", "ad"], - friends: [ - { - id: 0, - name: "Francis Park", - }, - { - id: 1, - name: "Schmidt Williamson", - }, - { - id: 2, - name: "Adkins Shields", - }, - ], - greeting: "Hello, Tommie Durham! You have 6 unread messages.", - favoriteFruit: "apple", - }, - { - _id: "612d652f8e1b1bc30f3585ec", - index: 6, - guid: "eb70d15e-fee8-4e76-8c90-049d3d6dac43", - isActive: false, - balance: "$1,139.14", - picture: "http://placehold.it/32x32", - age: 21, - eyeColor: "brown", - name: "Lee Good", - gender: "male", - company: "LIMAGE", - email: "leegood@limage.com", - phone: "+1 (945) 414-3105", - address: "652 Hendrickson Street, Wilsonia, Arizona, 9156", - about: - "Amet ullamco adipisicing velit cillum quis minim nulla sint dolor. Labore magna quis nulla occaecat cupidatat anim irure. Anim duis nisi ipsum sint.\r\n", - registered: "2017-10-14T04:22:31 +07:00", - latitude: 85.591186, - longitude: 51.21934, - tags: ["ipsum", "ad", "exercitation", "mollit", "magna", "irure", "elit"], - friends: [ - { - id: 0, - name: "Delacruz Vaughn", - }, - { - id: 1, - name: "Kari Figueroa", - }, - { - id: 2, - name: "Kris Marsh", - }, - ], - greeting: "Hello, Lee Good! You have 7 unread messages.", - favoriteFruit: "strawberry", - }, -]; - -export default function handler(req, res) { - res.code(200).send(responseData); -} diff --git a/integration-tests/plugin-fastify/src/api/test1/[splat].js b/integration-tests/plugin-fastify/src/api/test1/[splat].js deleted file mode 100644 index 220d50e90..000000000 --- a/integration-tests/plugin-fastify/src/api/test1/[splat].js +++ /dev/null @@ -1,3 +0,0 @@ -export default function handler(req, res) { - res.code(200).send(req.params); -} diff --git a/integration-tests/plugin-fastify/src/api/wildcard/[...].js b/integration-tests/plugin-fastify/src/api/wildcard/[...].js deleted file mode 100644 index 220d50e90..000000000 --- a/integration-tests/plugin-fastify/src/api/wildcard/[...].js +++ /dev/null @@ -1,3 +0,0 @@ -export default function handler(req, res) { - res.code(200).send(req.params); -} diff --git a/integration-tests/plugin-fastify/src/components/Post.js b/integration-tests/plugin-fastify/src/components/Post.js deleted file mode 100644 index eac1c560a..000000000 --- a/integration-tests/plugin-fastify/src/components/Post.js +++ /dev/null @@ -1,13 +0,0 @@ -import * as React from "react"; -import { Link } from "gatsby"; - -export default function PostPage({ title, content }) { - return ( -
- Return to Home - -

{title}

-
-
- ); -} diff --git a/integration-tests/plugin-fastify/src/images/icon.png b/integration-tests/plugin-fastify/src/images/icon.png deleted file mode 100644 index 38b2fb0e4..000000000 Binary files a/integration-tests/plugin-fastify/src/images/icon.png and /dev/null differ diff --git a/integration-tests/plugin-fastify/src/images/tree-in-sunset-main.jpeg b/integration-tests/plugin-fastify/src/images/tree-in-sunset-main.jpeg deleted file mode 100644 index e7fa1e985..000000000 Binary files a/integration-tests/plugin-fastify/src/images/tree-in-sunset-main.jpeg and /dev/null differ diff --git a/integration-tests/plugin-fastify/src/pages/404.js b/integration-tests/plugin-fastify/src/pages/404.js deleted file mode 100644 index fd99104fd..000000000 --- a/integration-tests/plugin-fastify/src/pages/404.js +++ /dev/null @@ -1,54 +0,0 @@ -import * as React from "react"; -import { Link } from "gatsby"; - -// styles -const pageStyles = { - color: "#232129", - padding: "96px", - fontFamily: "-apple-system, Roboto, sans-serif, serif", -}; -const headingStyles = { - marginTop: 0, - marginBottom: 64, - maxWidth: 320, -}; - -const paragraphStyles = { - marginBottom: 48, -}; -const codeStyles = { - color: "#8A6534", - padding: 4, - backgroundColor: "#FFF4DB", - fontSize: "1.25rem", - borderRadius: 4, -}; - -// markup -const NotFoundPage = () => { - return ( -
- Not found -

Page not found

-

- Sorry{" "} - - πŸ˜” - {" "} - we couldn’t find what you were looking for. -
- {process.env.NODE_ENV === "development" ? ( - <> -
- Try creating a page in src/pages/. -
- - ) : null} -
- Go home. -

-
- ); -}; - -export default NotFoundPage; diff --git a/integration-tests/plugin-fastify/src/pages/500.js b/integration-tests/plugin-fastify/src/pages/500.js deleted file mode 100644 index 1b682ccc0..000000000 --- a/integration-tests/plugin-fastify/src/pages/500.js +++ /dev/null @@ -1,54 +0,0 @@ -import * as React from "react"; -import { Link } from "gatsby"; - -// styles -const pageStyles = { - color: "#232129", - padding: "96px", - fontFamily: "-apple-system, Roboto, sans-serif, serif", -}; -const headingStyles = { - marginTop: 0, - marginBottom: 64, - maxWidth: 320, -}; - -const paragraphStyles = { - marginBottom: 48, -}; -const codeStyles = { - color: "#8A6534", - padding: 4, - backgroundColor: "#FFF4DB", - fontSize: "1.25rem", - borderRadius: 4, -}; - -// markup -const InternalServerError = () => { - return ( -
- Internal Server Error -

Internal Server Error

-

- Sorry{" "} - - πŸ˜” - {" "} - something went terribly wrong. -
- {process.env.NODE_ENV === "development" ? ( - <> -
- Try creating a page in src/pages/. -
- - ) : null} -
- Go home. -

-
- ); -}; - -export default InternalServerError; diff --git a/integration-tests/plugin-fastify/src/pages/app/[...].js b/integration-tests/plugin-fastify/src/pages/app/[...].js deleted file mode 100644 index da492b87d..000000000 --- a/integration-tests/plugin-fastify/src/pages/app/[...].js +++ /dev/null @@ -1,37 +0,0 @@ -import React from "react"; -import { Router } from "@reach/router"; -import { Link } from "gatsby"; - -const A = () => { - return ( - <> -

route A

- Go To app Home - - ); -}; -const B = () => { - return ( - <> -

route b

- Go To app Home - - ); -}; - -const App = () => { - return ( - <> -

Welcome to my client only routes

- Go To A - Go To B - Go To Home - - - - - - - ); -}; -export default App; diff --git a/integration-tests/plugin-fastify/src/pages/imagecdn.js b/integration-tests/plugin-fastify/src/pages/imagecdn.js deleted file mode 100644 index deac402b6..000000000 --- a/integration-tests/plugin-fastify/src/pages/imagecdn.js +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from "react"; -import { graphql } from "gatsby"; -import { GatsbyImage } from "gatsby-plugin-image"; -export default function StuffsArchive({ data }) { - return ( -
-

Gatsby Image CDN Image

-

here's some content

- -
- ); -} - -export const pageQuery = graphql` - query TestImage { - testImage(id: { eq: "test-image" }) { - gatsbyImage(width: 1024) - } - } -`; diff --git a/integration-tests/plugin-fastify/src/pages/index.js b/integration-tests/plugin-fastify/src/pages/index.js deleted file mode 100644 index 9be52c3ba..000000000 --- a/integration-tests/plugin-fastify/src/pages/index.js +++ /dev/null @@ -1,160 +0,0 @@ -import * as React from "react"; -import { Link, withPrefix } from "gatsby"; -// styles -const pageStyles = { - color: "#232129", - padding: 96, - fontFamily: "-apple-system, Roboto, sans-serif, serif", -}; -const headingStyles = { - marginTop: 0, - marginBottom: 64, - maxWidth: 320, -}; -const headingAccentStyles = { - color: "#663399", -}; -const paragraphStyles = { - marginBottom: 48, -}; -const codeStyles = { - color: "#8A6534", - padding: 4, - backgroundColor: "#FFF4DB", - fontSize: "1.25rem", - borderRadius: 4, -}; -const listStyles = { - marginBottom: 96, - paddingLeft: 0, -}; -const listItemStyles = { - fontWeight: 300, - fontSize: 24, - maxWidth: 560, - marginBottom: 30, -}; - -const linkStyle = { - color: "#8954A8", - fontWeight: "bold", - fontSize: 16, - verticalAlign: "5%", -}; - -// const descriptionStyle = { -// color: "#232129", -// fontSize: 14, -// marginTop: 10, -// marginBottom: 0, -// lineHeight: 1.25, -// }; - -// markup -const IndexPage = () => { - const posts = [ - { - title: "Page 1", - uri: "/posts/page-1", - }, - { - title: "Page 2", - uri: "/posts/page-2", - }, - { - title: "Page 3", - uri: "/posts/page-3", - }, - ]; - - return ( -
- Home Page -

- Congratulations -
- β€” you just made a Gatsby site! - - πŸŽ‰πŸŽ‰πŸŽ‰ - -

-

- Edit src/pages/index.js to see this page update in - real-time.{" "} - - 😎 - -

-
    - {posts.map(({ title, excerpt, uri }) => ( -
  • - - - {title} - - -
  • - ))} -
- -
-
- ); -}; - -export default IndexPage; diff --git a/integration-tests/plugin-fastify/src/pages/posts/page-1.js b/integration-tests/plugin-fastify/src/pages/posts/page-1.js deleted file mode 100644 index 7af051ed3..000000000 --- a/integration-tests/plugin-fastify/src/pages/posts/page-1.js +++ /dev/null @@ -1,6 +0,0 @@ -import * as React from "react"; -import PostPage from "../../components/Post"; - -export default function postPage1() { - return ; -} diff --git a/integration-tests/plugin-fastify/src/pages/posts/page-2.js b/integration-tests/plugin-fastify/src/pages/posts/page-2.js deleted file mode 100644 index fe962e423..000000000 --- a/integration-tests/plugin-fastify/src/pages/posts/page-2.js +++ /dev/null @@ -1,6 +0,0 @@ -import * as React from "react"; -import PostPage from "../../components/Post"; - -export default function postPage2() { - return ; -} diff --git a/integration-tests/plugin-fastify/src/pages/posts/page-3.js b/integration-tests/plugin-fastify/src/pages/posts/page-3.js deleted file mode 100644 index 85b52148e..000000000 --- a/integration-tests/plugin-fastify/src/pages/posts/page-3.js +++ /dev/null @@ -1,6 +0,0 @@ -import * as React from "react"; -import PostPage from "../../components/Post"; - -export default function postPage3() { - return ; -} diff --git a/integration-tests/plugin-fastify/src/pages/ssr.js b/integration-tests/plugin-fastify/src/pages/ssr.js deleted file mode 100644 index 5ddc3dda0..000000000 --- a/integration-tests/plugin-fastify/src/pages/ssr.js +++ /dev/null @@ -1,29 +0,0 @@ -import * as React from "react"; - -export default function SsrExample({ serverData }) { - return ( -
-

SSR Page with Dogs

- Happy dog -
- ); -} - -export async function getServerData() { - try { - const res = await fetch(`https://dog.ceo/api/breeds/image/random`); - if (!res.ok) { - throw new Error(`Response failed`); - } - return { - headers: { - "x-test": "Custom Headers Work!", - }, - props: await res.json(), - }; - } catch (error) { - return { - props: {}, - }; - } -} diff --git a/integration-tests/plugin-fastify/src/pages/ssr/[slug].js b/integration-tests/plugin-fastify/src/pages/ssr/[slug].js deleted file mode 100644 index 20a7b3a31..000000000 --- a/integration-tests/plugin-fastify/src/pages/ssr/[slug].js +++ /dev/null @@ -1,13 +0,0 @@ -import * as React from "react"; -export default function SsrFallBackExample({ serverData }) { - return
{serverData.message}
; -} - -export async function getServerData({ params }) { - return { - status: 200, - props: { - message: params["slug"] === "42" ? "meaning of life" : "try again", - }, - }; -} diff --git a/integration-tests/plugin-fastify/src/pages/ssr403.js b/integration-tests/plugin-fastify/src/pages/ssr403.js deleted file mode 100644 index 8eadc27da..000000000 --- a/integration-tests/plugin-fastify/src/pages/ssr403.js +++ /dev/null @@ -1,17 +0,0 @@ -import * as React from "react"; - -export default function Ssr403Example({ serverData }) { - return ( -
-

403 SSR Page

-
{JSON.stringify(serverData, null, 2)}
-
- ); -} - -export async function getServerData({ url, query, method, params, headers }) { - return { - status: 403, - props: {}, - }; -} diff --git a/integration-tests/plugin-fastify/src/pages/ssrBad.js b/integration-tests/plugin-fastify/src/pages/ssrBad.js deleted file mode 100644 index e273d12cf..000000000 --- a/integration-tests/plugin-fastify/src/pages/ssrBad.js +++ /dev/null @@ -1,13 +0,0 @@ -import * as React from "react"; - -export default function SsrExample({ serverData }) { - return ( -
-

This should never render

-
- ); -} - -export async function getServerData() { - throw new Error("This is a bad error"); -} diff --git a/integration-tests/plugin-fastify/src/pages/ssr_named_splat/[...test].js b/integration-tests/plugin-fastify/src/pages/ssr_named_splat/[...test].js deleted file mode 100644 index ed9a66276..000000000 --- a/integration-tests/plugin-fastify/src/pages/ssr_named_splat/[...test].js +++ /dev/null @@ -1,17 +0,0 @@ -import * as React from "react"; -export default function SsrFallBackExample({ serverData }) { - return ( -
-
{JSON.stringify(serverData.message, null, 2)}
-
- ); -} - -export async function getServerData({ params }) { - return { - status: 200, - props: { - message: params, - }, - }; -} diff --git a/integration-tests/plugin-fastify/src/pages/ssr_splat/[...].js b/integration-tests/plugin-fastify/src/pages/ssr_splat/[...].js deleted file mode 100644 index ed9a66276..000000000 --- a/integration-tests/plugin-fastify/src/pages/ssr_splat/[...].js +++ /dev/null @@ -1,17 +0,0 @@ -import * as React from "react"; -export default function SsrFallBackExample({ serverData }) { - return ( -
-
{JSON.stringify(serverData.message, null, 2)}
-
- ); -} - -export async function getServerData({ params }) { - return { - status: 200, - props: { - message: params, - }, - }; -} diff --git a/integration-tests/plugin-fastify/src/templates/example.js b/integration-tests/plugin-fastify/src/templates/example.js deleted file mode 100644 index 2f0599425..000000000 --- a/integration-tests/plugin-fastify/src/templates/example.js +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -export default function Example({ pageContext }) { - return
Hello world #{pageContext.pageNumber}!
; -} diff --git a/integration-tests/plugin-fastify/src/templates/fakerArchive.js b/integration-tests/plugin-fastify/src/templates/fakerArchive.js deleted file mode 100644 index 67dc4f88c..000000000 --- a/integration-tests/plugin-fastify/src/templates/fakerArchive.js +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from "react"; -import { Link } from "gatsby"; - -export default function fakerData({ pageContext: { posts } }) { - return ( - <> -

Faker Entries

-
    - {posts.map(({ lorem, name }) => { - return ( -
  1. - - {lorem.words} - {name.firstName} {name.lastName} - -
  2. - ); - })} -
- - ); -} diff --git a/integration-tests/plugin-fastify/src/templates/fakerPost.js b/integration-tests/plugin-fastify/src/templates/fakerPost.js deleted file mode 100644 index a2735f442..000000000 --- a/integration-tests/plugin-fastify/src/templates/fakerPost.js +++ /dev/null @@ -1,19 +0,0 @@ -import * as React from "react"; -import PostPage from "../components/Post"; -import { graphql } from "gatsby"; - -export default function postPage1({ data }) { - return ; -} - -export const query = graphql` - query fakerPostQuery($slug: String!) { - nameData(lorem: { slug: { eq: $slug } }) { - lorem { - paragraphs - slug - words - } - } - } -`; diff --git a/packages/gatsby-plugin-fastify/.babelrc b/packages/gatsby-plugin-fastify/.babelrc deleted file mode 100644 index ac0ad292b..000000000 --- a/packages/gatsby-plugin-fastify/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": [["babel-preset-gatsby-package"]] -} diff --git a/packages/gatsby-plugin-fastify/.npmignore b/packages/gatsby-plugin-fastify/.npmignore deleted file mode 100644 index 1b2e7f482..000000000 --- a/packages/gatsby-plugin-fastify/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.vscode/ -src \ No newline at end of file diff --git a/packages/gatsby-plugin-fastify/.vscode/launch.json b/packages/gatsby-plugin-fastify/.vscode/launch.json deleted file mode 100644 index 8a3a853ee..000000000 --- a/packages/gatsby-plugin-fastify/.vscode/launch.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Attach", - "port": 9229, - "request": "attach", - "skipFiles": ["/**"], - "type": "pwa-node" - }, - { - "name": "Attach by Process ID", - "processId": "${command:PickProcess}", - "request": "attach", - "skipFiles": ["/**"], - "type": "pwa-node" - } - ] -} diff --git a/packages/gatsby-plugin-fastify/CHANGELOG.md b/packages/gatsby-plugin-fastify/CHANGELOG.md deleted file mode 100644 index 7f99d926c..000000000 --- a/packages/gatsby-plugin-fastify/CHANGELOG.md +++ /dev/null @@ -1,375 +0,0 @@ -# gatsby-plugin-fastify - -## 0.13.4 - -### Patch Changes - -- [#469](https://github.com/gatsby-uc/plugins/pull/469) [`4759545`](https://github.com/gatsby-uc/plugins/commit/475954526a982c149696255f7ddfb3dba60e17b5) Thanks [@renovate](https://github.com/apps/renovate)! - fix(packages): update non-major dependency versions - -- [#471](https://github.com/gatsby-uc/plugins/pull/471) [`3ff08a8`](https://github.com/gatsby-uc/plugins/commit/3ff08a8bcd712a9728a009e42e48a092251a1b01) Thanks [@renovate](https://github.com/apps/renovate)! - chore(packages): update dependency @types/jest to ^29.5.13 - -- [#484](https://github.com/gatsby-uc/plugins/pull/484) [`2579b64`](https://github.com/gatsby-uc/plugins/commit/2579b64b1bbf62df71fd3717486c600161f8b307) Thanks [@renovate](https://github.com/apps/renovate)! - chore(babel): update build tooling to v7.25.8 - -- [#468](https://github.com/gatsby-uc/plugins/pull/468) [`67b7397`](https://github.com/gatsby-uc/plugins/commit/67b73976f7606fed7653e26150d4a7bab092935f) Thanks [@renovate](https://github.com/apps/renovate)! - Refactor code for updated linting rules - -- [#466](https://github.com/gatsby-uc/plugins/pull/466) [`3731300`](https://github.com/gatsby-uc/plugins/commit/3731300946af4aeed7caf052cea62886941f8c82) Thanks [@renovate](https://github.com/apps/renovate)! - chore(babel): update build tooling - -## 0.13.3 - -### Patch Changes - -- [#464](https://github.com/gatsby-uc/plugins/pull/464) [`c43c4d8`](https://github.com/gatsby-uc/plugins/commit/c43c4d86a4d787415b7efd830b9b1620ae4df989) Thanks [@renovate](https://github.com/apps/renovate)! - fix(packages): update non-major dependency versions - -- [#450](https://github.com/gatsby-uc/plugins/pull/450) [`f334dd4`](https://github.com/gatsby-uc/plugins/commit/f334dd4a79868cef3dc03534baa27e95e36760c8) Thanks [@renovate](https://github.com/apps/renovate)! - chore(babel): update build tooling to v7.23.7 - -## 0.13.2 - -### Patch Changes - -- [#461](https://github.com/gatsby-uc/plugins/pull/461) [`caf7d4f`](https://github.com/gatsby-uc/plugins/commit/caf7d4feb52b9ca062b0d78883659d62e86243f4) Thanks [@moonmeister](https://github.com/moonmeister)! - Updated can-i-use database - -- [#461](https://github.com/gatsby-uc/plugins/pull/461) [`caf7d4f`](https://github.com/gatsby-uc/plugins/commit/caf7d4feb52b9ca062b0d78883659d62e86243f4) Thanks [@moonmeister](https://github.com/moonmeister)! - - Updated testing and runners to latest Node 20 LTS. - - - Updated to latests Yarn v4 and corepack for management of packageManager. Please run `corepack enable` to use the correct version of `yarn`. - - Updated dependencies. - - Updated prettier and associated formatting. - - Update TypeScript versions used to latest. - -- [#444](https://github.com/gatsby-uc/plugins/pull/444) [`b7b48b7`](https://github.com/gatsby-uc/plugins/commit/b7b48b781885a7b0378bb44f18ee18b0733a3981) Thanks [@renovate](https://github.com/apps/renovate)! - fix(packages): update non-major dependency versions - -- [#453](https://github.com/gatsby-uc/plugins/pull/453) [`6a313dc`](https://github.com/gatsby-uc/plugins/commit/6a313dca5b1f7f71a2a7ef8c19aef7e72e5f7445) Thanks [@renovate](https://github.com/apps/renovate)! - fix(packages): update non-major dependency versions - -- [#461](https://github.com/gatsby-uc/plugins/pull/461) [`caf7d4f`](https://github.com/gatsby-uc/plugins/commit/caf7d4feb52b9ca062b0d78883659d62e86243f4) Thanks [@moonmeister](https://github.com/moonmeister)! - fix: something made Gatsby funcitons nest another default export deeper...so I added another line to unnest correctly - -## 0.13.1 - -### Patch Changes - -- [#442](https://github.com/gatsby-uc/plugins/pull/442) [`dd33f3d`](https://github.com/gatsby-uc/plugins/commit/dd33f3d91ef83c0c463e317be836c300f8427d21) Thanks [@renovate](https://github.com/apps/renovate)! - chore(babel): update build tooling - -## 0.13.0 - -### Minor Changes - -- [#430](https://github.com/gatsby-uc/plugins/pull/430) [`23f9fba`](https://github.com/gatsby-uc/plugins/commit/23f9fba42e854a86874545c4fce2be2858133c5f) Thanks [@tboutron](https://github.com/tboutron)! - Fix homepage link for plugins - -### Patch Changes - -- [#417](https://github.com/gatsby-uc/plugins/pull/417) [`04a77c7`](https://github.com/gatsby-uc/plugins/commit/04a77c7697eff0e4955096e9c2b58241d5eb8e75) Thanks [@renovate](https://github.com/apps/renovate)! - chore(packages): update jest monorepo - -- [#418](https://github.com/gatsby-uc/plugins/pull/418) [`c6b3c08`](https://github.com/gatsby-uc/plugins/commit/c6b3c084c542b24ed0e953005f394fdb62396465) Thanks [@renovate](https://github.com/apps/renovate)! - fix(packages): update non-major dependency versions - -- [#414](https://github.com/gatsby-uc/plugins/pull/414) [`badae40`](https://github.com/gatsby-uc/plugins/commit/badae403b130fd3bdf8d706c540d14de884c8490) Thanks [@renovate](https://github.com/apps/renovate)! - chore(babel): update build tooling - -## 0.12.4 - -### Patch Changes - -- [#382](https://github.com/gatsby-uc/plugins/pull/382) [`d578b78`](https://github.com/gatsby-uc/plugins/commit/d578b7896f804716a4c2222385c19be11c27bdf4) Thanks [@renovate](https://github.com/apps/renovate)! - fix(packages): update non-major dependency versions - -- [#380](https://github.com/gatsby-uc/plugins/pull/380) [`9da9a23`](https://github.com/gatsby-uc/plugins/commit/9da9a23a13343ca52cf32aa98105cb2f597a2f07) Thanks [@renovate](https://github.com/apps/renovate)! - chore(packages): update jest monorepo - -- [#378](https://github.com/gatsby-uc/plugins/pull/378) [`07bbfa7`](https://github.com/gatsby-uc/plugins/commit/07bbfa7c434b8543a7d15c5f2e87ac48705aa593) Thanks [@renovate](https://github.com/apps/renovate)! - chore(babel): update build tooling - -## 0.12.3 - -### Patch Changes - -- [#356](https://github.com/gatsby-uc/plugins/pull/356) [`687e7f9`](https://github.com/gatsby-uc/plugins/commit/687e7f9d65c442a53932def1df2e7ecb3b917fdc) Thanks [@renovate](https://github.com/apps/renovate)! - chore(packages): update dependency @types/jest to ^29.2.5 - -- [#365](https://github.com/gatsby-uc/plugins/pull/365) [`369749a`](https://github.com/gatsby-uc/plugins/commit/369749a50931bc073ba25815dc6d1e6561de28de) Thanks [@moonmeister](https://github.com/moonmeister)! - chore(babel): update build tooling - -- [#359](https://github.com/gatsby-uc/plugins/pull/359) [`b91e945`](https://github.com/gatsby-uc/plugins/commit/b91e945ebb0a25249f8432fa682bd771407c3b04) Thanks [@renovate](https://github.com/apps/renovate)! - fix(packages): update non-major dependency versions - -## 0.12.2 - -### Patch Changes - -- [#351](https://github.com/gatsby-uc/plugins/pull/351) [`3029c4b`](https://github.com/gatsby-uc/plugins/commit/3029c4bd65bbc5bc5203c19bd93c392934518136) Thanks [@moonmeister](https://github.com/moonmeister)! - When plugins are nested inside a Gatsby Theme they are required to have an `index.js` file in the package root. We recently removed these not knowing this requirement. Files restored and tests added. - -## 0.12.1 - -### Patch Changes - -- [#328](https://github.com/gatsby-uc/plugins/pull/328) [`90e1706`](https://github.com/gatsby-uc/plugins/commit/90e170661041dd62cb9453c25905bf10418f066f) Thanks [@tsdexter](https://github.com/tsdexter)! - encode replacements in wildcard redirects fixes #327 - -## 0.12.0 - -### Minor Changes - -- [#321](https://github.com/gatsby-uc/plugins/pull/321) [`fa6aa14`](https://github.com/gatsby-uc/plugins/commit/fa6aa14321c3b8012528b94501c56c8f51d2b0dd) Thanks [@moonmeister](https://github.com/moonmeister)! - FEAT: Added ability to configure Fastify server options from plugin config. As a part of this effort several non-critical defaults have been changed. While debating this change it was relized these defaults were more for development ease than good production defaults. - - 1. Request logging is now on by default as is normal in Fastify. - 2. Logging is no longer "pretty" when `NODE_ENV=development`. - - If you'd like to restore either of the functionalities see: - - ```js - //gatsby-config.js - module.exports = { - /* Site config */ - plugins: [ - /* Rest of the plugins */ - { - resolve: `gatsby-plugin-fastify`, - /* Default option value shown */ - options: { - fastify: { - logger: { - level: logLevel, - transport: - process.env.NODE_ENV === "development" - ? { - target: "pino-pretty", - options: { - translateTime: "HH:MM:ss Z", - ignore: "pid,hostname", - }, - } - : undefined, - }, - disableRequestLogging: ["trace", "debug"].includes(logLevel) ? false : true, - }, - }, - }, - ], - }; - ``` - - > To restore pretty printing you'll also need to install `pino-pretty` from npm. - -## 0.11.2 - -### Patch Changes - -- [#319](https://github.com/gatsby-uc/plugins/pull/319) [`327f233`](https://github.com/gatsby-uc/plugins/commit/327f233beb45485e7fcbdcc2d9a2811c7d21c561) Thanks [@moonmeister](https://github.com/moonmeister)! - refactor re-export. no funcitonal changes. - -## 0.11.1 - -### Patch Changes - -- [#317](https://github.com/gatsby-uc/plugins/pull/317) [`8fd9b57`](https://github.com/gatsby-uc/plugins/commit/8fd9b577189c98ddbacc0afb37a3cf3d756ea199) Thanks [@renovate](https://github.com/apps/renovate)! - fix(packages): update dependency fs-extra to v11 - -- [#310](https://github.com/gatsby-uc/plugins/pull/310) [`3c854d0`](https://github.com/gatsby-uc/plugins/commit/3c854d0fd7c4bb81c894a08d6dca0ca2c18f7025) Thanks [@renovate](https://github.com/apps/renovate)! - chore(babel): update build tooling - -- [#313](https://github.com/gatsby-uc/plugins/pull/313) [`60fecbc`](https://github.com/gatsby-uc/plugins/commit/60fecbc600ce57bf82887a78f4e4d9a430b35f00) Thanks [@renovate](https://github.com/apps/renovate)! - fix(packages): update non-major dependency versions - -## 0.11.0 - -### Minor Changes - -- [#306](https://github.com/gatsby-uc/plugins/pull/306) [`c109eb2`](https://github.com/gatsby-uc/plugins/commit/c109eb284913f00c05423804e3de888724848409) Thanks [@moonmeister](https://github.com/moonmeister)! - We've changed the default redirect codes to 307/308 from 301/302. See the redirects docs for more info. This won't break most use cases, unless you were expecting a specific response code. You may uses Gatsby's "statusCode" field to explicitly set the satus code back to 301/302 when creating the redirect. - -### Patch Changes - -- [#306](https://github.com/gatsby-uc/plugins/pull/306) [`c109eb2`](https://github.com/gatsby-uc/plugins/commit/c109eb284913f00c05423804e3de888724848409) Thanks [@moonmeister](https://github.com/moonmeister)! - feat: Changed redirects to respond on any HTTP medthod, not just GET. - -## 0.10.0 - -### Minor Changes - -- [#303](https://github.com/gatsby-uc/plugins/pull/303) [`bae3266`](https://github.com/gatsby-uc/plugins/commit/bae326612720b00116aea0928fc84a01a328fbb7) Thanks [@renovate](https://github.com/apps/renovate)! - Bumping dependencies to match Gatsby v5 related changes. We will only be testing against Gatsby v5, so there's no promisses for Gatsby v4, though there's no known breaking changes. - -### Patch Changes - -- [#305](https://github.com/gatsby-uc/plugins/pull/305) [`97af0d6`](https://github.com/gatsby-uc/plugins/commit/97af0d667d8f6e5265773f9cdb8eb0a184b9a6fa) Thanks [@moonmeister](https://github.com/moonmeister)! - ADded ESLint configs and updated packages to lint rules. Don't expect any functional changes but code was changed. Please open an issue if you notice any change in behavior. - -- [#303](https://github.com/gatsby-uc/plugins/pull/303) [`bae3266`](https://github.com/gatsby-uc/plugins/commit/bae326612720b00116aea0928fc84a01a328fbb7) Thanks [@renovate](https://github.com/apps/renovate)! - Adding Gatsby v5 to peer dependencies now that testing has been done. - -- [#288](https://github.com/gatsby-uc/plugins/pull/288) [`0a047a8`](https://github.com/gatsby-uc/plugins/commit/0a047a8a241c82205b7ac43abcb7f3b9ca5b97a0) Thanks [@moonmeister](https://github.com/moonmeister)! - chore(repo): node 18 version bumps and testing - -## 0.9.8 - -### Patch Changes - -- [#300](https://github.com/gatsby-uc/plugins/pull/300) [`2eacee4`](https://github.com/gatsby-uc/plugins/commit/2eacee4914a036372fcb8751be0d1b40fac6a5e2) Thanks [@moonmeister](https://github.com/moonmeister)! - Fix: bugs arround matching certain paths related to wildcard and parametric SSR routes. #289. - Fix: implemented some more consistent use and parsing of matchPaths to support native gatsby naming that is window ssompatible. #270 - -## 0.9.7 - -### Patch Changes - -- [#292](https://github.com/gatsby-uc/plugins/pull/292) [`4ca97f9`](https://github.com/gatsby-uc/plugins/commit/4ca97f9ae833b719d67f02ae2af0c9313549fea8) Thanks [@tsdexter](https://github.com/tsdexter)! - support colons in redirect `toPath`s - -## 0.9.6 - -### Patch Changes - -- [#277](https://github.com/gatsby-uc/plugins/pull/277) [`a07a56c`](https://github.com/gatsby-uc/plugins/commit/a07a56c6f670ef3606a95ea3dccedbecec1e724e) Thanks [@renovate](https://github.com/apps/renovate)! - fix(gatsby-plugin-fastify): update non-major dependency versions - -## 0.9.5 - -### Patch Changes - -- [#272](https://github.com/gatsby-uc/plugins/pull/272) [`95dcabf`](https://github.com/gatsby-uc/plugins/commit/95dcabf03992ca89382f35c1d4a54938ef3066e7) Thanks [@moonmeister](https://github.com/moonmeister)! - Fix: Correctly handle splat and wildcard routes for redirects as discussed in #271 - -## 0.9.4 - -### Patch Changes - -- [#266](https://github.com/gatsby-uc/plugins/pull/266) [`7792f9f`](https://github.com/gatsby-uc/plugins/commit/7792f9f0e6b9aa4148bdbd6fb3513c7843177be6) Thanks [@moonmeister](https://github.com/moonmeister)! - docs: Change docs to correctly direct user to ENV vars for changing host address. Solves #265 - -- [#260](https://github.com/gatsby-uc/plugins/pull/260) [`7c07006`](https://github.com/gatsby-uc/plugins/commit/7c07006c0464a4219d89f0885d5811d01d8459ba) Thanks [@moonmeister](https://github.com/moonmeister)! - Adding Type checking for all TS files and fixing type issues. - -- [#249](https://github.com/gatsby-uc/plugins/pull/249) [`b11a1b0`](https://github.com/gatsby-uc/plugins/commit/b11a1b04ac3cb7b9304545af82f2ff1aae5b04bd) Thanks [@renovate](https://github.com/apps/renovate)! - Update testing configs and implementation for speed and Jest 29 update. - -## 0.9.3 - -### Patch Changes - -- [#258](https://github.com/gatsby-uc/plugins/pull/258) [`ca806e9`](https://github.com/gatsby-uc/plugins/commit/ca806e94b03d7ecbe3f529d397151096175fa04d) Thanks [@moonmeister](https://github.com/moonmeister)! - fix(gatsby-plugin-fastify): Fix https://github.com/gatsby-uc/plugins/issues/257 where passing query parameters to SSR routes was causing 500. - -## 0.9.2 - -### Patch Changes - -- [#253](https://github.com/gatsby-uc/plugins/pull/253) [`d7ace2d`](https://github.com/gatsby-uc/plugins/commit/d7ace2dc1076feb3ef60e5c132cd86c8701c6908) Thanks [@klyngen](https://github.com/klyngen)! - Fallback routes get SSR-support - -## 0.9.1 - -### Patch Changes - -- [#217](https://github.com/gatsby-uc/plugins/pull/217) [`029cab4`](https://github.com/gatsby-uc/plugins/commit/029cab4ede52db8c7ac315a124d73536c2155bfd) Thanks [@renovate](https://github.com/apps/renovate)! - chore(gatsby-plugin-fastify): update dependency @types/node to ^14.18.28 - -## 0.9.0 - -### Minor Changes - -- [#245](https://github.com/gatsby-uc/plugins/pull/245) [`5f4decc`](https://github.com/gatsby-uc/plugins/commit/5f4decc6554ad6755e51daf01a4192307158956d) Thanks [@moonmeister](https://github.com/moonmeister)! - Upgraded fastify to v4 and bumped majors on related and unrelated packages. - - ## Breaking Changes - - - Logging no longer defaults to "pretty print" unless the environment variable`NODE_ENV` equals `development`. - - - Changes were made to the static file servers config. This fixed issues introduced by fastify updates. While this didn't break tests or knowingly intoduce bugs please let us know if you see any behavior changes. - -### Patch Changes - -- [#243](https://github.com/gatsby-uc/plugins/pull/243) [`8116411`](https://github.com/gatsby-uc/plugins/commit/8116411db4130b8c33ad27da9994095f4323e2eb) Thanks [@renovate](https://github.com/apps/renovate)! - chore(gatsby-plugin-fastify): update non-major dependency versions - -- [#241](https://github.com/gatsby-uc/plugins/pull/241) [`35ba22d`](https://github.com/gatsby-uc/plugins/commit/35ba22de4d10f1402b113880567f561aff4056ab) Thanks [@renovate](https://github.com/apps/renovate)! - chore(all-build-deps): update build tooling - -- [#227](https://github.com/gatsby-uc/plugins/pull/227) [`a08f176`](https://github.com/gatsby-uc/plugins/commit/a08f176070950d0bc63b00ec74c173f14c50b4bf) Thanks [@tsdexter](https://github.com/tsdexter)! - chore(gatsby-plugin-fastify): Update README.md - -## 0.8.1 - -### Patch Changes - -- [#202](https://github.com/gatsby-uc/plugins/pull/202) [`9ced9cb`](https://github.com/gatsby-uc/plugins/commit/9ced9cbc77b2eac88790ced90d8dcf401e258a55) Thanks [@moonmeister](https://github.com/moonmeister)! - Implemented the new "Gatsby Image CDN" from Gatsby Cloud. See the docs for getting started. - -## 0.8.0 - -### Minor Changes - -- [#176](https://github.com/gatsby-uc/plugins/pull/176) [`f556171`](https://github.com/gatsby-uc/plugins/commit/f556171cfbd44a379960a9bceb9f52b081f9ef8c) Thanks [@moonmeister](https://github.com/moonmeister)! - This plugin's focus is on serving the web app. Compression should be handled by an edge server (e.g. Nginx). Therefore we are removing this feature, this should not break an existing config, though you may see a warning during build if you explicitly set the compression setting in your `gatsby-config.js`. - -* [#200](https://github.com/gatsby-uc/plugins/pull/200) [`4a291b1`](https://github.com/gatsby-uc/plugins/commit/4a291b16d9fab8989ae045845a6ac95b11d1a7d3) Thanks [@moonmeister](https://github.com/moonmeister)! - We're nolonger treating the fastify plugins as public API. They've been removed from docs. If you're using them you may continue to do so at your own risk. If you'd like to contribute to help make these publically maintainable please open an issue. - -### Patch Changes - -- [#199](https://github.com/gatsby-uc/plugins/pull/199) [`eec780b`](https://github.com/gatsby-uc/plugins/commit/eec780bc8643bc5b2b5da9b85fc221c14cec743b) Thanks [@moonmeister](https://github.com/moonmeister)! - Did some reworking of redirects and added support for Gatsby's new Reverse Proxy functionality. - -## 0.7.5 - -### Patch Changes - -- [#187](https://github.com/gatsby-uc/plugins/pull/187) [`48c3369`](https://github.com/gatsby-uc/plugins/commit/48c336942ad638f1fb7483460ceb8fc4607ef3cc) Thanks [@renovate](https://github.com/apps/renovate)! - chore(gatsby-plugin-fastify): update non-major dependency versions - -## 0.7.4 - -### Patch Changes - -- [#177](https://github.com/gatsby-uc/plugins/pull/177) [`4c1365d`](https://github.com/gatsby-uc/plugins/commit/4c1365d639ecb1f0409d72db4e15593706d82639) Thanks [@jrotering](https://github.com/jrotering)! - Updated broken fastify documentation links & fixed typo - -## 0.7.3 - -### Patch Changes - -- [#163](https://github.com/gatsby-uc/plugins/pull/163) [`a3c5e55`](https://github.com/gatsby-uc/plugins/commit/a3c5e55542ad0b3dd97afcc04d686a00d44bdbe3) Thanks [@renovate](https://github.com/apps/renovate)! - chore(gatsby-plugin-fastify): update gatsby monorepo (major) - -* [#150](https://github.com/gatsby-uc/plugins/pull/150) [`1d9f473`](https://github.com/gatsby-uc/plugins/commit/1d9f4732872028be5cd8e77e7af15c478d392311) Thanks [@renovate](https://github.com/apps/renovate)! - chore(gatsby-plugin-fastify): update non-major dependency versions - -## 0.7.2 - -### Patch Changes - -- [`5d1f1bf`](https://github.com/gatsby-uc/plugins/commit/5d1f1bf7989c119540760dc40ae7bc4dcf822836) Thanks [@moonmeister](https://github.com/moonmeister)! - Update package dependencies - -## 0.7.1 - -### Patch Changes - -- [#128](https://github.com/gatsby-uc/plugins/pull/128) [`331bf7d`](https://github.com/gatsby-uc/plugins/commit/331bf7d2464701f8dab39c8e680efa3c996f056b) Thanks [@renovate](https://github.com/apps/renovate)! - fix(gatsby-plugin-fastify): update non-major dependency versions - -## 0.7.0 - -### Minor Changes - -- [#124](https://github.com/gatsby-uc/plugins/pull/124) [`e93dc62`](https://github.com/gatsby-uc/plugins/commit/e93dc62044ce2ac2069d80c339247901b4416ece) Thanks [@moonmeister](https://github.com/moonmeister)! - Updated "client path" name to "client routes" for consistency. Imports changed to `import { handleClientOnlyRoutes } from "./clientRoutes";` - -* [#124](https://github.com/gatsby-uc/plugins/pull/124) [`e93dc62`](https://github.com/gatsby-uc/plugins/commit/e93dc62044ce2ac2069d80c339247901b4416ece) Thanks [@moonmeister](https://github.com/moonmeister)! - Remove fastify plugins from peer deps to normal dependencies. Only Gatsby and fastify are peer deps now. - -- [#123](https://github.com/gatsby-uc/plugins/pull/123) [`acbf356`](https://github.com/gatsby-uc/plugins/commit/acbf356b305eff55f4ef96c77fbb47b2360319da) Thanks [@moonmeister](https://github.com/moonmeister)! - Set the HTTP response code when `status` is returned from `getServerData`. https://www.gatsbyjs.com/docs/reference/release-notes/v4.2/#getserverdata-improvements - -## 0.6.1 - -### Patch Changes - -- [#112](https://github.com/gatsby-uc/plugins/pull/112) [`529590e`](https://github.com/gatsby-uc/plugins/commit/529590eb9e83ec4188ad9ef23eca9c9d14fb8729) Thanks [@renovate](https://github.com/apps/renovate)! - chore(gatsby-plugin-fastify): update non-major dependency versions - -## 0.6.0 - -### Minor Changes - -- [#68](https://github.com/gatsby-uc/plugins/pull/68) [`e736248`](https://github.com/gatsby-uc/plugins/commit/e736248513e6bdbeb29cbedd06b79ed40ac0294f) Thanks [@moonmeister](https://github.com/moonmeister)! - feat: much improved logging - -* [#68](https://github.com/gatsby-uc/plugins/pull/68) [`e736248`](https://github.com/gatsby-uc/plugins/commit/e736248513e6bdbeb29cbedd06b79ed40ac0294f) Thanks [@moonmeister](https://github.com/moonmeister)! - feat: add support for Gatsby 500 error if SSR/DSG throws an error. - -- [#68](https://github.com/gatsby-uc/plugins/pull/68) [`e736248`](https://github.com/gatsby-uc/plugins/commit/e736248513e6bdbeb29cbedd06b79ed40ac0294f) Thanks [@moonmeister](https://github.com/moonmeister)! - Support for Gatsby v4's DSG and SSR routes. - -### Patch Changes - -- [#68](https://github.com/gatsby-uc/plugins/pull/68) [`e736248`](https://github.com/gatsby-uc/plugins/commit/e736248513e6bdbeb29cbedd06b79ed40ac0294f) Thanks [@moonmeister](https://github.com/moonmeister)! - Fix: SSR/DSG routes throwing non-fatal error when returning file. - -* [#68](https://github.com/gatsby-uc/plugins/pull/68) [`e736248`](https://github.com/gatsby-uc/plugins/commit/e736248513e6bdbeb29cbedd06b79ed40ac0294f) Thanks [@moonmeister](https://github.com/moonmeister)! - fix: handle situations where dev doesn't provide 404 page by falling back to generic 404. - -## 0.5.0 - -### Minor Changes - -- [#100](https://github.com/gatsby-uc/plugins/pull/100) [`fec2c31`](https://github.com/gatsby-uc/plugins/commit/fec2c31d1d64a51d6b99297ff0c1345ec2f4bad3) Thanks [@moonmeister](https://github.com/moonmeister)! - Implemented better logging. This means we removed teh "verbose" flag from the CLI in favor of a "logLevel" flag. See docs for more info. - -* [#97](https://github.com/gatsby-uc/plugins/pull/97) [`09bb2c2`](https://github.com/gatsby-uc/plugins/commit/09bb2c272f7127a732e1ad54d2b8fb38db054523) Thanks [@moonmeister](https://github.com/moonmeister)! - Implemented testing and that came with some minor changes and fixes. - -## 0.4.5 - -### Patch Changes - -- [#95](https://github.com/gatsby-uc/plugins/pull/95) [`7007934`](https://github.com/gatsby-uc/plugins/commit/700793427bf754a8449717179d51dabe76096d81) Thanks [@moonmeister](https://github.com/moonmeister)! - Add 404 handler for Gatsby functions to not use default Gatsby 404. thus any unknown route under "/api" now just returns a 404 and not found text. - -## 0.4.4 - -### Patch Changes - -- [#87](https://github.com/gatsby-uc/plugins/pull/87) [`5529aad`](https://github.com/gatsby-uc/plugins/commit/5529aadf0f65c4b0c193131d606c3ce7d8d06651) Thanks [@moonmeister](https://github.com/moonmeister)! - Update main server execution to use async/await from callbacks - -## 0.4.3 - -### Patch Changes - -- [#82](https://github.com/gatsby-uc/plugins/pull/82) [`eb12e74`](https://github.com/gatsby-uc/plugins/commit/eb12e74e05268ee7778f00711772749cd7d8ab6c) Thanks [@renovate](https://github.com/apps/renovate)! - chore(gatsby-plugin-fastify): update non-major dependency versions - -* [#85](https://github.com/gatsby-uc/plugins/pull/85) [`80aa8f3`](https://github.com/gatsby-uc/plugins/commit/80aa8f39c79bed433b47dad39810767710d0bdd2) Thanks [@moonmeister](https://github.com/moonmeister)! - chore(gatsby-plugin-fastify): Misc cleanup and typing improvements - -## 0.4.2 - -### Patch Changes - -- [#77](https://github.com/gatsby-uc/plugins/pull/77) [`30f7ac4`](https://github.com/gatsby-uc/plugins/commit/30f7ac4bb5c39374b79ed900b3aab60f9c44774a) Thanks [@renovate](https://github.com/apps/renovate)! - chore(gatsby-plugin-fastify): bump non-major package updates. This includes important security fixes for `fastify-static`. - -## 0.4.1 - -### Patch Changes - -- [#62](https://github.com/gatsby-uc/plugins/pull/62) [`79a49d6`](https://github.com/gatsby-uc/plugins/commit/79a49d63ef6fbb9ad997545e9e692f16b9e04ec3) Thanks [@renovate](https://github.com/apps/renovate)! - chore(gatsby-plugin-fastify): update non-major updates - Updated patch/minor updates in dependencies diff --git a/packages/gatsby-plugin-fastify/CONTRIBUTING.md b/packages/gatsby-plugin-fastify/CONTRIBUTING.md deleted file mode 100644 index 823f475e2..000000000 --- a/packages/gatsby-plugin-fastify/CONTRIBUTING.md +++ /dev/null @@ -1,11 +0,0 @@ -## Intro - -Thanks for your interest. There are two important things to know. - -## Testing - -Running `yarn test` will run tests. Make sure they pass when you start, and then keep them passing as you fix things and add features. If you're fixing a specific bug I'd recommend creating a test that fails before it is fixed so keep the bug from regressing. If you're adding a new feature, please write tests for the new feature. - -## Benchmarks - -When fixing bugs or adding features it'simportant to make sure our servers are fast. You can run benchmarks by building `integration-tests/plugin-fastify` via `yarn build` then run benchmarks with `yarn benchmark` from the `integration-tests/plugin-fastify` folder. To keep things consistent, shutdown as many other applications as possible. diff --git a/packages/gatsby-plugin-fastify/README.md b/packages/gatsby-plugin-fastify/README.md deleted file mode 100644 index 83fc22339..000000000 --- a/packages/gatsby-plugin-fastify/README.md +++ /dev/null @@ -1,257 +0,0 @@ -

- Gatsby + Fastify -

-

-

gatsby-plugin-fastify

-

-

- - Gatsby plugin for easy integration with Fastify. - -

-

- MIT License - NPM version - npm peer dependency version - npm peer dependency version -

- -# About - -`gatsby-plugin-fastify` gives you a way to integrate your Gatsby site with a Node.js server using Fastify. Use to serve a standard Gatsby.js site normally - the plugin will take care of everything: - -- Serving [Gatsby Functions](https://www.gatsbyjs.com/docs/reference/functions/) -- Serving [static files](https://www.gatsbyjs.com/docs/caching/#static-files) -- Serving [DSG](https://www.gatsbyjs.com/docs/reference/rendering-options/deferred-static-generation/)/[SSR](https://www.gatsbyjs.com/docs/reference/rendering-options/server-side-rendering/) Routes -- Gatsby [404 page](https://www.gatsbyjs.com/docs/how-to/adding-common-features/add-404-page/) -- Gatsby [500 page](https://www.gatsbyjs.com/docs/how-to/adding-common-features/add-500-page/) -- Gatsby [redirects](https://www.gatsbyjs.com/docs/reference/config-files/actions/#createRedirect) -- Gatsby [reverse proxy](https://support.gatsbyjs.com/hc/en-us/articles/1500003051241-Working-with-Redirects-and-Rewrites) -- [Client-only routes](https://www.gatsbyjs.com/docs/how-to/routing/client-only-routes-and-user-authentication) -- Serving the site with [pathPrefix](https://www.gatsbyjs.com/docs/how-to/previews-deploys-hosting/path-prefix/) - set it up inside `gatsby-config.js`, the plugin will take care of it -- Etags, and more. - -# Installation - -Install the plugin using npm or yarn - -```sh -npm install gatsby-plugin-fastify fastify -``` - -and add it to your `gatsby-config.js` - -```js -module.exports = { - /* Site config */ - plugins: [ - /* Rest of the plugins */ - { - resolve: `gatsby-plugin-fastify`, - options: { - /* discussed below */ - }, // All options are optional - }, - ], -}; -``` - -# Serving your site - -Node and Fastify are great for building application specific web servers but generally should not be used on the edge. Meaning, most folks will use a fully fledged web server (e.g. [Nginx](https://www.nginx.com/) or [Caddy](https://caddyserver.com/) that handles traffic before passing it back to the Node server. This edge server may handle caching, TLS/SSL, load balancing, compression, etc. Then the Node server only worries about the application. A CDN (e.g. Fastly or CloudFlare ) is also often used for performance and scalability. - -## Server CLI (expected) - -This plugin implements a server that's ready to go. To use this you can configure a `start`(or whatever you prefer) command in your `package.json`: - -```json -{ - "scripts": { - "start": "gserve" - } -} -``` - -### CLI Config - -``` - Server - -p, --port Port to run the server on [number] [default: "8080"] - -h, --host Host to run the server on [string] [default: "127.0.0.1"] - -o, --open Open the browser [boolean] [default: false] - -Options: - --help Show help [boolean] - --version Show version number [boolean] - -l, --logLevel set logging level - [string] [choices: "trace", "debug", "info", "warn", "error", "fatal"] - [default: "info"] -``` - -All settings may be change via environment variables prefixed with `GATSBY_SERVER_` and the flag name. - -```sh -# For example: -export GATSBY_SERVER_PORT=3000 -export GATSBY_SERVER_HOST=0.0.0.0 -# cammelCase is converted to SCREAMING_SNAKE_CASE. -export GATSBY_SERVER_LOG_LEVEL=debug -``` - -### Logging - -For info on logging see Fastify's [documentation on logging](https://www.fastify.io/docs/latest/Reference/Logging/). - -## Fastify Server Options - -You may directly [configure the Fastify server](https://www.fastify.io/docs/latest/Reference/Server/#factory) from the plugin options in Gatsby config. While many options fastify provides are safe to modify, it's very possible to break your server with these as well, test well. Outside the defaults any values passed are not type checked by Gatsby for compatibility, make sure you are passing valid values as defined in the [Fastify server factory docs](https://www.fastify.io/docs/latest/Reference/Server/#factory). - -```js -module.exports = { - /* Site config */ - plugins: [ - /* Rest of the plugins */ - { - resolve: `gatsby-plugin-fastify`, - /* Default option value shown */ - options: { - fastify: { - logger: { level: /* defaults to info by CLI params*/ }, - ignoreTralingSlash: true, - maxParamLength: 500, - // for complete options see https://www.fastify.io/docs/latest/Reference/Server/#factory - }, - }, - }, - ], -}; -``` - -## Features - -Some features can be disabled through the plugin options. This will not provide increased performance but is probided as an option to control features in certain deploys or to handoff certain features to an edge server or CDN as desired. - -```js -module.exports = { - /* Site config */ - plugins: [ - /* Rest of the plugins */ - { - resolve: `gatsby-plugin-fastify`, - /* Default option value shown */ - options: { - features: { - redirects: true, - reverseProxy: true, - imageCdn: false, // Feature in Beta, use with caution - }, - }, - }, - ], -}; -``` - -### Gatsby Image CDN (BETA) - -> **BETA:** This feature is under going active development to fix bugs and extend functionality by the Gatsby team. I'm releasing this feature here with compatability for `gatsby@4.12.1`, `gatsby-source-wordpres@6.12.1`, and `gatsby-source-contentful@7.10.0` No guarantee it works on newer or older versions. - -While not strictly a CDN in our case this still implements the ability for Images to be transformed outside of build time. - -> Please note that this writes generated images to the `/public/\_gatsby folder. This must be writeable in production. - -This will be enabled by default if your version of Gatsby supports the image CDN. You may manually disable it in the config if you don't need it. - -### Gatsby Reverse Proxy - -Building on top of the `createRedirects` API Gatsby Cloud now supports reverse proxies. We've implemented this feature here as well. - -```js -// gatsby-node.js -createRedirect({ - fromPath: `/docs/`, - toPath: `https://www.awesomesite.com/docs/`, - statusCode: 200, // The 200 is required to denote a proxy response as opposed to a redirect -}); -``` - -> The Gatsby docs note ending the to and from paths with `*`. This is not allowed in this plugin. If included they are stripped for compatibility. - -### Gatsby Redirects - -We support the use of `statusCode` but do not currently support `conditions`, `ignoreCase`, or `force` as discussed in the [`createRedirect` docs](https://www.gatsbyjs.com/docs/reference/config-files/actions/#createRedirect). - -For various reasons discussed in [this article](https://kinsta.com/knowledgebase/307-redirect/), the `isPermanent` boolean toggles HTTP `307 Temporray Redirect` and `308 Permanent Redirect` instead of `301 Moved Permanently` and `302 Found`. If you need to use `statusCode` onyour redirects to explicitly set the response code. - -Our implementation supports dynamic redirects as shown by [Gatsby Cloud Docs](https://www.gatsbyjs.com/docs/how-to/cloud/working-with-redirects-and-rewrites/). - -Basic, splat, wildcard, and Querystring splat redirects should all work. e.g. : - -```js -createRedirect({ - fromPath: "/perm-redirect", - toPath: "/posts/page-1", -}); -createRedirect({ - fromPath: "/redirect/:letter", // `/redirect/a` - toPath: "/app/:letter", // `/app/a` -}); -createRedirect({ - fromPath: "/redirect-query?example=:example", // `/redirect-query?example=test` - toPath: "/app/:example", // `/app/test` -}); -createRedirect({ - fromPath: "/redirect-query-query?example=:example", // `/redirect-query-query?example=test` - fromPath: "/redirect-query-query?example=:example", // `/app?example=test` - toPath: "/app?example=:example", -}); -createRedirect({ - fromPath: "/redirect-all/*", // `/redirect-all/example` - toPath: "/app/*", // `/app/example` -}); -createRedirect({ - fromPath: "/redirect-all2/*", // `/redirect-all2/abc/124` | `/redirect-all2/abc/152` - toPath: "/app/", // `/app/` -}); -``` - -Due to router diferences we have to handle non-splat style query string redirects specially. But they cannot be combined with splat or wildcard routes e.g. - -```js -// This works -createRedirect({ - fromPath: "/redirect-query-specific?id=2", - toPath: "/file.pdf", -}); - -// These will not work -createRedirect({ - fromPath: "/redirect-query-specific?id=2&example=:example", - toPath: "/:example/file.pdf", -}); -createRedirect({ - fromPath: "/redirect-query-specific/*?id=2", - toPath: "/*file.pdf", -}); -``` - -> **Note:** While these combos don't currently work it's not imposible to implement such a feature. If you need this feature please consider contributing. - -### Gatsby Functions - -Gatsby's [function docs](https://www.gatsbyjs.com/docs/reference/functions/getting-started/) suggest that the `Request` and `Response` objects for your Gatsby functions will be _Express like_ and provide the types from the Gatsby core for these. - -> **THIS IS NOT TRUE FOR THIS PLUGIN** - -Because we're not using Express or Gatsby's own cloud offering functions will need to use Fastify's own [`Request`](https://www.fastify.io/docs/latest/Reference/Request/) and [`Reply`](https://www.fastify.io/docs/latest/Reference/Reply/) API. - -```ts -import type { FastifyRequest, FastifyReply } from "fastify"; - -export default function handler(req: FastifyRequest, res: FastifyReply) { - res.send(`I am TYPESCRIPT`); -} -``` - -### Gatsby Routing - -We have implemented a compatability layer to support the Gatsby flavor of routing for [Gatsby Functions](https://www.gatsbyjs.com/docs/reference/functions/routing/) and [File System Routing API](https://www.gatsbyjs.com/docs/reference/routing/file-system-route-api/#syntax-client-only-routes). This should be transparent and if you follow the Gatsby docs for routing we should now support all those modes. This very well might not be perfect, if you have issues with routing please file a bug with a reproduction. diff --git a/packages/gatsby-plugin-fastify/gatsby-node.js b/packages/gatsby-plugin-fastify/gatsby-node.js deleted file mode 100644 index 80bdcf994..000000000 --- a/packages/gatsby-plugin-fastify/gatsby-node.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./dist/gatsby-node"); diff --git a/packages/gatsby-plugin-fastify/index.js b/packages/gatsby-plugin-fastify/index.js deleted file mode 100644 index 48d277392..000000000 --- a/packages/gatsby-plugin-fastify/index.js +++ /dev/null @@ -1 +0,0 @@ -//noop diff --git a/packages/gatsby-plugin-fastify/jest.config.js b/packages/gatsby-plugin-fastify/jest.config.js deleted file mode 100644 index ff9acd3fa..000000000 --- a/packages/gatsby-plugin-fastify/jest.config.js +++ /dev/null @@ -1,11 +0,0 @@ -// For a detailed explanation regarding each configuration property, visit: -// https://jestjs.io/docs/en/configuration.html - -const sharedConfig = require("../../shared/jest.config"); - -module.exports = { - ...sharedConfig, - transformIgnorePatterns: ["/query-engine/", "/page-ssr/"], - coveragePathIgnorePatterns: ["/query-engine/", "/page-ssr/"], - setupFilesAfterEnv: ["/src/__tests__/__utils__/setup-file.js"], -}; diff --git a/packages/gatsby-plugin-fastify/logo.png b/packages/gatsby-plugin-fastify/logo.png deleted file mode 100644 index e13248170..000000000 Binary files a/packages/gatsby-plugin-fastify/logo.png and /dev/null differ diff --git a/packages/gatsby-plugin-fastify/package.json b/packages/gatsby-plugin-fastify/package.json deleted file mode 100644 index 2834e5b10..000000000 --- a/packages/gatsby-plugin-fastify/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "gatsby-plugin-fastify", - "description": "Gatsby plugin for integration serving gatsby on Node.js using Fastify.", - "version": "0.13.4", - "homepage": "https://github.com/gatsby-uc/plugins/blob/main/packages/gatsby-plugin-fastify/README.md", - "repository": { - "type": "git", - "url": "https://github.com/gatsby-uc/plugins.git", - "directory": "packages/gatsby-plugin-fastify" - }, - "contributors": [ - "Alex Moon " - ], - "license": "MIT", - "keywords": [ - "gatsby", - "gatsby-plugin", - "gatsby-plugin-fastify", - "nodejs", - "server", - "fastify" - ], - "bin": { - "gserve": "./dist/cli.js" - }, - "scripts": { - "build": "babel src --out-dir ./dist --ignore \"**/__tests__,**/*.d.ts\" --extensions \".ts,.js\"", - "pretest": "cd ../../integration-tests/plugin-fastify/ && yarn run build", - "test:disable": "jest --coverage", - "watch": "yarn build --watch" - }, - "dependencies": { - "@babel/runtime": "^7.25.7", - "@fastify/accepts": "^4.3.0", - "@fastify/http-proxy": "^8.4.0", - "@fastify/middie": "^8.3.3", - "@fastify/static": "^6.12.0", - "fastify-plugin": "^4.5.1", - "fs-extra": "^11.2.0", - "gatsby-core-utils": "^4.13.1", - "gatsby-plugin-utils": "^4.13.1", - "http-status-codes": "^2.3.0", - "mime": "^3.0.0", - "open": "^8.4.2", - "picomatch": "^2.3.1", - "yargs": "^17.7.2" - }, - "devDependencies": { - "@babel/cli": "^7.25.7", - "@babel/core": "^7.25.8", - "@types/connect": "^3.4.38", - "@types/fs-extra": "^11.0.4", - "@types/jest": "^29.5.13", - "@types/mime": "^3.0.4", - "@types/node": "^20.16.11", - "@types/picomatch": "^2.3.4", - "@types/yargs": "^17.0.33", - "babel-jest": "^29.7.0", - "babel-preset-gatsby-package": "^3.13.1", - "cross-env": "^7.0.3", - "jest": "^29.7.0" - }, - "peerDependencies": { - "fastify": "^4.5.3", - "gatsby": "^4.2.0 || ^5.0.0" - }, - "engines": { - "node": ">=14.15.0" - } -} diff --git a/packages/gatsby-plugin-fastify/src/__tests__/__files__/public/404.html b/packages/gatsby-plugin-fastify/src/__tests__/__files__/public/404.html deleted file mode 100644 index 58c988e2c..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/__files__/public/404.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Gatsby Plugin Fastify - - - -

Page Not Found

- - - \ No newline at end of file diff --git a/packages/gatsby-plugin-fastify/src/__tests__/__files__/public/app/[...]/index.html b/packages/gatsby-plugin-fastify/src/__tests__/__files__/public/app/[...]/index.html deleted file mode 100644 index a6e9a619b..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/__files__/public/app/[...]/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Gatsby Plugin Fastify - Client Side Route - - - -

Welcome to the CSR!

- - - \ No newline at end of file diff --git a/packages/gatsby-plugin-fastify/src/__tests__/__files__/public/index.html b/packages/gatsby-plugin-fastify/src/__tests__/__files__/public/index.html deleted file mode 100644 index cf3c3aeb5..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/__files__/public/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Gatsby Plugin Fastify - - - -

Hello World

- - - \ No newline at end of file diff --git a/packages/gatsby-plugin-fastify/src/__tests__/__files__/public/posts/page-1/index.html b/packages/gatsby-plugin-fastify/src/__tests__/__files__/public/posts/page-1/index.html deleted file mode 100644 index 7d75c6c93..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/__files__/public/posts/page-1/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Gatsby Plugin Fastify - - - -

Hello Static world

- - - \ No newline at end of file diff --git a/packages/gatsby-plugin-fastify/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-plugin-fastify/src/__tests__/__snapshots__/gatsby-node.js.snap deleted file mode 100644 index 122faef8d..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/__snapshots__/gatsby-node.js.snap +++ /dev/null @@ -1,69 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Gatsby Node API Should Build Config 1`] = ` -{ - "clientSideRoutes": [ - { - "matchPath": "/app*", - "path": "/app/[...]/", - }, - ], - "fakeOption": "fakeValue", - "functions": [ - { - "absoluteCompiledFilePath": "/Users/user/code/gatsby-uc/plugins/integration-tests/plugin-fastify/.cache/functions/splat/:splat.js", - "functionRoute": "splat/:splat", - "originalAbsoluteFilePath": "/Users/user/code/gatsby-uc/plugins/integration-tests/plugin-fastify/src/api/splat/:splat.js", - "originalRelativeFilePath": "splat/:splat.js", - "pluginName": "default-site-plugin", - "relativeCompiledFilePath": "splat/:splat.js", - }, - { - "absoluteCompiledFilePath": "/Users/user/code/gatsby-uc/plugins/integration-tests/plugin-fastify/.cache/functions/test.js", - "functionRoute": "test", - "originalAbsoluteFilePath": "/Users/user/code/gatsby-uc/plugins/integration-tests/plugin-fastify/src/api/test.js", - "originalRelativeFilePath": "test.js", - "pluginName": "default-site-plugin", - "relativeCompiledFilePath": "test.js", - }, - ], - "prefix": "/test", - "proxies": [], - "redirects": [ - { - "fromPath": "/perm-redirect", - "ignoreCase": true, - "isPermanent": true, - "redirectInBrowser": false, - "toPath": "/posts/page-1", - }, - { - "fromPath": "/temp-redirect", - "ignoreCase": true, - "isPermanent": false, - "redirectInBrowser": false, - "toPath": "/posts/page-2", - }, - { - "fromPath": "/alt-redirect", - "ignoreCase": true, - "isPermanent": false, - "redirectInBrowser": false, - "statusCode": 307, - "toPath": "/posts/page-3", - }, - ], - "serverSideRoutes": [ - { - "matchPath": "/ssr", - "mode": "SSR", - "path": "/ssr", - }, - { - "matchPath": "/my/dsg/path", - "mode": "DSG", - "path": "/my/dsg/path", - }, - ], -} -`; diff --git a/packages/gatsby-plugin-fastify/src/__tests__/__utils__/config.js b/packages/gatsby-plugin-fastify/src/__tests__/__utils__/config.js deleted file mode 100644 index 8e4de88b6..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/__utils__/config.js +++ /dev/null @@ -1,27 +0,0 @@ -import Fastify from "fastify"; -import { getConfig } from "../../utils/config"; -import { createFastifyConfig } from "../../utils/server"; - -export function createCliConfig({ host, port, logLevel, open }) { - return { - host, - h: host, - port, - p: port, - logLevel, - l: logLevel, - open, - o: open, - }; -} - -export async function createFastifyInstance(plugin) { - const config = getConfig(); - - const fastify = Fastify(createFastifyConfig(config)); - - await fastify.register(plugin, { prefix: config.server.prefix }); - await fastify.ready(); - - return fastify; -} diff --git a/packages/gatsby-plugin-fastify/src/__tests__/__utils__/server.js b/packages/gatsby-plugin-fastify/src/__tests__/__utils__/server.js deleted file mode 100644 index 9efd442c6..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/__utils__/server.js +++ /dev/null @@ -1,32 +0,0 @@ -import { serveGatsby } from "../../plugins/gatsby"; -import { setConfig, getServerConfig, ConfigKeyEnum } from "../../utils/config"; -import { createCliConfig, createFastifyInstance } from "./config"; - -jest.mock("../../utils/constants", () => ({ - ...jest.requireActual("../../utils/constants"), - PATH_TO_FUNCTIONS: "../../integration-tests/plugin-fastify/.cache/functions/", - PATH_TO_PUBLIC: "src/__tests__/__files__/public", - PATH_TO_CACHE: "../../integration-tests/plugin-fastify/.cache", - CONFIG_FILE_PATH: "../../integration-tests/plugin-fastify/.cache", -})); - -export async function setupFastify(options) { - const overrideServerConfig = options?.overrideServerConfig ?? {}; - setConfig( - ConfigKeyEnum.CLI, - createCliConfig({ - port: 3000, - host: "127.0.0.1", - logLevel: "fatal", - open: false, - }), - ); - - setConfig(ConfigKeyEnum.SERVER, { ...getServerConfig(), ...overrideServerConfig }); - - return createFastifyInstance(serveGatsby); -} - -export async function shutdownFastify(fastify) { - return fastify.close(); -} diff --git a/packages/gatsby-plugin-fastify/src/__tests__/__utils__/setup-file.js b/packages/gatsby-plugin-fastify/src/__tests__/__utils__/setup-file.js deleted file mode 100644 index b8de0dd58..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/__utils__/setup-file.js +++ /dev/null @@ -1,9 +0,0 @@ -import { setupFastify, shutdownFastify } from "./server"; - -beforeAll(async () => { - globalThis.fastify = await setupFastify(); -}); - -afterAll(async () => { - await shutdownFastify(globalThis.fastify); -}); diff --git a/packages/gatsby-plugin-fastify/src/__tests__/gatsby-node.js b/packages/gatsby-plugin-fastify/src/__tests__/gatsby-node.js deleted file mode 100644 index 1e35ec8a2..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/gatsby-node.js +++ /dev/null @@ -1,121 +0,0 @@ -import { onPostBuild } from "../gatsby-node"; -import fs from "fs-extra"; - -jest.mock("../utils/constants", () => ({ - ...jest.requireActual("../utils/constants"), - PATH_TO_FUNCTIONS: "../../integration-tests/plugin-fastify/.cache/functions/", - PATH_TO_PUBLIC: process.cwd() + "/__files__/public/", - PATH_TO_CACHE: "../../integration-tests/plugin-fastify/.cache/", - CONFIG_FILE_PATH: "../../integration-tests/plugin-fastify/.cache/", -})); - -jest.mock("fs-extra", () => ({ - existsSync: jest.fn((path) => { - if (path.includes(".cache/functions")) { - return true; - } - return false; - }), - mkdir: jest.fn(), - writeJSON: jest.fn(), - readJSON: jest.fn((path) => { - if (path.includes("manifest.json")) { - return [ - { - functionRoute: "splat/:splat", - pluginName: "default-site-plugin", - originalAbsoluteFilePath: - "/Users/user/code/gatsby-uc/plugins/integration-tests/plugin-fastify/src/api/splat/:splat.js", - originalRelativeFilePath: "splat/:splat.js", - relativeCompiledFilePath: "splat/:splat.js", - absoluteCompiledFilePath: - "/Users/user/code/gatsby-uc/plugins/integration-tests/plugin-fastify/.cache/functions/splat/:splat.js", - }, - { - functionRoute: "test", - pluginName: "default-site-plugin", - originalAbsoluteFilePath: - "/Users/user/code/gatsby-uc/plugins/integration-tests/plugin-fastify/src/api/test.js", - originalRelativeFilePath: "test.js", - relativeCompiledFilePath: "test.js", - absoluteCompiledFilePath: - "/Users/user/code/gatsby-uc/plugins/integration-tests/plugin-fastify/.cache/functions/test.js", - }, - ]; - } else { - throw new Error("Invalid path"); - } - }), -})); - -const pathPrefix = "/test"; -const store = { - getState: jest.fn(() => ({ - program: { - directory: process.cwd() + "/__files__/", - }, - pages: [ - { - fakePage: "fakeValue", - path: "/", - }, - { - matchPath: "/app/*", - path: "/app/[...]/", - }, - { - path: "/ssr", - mode: "SSR", - }, - { - path: "/my/dsg/path", - mode: "DSG", - }, - ], - redirects: [ - { - fromPath: "/perm-redirect", - isPermanent: true, - ignoreCase: true, - redirectInBrowser: false, - toPath: "/posts/page-1", - }, - { - fromPath: "/temp-redirect", - isPermanent: false, - ignoreCase: true, - redirectInBrowser: false, - toPath: "/posts/page-2", - }, - { - fromPath: "/alt-redirect", - isPermanent: false, - ignoreCase: true, - redirectInBrowser: false, - toPath: "/posts/page-3", - statusCode: 307, - }, - ], - })), -}; - -const reporter = { - error: jest.fn((_message, error) => { - throw new Error(error); - }), -}; - -const pluginOptions = { - fakeOption: "fakeValue", -}; - -describe(`Gatsby Node API`, () => { - it(`Should Build Config`, async () => { - await onPostBuild({ store, reporter, pathPrefix }, pluginOptions); - - const writeJSONCall = fs.writeJSON.mock.calls[0]; - expect(fs.writeJSON).toHaveBeenCalledTimes(1); - expect(writeJSONCall[0]).toContain(".cache/gatsby-plugin-fastify.json"); - expect(writeJSONCall[1]).toMatchSnapshot(); - }); -}); diff --git a/packages/gatsby-plugin-fastify/src/__tests__/plugins/__snapshots__/client-routes.js.snap b/packages/gatsby-plugin-fastify/src/__tests__/plugins/__snapshots__/client-routes.js.snap deleted file mode 100644 index 4517062f1..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/plugins/__snapshots__/client-routes.js.snap +++ /dev/null @@ -1,35 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Client Side Routes Should handle base route 1`] = ` -" - - - - - - Gatsby Plugin Fastify - Client Side Route - - - -

Welcome to the CSR!

- - -" -`; - -exports[`Client Side Routes Should handle sub routes 1`] = ` -" - - - - - - Gatsby Plugin Fastify - Client Side Route - - - -

Welcome to the CSR!

- - -" -`; diff --git a/packages/gatsby-plugin-fastify/src/__tests__/plugins/__snapshots__/functions.js.snap b/packages/gatsby-plugin-fastify/src/__tests__/plugins/__snapshots__/functions.js.snap deleted file mode 100644 index 53aebb96e..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/plugins/__snapshots__/functions.js.snap +++ /dev/null @@ -1,7 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Gatsby Functions Should 404 on bad function route 1`] = `"Function not found."`; - -exports[`Gatsby Functions Should serve function route 1`] = `"[{"_id":"612d652f43f0c05240ed09b1","index":0,"guid":"ced90cbd-3fad-4c66-bd8d-678eebb3f319","isActive":true,"balance":"$3,289.14","picture":"http://placehold.it/32x32","age":34,"eyeColor":"blue","name":"Mcclure Cohen","gender":"male","company":"ONTALITY","email":"mcclurecohen@ontality.com","phone":"+1 (876) 555-3658","address":"933 Conklin Avenue, Joes, Indiana, 9109","about":"Do labore fugiat exercitation esse commodo dolor voluptate proident ullamco mollit eu. Dolor aliqua incididunt ex consectetur qui labore in laborum dolore mollit fugiat. Occaecat nisi ea nulla deserunt dolore aliqua consequat ipsum fugiat aliqua est sunt anim cillum. Nulla culpa dolore reprehenderit quis aliquip.\\r\\n","registered":"2016-03-02T03:01:11 +08:00","latitude":-13.438572,"longitude":116.414307,"tags":["Lorem","dolore","anim","mollit","ullamco","magna","elit"],"friends":[{"id":0,"name":"Burnett Farley"},{"id":1,"name":"Glenn Osborn"},{"id":2,"name":"Berry Schwartz"}],"greeting":"Hello, Mcclure Cohen! You have 7 unread messages.","favoriteFruit":"banana"},{"_id":"612d652f366d8330fa996824","index":1,"guid":"7101122e-8cea-4a02-b1b8-ae910c0802af","isActive":false,"balance":"$3,387.50","picture":"http://placehold.it/32x32","age":32,"eyeColor":"blue","name":"Geneva Valdez","gender":"female","company":"LIQUICOM","email":"genevavaldez@liquicom.com","phone":"+1 (974) 495-2314","address":"615 Waldorf Court, Belleview, New Jersey, 4579","about":"Sint anim sunt enim ea ea exercitation officia adipisicing aute. Cillum aliquip dolor mollit sunt sint. Sint excepteur sit ut eu culpa aute voluptate est non est sint do nostrud ut. Nostrud officia amet consectetur exercitation aliquip nulla occaecat. Irure voluptate aute irure quis aute ipsum.\\r\\n","registered":"2019-10-23T07:06:59 +07:00","latitude":4.157784,"longitude":79.800439,"tags":["Lorem","enim","sint","commodo","minim","tempor","consectetur"],"friends":[{"id":0,"name":"Teri Crane"},{"id":1,"name":"Colleen Burns"},{"id":2,"name":"Pierce Stafford"}],"greeting":"Hello, Geneva Valdez! You have 5 unread messages.","favoriteFruit":"banana"},{"_id":"612d652fac8efd8e645f7305","index":2,"guid":"9e49d2b8-2684-4a2b-8d34-2db63470105e","isActive":true,"balance":"$1,648.73","picture":"http://placehold.it/32x32","age":39,"eyeColor":"green","name":"Beth Pitts","gender":"female","company":"QUIZKA","email":"bethpitts@quizka.com","phone":"+1 (967) 452-3934","address":"209 Elm Avenue, Soham, South Dakota, 6752","about":"Excepteur est et cupidatat id nisi quis occaecat est non cillum. Dolore aliquip elit aliquip exercitation anim ad aliqua sint enim mollit anim. Nulla veniam amet labore consectetur nulla non culpa laboris non ea. Irure fugiat fugiat reprehenderit aute labore. Commodo enim velit sit sunt in eu adipisicing proident aliqua sit officia. Et cupidatat mollit est voluptate adipisicing ullamco ullamco. Elit in sint velit laboris fugiat.\\r\\n","registered":"2018-07-10T08:23:13 +07:00","latitude":-41.232792,"longitude":14.620843,"tags":["ipsum","voluptate","reprehenderit","fugiat","nulla","elit","dolore"],"friends":[{"id":0,"name":"Rosa Case"},{"id":1,"name":"Charlene Wilkinson"},{"id":2,"name":"Wilcox Shannon"}],"greeting":"Hello, Beth Pitts! You have 4 unread messages.","favoriteFruit":"apple"},{"_id":"612d652f86b888292e0537ea","index":3,"guid":"ae58b78c-46a4-4a09-b636-d86ebc84870c","isActive":false,"balance":"$1,820.92","picture":"http://placehold.it/32x32","age":38,"eyeColor":"blue","name":"Mack Parker","gender":"male","company":"GRONK","email":"mackparker@gronk.com","phone":"+1 (942) 455-3698","address":"340 Village Court, Spokane, Iowa, 7827","about":"Officia occaecat eu duis officia amet in ea ad mollit ut. Mollit non anim ex do. In esse commodo esse ullamco irure laborum officia enim deserunt et. Ut adipisicing aliqua qui anim fugiat duis magna culpa aliqua nisi ex tempor Lorem cupidatat. Aute Lorem ut fugiat reprehenderit fugiat velit. Eu occaecat esse sit anim ad.\\r\\n","registered":"2017-10-26T05:06:57 +07:00","latitude":62.176215,"longitude":50.081649,"tags":["eiusmod","esse","adipisicing","deserunt","minim","dolor","sint"],"friends":[{"id":0,"name":"Corinne Cleveland"},{"id":1,"name":"Janell Stevenson"},{"id":2,"name":"Ruiz Dalton"}],"greeting":"Hello, Mack Parker! You have 5 unread messages.","favoriteFruit":"banana"},{"_id":"612d652f918c5464a5d1badc","index":4,"guid":"16de477f-8260-4dbf-803a-0b9af672a7a3","isActive":false,"balance":"$2,015.74","picture":"http://placehold.it/32x32","age":40,"eyeColor":"brown","name":"Benton Garza","gender":"male","company":"CODACT","email":"bentongarza@codact.com","phone":"+1 (978) 544-3959","address":"723 Linden Street, Loma, Hawaii, 2183","about":"Veniam voluptate eiusmod est exercitation magna dolor cillum veniam. Anim culpa veniam adipisicing consequat sint adipisicing. Minim velit eu tempor enim nulla enim adipisicing id elit irure ex. Voluptate duis cupidatat fugiat amet dolore veniam. Adipisicing ad occaecat velit cillum.\\r\\n","registered":"2016-05-12T08:32:44 +07:00","latitude":41.639383,"longitude":-33.102296,"tags":["excepteur","et","duis","velit","laboris","pariatur","dolor"],"friends":[{"id":0,"name":"Ryan Waters"},{"id":1,"name":"Robbie Rosario"},{"id":2,"name":"Gracie Freeman"}],"greeting":"Hello, Benton Garza! You have 1 unread messages.","favoriteFruit":"strawberry"},{"_id":"612d652f1dd2eb98a16e0a3d","index":5,"guid":"856875e2-24fa-426c-a1cd-5447ea2abeb9","isActive":false,"balance":"$1,889.99","picture":"http://placehold.it/32x32","age":37,"eyeColor":"brown","name":"Tommie Durham","gender":"female","company":"EVIDENDS","email":"tommiedurham@evidends.com","phone":"+1 (866) 570-3407","address":"694 Barlow Drive, Lithium, Tennessee, 1100","about":"Enim nostrud ea ea quis. Commodo commodo reprehenderit ea minim officia enim. Velit laboris incididunt commodo esse commodo ea excepteur in deserunt deserunt. Fugiat ad exercitation aliqua minim ea sunt pariatur est commodo sunt nisi ex. Ipsum ad enim ut et culpa pariatur.\\r\\n","registered":"2018-03-01T06:21:31 +08:00","latitude":52.298302,"longitude":-22.076203,"tags":["laboris","labore","officia","in","est","deserunt","ad"],"friends":[{"id":0,"name":"Francis Park"},{"id":1,"name":"Schmidt Williamson"},{"id":2,"name":"Adkins Shields"}],"greeting":"Hello, Tommie Durham! You have 6 unread messages.","favoriteFruit":"apple"},{"_id":"612d652f8e1b1bc30f3585ec","index":6,"guid":"eb70d15e-fee8-4e76-8c90-049d3d6dac43","isActive":false,"balance":"$1,139.14","picture":"http://placehold.it/32x32","age":21,"eyeColor":"brown","name":"Lee Good","gender":"male","company":"LIMAGE","email":"leegood@limage.com","phone":"+1 (945) 414-3105","address":"652 Hendrickson Street, Wilsonia, Arizona, 9156","about":"Amet ullamco adipisicing velit cillum quis minim nulla sint dolor. Labore magna quis nulla occaecat cupidatat anim irure. Anim duis nisi ipsum sint.\\r\\n","registered":"2017-10-14T04:22:31 +07:00","latitude":85.591186,"longitude":51.21934,"tags":["ipsum","ad","exercitation","mollit","magna","irure","elit"],"friends":[{"id":0,"name":"Delacruz Vaughn"},{"id":1,"name":"Kari Figueroa"},{"id":2,"name":"Kris Marsh"}],"greeting":"Hello, Lee Good! You have 7 unread messages.","favoriteFruit":"strawberry"}]"`; - -exports[`Gatsby Functions Should serve function splat route 1`] = `"{"splat":"doesThisWork"}"`; diff --git a/packages/gatsby-plugin-fastify/src/__tests__/plugins/__snapshots__/gatsby.js.snap b/packages/gatsby-plugin-fastify/src/__tests__/plugins/__snapshots__/gatsby.js.snap deleted file mode 100644 index 7846fb44e..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/plugins/__snapshots__/gatsby.js.snap +++ /dev/null @@ -1,18 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test Gatsby Server Gatsby Path Prefix Should be served at prefix 1`] = ` -" - - - - - - Gatsby Plugin Fastify - - - -

Hello World

- - -" -`; diff --git a/packages/gatsby-plugin-fastify/src/__tests__/plugins/__snapshots__/static.js.snap b/packages/gatsby-plugin-fastify/src/__tests__/plugins/__snapshots__/static.js.snap deleted file mode 100644 index 8bff97ec1..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/plugins/__snapshots__/static.js.snap +++ /dev/null @@ -1,35 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Gatsby Static Routes Should serve custom 404 1`] = ` -" - - - - - - Gatsby Plugin Fastify - - - -

Page Not Found

- - -" -`; - -exports[`Gatsby Static Routes Should serve static index route 1`] = ` -" - - - - - - Gatsby Plugin Fastify - - - -

Hello World

- - -" -`; diff --git a/packages/gatsby-plugin-fastify/src/__tests__/plugins/client-routes.js b/packages/gatsby-plugin-fastify/src/__tests__/plugins/client-routes.js deleted file mode 100644 index a48c8ebce..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/plugins/client-routes.js +++ /dev/null @@ -1,27 +0,0 @@ -describe(`Client Side Routes`, () => { - it(`Should handle base route`, async () => { - const response = await fastify.inject({ - url: "/app/", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.payload).toMatchSnapshot(); - }); - - it(`Should handle sub routes`, async () => { - const responseBase = await fastify.inject({ - url: "/app/", - method: "GET", - }); - - const response = await fastify.inject({ - url: "/app/subPath", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.payload).toMatchSnapshot(); - expect(responseBase.payload).toEqual(response.payload); - }); -}); diff --git a/packages/gatsby-plugin-fastify/src/__tests__/plugins/functions.js b/packages/gatsby-plugin-fastify/src/__tests__/plugins/functions.js deleted file mode 100644 index 408463a2d..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/plugins/functions.js +++ /dev/null @@ -1,33 +0,0 @@ -describe(`Gatsby Functions`, () => { - it(`Should serve function route`, async () => { - const response = await fastify.inject({ - url: "/api/test", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.headers["content-type"]).toEqual("application/json; charset=utf-8"); - expect(response.payload).toMatchSnapshot(); - }); - - it(`Should serve function splat route`, async () => { - const response = await fastify.inject({ - url: "/api/splat/doesThisWork", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.headers["content-type"]).toEqual("application/json; charset=utf-8"); - expect(response.payload).toMatchSnapshot(); - }); - - it(`Should 404 on bad function route`, async () => { - const response = await fastify.inject({ - url: "/api/badRoute", - method: "GET", - }); - - expect(response.statusCode).toEqual(404); - expect(response.payload).toMatchSnapshot(); - }); -}); diff --git a/packages/gatsby-plugin-fastify/src/__tests__/plugins/gatsby.js b/packages/gatsby-plugin-fastify/src/__tests__/plugins/gatsby.js deleted file mode 100644 index a43243a10..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/plugins/gatsby.js +++ /dev/null @@ -1,24 +0,0 @@ -import { setupFastify, shutdownFastify } from "../__utils__/server"; - -describe(`Test Gatsby Server`, () => { - let fastify; - beforeAll(async () => { - fastify = await setupFastify({ overrideServerConfig: { prefix: "/test" } }); - }); - - afterAll(async () => { - await shutdownFastify(fastify); - }); - - describe(`Gatsby Path Prefix`, () => { - it(`Should be served at prefix`, async () => { - const response = await fastify.inject({ - url: "/test/", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.payload).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/gatsby-plugin-fastify/src/__tests__/plugins/redirects.js b/packages/gatsby-plugin-fastify/src/__tests__/plugins/redirects.js deleted file mode 100644 index 6cf0ce2e4..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/plugins/redirects.js +++ /dev/null @@ -1,172 +0,0 @@ -import { StatusCodes } from "http-status-codes"; - -describe(`Gatsby Redirects`, () => { - it(`Should handle permanent redirect`, async () => { - const response = await fastify.inject({ - url: "/perm-redirect", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.PERMANENT_REDIRECT); - expect(response.headers.location).toEqual("/posts/page-1"); - }); - - it(`Should handle temporary redirect`, async () => { - const response = await fastify.inject({ - url: "/temp-redirect", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.TEMPORARY_REDIRECT); - expect(response.headers.location).toEqual("/posts/page-2"); - }); - - it(`Should handle alt redirect`, async () => { - const response = await fastify.inject({ - url: "/alt-redirect", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.MOVED_PERMANENTLY); - expect(response.headers.location).toEqual("/posts/page-3"); - }); - - it(`Should handle redirect with path params`, async () => { - const response = await fastify.inject({ - url: "/redirect/a", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.TEMPORARY_REDIRECT); - expect(response.headers.location).toEqual("/app/a"); - }); - - it(`Should handle redirect with query string to params`, async () => { - const response = await fastify.inject({ - url: "/redirect-query?letter=a", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.TEMPORARY_REDIRECT); - expect(response.headers.location).toEqual("/app/a"); - }); - - it(`Should handle redirect with query string to other query params`, async () => { - const response = await fastify.inject({ - url: "/redirect-query-query?letter=a", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.TEMPORARY_REDIRECT); - expect(response.headers.location).toEqual("/app?letter=a"); - }); - - it(`Should handle redirect with catch all`, async () => { - const response = await fastify.inject({ - url: "/redirect-all/a", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.TEMPORARY_REDIRECT); - expect(response.headers.location).toEqual("/app/a"); - }); - - it(`Should handle redirect with catch all to 1 location`, async () => { - const response = await fastify.inject({ - url: "/redirect-all2/a", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.TEMPORARY_REDIRECT); - expect(response.headers.location).toEqual("/app/"); - }); - - it(`Should handle redirect correctly with params and catch all`, async () => { - const response = await fastify.inject({ - url: "/redirect-weird/test/more-stuff", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.TEMPORARY_REDIRECT); - expect(response.headers.location).toEqual("/app/test/more-stuff"); - }); - - it(`Should handle redirect correctly with specific query strings`, async () => { - const response = await fastify.inject({ - url: "/redirect-query-specific?id=2", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.TEMPORARY_REDIRECT); - expect(response.headers.location).toEqual("/file2.pdf"); - }); - - it(`Should handle colons in toPaths without splat in fromPath`, async () => { - const response = await fastify.inject({ - url: "/wiki/category/url", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.TEMPORARY_REDIRECT); - expect(response.headers.location).toEqual("https://en.wikipedia.org/wiki/Category:URL"); - }); - - it(`Should handle splats in fromPaths with colons in toPaths`, async () => { - const response = await fastify.inject({ - url: "/wiki/category/URL", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.TEMPORARY_REDIRECT); - expect(response.headers.location).toEqual("https://en.wikipedia.org/wiki/Category:URL"); - }); - - it(`Should handle multiple splats in fromPaths with colons in toPaths`, async () => { - const response = await fastify.inject({ - url: "/wiki/Category/URL", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.TEMPORARY_REDIRECT); - expect(response.headers.location).toEqual("https://en.wikipedia.org/wiki/Category:URL"); - }); - - it(`Should handle colons in fromPaths that are not splats via double colon`, async () => { - const response = await fastify.inject({ - url: "/Category:URL", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.TEMPORARY_REDIRECT); - expect(response.headers.location).toEqual("/wiki/Category:URL"); - }); - - it(`Should error when including an asterisk in toPath without a wildcard in fromPath, even if there is a splat or colon`, async () => { - const response = await fastify.inject({ - url: "/some/thing/all", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.INTERNAL_SERVER_ERROR); - }); - - it(`Should handle redirect with special chars in the path`, async () => { - const response = await fastify.inject({ - url: "/redirect-all/θ€ŒδΈ”", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.TEMPORARY_REDIRECT); - expect(response.headers.location).toEqual("/app/%E8%80%8C%E4%B8%94"); - }); - - it(`Should handle redirect with special chars in the path that go to another domain`, async () => { - const response = await fastify.inject({ - url: "/google/θ€ŒδΈ”", - method: "GET", - }); - - expect(response.statusCode).toEqual(StatusCodes.TEMPORARY_REDIRECT); - expect(response.headers.location).toEqual("https://google.com/search?q=%E8%80%8C%E4%B8%94"); - }); -}); diff --git a/packages/gatsby-plugin-fastify/src/__tests__/plugins/reverse-proxy.js b/packages/gatsby-plugin-fastify/src/__tests__/plugins/reverse-proxy.js deleted file mode 100644 index 2fc443560..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/plugins/reverse-proxy.js +++ /dev/null @@ -1,34 +0,0 @@ -describe(`Test Gatsby Reverse Proxy Routes`, () => { - it(`Should serve Reverse Proxy route`, async () => { - const response = await fastify.inject({ - url: "/example-proxy/", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.headers["content-type"]).toContain("text/html"); - expect(response.headers["x-gatsby-fastify"]).toContain("Reverse Proxy"); - expect(response.payload).toContain("Example Domain"); - }); - - it(`Should serve Reverse Proxy route made with trailing *`, async () => { - const response = await fastify.inject({ - url: "/example-proxy-star/", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.headers["content-type"]).toContain("text/html"); - expect(response.headers["x-gatsby-fastify"]).toContain("Reverse Proxy"); - expect(response.payload).toContain("Example Domain"); - }); - - it(`Should not serve Reverse Proxy route made with trailing * at *`, async () => { - const response = await fastify.inject({ - url: "/example-proxy-star/*", - method: "GET", - }); - - expect(response.statusCode).toEqual(404); - }); -}); diff --git a/packages/gatsby-plugin-fastify/src/__tests__/plugins/server-routes.js b/packages/gatsby-plugin-fastify/src/__tests__/plugins/server-routes.js deleted file mode 100644 index 075a23ed4..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/plugins/server-routes.js +++ /dev/null @@ -1,220 +0,0 @@ -describe(`Test Gatsby DSG/SSR Routes`, () => { - describe("DSG", () => { - it(`Should serve DSG route HTML no slash`, async () => { - const response = await fastify.inject({ - url: "/generated/page-6", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.headers["content-type"]).toEqual("text/html"); - expect(response.headers["x-gatsby-fastify"]).toContain("DSG"); - expect(response.payload).toContain("
Hello world #6!
"); - }); - - it(`Should serve DSG route HTML with slash`, async () => { - const response = await fastify.inject({ - url: "/generated/page-6/", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.headers["content-type"]).toEqual("text/html"); - expect(response.headers["x-gatsby-fastify"]).toContain("DSG"); - expect(response.payload).toContain("
Hello world #6!
"); - }); - - it(`Should serve DSG route "page-data.json"`, async () => { - const response = await fastify.inject({ - url: "/page-data/generated/page-6/page-data.json", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.headers["x-gatsby-fastify"]).toContain("DSG"); - expect(response.headers["content-type"]).toEqual("application/json; charset=utf-8"); - expect(response.payload).toContain(`"result":{"pageContext":{"pageNumber":6}}`); - }); - }); - - describe("SSR", () => { - it(`Should serve SSR route HTML no slash`, async () => { - const response = await fastify.inject({ - url: "/ssr", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.headers["content-type"]).toEqual("text/html"); - expect(response.headers["x-gatsby-fastify"]).toContain("SSR"); - expect(response.payload).toContain("SSR Page with Dogs"); - }); - - it(`Should serve SSR route HTML with slash`, async () => { - const response = await fastify.inject({ - url: "/ssr/", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.headers["content-type"]).toEqual("text/html"); - expect(response.headers["x-gatsby-fastify"]).toContain("SSR"); - expect(response.payload).toContain("SSR Page with Dogs"); - }); - - it(`Should serve SSR route "page-data.json"`, async () => { - const response = await fastify.inject({ - url: "/page-data/ssr/page-data.json", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.headers["x-gatsby-fastify"]).toContain("SSR"); - expect(response.headers["content-type"]).toEqual("application/json; charset=utf-8"); - expect(response.payload).toContain(`"path":"/ssr/","result":{"serverData"`); - }); - - it(`Should serve SSR route "page-data.json" with custom headers`, async () => { - const response = await fastify.inject({ - url: "/page-data/ssr/page-data.json", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.headers["x-test"]).toEqual("Custom Headers Work!"); - }); - - it(`Should throw 500 error on exception when fetching server data`, async () => { - const response = await fastify.inject({ - url: "/ssrBad", - method: "GET", - }); - - expect(response.statusCode).toEqual(500); - expect(response.headers["x-gatsby-fastify"]).toContain("SSR"); - }); - - it(`Should Add custom headers to SSR routes`, async () => { - const response = await fastify.inject({ - url: "/ssr", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.headers["x-test"]).toEqual("Custom Headers Work!"); - expect(response.payload).toContain("SSR Page with Dogs"); - }); - - it(`Should serve SSR page from a parametric route`, async () => { - const meaningfulResponse = await fastify.inject({ - url: "/ssr/42", - method: "GET", - }); - - expect(meaningfulResponse.statusCode).toEqual(200); - expect(meaningfulResponse.headers["x-gatsby-fastify"]).toContain("SSR"); - expect(meaningfulResponse.payload).toContain("meaning of life"); - - const meaninglessResponse = await fastify.inject({ - url: "/ssr/43", - method: "GET", - }); - - expect(meaninglessResponse.statusCode).toEqual(200); - expect(meaninglessResponse.headers["x-gatsby-fastify"]).toContain("SSR"); - expect(meaninglessResponse.payload).toContain("try again"); - }); - }); - - it(`Should 400 if request does not accept "text/html" on DSG/SSR route`, async () => { - const response = await fastify.inject({ - url: "/ssr", - method: "GET", - headers: { - accept: "text/plain", - }, - }); - - expect(response.statusCode).toEqual(400); - }); - - it(`Should throw 404 if bad /page-data/route`, async () => { - const response = await fastify.inject({ - url: "/page-data/fsdfsd/page-data.json", - method: "GET", - }); - - expect(response.statusCode).toEqual(404); - }); - - it(`Should throw returned status code from getServer Data for HTML`, async () => { - const response = await fastify.inject({ - url: "/ssr403", - method: "GET", - }); - - expect(response.statusCode).toEqual(403); - }); - - it(`Should throw returned status code from getServer Data for page-data.json`, async () => { - const response = await fastify.inject({ - url: "/page-data/ssr403/page-data.json", - method: "GET", - }); - - expect(response.statusCode).toEqual(403); - }); - - it(`Should return route correctly when queryparams exist`, async () => { - const response = await fastify.inject({ - url: "/ssr?test=test", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - }); - - it(`Should return route html correctly when splat route`, async () => { - const response = await fastify.inject({ - url: "/ssr_splat/example/test", - method: "GET", - }); - - expect(response.headers["x-gatsby-fastify"]).toContain("SSR"); - expect(response.statusCode).toEqual(200); - expect(response.body).toContain(""*": "example/test""); - }); - - it(`Should return route page-data.json correctly when splat route`, async () => { - const response = await fastify.inject({ - url: "/page-data/ssr_splat/[...]/page-data.json", - method: "GET", - }); - - expect(response.headers["x-gatsby-fastify"]).toContain("SSR"); - expect(response.headers["content-type"]).toContain("json"); - expect(response.statusCode).toEqual(200); - }); - - it(`Should return route html correctly when named splat route`, async () => { - const response = await fastify.inject({ - url: "/ssr_named_splat/example/test", - method: "GET", - }); - - expect(response.headers["x-gatsby-fastify"]).toContain("SSR"); - expect(response.statusCode).toEqual(200); - expect(response.body).toContain(""test": "example/test""); - }); - - it(`Should return route page-data.json correctly when named splat route`, async () => { - const response = await fastify.inject({ - url: "/page-data/ssr_named_splat/[...test]/page-data.json", - method: "GET", - }); - - expect(response.headers["x-gatsby-fastify"]).toContain("SSR"); - expect(response.headers["content-type"]).toContain("json"); - expect(response.statusCode).toEqual(200); - }); -}); diff --git a/packages/gatsby-plugin-fastify/src/__tests__/plugins/static.js b/packages/gatsby-plugin-fastify/src/__tests__/plugins/static.js deleted file mode 100644 index d7c5a38bd..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/plugins/static.js +++ /dev/null @@ -1,37 +0,0 @@ -describe(`Gatsby Static Routes`, () => { - it(`Should serve custom 404`, async () => { - const response = await fastify.inject({ - url: "/badRoute", - method: "GET", - }); - - expect(response.statusCode).toEqual(404); - expect(response.payload).toMatchSnapshot(); - }); - - it(`Should serve static index route`, async () => { - const response = await fastify.inject({ - url: "/", - method: "GET", - }); - - expect(response.statusCode).toEqual(200); - expect(response.payload).toMatchSnapshot(); - }); - - it(`Should serve static route with or without trailing /`, async () => { - const noSlashResponse = await fastify.inject({ - url: "/posts/page-1", - method: "GET", - }); - - const slashResponse = await fastify.inject({ - url: "/posts/page-1/", - method: "GET", - }); - - expect(noSlashResponse.statusCode).toEqual(200); - expect(slashResponse.statusCode).toEqual(200); - expect(noSlashResponse.payload).toEqual(slashResponse.payload); - }); -}); diff --git a/packages/gatsby-plugin-fastify/src/__tests__/utils/routes.ts b/packages/gatsby-plugin-fastify/src/__tests__/utils/routes.ts deleted file mode 100644 index 7905e146e..000000000 --- a/packages/gatsby-plugin-fastify/src/__tests__/utils/routes.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { formatMatchPath } from "../../utils/routes"; - -describe("Gatsby Route Handler Tests", () => { - describe("Match path formatter Tests", () => { - it.each([ - ["/test/*", "/test*"], - ["/test/*name", "/test*"], - ])("Correctly modify match path from %s to %s", (input, output) => { - expect(formatMatchPath(input)).toBe(output); - }); - - it.each(["/test/:test"])("Don't modify match path route: %s", (input) => { - expect(formatMatchPath(input)).toBe(input); - }); - }); -}); diff --git a/packages/gatsby-plugin-fastify/src/cli.ts b/packages/gatsby-plugin-fastify/src/cli.ts deleted file mode 100755 index 565dd1c28..000000000 --- a/packages/gatsby-plugin-fastify/src/cli.ts +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env node - -import { setConfig, ConfigKeyEnum, getServerConfig, getConfig } from "./utils/config"; -import yargs from "yargs"; -import { hideBin } from "yargs/helpers"; -import { gatsbyServer } from "./serve"; -import open from "open"; - -// eslint-disable-next-line @typescript-eslint/no-unused-expressions -yargs(hideBin(process.argv)) - .env("GATSBY_SERVER_") - .command( - "$0", - "Serve the Gatsby Site", - (yargs) => { - return yargs.options({ - l: { - alias: "logLevel", - default: "info", - choices: ["trace", "debug", "info", "warn", "error", "fatal"], - type: "string", - describe: "set logging level", - global: true, - }, - p: { - alias: "port", - default: "8080", - type: "number", - describe: "Port to run the server on", - group: "Server", - }, - h: { - alias: "host", - default: "127.0.0.1", - type: "string", - describe: "Host to run the server on", - group: "Server", - }, - o: { - alias: "open", - default: false, - type: "boolean", - describe: "Open the browser", - group: "Server", - }, - }); - }, - async (argv) => { - // @ts-expect-error argv isn't correctly typed by yargs. - // We're just going to ignore it since it gives us what we need. - setConfig(ConfigKeyEnum.CLI, argv); - setConfig(ConfigKeyEnum.SERVER, getServerConfig()); - - const { - server: { prefix }, - } = getConfig(); - - await gatsbyServer(); - - if (argv.open) { - const url = `http://${argv.host}:${argv.port}${prefix}`; - - open(url); - } - }, - ).argv; diff --git a/packages/gatsby-plugin-fastify/src/gatsby-node.ts b/packages/gatsby-plugin-fastify/src/gatsby-node.ts deleted file mode 100644 index 325ed5720..000000000 --- a/packages/gatsby-plugin-fastify/src/gatsby-node.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { writeJSON } from "fs-extra"; - -import { hasFeature } from "gatsby-plugin-utils"; - -import type { GatsbyFastifyPluginOptions, GatsbyNodeServerConfig } from "./utils/config"; -import type { GatsbyNode } from "gatsby"; - -import { makePluginData } from "./utils/plugin-data"; -import { getFunctionManifest } from "./gatsby/funcitons-manifest"; -import { CONFIG_FILE_NAME } from "./utils/constants"; -import { getClientSideRoutes } from "./gatsby/client-side-route"; -import { getServerSideRoutes } from "./gatsby/server-routes"; -import { getProxiesAndRedirects } from "./gatsby/proxies-and-redirects"; - -export const onPostBuild: GatsbyNode["onPostBuild"] = async ( - { store, pathPrefix, reporter }, - pluginOptions: GatsbyFastifyPluginOptions, -) => { - try { - const { proxies, redirects } = getProxiesAndRedirects(store); - const pluginData = await makePluginData(store, pathPrefix); - - const functions = await getFunctionManifest(pluginData); - const clientSideRoutes = await getClientSideRoutes(pluginData); - const serverSideRoutes = await getServerSideRoutes(pluginData); - - // @ts-expect-error This can't exist and making TS happy another way got complicated - delete pluginOptions.plugins; - - const config: GatsbyNodeServerConfig = { - ...pluginOptions, - clientSideRoutes, - serverSideRoutes, - redirects, - proxies, - prefix: pathPrefix, - functions, - }; - - await writeJSON(pluginData.configFolder(CONFIG_FILE_NAME), config, { spaces: 2 }); - } catch (error) { - if (error instanceof Error) { - reporter.error("Error building config for Fastify Server", error, "gatsby-plugin-fastify"); - } - } -}; - -export const pluginOptionsSchema: GatsbyNode["pluginOptionsSchema"] = ({ Joi }) => { - return Joi.object({ - features: Joi.object({ - reverseProxy: Joi.alternatives().try(Joi.boolean(), Joi.object()).default(true), - redirects: Joi.boolean().default(true), - imageCdn: Joi.boolean() - .default(hasFeature("image-cdn")) - .custom((value, helpers) => { - if (value && !hasFeature("image-cdn")) { - return helpers.error( - "The Image CDN is not supported by your Gatsby version. Please upgrade to Gatsby v4.10.0 or higher to use it.", - ); - } - - return value; - }), - }).default(), - fastify: Joi.object({ - maxParamLength: Joi.number().default(500), - ignoreTralingSlash: Joi.boolean().default(true), - }).unknown(true), - }); -}; diff --git a/packages/gatsby-plugin-fastify/src/gatsby/client-side-route.ts b/packages/gatsby-plugin-fastify/src/gatsby/client-side-route.ts deleted file mode 100644 index 67c7154d0..000000000 --- a/packages/gatsby-plugin-fastify/src/gatsby/client-side-route.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { PathConfig } from "../plugins/client-routes"; -import { formatMatchPath } from "../utils/routes"; -import type { PluginData } from "../utils/plugin-data"; - -export type NoUndefinedField = { [P in keyof T]-?: NoUndefinedField> }; - -export async function getClientSideRoutes(pageData: PluginData) { - const { pages } = pageData; - - const routes: NoUndefinedField[] = []; - - for (const page of pages.values()) { - if (page?.matchPath && page?.mode !== "SSR" && page?.mode !== "DSG") { - routes.push({ - matchPath: formatMatchPath(page.matchPath), - path: page.path, - }); - } - } - - return routes; -} diff --git a/packages/gatsby-plugin-fastify/src/gatsby/funcitons-manifest.ts b/packages/gatsby-plugin-fastify/src/gatsby/funcitons-manifest.ts deleted file mode 100644 index 0acca7677..000000000 --- a/packages/gatsby-plugin-fastify/src/gatsby/funcitons-manifest.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { existsSync, readJSON } from "fs-extra"; -import { IGatsbyFunction } from "gatsby/dist/redux/types"; -import { PluginData } from "../utils/plugin-data"; - -export async function getFunctionManifest(pluginData: PluginData): Promise { - const { functionsFolder } = pluginData; - const compiledFunctionsDirectory = functionsFolder(); - - if (!existsSync(compiledFunctionsDirectory)) { - throw new Error(`Unable to find function mainfest @ ${compiledFunctionsDirectory}`); - } - - const functions: IGatsbyFunction[] = await readJSON(functionsFolder(`manifest.json`), `utf-8`); - - return functions; -} diff --git a/packages/gatsby-plugin-fastify/src/gatsby/proxies-and-redirects.ts b/packages/gatsby-plugin-fastify/src/gatsby/proxies-and-redirects.ts deleted file mode 100644 index 9800bcfce..000000000 --- a/packages/gatsby-plugin-fastify/src/gatsby/proxies-and-redirects.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { Store } from "gatsby"; -import type { IRedirect } from "gatsby/dist/redux/types"; - -export type GatsbyFastifyProxy = { toPath: string; fromPath: string }; - -export function getProxiesAndRedirects(store: Store) { - const { redirects: proxiesAndRedirects }: { redirects: IRedirect[] } = store.getState(); - - const results = { redirects: [] as IRedirect[], proxies: [] as GatsbyFastifyProxy[] }; - - for (const current of proxiesAndRedirects) { - if (current.statusCode == 200) { - results.proxies.push({ - toPath: current.toPath.replace(/\*$/, ""), - fromPath: current.fromPath.replace(/\*$/, ""), - }); - } else { - results.redirects.push(current); - } - } - - return results; -} diff --git a/packages/gatsby-plugin-fastify/src/gatsby/server-routes.ts b/packages/gatsby-plugin-fastify/src/gatsby/server-routes.ts deleted file mode 100644 index 6a2a5098a..000000000 --- a/packages/gatsby-plugin-fastify/src/gatsby/server-routes.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { PluginData } from "../utils/plugin-data"; -import { formatMatchPath } from "../utils/routes"; - -export type ServerSideRoute = { - path: string; - mode: "DSG" | "SSR"; - matchPath: string; -}; - -export async function getServerSideRoutes(pageData: PluginData) { - const { pages } = pageData; - const routes: ServerSideRoute[] = []; - - for (const page of pages.values()) { - if (page?.mode === "DSG" || page?.mode === "SSR") { - routes.push({ - path: page.path, - mode: page.mode, - matchPath: page?.matchPath ? formatMatchPath(page.matchPath) : page.path, - }); - } - } - - return routes; -} diff --git a/packages/gatsby-plugin-fastify/src/plugins/404.ts b/packages/gatsby-plugin-fastify/src/plugins/404.ts deleted file mode 100644 index b08b3efef..000000000 --- a/packages/gatsby-plugin-fastify/src/plugins/404.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { FastifyPluginAsync } from "fastify"; -import { resolve } from "node:path"; -import { existsSync } from "fs-extra"; -import { PATH_TO_PUBLIC } from "../utils/constants"; - -import { StatusCodes, ReasonPhrases } from "http-status-codes"; - -export const handle404: FastifyPluginAsync = async (fastify) => { - const gatsby404ErrorFileExists = existsSync(resolve(PATH_TO_PUBLIC, "404.html")); - fastify.log.info( - `Gatsby 404 error page ${ - gatsby404ErrorFileExists ? "exists" : "missing, using generic 404 error" - }`, - ); - - fastify.setNotFoundHandler((request, reply) => { - fastify.log.warn(`404: '${request.url}' not found.`); - reply.appendModuleHeader("404"); - - if (gatsby404ErrorFileExists) { - reply.code(StatusCodes.NOT_FOUND).sendFile("404.html"); - } else { - reply.code(StatusCodes.NOT_FOUND).send(ReasonPhrases.NOT_FOUND); - } - }); -}; diff --git a/packages/gatsby-plugin-fastify/src/plugins/500.ts b/packages/gatsby-plugin-fastify/src/plugins/500.ts deleted file mode 100644 index e7680f64b..000000000 --- a/packages/gatsby-plugin-fastify/src/plugins/500.ts +++ /dev/null @@ -1,28 +0,0 @@ -import fp from "fastify-plugin"; -import { resolve } from "node:path"; -import { existsSync } from "fs-extra"; -import { StatusCodes, ReasonPhrases } from "http-status-codes"; - -import { PATH_TO_PUBLIC } from "../utils/constants"; - -import type { FastifyPluginAsync } from "fastify"; - -export const handle500: FastifyPluginAsync = fp(async (fastify) => { - const gatsby500ErrorFileExists = existsSync(resolve(PATH_TO_PUBLIC, "500.html")); - fastify.log.info( - `Gatsby 500 error page ${ - gatsby500ErrorFileExists ? "exists" : "missing, using generic 500 error for DSG/SSR" - }`, - ); - - fastify.setErrorHandler(async (error, request, reply) => { - fastify.log.error(`Error processing ${request.url}, ${error.message}`); - reply.appendModuleHeader("500"); - - if (gatsby500ErrorFileExists) { - reply.code(StatusCodes.INTERNAL_SERVER_ERROR).sendFile("500.html"); - } else { - reply.code(StatusCodes.INTERNAL_SERVER_ERROR).send(ReasonPhrases.INTERNAL_SERVER_ERROR); - } - }); -}); diff --git a/packages/gatsby-plugin-fastify/src/plugins/client-routes.ts b/packages/gatsby-plugin-fastify/src/plugins/client-routes.ts deleted file mode 100644 index 7c744de5c..000000000 --- a/packages/gatsby-plugin-fastify/src/plugins/client-routes.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { resolve } from "node:path"; - -import { PATH_TO_PUBLIC } from "../utils/constants"; - -import type { FastifyPluginAsync } from "fastify"; -import type { NoUndefinedField } from "../gatsby/client-side-route"; - -export type PathConfig = { - matchPath: string | undefined; - path: string; -}; - -export const handleClientOnlyRoutes: FastifyPluginAsync<{ - paths: NoUndefinedField[]; -}> = async (fastify, { paths }) => { - fastify.log.info(`Registering ${paths?.length} client-only route(s)`); - - if (paths?.length > 0) { - for (const p of paths) { - fastify.log.debug(`Registering client-only route: ${p.path}`); - - fastify.get(p.matchPath, (_request, reply) => { - reply.appendModuleHeader("Client Route"); - - reply.sendFile("index.html", resolve(PATH_TO_PUBLIC, p.path.replace("/", ""))); - }); - } - } -}; - -export default { handleClientOnlyRoutes }; diff --git a/packages/gatsby-plugin-fastify/src/plugins/decorators.ts b/packages/gatsby-plugin-fastify/src/plugins/decorators.ts deleted file mode 100644 index 4f7494669..000000000 --- a/packages/gatsby-plugin-fastify/src/plugins/decorators.ts +++ /dev/null @@ -1,17 +0,0 @@ -import fp from "fastify-plugin"; - -import { moduleHeaderDecorator, setHeaderDecorator } from "../utils/headers"; - -import type { FastifyPluginAsync } from "fastify"; - -declare module "fastify" { - interface FastifyReply { - appendModuleHeader: typeof moduleHeaderDecorator; - setHeader: FastifyReply["header"]; - } -} - -export const implementUtilDecorators: FastifyPluginAsync = fp(async (fastify) => { - fastify.decorateReply("setHeader", setHeaderDecorator); - fastify.decorateReply("appendModuleHeader", moduleHeaderDecorator, ["setHeader"]); -}); diff --git a/packages/gatsby-plugin-fastify/src/plugins/functions.ts b/packages/gatsby-plugin-fastify/src/plugins/functions.ts deleted file mode 100644 index 15f822730..000000000 --- a/packages/gatsby-plugin-fastify/src/plugins/functions.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { resolve } from "node:path"; -import { existsSync } from "fs-extra"; -import { StatusCodes } from "http-status-codes"; - -import { PATH_TO_FUNCTIONS } from "../utils/constants"; - -import type { FastifyPluginAsync, FastifyReply, FastifyRequest } from "fastify"; -import type { IGatsbyFunction } from "gatsby/dist/redux/types"; - -export type GatsbyFunctionHandler = ( - request: FastifyRequest, - reply: FastifyReply, -) => void | Promise; - -async function getFunctionToExec({ - relativeCompiledFilePath, -}: IGatsbyFunction): Promise { - const functionImportAbsPath = resolve(PATH_TO_FUNCTIONS, relativeCompiledFilePath); - - if (!existsSync(functionImportAbsPath)) { - throw new Error(`Unable to find function to import @ ${functionImportAbsPath}`); - } - - const function_ = await import(functionImportAbsPath); - return function_?.default?.default ?? function_?.default ?? function_; -} - -async function getFunctionHandler(routeConfig: IGatsbyFunction) { - const execFunction = await getFunctionToExec(routeConfig); - - return execFunction; -} - -export const handleFunctions: FastifyPluginAsync<{ - prefix: string; - functions: IGatsbyFunction[]; -}> = async (fastify, { prefix, functions }) => { - if (functions?.length > 0) { - fastify.log.info(`Registering ${functions.length} function(s)`); - - for (const functionConfig of functions) { - try { - const functionToExecute = await getFunctionHandler(functionConfig); - - if (functionToExecute) { - const path = functionConfig?.matchPath || functionConfig.functionRoute; - fastify.log.debug(`Registering function: ${prefix + path}`); - fastify.all(path, { - handler: async function (request, reply) { - try { - reply.appendModuleHeader("Functions"); - await Promise.resolve(functionToExecute(request, reply)); - } catch (error) { - fastify.log.error(error); - // Don't send the error if that would cause another error. - if (!reply.sent) { - reply - .code(StatusCodes.INTERNAL_SERVER_ERROR) - .send("Error executing Gatsby Function."); - } - } - }, - }); - } - } catch (error) { - fastify.log.error(error); - } - } - } - - fastify.all("/*", async (_request, reply) => { - reply.code(StatusCodes.NOT_FOUND).send("Function not found."); - }); -}; diff --git a/packages/gatsby-plugin-fastify/src/plugins/gatsby.ts b/packages/gatsby-plugin-fastify/src/plugins/gatsby.ts deleted file mode 100644 index ade9c1d2c..000000000 --- a/packages/gatsby-plugin-fastify/src/plugins/gatsby.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { handleClientOnlyRoutes } from "./client-routes"; -import { implementUtilDecorators } from "./decorators"; -import { handleServerRoutes } from "./server-routes"; -import { handleImageTransforms } from "./image-transform"; -import { handleFunctions } from "./functions"; -import { handleRedirects } from "./redirects"; -import { handleReverseProxy } from "./reverse-proxy"; -import { handleStatic } from "./static"; -import { handle404 } from "./404"; -import { handle500 } from "./500"; -import { getConfig } from "../utils/config"; - -import fastifyAccepts from "@fastify/accepts"; -import middiePlugin from "@fastify/middie"; - -import type { FastifyPluginAsync } from "fastify"; - -export const serveGatsby: FastifyPluginAsync = async (fastify) => { - const { server: serverConfig } = getConfig(); - - const { clientSideRoutes, serverSideRoutes, redirects, functions, proxies, features } = - serverConfig; - - // Utils - await fastify.register(fastifyAccepts); - await fastify.register(implementUtilDecorators); - - // Gatsby 500 - This must be registered before anything that wants to use it - await fastify.register(handle500); - - // Gatsby Image CDN - await fastify.register(middiePlugin).register(handleImageTransforms); - - // Gatsby Functions - await fastify.register(handleFunctions, { - prefix: "/api/", - functions, - }); - - // Gatsby Static - await fastify.register(handleStatic); - - // Gatsby Client Only Routes - await fastify.register(handleClientOnlyRoutes, { - paths: clientSideRoutes, - }); - - // Gatsby Redirects - if (features?.redirects) { - await fastify.register(handleRedirects, { redirects }); - } else { - fastify.log.warn("Redirects disabled."); - } - - // Gatsby Reverse Proxy - if (features?.reverseProxy) { - await fastify.register(handleReverseProxy, { proxies }); - } else { - fastify.log.warn("Reverse proxy disabled."); - } - - // Gatsby DSG & SSR - await fastify.register(handleServerRoutes, { paths: serverSideRoutes }); - - // Gatsby 404 - await fastify.register(handle404); -}; diff --git a/packages/gatsby-plugin-fastify/src/plugins/image-transform.ts b/packages/gatsby-plugin-fastify/src/plugins/image-transform.ts deleted file mode 100644 index 796a51318..000000000 --- a/packages/gatsby-plugin-fastify/src/plugins/image-transform.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { addImageRoutes } from "gatsby-plugin-utils/polyfill-remote-file"; - -import type { FastifyPluginAsync } from "fastify"; - -export const handleImageTransforms: FastifyPluginAsync = async (fastify) => { - fastify.log.debug(`πŸ“· Handling file/image transforms aka "Gatsby Image CDN"`); - addImageRoutes(fastify); -}; diff --git a/packages/gatsby-plugin-fastify/src/plugins/redirects.ts b/packages/gatsby-plugin-fastify/src/plugins/redirects.ts deleted file mode 100644 index 194d67a47..000000000 --- a/packages/gatsby-plugin-fastify/src/plugins/redirects.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { StatusCodes } from "http-status-codes"; - -import { removeQueryParmsFromUrl, buildRedirectUrlFromParameters } from "../utils/routes"; - -import type { FastifyPluginAsync } from "fastify"; -import type { IRedirect } from "gatsby/dist/redux/types"; - -function getResponseCode(redirect: IRedirect): StatusCodes { - //@ts-expect-error - StatusCodes just doesn't have 208 for some reason - return ( - redirect.statusCode || - (redirect.isPermanent ? StatusCodes.PERMANENT_REDIRECT : StatusCodes.TEMPORARY_REDIRECT) - ); -} - -export const handleRedirects: FastifyPluginAsync<{ - redirects: IRedirect[]; -}> = async (fastify, { redirects }) => { - fastify.log.info(`Registering ${redirects.length} redirect(s)`); - - const queryStringHandlers: { - [s: string]: IRedirect; - } = {}; - - const alreadyRegisterd = new Set(); - - for (let redirect of redirects) { - let responseCode = getResponseCode(redirect); - fastify.log.debug( - `Registering "${redirect.fromPath}" as redirect to "${redirect.toPath}" with HTTP status code "${responseCode}".`, - ); - - /* Fastify can't register routes currently with the query stirngs in the path. - * We must strip these out and only register the path once. - * We can then check, in that single route, whether the entire url(including the query params) matches a redirect path, if it does - * - */ - const cleanFromPath = removeQueryParmsFromUrl(redirect.fromPath); - const isCleanedPath = cleanFromPath != redirect.fromPath; - - if (isCleanedPath) { - queryStringHandlers[redirect.fromPath] = redirect; - } - - if (!alreadyRegisterd.has(cleanFromPath)) { - if (isCleanedPath) { - alreadyRegisterd.add(cleanFromPath); - } - - fastify.all<{ - Params: { - [s: string]: string; - }; - Querystring: { - [s: string]: string; - }; - }>(cleanFromPath, { config: {} }, (request, reply) => { - reply.appendModuleHeader("Redirects"); - - if (isCleanedPath && queryStringHandlers[request.url]) { - redirect = queryStringHandlers[request.url]; - responseCode = getResponseCode(redirect); - } - - const toUrl = buildRedirectUrlFromParameters(redirect.toPath, { - ...request.params, - ...request.query, - }); - - reply.code(responseCode).redirect(encodeURI(toUrl)); - }); - } - } -}; diff --git a/packages/gatsby-plugin-fastify/src/plugins/reverse-proxy.ts b/packages/gatsby-plugin-fastify/src/plugins/reverse-proxy.ts deleted file mode 100644 index c8256a737..000000000 --- a/packages/gatsby-plugin-fastify/src/plugins/reverse-proxy.ts +++ /dev/null @@ -1,36 +0,0 @@ -import pluginHttpProxy from "@fastify/http-proxy"; - -import type { FastifyPluginAsync, FastifyReply } from "fastify"; -import type { GatsbyFastifyProxy } from "../gatsby/proxies-and-redirects"; - -// Implements https://support.gatsbsyjs.com/hc/en-us/articles/1500003051241-Working-with-Redirects-and-Rewrites -export const handleReverseProxy: FastifyPluginAsync<{ - proxies: GatsbyFastifyProxy[]; -}> = async (fastify, { proxies }) => { - fastify.log.info(`Registering ${proxies.length} reverse proxy route(s)`); - - for (const proxy of proxies) { - try { - // Fastify doesn't not support/require the trailing "*" in the path, so we need to remove if they exist - const cleanTo = proxy.toPath.replace(/\*$/, ""); - const cleanFrom = proxy.fromPath.replace(/\*$/, ""); - - const proxyTo = new URL(cleanTo); - - fastify.log.debug(`Registering "${cleanFrom}" as proxied route to "${cleanTo}".`); - - fastify.register(pluginHttpProxy, { - upstream: proxyTo.href, - prefix: cleanFrom, - replyOptions: { - onResponse: (_request, reply, response) => { - (reply as FastifyReply).appendModuleHeader("Reverse Proxy"); - reply.send(response); - }, - }, - }); - } catch (error) { - fastify.log.error(error); - } - } -}; diff --git a/packages/gatsby-plugin-fastify/src/plugins/server-routes.ts b/packages/gatsby-plugin-fastify/src/plugins/server-routes.ts deleted file mode 100644 index 308b0dcd2..000000000 --- a/packages/gatsby-plugin-fastify/src/plugins/server-routes.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { join, posix, resolve } from "node:path"; -import { StatusCodes } from "http-status-codes"; - -import type { FastifyPluginAsync } from "fastify"; -import type { ServerSideRoute } from "../gatsby/server-routes"; - -import { reverseFixedPagePath } from "gatsby/dist/utils/page-data"; -import { NEVER_CACHE_HEADER, PATH_TO_CACHE } from "../utils/constants"; -import { removeQueryParmsFromUrl } from "../utils/routes"; -import { countPaths } from "../utils/log"; - -export const handleServerRoutes: FastifyPluginAsync<{ - paths: ServerSideRoute[]; -}> = async (fastify, { paths }) => { - if (paths?.length > 0) { - const { dsgCount, ssrCount } = countPaths(paths); - - fastify.log.info(`Registering ${dsgCount} DSG route(s)`); - fastify.log.info(`Registering ${ssrCount} SSR route(s)`); - - const cachePath = resolve(PATH_TO_CACHE); - - const { GraphQLEngine } = (await import( - join(cachePath, "query-engine") - )) as typeof import("gatsby/dist/schema/graphql-engine/entry"); - - const { getData, renderPageData, renderHTML } = (await import( - join(cachePath, "page-ssr") - )) as typeof import("gatsby/dist/utils/page-ssr-module/entry"); - - const graphqlEngine = new GraphQLEngine({ - dbPath: join(cachePath, "data", "datastore"), - }); - - // Handle page-data for SSR/DSG routes - for (const { path, mode } of paths) { - const pageDataPath = posix.join("/page-data", path, "page-data.json"); - - fastify.log.debug(`Registering "${pageDataPath}" as "${mode}" route.`); - - fastify.get(pageDataPath, async (request, reply) => { - fastify.log.debug(`DSG/SSR for "page-data.json" @ ${path}`); - const workingURL = removeQueryParmsFromUrl(request.url); - const potentialPagePath = reverseFixedPagePath(path); - const page = graphqlEngine.findPageByPath(potentialPagePath); - if (!page) { - //this theoreticall shouldn't happen cause we're creating these routes based on data from build. - throw new Error(`No page data found for path: ${workingURL}`); - } - reply.appendModuleHeader(`${page?.mode as "DSG" | "SSR"}`); - - try { - // Fetch Page Data and SSR Data - const pageQueryData = await getData({ - pathName: workingURL, - graphqlEngine, - req: request, - }); - - const pageData = (await renderPageData({ data: pageQueryData })) as unknown; - - if (page.mode === `SSR`) { - if (pageQueryData?.serverDataHeaders) { - reply.headers(pageQueryData.serverDataHeaders); - } - - if (pageQueryData?.serverDataStatus) { - reply.code(pageQueryData.serverDataStatus); - } - } - - reply.header(...NEVER_CACHE_HEADER); - return reply.send(pageData); - } catch (error) { - if (error instanceof Error) { - throw new TypeError(`Error fetching page data for ${path}: ${error.message}`); - } - } - }); - } - - //Handle HTML for DSG/SSR - for (const { path, mode, matchPath } of paths) { - fastify.log.debug(`Registering "${path}" as "${mode}" route.`); - - fastify.get(matchPath, async (request, reply) => { - const accept = request.accepts(); - const workingURL = removeQueryParmsFromUrl(request.url); - - if (accept.type(["html"])) { - fastify.log.debug(`DSG/SSR for "text/html" @ ${request.url}`); - const potentialPagePath = reverseFixedPagePath(workingURL); - const page = graphqlEngine.findPageByPath(potentialPagePath); - - if (!page) { - throw new Error(`No page found for ${workingURL}`); - } - - reply.appendModuleHeader(`${page?.mode as "DSG" | "SSR"}`); - - try { - const pageQueryData = await getData({ - pathName: potentialPagePath, - graphqlEngine, - req: request, - }); - - const results = await renderHTML({ data: pageQueryData }); - - if (page.mode === `SSR`) { - if (pageQueryData?.serverDataHeaders) { - reply.headers(pageQueryData.serverDataHeaders); - } - - if (pageQueryData?.serverDataStatus) { - reply.code(pageQueryData.serverDataStatus); - } - } - - if (page.mode === "DSG") { - reply.header(...NEVER_CACHE_HEADER); - } - - return reply.type("text/html").send(results); - } catch (error) { - if (error instanceof Error) { - throw new TypeError(`Error fetching page HTML for ${path}: ${error?.message}`); - } - } - } else { - fastify.log.warn(`Request for route ${request.url} does not support "text/html"`); - return reply - .code(StatusCodes.BAD_REQUEST) - .send("Request must support html via the `accept` header."); - } - }); - } - } -}; diff --git a/packages/gatsby-plugin-fastify/src/plugins/static.ts b/packages/gatsby-plugin-fastify/src/plugins/static.ts deleted file mode 100644 index b9e22de83..000000000 --- a/packages/gatsby-plugin-fastify/src/plugins/static.ts +++ /dev/null @@ -1,33 +0,0 @@ -import fastifyStatic, { FastifyStaticOptions } from "@fastify/static"; -import fp from "fastify-plugin"; -import { resolve } from "node:path"; -import { isMatch } from "picomatch"; -import { PATH_TO_PUBLIC, IMMUTABLE_CACHING_HEADER, NEVER_CACHE_HEADER } from "../utils/constants"; -import { appendModuleHeader } from "../utils/headers"; - -import type { FastifyPluginAsync } from "fastify"; - -export const handleStatic: FastifyPluginAsync> = fp( - async (fastify, options) => { - const publicPath = resolve(PATH_TO_PUBLIC); - fastify.log.debug(`Serving Static Assets from ${publicPath}`); - fastify.register(fastifyStatic, { - root: publicPath, - // These settings were switched to false with fastify v4, not entirely sure what changed, but tests are still passing. - redirect: false, - wildcard: false, - setHeaders: (reply, path) => { - if ( - isMatch(path, ["**/public/*.@(js|css)", "**/public/static/**"]) && - isMatch(path, "!**/sw.js") - ) { - reply.setHeader(...IMMUTABLE_CACHING_HEADER); - } else { - reply.setHeader(...NEVER_CACHE_HEADER); - } - appendModuleHeader("Static", reply); - }, - ...options, - }); - }, -); diff --git a/packages/gatsby-plugin-fastify/src/serve.ts b/packages/gatsby-plugin-fastify/src/serve.ts deleted file mode 100755 index 937e97220..000000000 --- a/packages/gatsby-plugin-fastify/src/serve.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* eslint unicorn/no-process-exit: "off" */ -import { serveGatsby } from "./plugins/gatsby"; -import Fastify from "fastify"; -import { getConfig } from "./utils/config"; -import { createFastifyConfig } from "./utils/server"; - -export async function gatsbyServer() { - const { - cli: { port, host, logLevel }, - server: { prefix }, - } = getConfig(); - - const fastify = Fastify(createFastifyConfig(getConfig())); - - fastify.log.info(`Logging Level set @ ${logLevel}`); - fastify.log.info(`Mounting Gatsby @ ${prefix || "/"}`); - - try { - await fastify.register(serveGatsby, { prefix }); - - await fastify.listen({ port, host }); - } catch (error) { - console.error(error); - fastify.log.fatal("Failed to start Fastify"); - process.exit(1); - } - - return fastify; -} diff --git a/packages/gatsby-plugin-fastify/src/utils/config.ts b/packages/gatsby-plugin-fastify/src/utils/config.ts deleted file mode 100644 index 594ec27b8..000000000 --- a/packages/gatsby-plugin-fastify/src/utils/config.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { readJSONSync, existsSync } from "fs-extra"; - -import type { NoUndefinedField } from "../gatsby/client-side-route"; -import type { IGatsbyFunction, IRedirect } from "gatsby/dist/redux/types"; -import type { PluginOptions } from "gatsby"; -import type { ServerSideRoute } from "../gatsby/server-routes"; -import type { GatsbyFastifyProxy } from "../gatsby/proxies-and-redirects"; -import type { FastifyServerOptions } from "fastify"; - -import { PathConfig } from "../plugins/client-routes"; -import { CONFIG_FILE_NAME, CONFIG_FILE_PATH } from "./constants"; -import { buildPrefixer } from "./plugin-data"; - -let config: Partial = {}; - -const configPrefixer = buildPrefixer(CONFIG_FILE_PATH); - -export interface GatsbyFastifyPluginOptions extends PluginOptions { - features: { - reverseProxy: boolean | Record; - redirects: boolean; - imageCdn: boolean; - }; - fastify: FastifyServerOptions; -} -export interface GatsbyNodeServerConfig extends GatsbyFastifyPluginOptions { - clientSideRoutes: NoUndefinedField[]; - serverSideRoutes: ServerSideRoute[]; - redirects: IRedirect[]; - prefix: string | undefined; - functions: IGatsbyFunction[]; - proxies: GatsbyFastifyProxy[]; -} - -export type GfCliOptions = { - port: number; - p: number; - host: string; - h: string; - open: boolean; - o: boolean; - logLevel: string; - l: string; -}; - -export enum ConfigKeyEnum { - CLI = "cli", - SERVER = "server", -} - -export type GfConfig = { - [ConfigKeyEnum.CLI]: GfCliOptions; - [ConfigKeyEnum.SERVER]: GatsbyNodeServerConfig; -}; - -export function getConfig(): GfConfig { - if (config.hasOwnProperty(ConfigKeyEnum.SERVER) && config.hasOwnProperty(ConfigKeyEnum.CLI)) { - return config as GfConfig; - } - - throw new Error("Must set config before getting Config."); -} - -export function setConfig(key: Key, incomingConfig: GfConfig[Key]) { - config[key] = incomingConfig; -} - -export function getServerConfig(): GatsbyNodeServerConfig { - const configPath = configPrefixer(CONFIG_FILE_NAME); - if (!existsSync(configPath)) { - throw new Error( - `No Server config found @ ${configPath}, did you do a production Gatsby Build?`, - ); - } - return readJSONSync(configPath, { encoding: "utf8" }); -} diff --git a/packages/gatsby-plugin-fastify/src/utils/constants.ts b/packages/gatsby-plugin-fastify/src/utils/constants.ts deleted file mode 100644 index 4845e9fc2..000000000 --- a/packages/gatsby-plugin-fastify/src/utils/constants.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Gatsby values -export const PATH_TO_FUNCTIONS = ".cache/functions"; -export const PATH_TO_PUBLIC = "public"; -export const PATH_TO_CACHE = ".cache"; - -// Config Values - -export const CONFIG_FILE_NAME = "gatsby-plugin-fastify.json"; -export const CONFIG_FILE_PATH = PATH_TO_CACHE; - -// implementation values - -type Header = [string, string]; -export const IMMUTABLE_CACHING_HEADER: Header = [ - `cache-control`, - `public, max-age=31536000, immutable`, -]; -export const NEVER_CACHE_HEADER: Header = [`cache-control`, `public, max-age=0, must-revalidate`]; diff --git a/packages/gatsby-plugin-fastify/src/utils/headers.ts b/packages/gatsby-plugin-fastify/src/utils/headers.ts deleted file mode 100644 index 8f30f7932..000000000 --- a/packages/gatsby-plugin-fastify/src/utils/headers.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { FastifyReply } from "fastify"; - -function appendHeader({ name, value }: { name: string; value: string }, reply: FastifyReply): void { - const existingHeader = reply.getHeader(name); - if (existingHeader) { - reply.setHeader(name, `${existingHeader} ${value.endsWith(";") ? value : value + ";"}`); - } else { - reply.setHeader(name, value); - } -} - -export type Modules = - | "DSG" - | "SSR" - | "Static" - | "Client Route" - | "Functions" - | "Redirects" - | "Reverse Proxy" - | "404" - | "500" - | "Image Transforms"; - -function servedBy(module: Modules) { - return `served-by: ${module};`; -} - -const FG_MODULE_HEADER = "x-gatsby-fastify"; - -export function appendModuleHeader(module: Modules, reply: FastifyReply): void { - appendHeader({ name: FG_MODULE_HEADER, value: servedBy(module) }, reply); -} - -export function moduleHeaderDecorator(this: FastifyReply, module: Modules): void { - appendModuleHeader(module, this); -} - -export function setHeaderDecorator(this: FastifyReply, key: string, value: string) { - return this.header(key, value); -} diff --git a/packages/gatsby-plugin-fastify/src/utils/log.ts b/packages/gatsby-plugin-fastify/src/utils/log.ts deleted file mode 100644 index 1cb34e478..000000000 --- a/packages/gatsby-plugin-fastify/src/utils/log.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { ServerSideRoute } from "../gatsby/server-routes"; - -export function countPaths(paths: ServerSideRoute[]) { - const results = { dsgCount: 0, ssrCount: 0 }; - - for (const path of paths) { - if (path.mode === "SSR") { - results.ssrCount += 1; - } else if (path.mode === "DSG") { - results.dsgCount += 1; - } - } - - return results; -} diff --git a/packages/gatsby-plugin-fastify/src/utils/plugin-data.ts b/packages/gatsby-plugin-fastify/src/utils/plugin-data.ts deleted file mode 100644 index 5d3fa13d9..000000000 --- a/packages/gatsby-plugin-fastify/src/utils/plugin-data.ts +++ /dev/null @@ -1,39 +0,0 @@ -//This file was initially coppied from `gatsby-plugin-gatsby-cloud` - -import { join } from "node:path"; -import { PATH_TO_CACHE, PATH_TO_FUNCTIONS, PATH_TO_PUBLIC } from "./constants"; -import type { Store } from "gatsby"; -import { IGatsbyState } from "gatsby/dist/redux/types"; - -export function buildPrefixer(prefix: string, ...paths: string[]) { - return (...subpaths: string[]) => join(prefix, ...paths, ...subpaths); -} - -// This function assembles data across the manifests and store to match a similar -// shape of `static-entry.js`. With it, we can build headers that point to the correct -// hashed filenames and ensure we pull in the componentChunkName. -export async function makePluginData(store: Store, pathPrefix: string): Promise { - const { program, pages } = store.getState() as IGatsbyState; - - const publicFolder = buildPrefixer(program.directory, PATH_TO_PUBLIC); - const functionsFolder = buildPrefixer(program.directory, PATH_TO_FUNCTIONS); - const configFolder = buildPrefixer(program.directory, PATH_TO_CACHE); - - return { - pages, - program, - pathPrefix, - publicFolder, - functionsFolder, - configFolder, - }; -} - -export interface PluginData { - pages: IGatsbyState["pages"]; - program: IGatsbyState["program"]; - pathPrefix: string; - publicFolder: (...paths: string[]) => string; - functionsFolder: (...paths: string[]) => string; - configFolder: (...paths: string[]) => string; -} diff --git a/packages/gatsby-plugin-fastify/src/utils/routes.ts b/packages/gatsby-plugin-fastify/src/utils/routes.ts deleted file mode 100644 index 35b964e5d..000000000 --- a/packages/gatsby-plugin-fastify/src/utils/routes.ts +++ /dev/null @@ -1,28 +0,0 @@ -export function formatMatchPath(matchPath: string): string { - return ( - matchPath - // /test/*example (named splat route) => /test/* as find-my-way doesn't support named splats - .replace(/\*([a-z]+)?/i, "*") - // Findmyway can't match a /example/* route to /example, this modifies the match path is /example* so that it correctly matchs /example, /example/, and /example/test - // Work around for https://github.com/fastify/fastify/issues/3331 - .replace(/\/\*$/, "*") - ); -} - -export function removeQueryParmsFromUrl(url: string) { - return url.split("?", 2)[0]; -} - -export function buildRedirectUrlFromParameters(path: string, data: { [s: string]: string } = {}) { - return path.replaceAll(/:(\w+)|(\*)/gi, function (match, p1, p2) { - if (p1 && !data[p1]) return match; // :Something in toPath does not have a splat in fromPath pass it through colon intact - let lookupString = p1 ?? p2; - let replacement = data[lookupString]; - - if (!replacement) { - throw new Error("Could not find url parameter " + lookupString + " in passed data object"); - } - - return replacement; - }); -} diff --git a/packages/gatsby-plugin-fastify/src/utils/server.ts b/packages/gatsby-plugin-fastify/src/utils/server.ts deleted file mode 100644 index 86673ed97..000000000 --- a/packages/gatsby-plugin-fastify/src/utils/server.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { FastifyServerOptions } from "fastify"; -import type { GfConfig } from "./config"; - -export function createFastifyConfig(config: GfConfig): FastifyServerOptions { - return { - logger: { level: config.cli.logLevel }, - maxParamLength: 500, - ...config.server.fastify, - ignoreTrailingSlash: true, - }; -} diff --git a/packages/gatsby-plugin-fastify/tsconfig.json b/packages/gatsby-plugin-fastify/tsconfig.json deleted file mode 100644 index eebb4e2be..000000000 --- a/packages/gatsby-plugin-fastify/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "compilerOptions": { - "target": "ESNext", - "module": "esnext", - "moduleResolution": "node", - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "skipLibCheck": true, - "strictBindCallApply": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "strictPropertyInitialization": true, - "noFallthroughCasesInSwitch": true, - "resolveJsonModule": true, - "esModuleInterop": true, - "jsx": "preserve", - "paths": {} - } -} diff --git a/yarn.lock b/yarn.lock index 11494ea32..7d8a69010 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3124,7 +3124,7 @@ __metadata: languageName: node linkType: hard -"@babel/preset-typescript@npm:^7.18.6, @babel/preset-typescript@npm:^7.25.7": +"@babel/preset-typescript@npm:^7.18.6": version: 7.25.7 resolution: "@babel/preset-typescript@npm:7.25.7" dependencies: @@ -3835,121 +3835,6 @@ __metadata: languageName: node linkType: hard -"@fastify/accept-negotiator@npm:^1.0.0": - version: 1.0.0 - resolution: "@fastify/accept-negotiator@npm:1.0.0" - checksum: 10/9b6be6bfd0f1475e4d06ffbd6359d7cf70841cc8e37abe6fe32f2e0e8185da6077da0d5c6610ade356ed3d4af4d3a642094b4861b123607987491bef2a384957 - languageName: node - linkType: hard - -"@fastify/accepts@npm:^4.3.0": - version: 4.3.0 - resolution: "@fastify/accepts@npm:4.3.0" - dependencies: - accepts: "npm:^1.3.5" - fastify-plugin: "npm:^4.0.0" - checksum: 10/2255e63b1beac297a9fca94e5557976acf3758f6568f3e36bc66de43b057256072db56626212062b24aa9153690fbb2fb2bd0a10adb9d32f16437e9a6c12367b - languageName: node - linkType: hard - -"@fastify/ajv-compiler@npm:^3.5.0": - version: 3.5.0 - resolution: "@fastify/ajv-compiler@npm:3.5.0" - dependencies: - ajv: "npm:^8.11.0" - ajv-formats: "npm:^2.1.1" - fast-uri: "npm:^2.0.0" - checksum: 10/c46c4680bf583e37b97ffc85b69070712c9c47e18ddf89b9fb93dbc0b6ba3c6496cf624aabe9aac25dafc4a404b738ab0fedcff66503df0ce18d9dcad9e44b26 - languageName: node - linkType: hard - -"@fastify/deepmerge@npm:^1.0.0": - version: 1.1.0 - resolution: "@fastify/deepmerge@npm:1.1.0" - checksum: 10/363b2cdce5ff205a8c8422144b1f1fa6c99137f3c58bd1fd4507ee890714bc953c87e275a984d30e93cb9f2c668cd4793607326182cda16660ea126503231f3c - languageName: node - linkType: hard - -"@fastify/error@npm:^3.0.0, @fastify/error@npm:^3.2.0, @fastify/error@npm:^3.3.0, @fastify/error@npm:^3.4.0": - version: 3.4.1 - resolution: "@fastify/error@npm:3.4.1" - checksum: 10/4d63660f7d4a0d6091abf869208d30898bde82f513ca7be542243d9d740df743dd4be293e7db30858fca612dd512d28a818ea06dc674e06b445278fcefcdda92 - languageName: node - linkType: hard - -"@fastify/fast-json-stringify-compiler@npm:^4.3.0": - version: 4.3.0 - resolution: "@fastify/fast-json-stringify-compiler@npm:4.3.0" - dependencies: - fast-json-stringify: "npm:^5.7.0" - checksum: 10/9ad575907d44bbd371dbc23a51853fd349a459092340fe91c50317f92707961f2e6ca6c9d17707a8e4a087c635e09bce1166e082d54f191769a582339c94badd - languageName: node - linkType: hard - -"@fastify/http-proxy@npm:^8.4.0": - version: 8.4.0 - resolution: "@fastify/http-proxy@npm:8.4.0" - dependencies: - "@fastify/reply-from": "npm:^8.0.0" - ws: "npm:^8.4.2" - checksum: 10/bc125ef0b49edb4152c327946a190ebbafc92d25989d99ba7e56863d21852fd5f8a9333cec4fbd42b7204159d525ed2b344eec1de020e4e6c44553f78c94f62c - languageName: node - linkType: hard - -"@fastify/middie@npm:^8.3.3": - version: 8.3.3 - resolution: "@fastify/middie@npm:8.3.3" - dependencies: - "@fastify/error": "npm:^3.2.0" - fastify-plugin: "npm:^4.0.0" - path-to-regexp: "npm:^6.3.0" - reusify: "npm:^1.0.4" - checksum: 10/b03e12a62e099443a41e59d1d826b3a7c98d2b68788535a7dd743008c7ed9edcd076fa2999a947786effc40a669325ba52d7095ca9776ab2501c1be3add5ad0a - languageName: node - linkType: hard - -"@fastify/reply-from@npm:^8.0.0": - version: 8.2.1 - resolution: "@fastify/reply-from@npm:8.2.1" - dependencies: - "@fastify/error": "npm:^3.0.0" - end-of-stream: "npm:^1.4.4" - fastify-plugin: "npm:^4.0.0" - pump: "npm:^3.0.0" - semver: "npm:^7.3.7" - tiny-lru: "npm:^8.0.2" - undici: "npm:^5.5.1" - checksum: 10/116b4db155fa81c57dc0b41d839d6afc0f32557ca7fae2c8dc5b679867bf8ff1d5257c5c460881d7160a91e1a34708637e85f0d2171c47b05a028c0967d85311 - languageName: node - linkType: hard - -"@fastify/send@npm:^2.0.0": - version: 2.0.1 - resolution: "@fastify/send@npm:2.0.1" - dependencies: - "@lukeed/ms": "npm:^2.0.1" - escape-html: "npm:~1.0.3" - fast-decode-uri-component: "npm:^1.0.1" - http-errors: "npm:2.0.0" - mime: "npm:^3.0.0" - checksum: 10/2e0a21d9a6e7dcba37fcc450fdc51b44304128713276011a2e5f379a7d6cbc1e74298ef1974dc9fb18bf3533de8400b06c3534465d6fed77d9c7f90a6dbaa427 - languageName: node - linkType: hard - -"@fastify/static@npm:^6.12.0": - version: 6.12.0 - resolution: "@fastify/static@npm:6.12.0" - dependencies: - "@fastify/accept-negotiator": "npm:^1.0.0" - "@fastify/send": "npm:^2.0.0" - content-disposition: "npm:^0.5.3" - fastify-plugin: "npm:^4.0.0" - glob: "npm:^8.0.1" - p-limit: "npm:^3.1.0" - checksum: 10/33304062bd2cc0dd3b79c5f2544a87be8e27a6c9360ffa0d2d290e8d10d50ab8d2e04802193d4727e113f6b71728f5482f5c7082d8b798d52a080e170cec3ce5 - languageName: node - linkType: hard - "@gar/promisify@npm:^1.0.1": version: 1.1.2 resolution: "@gar/promisify@npm:1.1.2" @@ -4769,13 +4654,6 @@ __metadata: languageName: node linkType: hard -"@lukeed/ms@npm:^2.0.1": - version: 2.0.1 - resolution: "@lukeed/ms@npm:2.0.1" - checksum: 10/c7b46933bf7bad3e024dcbbe2ad6201392b4ed2a05a717c0ef7e96a03fb885d44f08b4b749c392cc51c2736a6a45a08c77f1863ace1c072928fbfd9908a13db3 - languageName: node - linkType: hard - "@manypkg/find-root@npm:^1.1.0": version: 1.1.0 resolution: "@manypkg/find-root@npm:1.1.0" @@ -7118,15 +6996,6 @@ __metadata: languageName: node linkType: hard -"@types/connect@npm:^3.4.38": - version: 3.4.38 - resolution: "@types/connect@npm:3.4.38" - dependencies: - "@types/node": "npm:*" - checksum: 10/7eb1bc5342a9604facd57598a6c62621e244822442976c443efb84ff745246b10d06e8b309b6e80130026a396f19bf6793b7cecd7380169f369dac3bfc46fb99 - languageName: node - linkType: hard - "@types/cookie@npm:^0.4.1": version: 0.4.1 resolution: "@types/cookie@npm:0.4.1" @@ -7184,16 +7053,6 @@ __metadata: languageName: node linkType: hard -"@types/fs-extra@npm:^11.0.4": - version: 11.0.4 - resolution: "@types/fs-extra@npm:11.0.4" - dependencies: - "@types/jsonfile": "npm:*" - "@types/node": "npm:*" - checksum: 10/acc4c1eb0cde7b1f23f3fe6eb080a14832d8fa9dc1761aa444c5e2f0f6b6fa657ed46ebae32fb580a6700fc921b6165ce8ac3e3ba030c3dd15f10ad4dd4cae98 - languageName: node - linkType: hard - "@types/get-port@npm:^3.2.0": version: 3.2.0 resolution: "@types/get-port@npm:3.2.0" @@ -7271,16 +7130,6 @@ __metadata: languageName: node linkType: hard -"@types/jest@npm:^29.5.13": - version: 29.5.13 - resolution: "@types/jest@npm:29.5.13" - dependencies: - expect: "npm:^29.0.0" - pretty-format: "npm:^29.0.0" - checksum: 10/7d6e3e4ef4b1cab0f61270d55764709512fdfbcb1bd47c0ef44117d48490529c1f264dacf3440b9188363e99e290b80b79c529eadc3af2184116a90f6856b192 - languageName: node - linkType: hard - "@types/json-schema@npm:*, @types/json-schema@npm:^7.0.15, @types/json-schema@npm:^7.0.4, @types/json-schema@npm:^7.0.5, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": version: 7.0.15 resolution: "@types/json-schema@npm:7.0.15" @@ -7295,15 +7144,6 @@ __metadata: languageName: node linkType: hard -"@types/jsonfile@npm:*": - version: 6.1.4 - resolution: "@types/jsonfile@npm:6.1.4" - dependencies: - "@types/node": "npm:*" - checksum: 10/309fda20eb5f1cf68f2df28931afdf189c5e7e6bec64ac783ce737bb98908d57f6f58757ad5da9be37b815645a6f914e2d4f3ac66c574b8fe1ba6616284d0e97 - languageName: node - linkType: hard - "@types/keyv@npm:*": version: 3.1.3 resolution: "@types/keyv@npm:3.1.3" @@ -7329,13 +7169,6 @@ __metadata: languageName: node linkType: hard -"@types/mime@npm:^3.0.4": - version: 3.0.4 - resolution: "@types/mime@npm:3.0.4" - checksum: 10/a6139c8e1f705ef2b064d072f6edc01f3c099023ad7c4fce2afc6c2bf0231888202adadbdb48643e8e20da0ce409481a49922e737eca52871b3dc08017455843 - languageName: node - linkType: hard - "@types/minimatch@npm:*": version: 3.0.5 resolution: "@types/minimatch@npm:3.0.5" @@ -7406,13 +7239,6 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^17.0.5": - version: 17.0.45 - resolution: "@types/node@npm:17.0.45" - checksum: 10/b45fff7270b5e81be19ef91a66b764a8b21473a97a8d211218a52e3426b79ad48f371819ab9153370756b33ba284e5c875463de4d2cf48a472e9098d7f09e8a2 - languageName: node - linkType: hard - "@types/node@npm:^20.16.11": version: 20.16.11 resolution: "@types/node@npm:20.16.11" @@ -7443,13 +7269,6 @@ __metadata: languageName: node linkType: hard -"@types/picomatch@npm:^2.3.4": - version: 2.3.4 - resolution: "@types/picomatch@npm:2.3.4" - checksum: 10/12f67f2425fb134cb24edfeeeebee1a18b4464e7767690780ca9e1edc8e3573bfb851febba5ee079ff1ee87bc0a9525bed0f3b724581f6e8051ff48529078f17 - languageName: node - linkType: hard - "@types/prop-types@npm:*": version: 15.7.4 resolution: "@types/prop-types@npm:15.7.4" @@ -7496,15 +7315,6 @@ __metadata: languageName: node linkType: hard -"@types/sax@npm:^1.2.1": - version: 1.2.3 - resolution: "@types/sax@npm:1.2.3" - dependencies: - "@types/node": "npm:*" - checksum: 10/75ea0e33bca76ce407c31e51c19b125136d0e656d9b8d97f07299a8355bbc1a95b2542f71b428cc861dbff30609938a318f91987e5ec4059f9de16791f105771 - languageName: node - linkType: hard - "@types/scheduler@npm:*": version: 0.16.2 resolution: "@types/scheduler@npm:0.16.2" @@ -7575,7 +7385,7 @@ __metadata: languageName: node linkType: hard -"@types/yargs@npm:^17.0.33, @types/yargs@npm:^17.0.8": +"@types/yargs@npm:^17.0.8": version: 17.0.33 resolution: "@types/yargs@npm:17.0.33" dependencies: @@ -8125,14 +7935,7 @@ __metadata: languageName: node linkType: hard -"abstract-logging@npm:^2.0.1": - version: 2.0.1 - resolution: "abstract-logging@npm:2.0.1" - checksum: 10/6967d15e5abbafd17f56eaf30ba8278c99333586fa4f7935fd80e93cfdc006c37fcc819c5d63ee373a12e6cb2d0417f7c3c6b9e42b957a25af9937d26749415e - languageName: node - linkType: hard - -"accepts@npm:^1.3.5, accepts@npm:~1.3.4, accepts@npm:~1.3.5, accepts@npm:~1.3.8": +"accepts@npm:~1.3.4, accepts@npm:~1.3.5, accepts@npm:~1.3.8": version: 1.3.8 resolution: "accepts@npm:1.3.8" dependencies: @@ -8285,20 +8088,6 @@ __metadata: languageName: node linkType: hard -"ajv-formats@npm:^2.1.1": - version: 2.1.1 - resolution: "ajv-formats@npm:2.1.1" - dependencies: - ajv: "npm:^8.0.0" - peerDependencies: - ajv: ^8.0.0 - peerDependenciesMeta: - ajv: - optional: true - checksum: 10/70c263ded219bf277ffd9127f793b625f10a46113b2e901e150da41931fcfd7f5592da6d66862f4449bb157ffe65867c3294a7df1d661cc232c4163d5a1718ed - languageName: node - linkType: hard - "ajv-keywords@npm:^3.4.1, ajv-keywords@npm:^3.5.2": version: 3.5.2 resolution: "ajv-keywords@npm:3.5.2" @@ -8308,17 +8097,6 @@ __metadata: languageName: node linkType: hard -"ajv-keywords@npm:^5.0.0": - version: 5.1.0 - resolution: "ajv-keywords@npm:5.1.0" - dependencies: - fast-deep-equal: "npm:^3.1.3" - peerDependencies: - ajv: ^8.8.2 - checksum: 10/5021f96ab7ddd03a4005326bd06f45f448ebfbb0fe7018b1b70b6c28142fa68372bda2057359814b83fd0b2d4c8726c297f0a7557b15377be7b56ce5344533d8 - languageName: node - linkType: hard - "ajv@npm:^6.10.0, ajv@npm:^6.12.2, ajv@npm:^6.12.3, ajv@npm:^6.12.4, ajv@npm:^6.12.5": version: 6.12.6 resolution: "ajv@npm:6.12.6" @@ -8331,7 +8109,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^8.0.0, ajv@npm:^8.0.1, ajv@npm:^8.10.0, ajv@npm:^8.11.0, ajv@npm:^8.8.0": +"ajv@npm:^8.0.1": version: 8.11.0 resolution: "ajv@npm:8.11.0" dependencies: @@ -8539,7 +8317,7 @@ __metadata: languageName: node linkType: hard -"arg@npm:^5.0.0, arg@npm:^5.0.2": +"arg@npm:^5.0.2": version: 5.0.2 resolution: "arg@npm:5.0.2" checksum: 10/92fe7de222054a060fd2329e92e867410b3ea260328147ee3fb7855f78efae005f4087e698d4e688a856893c56bb09951588c40f2c901cf6996cd8cd7bcfef2c @@ -8824,16 +8602,6 @@ __metadata: languageName: node linkType: hard -"avvio@npm:^8.3.0": - version: 8.4.0 - resolution: "avvio@npm:8.4.0" - dependencies: - "@fastify/error": "npm:^3.3.0" - fastq: "npm:^1.17.1" - checksum: 10/b98ffd99743d404d32094a26ce5296937cdfc8a7c75837fedfb79b409a9a51b177173aa90e930b1fa453965b5fa18ee4548dca20eac191846d5de91c487c4da4 - languageName: node - linkType: hard - "aws-sign2@npm:~0.7.0": version: 0.7.0 resolution: "aws-sign2@npm:0.7.0" @@ -8956,19 +8724,6 @@ __metadata: languageName: node linkType: hard -"babel-loader@npm:^9.2.1": - version: 9.2.1 - resolution: "babel-loader@npm:9.2.1" - dependencies: - find-cache-dir: "npm:^4.0.0" - schema-utils: "npm:^4.0.0" - peerDependencies: - "@babel/core": ^7.12.0 - webpack: ">=5" - checksum: 10/f1f24ae3c22d488630629240b0eba9c935545f82ff843c214e8f8df66e266492b7a3d4cb34ef9c9721fb174ca222e900799951c3fd82199473bc6bac52ec03a3 - languageName: node - linkType: hard - "babel-plugin-add-module-exports@npm:^1.0.4": version: 1.0.4 resolution: "babel-plugin-add-module-exports@npm:1.0.4" @@ -9264,16 +9019,6 @@ __metadata: languageName: node linkType: hard -"benchmark@npm:^2.1.4": - version: 2.1.4 - resolution: "benchmark@npm:2.1.4" - dependencies: - lodash: "npm:^4.17.4" - platform: "npm:^1.3.3" - checksum: 10/0f42f865aeb8b79992bb6204874312f9cb384e122f4fd3b20ba6d0bc7cff003610400fb37e52580a7b4aec4a3d1291c51b5ff887691b1abc80e9df4ff032a675 - languageName: node - linkType: hard - "better-opn@npm:^2.1.1": version: 2.1.1 resolution: "better-opn@npm:2.1.1" @@ -10426,7 +10171,7 @@ __metadata: languageName: node linkType: hard -"content-disposition@npm:0.5.4, content-disposition@npm:^0.5.3": +"content-disposition@npm:0.5.4": version: 0.5.4 resolution: "content-disposition@npm:0.5.4" dependencies: @@ -10599,23 +10344,6 @@ __metadata: languageName: node linkType: hard -"cosmiconfig@npm:^8.2.0": - version: 8.3.6 - resolution: "cosmiconfig@npm:8.3.6" - dependencies: - import-fresh: "npm:^3.3.0" - js-yaml: "npm:^4.1.0" - parse-json: "npm:^5.2.0" - path-type: "npm:^4.0.0" - peerDependencies: - typescript: ">=4.9.5" - peerDependenciesMeta: - typescript: - optional: true - checksum: 10/91d082baca0f33b1c085bf010f9ded4af43cbedacba8821da0fb5667184d0a848addc52c31fadd080007f904a555319c238cf5f4c03e6d58ece2e4876b2e73d6 - languageName: node - linkType: hard - "covector@npm:0.12.3": version: 0.12.3 resolution: "covector@npm:0.12.3" @@ -11753,7 +11481,7 @@ __metadata: languageName: node linkType: hard -"end-of-stream@npm:^1.1.0, end-of-stream@npm:^1.4.1, end-of-stream@npm:^1.4.4": +"end-of-stream@npm:^1.1.0, end-of-stream@npm:^1.4.1": version: 1.4.4 resolution: "end-of-stream@npm:1.4.4" dependencies: @@ -12754,7 +12482,7 @@ __metadata: languageName: node linkType: hard -"expect@npm:^29.0.0, expect@npm:^29.7.0": +"expect@npm:^29.7.0": version: 29.7.0 resolution: "expect@npm:29.7.0" dependencies: @@ -12889,27 +12617,6 @@ __metadata: languageName: node linkType: hard -"faker@npm:^4.1.0": - version: 4.1.0 - resolution: "faker@npm:4.1.0" - checksum: 10/9d349048c4dd57f96f50b7e68f33439627e1a5a25ec2129b991a0a2d3d5c9ba4dae1f1f243854fe5e08d0b90deeed72cdfe8cb7ac13217db4f62608279aa7425 - languageName: node - linkType: hard - -"fast-content-type-parse@npm:^1.1.0": - version: 1.1.0 - resolution: "fast-content-type-parse@npm:1.1.0" - checksum: 10/8637228a19b11296992af5d9b5f5ae84c6f27a465cf36a901b303b784ce0ca6f10502375da59958eb2b9c4949b98e5cc460ecb4bd777d22c3fa236c1e8da1ed8 - languageName: node - linkType: hard - -"fast-decode-uri-component@npm:^1.0.1": - version: 1.0.1 - resolution: "fast-decode-uri-component@npm:1.0.1" - checksum: 10/4b6ed26974414f688be4a15eab6afa997bad4a7c8605cb1deb928b28514817b4523a1af0fa06621c6cbfedb7e5615144c2c3e7512860e3a333a31a28d537dca7 - languageName: node - linkType: hard - "fast-deep-equal@npm:^3.1.1, fast-deep-equal@npm:^3.1.3": version: 3.1.3 resolution: "fast-deep-equal@npm:3.1.3" @@ -12944,21 +12651,6 @@ __metadata: languageName: node linkType: hard -"fast-json-stringify@npm:^5.7.0, fast-json-stringify@npm:^5.8.0": - version: 5.9.1 - resolution: "fast-json-stringify@npm:5.9.1" - dependencies: - "@fastify/deepmerge": "npm:^1.0.0" - ajv: "npm:^8.10.0" - ajv-formats: "npm:^2.1.1" - fast-deep-equal: "npm:^3.1.3" - fast-uri: "npm:^2.1.0" - json-schema-ref-resolver: "npm:^1.0.1" - rfdc: "npm:^1.2.0" - checksum: 10/873862329f4053b171cb831a2da563bfe3614257a7f7a23042e49bddfb907d166f624df2d96128f8425740eb191e9991cf27ef31053c9cf531bfd056ab96b6d4 - languageName: node - linkType: hard - "fast-levenshtein@npm:^2.0.6": version: 2.0.6 resolution: "fast-levenshtein@npm:2.0.6" @@ -12966,15 +12658,6 @@ __metadata: languageName: node linkType: hard -"fast-querystring@npm:^1.0.0": - version: 1.0.0 - resolution: "fast-querystring@npm:1.0.0" - dependencies: - fast-decode-uri-component: "npm:^1.0.1" - checksum: 10/5f70df27d02fcf86ea2baa16ea59e0da8bbd891e3a97aa1e95b1c0c64d5445aeab3bde5ce3e603b21d48c87db70a458febf05150a9dbe7c099aced5f123b3ffd - languageName: node - linkType: hard - "fast-redact@npm:^3.1.1": version: 3.1.2 resolution: "fast-redact@npm:3.1.2" @@ -12982,13 +12665,6 @@ __metadata: languageName: node linkType: hard -"fast-uri@npm:^2.0.0, fast-uri@npm:^2.1.0": - version: 2.1.0 - resolution: "fast-uri@npm:2.1.0" - checksum: 10/f41b330c748423b2978cf99412066bfe6df1dec128e4d3881755f61e2bf1b9c87c6e14ee28b0a205ff42039bff214696f678decf9e3ffbda3c79ce8fedbafe26 - languageName: node - linkType: hard - "fast-xml-parser@npm:4.4.1": version: 4.4.1 resolution: "fast-xml-parser@npm:4.4.1" @@ -13007,38 +12683,7 @@ __metadata: languageName: node linkType: hard -"fastify-plugin@npm:^4.0.0, fastify-plugin@npm:^4.5.1": - version: 4.5.1 - resolution: "fastify-plugin@npm:4.5.1" - checksum: 10/7c6d777ada0f01c8a1166a2a669cccfd6074c7764121f07cce997745f198227a271c7a317aaf0da273b329f24307f0eba3f093d872d29b839b33deb525bbafe2 - languageName: node - linkType: hard - -"fastify@npm:^4.28.1": - version: 4.28.1 - resolution: "fastify@npm:4.28.1" - dependencies: - "@fastify/ajv-compiler": "npm:^3.5.0" - "@fastify/error": "npm:^3.4.0" - "@fastify/fast-json-stringify-compiler": "npm:^4.3.0" - abstract-logging: "npm:^2.0.1" - avvio: "npm:^8.3.0" - fast-content-type-parse: "npm:^1.1.0" - fast-json-stringify: "npm:^5.8.0" - find-my-way: "npm:^8.0.0" - light-my-request: "npm:^5.11.0" - pino: "npm:^9.0.0" - process-warning: "npm:^3.0.0" - proxy-addr: "npm:^2.0.7" - rfdc: "npm:^1.3.0" - secure-json-parse: "npm:^2.7.0" - semver: "npm:^7.5.4" - toad-cache: "npm:^3.3.0" - checksum: 10/8a749dd540609579258cd0471c521696ed16bf66e34d46babbbed9d9a184bd7a378c2ec87a233e382071c1c91b223db0a1ad1a7f9dc8a8f2240aaf8e173ed597 - languageName: node - linkType: hard - -"fastq@npm:^1.15.0, fastq@npm:^1.17.1, fastq@npm:^1.6.0": +"fastq@npm:^1.15.0, fastq@npm:^1.6.0": version: 1.17.1 resolution: "fastq@npm:1.17.1" dependencies: @@ -13229,27 +12874,6 @@ __metadata: languageName: node linkType: hard -"find-cache-dir@npm:^4.0.0": - version: 4.0.0 - resolution: "find-cache-dir@npm:4.0.0" - dependencies: - common-path-prefix: "npm:^3.0.0" - pkg-dir: "npm:^7.0.0" - checksum: 10/52a456a80deeb27daa3af6e06059b63bdb9cc4af4d845fc6d6229887e505ba913cd56000349caa60bc3aa59dacdb5b4c37903d4ba34c75102d83cab330b70d2f - languageName: node - linkType: hard - -"find-my-way@npm:^8.0.0": - version: 8.2.2 - resolution: "find-my-way@npm:8.2.2" - dependencies: - fast-deep-equal: "npm:^3.1.3" - fast-querystring: "npm:^1.0.0" - safe-regex2: "npm:^3.1.0" - checksum: 10/8a3e7531a7471d1ea93e77d4e486f4ca8c42fc0349efaaefba197cabf4e2fa62f4ae65866b34702eb74c7f2caf9121d26e04c9f4b25db76310b5399a6db7f5a5 - languageName: node - linkType: hard - "find-packages@npm:10.0.4": version: 10.0.4 resolution: "find-packages@npm:10.0.4" @@ -13292,16 +12916,6 @@ __metadata: languageName: node linkType: hard -"find-up@npm:^6.3.0": - version: 6.3.0 - resolution: "find-up@npm:6.3.0" - dependencies: - locate-path: "npm:^7.1.0" - path-exists: "npm:^5.0.0" - checksum: 10/4f3bdc30d41778c647e53f4923e72de5e5fb055157031f34501c5b36c2eb59f77b997edf9cb00165c6060cda7eaa2e3da82cb6be2e61d68ad3e07c4bc4cce67e - languageName: node - linkType: hard - "flat-cache@npm:^3.0.4": version: 3.0.4 resolution: "flat-cache@npm:3.0.4" @@ -13796,45 +13410,6 @@ __metadata: languageName: unknown linkType: soft -"gatsby-plugin-fastify@npm:*, gatsby-plugin-fastify@workspace:packages/gatsby-plugin-fastify": - version: 0.0.0-use.local - resolution: "gatsby-plugin-fastify@workspace:packages/gatsby-plugin-fastify" - dependencies: - "@babel/cli": "npm:^7.25.7" - "@babel/core": "npm:^7.25.8" - "@babel/runtime": "npm:^7.25.7" - "@fastify/accepts": "npm:^4.3.0" - "@fastify/http-proxy": "npm:^8.4.0" - "@fastify/middie": "npm:^8.3.3" - "@fastify/static": "npm:^6.12.0" - "@types/connect": "npm:^3.4.38" - "@types/fs-extra": "npm:^11.0.4" - "@types/jest": "npm:^29.5.13" - "@types/mime": "npm:^3.0.4" - "@types/node": "npm:^20.16.11" - "@types/picomatch": "npm:^2.3.4" - "@types/yargs": "npm:^17.0.33" - babel-jest: "npm:^29.7.0" - babel-preset-gatsby-package: "npm:^3.13.1" - cross-env: "npm:^7.0.3" - fastify-plugin: "npm:^4.5.1" - fs-extra: "npm:^11.2.0" - gatsby-core-utils: "npm:^4.13.1" - gatsby-plugin-utils: "npm:^4.13.1" - http-status-codes: "npm:^2.3.0" - jest: "npm:^29.7.0" - mime: "npm:^3.0.0" - open: "npm:^8.4.2" - picomatch: "npm:^2.3.1" - yargs: "npm:^17.7.2" - peerDependencies: - fastify: ^4.5.3 - gatsby: ^4.2.0 || ^5.0.0 - bin: - gserve: ./dist/cli.js - languageName: unknown - linkType: soft - "gatsby-plugin-github-ribbon@workspace:packages/gatsby-plugin-github-ribbon": version: 0.0.0-use.local resolution: "gatsby-plugin-github-ribbon@workspace:packages/gatsby-plugin-github-ribbon" @@ -13888,21 +13463,6 @@ __metadata: languageName: node linkType: hard -"gatsby-plugin-manifest@npm:^5.13.1": - version: 5.13.1 - resolution: "gatsby-plugin-manifest@npm:5.13.1" - dependencies: - "@babel/runtime": "npm:^7.20.13" - gatsby-core-utils: "npm:^4.13.1" - gatsby-plugin-utils: "npm:^4.13.1" - semver: "npm:^7.5.3" - sharp: "npm:^0.32.6" - peerDependencies: - gatsby: ^5.0.0-next - checksum: 10/45d59a4aa57bc4378b8da19517e738403755ae94fb549732aa71b23cbf7dfad640d58bbec1465d54b19cd79d40893875365790f28191fbf427cf515be720b50b - languageName: node - linkType: hard - "gatsby-plugin-page-creator@npm:^5.13.1": version: 5.13.1 resolution: "gatsby-plugin-page-creator@npm:5.13.1" @@ -13941,19 +13501,6 @@ __metadata: languageName: unknown linkType: soft -"gatsby-plugin-postcss@npm:^6.13.1": - version: 6.13.1 - resolution: "gatsby-plugin-postcss@npm:6.13.1" - dependencies: - "@babel/runtime": "npm:^7.20.13" - postcss-loader: "npm:^7.3.3" - peerDependencies: - gatsby: ^5.0.0-next - postcss: ^8.0.5 - checksum: 10/8270846de993c741904cd1db53a3791797aa076d8c0d1162854590deaa7fb639f700079325aaeb6594ae83956f8db86633ec1b2f583fe278ab91e5ab8c552458 - languageName: node - linkType: hard - "gatsby-plugin-readingtime@workspace:packages/gatsby-plugin-readingtime": version: 0.0.0-use.local resolution: "gatsby-plugin-readingtime@workspace:packages/gatsby-plugin-readingtime" @@ -14000,22 +13547,6 @@ __metadata: languageName: node linkType: hard -"gatsby-plugin-sitemap@npm:^6.13.1": - version: 6.13.1 - resolution: "gatsby-plugin-sitemap@npm:6.13.1" - dependencies: - "@babel/runtime": "npm:^7.20.13" - common-tags: "npm:^1.8.2" - minimatch: "npm:^3.1.2" - sitemap: "npm:^7.1.1" - peerDependencies: - gatsby: ^5.0.0-next - react: ^18.0.0 || ^0.0.0 - react-dom: ^18.0.0 || ^0.0.0 - checksum: 10/80cb28ff6f2fdff1876ac20fd4e476f3990e45124741991197a7e33ddff5c00f6ad69d44630af4bfd06d63fb8a89ed01623bb71df788ac385e7e63ba16b4efb5 - languageName: node - linkType: hard - "gatsby-plugin-typescript@npm:^5.13.1": version: 5.13.1 resolution: "gatsby-plugin-typescript@npm:5.13.1" @@ -14119,18 +13650,6 @@ __metadata: languageName: unknown linkType: soft -"gatsby-source-faker@npm:^5.13.1": - version: 5.13.1 - resolution: "gatsby-source-faker@npm:5.13.1" - dependencies: - "@babel/runtime": "npm:^7.20.13" - faker: "npm:^4.1.0" - peerDependencies: - gatsby: ^5.0.0-next - checksum: 10/c70eb240ca8757b4be7854a21f43e27fdf55ecef53b300f36c0faf8dfd6a392a3da946a21316c0312723facb9c241de3b8831c6285f0ede9610d15d156eae4fa - languageName: node - linkType: hard - "gatsby-source-filesystem@npm:^5.13.1": version: 5.13.1 resolution: "gatsby-source-filesystem@npm:5.13.1" @@ -14737,19 +14256,6 @@ __metadata: languageName: node linkType: hard -"glob@npm:^8.0.1": - version: 8.0.3 - resolution: "glob@npm:8.0.3" - dependencies: - fs.realpath: "npm:^1.0.0" - inflight: "npm:^1.0.4" - inherits: "npm:2" - minimatch: "npm:^5.0.1" - once: "npm:^1.3.0" - checksum: 10/cd002c04010ffddba426376c3046466b923b5450f89a434e6a9df6bfec369a4e907afc436303d7fbc34366dcf37056dcc3bec41e41ce983ed8d78b6035ecc317 - languageName: node - linkType: hard - "global-agent@npm:3.0.0": version: 3.0.0 resolution: "global-agent@npm:3.0.0" @@ -15282,13 +14788,6 @@ __metadata: languageName: node linkType: hard -"http-status-codes@npm:^2.3.0": - version: 2.3.0 - resolution: "http-status-codes@npm:2.3.0" - checksum: 10/1b8a01940b5e14d3c5b2f842313f4531469b41ce4fa40ca3aae5c82a3101828db2cc9406bfb2d50a46e6d521d106577b6656c2b065c76125b99ee54b2cbbac09 - languageName: node - linkType: hard - "http2-wrapper@npm:^1.0.0-beta.5.2": version: 1.0.3 resolution: "http2-wrapper@npm:1.0.3" @@ -16962,15 +16461,6 @@ __metadata: languageName: node linkType: hard -"jiti@npm:^1.18.2": - version: 1.18.2 - resolution: "jiti@npm:1.18.2" - bin: - jiti: bin/jiti.js - checksum: 10/11227bd99773dd5c596a2e9a253b22e9ec077ccae769f14c1b23cf381f0ba1b0354e7c065e8b5cb0d8044e4c3e047de3de8c1f07e3ce99997011708bffce80bc - languageName: node - linkType: hard - "joi@npm:^17.13.3, joi@npm:^17.9.2": version: 17.13.3 resolution: "joi@npm:17.13.3" @@ -17096,15 +16586,6 @@ __metadata: languageName: node linkType: hard -"json-schema-ref-resolver@npm:^1.0.1": - version: 1.0.1 - resolution: "json-schema-ref-resolver@npm:1.0.1" - dependencies: - fast-deep-equal: "npm:^3.1.3" - checksum: 10/5ec9879fd939e0ddf84740fbdef31c574a6999cc4ecd8cee8e2a07d2627ec395f1a588d9433173cfe59d2473759389cea2782d67f850f9b95212f5bd2940a24b - languageName: node - linkType: hard - "json-schema-traverse@npm:^0.4.1": version: 0.4.1 resolution: "json-schema-traverse@npm:0.4.1" @@ -17376,17 +16857,6 @@ __metadata: languageName: node linkType: hard -"light-my-request@npm:^5.11.0": - version: 5.11.0 - resolution: "light-my-request@npm:5.11.0" - dependencies: - cookie: "npm:^0.5.0" - process-warning: "npm:^2.0.0" - set-cookie-parser: "npm:^2.4.1" - checksum: 10/e4e35b5c7afe73611dcd328018a70f9ac33d25909d726d6ae85b8198fcdc8fb4b79fc079bc71f608f0d7631e1d4d4d88d6c322d3e243b1eee50469a1bd0f5862 - languageName: node - linkType: hard - "lilconfig@npm:^2.0.3": version: 2.0.3 resolution: "lilconfig@npm:2.0.3" @@ -17607,15 +17077,6 @@ __metadata: languageName: node linkType: hard -"locate-path@npm:^7.1.0": - version: 7.2.0 - resolution: "locate-path@npm:7.2.0" - dependencies: - p-locate: "npm:^6.0.0" - checksum: 10/1c6d269d4efec555937081be964e8a9b4a136319c79ca1d45ac6382212a8466113c75bd89e44521ca8ecd1c47fb08523b56eee5c0712bc7d14fec5f729deeb42 - languageName: node - linkType: hard - "lock@npm:^1.1.0": version: 1.1.0 resolution: "lock@npm:1.1.0" @@ -18418,15 +17879,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^5.0.1": - version: 5.1.0 - resolution: "minimatch@npm:5.1.0" - dependencies: - brace-expansion: "npm:^2.0.1" - checksum: 10/3bcc271af1e5e95260fb9acd859628db9567a27ff1fe45b42fcf9b37f17dddbc5a23a614108755a6e076a5109969cabdc0b266ae6929fab12e679ec0f07f65ec - languageName: node - linkType: hard - "minimatch@npm:^9.0.4": version: 9.0.5 resolution: "minimatch@npm:9.0.5" @@ -19317,7 +18769,7 @@ __metadata: languageName: node linkType: hard -"open@npm:^8.4.0, open@npm:^8.4.2": +"open@npm:^8.4.0": version: 8.4.2 resolution: "open@npm:8.4.2" dependencies: @@ -19457,15 +18909,6 @@ __metadata: languageName: node linkType: hard -"p-limit@npm:^4.0.0": - version: 4.0.0 - resolution: "p-limit@npm:4.0.0" - dependencies: - yocto-queue: "npm:^1.0.0" - checksum: 10/01d9d70695187788f984226e16c903475ec6a947ee7b21948d6f597bed788e3112cc7ec2e171c1d37125057a5f45f3da21d8653e04a3a793589e12e9e80e756b - languageName: node - linkType: hard - "p-locate@npm:^3.0.0": version: 3.0.0 resolution: "p-locate@npm:3.0.0" @@ -19493,15 +18936,6 @@ __metadata: languageName: node linkType: hard -"p-locate@npm:^6.0.0": - version: 6.0.0 - resolution: "p-locate@npm:6.0.0" - dependencies: - p-limit: "npm:^4.0.0" - checksum: 10/2bfe5234efa5e7a4e74b30a5479a193fdd9236f8f6b4d2f3f69e3d286d9a7d7ab0c118a2a50142efcf4e41625def635bd9332d6cbf9cc65d85eb0718c579ab38 - languageName: node - linkType: hard - "p-map@npm:4.0.0, p-map@npm:^4.0.0": version: 4.0.0 resolution: "p-map@npm:4.0.0" @@ -19729,13 +19163,6 @@ __metadata: languageName: node linkType: hard -"path-exists@npm:^5.0.0": - version: 5.0.0 - resolution: "path-exists@npm:5.0.0" - checksum: 10/8ca842868cab09423994596eb2c5ec2a971c17d1a3cb36dbf060592c730c725cd524b9067d7d2a1e031fef9ba7bd2ac6dc5ec9fb92aa693265f7be3987045254 - languageName: node - linkType: hard - "path-is-absolute@npm:^1.0.0": version: 1.0.1 resolution: "path-is-absolute@npm:1.0.1" @@ -19814,13 +19241,6 @@ __metadata: languageName: node linkType: hard -"path-to-regexp@npm:^6.3.0": - version: 6.3.0 - resolution: "path-to-regexp@npm:6.3.0" - checksum: 10/6822f686f01556d99538b350722ef761541ec0ce95ca40ce4c29e20a5b492fe8361961f57993c71b2418de12e604478dcf7c430de34b2c31a688363a7a944d9c - languageName: node - linkType: hard - "path-type@npm:^4.0.0": version: 4.0.0 resolution: "path-type@npm:4.0.0" @@ -19945,7 +19365,7 @@ __metadata: languageName: node linkType: hard -"pino@npm:^9.0.0, pino@npm:^9.1.0": +"pino@npm:^9.1.0": version: 9.4.0 resolution: "pino@npm:9.4.0" dependencies: @@ -19982,15 +19402,6 @@ __metadata: languageName: node linkType: hard -"pkg-dir@npm:^7.0.0": - version: 7.0.0 - resolution: "pkg-dir@npm:7.0.0" - dependencies: - find-up: "npm:^6.3.0" - checksum: 10/94298b20a446bfbbd66604474de8a0cdd3b8d251225170970f15d9646f633e056c80520dd5b4c1d1050c9fed8f6a9e5054b141c93806439452efe72e57562c03 - languageName: node - linkType: hard - "pkg-up@npm:^3.1.0": version: 3.1.0 resolution: "pkg-up@npm:3.1.0" @@ -20000,7 +19411,7 @@ __metadata: languageName: node linkType: hard -"platform@npm:^1.3.3, platform@npm:^1.3.6": +"platform@npm:^1.3.6": version: 1.3.6 resolution: "platform@npm:1.3.6" checksum: 10/1f2d8333e23ea6a7620c828d2fc1ccbbd33e01928fb142323420506114d7325ebdeb1b38544efbf64e90ab73af0847f874d0f475b9327bcf53510fa827a4ef95 @@ -20144,20 +19555,6 @@ __metadata: languageName: node linkType: hard -"postcss-loader@npm:^7.3.3": - version: 7.3.3 - resolution: "postcss-loader@npm:7.3.3" - dependencies: - cosmiconfig: "npm:^8.2.0" - jiti: "npm:^1.18.2" - semver: "npm:^7.3.8" - peerDependencies: - postcss: ^7.0.0 || ^8.0.1 - webpack: ^5.0.0 - checksum: 10/743a4286db68169d271bef31e6e9351874bcf2dfa408b82c648c2d5bfba9c862cbfe3004494d927469654d6ac8b82fe647f2b80a186c1dbd44d81632eec1e838 - languageName: node - linkType: hard - "postcss-merge-longhand@npm:^5.0.2": version: 5.0.2 resolution: "postcss-merge-longhand@npm:5.0.2" @@ -20462,7 +19859,7 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.2.15, postcss@npm:^8.2.9, postcss@npm:^8.4.24, postcss@npm:^8.4.47": +"postcss@npm:^8.2.15, postcss@npm:^8.2.9, postcss@npm:^8.4.24": version: 8.4.47 resolution: "postcss@npm:8.4.47" dependencies: @@ -20537,7 +19934,7 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:^29.0.0, pretty-format@npm:^29.7.0": +"pretty-format@npm:^29.7.0": version: 29.7.0 resolution: "pretty-format@npm:29.7.0" dependencies: @@ -20582,20 +19979,6 @@ __metadata: languageName: node linkType: hard -"process-warning@npm:^2.0.0": - version: 2.0.0 - resolution: "process-warning@npm:2.0.0" - checksum: 10/efbf769c41898ec68d57a523cbde5a8c1e792261a36362129c9788101342aac85b4cb8261448165d0a4b78115f9c7bc827f3a98d193bca86c8d67c7412dbe272 - languageName: node - linkType: hard - -"process-warning@npm:^3.0.0": - version: 3.0.0 - resolution: "process-warning@npm:3.0.0" - checksum: 10/2d82fa641e50a5789eaf0f2b33453760996e373d4591aac576a22d696186ab7e240a0592db86c264d4f28a46c2abbe9b94689752017db7dadc90f169f12b0924 - languageName: node - linkType: hard - "process-warning@npm:^4.0.0": version: 4.0.0 resolution: "process-warning@npm:4.0.0" @@ -20716,7 +20099,7 @@ __metadata: languageName: node linkType: hard -"proxy-addr@npm:^2.0.7, proxy-addr@npm:~2.0.7": +"proxy-addr@npm:~2.0.7": version: 2.0.7 resolution: "proxy-addr@npm:2.0.7" dependencies: @@ -21784,13 +21167,6 @@ __metadata: languageName: node linkType: hard -"ret@npm:~0.4.0": - version: 0.4.3 - resolution: "ret@npm:0.4.3" - checksum: 10/d6a00f0920400b78b6aa96ce1c953d2f783f4fd5d56b5e842a744c40e33545e7955fb132386ada406361881353292fe7282f4e6e82b2c1e61f6c96a6ea4bb2d7 - languageName: node - linkType: hard - "retry@npm:^0.12.0": version: 0.12.0 resolution: "retry@npm:0.12.0" @@ -21805,7 +21181,7 @@ __metadata: languageName: node linkType: hard -"rfdc@npm:^1.2.0, rfdc@npm:^1.3.0, rfdc@npm:^1.4.1": +"rfdc@npm:^1.3.0, rfdc@npm:^1.4.1": version: 1.4.1 resolution: "rfdc@npm:1.4.1" checksum: 10/2f3d11d3d8929b4bfeefc9acb03aae90f971401de0add5ae6c5e38fec14f0405e6a4aad8fdb76344bfdd20c5193110e3750cbbd28ba86d73729d222b6cf4a729 @@ -21937,15 +21313,6 @@ __metadata: languageName: node linkType: hard -"safe-regex2@npm:^3.1.0": - version: 3.1.0 - resolution: "safe-regex2@npm:3.1.0" - dependencies: - ret: "npm:~0.4.0" - checksum: 10/4f9f7172662763619052a45599e515efc5dd10a932690f610c8ab808a4baa41be3feafefa444f7532651d721d12871a1c9a85330626cdd013b804e8f4240dff1 - languageName: node - linkType: hard - "safe-stable-stringify@npm:2.5.0": version: 2.5.0 resolution: "safe-stable-stringify@npm:2.5.0" @@ -22016,25 +21383,6 @@ __metadata: languageName: node linkType: hard -"schema-utils@npm:^4.0.0": - version: 4.0.0 - resolution: "schema-utils@npm:4.0.0" - dependencies: - "@types/json-schema": "npm:^7.0.9" - ajv: "npm:^8.8.0" - ajv-formats: "npm:^2.1.1" - ajv-keywords: "npm:^5.0.0" - checksum: 10/b1bbf840a608be6a2475a3955ff8f7c8fc7be6cdd63154ee26a487530e2b7b557b316f21797b9fe63e8e612b0c377c42c6096e281993ddbda0134fd312ce449c - languageName: node - linkType: hard - -"secure-json-parse@npm:^2.7.0": - version: 2.7.0 - resolution: "secure-json-parse@npm:2.7.0" - checksum: 10/974386587060b6fc5b1ac06481b2f9dbbb0d63c860cc73dc7533f27835fdb67b0ef08762dbfef25625c15bc0a0c366899e00076cb0d556af06b71e22f1dede4c - languageName: node - linkType: hard - "semver-compare@npm:^1.0.0": version: 1.0.0 resolution: "semver-compare@npm:1.0.0" @@ -22067,7 +21415,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.6.3, semver@npm:^7.1.2, semver@npm:^7.2.1, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.2, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3": +"semver@npm:7.6.3, semver@npm:^7.1.2, semver@npm:^7.2.1, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.2, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3": version: 7.6.3 resolution: "semver@npm:7.6.3" bin: @@ -22163,13 +21511,6 @@ __metadata: languageName: node linkType: hard -"set-cookie-parser@npm:^2.4.1": - version: 2.4.8 - resolution: "set-cookie-parser@npm:2.4.8" - checksum: 10/90a74a484e3ed0dca04ad15c7925cf4a6524c30d186f9b74a8a0e68aba0c3b6dfbfcc5c24c3e2f7b1393cda54ea74078ecabe2a62629e2d22b2e76987eac80cb - languageName: node - linkType: hard - "set-function-length@npm:^1.2.1": version: 1.2.2 resolution: "set-function-length@npm:1.2.2" @@ -22381,20 +21722,6 @@ __metadata: languageName: node linkType: hard -"sitemap@npm:^7.1.1": - version: 7.1.1 - resolution: "sitemap@npm:7.1.1" - dependencies: - "@types/node": "npm:^17.0.5" - "@types/sax": "npm:^1.2.1" - arg: "npm:^5.0.0" - sax: "npm:^1.2.4" - bin: - sitemap: dist/cli.js - checksum: 10/b2b493630440713162e8637b0cd203c0dd3fe1b862af3e75542df883cdb5e63aef03aa0bd7eaeef772f654311295721edd47c45990813df002b017b1cdd2e751 - languageName: node - linkType: hard - "slash@npm:^2.0.0": version: 2.0.0 resolution: "slash@npm:2.0.0" @@ -23435,32 +22762,6 @@ __metadata: languageName: node linkType: hard -"test-plugin-fastify@workspace:integration-tests/plugin-fastify": - version: 0.0.0-use.local - resolution: "test-plugin-fastify@workspace:integration-tests/plugin-fastify" - dependencies: - "@babel/core": "npm:^7.25.8" - "@babel/preset-typescript": "npm:^7.25.7" - babel-loader: "npm:^9.2.1" - babel-preset-gatsby: "npm:^3.13.2" - benchmark: "npm:^2.1.4" - fastify: "npm:^4.28.1" - gatsby: "npm:^5.13.7" - gatsby-plugin-fastify: "npm:*" - gatsby-plugin-image: "npm:^3.13.1" - gatsby-plugin-manifest: "npm:^5.13.1" - gatsby-plugin-postcss: "npm:^6.13.1" - gatsby-plugin-sharp: "npm:^5.13.1" - gatsby-plugin-sitemap: "npm:^6.13.1" - gatsby-source-faker: "npm:^5.13.1" - gatsby-source-filesystem: "npm:^5.13.1" - gatsby-transformer-sharp: "npm:^5.13.1" - postcss: "npm:^8.4.47" - react: "npm:^18.3.1" - react-dom: "npm:^18.3.1" - languageName: unknown - linkType: soft - "text-table@npm:^0.2.0": version: 0.2.0 resolution: "text-table@npm:0.2.0" @@ -23536,13 +22837,6 @@ __metadata: languageName: node linkType: hard -"tiny-lru@npm:^8.0.2": - version: 8.0.2 - resolution: "tiny-lru@npm:8.0.2" - checksum: 10/74b193d83b9edbe690b4e97e3cfd66c8a66d593c33b2c7133f132adacbf0442afbef82c679848208010137175aac3db9e68f350bef68cc299c0f2eb589554ffb - languageName: node - linkType: hard - "tinylogic@npm:^2.0.0": version: 2.0.0 resolution: "tinylogic@npm:2.0.0" @@ -23600,13 +22894,6 @@ __metadata: languageName: node linkType: hard -"toad-cache@npm:^3.3.0": - version: 3.4.1 - resolution: "toad-cache@npm:3.4.1" - checksum: 10/78502b2943c203959a5d2e05fddfa713ba57782875887e226533d0241c669336ffa533c0e5a273733fb4c7ec79d3916f925d892bc317fff4f141f15300df6fc1 - languageName: node - linkType: hard - "toidentifier@npm:1.0.1": version: 1.0.1 resolution: "toidentifier@npm:1.0.1" @@ -24090,13 +23377,6 @@ __metadata: languageName: node linkType: hard -"undici@npm:^5.5.1": - version: 5.10.0 - resolution: "undici@npm:5.10.0" - checksum: 10/d291a87f3d4c551bff258ddfc922ac994f8234b296b527c70e5bb89add8428186ceeaa2a58ed15395a8ac3afec8598f183e295f4e5f55aff3dc86352241b8410 - languageName: node - linkType: hard - "unicode-canonical-property-names-ecmascript@npm:^2.0.0": version: 2.0.0 resolution: "unicode-canonical-property-names-ecmascript@npm:2.0.0" @@ -24925,7 +24205,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.4.2, ws@npm:~8.11.0": +"ws@npm:~8.11.0": version: 8.11.0 resolution: "ws@npm:8.11.0" peerDependencies: @@ -25121,13 +24401,6 @@ __metadata: languageName: node linkType: hard -"yocto-queue@npm:^1.0.0": - version: 1.0.0 - resolution: "yocto-queue@npm:1.0.0" - checksum: 10/2cac84540f65c64ccc1683c267edce396b26b1e931aa429660aefac8fbe0188167b7aee815a3c22fa59a28a58d898d1a2b1825048f834d8d629f4c2a5d443801 - languageName: node - linkType: hard - "yoctocolors@npm:^2.0.0": version: 2.1.1 resolution: "yoctocolors@npm:2.1.1"