diff --git a/.changeset/little-feet-drop.md b/.changeset/little-feet-drop.md new file mode 100644 index 000000000..f424e3b01 --- /dev/null +++ b/.changeset/little-feet-drop.md @@ -0,0 +1,6 @@ +--- +'create-pantheon-decoupled-kit': patch +--- + +[gatsby-wp] Add healthcheck script, bump +`@pantheon-systems/decoupled-kit-healthcheck` version diff --git a/.changeset/nervous-peas-suffer.md b/.changeset/nervous-peas-suffer.md index ed6b4bc1d..85c4f9d1e 100644 --- a/.changeset/nervous-peas-suffer.md +++ b/.changeset/nervous-peas-suffer.md @@ -6,4 +6,4 @@ as a dev dependency to the `next-wp` template. The health check will run before a build to check critical endpoints for availability -[next-wp, next-drupal] Updated the README to include information about the `@pantheon-systems/decoupled-kit-health-check` and +[next-wp, next-drupal] Updated the README to include information about the `@pantheon-systems/decoupled-kit-health-check` diff --git a/.changeset/spicy-schools-love.md b/.changeset/spicy-schools-love.md deleted file mode 100644 index 425523d0c..000000000 --- a/.changeset/spicy-schools-love.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'create-pantheon-decoupled-kit': minor ---- - -[gatsby-wp] Starters created using the `gatsby-wp` generator are now in -TypeScript diff --git a/packages/create-pantheon-decoupled-kit/__tests__/index.test.ts b/packages/create-pantheon-decoupled-kit/__tests__/index.test.ts index 476f8270f..c6fabab9d 100644 --- a/packages/create-pantheon-decoupled-kit/__tests__/index.test.ts +++ b/packages/create-pantheon-decoupled-kit/__tests__/index.test.ts @@ -199,6 +199,7 @@ To see this list at any time, use the --help command.`); process.argv = ['node', 'bin.js', 'gatsby-wp']; const data = { _: ['gatsby-wp'], + dkHealthCheckVersion: versions['decoupled-kit-health-check'], eslintConfigVersion: versions['eslint'], force: false, gatsby: true, diff --git a/packages/create-pantheon-decoupled-kit/src/generators/gatsby-wp.generator.ts b/packages/create-pantheon-decoupled-kit/src/generators/gatsby-wp.generator.ts index e1bd1ecf7..dca151572 100644 --- a/packages/create-pantheon-decoupled-kit/src/generators/gatsby-wp.generator.ts +++ b/packages/create-pantheon-decoupled-kit/src/generators/gatsby-wp.generator.ts @@ -40,6 +40,7 @@ export const gatsbyWp: DecoupledKitGenerator = { ], data: { gatsbyPnpmPlugin: pnpm, + dkHealthCheckVersion: versions['decoupled-kit-health-check'], wordpressKitVersion: versions['wordpress-kit'], otherConfigsVersion: versions['other'], eslintConfigVersion: versions['eslint'], diff --git a/packages/create-pantheon-decoupled-kit/src/templates/gatsby-wp/package.json.ts b/packages/create-pantheon-decoupled-kit/src/templates/gatsby-wp/package.json.ts index 300d0dace..441ef689b 100644 --- a/packages/create-pantheon-decoupled-kit/src/templates/gatsby-wp/package.json.ts +++ b/packages/create-pantheon-decoupled-kit/src/templates/gatsby-wp/package.json.ts @@ -5,7 +5,7 @@ import { tailwindcssDeps } from '@partials/pkg-shared/tailwindcssDepsT'; const json: TemplateFn = ({ data, utils }) => /* JSON */ `{ ${sharedPkgJsonField(utils.pkgName(data.appName))} "scripts": { - "build": "gatsby build", + "build": "npm run decoupled-kit-health-check && gatsby build", "develop": "ENABLE_GATSBY_REFRESH_ENDPOINT=true gatsby develop -H 0.0.0.0", "format": "prettier --write '**/*.{js,jsx,ts,tsx,json,md}'", "start": "npm run develop", @@ -18,7 +18,8 @@ const json: TemplateFn = ({ data, utils }) => /* JSON */ `{ "update-snapshots": "vitest run --update --silent", "coverage": "vitest run --coverage", "lint:fix": "eslint --ext .js,.ts,.jsx,.tsx src --fix --ignore-path .gitignore", - "lint": "eslint --ext .js,.ts,.jsx,.tsx src --ignore-path .gitignore" + "lint": "eslint --ext .js,.ts,.jsx,.tsx src --ignore-path .gitignore", + "decoupled-kit-health-check": "npx --prefer-offline @pantheon-systems/decoupled-kit-health-check wordpress" }, "dependencies": { "gatsby": "^5.11.0", @@ -41,13 +42,10 @@ const json: TemplateFn = ({ data, utils }) => /* JSON */ `{ "devDependencies": { ${utils.if(data.tailwindcss, tailwindcssDeps(true))} ${utils.if(data.tailwindcss, tailwindcssDeps(false))} - "@pantheon-systems/decoupled-kit-configs": "${String( - data.otherConfigsVersion, - )}", - "@pantheon-systems/eslint-config-decoupled-kit": "${String( - data.eslintConfigVersion, - )}", - "@pantheon-systems/wordpress-kit": "${String(data.wordpressKitVersion)}", + "@pantheon-systems/decoupled-kit-configs": "${data.otherConfigsVersion}", + "@pantheon-systems/decoupled-kit-health-check": "${data.dkHealthCheckVersion}", + "@pantheon-systems/eslint-config-decoupled-kit": "${data.eslintConfigVersion}", + "@pantheon-systems/wordpress-kit": "${data.wordpressKitVersion}", "@testing-library/react": "13.4.0", "@types/dompurify": "^3.0.2", "@types/gatsbyjs__reach-router": "^2.0.0",