From ebecc27795c167e2c45ae9a99b0d8288876604a3 Mon Sep 17 00:00:00 2001 From: Tony Pujals Date: Wed, 2 Oct 2024 12:48:16 -0700 Subject: [PATCH 1/3] docs: update contributing guide --- CONTRIBUTING.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 67e1b44307..e7ccb6ea98 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,6 +48,22 @@ All samples must have tests. We use `mocha` as testing framework. The executes the `mocha` tests via `npm test` ([example](https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/main/batch/package.json#L13)). +### Third party libraries + +Contributors are encouraged to use vanilla Node.js as much as pragmatically +possible to standardize writing, reviewing, and maintaining samples and their +tests, ideally reducing dependencies on third party libraries. + +For tests, using the standard +library [assert](https://nodejs.org/docs/latest-v18.x/api/assert.html) is +preferred. + +If you want to use a third party package, help us to understand if you have +requirements not fulfilled by core libraries in the description of your pull +request. + +### CI testing + For new samples, a GitHub Actions workflow should be created to run your tests on the CI system: From 4d8572310510d35e2fc94add1879607555fd5f5c Mon Sep 17 00:00:00 2001 From: Tony Pujals Date: Wed, 2 Oct 2024 12:59:43 -0700 Subject: [PATCH 2/3] docs: add more detail to assert recommendation --- CONTRIBUTING.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e7ccb6ea98..b9491f72f5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,7 +56,12 @@ tests, ideally reducing dependencies on third party libraries. For tests, using the standard library [assert](https://nodejs.org/docs/latest-v18.x/api/assert.html) is -preferred. +preferred. The library provides a strict and a legacy mode; please use the +strict mode as shown below: + +```js +const assert = require('node:assert/strict'); +``` If you want to use a third party package, help us to understand if you have requirements not fulfilled by core libraries in the description of your pull From a51b4199b1d401d6bf7b7d2ad9ab435e223b4ed6 Mon Sep 17 00:00:00 2001 From: Jennifer Davis Date: Thu, 3 Oct 2024 19:35:39 -0700 Subject: [PATCH 3/3] chore: massaging language a bit --- CONTRIBUTING.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b9491f72f5..af25dd5ff7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,19 +54,14 @@ Contributors are encouraged to use vanilla Node.js as much as pragmatically possible to standardize writing, reviewing, and maintaining samples and their tests, ideally reducing dependencies on third party libraries. -For tests, using the standard -library [assert](https://nodejs.org/docs/latest-v18.x/api/assert.html) is -preferred. The library provides a strict and a legacy mode; please use the +For tests, we recommend using the standard +library [assert](https://nodejs.org/docs/latest-v18.x/api/assert.html). The library provides a strict and a legacy mode; please use the strict mode as shown below: ```js const assert = require('node:assert/strict'); ``` -If you want to use a third party package, help us to understand if you have -requirements not fulfilled by core libraries in the description of your pull -request. - ### CI testing For new samples, a GitHub Actions workflow should be created to run your tests