Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DB-6542: [gatsby-wp, gatsby-wp-acf-addon] Use TypeScript for the `gat…
…sby-wp*` templates (#794) * DB-5244: Add tagged template support in addWithDiff + tests * DB-5244: Add tagged template support in addWithDiff + tests * DB-5244: gatsby-wp ts conversion - Refactor gatsby-node.js and gatsby-config.js to ts - Add gatsby graphql generated types - Split out gatsby-node create page function to lib/createPagesUtils - Remove redundant page queries, use pageContext instead - Refactor page and post componentsto ts * DB-5244: Convert 404 page and seo component to ts * DB-5244: Convert pagination component and template to ts - Break out some logic to a custom hook * DB-5244: Clean up page template * DB-5244: Fix component type and ts for paginationExample template * DB-5244: More types cleanup * DB-5244: Use default filepath for generated gatsby-types.d.ts * DB-5244: Convert remaining pages to ts * DB-5244: - Ignore linting for static templates - Fix memory leak in watch script * DB-5244: Replace tests with single example for snapshots and unit testing * DB-5244: Update test section in the README * DB-5244: Fix getPages and getPosts types * DB-5244: Move generator data interfaces to types.ts This allows the data object in the tagged templates to make use of the types. There is likely some more work to be done here to further enhance the types for the generators. * DB-5244: Convert remaining handlebars templates to new tagged templates - Removed some tagged template helpers where backticks can be used instead to greater effect - Added a @partials alias to the root tsconfig for easier importing of new partials Partials are written in TypeScript and do not use the TemplateFn signature, but instead accept only the variables they need to render out the proper string. These partials can be imported as functions and called as needed inside tagged template literal templates. * DB-5244: Replace handlebars instructions with new tagged templates in CONTRIBUTING * DB-5244: Add changeset * DB-5244: Sanitize innerHTML * DB-5244: Undo change to nextjs-kit * DB-5244: Compile tagged templates to js - Moved typescript path alias to tsconfig in create- package - Add esbuild-ts-paths to resolve the path aliases - Rename the shared partials as the name was conflicting with the handlebars templates during the build - Update the copyTemplates script to ignore the templates that are to be compiled - Move the tagged template regex to a shareable constants.ts file in utils - Updated path alias imports with new path * DB-5244: Fix linting and build errors, re-add wpMenu.json for test example - Made the types on Input optional. I'm not a huge fan of this but at this point I'm not sure the best path forward to type both the generator data field and the same data coming into the templates. - Fixed tests - Added new test - Ensure .tsx files are converted in the ConvertCSSModulesaction * DB-5244: Use isometric-dompurify to fix build errors * DB-5244: - Remove stray console.logs - Typecast some things in post & page to a string - Re-add @types/dompurify - Update lando.yml node version to 18 * DB-5244: Ensure gatsby-*.tsx files are included in tsconfig * DB-5244: Fix wpMenu.json import * DB-6357: Upgrade gatsby-wp templates to gastby v5 * DB-6357: Add changeset * DB-6357: Pin convert-css-modules-to-tailwind to 0.1.9 * DB-6357: Fix indentation * DB-6357: Remove unused packages * DB-6357: Touch up CSS, fix broken css from modules->tw conversion * DB-6357: Update glob in lint-staged for tagged templates * DB-6357: Move min-height to paginatorExample template * DB-6357: Remove componentContainer * DB-5578: - Move wpPostQuery to a partial - Move postTemplate to a partial - Use new template style for postTemplate.module.css - Add postTemplate.module.css.d.ts - Add update generated gatsby-types.d.ts for the related content queries - Remove beforeExit listener from main() - Refine types for PostGridItem and PageGridItem - Source relatedContent from pageContext, replacing the pageQuery - Make lint-staged.config explicit for tagged template file extensions to avoid failing on *.module.css.d.ts files - Add changeset * Exit pre-release mode for sprint 12 * Update versions * Enter pre-release mode for sprint 13 * Nightly audit run at 00:05:34 * Add changeset to bump nextjs-kit version in the CLI * DB-6330: - Remove check-built script - Update types path in PantheonDrupalSate - Bump and pin @gdwc/drupal-state - Add jsdom to nextjs kit, tests were suddenly failing without it - Add changesets * Update healthy-numbers-judge.md * DB-6330: - Move setOutgoingHeaders to wordpress-kit - Update next-wp templates reflect setOutgoingHeaders change - Update code snippet in docs to use setOutgoingHeaders - Add tests * DB-6331: Match @types/react-dom to @types/react * canary-release (canary) * Next config chanege no longer necessary for Drupal surrogate key example * DB-6331: Remove wordpress-kit from transpilePackage The starter no longer requires this package to be transpiled by nextjs and this is also breaking on some versions of next * canary-release (canary) * DB-5777: developer docs for terminus-decoupled-kit plugin * DB-6331: Pin starters to [email protected] * canary-release (canary) * DB-5777: clarify use of upstream ID based on feedback * DB-5777: remove unneded - * Exit pre-release mode for sprint 13 * Update versions * Enter pre-release for sprint 14 * DB-6269: Scaffold health-check package * DB-6269: - Health check script for drupal starter * DB-6269: Refactor to only check one endpoint - Add typedoc comments * DB-6269: Setup msw for tests * DB-6269: Setup vitest and begin adding unit tests * DB-6269: Use `msw@next` for node 18 fetch compatibility * DB-6269: Add tests * DB-6269: Add changeset, adjust package.json version for first release * DB-6269: Update README, fix shebang * DB-6269: Remove unused constants.ts * DB-6269: Rename health-check -> decoupled-kit-health-check * DB-6269: - Refine error messages - Remove hourglass emoji - Replace do-not-enter emoji with hourglass for log.warn - Remove emoji for log.suggest - Add checkPreviewSecret function - Add engines field to package.json - Update pnpm-lock.yaml * DB-6269: Update changeset with new name * canary-release (canary) * DB-6269: - Add decoupled-kit-health-check as devDependency to next-drupal - Run the health-check as the first step of the build command * canary-release (canary) * DB-6269: Fix missing https in PANTHEON_CMS_ENDPOINT * canary-release (canary) * DB-6540: - Add health-check script for next-wp - Read arg from CLI to determine which script to run (drupal or wp) - Check package.json to determine which script to run (next or gatsby) - Update functions to work for drupal (rest) and wp (graphql) - Update tests accordingly - Add msw handlers for wordpress - Add changeset - Add script to next-wp package.json * DB-6450: Make cmsEndpoint a function to avoid polluting search params between requests * DB-6450: - Update README - Update README for next-wp and next-drupal starters - Add section in troubleshooting next+drupal and next+wp about disabling the health-check - Throw an error if no arg is present when running the command * canary-release (canary) * Fix next-wp package.json * canary-release (canary) * DB-6450: Ensure endpoint ends with /wp/graphql * canary-release (canary) * Nightly audit run at 00:05:46 * DB-4444: next-drupal preview route test option * DB-6463: - Respond to test=true query param with json in the next-wp preview api route - Update next-drupal preivew test responses to proper status codes * DB-6463: Add and edit changesets * DB-6463: Remove console.log * canary-release (canary) * refactor: Use classes for better readability and extensibility * refactor: Use snapshots for tests * Add changeset * Nightly audit run at 00:05:31 * Upgrade tooling dependencies [root]: typescript, typedoc, prettier [workspace-eslint]: @typescript/eslint-plugin, @typescript/eslint-parser [wp-kit, drupal-kit]: msw - required for typescript 5.1 Note: The published configs have not had their dependencies updated. These will be updated in a future ticket when we do a more comprehensive dependency update. * DB-6542: - Rebase feat/typescript - Refine linting scripts for templates and non templates This should ensure the tagged templates ending in .ts are linted but other templates are not. - Remove some options from runLint that we do not use * DB-6542: Add changeset * DB-6542: - Use .ts for vite.config - Fix missing backticks around posts query - Use tailwindcss version for example snapshot test --------- Co-authored-by: Mitchell Markoff <[email protected]> Co-authored-by: Brian Perry <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: pantheon-decoupled-service-user <[email protected]>
- Loading branch information