diff --git a/.github/workflows/ci_release.yml b/.github/workflows/ci_release.yml index e59bedfc..84d4f88d 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 23b2ab01..ac1d65bf 100644 --- a/nx.json +++ b/nx.json @@ -3,19 +3,10 @@ "targetDefaults": { "build:ng": { "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-lock.json b/package-lock.json index e7f993a7..fe3c268c 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": { @@ -3640,9 +3640,10 @@ }, "node_modules/@commitlint/load/node_modules/typescript": { "version": "5.5.3", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/typescript/-/typescript-5.5.3.tgz", + "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", @@ -4246,9 +4247,10 @@ }, "node_modules/@eslint/eslintrc": { "version": "2.1.4", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "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", @@ -4270,9 +4272,10 @@ }, "node_modules/@eslint/eslintrc/node_modules/ajv": { "version": "6.12.6", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/ajv/-/ajv-6.12.6.tgz", + "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", @@ -4287,16 +4290,18 @@ }, "node_modules/@eslint/eslintrc/node_modules/argparse": { "version": "2.0.1", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/argparse/-/argparse-2.0.1.tgz", + "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://nxrm.hisaas.hcuge.ch/repository/npm-all/brace-expansion/-/brace-expansion-1.1.11.tgz", + "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", @@ -4305,9 +4310,10 @@ }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "13.24.0", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/globals/-/globals-13.24.0.tgz", + "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" @@ -4321,9 +4327,10 @@ }, "node_modules/@eslint/eslintrc/node_modules/js-yaml": { "version": "4.1.0", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/js-yaml/-/js-yaml-4.1.0.tgz", + "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" @@ -4334,16 +4341,18 @@ }, "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { "version": "0.4.1", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "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://nxrm.hisaas.hcuge.ch/repository/npm-all/minimatch/-/minimatch-3.1.2.tgz", + "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" @@ -4354,9 +4363,10 @@ }, "node_modules/@eslint/eslintrc/node_modules/type-fest": { "version": "0.20.2", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/type-fest/-/type-fest-0.20.2.tgz", + "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" @@ -4367,9 +4377,10 @@ }, "node_modules/@eslint/js": { "version": "8.57.0", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/@eslint/js/-/js-8.57.0.tgz", + "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" @@ -4531,10 +4542,11 @@ }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "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", @@ -4547,9 +4559,10 @@ }, "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { "version": "1.1.11", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/brace-expansion/-/brace-expansion-1.1.11.tgz", + "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", @@ -4558,9 +4571,10 @@ }, "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { "version": "3.1.2", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/minimatch/-/minimatch-3.1.2.tgz", + "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" @@ -4571,9 +4585,10 @@ }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "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" @@ -4585,10 +4600,11 @@ }, "node_modules/@humanwhocodes/object-schema": { "version": "2.0.3", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "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": { @@ -7352,9 +7368,10 @@ }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "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": { @@ -9959,9 +9976,10 @@ }, "node_modules/deep-is": { "version": "0.1.4", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/deep-is/-/deep-is-0.1.4.tgz", + "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": { @@ -10194,9 +10212,10 @@ }, "node_modules/doctrine": { "version": "3.0.0", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/doctrine/-/doctrine-3.0.0.tgz", + "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" @@ -11102,9 +11121,10 @@ }, "node_modules/eslint": { "version": "8.57.0", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/eslint/-/eslint-8.57.0.tgz", + "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", @@ -11636,9 +11656,10 @@ }, "node_modules/eslint/node_modules/ajv": { "version": "6.12.6", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/ajv/-/ajv-6.12.6.tgz", + "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", @@ -11653,9 +11674,10 @@ }, "node_modules/eslint/node_modules/ansi-styles": { "version": "4.3.0", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/ansi-styles/-/ansi-styles-4.3.0.tgz", + "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" @@ -11669,16 +11691,18 @@ }, "node_modules/eslint/node_modules/argparse": { "version": "2.0.1", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/argparse/-/argparse-2.0.1.tgz", + "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://nxrm.hisaas.hcuge.ch/repository/npm-all/brace-expansion/-/brace-expansion-1.1.11.tgz", + "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", @@ -11687,9 +11711,10 @@ }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/chalk/-/chalk-4.1.2.tgz", + "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", @@ -11704,9 +11729,10 @@ }, "node_modules/eslint/node_modules/color-convert": { "version": "2.0.1", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/color-convert/-/color-convert-2.0.1.tgz", + "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" @@ -11717,16 +11743,18 @@ }, "node_modules/eslint/node_modules/color-name": { "version": "1.1.4", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/color-name/-/color-name-1.1.4.tgz", + "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://nxrm.hisaas.hcuge.ch/repository/npm-all/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "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" @@ -11737,9 +11765,10 @@ }, "node_modules/eslint/node_modules/eslint-scope": { "version": "7.2.2", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/eslint-scope/-/eslint-scope-7.2.2.tgz", + "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", @@ -11754,9 +11783,10 @@ }, "node_modules/eslint/node_modules/glob-parent": { "version": "6.0.2", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/glob-parent/-/glob-parent-6.0.2.tgz", + "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" @@ -11767,9 +11797,10 @@ }, "node_modules/eslint/node_modules/globals": { "version": "13.24.0", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/globals/-/globals-13.24.0.tgz", + "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" @@ -11783,9 +11814,10 @@ }, "node_modules/eslint/node_modules/has-flag": { "version": "4.0.0", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/has-flag/-/has-flag-4.0.0.tgz", + "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" @@ -11793,9 +11825,10 @@ }, "node_modules/eslint/node_modules/js-yaml": { "version": "4.1.0", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/js-yaml/-/js-yaml-4.1.0.tgz", + "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" @@ -11806,16 +11839,18 @@ }, "node_modules/eslint/node_modules/json-schema-traverse": { "version": "0.4.1", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "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://nxrm.hisaas.hcuge.ch/repository/npm-all/minimatch/-/minimatch-3.1.2.tgz", + "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" @@ -11826,9 +11861,10 @@ }, "node_modules/eslint/node_modules/supports-color": { "version": "7.2.0", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/supports-color/-/supports-color-7.2.0.tgz", + "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" @@ -11839,9 +11875,10 @@ }, "node_modules/eslint/node_modules/type-fest": { "version": "0.20.2", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/type-fest/-/type-fest-0.20.2.tgz", + "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" @@ -12167,9 +12204,10 @@ }, "node_modules/fast-levenshtein": { "version": "2.0.6", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "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": { @@ -12213,9 +12251,10 @@ }, "node_modules/file-entry-cache": { "version": "6.0.1", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "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" @@ -12353,9 +12392,10 @@ }, "node_modules/flat-cache": { "version": "3.2.0", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/flat-cache/-/flat-cache-3.2.0.tgz", + "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", @@ -13930,9 +13970,10 @@ }, "node_modules/is-path-inside": { "version": "3.0.3", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/is-path-inside/-/is-path-inside-3.0.3.tgz", + "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" @@ -14616,9 +14657,10 @@ }, "node_modules/json-buffer": { "version": "3.0.1", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/json-buffer/-/json-buffer-3.0.1.tgz", + "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": { @@ -14656,9 +14698,10 @@ }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "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": { @@ -15004,9 +15047,10 @@ }, "node_modules/keyv": { "version": "4.5.4", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/keyv/-/keyv-4.5.4.tgz", + "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" @@ -15164,9 +15208,10 @@ }, "node_modules/levn": { "version": "0.4.1", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/levn/-/levn-0.4.1.tgz", + "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", @@ -17325,9 +17370,10 @@ }, "node_modules/optionator": { "version": "0.9.4", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/optionator/-/optionator-0.9.4.tgz", + "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", @@ -18891,9 +18937,10 @@ }, "node_modules/prelude-ls": { "version": "1.2.1", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/prelude-ls/-/prelude-ls-1.2.1.tgz", + "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" @@ -21045,9 +21092,10 @@ }, "node_modules/strip-json-comments": { "version": "3.1.1", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "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" @@ -21725,9 +21773,10 @@ }, "node_modules/type-check": { "version": "0.4.0", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/type-check/-/type-check-0.4.0.tgz", + "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" @@ -22551,9 +22600,10 @@ }, "node_modules/word-wrap": { "version": "1.2.5", - "resolved": "https://nxrm.hisaas.hcuge.ch/repository/npm-all/word-wrap/-/word-wrap-1.2.5.tgz", + "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" @@ -22757,7 +22807,7 @@ }, "projects/core": { "name": "@hug/ngx-core", - "version": "1.1.6", + "version": "1.1.7", "license": "GPL-3.0-only", "dependencies": { "tslib": "^2.6.3" @@ -22783,7 +22833,7 @@ "@angular/common": ">= 14", "@angular/core": ">= 14", "@angular/material": ">= 14", - "@hug/ngx-core": "1.1.6", + "@hug/ngx-core": "1.1.7", "@hug/ngx-sidenav": "1.1.1" } }, @@ -22815,7 +22865,7 @@ }, "projects/message-box-dialog": { "name": "@hug/ngx-message-box-dialog", - "version": "1.1.2", + "version": "1.1.3", "license": "GPL-3.0-only", "dependencies": { "tslib": "^2.6.3" @@ -22824,7 +22874,7 @@ "@angular/common": ">= 14", "@angular/core": ">= 14", "@angular/material": ">= 14", - "@hug/ngx-core": "1.1.6", + "@hug/ngx-core": "1.1.7", "rxjs": ">= 7.0.0" } }, @@ -22840,7 +22890,7 @@ "@angular/common": ">= 14", "@angular/core": ">= 14", "@angular/material": ">= 14", - "@hug/ngx-core": "1.1.6", + "@hug/ngx-core": "1.1.7", "rxjs": ">= 7.0.0" } }, @@ -22855,13 +22905,13 @@ "@angular/cdk": ">= 14", "@angular/common": ">= 14", "@angular/core": ">= 14", - "@hug/ngx-core": "1.1.6", + "@hug/ngx-core": "1.1.7", "rxjs": ">= 7.0.0" } }, "projects/search-container": { "name": "@hug/ngx-search-container", - "version": "1.1.1", + "version": "1.1.2", "license": "GPL-3.0-only", "dependencies": { "tslib": "^2.6.3" @@ -22871,7 +22921,7 @@ "@angular/core": ">= 14", "@angular/forms": ">= 14", "@angular/material": ">= 14", - "@hug/ngx-core": "1.1.6", + "@hug/ngx-core": "1.1.7", "rxjs": ">= 7.0.0" } }, @@ -22885,7 +22935,7 @@ "peerDependencies": { "@angular/common": ">= 14", "@angular/core": ">= 14", - "@hug/ngx-core": "1.1.6", + "@hug/ngx-core": "1.1.7", "rxjs": ">= 7.0.0" } }, @@ -22899,13 +22949,13 @@ "peerDependencies": { "@angular/common": ">= 14", "@angular/core": ">= 14", - "@hug/ngx-core": "1.1.6", + "@hug/ngx-core": "1.1.7", "rxjs": ">= 7.0.0" } }, "projects/splitter": { "name": "@hug/ngx-splitter", - "version": "1.1.2", + "version": "1.1.3", "license": "GPL-3.0-only", "dependencies": { "tslib": "^2.6.3" @@ -22914,7 +22964,7 @@ "@angular/cdk": ">= 14", "@angular/common": ">= 14", "@angular/core": ">= 14", - "@hug/ngx-core": "1.1.6", + "@hug/ngx-core": "1.1.7", "rxjs": ">= 7.0.0" } }, @@ -22930,7 +22980,7 @@ "@angular/common": ">= 14", "@angular/core": ">= 14", "@angular/material": ">= 14", - "@hug/ngx-core": "1.1.6", + "@hug/ngx-core": "1.1.7", "@hug/ngx-message-box": "1.1.2", "@hug/ngx-snackbar": "1.1.2", "rxjs": ">= 7.0.0" @@ -22949,7 +22999,7 @@ "@angular/core": ">= 14", "@angular/forms": ">= 14", "@angular/material": ">= 14", - "@hug/ngx-core": "1.1.6", + "@hug/ngx-core": "1.1.7", "@hug/ngx-numeric-stepper": "1.1.3", "date-fns": "^2.30.0", "rxjs": ">= 7.0.0" @@ -22957,7 +23007,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" @@ -22967,7 +23017,7 @@ "@angular/common": ">= 14", "@angular/core": ">= 14", "@angular/material": ">= 14", - "@hug/ngx-core": "1.1.6", + "@hug/ngx-core": "1.1.7", "lodash-es": "^4.17.21", "rxjs": ">= 7.0.0" } @@ -22997,8 +23047,8 @@ "@angular/common": ">= 14", "@angular/core": ">= 14", "@angular/material": ">= 14", - "@hug/ngx-core": "1.1.6", - "@hug/ngx-tooltip": "1.1.4", + "@hug/ngx-core": "1.1.7", + "@hug/ngx-tooltip": "1.1.2", "@hug/ngx-user-card": "1.1.1" } } diff --git a/package.json b/package.json index 8eaa54d4..66f011bd 100644 --- a/package.json +++ b/package.json @@ -5,12 +5,11 @@ "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", "start": "ng serve", "prettier": "npx prettier . --check", - "prettier-fix": "npx prettier . --write", - "ng": "ng" + "prettier-fix": "npx prettier . --write" }, "workspaces": [ "projects/core", diff --git a/patches/nx+19.3.0.patch b/patches/nx+19.3.0.patch deleted file mode 100644 index 6ba5f5b5..00000000 --- a/patches/nx+19.3.0.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff --git a/node_modules/nx/bin/nx-cloud.js b/node_modules/nx/bin/nx-cloud.js -old mode 100755 -new mode 100644 -diff --git a/node_modules/nx/src/command-line/release/changelog.js b/node_modules/nx/src/command-line/release/changelog.js -index 3f43843..958744d 100644 ---- a/node_modules/nx/src/command-line/release/changelog.js -+++ b/node_modules/nx/src/command-line/release/changelog.js -@@ -305,6 +305,7 @@ async function releaseChangelog(args) { - } - if (!commits) { - commits = await getCommits(fromRef, toSHA); -+ commits = commits.filter((c) => c.affectedFiles.find((f) => f.startsWith(project.data.root))); - } - const { fileMap } = await (0, file_map_utils_1.createFileMapUsingProjectGraph)(projectGraph); - const fileToProjectMap = createFileToProjectMap(fileMap.projectFileMap); -diff --git a/node_modules/nx/src/command-line/release/utils/shared.js b/node_modules/nx/src/command-line/release/utils/shared.js -index e08aff8..de3cdc7 100644 ---- a/node_modules/nx/src/command-line/release/utils/shared.js -+++ b/node_modules/nx/src/command-line/release/utils/shared.js -@@ -209,8 +209,9 @@ async function getCommitsRelevantToProjects(projectGraph, commits, projects) { - * - touch project files which are contained within the list of projects directly - * - touch non-project files and the commit is not scoped - */ -- return commits.filter((c) => c.affectedFiles.some((f) => filesInReleaseGroup.has(f) || -- (!c.scope && -- fileMap.nonProjectFiles.some((nonProjectFile) => nonProjectFile.file === f)))); -+ // return commits.filter((c) => c.affectedFiles.some((f) => filesInReleaseGroup.has(f) || -+ // (!c.scope && -+ // fileMap.nonProjectFiles.some((nonProjectFile) => nonProjectFile.file === f)))); -+ return commits.filter((c) => c.affectedFiles.some((f) => filesInReleaseGroup.has(f))); - } - exports.getCommitsRelevantToProjects = getCommitsRelevantToProjects; -diff --git a/node_modules/nx/src/generators/utils/json.js b/node_modules/nx/src/generators/utils/json.js -index 7db40ce..5e69931 100644 ---- a/node_modules/nx/src/generators/utils/json.js -+++ b/node_modules/nx/src/generators/utils/json.js -@@ -1,6 +1,8 @@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.updateJson = exports.writeJson = exports.readJson = void 0; -+let detectIndent_1; -+(async () => detectIndent_1 = ((await import('detect-indent')).default))(); - const json_1 = require("../../utils/json"); - /** - * Reads a json file, removes all comments and parses JSON. -@@ -30,7 +32,10 @@ exports.readJson = readJson; - * @param options Optional JSON Serialize Options - */ - function writeJson(tree, path, value, options) { -- const serialized = (0, json_1.serializeJson)(value, options); -+ // const serialized = (0, json_1.serializeJson)(value, options); -+ // tree.write(path, `${serialized}\n`); -+ const indent = options?.indent ?? detectIndent_1(tree.read(path, 'utf-8')).indent; -+ const serialized = (0, json_1.serializeJson)(value, { ...options, indent }); - tree.write(path, `${serialized}\n`); - } - exports.writeJson = writeJson; -diff --git a/node_modules/nx/src/utils/json.js b/node_modules/nx/src/utils/json.js -index 9ea1345..0a51412 100644 ---- a/node_modules/nx/src/utils/json.js -+++ b/node_modules/nx/src/utils/json.js -@@ -57,6 +57,7 @@ function formatParseError(input, parseError) { - * @returns the formatted JSON representation of the object - */ - function serializeJson(input, options) { -- return JSON.stringify(input, null, options?.spaces ?? 2); -+ // return JSON.stringify(input, null, options?.spaces ?? 2); -+ return JSON.stringify(input, null, options?.indent ?? 2); - } - exports.serializeJson = serializeJson; diff --git a/patches/nx+19.3.2.patch b/patches/nx+19.3.2.patch index 83fdfbf9..331d7f33 100644 --- a/patches/nx+19.3.2.patch +++ b/patches/nx+19.3.2.patch @@ -1,6 +1,3 @@ -diff --git a/node_modules/nx/bin/nx-cloud.js b/node_modules/nx/bin/nx-cloud.js -old mode 100755 -new mode 100644 diff --git a/node_modules/nx/src/command-line/release/changelog.js b/node_modules/nx/src/command-line/release/changelog.js index 13e2e34..5dc0610 100644 --- a/node_modules/nx/src/command-line/release/changelog.js @@ -13,6 +10,20 @@ index 13e2e34..5dc0610 100644 } const { fileMap } = await (0, file_map_utils_1.createFileMapUsingProjectGraph)(projectGraph); const fileToProjectMap = createFileToProjectMap(fileMap.projectFileMap); +diff --git a/node_modules/nx/src/command-line/release/utils/git.js b/node_modules/nx/src/command-line/release/utils/git.js +index c5c7d90..bb882ad 100644 +--- a/node_modules/nx/src/command-line/release/utils/git.js ++++ b/node_modules/nx/src/command-line/release/utils/git.js +@@ -281,7 +281,8 @@ function parseConventionalCommitsMessage(message) { + exports.parseConventionalCommitsMessage = parseConventionalCommitsMessage; + // https://www.conventionalcommits.org/en/v1.0.0/ + // https://regex101.com/r/FSfNvA/1 +-const ConventionalCommitRegex = /(?[a-z]+)(\((?.+)\))?(?!)?: (?.+)/i; ++// const ConventionalCommitRegex = /(?[a-z]+)(\((?.+)\))?(?!)?: (?.+)/i; ++const ConventionalCommitRegex = /(?[a-z]+)(\((?.*)\))?(?!)?: (?.+)/i; + const CoAuthoredByRegex = /co-authored-by:\s*(?.+)(<(?.+)>)/gim; + const PullRequestRE = /\([ a-z]*(#\d+)\s*\)/gm; + const IssueRE = /(#\d+)/gm; diff --git a/node_modules/nx/src/command-line/release/utils/shared.js b/node_modules/nx/src/command-line/release/utils/shared.js index e08aff8..de3cdc7 100644 --- a/node_modules/nx/src/command-line/release/utils/shared.js diff --git a/projects/core/CHANGELOG.md b/projects/core/CHANGELOG.md index 77c35338..6cc3153e 100644 --- a/projects/core/CHANGELOG.md +++ b/projects/core/CHANGELOG.md @@ -1,3 +1,13 @@ +## 1.1.7 (2024-07-05) + +### 🐛 Fixes + +- theming ([79feb6e](https://github.com/DSI-HUG/ngx-components/commit/79feb6e)) + +### ❤️ Thank You + +- Serge + ## 1.1.5 (2024-06-24) ### 🐛 Fixes diff --git a/projects/core/package.json b/projects/core/package.json index 2a65f782..25e56a58 100644 --- a/projects/core/package.json +++ b/projects/core/package.json @@ -1,6 +1,6 @@ { "name": "@hug/ngx-core", - "version": "1.1.6", + "version": "1.1.7", "description": "HUG Angular - the core framework", "homepage": "https://github.com/dsi-hug/ngx-components", "license": "GPL-3.0-only", @@ -46,8 +46,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 ddbd66a1..855673cd 100644 --- a/projects/layout/package.json +++ b/projects/layout/package.json @@ -31,15 +31,15 @@ "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", "@angular/core": ">= 14", "@angular/cdk": ">= 14", "@angular/material": ">= 14", - "@hug/ngx-core": "1.1.6", + "@hug/ngx-core": "1.1.7", "@hug/ngx-sidenav": "1.1.1" }, "dependencies": { 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/CHANGELOG.md b/projects/message-box-dialog/CHANGELOG.md index 26a80130..d75d29b6 100644 --- a/projects/message-box-dialog/CHANGELOG.md +++ b/projects/message-box-dialog/CHANGELOG.md @@ -1,3 +1,18 @@ +## 1.1.3 (2024-07-05) + +### 🐛 Fixes + +- theming ([79feb6e](https://github.com/DSI-HUG/ngx-components/commit/79feb6e)) + +### 🌱 Dependencies + +- **@hug/ngx-core:** upgrade to v1.1.7 ([b0f15b9](https://github.com/DSI-HUG/ngx-components/commit/b0f15b9)) + +### ❤️ Thank You + +- dsi-hug-bot @dsi-hug-bot +- Serge + ## 1.1.1 (2024-07-01) ### 🐛 Fixes diff --git a/projects/message-box-dialog/package.json b/projects/message-box-dialog/package.json index 4d1f9b07..78b1cdd2 100644 --- a/projects/message-box-dialog/package.json +++ b/projects/message-box-dialog/package.json @@ -1,6 +1,6 @@ { "name": "@hug/ngx-message-box-dialog", - "version": "1.1.2", + "version": "1.1.3", "description": "HUG Angular - message-box-dialog component", "homepage": "https://github.com/dsi-hug/ngx-components", "license": "GPL-3.0-only", @@ -31,15 +31,15 @@ "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", "@angular/core": ">= 14", "@angular/material": ">= 14", "rxjs": ">= 7.0.0", - "@hug/ngx-core": "1.1.6" + "@hug/ngx-core": "1.1.7" }, "dependencies": { "tslib": "^2.6.3" 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..900c6579 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", @@ -40,7 +40,7 @@ "@angular/cdk": ">= 14", "@angular/material": ">= 14", "rxjs": ">= 7.0.0", - "@hug/ngx-core": "1.1.6" + "@hug/ngx-core": "1.1.7" }, "dependencies": { "tslib": "^2.6.3" diff --git a/projects/overlay/CHANGELOG.md b/projects/overlay/CHANGELOG.md index b0fdd276..ce4485f2 100644 --- a/projects/overlay/CHANGELOG.md +++ b/projects/overlay/CHANGELOG.md @@ -1,3 +1,18 @@ +## 1.1.3 (2024-07-05) + +### 🐛 Fixes + +- overlay-demo.component and add demo ([c8ac2b4](https://github.com/DSI-HUG/ngx-components/commit/c8ac2b4)) + +### 🌱 Dependencies + +- **@hug/ngx-core:** upgrade to v1.1.7 ([b0f15b9](https://github.com/DSI-HUG/ngx-components/commit/b0f15b9)) + +### ❤️ Thank You + +- dsi-hug-bot @dsi-hug-bot +- Serge + ## 1.1.1 (2024-06-24) ### 🐛 Fixes diff --git a/projects/overlay/package.json b/projects/overlay/package.json index c319d89a..21941d15 100644 --- a/projects/overlay/package.json +++ b/projects/overlay/package.json @@ -26,15 +26,15 @@ "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", "@angular/core": ">= 14", "@angular/cdk": ">= 14", "rxjs": ">= 7.0.0", - "@hug/ngx-core": "1.1.6" + "@hug/ngx-core": "1.1.7" }, "dependencies": { "tslib": "^2.6.3" diff --git a/projects/search-container/CHANGELOG.md b/projects/search-container/CHANGELOG.md index fc4551e5..4bcf4017 100644 --- a/projects/search-container/CHANGELOG.md +++ b/projects/search-container/CHANGELOG.md @@ -1,3 +1,18 @@ +## 1.1.2 (2024-07-05) + +### 🐛 Fixes + +- theming ([79feb6e](https://github.com/DSI-HUG/ngx-components/commit/79feb6e)) + +### 🌱 Dependencies + +- **@hug/ngx-core:** upgrade to v1.1.7 ([b0f15b9](https://github.com/DSI-HUG/ngx-components/commit/b0f15b9)) + +### ❤️ Thank You + +- dsi-hug-bot @dsi-hug-bot +- Serge + ## 1.1.0 (2024-06-26) ### 🚀 Features diff --git a/projects/search-container/package.json b/projects/search-container/package.json index b4921868..6ac1357b 100644 --- a/projects/search-container/package.json +++ b/projects/search-container/package.json @@ -1,6 +1,6 @@ { "name": "@hug/ngx-search-container", - "version": "1.1.1", + "version": "1.1.2", "description": "HUG Angular - search-container component", "homepage": "https://github.com/dsi-hug/ngx-components", "license": "GPL-3.0-only", @@ -31,8 +31,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", @@ -40,7 +40,7 @@ "@angular/forms": ">= 14", "@angular/material": ">= 14", "rxjs": ">= 7.0.0", - "@hug/ngx-core": "1.1.6" + "@hug/ngx-core": "1.1.7" }, "dependencies": { "tslib": "^2.6.3" diff --git a/projects/sidenav/package.json b/projects/sidenav/package.json index edcbea99..89273552 100644 --- a/projects/sidenav/package.json +++ b/projects/sidenav/package.json @@ -31,14 +31,14 @@ "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", "@angular/core": ">= 14", "rxjs": ">= 7.0.0", - "@hug/ngx-core": "1.1.6" + "@hug/ngx-core": "1.1.7" }, "dependencies": { "tslib": "^2.6.3" diff --git a/projects/snackbar/package.json b/projects/snackbar/package.json index ad45ca3e..6e464074 100644 --- a/projects/snackbar/package.json +++ b/projects/snackbar/package.json @@ -26,14 +26,14 @@ "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", "@angular/core": ">= 14", "rxjs": ">= 7.0.0", - "@hug/ngx-core": "1.1.6" + "@hug/ngx-core": "1.1.7" }, "dependencies": { "tslib": "^2.6.3" diff --git a/projects/splitter/CHANGELOG.md b/projects/splitter/CHANGELOG.md index afe14ed6..a5c386b5 100644 --- a/projects/splitter/CHANGELOG.md +++ b/projects/splitter/CHANGELOG.md @@ -1,3 +1,18 @@ +## 1.1.3 (2024-07-05) + +### 🐛 Fixes + +- splitter standalone ([7befe8d](https://github.com/DSI-HUG/ngx-components/commit/7befe8d)) + +### 🌱 Dependencies + +- **@hug/ngx-core:** upgrade to v1.1.7 ([b0f15b9](https://github.com/DSI-HUG/ngx-components/commit/b0f15b9)) + +### ❤️ Thank You + +- dsi-hug-bot @dsi-hug-bot +- Serge + ## 1.1.1 (2024-06-24) ### 🐛 Fixes diff --git a/projects/splitter/package.json b/projects/splitter/package.json index b9f6dce0..470d7896 100644 --- a/projects/splitter/package.json +++ b/projects/splitter/package.json @@ -1,6 +1,6 @@ { "name": "@hug/ngx-splitter", - "version": "1.1.2", + "version": "1.1.3", "description": "HUG Angular - splitter component", "homepage": "https://github.com/dsi-hug/ngx-components", "license": "GPL-3.0-only", @@ -31,15 +31,15 @@ "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", "@angular/core": ">= 14", "@angular/cdk": ">= 14", "rxjs": ">= 7.0.0", - "@hug/ngx-core": "1.1.6" + "@hug/ngx-core": "1.1.7" }, "dependencies": { "tslib": "^2.6.3" diff --git a/projects/status/package.json b/projects/status/package.json index f29845f2..c40827f2 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", @@ -40,7 +40,7 @@ "@angular/cdk": ">= 14", "@angular/material": ">= 14", "rxjs": ">= 7.0.0", - "@hug/ngx-core": "1.1.6", + "@hug/ngx-core": "1.1.7", "@hug/ngx-snackbar": "1.1.2", "@hug/ngx-message-box": "1.1.2" }, diff --git a/projects/time-picker/package.json b/projects/time-picker/package.json index 3e195931..292eb401 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", @@ -37,7 +37,7 @@ "@angular/material": ">= 14", "rxjs": ">= 7.0.0", "date-fns": "^2.30.0", - "@hug/ngx-core": "1.1.6", + "@hug/ngx-core": "1.1.7", "@hug/ngx-numeric-stepper": "1.1.3" }, "dependencies": { diff --git a/projects/tooltip/package.json b/projects/tooltip/package.json index 8815a561..21b9f591 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", @@ -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", @@ -36,7 +36,7 @@ "@angular/material": ">= 14", "rxjs": ">= 7.0.0", "lodash-es": "^4.17.21", - "@hug/ngx-core": "1.1.6" + "@hug/ngx-core": "1.1.7" }, "dependencies": { "tslib": "^2.6.3" diff --git a/projects/user-card/package.json b/projects/user-card/package.json index 227a74fe..bc503c99 100644 --- a/projects/user-card/package.json +++ b/projects/user-card/package.json @@ -31,8 +31,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 e1a67ec7..72064567 100644 --- a/projects/user-tooltip/package.json +++ b/projects/user-tooltip/package.json @@ -26,15 +26,15 @@ "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", "@angular/core": ">= 14", "@angular/material": ">= 14", - "@hug/ngx-core": "1.1.6", - "@hug/ngx-tooltip": "1.1.4", + "@hug/ngx-core": "1.1.7", + "@hug/ngx-tooltip": "1.1.2", "@hug/ngx-user-card": "1.1.1" }, "dependencies": { diff --git a/scripts/release.ts b/scripts/release.ts new file mode 100644 index 00000000..8e165c90 --- /dev/null +++ b/scripts/release.ts @@ -0,0 +1,262 @@ +/* eslint-disable @typescript-eslint/naming-convention, no-loops/no-loops, camelcase */ + +import chalk from 'chalk'; +import { spawnSync } 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 exec = (message: string | undefined, cmd: string, args: string[]): void => { + if (message) { + console.log(message); + } + if (options.verbose) { + console.log(`\n${cmd} ${args.join(' ')}`); + } + if (!options.dryRun) { + const result = spawnSync(cmd, args, { stdio: 'inherit', cwd: workspaceRoot }); + if (result.error) { + throw result.error; + } + if (result.status !== 0) { + throw new Error(`Command failed with exit code ${result.status}`); + } + } + }; + + 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 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] + ); + 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` does not update package-lock file correctly. + * + * TODO: remove this script if one day this feature is supported by `nx release` directly + * @see https://github.com/nrwl/nx/issues/26660 + * + * 14. Synchronize `package-lock.json` file + */ + console.log(`\n${bgBlue(' HUG ')} ${blue('Synchronizing npm lock file')}${options.dryRun ? yellow(' [dry-run]') : ''}`); + exec(undefined, 'npm', ['install']); + exec(undefined, 'git', ['add', 'package.json', 'package-lock.json']); + exec(undefined, 'git', ['commit', '--message', 'chore: synchronize package.json and package-lock.json', '--message', '[skip ci]']); + exec(undefined, 'git', ['push', '--follow-tags', '--no-verify', '--atomic']); + + /** + * 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 + * + * 15. 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.version = 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. + * + * 16. Publish to npm + */ + let processStatus = 0; + if (!options.dryRun) { + 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 9d0fa9f2..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')); - } -})();