Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"test": "repo-tools test run --cmd npm -- run cover"
},
"dependencies": {
"@google-cloud/pubsub": "0.16.2",
"@google-cloud/pubsub": "0.20.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Upgrading @google-cloud/pubsub to version 0.20.0 introduces several breaking changes that will cause runtime errors in the sample code:

  • Node.js version: This version requires Node.js 6+ (as its dependency google-gax dropped support for Node.js 4), which conflicts with the "node": ">=4.3.2" requirement in package.json (line 12).
  • API change in Topic#publisher: In version 0.17.0 and later, Topic#publisher became a property instead of a method. The sample file samples/topics.js calls it as a method (e.g., line 120: .publisher()), which will throw a TypeError.
  • API change in IAM#setPolicy: In version 0.18.0 and later, the Promise returned by setPolicy resolves with the Policy object directly, not an array. The code in samples/subscriptions.js (line 501) expects an array (results[0]) and will fail.

To fix this, the application code needs to be updated to match the new API, and the engines field in package.json must be updated to reflect the new Node.js version requirement.

"yargs": "10.1.2"
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "3.3.0",
"ava": "^0.25.0",
"nyc": "^11.3.0",
"ava": "^4.0.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The upgrade of ava to version 4.0.0 is a major breaking change that will cause the test suite to fail.

  • Node.js version: ava@4.0.0 requires Node.js ^12.20.0 || ^14.13.1 || >=16.0.0. This is incompatible with the "node": ">=4.3.2" specified in package.json (line 12).
  • test.cb removal: The test.cb interface for callback tests was removed in ava@2.0.0. The test file samples/system-test/quickstart.test.js uses test.cb (line 38) and will fail to run.

To resolve this, the tests need to be migrated to use async/await or Promises, and the engines field in package.json must be updated.

"nyc": "^15.0.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Upgrading nyc to version 15.0.0 introduces a breaking change related to the supported Node.js version.

  • Node.js version: nyc@15 requires Node.js 10 or newer. This conflicts with the "node": ">=4.3.2" requirement in package.json (line 12).

The engines field in package.json needs to be updated to a compatible version, such as >=12.20.0, to align with the requirements of the updated development dependencies.

"proxyquire": "1.8.0",
"sinon": "4.5.0",
"uuid": "^3.1.0"
Expand Down
Loading