From 4f51b946b88f57056af39fa4cc4117a5dcb6c1b8 Mon Sep 17 00:00:00 2001 From: Badisi Date: Thu, 4 Jul 2024 23:58:25 +0200 Subject: [PATCH 1/2] deps(@hug/ngx-tooltip): revert to v.1.1.2 --- package-lock.json | 709 ++++++++++++++++++++++++++++- projects/tooltip/package.json | 2 +- projects/user-tooltip/package.json | 2 +- 3 files changed, 708 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 722d1a8f..7e3934d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "ngx-components", + "name": "@hug/ngx-components", "lockfileVersion": 3, "requires": true, "packages": { @@ -3637,6 +3637,21 @@ "node": ">=8" } }, + "node_modules/@commitlint/load/node_modules/typescript": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", + "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/@commitlint/message": { "version": "18.6.1", "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-18.6.1.tgz", @@ -4229,6 +4244,147 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0", + "peer": true + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/eslintrc/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/@gar/promisify": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", @@ -4383,6 +4539,73 @@ "resolved": "projects/user-tooltip", "link": true }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "deprecated": "Use @eslint/config-array instead", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true, + "license": "BSD-3-Clause", + "peer": true + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -7142,6 +7365,14 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true, + "license": "ISC", + "peer": true + }, "node_modules/@webassemblyjs/ast": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", @@ -9742,6 +9973,14 @@ "node": ">=0.10" } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", @@ -9970,6 +10209,20 @@ "node": ">=6" } }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/dom-serialize": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", @@ -10865,6 +11118,63 @@ "node": ">=0.8.0" } }, + "node_modules/eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint-compat-utils": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.5.1.tgz", @@ -11343,6 +11653,239 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/eslint/node_modules/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, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0", + "peer": true + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/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, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/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, + "license": "MIT", + "peer": true + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint/node_modules/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, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", @@ -11658,6 +12201,14 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", @@ -11697,6 +12248,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, "node_modules/filelist": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", @@ -11824,6 +12389,22 @@ "flat": "cli.js" } }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, "node_modules/flatted": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", @@ -13386,6 +13967,17 @@ "node": ">=8" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-plain-obj": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", @@ -14062,6 +14654,14 @@ "node": ">=4" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -14095,6 +14695,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -14436,6 +15044,17 @@ "node": ">=10" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -14586,6 +15205,21 @@ "node": ">=0.10.0" } }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/license-webpack-plugin": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/license-webpack-plugin/-/license-webpack-plugin-4.0.2.tgz", @@ -16733,6 +17367,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/ora": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", @@ -18281,6 +18934,17 @@ "dev": true, "license": "MIT" }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", @@ -20410,6 +21074,20 @@ "node": ">=8" } }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strong-log-transformer": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz", @@ -21077,6 +21755,20 @@ "dev": true, "license": "0BSD" }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/type-fest": { "version": "0.21.3", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", @@ -21890,6 +22582,17 @@ "dev": true, "license": "MIT" }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -22288,7 +22991,7 @@ }, "projects/tooltip": { "name": "@hug/ngx-tooltip", - "version": "1.1.4", + "version": "1.1.2", "license": "GPL-3.0-only", "dependencies": { "tslib": "^2.6.3" @@ -22329,7 +23032,7 @@ "@angular/core": ">= 14", "@angular/material": ">= 14", "@hug/ngx-core": "1.1.6", - "@hug/ngx-tooltip": "1.1.4", + "@hug/ngx-tooltip": "1.1.2", "@hug/ngx-user-card": "1.1.1" } } diff --git a/projects/tooltip/package.json b/projects/tooltip/package.json index 8815a561..efc776b6 100644 --- a/projects/tooltip/package.json +++ b/projects/tooltip/package.json @@ -1,6 +1,6 @@ { "name": "@hug/ngx-tooltip", - "version": "1.1.4", + "version": "1.1.2", "description": "HUG Angular - tooltip component", "homepage": "https://github.com/dsi-hug/ngx-components", "license": "GPL-3.0-only", diff --git a/projects/user-tooltip/package.json b/projects/user-tooltip/package.json index e1a67ec7..3711d4b6 100644 --- a/projects/user-tooltip/package.json +++ b/projects/user-tooltip/package.json @@ -34,7 +34,7 @@ "@angular/core": ">= 14", "@angular/material": ">= 14", "@hug/ngx-core": "1.1.6", - "@hug/ngx-tooltip": "1.1.4", + "@hug/ngx-tooltip": "1.1.2", "@hug/ngx-user-card": "1.1.1" }, "dependencies": { From c4ea7ab8d1f10380283b7f6f63629e0049350042 Mon Sep 17 00:00:00 2001 From: Badisi Date: Fri, 5 Jul 2024 00:59:27 +0200 Subject: [PATCH 2/2] ci: improve release --- .github/workflows/ci_release.yml | 51 ----- nx.json | 11 -- package.json | 2 +- projects/core/package.json | 4 +- projects/layout/package.json | 4 +- projects/list-loader/package.json | 4 +- projects/message-box-dialog/package.json | 4 +- projects/message-box/package.json | 4 +- projects/numeric-stepper/package.json | 4 +- projects/overlay/package.json | 4 +- projects/search-container/package.json | 4 +- projects/sidenav/package.json | 4 +- projects/snackbar/package.json | 4 +- projects/splitter/package.json | 4 +- projects/status/package.json | 4 +- projects/time-picker/package.json | 4 +- projects/tooltip/package.json | 4 +- projects/user-card/package.json | 4 +- projects/user-tooltip/package.json | 4 +- scripts/release.ts | 237 +++++++++++++++++++++++ scripts/sync-peer-deps.mjs | 110 ----------- 21 files changed, 270 insertions(+), 205 deletions(-) create mode 100644 scripts/release.ts delete mode 100644 scripts/sync-peer-deps.mjs diff --git a/.github/workflows/ci_release.yml b/.github/workflows/ci_release.yml index 560c4af7..a2d26dcf 100644 --- a/.github/workflows/ci_release.yml +++ b/.github/workflows/ci_release.yml @@ -46,54 +46,3 @@ jobs: working-directory: 'projects/${{ inputs.package }}' dry-run: ${{ inputs.dry-run }} release: true - - ci_sync_peer_deps: - needs: ci_release - runs-on: 'ubuntu-latest' - steps: - - name: Checkout sources - uses: actions/checkout@v4 - with: - ref: ${{ github.ref_name }} # https://github.com/actions/checkout/issues/1327 - persist-credentials: false # https://github.com/semantic-release/semantic-release/issues/2636 - - - name: Synchronize peer dependencies - working-directory: 'scripts' - env: - GITHUB_TOKEN: ${{ secrets.DSI_HUG_BOT_GITHUB_TOKEN }} - run: | - git config user.name 'dsi-hug-bot' - git config user.email 'dsi-hug-bot@users.noreply.github.com' - git remote set-url origin https://x-access-token:${{ secrets.DSI_HUG_BOT_GITHUB_TOKEN }}@github.com/${{ github.repository }} - npm --prefix . i chalk - node ./sync-peer-deps.mjs - - # - # nx does not update package-lock file correctly. - # @see https://github.com/nrwl/nx/issues/26660 - # - # This results in the following error, next time deps are installed: - # “npm error `npm ci` can only install packages when your package.json and package-lock.json or - # npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing." - # - ci_update_package_lock_file: - needs: ci_sync_peer_deps - runs-on: 'ubuntu-latest' - steps: - - name: Checkout sources - uses: actions/checkout@v4 - with: - ref: ${{ github.ref_name }} # https://github.com/actions/checkout/issues/1327 - persist-credentials: false # https://github.com/semantic-release/semantic-release/issues/2636 - - - name: Synchronize package.json and package-lock.json - env: - GITHUB_TOKEN: ${{ secrets.DSI_HUG_BOT_GITHUB_TOKEN }} - run: | - git config user.name 'dsi-hug-bot' - git config user.email 'dsi-hug-bot@users.noreply.github.com' - git remote set-url origin https://x-access-token:${{ secrets.DSI_HUG_BOT_GITHUB_TOKEN }}@github.com/${{ github.repository }} - npm install - git add package.json package-lock.json - git commit --message "chore: synchronize package.json and package-lock.json" - git push --follow-tags --no-verify --atomic diff --git a/nx.json b/nx.json index 67adef24..0e9e9393 100644 --- a/nx.json +++ b/nx.json @@ -5,21 +5,10 @@ "dependsOn": [ "^build:ng" ] - }, - "nx-release-publish": { - "dependsOn": [ - "build" - ], - "options": { - "packageRoot": "{workspaceRoot}/dist/{projectRoot}" - } } }, "release": { "projectsRelationship": "independent", - "git": { - "commitMessage": "chore({projectName}): release version {version} [skip ci]" - }, "version": { "conventionalCommits": true }, diff --git a/package.json b/package.json index 6c35ea57..c2965601 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "lint": "eslint . --fix", "prepare": "husky || true", "new-package": "ng g .:new-package", - "release:dry-run": "nx release --verbose --dry-run", + "release:dry-run": "node -r @swc-node/register ./scripts/release.ts --verbose --dry-run", "postinstall": "patch-package" }, "workspaces": [ diff --git a/projects/core/package.json b/projects/core/package.json index cc3912c2..0fdc01c8 100644 --- a/projects/core/package.json +++ b/projects/core/package.json @@ -31,8 +31,8 @@ "test:ci": "ng test core --watch=false --browsers=ChromeHeadless", "build:ng": "ng build core -c=production", "build": "nx build:ng @hug/ngx-core --verbose", - "release": "nx release -p=@hug/ngx-core --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-core --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-core --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/projects/layout/package.json b/projects/layout/package.json index 1b698d8c..056d04c6 100644 --- a/projects/layout/package.json +++ b/projects/layout/package.json @@ -26,8 +26,8 @@ "test:ci": "ng test layout --watch=false --browsers=ChromeHeadless", "build:ng": "ng build layout -c=production", "build": "nx build:ng @hug/ngx-layout --verbose", - "release": "nx release -p=@hug/ngx-layout --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-layout --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-layout --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/projects/list-loader/package.json b/projects/list-loader/package.json index 1dd28eb6..f57b2bdc 100644 --- a/projects/list-loader/package.json +++ b/projects/list-loader/package.json @@ -31,8 +31,8 @@ "test:ci": "ng test list-loader --watch=false --browsers=ChromeHeadless", "build:ng": "ng build list-loader -c=production", "build": "nx build:ng @hug/ngx-list-loader --verbose", - "release": "nx release -p=@hug/ngx-list-loader --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-list-loader --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-list-loader --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/projects/message-box-dialog/package.json b/projects/message-box-dialog/package.json index 329a955e..32f79737 100644 --- a/projects/message-box-dialog/package.json +++ b/projects/message-box-dialog/package.json @@ -26,8 +26,8 @@ "test:ci": "ng test message-box-dialog --watch=false --browsers=ChromeHeadless", "build:ng": "ng build message-box-dialog -c=production", "build": "nx build:ng @hug/ngx-message-box-dialog --verbose", - "release": "nx release -p=@hug/ngx-message-box-dialog --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-message-box-dialog --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-message-box-dialog --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/projects/message-box/package.json b/projects/message-box/package.json index 09857b44..aeb32b86 100644 --- a/projects/message-box/package.json +++ b/projects/message-box/package.json @@ -31,8 +31,8 @@ "test:ci": "ng test message-box --watch=false --browsers=ChromeHeadless", "build:ng": "ng build message-box -c=production", "build": "nx build:ng @hug/ngx-message-box --verbose", - "release": "nx release -p=@hug/ngx-message-box --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-message-box --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-message-box --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/projects/numeric-stepper/package.json b/projects/numeric-stepper/package.json index 1fed2400..9a1864cc 100644 --- a/projects/numeric-stepper/package.json +++ b/projects/numeric-stepper/package.json @@ -31,8 +31,8 @@ "test:ci": "ng test numeric-stepper --watch=false --browsers=ChromeHeadless", "build:ng": "ng build numeric-stepper -c=production", "build": "nx build:ng @hug/ngx-numeric-stepper --verbose", - "release": "nx release -p=@hug/ngx-numeric-stepper --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-numeric-stepper --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-numeric-stepper --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/projects/overlay/package.json b/projects/overlay/package.json index a0732d58..8f350b04 100644 --- a/projects/overlay/package.json +++ b/projects/overlay/package.json @@ -26,8 +26,8 @@ "test:ci": "ng test overlay --watch=false --browsers=ChromeHeadless", "build:ng": "ng build overlay -c=production", "build": "nx build:ng @hug/ngx-overlay --verbose", - "release": "nx release -p=@hug/ngx-overlay --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-overlay --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-overlay --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/projects/search-container/package.json b/projects/search-container/package.json index 00964aec..1da87c1f 100644 --- a/projects/search-container/package.json +++ b/projects/search-container/package.json @@ -26,8 +26,8 @@ "test:ci": "ng test search-container --watch=false --browsers=ChromeHeadless", "build:ng": "ng build search-container -c=production", "build": "nx build:ng @hug/ngx-search-container --verbose", - "release": "nx release -p=@hug/ngx-search-container --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-search-container --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-search-container --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/projects/sidenav/package.json b/projects/sidenav/package.json index e7348d99..fd5dde71 100644 --- a/projects/sidenav/package.json +++ b/projects/sidenav/package.json @@ -26,8 +26,8 @@ "test:ci": "ng test sidenav --watch=false --browsers=ChromeHeadless", "build:ng": "ng build sidenav -c=production", "build": "nx build:ng @hug/ngx-sidenav --verbose", - "release": "nx release -p=@hug/ngx-sidenav --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-sidenav --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-sidenav --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/projects/snackbar/package.json b/projects/snackbar/package.json index ad45ca3e..cba433ab 100644 --- a/projects/snackbar/package.json +++ b/projects/snackbar/package.json @@ -26,8 +26,8 @@ "test:ci": "ng test snackbar --watch=false --browsers=ChromeHeadless", "build:ng": "ng build snackbar -c=production", "build": "nx build:ng @hug/ngx-snackbar --verbose", - "release": "nx release -p=@hug/ngx-snackbar --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-snackbar --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-snackbar --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/projects/splitter/package.json b/projects/splitter/package.json index b9f6dce0..165de1b5 100644 --- a/projects/splitter/package.json +++ b/projects/splitter/package.json @@ -31,8 +31,8 @@ "test:ci": "ng test splitter --watch=false --browsers=ChromeHeadless", "build:ng": "ng build splitter -c=production", "build": "nx build:ng @hug/ngx-splitter --verbose", - "release": "nx release -p=@hug/ngx-splitter --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-splitter --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-splitter --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/projects/status/package.json b/projects/status/package.json index f29845f2..80838a93 100644 --- a/projects/status/package.json +++ b/projects/status/package.json @@ -31,8 +31,8 @@ "test:ci": "ng test status --watch=false --browsers=ChromeHeadless", "build:ng": "ng build status -c=production", "build": "nx build:ng @hug/ngx-status --verbose", - "release": "nx release -p=@hug/ngx-status --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-status --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-status --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/projects/time-picker/package.json b/projects/time-picker/package.json index 3e195931..93c14ca2 100644 --- a/projects/time-picker/package.json +++ b/projects/time-picker/package.json @@ -26,8 +26,8 @@ "test:ci": "ng test time-picker --watch=false --browsers=ChromeHeadless", "build:ng": "ng build time-picker -c=production", "build": "nx build:ng @hug/ngx-time-picker --verbose", - "release": "nx release -p=@hug/ngx-time-picker --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-time-picker --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-time-picker --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/projects/tooltip/package.json b/projects/tooltip/package.json index efc776b6..bde9b13f 100644 --- a/projects/tooltip/package.json +++ b/projects/tooltip/package.json @@ -26,8 +26,8 @@ "test:ci": "ng test tooltip --watch=false --browsers=ChromeHeadless", "build:ng": "ng build tooltip -c=production", "build": "nx build:ng @hug/ngx-tooltip --verbose", - "release": "nx release -p=@hug/ngx-tooltip --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-tooltip --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-tooltip --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/projects/user-card/package.json b/projects/user-card/package.json index ed3be12c..d76f58f2 100644 --- a/projects/user-card/package.json +++ b/projects/user-card/package.json @@ -26,8 +26,8 @@ "test:ci": "ng test user-card --watch=false --browsers=ChromeHeadless", "build:ng": "ng build user-card -c=production", "build": "nx build:ng @hug/ngx-user-card --verbose", - "release": "nx release -p=@hug/ngx-user-card --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-user-card --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-user-card --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/projects/user-tooltip/package.json b/projects/user-tooltip/package.json index 3711d4b6..76fc3121 100644 --- a/projects/user-tooltip/package.json +++ b/projects/user-tooltip/package.json @@ -26,8 +26,8 @@ "test:ci": "ng test user-tooltip --watch=false --browsers=ChromeHeadless", "build:ng": "ng build user-tooltip -c=production", "build": "nx build:ng @hug/ngx-user-tooltip --verbose", - "release": "nx release -p=@hug/ngx-user-tooltip --yes --verbose", - "release:dry-run": "nx release -p=@hug/ngx-user-tooltip --verbose --dry-run" + "release": "node -r @swc-node/register ../../scripts/release.ts --projects=@hug/ngx-user-tooltip --verbose", + "release:dry-run": "npm run release -- --dry-run" }, "peerDependencies": { "@angular/common": ">= 14", diff --git a/scripts/release.ts b/scripts/release.ts new file mode 100644 index 00000000..00979c2d --- /dev/null +++ b/scripts/release.ts @@ -0,0 +1,237 @@ +/* eslint-disable @typescript-eslint/naming-convention, no-loops/no-loops, camelcase */ + +import chalk from 'chalk'; +import { execSync } from 'node:child_process'; +import { copyFileSync, readFileSync, writeFileSync } from 'node:fs'; +import { join } from 'node:path'; +import { releaseChangelog, releasePublish, releaseVersion } from 'nx/release'; +import { PublishOptions } from 'nx/src/command-line/release/command-object'; +import { createProjectGraphAsync, readProjectsConfigurationFromProjectGraph } from 'nx/src/project-graph/project-graph'; +import { PackageJson } from 'nx/src/utils/package-json'; +import { workspaceRoot } from 'nx/src/utils/workspace-root'; +import * as yargs from 'yargs'; + +const { yellow, blue, red, green, gray, white, bgBlue } = chalk; + +void (async (): Promise => { + const options = await yargs + .version(false) + .option('projects', { + description: 'Projects filter to use for the release script', + type: 'array', + string: true, + default: [] + }) + .option('dry-run', { + description: 'Whether or not to perform a dry-run of the release process, defaults to false', + type: 'boolean', + default: false + }) + .option('verbose', { + description: 'Whether or not to enable verbose logging, defaults to false', + type: 'boolean', + default: false + }) + .parseAsync(); + + /** + * 1. Resolve new project version + * 2. Update `projects//package.json` with new version + * 3. Update npm lock file + * 4. Stage changed files with git + */ + const { workspaceVersion, projectsVersionData } = await releaseVersion({ + projects: options.projects, + stageChanges: true, + gitCommit: false, + dryRun: options.dryRun, + verbose: options.verbose + }); + + /** + * 5. Determine affected projects and exit if none + */ + const projectsToRelease = Object.keys(projectsVersionData).filter(key => { + const { newVersion, currentVersion } = projectsVersionData[key]; + return (newVersion && (newVersion !== currentVersion)); + }); + if (projectsToRelease.length === 0) { + console.log('No affected projects found to be published'); + return process.exit(0); + } + + /** + * 6. Update `projects//CHANGELOG.md` + * 7. Stage changed files with git + * 8. Commit all previously staged files in git + * chore(release): publish [skip ci] + * - project: @hug/ngx-xyz 1.2.3 + * 9. Tag commit with git + * @hug/ngx-xyz@1.2.3 + * 10. Push to git remote + * 11. Create GitHub release + */ + await releaseChangelog({ + projects: options.projects, + version: workspaceVersion, + versionData: projectsVersionData, + stageChanges: true, + gitCommit: true, + gitCommitMessage: 'chore(release): publish [skip ci]', + gitTag: true, + dryRun: options.dryRun, + verbose: options.verbose + }); + + /** + * Ensures consistent versioning across interdependent packages in the monorepo. + * + * It reads the current version of each package and updates any other packages that reference + * it in their `peerDependencies` to maintain version synchronization. + * + * TODO: remove this script if one day this feature is supported by `nx release` directly + * @see https://github.com/nrwl/nx/issues/22776 + * @see https://github.com/nrwl/nx/discussions/23388 + * + * 12. Synchronize interdependencies + * - Update project's package.json file + * - Update npm lock file + * - Stage changed files with git + * - Commit all previously staged files in git + * deps(@hug/ngx-xyz): upgrade to v1.2.3 + * [skip ci] + * 13. Push to git remote + */ + const exec = (message: string, cmd: string): void => { + console.log(message); + if (options.verbose) { + console.log(cmd); + } + if (!options.dryRun) { + execSync(cmd, { cwd: workspaceRoot, stdio: 'inherit' }); + } + }; + const projectGraph = await createProjectGraphAsync({ exitOnError: true }); + const { projects } = readProjectsConfigurationFromProjectGraph(projectGraph); + const workspaces = Object.values(projects).map(project => ({ + packageJsonPath: join(project.root, 'package.json'), + packageJson: JSON.parse(readFileSync(join(workspaceRoot, project.root, 'package.json'), 'utf8')) as PackageJson + })); + let packageJsonFiles: string[] = []; + let changesDetected = false; + + console.log(`\n${bgBlue(' HUG ')} ${blue('Synchronizing peer interdependencies')}${options.dryRun ? yellow(' [dry-run]') : ''}`); + workspaces.forEach(workspace => { + workspaces.forEach(workspace2 => { + const peerDependencies = workspace2.packageJson.peerDependencies ?? {}; + if (Object.prototype.hasOwnProperty.call(peerDependencies, workspace.packageJson.name)) { + const version = peerDependencies[workspace.packageJson.name]; + if (!version.includes(workspace.packageJson.version)) { + changesDetected = true; + + const versionRange = version.match(/(^[^\d]*)\d.*/)?.[1] ?? ''; + const newVersion = `${versionRange}${workspace.packageJson.version}`; + + if (!packageJsonFiles.length) { + console.log(`\n- ${blue(workspace.packageJson.name)}`); + } + + console.log(`\n${white('UPDATE')} ${workspace2.packageJsonPath}${options.dryRun ? yellow(' [dry-run]') : ''}\n`); + console.log(gray(' "peerDependencies": {')); + console.log(red(`- "${workspace.packageJson.name}": "${version}"`)); + console.log(green(`+ "${workspace.packageJson.name}": "${newVersion}"`)); + console.log(gray(' }')); + if (!options.dryRun) { + peerDependencies[workspace.packageJson.name] = newVersion; + workspace2.packageJson.peerDependencies = peerDependencies; + writeFileSync(join(workspaceRoot, workspace2.packageJsonPath), JSON.stringify(workspace2.packageJson, null, 4), { encoding: 'utf8' }); + } + + packageJsonFiles.push(workspace2.packageJsonPath); + } + } + }); + + if (packageJsonFiles.length) { + exec( + `\n${bgBlue(' HUG ')} ${blue('Updating npm lock file')}${options.dryRun ? yellow(' [dry-run]') : ''}\n`, + 'npm install' + ); + exec( + `\n${bgBlue(' HUG ')} ${blue('Staging changed files with git')}${options.dryRun ? yellow(' [dry-run]') : ''}\n`, + `git add package-lock.json ${packageJsonFiles.join(' ')}` + ); + exec( + `\n${bgBlue(' HUG ')} ${blue('Comitting changes with git')}${options.dryRun ? yellow(' [dry-run]') : ''}\n`, + `git commit --message deps(${workspace.packageJson.name}): upgrade to v${workspace.packageJson.version} --message [skip ci]` + ); + packageJsonFiles = []; + } + }); + if (changesDetected) { + exec( + `\n${bgBlue(' HUG ')} ${blue('Pushing to git remote')}${options.dryRun ? yellow(' [dry-run]') : ''}\n`, + 'git push --follow-tags --no-verify --atomic' + ); + } else { + console.log('\nNo changes were needed, versions already in sync.'); + } + + /** + * Currently `nx release` publishes packages from their source directory by default. + * + * So we need to make sure `dist` are in sync and published instead. + * + * TODO: remove this script if one day this feature is supported by `nx release` directly + * @see https://github.com/nrwl/nx/issues/21855#issuecomment-1977360480 + * + * 14. Update project(s) `package.json` and `CHANGELOG.md` in dist + */ + console.log(`\n${bgBlue(' HUG ')} ${blue('Synchronizing dist packages')}${options.dryRun ? yellow(' [dry-run]') : ''}`); + projectsToRelease.forEach(project => { + const projectRoot = projects[project].root; + const projectName = projectRoot.substring('projects/'.length); + const projectNewVersion = projectsVersionData[project].newVersion ?? ''; + const distPackageJsonPath = join('dist', projectName, 'package.json'); + const distChangelogPath = join('dist', projectName, 'CHANGELOG.md'); + + console.log(`\n${blue(projects[project].name ?? '')} New version ${projectNewVersion} written to ${distPackageJsonPath}`); + if (!options.dryRun) { + const distPackageJson = JSON.parse(readFileSync(join(workspaceRoot, projectRoot, 'package.json'), 'utf8')) as PackageJson; + distPackageJson.name = projectNewVersion; + writeFileSync(join(workspaceRoot, distPackageJsonPath), JSON.stringify(distPackageJson, null, 4), { encoding: 'utf8' }); + } + + console.log(`${blue(projects[project].name ?? '')} Changelog updated in ${distChangelogPath}`); + if (!options.dryRun) { + copyFileSync(join(workspaceRoot, projectRoot, 'CHANGELOG.md'), join(workspaceRoot, distChangelogPath)); + } + }); + + /** + * Currently `nx release` does not allow to easily change the folder to be published. + * + * `nx.json#targetDefaults.nx-release-publish.options.packageRoot` could be used but can only interpolate: + * - {projectName}: which resolved to '@hug/ngx-xyz' (ie. package.json#name) + * - {projectRoot}: which resolved to 'projects/xyz' + * And what we need is actually `xyz` because Angular generates projects in `dist/xyz`. + * So to make it work, we use the hidden option (__overrides_unparsed__) and publish each project individually. + * + * 15. Publish to npm + */ + let processStatus = 0; + for (const project of projectsToRelease) { + const projectName = projects[project].root.substring('projects/'.length); + const publishStatus = await releasePublish({ + __overrides_unparsed__: `--packageRoot=./dist/${projectName}`, + projects: [project], + dryRun: options.dryRun, + verbose: options.verbose + } as PublishOptions); + if (publishStatus !== 0) { + processStatus = publishStatus; + } + } + + return process.exit(processStatus); +})(); diff --git a/scripts/sync-peer-deps.mjs b/scripts/sync-peer-deps.mjs deleted file mode 100644 index 5d34732c..00000000 --- a/scripts/sync-peer-deps.mjs +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Automated script that ensures consistent versioning across interdependent packages in a monorepo. - * - * This script reads the current version of each package and updates any other packages that reference - * it in their `peerDependencies` to maintain version synchronization. - * - * @example: $ node ./sync-peer-deps.mjs [--dry-run] - * - * TODO: remove this script if one day this feature is supported by `nx release` directly - * @see https://github.com/nrwl/nx/issues/22776 - * @see https://github.com/nrwl/nx/discussions/23388 - */ - -import chalk from 'chalk'; -import { spawnSync } from 'node:child_process'; -import { readFileSync, writeFileSync } from 'node:fs'; -import { dirname, resolve } from 'node:path'; -import { fileURLToPath } from 'node:url'; - -const { yellow, blue, red, green, gray, white, bgBlue, bgWhite } = chalk; - -const __dirname = dirname(fileURLToPath(import.meta.url)); -const rootPath = resolve(__dirname, '..'); - -const dryRun = (process.argv[2] === '--dry-run'); - -const execCommand = (command, args) => { - console.log(`\n${command} ${args.join(' ')}`); - if (!dryRun) { - const result = spawnSync(command, args, { stdio: 'inherit' }); - if (result.error) { - throw result.error; - } - if (result.status !== 0) { - throw new Error(`Command failed with exit code ${result.status}`); - } - } -}; - -const getWorkspaces = () => { - const rootPackageJson = JSON.parse(readFileSync(resolve(rootPath, 'package.json'), 'utf8')); - if (!rootPackageJson.workspaces) { - console.error(red('No workspaces found in package.json')); - } - return (rootPackageJson.workspaces || []).map(workspace => ({ - packageJsonPath: resolve(rootPath, workspace, 'package.json'), - packageJson: JSON.parse(readFileSync(resolve(rootPath, workspace, 'package.json'), 'utf8')) - })); -}; - -(() => { - console.log(`\n${bgBlue(' > ')} Synchronizing peer dependencies`); - let changesDetected = false; - let packageJsonFiles = []; - const workspaces = getWorkspaces(); - workspaces.forEach(workspace => { - workspaces.forEach(workspace2 => { - const peerDependencies = workspace2.packageJson.peerDependencies || {}; - if (Object.hasOwn(peerDependencies, workspace.packageJson.name)) { - const version = peerDependencies[workspace.packageJson.name]; - if (!version.includes(workspace.packageJson.version)) { - changesDetected = true; - - const versionRange = version.match(/(^[^\d]*)\d.*/)[1]; - const newVersion = `${versionRange}${workspace.packageJson.version}`; - - if (!packageJsonFiles.length) { - console.log(`\n${blue(workspace.packageJson.name)}`); - } - - console.log(`\n${bgWhite(' > ')} ${white('UPDATE')} ${workspace2.packageJsonPath}${dryRun ? yellow(' [dry-run]') : ''}\n`); - console.log(gray(' "peerDependencies": {')); - console.log(red(`- "${workspace.packageJson.name}": "${version}"`)); - console.log(green(`+ "${workspace.packageJson.name}": "${newVersion}"`)); - console.log(gray(' }')); - if (!dryRun) { - workspace2.packageJson.peerDependencies[workspace.packageJson.name] = newVersion; - writeFileSync(workspace2.packageJsonPath, JSON.stringify(workspace2.packageJson, null, 4), { encoding: 'utf8' }); - } - - packageJsonFiles.push(workspace2.packageJsonPath); - } - } - }); - - if (packageJsonFiles.length) { - console.log(`\n${bgWhite(' > ')} Updating npm lock file${dryRun ? yellow(' [dry-run]') : ''}`); - execCommand('npm', ['install']); - - console.log(`\n${bgWhite(' > ')} Staging changed files with git${dryRun ? yellow(' [dry-run]') : ''}`); - execCommand('git', ['add', resolve(rootPath, 'package-lock.json'), ...packageJsonFiles]); - - console.log(`\n${bgWhite(' > ')} Committing changes with git${dryRun ? yellow(' [dry-run]') : ''}`); - execCommand('git', ['commit', '--message', `deps(${workspace.packageJson.name}): upgrade to v${workspace.packageJson.version} [skip ci]`]); - - packageJsonFiles = []; - } - }); - - if (changesDetected) { - console.log(`\n${bgWhite(' > ')} Pushing to git remote${dryRun ? yellow(' [dry-run]') : ''}`); - execCommand('git', ['push', '--follow-tags', '--no-verify', '--atomic']); - } else { - console.log('\nNo changes were needed, versions already in sync.'); - } - - if (dryRun) { - console.log(yellow('\nNOTE: The "--dry-run" flag means no changes were made.\n')); - } -})();