Skip to content

fix(graphql-docs-generator): allow handlebars ^4.7.10 - #1039

Draft
sharonyajain wants to merge 1 commit into
mainfrom
crew/oncall-bot/handlebars-4.7.10
Draft

sharonyajain wants to merge 1 commit into
mainfrom
crew/oncall-bot/handlebars-4.7.10

Conversation

@sharonyajain

Copy link
Copy Markdown

Description of changes

@aws-amplify/graphql-docs-generator pinned handlebars to exactly 4.7.9. This change moves it to ^4.7.10, the first release that fixes GHSA-8r5x-fm3f-whwj (critical), GHSA-p8wg-vrv2-v86f (critical) and GHSA-xw65-4hp5-5hc7 (moderate). With the exact pin, consumers could not pick up the fix, and npm audit reports "No fix available" for every Gen 2 project through form-generator and graphql-generator.

  • packages/graphql-docs-generator/package.json: handlebars 4.7.9 → ^4.7.10.
  • Root resolutions: handlebars >=4.7.9 → >=4.7.10, so the monorepo's security floor matches the new pin.
  • yarn.lock: handlebars 4.7.10, and minimist ^1.2.8, which 4.7.10 requires and which was already locked at 1.2.8.

The 4.7.10 compatibility notes (release notes) don't affect this package:

  • Only template-string partials are compiled now. The docs generator registers only string partials (getTemplatePartials()).
  • {{#each}} iterates Map/Set/generators lazily. The templates iterate only plain arrays (args, fields, ...).

Release note: lerna's --exact publish bumps the exact graphql-docs-generator pins in graphql-generator and amplify-codegen. amplify-backend depends on these packages through caret ranges (form-generator: ^4.1.0; backend-data / model-generator: graphql-generator ^0.5.1), so a fresh install or npm update picks up the fix with no amplify-backend release.

Note for reviewers: running plain yarn install on unmodified main already rewrites yarn.lock. It re-adds a @aws-amplify/graphql-docs-generator@4.2.1 entry and splits js-yaml@^3.10.0. That drift predates this change, so I left it out of this PR.

Codegen Paramaters Changed or Added

None.

Issue #, if available

N/A

Description of how you validated changes

  • yarn install --frozen-lockfile passes with the updated lockfile.
  • packages/graphql-docs-generator: yarn build passes; yarn test: 11 suites, 48 tests, 6 snapshots passed.
  • packages/graphql-generator (built with its dependencies; holds the generated statements/types/models snapshots): yarn test: 6 suites, 50 tests, 42 snapshots passed. Generated output is unchanged with 4.7.10.
  • E2E not run.

Checklist

  • PR description included
  • yarn test passes (graphql-docs-generator and graphql-generator)
  • E2E test run linked
  • Tests are changed or added: dependency-only change, covered by existing snapshot tests
  • Breaking changes to existing customers are released behind a feature flag or major version update: no breaking change, patch-level dependency update

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

handlebars 4.7.10 fixes GHSA-8r5x-fm3f-whwj, GHSA-p8wg-vrv2-v86f (critical)
and GHSA-xw65-4hp5-5hc7. The docs generator pinned exactly 4.7.9, so
consumers could not pick up the fix.

- graphql-docs-generator: handlebars 4.7.9 -> ^4.7.10
- root resolutions: handlebars >=4.7.9 -> >=4.7.10
- yarn.lock: handlebars 4.7.10 (minimist ^1.2.8)

The docs generator registers only string partials and iterates arrays in
#each, so the 4.7.10 compatibility notes do not apply. graphql-docs-generator
and graphql-generator tests pass with unchanged snapshots.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant