From 960979b4b5219b9bf6cb55e5dd851d83627fdf7b Mon Sep 17 00:00:00 2001 From: Ieuan Jenkins Date: Mon, 22 Apr 2024 11:48:28 +1200 Subject: [PATCH 1/8] Install and configure husky package --- .husky/.gitignore | 1 + .husky/pre-commit | 4 + package-lock.json | 373 ++++++++++++++++++++++------------------------ package.json | 4 +- 4 files changed, 186 insertions(+), 196 deletions(-) create mode 100644 .husky/.gitignore create mode 100755 .husky/pre-commit diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 00000000..31354ec1 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..36af2198 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged diff --git a/package-lock.json b/package-lock.json index 80a521af..bb59f258 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3008,33 +3008,12 @@ "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, "string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -3046,40 +3025,6 @@ "strip-ansi": "^7.0.1" } }, - "string-width-cjs": { - "version": "npm:string-width@4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, "strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", @@ -3089,23 +3034,6 @@ "ansi-regex": "^6.0.1" } }, - "strip-ansi-cjs": { - "version": "npm:strip-ansi@6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - } - } - }, "wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -3116,60 +3044,6 @@ "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } - }, - "wrap-ansi-cjs": { - "version": "npm:wrap-ansi@7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } } } }, @@ -4838,6 +4712,17 @@ "color-convert": "^2.0.1" } }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "optional": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -4887,6 +4772,13 @@ "universalify": "^0.1.0" } }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "optional": true + }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -4940,6 +4832,28 @@ "ansi-regex": "^5.0.1" } }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "optional": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "vue-loader-v16": { + "version": "npm:vue-loader@16.8.3", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz", + "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==", + "dev": true, + "optional": true, + "requires": { + "chalk": "^4.1.0", + "hash-sum": "^2.0.0", + "loader-utils": "^2.0.0" + } + }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -12471,6 +12385,12 @@ "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", "dev": true }, + "husky": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", + "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "dev": true + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -21755,6 +21675,46 @@ "strip-ansi": "^3.0.0" } }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, "string.prototype.trim": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", @@ -21826,6 +21786,23 @@ "ansi-regex": "^2.0.0" } }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + } + } + }, "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -23842,75 +23819,6 @@ } } }, - "vue-loader-v16": { - "version": "npm:vue-loader@16.8.3", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz", - "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==", - "dev": true, - "optional": true, - "requires": { - "chalk": "^4.1.0", - "hash-sum": "^2.0.0", - "loader-utils": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "optional": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "optional": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "optional": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "optional": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "optional": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "optional": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "vue-scrollto": { "version": "2.20.0", "resolved": "https://registry.npmjs.org/vue-scrollto/-/vue-scrollto-2.20.0.tgz", @@ -24740,6 +24648,81 @@ } } }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 915848ac..e00a55cc 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,8 @@ "build-component": "rm -rf dist && VUE_APP_CC_OUTPUT=embedded vue-cli-service build --target wc --name license-chooser src/main.js", "test:cypress": "node_modules/.bin/cypress open", "lint": "vue-cli-service lint src/**/*.{vue,js} --fix && npx stylelint ./src/**/*.{vue,css} --fix", - "i18n:report": "vue-cli-service i18n:report -v --src src/**/*.vue --locales src/locales/**.json -o output.json" + "i18n:report": "vue-cli-service i18n:report -v --src src/**/*.vue --locales src/locales/**.json -o output.json", + "prepare": "husky install" }, "dependencies": { "@creativecommons/cc-assets": "^0.1.0", @@ -69,6 +70,7 @@ "eslint-plugin-promise": "^4.3.1", "eslint-plugin-standard": "^4.0.1", "eslint-plugin-vue": "^6.2.2", + "husky": "^8.0.3", "lint-staged": "^9.5.0", "live-server": "^1.2.2", "prettier": "^2.8.8", From 1f24834dedea06a2466ae6226531ae9c4b5979d9 Mon Sep 17 00:00:00 2001 From: Ieuan Jenkins Date: Mon, 22 Apr 2024 11:53:59 +1200 Subject: [PATCH 2/8] Fix prettier setup Upgrade prettier to latest supported Downgrade eslint-config-prettier to version that supports eslint v6 Add npm format scripts for prettier Exclude coverage and dist from prettier execution Update lint-staged to run prettier --- .prettierignore | 2 ++ package-lock.json | 41 ++++++++++++++++++++++++++++++++++------- package.json | 8 ++++++-- 3 files changed, 42 insertions(+), 9 deletions(-) diff --git a/.prettierignore b/.prettierignore index 77f12ae2..a3c063fc 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,3 @@ +coverage/ +dist/ docs/ diff --git a/package-lock.json b/package-lock.json index bb59f258..62b81d01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5072,6 +5072,13 @@ "source-map": "^0.6.1" } }, + "prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "optional": true + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -10088,10 +10095,21 @@ } }, "eslint-config-prettier": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-7.2.0.tgz", - "integrity": "sha512-rV4Qu0C3nfJKPOAhFujFxB7RMP+URFyQqqOZW9DMRD7ZDTFyjaIlETU3xzHELt++4ugC0+Jm084HQYkkJe+Ivg==", - "dev": true + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz", + "integrity": "sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + }, + "dependencies": { + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + } + } }, "eslint-config-standard": { "version": "14.1.1", @@ -19670,9 +19688,10 @@ "dev": true }, "prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==" + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true }, "pretty": { "version": "2.0.0", @@ -23621,6 +23640,14 @@ "postcss": "^8.4.14", "prettier": "^1.18.2 || ^2.0.0", "source-map": "^0.6.1" + }, + "dependencies": { + "prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "optional": true + } } }, "source-map": { diff --git a/package.json b/package.json index e00a55cc..71cb81c6 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,8 @@ "build-component": "rm -rf dist && VUE_APP_CC_OUTPUT=embedded vue-cli-service build --target wc --name license-chooser src/main.js", "test:cypress": "node_modules/.bin/cypress open", "lint": "vue-cli-service lint src/**/*.{vue,js} --fix && npx stylelint ./src/**/*.{vue,css} --fix", + "format": "prettier --write .", + "format:check": "prettier --check .", "i18n:report": "vue-cli-service i18n:report -v --src src/**/*.vue --locales src/locales/**.json -o output.json", "prepare": "husky install" }, @@ -63,7 +65,7 @@ "babel-plugin-transform-require-context": "^0.1.1", "cypress": "^12.17.4", "eslint": "^6.8.0", - "eslint-config-prettier": "^7.2.0", + "eslint-config-prettier": "^6.15.0", "eslint-plugin-cypress": "^2.15.1", "eslint-plugin-import": "^2.29.1", "eslint-plugin-node": "^11.1.0", @@ -73,7 +75,7 @@ "husky": "^8.0.3", "lint-staged": "^9.5.0", "live-server": "^1.2.2", - "prettier": "^2.8.8", + "prettier": "^3.2.5", "shx": "^0.3.4", "stylelint": "^13.13.1", "stylelint-config-prettier": "^8.0.2", @@ -87,10 +89,12 @@ "lint-staged": { "src/*.{js,vue}": [ "vue-cli-service lint", + "prettier --write", "git add" ], "*.{css,vue}": [ "stylelint --fix", + "prettier --write", "git add" ] }, From 8f2c44e23c00eadcd748a11d1267ab177b4a1699 Mon Sep 17 00:00:00 2001 From: Ieuan Jenkins Date: Mon, 22 Apr 2024 11:55:27 +1200 Subject: [PATCH 3/8] Remove gitHooks config We're using the main husky package, not Yorkie --- package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/package.json b/package.json index 71cb81c6..7cd306d8 100644 --- a/package.json +++ b/package.json @@ -83,9 +83,6 @@ "vue-cli-plugin-i18n": "^2.3.2", "vue-template-compiler": "=2.7.16" }, - "gitHooks": { - "pre-commit": "lint-staged" - }, "lint-staged": { "src/*.{js,vue}": [ "vue-cli-service lint", From fca9dae43522154ccd72ed15f191ecc88b63d18f Mon Sep 17 00:00:00 2001 From: Ieuan Jenkins Date: Mon, 22 Apr 2024 11:56:25 +1200 Subject: [PATCH 4/8] Remove conflicting eslint rules As recommended by eslint-config-prettier-check --- .eslintrc.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5218a73c..82f1bb68 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -13,9 +13,6 @@ module.exports = { rules: { 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - indent: ['error', 2], - 'comma-dangle': ['error', 'always-multiline'], - 'space-before-function-paren': ['warn', 'never'], 'vue/require-default-prop': 'off', 'vue/no-v-html': 'off', }, From 51ab3825e5bd5b9ea3d1fc7669fe8e7a3182ee58 Mon Sep 17 00:00:00 2001 From: Ieuan Jenkins Date: Mon, 22 Apr 2024 11:58:12 +1200 Subject: [PATCH 5/8] Only run stylelint via lint-staged on same file pattern as npm run lint does --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7cd306d8..ef248219 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "prettier --write", "git add" ], - "*.{css,vue}": [ + "src/*.{css,vue}": [ "stylelint --fix", "prettier --write", "git add" From 83655000fd20c0c8d67fb0b502f037d3e9bce8ae Mon Sep 17 00:00:00 2001 From: Ieuan Jenkins Date: Mon, 22 Apr 2024 12:00:03 +1200 Subject: [PATCH 6/8] Run one-off full lint and format --- .babelrc | 23 +- .github/workflows/lint_and_test.yml | 4 +- .prettierrc | 6 +- README.md | 83 +- cypress.config.js | 6 +- docker-compose.yml | 1 - public/index.html | 66 +- src/App.vue | 11 +- src/Vocabulary/VInput.vue | 2 +- src/components/FooterSection.vue | 160 +- src/components/HeaderSection.vue | 144 +- src/components/HelpSection.vue | 4 +- src/components/LicenseIcons.vue | 2 +- src/components/LicenseText.vue | 7 +- src/components/StepHeader.vue | 2 +- src/components/Stepper.vue | 45 +- src/components/XmpButton.vue | 7 +- src/i18n.js | 2 +- src/locales/en.json | 4 +- src/main.js | 7 +- src/store/index.js | 26 +- src/styles/vocab.scss | 457 +- src/utils/license-utilities.js | 25 +- src/utils/locales.json | 882 +- src/utils/xmp.js | 45 +- .../vocabulary-legacy/legacy-vocabulary.css | 11067 +++++++++++++++- static/vocabulary/README.md | 35 +- static/vocabulary/css/library-vars.css | 358 +- static/vocabulary/css/vendor/normalize.css | 372 +- static/vocabulary/css/vocabulary.css | 3125 ++--- .../vocabulary/favicon/manifest.webmanifest | 12 +- static/vocabulary/fonts/VocabularyIcons.json | 1483 ++- static/vocabulary/js/vocabulary.js | 24 +- tests/README.md | 7 +- tests/cypress/fixtures/example.json | 2 +- .../integration/AttributionDetails..cy.js | 2 +- tests/cypress/integration/Stepper..cy.js | 36 +- tests/cypress/support/commands.js | 265 +- tests/unit/specs/components/App.spec.js | 4 +- .../components/AttributionDetailsStep.spec.js | 4 +- .../unit/specs/components/ChooserStep.spec.js | 2 +- tests/unit/specs/components/CopyTools.spec.js | 2 +- .../components/CopyrightWaiverStep.spec.js | 12 +- .../specs/components/DropdownStep.spec.js | 2 +- .../unit/specs/components/HelpSection.spec.js | 2 +- .../components/LicenseDetailsCard.spec.js | 6 +- .../specs/components/LicenseUseCard.spec.js | 2 +- .../unit/specs/components/StepHeader.spec.js | 2 +- .../specs/components/StepNavigation.spec.js | 2 +- tests/unit/specs/components/Stepper.spec.js | 6 +- .../specs/utils/license-utilities.test.js | 33 +- 51 files changed, 15815 insertions(+), 3073 deletions(-) diff --git a/.babelrc b/.babelrc index fa980b74..7ea60efb 100644 --- a/.babelrc +++ b/.babelrc @@ -1,13 +1,16 @@ { - "presets": [ - [ "@babel/preset-env", { - "targets": { "node": "10" } - } ] - ], - "plugins": [ "@babel/plugin-transform-modules-commonjs" ], - "env": { - "test": { - "plugins": ["transform-require-context"] - } + "presets": [ + [ + "@babel/preset-env", + { + "targets": { "node": "10" } } + ] + ], + "plugins": ["@babel/plugin-transform-modules-commonjs"], + "env": { + "test": { + "plugins": ["transform-require-context"] + } + } } diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml index bdbb6f9e..b76d679b 100644 --- a/.github/workflows/lint_and_test.yml +++ b/.github/workflows/lint_and_test.yml @@ -17,7 +17,7 @@ jobs: - name: Use Node.js 14 uses: actions/setup-node@v4 with: - node-version: '14' + node-version: '14' - name: Clean install NPM packages from package-lock.json run: npm ci @@ -28,7 +28,7 @@ jobs: - name: Test run: npm run test:unit env: - CI: true + CI: true # https://github.com/cypress-io/github-action - name: Cypress run diff --git a/.prettierrc b/.prettierrc index 865420ab..7d2081a9 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,5 @@ { - singleQuote: true, - semi: true, - trailingComma: 'all', + "singleQuote": true, + "semi": true, + "trailingComma": "all" } diff --git a/README.md b/README.md index 15b69be7..68582208 100644 --- a/README.md +++ b/README.md @@ -8,27 +8,24 @@ ![GitHub Repo stars](https://img.shields.io/github/stars/creativecommons/chooser?style=social) ![GitHub forks](https://img.shields.io/github/forks/creativecommons/chooser?style=social) - # Chooser The Creative Commons License Chooser is meant to help people learn about CC licenses, and select the license that best fits their needs. The new version in this repo places greater importance on usability, and an educational experience of the six CC licenses. - ## About Repository containing the source code for the new Creative Commons License Chooser. The new chooser is still in beta, and a beta deployment can be found [here](https://chooser-beta.creativecommons.org/). This site is built using [Vue.js](https://vuejs.org/) (and vue-cli). - ### Roadmap Tasks, issues, and discussion related to the release of the new chooser are tracked with the [`Launch Milestone`](https://github.com/creativecommons/chooser/milestone/1). - ## Code of conduct [`CODE_OF_CONDUCT.md`][org-coc]: + > The Creative Commons team is committed to fostering a welcoming community. > This project and all other Creative Commons open source projects are governed > by our [Code of Conduct][code_of_conduct]. Please report unacceptable @@ -39,28 +36,25 @@ Tasks, issues, and discussion related to the release of the new chooser are trac [code_of_conduct]: https://opensource.creativecommons.org/community/code-of-conduct/ [reporting_guide]: https://opensource.creativecommons.org/community/code-of-conduct/enforcement/ - ## Contributing See [`CONTRIBUTING.md`][org-contrib]. [org-contrib]: https://github.com/creativecommons/.github/blob/main/CONTRIBUTING.md - ## Using Docker - ### Containers The [`docker-compose.yml`](docker-compose.yml) file defines the following containers: + 1. **chooser-web** - simple NGINX container serving [`docs/`](docs) - [localhost:8888](http://localhost:8888/) 2. **chooser-node** - Node14 container - [localhost:8080](http://localhost:8080/) - (requires **Run Node development server**, below) - ### Docker desktop required Before proceeding, ensure you have Docker installed on your local machine. If @@ -68,65 +62,64 @@ not, download and install Docker Desktop by visiting [Docker's official website](https://www.docker.com/products/docker-desktop) and follow the installation instructions. - ### Startup containers The containers can be started with: + ```shell docker compose up ``` + (See [Docker Compose overview | Docker Docs](https://docs.docker.com/compose/) for more information on managing containes with `docker compose`.) - ### Initial setup Before the chooser-node container can be used effectively, a clean install of NPM packages from `package-lock.json` is required: + ```shell docker compose exec chooser-node npm ci ``` -**This step generally only needs to be done once.** +**This step generally only needs to be done once.** ### Run Node development server 1. Startup containers (see above) 2. Complete initial setup (see above) 3. Run Node development server - ```shell - docker compose exec chooser-node npm run serve - ``` + ```shell + docker compose exec chooser-node npm run serve + ``` - [localhost:8080](http://localhost:8080/) - ### Create production (standalone) build 1. Startup containers (see above) 2. Complete initial setup (see above) 3. Run Node development server - ```shell - docker compose exec chooser-node npm run build - ``` - - (this automatically copies the generated files from [`dist/`](dist) to - [`docs/`](docs)) + ```shell + docker compose exec chooser-node npm run build + ``` + - (this automatically copies the generated files from [`dist/`](dist) to + [`docs/`](docs)) The chooser is deployed to GitHub Pages. The source files for the beta deployment are contained in the `./docs/` dir, and are live. Any changes to this directory's contents will be automatically deployed, so please take care when making modifications to this location. - ### Create standalone (production) build 1. Startup containers (see above) 2. Complete initial setup (see above) 3. Run Node development server - ```shell - docker compose exec chooser-node npm run build - ``` - - (this automatically copies the generated files from [`dist/`](dist) to - [`docs/`](docs)) + ```shell + docker compose exec chooser-node npm run build + ``` + - (this automatically copies the generated files from [`dist/`](dist) to + [`docs/`](docs)) The chooser is deployed to GitHub Pages. The source files for the beta deployment are contained in the `./docs/` dir, and are live. Any changes to @@ -134,20 +127,21 @@ this directory's contents will be automatically deployed, so please take care when making modifications to this location. For an embedded standalone build (no header nor footer), run: + ```shell docker compose exec chooser-node VUE_APP_CC_OUTPUT=embedded npm run build ``` -**(please _don't_ commit embedded builds to `docs/`)** +**(please _don't_ commit embedded builds to `docs/`)** ### Create a web component build 1. Startup containers (see above) 2. Complete initial setup (see above) 3. Run Node development server - ```shell - docker compose exec chooser-node npm run build-component - ``` + ```shell + docker compose exec chooser-node npm run build-component + ``` This will create a file in the [`dist/`](dist) folder named `license-chooser.min.js`. It can be used to load the web-component in any JS @@ -168,41 +162,39 @@ example. ``` For an embedded web component build (no header nor footer), run: + ```shell docker compose exec chooser-node VUE_APP_CC_OUTPUT=embedded npm run build-component ``` - ## Perform unit tests on standalone or embedded build 1. Startup containers (see above) 2. Complete initial setup (see above) -2. Run unit tests - ```shell - docker compose exec chooser-node npm run test:unit - ``` +3. Run unit tests + ```shell + docker compose exec chooser-node npm run test:unit + ``` ## Perform unit tests on web-component build 1. Startup containers (see above) 2. Complete initial setup (see above) 3. Create a web component build (see above) -2. Run unit tests - ```shell - docker compose exec chooser-node npm run test-component - ``` +4. Run unit tests + ```shell + docker compose exec chooser-node npm run test-component + ``` - It starts a server with the `dist/demo.html` on which tests can be run. - ## Perform Cypress tests 1. Startup containers (see above) 2. Run Cypress tests - ```shell - docker run -it -v $PWD:/e2e -w /e2e -e CYPRESS_baseUrl=http://host.docker.internal:8888 cypress/included:latest - ``` - - (This will download the cypress/included image when first run) - + ```shell + docker run -it -v $PWD:/e2e -w /e2e -e CYPRESS_baseUrl=http://host.docker.internal:8888 cypress/included:latest + ``` + - (This will download the cypress/included image when first run) ## CSS Build @@ -213,7 +205,6 @@ can also be removed. If you find that the built site misses some styles, you can manually add the necessary classes or Regex expressions to the `safelist` array in the `postcss.config.js` file. - ## Embedded screenshot The site can be built in two different modes: `embedded` and `standalone`. diff --git a/cypress.config.js b/cypress.config.js index baa4d00f..b4a6a086 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -1,4 +1,4 @@ -const { defineConfig } = require('cypress') +const { defineConfig } = require('cypress'); module.exports = defineConfig({ project: 'creativecommons-chooser', @@ -9,10 +9,10 @@ module.exports = defineConfig({ // We've imported your old cypress plugins here. // You may want to clean this up later by importing these. setupNodeEvents(on, config) { - return require('./tests/cypress/plugins/index.js')(on, config) + return require('./tests/cypress/plugins/index.js')(on, config); }, baseUrl: 'http://localhost:8080/', specPattern: 'tests/cypress/integration//**/*.cy.{js,jsx,ts,tsx}', supportFile: 'tests/cypress/support/index.js', }, -}) +}); diff --git a/docker-compose.yml b/docker-compose.yml index c5ebb163..1b3067a5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,6 @@ version: '2.4' services: - chooser-web: build: . ports: diff --git a/public/index.html b/public/index.html index ab5b1db8..748bbf57 100644 --- a/public/index.html +++ b/public/index.html @@ -1,31 +1,53 @@ - + - - - - - - - - + + + + + + + + - + - - - + + + Choose a License - - - -
- - + + + +
+ + diff --git a/src/App.vue b/src/App.vue index b0b81f07..a0ae4cf8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,11 @@
-