From 622d8b34040ec85498f88c5a8f8868e13ce97e1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Jan 2024 11:38:29 +0000 Subject: [PATCH 1/4] Bump prettier from 3.2.2 to 3.2.4 Bumps [prettier](https://github.com/prettier/prettier) from 3.2.2 to 3.2.4. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.2.2...3.2.4) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index adf91e6b..be5cfc06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "github-label-sync": "2.3.1", "markdown-link-check": "^3.11.2", "markdownlint-cli": "^0.37.0", - "prettier": "^3.2.2" + "prettier": "^3.2.4" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -3311,9 +3311,9 @@ } }, "node_modules/prettier": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.2.tgz", - "integrity": "sha512-HTByuKZzw7utPiDO523Tt2pLtEyK7OibUD9suEJQrPUCYQqrHr74GGX6VidMrovbf/I50mPqr8j/II6oBAuc5A==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz", + "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -6721,9 +6721,9 @@ "dev": true }, "prettier": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.2.tgz", - "integrity": "sha512-HTByuKZzw7utPiDO523Tt2pLtEyK7OibUD9suEJQrPUCYQqrHr74GGX6VidMrovbf/I50mPqr8j/II6oBAuc5A==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz", + "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", "dev": true }, "progress": { diff --git a/package.json b/package.json index 88044a53..9481628b 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "github-label-sync": "2.3.1", "markdown-link-check": "^3.11.2", "markdownlint-cli": "^0.37.0", - "prettier": "^3.2.2" + "prettier": "^3.2.4" }, "dependencies": { "js-yaml": "^4.1.0" From 49eb6f6aa7ae55f608ef75d4a251f9b5c0b602d9 Mon Sep 17 00:00:00 2001 From: per1234 Date: Fri, 26 Jan 2024 03:39:17 -0800 Subject: [PATCH 2/4] Update `prettier` version in template installation docs This is now the version used as standard in all Arduino Tooling projects, which the "template" is intended to be used with. --- workflow-templates/check-prettier-formatting-task.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow-templates/check-prettier-formatting-task.md b/workflow-templates/check-prettier-formatting-task.md index f5d6268d..1526c383 100644 --- a/workflow-templates/check-prettier-formatting-task.md +++ b/workflow-templates/check-prettier-formatting-task.md @@ -34,7 +34,7 @@ The tool dependencies of this workflow are managed by [npm](https://www.npmjs.co Add the dependencies by running this command: ```text -npm install --save-dev prettier@^3.2.2 +npm install --save-dev prettier@^3.2.4 ``` Commit the resulting changes to the `package.json` and `package-lock.json` files. From cc6f87c1bf8cb188d5b4f258900531c4e67d301b Mon Sep 17 00:00:00 2001 From: per1234 Date: Fri, 26 Jan 2024 03:44:20 -0800 Subject: [PATCH 3/4] Install referenced schema in "npm:validate" task The "npm:validate" task validates the repository's `package.json` npm manifest file against its JSON schema to catch any problems with its data format. In order to avoid duplication of content, JSON schemas may reference other schemas via the `$ref` keyword. The `package.json` schema was recently updated to share resources with an ESLint plugins configuration schema, which caused the validation to start failing: schema /tmp/package-json-schema-WItZVgRyuR.json is invalid error: can't resolve reference https://json.schemastore.org/partial-eslint-plugins.json from id https://json.schemastore.org/eslintrc.json# task: Failed to run task "npm:validate": exit status 1 The solution is to configure the task to download that schema as well and also to provide its path to the avj-cli validator via a `-r` flag. --- Taskfile.yml | 6 ++++++ workflow-templates/assets/check-npm-task/Taskfile.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Taskfile.yml b/Taskfile.yml index c9f0bba3..7ffea285 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -737,6 +737,10 @@ tasks: NPM_BADGES_SCHEMA_URL: https://json.schemastore.org/npm-badges.json NPM_BADGES_SCHEMA_PATH: sh: task utility:mktemp-file TEMPLATE="npm-badges-schema-XXXXXXXXXX.json" + # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/partial-eslint-plugins.json + PARTIAL_ESLINT_PLUGINS_SCHEMA_URL: https://json.schemastore.org/partial-eslint-plugins.json + PARTIAL_ESLINT_PLUGINS_PATH: + sh: task utility:mktemp-file TEMPLATE="partial-eslint-plugins-schema-XXXXXXXXXX.json" # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/prettierrc.json PRETTIERRC_SCHEMA_URL: https://json.schemastore.org/prettierrc.json PRETTIERRC_SCHEMA_PATH: @@ -761,6 +765,7 @@ tasks: - wget --quiet --output-document="{{.ESLINTRC_SCHEMA_PATH}}" {{.ESLINTRC_SCHEMA_URL}} - wget --quiet --output-document="{{.JSCPD_SCHEMA_PATH}}" {{.JSCPD_SCHEMA_URL}} - wget --quiet --output-document="{{.NPM_BADGES_SCHEMA_PATH}}" {{.NPM_BADGES_SCHEMA_URL}} + - wget --quiet --output-document="{{.PARTIAL_ESLINT_PLUGINS_PATH}}" {{.PARTIAL_ESLINT_PLUGINS_SCHEMA_URL}} - wget --quiet --output-document="{{.PRETTIERRC_SCHEMA_PATH}}" {{.PRETTIERRC_SCHEMA_URL}} - wget --quiet --output-document="{{.SEMANTIC_RELEASE_SCHEMA_PATH}}" {{.SEMANTIC_RELEASE_SCHEMA_URL}} - wget --quiet --output-document="{{.STYLELINTRC_SCHEMA_PATH}}" {{.STYLELINTRC_SCHEMA_URL}} @@ -773,6 +778,7 @@ tasks: -r "{{.ESLINTRC_SCHEMA_PATH}}" \ -r "{{.JSCPD_SCHEMA_PATH}}" \ -r "{{.NPM_BADGES_SCHEMA_PATH}}" \ + -r "{{.PARTIAL_ESLINT_PLUGINS_PATH}}" \ -r "{{.PRETTIERRC_SCHEMA_PATH}}" \ -r "{{.SEMANTIC_RELEASE_SCHEMA_PATH}}" \ -r "{{.STYLELINTRC_SCHEMA_PATH}}" \ diff --git a/workflow-templates/assets/check-npm-task/Taskfile.yml b/workflow-templates/assets/check-npm-task/Taskfile.yml index a44582ce..94a07d10 100644 --- a/workflow-templates/assets/check-npm-task/Taskfile.yml +++ b/workflow-templates/assets/check-npm-task/Taskfile.yml @@ -32,6 +32,10 @@ tasks: NPM_BADGES_SCHEMA_URL: https://json.schemastore.org/npm-badges.json NPM_BADGES_SCHEMA_PATH: sh: task utility:mktemp-file TEMPLATE="npm-badges-schema-XXXXXXXXXX.json" + # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/partial-eslint-plugins.json + PARTIAL_ESLINT_PLUGINS_SCHEMA_URL: https://json.schemastore.org/partial-eslint-plugins.json + PARTIAL_ESLINT_PLUGINS_PATH: + sh: task utility:mktemp-file TEMPLATE="partial-eslint-plugins-schema-XXXXXXXXXX.json" # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/prettierrc.json PRETTIERRC_SCHEMA_URL: https://json.schemastore.org/prettierrc.json PRETTIERRC_SCHEMA_PATH: @@ -56,6 +60,7 @@ tasks: - wget --quiet --output-document="{{.ESLINTRC_SCHEMA_PATH}}" {{.ESLINTRC_SCHEMA_URL}} - wget --quiet --output-document="{{.JSCPD_SCHEMA_PATH}}" {{.JSCPD_SCHEMA_URL}} - wget --quiet --output-document="{{.NPM_BADGES_SCHEMA_PATH}}" {{.NPM_BADGES_SCHEMA_URL}} + - wget --quiet --output-document="{{.PARTIAL_ESLINT_PLUGINS_PATH}}" {{.PARTIAL_ESLINT_PLUGINS_SCHEMA_URL}} - wget --quiet --output-document="{{.PRETTIERRC_SCHEMA_PATH}}" {{.PRETTIERRC_SCHEMA_URL}} - wget --quiet --output-document="{{.SEMANTIC_RELEASE_SCHEMA_PATH}}" {{.SEMANTIC_RELEASE_SCHEMA_URL}} - wget --quiet --output-document="{{.STYLELINTRC_SCHEMA_PATH}}" {{.STYLELINTRC_SCHEMA_URL}} @@ -68,6 +73,7 @@ tasks: -r "{{.ESLINTRC_SCHEMA_PATH}}" \ -r "{{.JSCPD_SCHEMA_PATH}}" \ -r "{{.NPM_BADGES_SCHEMA_PATH}}" \ + -r "{{.PARTIAL_ESLINT_PLUGINS_PATH}}" \ -r "{{.PRETTIERRC_SCHEMA_PATH}}" \ -r "{{.SEMANTIC_RELEASE_SCHEMA_PATH}}" \ -r "{{.STYLELINTRC_SCHEMA_PATH}}" \ From c972e1adb3cc18f9dfff4071ef3f33c9314fecb2 Mon Sep 17 00:00:00 2001 From: per1234 Date: Fri, 26 Jan 2024 03:48:55 -0800 Subject: [PATCH 4/4] Install referenced schema in "eslint:validate" task The "eslint:validate" task validates the repository's ESLint configuration file against its JSON schema to catch any problems with its data format. In order to avoid duplication of content, JSON schemas may reference other schemas via the `$ref` keyword. The ESLint configuration file schema was recently updated to share resources with a separate ESLint plugins configuration schema, which caused the validation to start failing: schema /tmp/eslintrc-schema-usLlcKrt8g.json is invalid error: can't resolve reference https://json.schemastore.org/partial-eslint-plugins.json from id https://json.schemastore.org/eslintrc.json# task: Failed to run task "eslint:validate": exit status 1 The solution is to configure the task to download that schema as well and also to provide its path to the avj-cli validator via a `-r` flag. --- Taskfile.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Taskfile.yml b/Taskfile.yml index 7ffea285..ac5568de 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -397,6 +397,10 @@ tasks: SCHEMA_URL: https://json.schemastore.org/eslintrc.json SCHEMA_PATH: sh: task utility:mktemp-file TEMPLATE="eslintrc-schema-XXXXXXXXXX.json" + # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/partial-eslint-plugins.json + PARTIAL_ESLINT_PLUGINS_SCHEMA_URL: https://json.schemastore.org/partial-eslint-plugins.json + PARTIAL_ESLINT_PLUGINS_PATH: + sh: task utility:mktemp-file TEMPLATE="partial-eslint-plugins-schema-XXXXXXXXXX.json" DATA_PATH: workflow-templates/assets/check-javascript/.eslintrc.yml # ajv-cli identifies YAML-format data files by their file extension, so renaming is required: # https://github.com/ajv-validator/ajv-cli/issues/117 @@ -406,11 +410,13 @@ tasks: sh: task utility:mktemp-folder TEMPLATE="eslintrc-validate-XXXXXXXXXX" cmds: - wget --quiet --output-document="{{.SCHEMA_PATH}}" {{.SCHEMA_URL}} + - wget --quiet --output-document="{{.PARTIAL_ESLINT_PLUGINS_PATH}}" {{.PARTIAL_ESLINT_PLUGINS_SCHEMA_URL}} - | cd "{{.WORKING_FOLDER}}" # Workaround for https://github.com/npm/cli/issues/3210 npx ajv-cli@{{.SCHEMA_DRAFT_4_AJV_CLI_VERSION}} validate \ --all-errors \ -s "{{.SCHEMA_PATH}}" \ + -r "{{.PARTIAL_ESLINT_PLUGINS_PATH}}" \ -d "{{.PROJECT_FOLDER}}/{{.DATA_PATH}}" # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-files-task/Taskfile.yml