From d2e87f9a91e223de49ed51ed44eeecf16ca8c82e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Nov 2021 08:27:33 -0600 Subject: [PATCH 1/9] chore(deps-dev): bump @types/node from 16.11.0 to 16.11.8 (#242) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.0 to 16.11.8. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 941c4f15..9cb49031 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "@types/inquirer": "^8.1.3", "@types/is-ci": "^3.0.0", "@types/jest": "27.0.2", - "@types/node": "16.11.0", + "@types/node": "16.11.8", "@types/react": "17", "@types/rimraf": "^3.0.2", "@types/tmp": "^0.2.1", diff --git a/yarn.lock b/yarn.lock index 1789371d..888cef71 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2996,15 +2996,10 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/node@*": - version "16.11.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.2.tgz#31c249c136c3f9b35d4b60fb8e50e01a1f0cc9a5" - integrity sha512-w34LtBB0OkDTs19FQHXy4Ig/TOXI4zqvXS2Kk1PAsRKZ0I+nik7LlMYxckW0tSNGtvWmzB+mrCTbuEjuB9DVsw== - -"@types/node@16.11.0": - version "16.11.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.0.tgz#4b95f2327bacd1ef8f08d8ceda193039c5d7f52e" - integrity sha512-8MLkBIYQMuhRBQzGN9875bYsOhPnf/0rgXGo66S2FemHkhbn9qtsz9ywV1iCG+vbjigE4WUNVvw37Dx+L0qsPg== +"@types/node@*", "@types/node@16.11.8": + version "16.11.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.8.tgz#a1aeb23f0aa33cb111e64ccaa1687b2ae0423b69" + integrity sha512-hmT5gfpRkkHr7DZZHMf3jBe/zNcVGN+jXSL2f8nAsYfBPxQFToKwQlS/zES4Sjp488Bi73i+p6bvrNRRGU0x9Q== "@types/node@^15.0.1": version "15.14.9" From 885e5823ab98650ebc483464f93bafd266a35385 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 19 Nov 2021 09:29:49 -0600 Subject: [PATCH 2/9] chore(deps): bump several dependencies Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions --- package.json | 8 ++++---- yarn.lock | 48 ++++++++++++++++++++++++------------------------ 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 9cb49031..5e6451f0 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "@semantic-release/changelog": "^6.0.0", "@semantic-release/commit-analyzer": "^9.0.1", "@semantic-release/exec": "^6.0.1", - "@semantic-release/git": "^10.0.0", + "@semantic-release/git": "^10.0.1", "@semantic-release/release-notes-generator": "^10.0.2", "@types/fs-extra": "^9.0.13", "@types/inquirer": "^8.1.3", @@ -84,7 +84,7 @@ "@types/node": "16.11.8", "@types/react": "17", "@types/rimraf": "^3.0.2", - "@types/tmp": "^0.2.1", + "@types/tmp": "^0.2.2", "@types/yargs-parser": "^20.2.1", "@typescript-eslint/eslint-plugin": "4.33.0", "@typescript-eslint/parser": "4.33.0", @@ -92,12 +92,12 @@ "eslint-config-prettier": "8.3.0", "fs-extra": "^10.0.0", "husky": "^7.0.2", - "jest": "27.2.5", + "jest": "27.3.1", "lint-staged": "^11.2.3", "prettier": "2.4.1", "run-p": "*", "semantic-release": "^18.0.0", - "ts-jest": "27.0.6", + "ts-jest": "27.0.7", "ts-node": "~10.3.0", "tslib": "^2.3.1", "typescript": "4.4.4", diff --git a/yarn.lock b/yarn.lock index 888cef71..b375d964 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1815,7 +1815,7 @@ jest-util "^27.3.1" slash "^3.0.0" -"@jest/core@^27.2.5", "@jest/core@^27.3.1": +"@jest/core@^27.3.1": version "27.3.1" resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.3.1.tgz#04992ef1b58b17c459afb87ab56d81e63d386925" integrity sha512-DMNE90RR5QKx0EA+wqe3/TNEwiRpOkhshKNxtLxd4rt3IZpCt+RSL+FoJsGeblRZmqdK4upHA/mKKGPPRAifhg== @@ -2397,9 +2397,9 @@ yargs-parser "20.0.0" "@nx-dotnet/nxdoc@latest": - version "1.5.2" - resolved "https://registry.yarnpkg.com/@nx-dotnet/nxdoc/-/nxdoc-1.5.2.tgz#65c7dc7608846ec4411ad0db377b78afb723c9ff" - integrity sha512-oPiF4dTa4/OhyRrWM6i+qeHiKdQRwkkQVZjLkrdopAFTbzBz5EbNiaN+oAHRrj6c4+LEB17214EYfy29SWwDCw== + version "1.6.0" + resolved "https://registry.yarnpkg.com/@nx-dotnet/nxdoc/-/nxdoc-1.6.0.tgz#dd82b6dc066a77a8ee3703455a0ca6a3d87cef86" + integrity sha512-M3kYbjxd/Sqi/dBOmXM37e4NRJqnGDZwxXS3lS5gvADqvJWwIN4K9x/kYjuZ+hxrjbj2dfaAO/kNMdiM599c7A== "@nx-plus/docusaurus@^12.2.0": version "12.2.0" @@ -2571,12 +2571,12 @@ lodash "^4.17.4" parse-json "^5.0.0" -"@semantic-release/git@^10.0.0": - version "10.0.0" - resolved "https://registry.yarnpkg.com/@semantic-release/git/-/git-10.0.0.tgz#41dda434e9c2fe222d030f12060e6f5a8696e7ba" - integrity sha512-/BljvngXJzwbFFJouxHHvSzAhi5iaucF7l0kQPszD4m7Y79+FHyvQl5Q/HK7T/e8MIwU9hz321KjOZn9yfSpPg== +"@semantic-release/git@^10.0.1": + version "10.0.1" + resolved "https://registry.yarnpkg.com/@semantic-release/git/-/git-10.0.1.tgz#c646e55d67fae623875bf3a06a634dd434904498" + integrity sha512-eWrx5KguUcU2wUPaO6sfvZI0wPafUKAMNC18aXY4EnNcrZL86dEmpNVnC9uMpGZkmZJ9EfCVJBQx4pV4EMGT1w== dependencies: - "@semantic-release/error" "^2.1.0" + "@semantic-release/error" "^3.0.0" aggregate-error "^3.0.0" debug "^4.0.0" dir-glob "^3.0.0" @@ -3087,10 +3087,10 @@ dependencies: "@types/node" "*" -"@types/tmp@^0.2.1": - version "0.2.1" - resolved "https://registry.yarnpkg.com/@types/tmp/-/tmp-0.2.1.tgz#83ecf4ec22a8c218c71db25f316619fe5b986011" - integrity sha512-7cTXwKP/HLOPVgjg+YhBdQ7bMiobGMuoBmrGmqwIWJv8elC6t1DfVc/mn4fD9UE1IjhwmhaQ5pGVXkmXbH0rhg== +"@types/tmp@^0.2.2": + version "0.2.2" + resolved "https://registry.yarnpkg.com/@types/tmp/-/tmp-0.2.2.tgz#424537a3b91828cb26aaf697f21ae3cd1b69f7e7" + integrity sha512-MhSa0yylXtVMsyT8qFpHA1DLHj4DvQGH5ntxrhHSh8PxUVNi35Wk+P5hVgqbO2qZqOotqr9jaoPRL+iRjWYm/A== "@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3": version "2.0.6" @@ -8422,7 +8422,7 @@ jest-circus@^27.2.2, jest-circus@^27.3.1: stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.2.5: +jest-cli@^27.3.1: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.3.1.tgz#b576f9d146ba6643ce0a162d782b40152b6b1d16" integrity sha512-WHnCqpfK+6EvT62me6WVs8NhtbjAS4/6vZJnk7/2+oOr50cwAzG4Wxt6RXX0hu6m1169ZGMlhYYUNeKBXCph/Q== @@ -8844,14 +8844,14 @@ jest-worker@^27.0.2, jest-worker@^27.0.6, jest-worker@^27.2.2, jest-worker@^27.3 merge-stream "^2.0.0" supports-color "^8.0.0" -jest@27.2.5: - version "27.2.5" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.2.5.tgz#7d8a5c8781a160f693beeb7c68e46c16ef948148" - integrity sha512-vDMzXcpQN4Ycaqu+vO7LX8pZwNNoKMhc+gSp6q1D8S6ftRk8gNW8cni3YFxknP95jxzQo23Lul0BI2FrWgnwYQ== +jest@27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.3.1.tgz#b5bab64e8f56b6f7e275ba1836898b0d9f1e5c8a" + integrity sha512-U2AX0AgQGd5EzMsiZpYt8HyZ+nSVIh5ujQ9CPp9EQZJMjXIiSZpJNweZl0swatKRoqHWgGKM3zaSwm4Zaz87ng== dependencies: - "@jest/core" "^27.2.5" + "@jest/core" "^27.3.1" import-local "^3.0.2" - jest-cli "^27.2.5" + jest-cli "^27.3.1" joi@^17.4.0, joi@^17.4.2: version "17.4.2" @@ -13913,10 +13913,10 @@ ts-essentials@^2.0.3: resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-2.0.12.tgz#c9303f3d74f75fa7528c3d49b80e089ab09d8745" integrity sha512-3IVX4nI6B5cc31/GFFE+i8ey/N2eA0CZDbo6n0yrz0zDX8ZJ8djmU1p+XRz7G3is0F3bB3pu2pAroFdAWQKU3w== -ts-jest@27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.0.6.tgz#9960dbbdb33792b79c5ee24d1c62514fd7b60052" - integrity sha512-XWkEBbrkyUWJdK9FwiCVdBZ7ZmT7sxcKtyVEZNmo7u8eQw6NHmtYEM2WpkX9VfnRI0DjSr6INfEHC9vCFhsFnQ== +ts-jest@27.0.7: + version "27.0.7" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.0.7.tgz#fb7c8c8cb5526ab371bc1b23d06e745652cca2d0" + integrity sha512-O41shibMqzdafpuP+CkrOL7ykbmLh+FqQrXEmV9CydQ5JBk0Sj0uAEF5TNNe94fZWKm3yYvWa/IbyV4Yg1zK2Q== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" From a1384197ee5847453720404cb855f024f792aa53 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 27 Nov 2021 11:57:45 -0600 Subject: [PATCH 3/9] chore(deps): bump @types/node from 16.11.8 to 16.11.10 (#250) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 5e6451f0..bad4733b 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "@types/inquirer": "^8.1.3", "@types/is-ci": "^3.0.0", "@types/jest": "27.0.2", - "@types/node": "16.11.8", + "@types/node": "16.11.10", "@types/react": "17", "@types/rimraf": "^3.0.2", "@types/tmp": "^0.2.2", diff --git a/yarn.lock b/yarn.lock index b375d964..490ffe7d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2996,10 +2996,10 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/node@*", "@types/node@16.11.8": - version "16.11.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.8.tgz#a1aeb23f0aa33cb111e64ccaa1687b2ae0423b69" - integrity sha512-hmT5gfpRkkHr7DZZHMf3jBe/zNcVGN+jXSL2f8nAsYfBPxQFToKwQlS/zES4Sjp488Bi73i+p6bvrNRRGU0x9Q== +"@types/node@*", "@types/node@16.11.10": + version "16.11.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.10.tgz#2e3ad0a680d96367103d3e670d41c2fed3da61ae" + integrity sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA== "@types/node@^15.0.1": version "15.14.9" From e8f1f7dc6de029e5bf2c9a9c06fcf0e6372e0fc8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 27 Nov 2021 12:37:44 -0600 Subject: [PATCH 4/9] chore(deps): Combined PR for dependabot updates (#252) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions --- package.json | 10 ++--- yarn.lock | 108 +++++++++++++++++++++++++++------------------------ 2 files changed, 62 insertions(+), 56 deletions(-) diff --git a/package.json b/package.json index bad4733b..d05d42b2 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ }, "devDependencies": { "@commitlint/cli": "^13.2.1", - "@commitlint/config-conventional": "^13.2.0", + "@commitlint/config-conventional": "^15.0.0", "@commitlint/types": "^13.2.0", "@nrwl/cli": "13.0.1", "@nrwl/devkit": "13.0.1", @@ -66,13 +66,13 @@ "@nrwl/jest": "13.0.1", "@nrwl/linter": "13.0.1", "@nrwl/node": "13.0.1", - "@nrwl/nx-cloud": "12.5.0", + "@nrwl/nx-cloud": "12.5.4", "@nrwl/nx-plugin": "13.0.1", "@nrwl/tao": "13.0.1", "@nrwl/workspace": "13.0.1", "@nx-dotnet/nxdoc": "latest", "@nx-plus/docusaurus": "^12.2.0", - "@semantic-release/changelog": "^6.0.0", + "@semantic-release/changelog": "^6.0.1", "@semantic-release/commit-analyzer": "^9.0.1", "@semantic-release/exec": "^6.0.1", "@semantic-release/git": "^10.0.1", @@ -80,7 +80,7 @@ "@types/fs-extra": "^9.0.13", "@types/inquirer": "^8.1.3", "@types/is-ci": "^3.0.0", - "@types/jest": "27.0.2", + "@types/jest": "27.0.3", "@types/node": "16.11.10", "@types/react": "17", "@types/rimraf": "^3.0.2", @@ -101,7 +101,7 @@ "ts-node": "~10.3.0", "tslib": "^2.3.1", "typescript": "4.4.4", - "verdaccio": "^5.1.6" + "verdaccio": "^5.2.2" }, "lint-staged": { "**/*.{js,ts,md,json}": [ diff --git a/yarn.lock b/yarn.lock index 490ffe7d..740b467a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1215,10 +1215,10 @@ resolve-global "1.0.0" yargs "^17.0.0" -"@commitlint/config-conventional@^13.2.0": - version "13.2.0" - resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-13.2.0.tgz#2ad24fecc56ae9619dbe0934b98a98b18ace0bec" - integrity sha512-7u7DdOiF+3qSdDlbQGfpvCH8DCQdLFvnI2+VucYmmV7E92iD6t9PBj+UjIoSQCaMAzYp27Vkall78AkcXBh6Xw== +"@commitlint/config-conventional@^15.0.0": + version "15.0.0" + resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-15.0.0.tgz#3bf1adf319e3b431de12ba82dc399524038b2d8f" + integrity sha512-eZBRL8Lk3hMNHp1wUMYj0qrZQEsST1ai7KHR8J1IDD9aHgT7L2giciibuQ+Og7vxVhR5WtYDvh9xirXFVPaSkQ== dependencies: conventional-changelog-conventionalcommits "^4.3.1" @@ -2322,10 +2322,10 @@ webpack-merge "^5.8.0" webpack-node-externals "^3.0.0" -"@nrwl/nx-cloud@12.5.0": - version "12.5.0" - resolved "https://registry.yarnpkg.com/@nrwl/nx-cloud/-/nx-cloud-12.5.0.tgz#a24d347d99a6d41242f28d649647c118cd0dafbb" - integrity sha512-3WhuYYNW9L4xFCdCTWBlJUN0CoWMAYpfY1tnLM/ZVgW2Akv9jLgXKbCKV+cO0xqglSy+eMokwwQnB9PxF35aYQ== +"@nrwl/nx-cloud@12.5.4": + version "12.5.4" + resolved "https://registry.yarnpkg.com/@nrwl/nx-cloud/-/nx-cloud-12.5.4.tgz#496ed99208664318607d0ae6b3ad273bf64b38c9" + integrity sha512-FHNTF0S1dMPddDstY6MUjZ30f99wVnZ46Q8r5plASxBPUvPAqPI8TRYzYTcPSAcf7s5NB3lAnLXw0wvN+8+4Ig== dependencies: axios "^0.21.1" chalk "4.1.0" @@ -2526,12 +2526,12 @@ resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== -"@semantic-release/changelog@^6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@semantic-release/changelog/-/changelog-6.0.0.tgz#b16636009bfbde9c09c6c1b89463af257d4a7142" - integrity sha512-X01Me+QVMykvILockNGlXXl3dgr1QqpbRQsknQoOJQCXQGXoqY3DNQ3rBQuI8/SUK7RZwYLctg0NbPNArlo6eQ== +"@semantic-release/changelog@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@semantic-release/changelog/-/changelog-6.0.1.tgz#8dd0334fd8c7d50cda747d2591e4f18f816b3c9c" + integrity sha512-FT+tAGdWHr0RCM3EpWegWnvXJ05LQtBkQUaQRIExONoXjVjLuOILNm4DEKNaV+GAQyJjbLRVs57ti//GypH6PA== dependencies: - "@semantic-release/error" "^2.1.0" + "@semantic-release/error" "^3.0.0" aggregate-error "^3.0.0" fs-extra "^9.0.0" lodash "^4.17.4" @@ -2961,10 +2961,10 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@27.0.2": - version "27.0.2" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.2.tgz#ac383c4d4aaddd29bbf2b916d8d105c304a5fcd7" - integrity sha512-4dRxkS/AFX0c5XW6IPMNOydLn2tEhNhJV7DnYK+0bjoJZ+QTmfucBlihX7aoEsh/ocYtkLC73UbnBXBXIxsULA== +"@types/jest@27.0.3": + version "27.0.3" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.3.tgz#0cf9dfe9009e467f70a342f0f94ead19842a783a" + integrity sha512-cmmwv9t7gBYt7hNKH5Spu7Kuu/DotGa+Ff+JGRKZ4db5eh8PnKS4LuebJ3YLUoyOyIHraTGyULn23YtEAm0VSg== dependencies: jest-diff "^27.0.0" pretty-format "^27.0.0" @@ -3833,10 +3833,10 @@ async@3.2.0: resolved "https://registry.yarnpkg.com/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720" integrity sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw== -async@3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.1.tgz#d3274ec66d107a47476a4c49136aacdb00665fc8" - integrity sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg== +async@3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/async/-/async-3.2.2.tgz#2eb7671034bb2194d45d30e31e24ec7e7f9670cd" + integrity sha512-H0E+qZaDEfx/FY4t7iLRv1W2fFI6+pyCeTw1uN20AQPiwqwM6ojPxHxdLv4z8hi2DtnW9BOckSspLucW7pIE5g== async@^2.6.2: version "2.6.3" @@ -4633,10 +4633,10 @@ cli-width@^3.0.0: resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== -clipanion@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/clipanion/-/clipanion-3.0.1.tgz#cba44989fa18a625d7d02800ea98c835e973fc26" - integrity sha512-/ujK3YJ1MGjGr18w99Gl9XZjy4xcC/5bZRJXsgvYG6GbUTO4CTKriC+oUxDbo8G+G/dxDqSJhm8QIDnK6iH6Ig== +clipanion@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/clipanion/-/clipanion-3.1.0.tgz#3e217dd6476bb9236638b07eb4673f7309839819" + integrity sha512-v025Hz+IDQ15FpOyK8p02h5bFznMu6rLFsJSyOPR+7WrbSnZ1Ek6pblPukV7K5tC/dsWfncQPIrJ4iUy2PXkbw== dependencies: typanion "^3.3.1" @@ -5375,10 +5375,10 @@ dateformat@^3.0.0: resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== -dayjs@1.10.6: - version "1.10.6" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.6.tgz#288b2aa82f2d8418a6c9d4df5898c0737ad02a63" - integrity sha512-AztC/IOW4L1Q41A86phW5Thhcrco3xuAA+YX/BLpLWWjRcTj5TOt/QImBLmCKlrF7u7k47arTnOyL6GnbG8Hvw== +dayjs@1.10.7: + version "1.10.7" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.7.tgz#2cf5f91add28116748440866a0a1d26f3a6ce468" + integrity sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig== debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.9: version "2.6.9" @@ -6460,6 +6460,11 @@ fastest-levenshtein@^1.0.12: resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2" integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow== +fastify-warning@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/fastify-warning/-/fastify-warning-0.2.0.tgz#e717776026a4493dc9a2befa44db6d17f618008f" + integrity sha512-s1EQguBw/9qtc1p/WTY4eq9WMRIACkj+HTcOIK1in4MV5aFaQC9ZCIt0dJ7pr5bIf4lPpHvAtP2ywpTNgs7hqw== + fastq@^1.6.0: version "1.13.0" resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" @@ -9943,10 +9948,10 @@ mime@1.6.0: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -mime@2.5.2, mime@^2.3.1, mime@^2.4.3, mime@^2.4.4: - version "2.5.2" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe" - integrity sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg== +mime@2.6.0, mime@^2.3.1, mime@^2.4.3, mime@^2.4.4: + version "2.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" + integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== mimic-fn@^2.1.0: version "2.1.0" @@ -11160,13 +11165,14 @@ pino-std-serializers@^3.1.0: resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-3.2.0.tgz#b56487c402d882eb96cd67c257868016b61ad671" integrity sha512-EqX4pwDPrt3MuOAAUBMU0Tk5kR/YcCM5fNPEzgCO2zJ5HfX0vbiH9HbJglnyeQsN96Kznae6MWD47pZB5avTrg== -pino@6.13.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/pino/-/pino-6.13.0.tgz#41810b9be213af6f8f7c23a1b17058d880267e7b" - integrity sha512-mRXSTfa34tbfrWqCIp1sUpZLqBhcoaGapoyxfEwaWwJGMpLijlRdDKIQUyvq4M3DUfFH5vEglwSw8POZYwbThA== +pino@6.13.3: + version "6.13.3" + resolved "https://registry.yarnpkg.com/pino/-/pino-6.13.3.tgz#60b93bcda1541f92fb37b3f2be0a25cf1d05b6fe" + integrity sha512-tJy6qVgkh9MwNgqX1/oYi3ehfl2Y9H0uHyEEMsBe74KinESIjdMrMQDWpcZPpPicg3VV35d/GLQZmo4QgU2Xkg== dependencies: fast-redact "^3.0.0" fast-safe-stringify "^2.0.8" + fastify-warning "^0.2.0" flatstr "^1.0.12" pino-std-serializers "^3.1.0" quick-format-unescaped "^4.0.3" @@ -14489,10 +14495,10 @@ validate-npm-package-name@^3.0.0, validate-npm-package-name@~3.0.0: dependencies: builtins "^1.0.3" -validator@13.6.0: - version "13.6.0" - resolved "https://registry.yarnpkg.com/validator/-/validator-13.6.0.tgz#1e71899c14cdc7b2068463cb24c1cc16f6ec7059" - integrity sha512-gVgKbdbHgtxpRyR8K0O6oFZPhhB5tT1jeEHZR0Znr9Svg03U0+r9DXWMrnRAB+HtCStDQKlaIZm42tVsVjqtjg== +validator@13.7.0: + version "13.7.0" + resolved "https://registry.yarnpkg.com/validator/-/validator-13.7.0.tgz#4f9658ba13ba8f3d82ee881d3516489ea85c0857" + integrity sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw== value-equal@^1.0.1: version "1.0.1" @@ -14530,10 +14536,10 @@ verdaccio-htpasswd@10.0.0: http-errors "1.8.0" unix-crypt-td-js "1.1.4" -verdaccio@^5.1.6: - version "5.1.6" - resolved "https://registry.yarnpkg.com/verdaccio/-/verdaccio-5.1.6.tgz#309f4a5c2b3cd4679109d8339cdcfa87a9c9e2da" - integrity sha512-/DlhWtgtlfqKKxV6puZigRS6eicqVSXBZoZuG1HL8h+pft7F2bwu0KI1u4XT2fzGw9hp69FFET8OlPLNfYEvwQ== +verdaccio@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/verdaccio/-/verdaccio-5.2.2.tgz#e60c900e2193fa4b934d82934d15e18a6fe06ff9" + integrity sha512-7TbQ2QWDIQBabYMUAJQtJl9qbxpBKl8tndNYtMl9gVUgWN67gr+kPeMoqY0m4whg/+OdWrMyBj3NQy5VoTQiIw== dependencies: "@verdaccio/commons-api" "10.0.1" "@verdaccio/local-storage" "10.0.7" @@ -14541,13 +14547,13 @@ verdaccio@^5.1.6: "@verdaccio/streams" "10.0.0" "@verdaccio/ui-theme" "3.2.1" JSONStream "1.3.5" - async "3.2.1" + async "3.2.2" body-parser "1.19.0" - clipanion "3.0.1" + clipanion "3.1.0" compression "1.7.4" cookies "0.8.0" cors "2.8.5" - dayjs "1.10.6" + dayjs "1.10.7" debug "^4.3.2" envinfo "7.8.1" eslint-import-resolver-node "0.3.4" @@ -14563,17 +14569,17 @@ verdaccio@^5.1.6: lunr-mutable-indexes "2.3.2" marked "2.1.3" memoizee "0.4.15" - mime "2.5.2" + mime "2.6.0" minimatch "3.0.4" mkdirp "1.0.4" mv "2.1.1" - pino "6.13.0" + pino "6.13.3" pkginfo "0.4.1" prettier-bytes "^1.0.4" pretty-ms "^7.0.1" request "2.88.0" semver "7.3.5" - validator "13.6.0" + validator "13.7.0" verdaccio-audit "10.0.2" verdaccio-htpasswd "10.0.0" From bb2622144a8e396ecb8e14309c56110cbec3b059 Mon Sep 17 00:00:00 2001 From: Craigory Coppola Date: Sat, 27 Nov 2021 12:38:49 -0600 Subject: [PATCH 5/9] chore(repo): update combined-prs.yml --- .github/workflows/combine-prs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/combine-prs.yml b/.github/workflows/combine-prs.yml index 6c0d1e2b..5fec6dda 100644 --- a/.github/workflows/combine-prs.yml +++ b/.github/workflows/combine-prs.yml @@ -132,8 +132,8 @@ jobs: await github.pulls.create({ owner: context.repo.owner, repo: context.repo.repo, - title: 'Combined PR', + title: 'chore(deps): Combined PR for dependabot updates', head: '${{ github.event.inputs.combineBranchName }}', base: '${{ steps.fetch-branch-names.outputs.base-branch }}', body: body - }); \ No newline at end of file + }); From 48dc1866a782c214585d0b0939dff0a69faa4ce1 Mon Sep 17 00:00:00 2001 From: AgentEnder Date: Fri, 22 Oct 2021 09:52:26 -0500 Subject: [PATCH 6/9] chore(repo): update smoke tests to ensure latest nx is pulled --- smoke/core/tests/nx-dotnet.spec.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/smoke/core/tests/nx-dotnet.spec.ts b/smoke/core/tests/nx-dotnet.spec.ts index 18c64d44..a762e5d5 100644 --- a/smoke/core/tests/nx-dotnet.spec.ts +++ b/smoke/core/tests/nx-dotnet.spec.ts @@ -24,11 +24,14 @@ describe('nx-dotnet smoke', () => { }); it('should work', async () => { - execSync('npx create-nx-workspace test --preset empty --nxCloud false', { - cwd: smokeDirectory, - env: process.env, - stdio: 'inherit', - }); + execSync( + 'npx create-nx-workspace@latest test --preset empty --nxCloud false', + { + cwd: smokeDirectory, + env: process.env, + stdio: 'inherit', + }, + ); execSync('npm i --save-dev @nx-dotnet/core', execSyncOptions); execSync( `npx nx g @nx-dotnet/core:lib ${testLib} --language C# --template classlib --testTemplate nunit`, From dbff13cbac22ceff821e12b6d59af72f2b0c8918 Mon Sep 17 00:00:00 2001 From: AgentEnder Date: Sat, 27 Nov 2021 12:54:42 -0600 Subject: [PATCH 7/9] chore(repo): update to Nx 13.2.2 --- nx.json | 3 +- package.json | 18 +-- packages/core/tsconfig.lib.json | 2 +- packages/core/tsconfig.spec.json | 4 + packages/dotnet/tsconfig.lib.json | 2 +- packages/dotnet/tsconfig.spec.json | 4 + packages/nx-ghpages/tsconfig.lib.json | 2 +- packages/nx-ghpages/tsconfig.spec.json | 4 + packages/nxdoc/tsconfig.lib.json | 2 +- packages/nxdoc/tsconfig.spec.json | 4 + packages/typescript/tsconfig.lib.json | 2 +- packages/typescript/tsconfig.spec.json | 4 + packages/utils/tsconfig.lib.json | 2 +- packages/utils/tsconfig.spec.json | 4 + smoke/core/tsconfig.spec.json | 2 +- yarn.lock | 147 ++++++++++++++++--------- 16 files changed, 134 insertions(+), 72 deletions(-) diff --git a/nx.json b/nx.json index 634905a4..215666f7 100644 --- a/nx.json +++ b/nx.json @@ -22,7 +22,8 @@ "cacheableOperations": ["build", "lint", "test", "e2e"], "accessToken": "ZTMwZjcyY2ItZWRjYS00NzZjLTg3ZmQtYzdjM2Y3OGIzNDdhfHJlYWQtd3JpdGU=", "canTrackAnalytics": false, - "showUsageWarnings": true + "showUsageWarnings": true, + "parallel": 1 } } }, diff --git a/package.json b/package.json index d05d42b2..be6d495d 100644 --- a/package.json +++ b/package.json @@ -60,16 +60,16 @@ "@commitlint/cli": "^13.2.1", "@commitlint/config-conventional": "^15.0.0", "@commitlint/types": "^13.2.0", - "@nrwl/cli": "13.0.1", - "@nrwl/devkit": "13.0.1", - "@nrwl/eslint-plugin-nx": "13.0.1", - "@nrwl/jest": "13.0.1", - "@nrwl/linter": "13.0.1", - "@nrwl/node": "13.0.1", + "@nrwl/cli": "13.2.2", + "@nrwl/devkit": "13.2.2", + "@nrwl/eslint-plugin-nx": "13.2.2", + "@nrwl/jest": "13.2.2", + "@nrwl/linter": "13.2.2", + "@nrwl/node": "13.2.2", "@nrwl/nx-cloud": "12.5.4", - "@nrwl/nx-plugin": "13.0.1", - "@nrwl/tao": "13.0.1", - "@nrwl/workspace": "13.0.1", + "@nrwl/nx-plugin": "13.2.2", + "@nrwl/tao": "13.2.2", + "@nrwl/workspace": "13.2.2", "@nx-dotnet/nxdoc": "latest", "@nx-plus/docusaurus": "^12.2.0", "@semantic-release/changelog": "^6.0.1", diff --git a/packages/core/tsconfig.lib.json b/packages/core/tsconfig.lib.json index 037d796f..6efdbeec 100644 --- a/packages/core/tsconfig.lib.json +++ b/packages/core/tsconfig.lib.json @@ -6,6 +6,6 @@ "declaration": true, "types": ["node"] }, - "exclude": ["**/*.spec.ts"], + "exclude": ["**/*.spec.ts", "**/*.test.ts"], "include": ["**/*.ts"] } diff --git a/packages/core/tsconfig.spec.json b/packages/core/tsconfig.spec.json index 559410b9..68296441 100644 --- a/packages/core/tsconfig.spec.json +++ b/packages/core/tsconfig.spec.json @@ -7,9 +7,13 @@ }, "include": [ "**/*.spec.ts", + "**/*.test.ts", "**/*.spec.tsx", + "**/*.test.tsx", "**/*.spec.js", + "**/*.test.js", "**/*.spec.jsx", + "**/*.test.jsx", "**/*.d.ts" ] } diff --git a/packages/dotnet/tsconfig.lib.json b/packages/dotnet/tsconfig.lib.json index 1cf331eb..f4bb78ae 100644 --- a/packages/dotnet/tsconfig.lib.json +++ b/packages/dotnet/tsconfig.lib.json @@ -7,5 +7,5 @@ "declaration": true }, "include": ["**/*.ts"], - "exclude": ["**/*.spec.ts"] + "exclude": ["**/*.spec.ts", "**/*.test.ts"] } diff --git a/packages/dotnet/tsconfig.spec.json b/packages/dotnet/tsconfig.spec.json index 559410b9..68296441 100644 --- a/packages/dotnet/tsconfig.spec.json +++ b/packages/dotnet/tsconfig.spec.json @@ -7,9 +7,13 @@ }, "include": [ "**/*.spec.ts", + "**/*.test.ts", "**/*.spec.tsx", + "**/*.test.tsx", "**/*.spec.js", + "**/*.test.js", "**/*.spec.jsx", + "**/*.test.jsx", "**/*.d.ts" ] } diff --git a/packages/nx-ghpages/tsconfig.lib.json b/packages/nx-ghpages/tsconfig.lib.json index 037d796f..6efdbeec 100644 --- a/packages/nx-ghpages/tsconfig.lib.json +++ b/packages/nx-ghpages/tsconfig.lib.json @@ -6,6 +6,6 @@ "declaration": true, "types": ["node"] }, - "exclude": ["**/*.spec.ts"], + "exclude": ["**/*.spec.ts", "**/*.test.ts"], "include": ["**/*.ts"] } diff --git a/packages/nx-ghpages/tsconfig.spec.json b/packages/nx-ghpages/tsconfig.spec.json index 559410b9..68296441 100644 --- a/packages/nx-ghpages/tsconfig.spec.json +++ b/packages/nx-ghpages/tsconfig.spec.json @@ -7,9 +7,13 @@ }, "include": [ "**/*.spec.ts", + "**/*.test.ts", "**/*.spec.tsx", + "**/*.test.tsx", "**/*.spec.js", + "**/*.test.js", "**/*.spec.jsx", + "**/*.test.jsx", "**/*.d.ts" ] } diff --git a/packages/nxdoc/tsconfig.lib.json b/packages/nxdoc/tsconfig.lib.json index 037d796f..6efdbeec 100644 --- a/packages/nxdoc/tsconfig.lib.json +++ b/packages/nxdoc/tsconfig.lib.json @@ -6,6 +6,6 @@ "declaration": true, "types": ["node"] }, - "exclude": ["**/*.spec.ts"], + "exclude": ["**/*.spec.ts", "**/*.test.ts"], "include": ["**/*.ts"] } diff --git a/packages/nxdoc/tsconfig.spec.json b/packages/nxdoc/tsconfig.spec.json index 559410b9..68296441 100644 --- a/packages/nxdoc/tsconfig.spec.json +++ b/packages/nxdoc/tsconfig.spec.json @@ -7,9 +7,13 @@ }, "include": [ "**/*.spec.ts", + "**/*.test.ts", "**/*.spec.tsx", + "**/*.test.tsx", "**/*.spec.js", + "**/*.test.js", "**/*.spec.jsx", + "**/*.test.jsx", "**/*.d.ts" ] } diff --git a/packages/typescript/tsconfig.lib.json b/packages/typescript/tsconfig.lib.json index 037d796f..6efdbeec 100644 --- a/packages/typescript/tsconfig.lib.json +++ b/packages/typescript/tsconfig.lib.json @@ -6,6 +6,6 @@ "declaration": true, "types": ["node"] }, - "exclude": ["**/*.spec.ts"], + "exclude": ["**/*.spec.ts", "**/*.test.ts"], "include": ["**/*.ts"] } diff --git a/packages/typescript/tsconfig.spec.json b/packages/typescript/tsconfig.spec.json index 559410b9..68296441 100644 --- a/packages/typescript/tsconfig.spec.json +++ b/packages/typescript/tsconfig.spec.json @@ -7,9 +7,13 @@ }, "include": [ "**/*.spec.ts", + "**/*.test.ts", "**/*.spec.tsx", + "**/*.test.tsx", "**/*.spec.js", + "**/*.test.js", "**/*.spec.jsx", + "**/*.test.jsx", "**/*.d.ts" ] } diff --git a/packages/utils/tsconfig.lib.json b/packages/utils/tsconfig.lib.json index 1cf331eb..f4bb78ae 100644 --- a/packages/utils/tsconfig.lib.json +++ b/packages/utils/tsconfig.lib.json @@ -7,5 +7,5 @@ "declaration": true }, "include": ["**/*.ts"], - "exclude": ["**/*.spec.ts"] + "exclude": ["**/*.spec.ts", "**/*.test.ts"] } diff --git a/packages/utils/tsconfig.spec.json b/packages/utils/tsconfig.spec.json index 559410b9..68296441 100644 --- a/packages/utils/tsconfig.spec.json +++ b/packages/utils/tsconfig.spec.json @@ -7,9 +7,13 @@ }, "include": [ "**/*.spec.ts", + "**/*.test.ts", "**/*.spec.tsx", + "**/*.test.tsx", "**/*.spec.js", + "**/*.test.js", "**/*.spec.jsx", + "**/*.test.jsx", "**/*.d.ts" ] } diff --git a/smoke/core/tsconfig.spec.json b/smoke/core/tsconfig.spec.json index 29efa430..07c165e4 100644 --- a/smoke/core/tsconfig.spec.json +++ b/smoke/core/tsconfig.spec.json @@ -5,5 +5,5 @@ "module": "commonjs", "types": ["jest", "node"] }, - "include": ["**/*.spec.ts", "**/*.d.ts"] + "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"] } diff --git a/yarn.lock b/yarn.lock index 740b467a..900dc338 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2229,7 +2229,7 @@ node-gyp "^7.1.0" read-package-json-fast "^2.0.1" -"@nrwl/cli@*", "@nrwl/cli@13.0.1": +"@nrwl/cli@*": version "13.0.1" resolved "https://registry.yarnpkg.com/@nrwl/cli/-/cli-13.0.1.tgz#37f07849f4ecab73717cb8ca6521b5d169b2f86e" integrity sha512-73fJIwvGhliEPC298zm8DTGa/TuMnDFQApf0tMqRk307SKC0oetszpOVDJGffFtvv6hOeCx67rBVtYDyMXRRvg== @@ -2241,68 +2241,81 @@ yargs "15.4.1" yargs-parser "20.0.0" -"@nrwl/devkit@13.0.1": - version "13.0.1" - resolved "https://registry.yarnpkg.com/@nrwl/devkit/-/devkit-13.0.1.tgz#fb91bf6e5d770ed477288a315fbf095130a4e5a2" - integrity sha512-fDLo8cu0Kn/iHt4i8aRArFV5Lsw/nYaIAzf3MILWgdh7113ksfgmaJbm7iVpoR6dHSpveqTFGaCrzm/CIVD7Zw== +"@nrwl/cli@13.2.2": + version "13.2.2" + resolved "https://registry.yarnpkg.com/@nrwl/cli/-/cli-13.2.2.tgz#cd6237ac5254bf6a686f6a5205c2d6e949a13083" + integrity sha512-iqWwULCgYV3r+sKA/jrh4Di5buesPDcmdG0vi4kFnMgNF3Pg+8Coa7qKXJXdTr1gugBfGPFFmHORmH1pE3CMYA== dependencies: - "@nrwl/tao" "13.0.1" + "@nrwl/tao" "13.2.2" + chalk "4.1.0" + enquirer "~2.3.6" + v8-compile-cache "2.3.0" + yargs "15.4.1" + yargs-parser "20.0.0" + +"@nrwl/devkit@13.2.2": + version "13.2.2" + resolved "https://registry.yarnpkg.com/@nrwl/devkit/-/devkit-13.2.2.tgz#f0cee712359ae7b82d222380c2cd5695ba38d6e8" + integrity sha512-2uMJF6j7dpR9DYkFWn9WeMeycrEAhSTzDUTdapWp9hPsqJIMV0rk2WD4PPseflAewHnrdDtm9b9Rqvo/mXz4wQ== + dependencies: + "@nrwl/tao" "13.2.2" ejs "^3.1.5" ignore "^5.0.4" rxjs "^6.5.4" semver "7.3.4" - tslib "^2.0.0" + tslib "^2.3.0" -"@nrwl/eslint-plugin-nx@13.0.1": - version "13.0.1" - resolved "https://registry.yarnpkg.com/@nrwl/eslint-plugin-nx/-/eslint-plugin-nx-13.0.1.tgz#d34f732fdf44d804fa2cd635884a559899f2f7f3" - integrity sha512-7ULvMH9DYqrTja4FfH9LNjxk1nFHEZAHUIt2ZdQ/pwuHGo6B53ehgvMSBNqty7DrGxkvrUSxc/JR8TfN2qSMzA== +"@nrwl/eslint-plugin-nx@13.2.2": + version "13.2.2" + resolved "https://registry.yarnpkg.com/@nrwl/eslint-plugin-nx/-/eslint-plugin-nx-13.2.2.tgz#999b4329bda8479c0f16341c0a656786163fb2f9" + integrity sha512-HAR7p2QnScXk0LwHvvUSnMZB0oTnYHhFiLOyTYCUQFdp6Mjx7scJdVsm2/NfQh7VCqzDe5qMvKqb5k47TRX2WQ== dependencies: - "@nrwl/devkit" "13.0.1" - "@nrwl/workspace" "13.0.1" + "@nrwl/devkit" "13.2.2" + "@nrwl/workspace" "13.2.2" "@typescript-eslint/experimental-utils" "~4.33.0" confusing-browser-globals "^1.0.9" ts-node "^9.1.1" tsconfig-paths "^3.9.0" -"@nrwl/jest@13.0.1": - version "13.0.1" - resolved "https://registry.yarnpkg.com/@nrwl/jest/-/jest-13.0.1.tgz#65b12e626bd839e0a2439c745a30c3aa3d398b1d" - integrity sha512-rM7KkpobqHHexbXTOYEJtuY7MNkJkAaE4VeqOFAbTdI4xj6hfh78l3ZFjdWKJtzwTlYGt4CP2DFKlgmyC6jgXw== +"@nrwl/jest@13.2.2": + version "13.2.2" + resolved "https://registry.yarnpkg.com/@nrwl/jest/-/jest-13.2.2.tgz#e9ffc1af695af9110581848fd47e83cd81f0af25" + integrity sha512-2fPwx0pSm557TrOPdaT4jcJH6JZor7+gCx3mW6BAVmAr5IZmKEbnLI9M3eWV0KhcIOt4teZXqJQ4YrrQ8Eb/Tw== dependencies: "@jest/reporters" "27.2.2" "@jest/test-result" "27.2.2" - "@nrwl/devkit" "13.0.1" + "@nrwl/devkit" "13.2.2" chalk "4.1.0" identity-obj-proxy "3.0.0" jest-config "27.2.2" jest-resolve "27.2.2" jest-util "27.2.0" + resolve.exports "1.1.0" rxjs "^6.5.4" - tslib "^2.0.0" + tslib "^2.3.0" -"@nrwl/linter@13.0.1": - version "13.0.1" - resolved "https://registry.yarnpkg.com/@nrwl/linter/-/linter-13.0.1.tgz#d95531cbb574feeb2beab3c2f30175713081ccb1" - integrity sha512-nqzVPPXPN5mOxhuOoz6LywDq2ld3HvhaRgVtX5eNyIZUm+PVTgBgiZJuRhRskdtQz8HcEA4CAUJDF6eEBUavKg== +"@nrwl/linter@13.2.2": + version "13.2.2" + resolved "https://registry.yarnpkg.com/@nrwl/linter/-/linter-13.2.2.tgz#0d9ec6dda8b0aaf80c91d583ccfc03bbd8a3d80a" + integrity sha512-WLEvlEDUZIVZuGfjgNahIBRO9P5rWoj6qcDk6mutpz3Fx/EYFSdH8thsJz6K+MMWk1gBZprwbXt8PiBdDrwIdQ== dependencies: - "@nrwl/devkit" "13.0.1" - "@nrwl/jest" "13.0.1" + "@nrwl/devkit" "13.2.2" + "@nrwl/jest" "13.2.2" eslint "7.32.0" glob "7.1.4" minimatch "3.0.4" tmp "~0.2.1" - tslib "^2.0.0" + tslib "^2.3.0" -"@nrwl/node@13.0.1": - version "13.0.1" - resolved "https://registry.yarnpkg.com/@nrwl/node/-/node-13.0.1.tgz#8a7c01c2ca1721c3633a3182707d52e81caa32d3" - integrity sha512-Xfo8/Jrw6O9cF48LXHUbpkDgqQp54KUvou2K6GBm6Aa79S1WP1b70mOr58lSg9aTj5oUVYHumMsWLHgwcN6NTA== +"@nrwl/node@13.2.2": + version "13.2.2" + resolved "https://registry.yarnpkg.com/@nrwl/node/-/node-13.2.2.tgz#67976a734dcfbed5bc4c4f804da48f083094b236" + integrity sha512-F1ibkoofGdzfjn3zVSs7lRETRDQ85txZXx2h2U4LcTcgv6s1hkXDwAGu/saK18PFYPbrrq7wXtNAqXlqUkapIA== dependencies: - "@nrwl/devkit" "13.0.1" - "@nrwl/jest" "13.0.1" - "@nrwl/linter" "13.0.1" - "@nrwl/workspace" "13.0.1" + "@nrwl/devkit" "13.2.2" + "@nrwl/jest" "13.2.2" + "@nrwl/linter" "13.2.2" + "@nrwl/workspace" "13.2.2" chalk "4.1.0" copy-webpack-plugin "^9.0.1" enhanced-resolve "^5.8.3" @@ -2317,7 +2330,7 @@ ts-loader "^9.2.6" tsconfig-paths "^3.9.0" tsconfig-paths-webpack-plugin "3.4.1" - tslib "^2.0.0" + tslib "^2.3.0" webpack "^5.58.1" webpack-merge "^5.8.0" webpack-node-externals "^3.0.0" @@ -2334,18 +2347,18 @@ strip-json-comments "^3.1.1" tar "6.1.11" -"@nrwl/nx-plugin@13.0.1": - version "13.0.1" - resolved "https://registry.yarnpkg.com/@nrwl/nx-plugin/-/nx-plugin-13.0.1.tgz#f88df42167a83c042c9b547cac10bc56697d64d9" - integrity sha512-Xad7ZXYs1n4P46C+KFAAndsE+9I3a3lLuwasUxPaaUDMw5dQ6X2RIWfnXel3IcGlsx6NMD9mCnsA6AQYMObEIQ== +"@nrwl/nx-plugin@13.2.2": + version "13.2.2" + resolved "https://registry.yarnpkg.com/@nrwl/nx-plugin/-/nx-plugin-13.2.2.tgz#5a52a0b97e17cf2c37a07f1bab0519aa2a430572" + integrity sha512-vSpH7WlG0mOU+ugD41NTPm+QYf2skD8eCnK9N/5gf4h/oDTUgE1JW/KBgH42V9Kgvi9S9LfyDBk6czWJp4Z2IQ== dependencies: - "@nrwl/devkit" "13.0.1" - "@nrwl/jest" "13.0.1" - "@nrwl/linter" "13.0.1" - "@nrwl/node" "13.0.1" + "@nrwl/devkit" "13.2.2" + "@nrwl/jest" "13.2.2" + "@nrwl/linter" "13.2.2" + "@nrwl/node" "13.2.2" fs-extra "^9.1.0" rxjs "^6.5.4" - tslib "^2.0.0" + tslib "^2.3.0" yargs "15.4.1" "@nrwl/tao@13.0.1": @@ -2365,15 +2378,32 @@ tslib "^2.0.0" yargs-parser "20.0.0" -"@nrwl/workspace@13.0.1": - version "13.0.1" - resolved "https://registry.yarnpkg.com/@nrwl/workspace/-/workspace-13.0.1.tgz#cd0b7c3248ea2b5f9c71ba0ffd96c9a75a1318dc" - integrity sha512-RACK5XvEdnPsrFBnIpIsUWveaCHZX2ALHKsJBd+tlvN+DBwLKBWC3a5+DTAZ1kWgd0yuAJx/VE1CpRxNeZnxGQ== +"@nrwl/tao@13.2.2": + version "13.2.2" + resolved "https://registry.yarnpkg.com/@nrwl/tao/-/tao-13.2.2.tgz#704940de14c62a14d54ec69fd898e1e3d7066b5c" + integrity sha512-IQtiTuouagSYpxztJvxD1XYha1eLagFoJV/2Y7bu6jUx5KTT5chLzXbz18WUeKhkuZAHhhb2UeOmL9ggQpWnZQ== dependencies: - "@nrwl/cli" "13.0.1" - "@nrwl/devkit" "13.0.1" - "@nrwl/jest" "13.0.1" - "@nrwl/linter" "13.0.1" + chalk "4.1.0" + enquirer "~2.3.6" + fs-extra "^9.1.0" + jsonc-parser "3.0.0" + nx "13.2.2" + rxjs "^6.5.4" + rxjs-for-await "0.0.2" + semver "7.3.4" + tmp "~0.2.1" + tslib "^2.3.0" + yargs-parser "20.0.0" + +"@nrwl/workspace@13.2.2": + version "13.2.2" + resolved "https://registry.yarnpkg.com/@nrwl/workspace/-/workspace-13.2.2.tgz#aca7388413e1c853f1250059c807bc4e25907e29" + integrity sha512-DP+dTUee/hJ8mbF8x9gd5hL0dUmnT6j1c2zujneYMhvrFGdC8M5wbyK5V7tuW9tSUzjVnQeATGrCvJuFz6tOxQ== + dependencies: + "@nrwl/cli" "13.2.2" + "@nrwl/devkit" "13.2.2" + "@nrwl/jest" "13.2.2" + "@nrwl/linter" "13.2.2" "@parcel/watcher" "2.0.0-alpha.11" chalk "4.1.0" chokidar "^3.5.1" @@ -2392,7 +2422,7 @@ semver "7.3.4" strip-ansi "6.0.0" tmp "~0.2.1" - tslib "^2.0.0" + tslib "^2.3.0" yargs "15.4.1" yargs-parser "20.0.0" @@ -10608,6 +10638,13 @@ nx@13.0.1: dependencies: "@nrwl/cli" "*" +nx@13.2.2: + version "13.2.2" + resolved "https://registry.yarnpkg.com/nx/-/nx-13.2.2.tgz#ffeeaeeb255e061cd0c462541c446a462fa2419b" + integrity sha512-d13Xb3pswItWS9sP4+ed4JarkTzo6+gCBNWSgxuO6MMkmKZPXH3yM3an9KlA5jCyFygcsny7CIgwwxJhz1SJCg== + dependencies: + "@nrwl/cli" "*" + oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" @@ -12478,7 +12515,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve.exports@^1.1.0: +resolve.exports@1.1.0, resolve.exports@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== @@ -13997,7 +14034,7 @@ tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2, tslib@^2.0.0, tslib@^2.0.3, tslib@^2.3.1: +tslib@^2, tslib@^2.0.0, tslib@^2.0.3, tslib@^2.3.0, tslib@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== From ec342ae2699b7ca5fad0aee717d67ded3c0a9524 Mon Sep 17 00:00:00 2001 From: Craigory Coppola Date: Mon, 29 Nov 2021 09:01:56 -0600 Subject: [PATCH 8/9] feat(core): support for workspace solution files (#254) --- .vscode/extensions.json | 1 - apps/docs-site/docusaurus.config.js | 3 + apps/docs-site/project.json | 6 ++ docs/core/generators/application.md | 6 ++ docs/core/generators/library.md | 6 ++ docs/core/generators/test.md | 6 ++ docs/core/guides/_category_.yml | 2 + docs/core/guides/handling-solutions.md | 37 ++++++++++ e2e/core-e2e/project.json | 2 +- e2e/core-e2e/tests/nx-dotnet.spec.ts | 69 +++++++++++++++++-- e2e/nx-ghpages-e2e/project.json | 2 +- e2e/nxdoc-e2e/project.json | 2 +- e2e/typescript-e2e/project.json | 2 +- nx.json | 4 ++ package.json | 28 ++------ packages/core/package.json | 4 +- packages/core/project.json | 12 ++++ packages/core/src/executors/build/executor.ts | 14 +--- .../src/executors/format/executor.spec.ts | 8 +-- .../core/src/executors/format/executor.ts | 14 +--- .../src/executors/publish/executor.spec.ts | 4 +- .../core/src/executors/publish/executor.ts | 11 +-- packages/core/src/executors/serve/executor.ts | 13 +--- packages/core/src/executors/test/executor.ts | 11 +-- packages/core/src/generators/app/schema.json | 17 ++++- packages/core/src/generators/lib/schema.json | 17 ++++- .../generators/nuget-reference/generator.ts | 28 +++----- packages/core/src/generators/test/schema.json | 17 ++++- .../core/src/generators/utils/add-to-sln.ts | 42 +++++++++++ .../generators/utils/generate-project.spec.ts | 4 +- .../src/generators/utils/generate-project.ts | 41 +++++------ .../generators/utils/generate-test-project.ts | 22 ++---- .../src/models/project-generator-schema.ts | 1 + packages/dotnet/package.json | 4 +- packages/dotnet/project.json | 12 ++++ packages/dotnet/src/lib/core/dotnet.client.ts | 40 ++++------- .../dotnet-add-package-options.ts | 5 +- .../dotnet-build/dotnet-build-options.ts | 5 +- .../dotnet-format/dotnet-format-options.ts | 5 +- .../models/dotnet-new/dotnet-new-options.ts | 5 +- .../dotnet-publish/dotnet-publish-options.ts | 5 +- .../models/dotnet-run/dotnet-run-options.ts | 5 +- .../models/dotnet-test/dotnet-test-options.ts | 5 +- packages/nx-ghpages/package.json | 4 +- packages/nx-ghpages/project.json | 12 ++++ packages/nxdoc/package.json | 4 +- packages/nxdoc/project.json | 12 ++++ packages/typescript/package.json | 4 +- packages/typescript/project.json | 12 ++++ packages/utils/package.json | 4 +- packages/utils/project.json | 12 ++++ .../lib/models/nx-dotnet-config.interface.ts | 1 + .../utils/src/lib/utility-functions/args.ts | 16 +---- .../utils/src/lib/utility-functions/config.ts | 12 ++++ .../src/lib/utility-functions/parameters.ts | 18 ++--- tools/scripts/e2e.ts | 20 ++---- tools/scripts/local-registry/setup.ts | 40 +++++++++++ tools/scripts/patch-package-versions/index.ts | 43 ++++++++++-- tools/scripts/publish-all/index.ts | 8 +-- tools/scripts/sandbox.ts | 48 +++++++++++++ tools/utils/nx.ts | 18 +++++ yarn.lock | 18 +++++ 62 files changed, 580 insertions(+), 273 deletions(-) create mode 100644 docs/core/guides/_category_.yml create mode 100644 docs/core/guides/handling-solutions.md create mode 100644 packages/core/src/generators/utils/add-to-sln.ts create mode 100644 tools/scripts/local-registry/setup.ts create mode 100644 tools/scripts/sandbox.ts diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 469ac9b0..7f59c19f 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,5 @@ { "recommendations": [ - "ms-vscode.vscode-typescript-tslint-plugin", "esbenp.prettier-vscode", "firsttris.vscode-jest-runner", "mike-co.import-sorter" diff --git a/apps/docs-site/docusaurus.config.js b/apps/docs-site/docusaurus.config.js index 56547d1a..1f507498 100644 --- a/apps/docs-site/docusaurus.config.js +++ b/apps/docs-site/docusaurus.config.js @@ -85,6 +85,9 @@ module.exports = { contextualSearch: false, appId: 'BH4D9OD16A', }, + prism: { + additionalLanguages: ['json5', 'typescript', 'bash'], + }, }, presets: [ [ diff --git a/apps/docs-site/project.json b/apps/docs-site/project.json index 390c7c09..f276f266 100644 --- a/apps/docs-site/project.json +++ b/apps/docs-site/project.json @@ -9,6 +9,12 @@ "outputPath": "dist/apps/docs-site" } }, + "prebuild": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "commands": ["echo"] + } + }, "serve": { "executor": "@nx-plus/docusaurus:dev-server", "options": { diff --git a/docs/core/generators/application.md b/docs/core/generators/application.md index 609e59b3..273b7fe7 100644 --- a/docs/core/generators/application.md +++ b/docs/core/generators/application.md @@ -37,3 +37,9 @@ Generate a dotnet project under the application directory. ### standalone - (boolean): Should the project use project.json? If false, the project config is inside workspace.json + +### solutionFile + +- (string): The name of the solution file to add the project to + +- (boolean): Should the project be added to the default solution file? diff --git a/docs/core/generators/library.md b/docs/core/generators/library.md index b7275c70..20fe60ce 100644 --- a/docs/core/generators/library.md +++ b/docs/core/generators/library.md @@ -33,3 +33,9 @@ Generate a dotnet project under the library directory. ### standalone - (boolean): Should the project use project.json? If false, the project config is inside workspace.json + +### solutionFile + +- (string): The name of the solution file to add the project to + +- (boolean): Should the project be added to the default solution file? diff --git a/docs/core/generators/test.md b/docs/core/generators/test.md index 9c6c7de7..719f9c67 100644 --- a/docs/core/generators/test.md +++ b/docs/core/generators/test.md @@ -29,3 +29,9 @@ Generate a .NET test project for an existing application or library ### standalone - (boolean): Should the project use project.json? If false, the project config is inside workspace.json + +### solutionFile + +- (string): The name of the solution file to add the project to + +- (boolean): Should the project be added to the default solution file? diff --git a/docs/core/guides/_category_.yml b/docs/core/guides/_category_.yml new file mode 100644 index 00000000..23d49f2b --- /dev/null +++ b/docs/core/guides/_category_.yml @@ -0,0 +1,2 @@ +label: 'Guides' +position: 1 diff --git a/docs/core/guides/handling-solutions.md b/docs/core/guides/handling-solutions.md new file mode 100644 index 00000000..7a041b66 --- /dev/null +++ b/docs/core/guides/handling-solutions.md @@ -0,0 +1,37 @@ +# Handling Solution Files + +## Workspace Level + +As of v1.7.0, `nx-dotnet` supports adding projects to a workspace level solution file automatically. When generating an app, lib, or test project you can pass `--solutionFile` to add the project to the default solution at the workspace root. Alternatively, you can pass `--solutionFile {path/to/sln}` to add the project to a custom solution file. This should look something like: + +```bash +npx nx g @nx-dotnet/core:app my-api --template webapi --solutionFile MyCompany.sln +``` + +To add projects to a solution file by default, you can set the generator defaults in [nx.json](https://nx.dev/l/a/core-concepts/configuration#nxjson) as below: + +```json5 +{ + // ... more nx.json configuration + generators: { + // ... other default configurations + '@nx-dotnet/core:app': { + solutionFile: true, + }, + }, +} +``` + +## Subgraph Solutions + +In a large monorepo, IDEs or other tooling may slow down when presented with a large solution file. Currently, `nx-dotnet` does not assist in managing this issue, but there are a few easy steps to take that can help optimize your workflow. Which path you take will depend on both the tooling you use, and the pains that you are enountering. + +Either of the two approaches listed below could be expanded on in the future, but currently are not in the scope of the nx-plugin. + +### Separate solution files + +One option would be totally separated solution files for project graphs that are not connected. The main thing to be cautious with in an approach like this, is that if the dependency graph changes and the two subgraphs become connected it would be possible to make changes that break a project not currently visible to the IDE. For example, lets say you have 3 projects `A`, `B`, and `Shared`. If `A` and `B` both depend on `Shared`, and you have separate solutions each containing either `A` or `B` alongside the `Shared` project, a developer could modify the code in `Shared` and break the project that was not included in the opened solution file. As such, any solution that contained `Shared` _must_ contain all projects that depend on it to maintain good DX. + +### Solution filters + +Some IDEs such as Visual Studio support solution filters. These filters would allow for all projects to be visible to the IDE, but can have some performance benefits. The caveats to using separate files can still exist though, but these could be easier to maintain in the long run. Here is a link to the [msdn docs for solution filters](https://docs.microsoft.com/en-us/visualstudio/ide/filtered-solutions?view=vs-2022). diff --git a/e2e/core-e2e/project.json b/e2e/core-e2e/project.json index f2d1f080..018bec11 100644 --- a/e2e/core-e2e/project.json +++ b/e2e/core-e2e/project.json @@ -6,7 +6,7 @@ "e2e": { "executor": "@nrwl/nx-plugin:e2e", "options": { - "target": "core:build", + "target": "core:noop", "jestConfig": "e2e/core-e2e/jest.config.js" } } diff --git a/e2e/core-e2e/tests/nx-dotnet.spec.ts b/e2e/core-e2e/tests/nx-dotnet.spec.ts index d0d2a098..4497da3c 100644 --- a/e2e/core-e2e/tests/nx-dotnet.spec.ts +++ b/e2e/core-e2e/tests/nx-dotnet.spec.ts @@ -1,13 +1,9 @@ -import { - joinPathFragments, - names, - WorkspaceJsonConfiguration, -} from '@nrwl/devkit'; +import { joinPathFragments, names } from '@nrwl/devkit'; import { checkFilesExist, ensureNxProject, + listFiles, readFile, - readJson, runNxCommandAsync, uniq, } from '@nrwl/nx-plugin/testing'; @@ -20,6 +16,7 @@ import { findProjectFileInPathSync } from '@nx-dotnet/utils'; import { readDependenciesFromNxDepGraph } from '@nx-dotnet/utils/e2e'; import { execSync } from 'child_process'; import { ensureDirSync } from 'fs-extra'; +import { Workspaces } from '@nrwl/tao/src/shared/workspace'; const e2eDir = 'tmp/nx-e2e/proj'; @@ -234,7 +231,7 @@ describe('nx-dotnet e2e', () => { await runNxCommandAsync(`generate @nx-dotnet/core:import-projects`); - const workspace = readJson('workspace.json'); + const workspace = new Workspaces(e2eDir).readWorkspaceConfiguration(); expect(workspace.projects[testApp].targets?.serve).toBeDefined(); expect(workspace.projects[testApp].targets?.build).toBeDefined(); @@ -250,4 +247,62 @@ describe('nx-dotnet e2e', () => { checkFilesExist(`dist/apps/${testApp}`); }); }); + + describe('solution handling', () => { + // For solution handling, defaults fall back to if a file exists. + // This ensures that the tests are ran in a clean state, without previous + // test projects interfering with the test. + beforeEach(() => { + ensureNxProject('@nx-dotnet/core', 'dist/packages/core'); + }, 1500000); + + it("shouldn't create a solution by default if not specified", async () => { + const app = uniq('app'); + await runNxCommandAsync( + `generate @nx-dotnet/core:app ${app} --language="C#" --template="webapi"`, + ); + + expect(() => checkFilesExist(`apps/${app}`)).not.toThrow(); + expect(listFiles('.').filter((x) => x.endsWith('.sln'))).toHaveLength(0); + }); + + it('should create a default solution file if specified as true', async () => { + const app = uniq('app'); + await runNxCommandAsync( + `generate @nx-dotnet/core:app ${app} --language="C#" --template="webapi" --solutionFile`, + ); + + expect(() => checkFilesExist(`apps/${app}`)).not.toThrow(); + expect(listFiles('.').filter((x) => x.endsWith('.sln'))).toHaveLength(1); + }); + + it('should create specified solution file if specified as string', async () => { + const app = uniq('app'); + await runNxCommandAsync( + `generate @nx-dotnet/core:app ${app} --language="C#" --template="webapi" --solutionFile="MyCompany.sln"`, + ); + + expect(() => + checkFilesExist(`apps/${app}`, `MyCompany.sln`), + ).not.toThrow(); + }); + + it('should add successive projects to default solution file', async () => { + const app1 = uniq('app'); + await runNxCommandAsync( + `generate @nx-dotnet/core:app ${app1} --language="C#" --template="webapi" --solutionFile`, + ); + + const app2 = uniq('app2'); + await runNxCommandAsync( + `generate @nx-dotnet/core:app ${app2} --language="C#" --template="webapi" --solutionFile`, + ); + + const slnFile = readFile('proj.nx-dotnet.sln'); + + expect(() => checkFilesExist(`apps/${app1}`)).not.toThrow(); + expect(slnFile).toContain(app1); + expect(slnFile).toContain(app2); + }); + }); }); diff --git a/e2e/nx-ghpages-e2e/project.json b/e2e/nx-ghpages-e2e/project.json index 4fe4f918..66c5fcd6 100644 --- a/e2e/nx-ghpages-e2e/project.json +++ b/e2e/nx-ghpages-e2e/project.json @@ -6,7 +6,7 @@ "e2e": { "executor": "@nrwl/nx-plugin:e2e", "options": { - "target": "nx-ghpages:build", + "target": "nx-ghpages:noop", "jestConfig": "e2e/nx-ghpages-e2e/jest.config.js" } } diff --git a/e2e/nxdoc-e2e/project.json b/e2e/nxdoc-e2e/project.json index effec02c..0b7b964d 100644 --- a/e2e/nxdoc-e2e/project.json +++ b/e2e/nxdoc-e2e/project.json @@ -6,7 +6,7 @@ "e2e": { "executor": "@nrwl/nx-plugin:e2e", "options": { - "target": "nxdoc:build", + "target": "nxdoc:noop", "jestConfig": "e2e/nxdoc-e2e/jest.config.js" } } diff --git a/e2e/typescript-e2e/project.json b/e2e/typescript-e2e/project.json index 86aa097f..007cd77e 100644 --- a/e2e/typescript-e2e/project.json +++ b/e2e/typescript-e2e/project.json @@ -6,7 +6,7 @@ "e2e": { "executor": "@nrwl/nx-plugin:e2e", "options": { - "target": "typescript:build", + "target": "typescript:noop", "jestConfig": "e2e/typescript-e2e/jest.config.js" } } diff --git a/nx.json b/nx.json index 215666f7..8456a9a4 100644 --- a/nx.json +++ b/nx.json @@ -36,6 +36,10 @@ { "target": "build", "projects": "dependencies" + }, + { + "target": "prebuild", + "projects": "self" } ] }, diff --git a/package.json b/package.json index be6d495d..42dff228 100644 --- a/package.json +++ b/package.json @@ -2,38 +2,17 @@ "name": "nx-dotnet", "license": "MIT", "scripts": { - "nx": "nx", - "start": "nx serve", - "build": "nx build", - "test": "nx test", - "lint": "nx workspace-lint && nx lint", "prepare": "husky install", "lint-staged": "lint-staged", - "affected:apps": "nx affected:apps", - "affected:libs": "nx affected:libs", - "affected:build": "nx affected:build", - "affected:e2e": "nx affected:e2e", - "affected:test": "nx affected:test", - "affected:lint": "nx affected:lint", - "affected:dep-graph": "nx affected:dep-graph", - "affected": "nx affected", - "format": "nx format:write", - "format:write": "nx format:write", - "format:check": "nx format:check", - "update": "nx migrate latest", - "workspace-generator": "nx workspace-generator", - "dep-graph": "nx dep-graph", - "help": "nx help", "publish-dev": "ts-node tools/scripts/publish-dev", - "e2e-registry": "yarn verdaccio --config ./tools/scripts/local-registry/config.yml --listen 4872", - "e2e-tests": "ts-node -P ./tools/scripts/tsconfig.e2e.json ./tools/scripts/e2e.ts", - "e2e": "run-p -r e2e-registry \"e2e-tests {@}\" --", + "e2e": "ts-node -P ./tools/scripts/tsconfig.e2e.json ./tools/scripts/e2e.ts", "publish-local": "cp .npmrc.local .npmrc && run-p \"rimraf tmp\" e2e-registry \"ts-node ./tools/scripts/publish-all 99.99.99 local\"", "semantic-release": "semantic-release", "ts-node": "ts-node", "rimraf": "rimraf", "preinstall": "node ./tools/scripts/hooks/preinstall.js", - "documentation:check": "ts-node ./tools/scripts/hooks/documentation.check.ts" + "documentation:check": "ts-node ./tools/scripts/hooks/documentation.check.ts", + "sandbox": "ts-node ./tools/scripts/sandbox.ts" }, "private": false, "dependencies": { @@ -93,6 +72,7 @@ "fs-extra": "^10.0.0", "husky": "^7.0.2", "jest": "27.3.1", + "kill-port": "^1.6.1", "lint-staged": "^11.2.3", "prettier": "2.4.1", "run-p": "*", diff --git a/packages/core/package.json b/packages/core/package.json index ed0f95f1..7dfab848 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -14,7 +14,6 @@ "email": "craigorycoppola+nxdotnet@gmail.com" }, "license": "MIT", - "version": "1.6.0", "keywords": [ "Nx", ".NET", @@ -32,5 +31,6 @@ }, "nx-migrations": { "migrations": "./migrations.json" - } + }, + "version": "1.6.0" } diff --git a/packages/core/project.json b/packages/core/project.json index 35dfe64a..37ec4fa2 100644 --- a/packages/core/project.json +++ b/packages/core/project.json @@ -18,6 +18,12 @@ "passWithNoTests": true } }, + "prebuild": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "commands": ["npx ts-node tools/scripts/patch-package-versions"] + } + }, "build": { "executor": "@nrwl/node:package", "outputs": ["{options.outputPath}"], @@ -59,6 +65,12 @@ } ] } + }, + "noop": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "echo" + } } }, "tags": [] diff --git a/packages/core/src/executors/build/executor.ts b/packages/core/src/executors/build/executor.ts index 04d77f5e..41505980 100644 --- a/packages/core/src/executors/build/executor.ts +++ b/packages/core/src/executors/build/executor.ts @@ -1,11 +1,7 @@ import { ExecutorContext } from '@nrwl/devkit'; import { appRootPath } from '@nrwl/tao/src/utils/app-root'; -import { - dotnetBuildFlags, - DotNetClient, - dotnetFactory, -} from '@nx-dotnet/dotnet'; +import { DotNetClient, dotnetFactory } from '@nx-dotnet/dotnet'; import { getExecutedProjectConfiguration, getProjectFileForNxProject, @@ -30,13 +26,7 @@ export default async function runExecutor( ? resolve(appRootPath, options.output) : undefined; - dotnetClient.build( - projectFilePath, - Object.keys(options).map((x) => ({ - flag: x as dotnetBuildFlags, - value: (options as Record)[x], - })), - ); + dotnetClient.build(projectFilePath, options); return { success: true, diff --git a/packages/core/src/executors/format/executor.spec.ts b/packages/core/src/executors/format/executor.spec.ts index 8280cab7..fe92ee12 100644 --- a/packages/core/src/executors/format/executor.spec.ts +++ b/packages/core/src/executors/format/executor.spec.ts @@ -181,8 +181,8 @@ describe('Format Executor', () => { const formatOptions = (dotnetClient as jest.Mocked).format .mock.calls[0][1]; - const checkFlag = formatOptions?.find((o) => o.flag == 'check'); - expect(checkFlag?.value).toBeTruthy(); + const checkFlag = formatOptions?.check; + expect(checkFlag).toBeTruthy(); }); it('passes the --verify-no-changes option on .NET 6 and later', async () => { @@ -203,7 +203,7 @@ describe('Format Executor', () => { const formatOptions = (dotnetClient as jest.Mocked).format .mock.calls[0][1]; - const checkFlag = formatOptions?.find((o) => o.flag == 'verifyNoChanges'); - expect(checkFlag?.value).toBeTruthy(); + const verifyNoChangesFlag = formatOptions?.verifyNoChanges; + expect(verifyNoChangesFlag).toBeTruthy(); }); }); diff --git a/packages/core/src/executors/format/executor.ts b/packages/core/src/executors/format/executor.ts index 95a2662b..c42f26ae 100644 --- a/packages/core/src/executors/format/executor.ts +++ b/packages/core/src/executors/format/executor.ts @@ -4,11 +4,7 @@ import { appRootPath } from '@nrwl/tao/src/utils/app-root'; import { existsSync } from 'fs'; import { join } from 'path'; -import { - DotNetClient, - dotnetFactory, - dotnetFormatFlags, -} from '@nx-dotnet/dotnet'; +import { DotNetClient, dotnetFactory } from '@nx-dotnet/dotnet'; import { getExecutedProjectConfiguration, getProjectFileForNxProject, @@ -50,13 +46,7 @@ export default async function runExecutor( const normalized = normalizeOptions(options, isNet6OrHigher); ensureFormatToolInstalled(context, dotnetClient, isNet6OrHigher); - dotnetClient.format( - projectFilePath, - Object.keys(normalized).map((x) => ({ - flag: x as dotnetFormatFlags, - value: normalized[x], - })), - ); + dotnetClient.format(projectFilePath, normalized); return { success: true, diff --git a/packages/core/src/executors/publish/executor.spec.ts b/packages/core/src/executors/publish/executor.spec.ts index 11c112e8..da6b94b8 100644 --- a/packages/core/src/executors/publish/executor.spec.ts +++ b/packages/core/src/executors/publish/executor.spec.ts @@ -125,9 +125,9 @@ describe('Publish Executor', () => { } const res = await executor(options, context, dotnetClient); expect(spy).toHaveBeenCalled(); - const outputFlag = spy.mock.calls[0][1]?.find((x) => x.flag === 'output'); + const outputFlag = spy.mock.calls[0][1]?.output; expect(outputFlag).toBeTruthy(); - expect(outputFlag && isAbsolute(outputFlag.value as string)).toBeTruthy(); + expect(outputFlag && isAbsolute(outputFlag as string)).toBeTruthy(); expect(res.success).toBeTruthy(); }); }); diff --git a/packages/core/src/executors/publish/executor.ts b/packages/core/src/executors/publish/executor.ts index 9f6b75e7..ff101105 100644 --- a/packages/core/src/executors/publish/executor.ts +++ b/packages/core/src/executors/publish/executor.ts @@ -1,11 +1,7 @@ import { ExecutorContext } from '@nrwl/devkit'; import { appRootPath } from '@nrwl/tao/src/utils/app-root'; -import { - DotNetClient, - dotnetFactory, - dotnetPublishFlags, -} from '@nx-dotnet/dotnet'; +import { DotNetClient, dotnetFactory } from '@nx-dotnet/dotnet'; import { getExecutedProjectConfiguration, getProjectFileForNxProject, @@ -33,10 +29,7 @@ export default async function runExecutor( dotnetClient.publish( resolve(appRootPath, projectFilePath), - Object.keys(flags).map((x) => ({ - flag: x as dotnetPublishFlags, - value: options[x as keyof PublishExecutorSchema], - })), + flags, publishProfile, extraParameters, ); diff --git a/packages/core/src/executors/serve/executor.ts b/packages/core/src/executors/serve/executor.ts index ddf3880c..c01b3a6c 100644 --- a/packages/core/src/executors/serve/executor.ts +++ b/packages/core/src/executors/serve/executor.ts @@ -4,12 +4,7 @@ import { appRootPath } from '@nrwl/tao/src/utils/app-root'; import { ChildProcess } from 'child_process'; import { resolve as pathResolve } from 'path'; -import { - DotNetClient, - dotnetFactory, - dotnetRunFlags, - dotnetRunOptions, -} from '@nx-dotnet/dotnet'; +import { DotNetClient, dotnetFactory } from '@nx-dotnet/dotnet'; import { getExecutedProjectConfiguration, getProjectFileForNxProject, @@ -42,12 +37,8 @@ const runDotnetRun = async ( options: ServeExecutorSchema, ) => { const { watch, ...commandLineOptions } = options; - const opts: dotnetRunOptions = Object.keys(commandLineOptions).map((x) => ({ - flag: x as dotnetRunFlags, - value: (commandLineOptions as Record)[x], - })); - childProcess = dotnetClient.run(project, watch, opts); + childProcess = dotnetClient.run(project, watch, commandLineOptions); await handleChildProcessPassthrough(childProcess); await rimraf(projectDirectory + '/bin'); await rimraf(projectDirectory + '/obj'); diff --git a/packages/core/src/executors/test/executor.ts b/packages/core/src/executors/test/executor.ts index bff4c8cf..30f24b53 100644 --- a/packages/core/src/executors/test/executor.ts +++ b/packages/core/src/executors/test/executor.ts @@ -3,11 +3,7 @@ import { appRootPath } from '@nrwl/tao/src/utils/app-root'; import { resolve } from 'path'; -import { - DotNetClient, - dotnetFactory, - dotnetTestFlags, -} from '@nx-dotnet/dotnet'; +import { DotNetClient, dotnetFactory } from '@nx-dotnet/dotnet'; import { getExecutedProjectConfiguration, getProjectFileForNxProject, @@ -36,10 +32,7 @@ export default async function runExecutor( const result = dotnetClient.test( resolve(appRootPath, projectFilePath), watch, - Object.keys(options).map((x) => ({ - flag: x as dotnetTestFlags, - value: (parsedOptions as Record)[x], - })), + parsedOptions, ); if (watch && isChildProcess(result)) { diff --git a/packages/core/src/generators/app/schema.json b/packages/core/src/generators/app/schema.json index 2dc8189d..5cae0158 100644 --- a/packages/core/src/generators/app/schema.json +++ b/packages/core/src/generators/app/schema.json @@ -62,8 +62,21 @@ }, "standalone": { "type": "boolean", - "description": "Should the project use project.json? If false, the project config is inside workspace.json", - "default": false + "description": "Should the project use project.json? If false, the project config is inside workspace.json" + }, + "solutionFile": { + "description": "Determines if the project should be added to a solution file.", + "oneOf": [ + { + "type": "string", + "description": "The name of the solution file to add the project to" + }, + { + "type": "boolean", + "description": "Should the project be added to the default solution file?" + } + ], + "alias": ["solution", "s"] } }, "required": ["name", "template", "language"] diff --git a/packages/core/src/generators/lib/schema.json b/packages/core/src/generators/lib/schema.json index d799cfcb..3f5c3bb1 100644 --- a/packages/core/src/generators/lib/schema.json +++ b/packages/core/src/generators/lib/schema.json @@ -56,8 +56,21 @@ }, "standalone": { "type": "boolean", - "description": "Should the project use project.json? If false, the project config is inside workspace.json", - "default": false + "description": "Should the project use project.json? If false, the project config is inside workspace.json" + }, + "solutionFile": { + "description": "Determines if the project should be added to a solution file.", + "oneOf": [ + { + "type": "string", + "description": "The name of the solution file to add the project to" + }, + { + "type": "boolean", + "description": "Should the project be added to the default solution file?" + } + ], + "alias": ["solution", "s"] } }, "required": ["name", "template", "language", "testTemplate"] diff --git a/packages/core/src/generators/nuget-reference/generator.ts b/packages/core/src/generators/nuget-reference/generator.ts index c95bf3f8..520fc74d 100644 --- a/packages/core/src/generators/nuget-reference/generator.ts +++ b/packages/core/src/generators/nuget-reference/generator.ts @@ -1,10 +1,6 @@ import { readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { - dotnetAddPackageFlags, - DotNetClient, - dotnetFactory, -} from '@nx-dotnet/dotnet'; +import { DotNetClient, dotnetFactory } from '@nx-dotnet/dotnet'; import { ALLOW_MISMATCH, getProjectFileForNxProject, @@ -21,18 +17,19 @@ export default async function ( options: NugetReferenceGeneratorSchema, dotnetClient = new DotNetClient(dotnetFactory()), ) { - const project = readProjectConfiguration(host, options.project); + const { packageName, project: projectName, ...params } = options; + const project = readProjectConfiguration(host, projectName); const projectFilePath = await getProjectFileForNxProject(project); const config = readConfig(host); - const configuredPkgVersion = config.nugetPackages[options.packageName]; + const configuredPkgVersion = config.nugetPackages[packageName]; const resolvedVersion = await resolveVersionMismatch( options.version, configuredPkgVersion, options.allowVersionMismatch, - options.packageName, + packageName, ); - config.nugetPackages[options.packageName] = resolvedVersion; + config.nugetPackages[packageName] = resolvedVersion; if ( resolvedVersion !== options.version && resolvedVersion !== ALLOW_MISMATCH @@ -41,16 +38,7 @@ export default async function ( } try { - dotnetClient.addPackageReference( - projectFilePath, - options.packageName, - Object.keys(options) - .filter((x) => x !== 'packageName' && x !== 'project') - .map((x) => ({ - flag: x as dotnetAddPackageFlags, - value: options[x as keyof NugetReferenceGeneratorSchema], - })), - ); + dotnetClient.addPackageReference(projectFilePath, packageName, params); updateConfig(host, config); @@ -59,7 +47,7 @@ export default async function ( resolvedVersion !== configuredPkgVersion && resolvedVersion ) { - updateDependencyVersions(host, options.packageName, resolvedVersion); + updateDependencyVersions(host, packageName, resolvedVersion); } } catch (e: unknown) { console.warn('Config not updated since dotnet failed to add dependency!'); diff --git a/packages/core/src/generators/test/schema.json b/packages/core/src/generators/test/schema.json index c934ef57..b56e9c8f 100644 --- a/packages/core/src/generators/test/schema.json +++ b/packages/core/src/generators/test/schema.json @@ -56,8 +56,21 @@ }, "standalone": { "type": "boolean", - "description": "Should the project use project.json? If false, the project config is inside workspace.json", - "default": false + "description": "Should the project use project.json? If false, the project config is inside workspace.json" + }, + "solutionFile": { + "description": "Determines if the project should be added to a solution file.", + "oneOf": [ + { + "type": "string", + "description": "The name of the solution file to add the project to" + }, + { + "type": "boolean", + "description": "Should the project be added to the default solution file?" + } + ], + "alias": ["solution", "s"] } }, "required": ["name", "testTemplate"] diff --git a/packages/core/src/generators/utils/add-to-sln.ts b/packages/core/src/generators/utils/add-to-sln.ts new file mode 100644 index 00000000..17f40834 --- /dev/null +++ b/packages/core/src/generators/utils/add-to-sln.ts @@ -0,0 +1,42 @@ +import { + joinPathFragments, + readWorkspaceConfiguration, + Tree, +} from '@nrwl/devkit'; +import { DotNetClient, dotnetFactory } from '@nx-dotnet/dotnet'; +import { readConfigSection } from '@nx-dotnet/utils'; +import { parse, relative, resolve } from 'path'; + +export function addToSolutionFile( + host: Tree, + projectRoot: string, + dotnetClient = new DotNetClient(dotnetFactory()), + solutionFile?: string | boolean, +) { + const workspaceConfiguration = readWorkspaceConfiguration(host); + const defaultFilePath = readConfigSection(host, 'solutionFile')?.replace( + '{npmScope}', + workspaceConfiguration.npmScope || '', + ); + if (typeof solutionFile === 'boolean' && solutionFile) { + solutionFile = defaultFilePath; + } else if (solutionFile === null || solutionFile === undefined) { + if (defaultFilePath && host.exists(defaultFilePath)) { + solutionFile = defaultFilePath; + } + } + + if (solutionFile) { + if (!host.exists(solutionFile)) { + dotnetClient.new('sln', { + name: parse(solutionFile).name, + output: host.root, + }); + } + const relativePath = relative(dotnetClient.cwd || host.root, host.root); + dotnetClient.addProjectToSolution( + joinPathFragments(relativePath, solutionFile), + resolve(relativePath, projectRoot), + ); + } +} diff --git a/packages/core/src/generators/utils/generate-project.spec.ts b/packages/core/src/generators/utils/generate-project.spec.ts index e2c606c5..2de72586 100644 --- a/packages/core/src/generators/utils/generate-project.spec.ts +++ b/packages/core/src/generators/utils/generate-project.spec.ts @@ -99,7 +99,7 @@ describe('nx-dotnet project generator', () => { const spy = jest.spyOn(dotnetClient, 'new'); await GenerateProject(appTree, options, dotnetClient, 'library'); const [, dotnetOptions] = spy.mock.calls[spy.mock.calls.length - 1]; - const nameFlag = dotnetOptions?.find((flag) => flag.flag === 'name'); - expect(nameFlag?.value).toBe('Proj.SubDir.Test'); + const nameFlag = dotnetOptions?.name; + expect(nameFlag).toBe('Proj.SubDir.Test'); }); }); diff --git a/packages/core/src/generators/utils/generate-project.ts b/packages/core/src/generators/utils/generate-project.ts index 118d871e..1ab328f2 100644 --- a/packages/core/src/generators/utils/generate-project.ts +++ b/packages/core/src/generators/utils/generate-project.ts @@ -5,7 +5,6 @@ import { joinPathFragments, names, normalizePath, - NxJsonProjectConfiguration, ProjectConfiguration, ProjectType, readWorkspaceConfiguration, @@ -34,6 +33,7 @@ import { } from '../../models'; import initSchematic from '../init/generator'; import { GenerateTestProject } from './generate-test-project'; +import { addToSolutionFile } from './add-to-sln'; export interface NormalizedSchema extends NxDotnetProjectGeneratorSchema { projectName: string; @@ -121,8 +121,7 @@ export async function GenerateProject( const normalizedOptions = normalizeOptions(host, options, projectType); - const projectConfiguration: ProjectConfiguration & - NxJsonProjectConfiguration = { + const projectConfiguration: ProjectConfiguration = { root: normalizedOptions.projectRoot, projectType: projectType, sourceRoot: `${normalizedOptions.projectRoot}`, @@ -143,26 +142,25 @@ export async function GenerateProject( normalizedOptions.standalone, ); - const newParams: dotnetNewOptions = [ - { - flag: 'language', - value: normalizedOptions.language, - }, - { - flag: 'name', - value: normalizedOptions.namespaceName, - }, - { - flag: 'output', - value: normalizedOptions.projectRoot, - }, - ]; + const newParams: dotnetNewOptions = { + language: normalizedOptions.language, + name: normalizedOptions.namespaceName, + output: normalizedOptions.projectRoot, + }; if (isDryRun()) { - addDryRunParameter(newParams); + newParams['dryRun'] = true; } dotnetClient.new(normalizedOptions.template, newParams); + if (!isDryRun()) { + addToSolutionFile( + host, + projectConfiguration.root, + dotnetClient, + normalizedOptions.solutionFile, + ); + } if (options['testTemplate'] !== 'none') { await GenerateTestProject(host, normalizedOptions, dotnetClient); @@ -175,13 +173,6 @@ export async function GenerateProject( await formatFiles(host); } -export function addDryRunParameter(parameters: dotnetNewOptions): void { - parameters.push({ - flag: 'dryRun', - value: true, - }); -} - export function setOutputPath( xml: XmlDocument, projectRootPath: string, diff --git a/packages/core/src/generators/utils/generate-test-project.ts b/packages/core/src/generators/utils/generate-test-project.ts index 99b6c5bb..10b77e31 100644 --- a/packages/core/src/generators/utils/generate-test-project.ts +++ b/packages/core/src/generators/utils/generate-test-project.ts @@ -10,7 +10,6 @@ import { } from '../../models'; import { - addDryRunParameter, NormalizedSchema, normalizeOptions, manipulateXmlProjectFile, @@ -46,23 +45,14 @@ export async function GenerateTestProject( schema.standalone, ); - const newParams: dotnetNewOptions = [ - { - flag: 'language', - value: schema.language, - }, - { - flag: 'name', - value: schema.namespaceName + '.' + names(suffix).className, - }, - { - flag: 'output', - value: schema.projectRoot + '-' + suffix, - }, - ]; + const newParams: dotnetNewOptions = { + language: schema.language, + name: schema.namespaceName + '.' + names(suffix).className, + output: schema.projectRoot + '-' + suffix, + }; if (isDryRun()) { - addDryRunParameter(newParams); + newParams['dryRun'] = true; } dotnetClient.new(schema.testTemplate, newParams); diff --git a/packages/core/src/models/project-generator-schema.ts b/packages/core/src/models/project-generator-schema.ts index 96b9a5f8..3c02afd5 100644 --- a/packages/core/src/models/project-generator-schema.ts +++ b/packages/core/src/models/project-generator-schema.ts @@ -14,4 +14,5 @@ export interface NxDotnetProjectGeneratorSchema { skipOutputPathManipulation: boolean; standalone: boolean; projectType?: ProjectType; + solutionFile?: string | boolean; } diff --git a/packages/dotnet/package.json b/packages/dotnet/package.json index 35c78653..ed8c81a5 100644 --- a/packages/dotnet/package.json +++ b/packages/dotnet/package.json @@ -4,7 +4,6 @@ "main": "src/index.js", "dependencies": {}, "license": "MIT", - "version": "1.6.0", "keywords": [ ".NET", "dotnet" @@ -20,5 +19,6 @@ "type": "git", "url": "https://github.com/nx-dotnet/nx-dotnet" }, - "homepage": "https://nx-dotnet.com/" + "homepage": "https://nx-dotnet.com/", + "version": "1.6.0" } diff --git a/packages/dotnet/project.json b/packages/dotnet/project.json index a2c89ea5..bdc7d41d 100644 --- a/packages/dotnet/project.json +++ b/packages/dotnet/project.json @@ -18,6 +18,12 @@ "passWithNoTests": true } }, + "prebuild": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "commands": ["npx ts-node tools/scripts/patch-package-versions"] + } + }, "build": { "executor": "@nrwl/node:package", "outputs": ["{options.outputPath}"], @@ -29,6 +35,12 @@ "updateBuildableProjectDepsInPackageJson": true, "assets": ["packages/dotnet/*.md"] } + }, + "noop": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "echo" + } } }, "tags": [] diff --git a/packages/dotnet/src/lib/core/dotnet.client.ts b/packages/dotnet/src/lib/core/dotnet.client.ts index aae5cbd5..6470d114 100644 --- a/packages/dotnet/src/lib/core/dotnet.client.ts +++ b/packages/dotnet/src/lib/core/dotnet.client.ts @@ -1,9 +1,6 @@ import { ChildProcess, execSync, spawn } from 'child_process'; -import { - getParameterString, - swapArrayFieldValueUsingMap, -} from '@nx-dotnet/utils'; +import { getParameterString, swapKeysUsingMap } from '@nx-dotnet/utils'; import { addPackageKeyMap, @@ -30,7 +27,7 @@ export class DotNetClient { new(template: dotnetTemplate, parameters?: dotnetNewOptions): void { let cmd = `${this.cliCommand.command} new ${template}`; if (parameters) { - parameters = swapArrayFieldValueUsingMap(parameters, 'flag', newKeyMap); + parameters = swapKeysUsingMap(parameters, newKeyMap); const paramString = parameters ? getParameterString(parameters) : ''; cmd = `${cmd} ${paramString}`; } @@ -40,7 +37,7 @@ export class DotNetClient { build(project: string, parameters?: dotnetBuildOptions): void { let cmd = `${this.cliCommand.command} build ${project}`; if (parameters) { - parameters = swapArrayFieldValueUsingMap(parameters, 'flag', buildKeyMap); + parameters = swapKeysUsingMap(parameters, buildKeyMap); const paramString = parameters ? getParameterString(parameters) : ''; cmd = `${cmd} ${paramString}`; } @@ -56,7 +53,7 @@ export class DotNetClient { ? `watch --project ${project} run` : `run --project ${project}`; if (parameters) { - parameters = swapArrayFieldValueUsingMap(parameters, 'flag', runKeyMap); + parameters = swapKeysUsingMap(parameters, runKeyMap); const paramString = parameters ? getParameterString(parameters) : ''; cmd = `${cmd} ${paramString}`; } @@ -76,11 +73,7 @@ export class DotNetClient { cmd = `${this.cliCommand.command} ${cmd}`; if (parameters) { - const mappedParameters = swapArrayFieldValueUsingMap( - parameters, - 'flag', - testKeyMap, - ); + const mappedParameters = swapKeysUsingMap(parameters, testKeyMap); const paramString = getParameterString(mappedParameters); cmd = `${cmd} ${paramString}`; } @@ -106,11 +99,7 @@ export class DotNetClient { ): void { let cmd = `${this.cliCommand.command} add ${project} package ${pkg}`; if (parameters) { - parameters = swapArrayFieldValueUsingMap( - parameters, - 'flag', - addPackageKeyMap, - ); + parameters = swapKeysUsingMap(parameters, addPackageKeyMap); const paramString = parameters ? getParameterString(parameters) : ''; cmd = `${cmd} ${paramString}`; } @@ -131,11 +120,7 @@ export class DotNetClient { ): void { let cmd = `${this.cliCommand.command} publish ${project}`; if (parameters) { - parameters = swapArrayFieldValueUsingMap( - parameters, - 'flag', - publishKeyMap, - ); + parameters = swapKeysUsingMap(parameters, publishKeyMap); const paramString = parameters ? getParameterString(parameters) : ''; cmd = `${cmd} ${paramString}`; } @@ -166,17 +151,18 @@ export class DotNetClient { format(project: string, parameters?: dotnetFormatOptions): void { let cmd = `${this.cliCommand.command} format ${project}`; if (parameters) { - parameters = swapArrayFieldValueUsingMap( - parameters, - 'flag', - formatKeyMap, - ); + parameters = swapKeysUsingMap(parameters, formatKeyMap); const paramString = parameters ? getParameterString(parameters) : ''; cmd = `${cmd} ${paramString}`; } return this.logAndExecute(cmd); } + addProjectToSolution(solutionFile: string, project: string) { + const cmd = `${this.cliCommand.command} sln "${solutionFile}" add "${project}"`; + this.logAndExecute(cmd); + } + getSdkVersion(): Buffer { const cmd = 'dotnet --version'; return this.execute(cmd); diff --git a/packages/dotnet/src/lib/models/dotnet-add-package/dotnet-add-package-options.ts b/packages/dotnet/src/lib/models/dotnet-add-package/dotnet-add-package-options.ts index 90b14bd2..1129f097 100644 --- a/packages/dotnet/src/lib/models/dotnet-add-package/dotnet-add-package-options.ts +++ b/packages/dotnet/src/lib/models/dotnet-add-package/dotnet-add-package-options.ts @@ -1,6 +1,5 @@ import { dotnetAddPackageFlags } from './dotnet-add-package-flags'; export type dotnetAddPackageOptions = { - flag: dotnetAddPackageFlags; - value?: string | boolean; -}[]; + [key in dotnetAddPackageFlags]?: string | boolean; +}; diff --git a/packages/dotnet/src/lib/models/dotnet-build/dotnet-build-options.ts b/packages/dotnet/src/lib/models/dotnet-build/dotnet-build-options.ts index ec53bc34..1e541085 100644 --- a/packages/dotnet/src/lib/models/dotnet-build/dotnet-build-options.ts +++ b/packages/dotnet/src/lib/models/dotnet-build/dotnet-build-options.ts @@ -1,6 +1,5 @@ import { dotnetBuildFlags } from './dotnet-build-flags'; export type dotnetBuildOptions = { - flag: dotnetBuildFlags; - value?: string | boolean; -}[]; + [key in dotnetBuildFlags]?: string | boolean; +}; diff --git a/packages/dotnet/src/lib/models/dotnet-format/dotnet-format-options.ts b/packages/dotnet/src/lib/models/dotnet-format/dotnet-format-options.ts index aa531713..169ad3bc 100644 --- a/packages/dotnet/src/lib/models/dotnet-format/dotnet-format-options.ts +++ b/packages/dotnet/src/lib/models/dotnet-format/dotnet-format-options.ts @@ -1,6 +1,5 @@ import { dotnetFormatFlags } from './dotnet-format-flags'; export type dotnetFormatOptions = { - flag: dotnetFormatFlags; - value?: string | boolean; -}[]; + [key in dotnetFormatFlags]?: string | boolean; +}; diff --git a/packages/dotnet/src/lib/models/dotnet-new/dotnet-new-options.ts b/packages/dotnet/src/lib/models/dotnet-new/dotnet-new-options.ts index b67c393f..f334d59b 100644 --- a/packages/dotnet/src/lib/models/dotnet-new/dotnet-new-options.ts +++ b/packages/dotnet/src/lib/models/dotnet-new/dotnet-new-options.ts @@ -1,6 +1,5 @@ import { dotnetNewFlags } from './dotnet-new-flags'; export type dotnetNewOptions = { - flag: dotnetNewFlags; - value?: string | boolean; -}[]; + [key in dotnetNewFlags]?: string | boolean; +}; diff --git a/packages/dotnet/src/lib/models/dotnet-publish/dotnet-publish-options.ts b/packages/dotnet/src/lib/models/dotnet-publish/dotnet-publish-options.ts index 0cb1ba43..4df92b95 100644 --- a/packages/dotnet/src/lib/models/dotnet-publish/dotnet-publish-options.ts +++ b/packages/dotnet/src/lib/models/dotnet-publish/dotnet-publish-options.ts @@ -1,6 +1,5 @@ import { dotnetPublishFlags } from './dotnet-publish-flags'; export type dotnetPublishOptions = { - flag: dotnetPublishFlags; - value?: string | boolean; -}[]; + [key in dotnetPublishFlags]?: string | boolean; +}; diff --git a/packages/dotnet/src/lib/models/dotnet-run/dotnet-run-options.ts b/packages/dotnet/src/lib/models/dotnet-run/dotnet-run-options.ts index 7672599c..0d2f57b6 100644 --- a/packages/dotnet/src/lib/models/dotnet-run/dotnet-run-options.ts +++ b/packages/dotnet/src/lib/models/dotnet-run/dotnet-run-options.ts @@ -1,6 +1,3 @@ import { dotnetRunFlags } from './dotnet-run-flags'; -export type dotnetRunOptions = { - flag: dotnetRunFlags; - value?: string | boolean; -}[]; +export type dotnetRunOptions = { [key in dotnetRunFlags]?: string | boolean }; diff --git a/packages/dotnet/src/lib/models/dotnet-test/dotnet-test-options.ts b/packages/dotnet/src/lib/models/dotnet-test/dotnet-test-options.ts index 41543361..370c43f1 100644 --- a/packages/dotnet/src/lib/models/dotnet-test/dotnet-test-options.ts +++ b/packages/dotnet/src/lib/models/dotnet-test/dotnet-test-options.ts @@ -1,6 +1,3 @@ import { dotnetTestFlags } from './dotnet-test-flags'; -export type dotnetTestOptions = { - flag: dotnetTestFlags; - value?: string | boolean; -}[]; +export type dotnetTestOptions = { [key in dotnetTestFlags]?: string | boolean }; diff --git a/packages/nx-ghpages/package.json b/packages/nx-ghpages/package.json index ec0a6da2..babc14f3 100644 --- a/packages/nx-ghpages/package.json +++ b/packages/nx-ghpages/package.json @@ -1,6 +1,5 @@ { "name": "@nx-dotnet/nx-ghpages", - "version": "1.6.0", "main": "src/index.js", "generators": "./generators.json", "executors": "./executors.json", @@ -24,5 +23,6 @@ "type": "git", "url": "https://github.com/nx-dotnet/nx-dotnet" }, - "homepage": "https://nx-dotnet.com/" + "homepage": "https://nx-dotnet.com/", + "version": "1.6.0" } diff --git a/packages/nx-ghpages/project.json b/packages/nx-ghpages/project.json index 29b8a706..5f6cee6a 100644 --- a/packages/nx-ghpages/project.json +++ b/packages/nx-ghpages/project.json @@ -18,6 +18,12 @@ "passWithNoTests": true } }, + "prebuild": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "commands": ["npx ts-node tools/scripts/patch-package-versions"] + } + }, "build": { "executor": "@nrwl/node:package", "outputs": ["{options.outputPath}"], @@ -50,6 +56,12 @@ } ] } + }, + "noop": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "echo" + } } }, "tags": [] diff --git a/packages/nxdoc/package.json b/packages/nxdoc/package.json index d2bb6e47..4bd496b5 100644 --- a/packages/nxdoc/package.json +++ b/packages/nxdoc/package.json @@ -1,6 +1,5 @@ { "name": "@nx-dotnet/nxdoc", - "version": "1.6.0", "main": "src/index.js", "generators": "./generators.json", "executors": "./executors.json", @@ -24,5 +23,6 @@ "repository": { "type": "git", "url": "https://github.com/nx-dotnet/nx-dotnet" - } + }, + "version": "1.6.0" } diff --git a/packages/nxdoc/project.json b/packages/nxdoc/project.json index 6d259506..c5d30150 100644 --- a/packages/nxdoc/project.json +++ b/packages/nxdoc/project.json @@ -18,6 +18,12 @@ "passWithNoTests": true } }, + "prebuild": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "commands": ["npx ts-node tools/scripts/patch-package-versions"] + } + }, "build": { "executor": "@nrwl/node:package", "outputs": ["{options.outputPath}"], @@ -50,6 +56,12 @@ } ] } + }, + "noop": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "echo" + } } }, "tags": [] diff --git a/packages/typescript/package.json b/packages/typescript/package.json index 00d92565..510b11ea 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -4,7 +4,6 @@ "generators": "./generators.json", "executors": "./executors.json", "license": "MIT", - "version": "1.6.0", "keywords": [ "Nx", ".NET", @@ -25,5 +24,6 @@ "repository": { "type": "git", "url": "https://github.com/nx-dotnet/nx-dotnet" - } + }, + "version": "1.6.0" } diff --git a/packages/typescript/project.json b/packages/typescript/project.json index f662cb69..f9513fc1 100644 --- a/packages/typescript/project.json +++ b/packages/typescript/project.json @@ -18,6 +18,12 @@ "passWithNoTests": true } }, + "prebuild": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "commands": ["npx ts-node tools/scripts/patch-package-versions"] + } + }, "build": { "executor": "@nrwl/node:package", "outputs": ["{options.outputPath}"], @@ -51,6 +57,12 @@ } ] } + }, + "noop": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "echo" + } } }, "tags": [] diff --git a/packages/utils/package.json b/packages/utils/package.json index 7c36f16d..0f652070 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -4,7 +4,6 @@ "private": false, "dependencies": {}, "license": "MIT", - "version": "1.6.0", "bugs": { "url": "https://github.com/nx-dotnet/nx-dotnet/issues?q=is%3Aopen", "email": "craigorycoppola+nxdotnet@gmail.com" @@ -24,5 +23,6 @@ "type": "git", "url": "https://github.com/nx-dotnet/nx-dotnet" }, - "homepage": "https://nx-dotnet.com/" + "homepage": "https://nx-dotnet.com/", + "version": "1.6.0" } diff --git a/packages/utils/project.json b/packages/utils/project.json index e94f2c58..c772ac08 100644 --- a/packages/utils/project.json +++ b/packages/utils/project.json @@ -18,6 +18,12 @@ "passWithNoTests": true } }, + "prebuild": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "commands": ["npx ts-node tools/scripts/patch-package-versions"] + } + }, "build": { "executor": "@nrwl/node:package", "outputs": ["{options.outputPath}"], @@ -29,6 +35,12 @@ "main": "packages/utils/src/index.ts", "assets": ["packages/utils/*.md"] } + }, + "noop": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "echo" + } } }, "tags": [] diff --git a/packages/utils/src/lib/models/nx-dotnet-config.interface.ts b/packages/utils/src/lib/models/nx-dotnet-config.interface.ts index 9fb87415..a2fed9cb 100644 --- a/packages/utils/src/lib/models/nx-dotnet-config.interface.ts +++ b/packages/utils/src/lib/models/nx-dotnet-config.interface.ts @@ -8,4 +8,5 @@ export interface NxDotnetConfig { [key: string]: string | undefined; }; moduleBoundaries?: ModuleBoundaries; + solutionFile?: string; } diff --git a/packages/utils/src/lib/utility-functions/args.ts b/packages/utils/src/lib/utility-functions/args.ts index 3fa1363b..ed4f80f9 100644 --- a/packages/utils/src/lib/utility-functions/args.ts +++ b/packages/utils/src/lib/utility-functions/args.ts @@ -3,9 +3,9 @@ export function isDryRun(): boolean { } export function swapKeysUsingMap( - object: Record, + object: Record, map: Record, -): Record { +): Record { return Object.fromEntries( Object.entries(object).map(([key, value]) => [ key in map ? map[key] : key, @@ -13,15 +13,3 @@ export function swapKeysUsingMap( ]), ); } - -export function swapArrayFieldValueUsingMap( - array: T[], - field: keyof T, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - map: any, -) { - return array.map((x) => ({ - ...x, - [field]: map[x[field]] ?? x[field], - })); -} diff --git a/packages/utils/src/lib/utility-functions/config.ts b/packages/utils/src/lib/utility-functions/config.ts index 1adb8d50..1d2a7e7e 100644 --- a/packages/utils/src/lib/utility-functions/config.ts +++ b/packages/utils/src/lib/utility-functions/config.ts @@ -5,6 +5,10 @@ import { readJsonSync } from 'fs-extra'; import { CONFIG_FILE_PATH } from '../constants'; import { NxDotnetConfig } from '../models'; +export const DefaultConfigValues: Partial = { + solutionFile: '{npmScope}.nx-dotnet.sln', +}; + export function readConfig(host?: Tree): NxDotnetConfig { return host ? readJson(host, CONFIG_FILE_PATH) @@ -14,3 +18,11 @@ export function readConfig(host?: Tree): NxDotnetConfig { export function updateConfig(host: Tree, value: NxDotnetConfig) { writeJson(host, CONFIG_FILE_PATH, value); } + +export function readConfigSection( + host: Tree, + section: T, +): Partial[T] { + const config = readConfig(host); + return config[section] || DefaultConfigValues[section]; +} diff --git a/packages/utils/src/lib/utility-functions/parameters.ts b/packages/utils/src/lib/utility-functions/parameters.ts index 31e340da..98c2b05f 100644 --- a/packages/utils/src/lib/utility-functions/parameters.ts +++ b/packages/utils/src/lib/utility-functions/parameters.ts @@ -1,20 +1,20 @@ -import { cmdLineParameter } from '../models'; - /** - * Transforms an array of cmdLineParameter into a string. + * Transforms an object of parameters into a string. * @param parameters Parameters to transform into CLI arguments * @returns Parameter string to be appended to CLI command */ -export function getParameterString(parameters: cmdLineParameter[]): string { - return parameters.reduce((acc, current) => { - if (typeof current.value === 'boolean' || !current.value) { - if (current.value) { - return acc + `--${current.flag} `; +export function getParameterString( + parameters: Record, +): string { + return Object.entries(parameters).reduce((acc, [flag, value]) => { + if (typeof value === 'boolean' || !value) { + if (value) { + return acc + `--${flag} `; } else { return acc; } } else { - return acc + `--${current.flag} ${current.value} `; + return acc + `--${flag} ${value} `; } }, ''); } diff --git a/tools/scripts/e2e.ts b/tools/scripts/e2e.ts index 1a98cfcc..b90a9c6f 100644 --- a/tools/scripts/e2e.ts +++ b/tools/scripts/e2e.ts @@ -1,24 +1,16 @@ -import { ChildProcess, execSync, spawn } from 'child_process'; -import { readdirSync, readFileSync } from 'fs'; -import { copySync, removeSync, writeFileSync } from 'fs-extra'; +import { execSync } from 'child_process'; +import { copySync, removeSync } from 'fs-extra'; import { e2eRoot } from '../../e2e/utils'; +import { startCleanVerdaccioInstance } from './local-registry/setup'; +import { publishAll } from './publish-all'; const kill = require('tree-kill'); -let verdaccioInstance: ChildProcess; - -export const getDirectories = (source: string) => - readdirSync(source, { withFileTypes: true }) - .filter((dirent) => dirent.isDirectory()) - .map((dirent) => dirent.name); - export function setup() { - // Remove previous packages with the same version - // before publishing the new ones - removeSync('../../tmp/local-registry'); + startCleanVerdaccioInstance(); copySync('.npmrc.local', '.npmrc'); - execSync('ts-node ./tools/scripts/publish-all 99.99.99 local'); + publishAll('99.99.99', 'local'); } async function runTest() { diff --git a/tools/scripts/local-registry/setup.ts b/tools/scripts/local-registry/setup.ts new file mode 100644 index 00000000..e227f17a --- /dev/null +++ b/tools/scripts/local-registry/setup.ts @@ -0,0 +1,40 @@ +import { ChildProcess, spawn } from 'child_process'; +import { removeSync } from 'fs-extra'; +import { join } from 'path'; + +let verdaccioInstance: ChildProcess; + +export function cleanupVerdaccioData() { + killVerdaccioInstance(); + // Remove previous packages with the same version + // before publishing the new ones + removeSync(join(__dirname, '../../../tmp/local-registry')); +} + +export function startCleanVerdaccioInstance() { + cleanupVerdaccioData(); + verdaccioInstance = spawn( + 'npx', + [ + 'verdaccio', + '--config', + './tools/scripts/local-registry/config.yml', + '--listen', + '4872', + ], + { + cwd: join(__dirname, '../../..'), + stdio: 'inherit', + }, + ); +} + +export function killVerdaccioInstance() { + if (verdaccioInstance) { + verdaccioInstance.kill(1); + } +} + +process.on('SIGINT', () => { + killVerdaccioInstance(); +}); diff --git a/tools/scripts/patch-package-versions/index.ts b/tools/scripts/patch-package-versions/index.ts index b7468dbb..3e1293fb 100644 --- a/tools/scripts/patch-package-versions/index.ts +++ b/tools/scripts/patch-package-versions/index.ts @@ -6,17 +6,25 @@ import { join } from 'path'; import { existsSync, + getWorkspacePackages, readJson, readWorkspaceJson, writeJson, } from '../../utils'; -export function PatchPackageVersions(newVersion: string, updateGit = true) { +export function PatchPackageVersions( + newVersion: string, + updateGit = true, + prebuild = false, +) { const workspace: WorkspaceJsonConfiguration = readWorkspaceJson(); const rootPkg = readJson('package.json'); - - rootPkg.version = newVersion; - writeJson('package.json', rootPkg); + if (newVersion && prebuild) { + rootPkg.version = newVersion; + writeJson('package.json', rootPkg); + } else if (!newVersion) { + newVersion = rootPkg.version; + } if (updateGit) { execSync(`git add package.json`, { @@ -27,13 +35,23 @@ export function PatchPackageVersions(newVersion: string, updateGit = true) { const projects = Object.values(workspace.projects); projects.forEach((projectConfiguration, idx) => { - const pkgPath = `${projectConfiguration.root}/package.json`; + if (!projectConfiguration.targets?.build) { + return; + } + + const pkgPath = `${ + prebuild + ? projectConfiguration.root + : projectConfiguration.targets?.build.options.outputPath + }/package.json`; if (!existsSync(pkgPath)) { console.log('pkgPath not found', pkgPath); return; } const pkg = readJson(pkgPath); pkg.version = newVersion; + patchDependenciesSection('dependencies', pkg, newVersion); + patchDependenciesSection('devDependencies', pkg, newVersion); writeJson(pkgPath, pkg); @@ -57,6 +75,19 @@ export function PatchPackageVersions(newVersion: string, updateGit = true) { } } +function patchDependenciesSection( + section: 'dependencies' | 'devDependencies', + packageJson: any, + version: string, +) { + const localPackages = getWorkspacePackages(); + Object.keys(packageJson[section] || {}).forEach((pkg) => { + if (localPackages.includes(pkg)) { + packageJson[section][pkg] = version; + } + }); +} + if (require.main === module) { - PatchPackageVersions(process.argv[2], false); + PatchPackageVersions(process.argv[2], false, true); } diff --git a/tools/scripts/publish-all/index.ts b/tools/scripts/publish-all/index.ts index ef1ef8e1..b1202da5 100644 --- a/tools/scripts/publish-all/index.ts +++ b/tools/scripts/publish-all/index.ts @@ -6,16 +6,16 @@ import { existsSync } from 'fs'; import { readJson, readWorkspaceJson } from '../../utils'; import { PatchPackageVersions } from '../patch-package-versions'; -export function PublishAll(version: string, tag = 'latest') { +export function publishAll(version: string, tag = 'latest') { const workspace: WorkspaceJsonConfiguration = readWorkspaceJson(); const rootPkg = readJson('package.json'); - PatchPackageVersions(version, false); - execSync('npx nx run-many --all --target="build"', { stdio: 'inherit', }); + PatchPackageVersions(version, false); + const projects = Object.values(workspace.projects); const environment = { ...process.env, @@ -34,5 +34,5 @@ export function PublishAll(version: string, tag = 'latest') { } if (require.main === module) { - PublishAll(process.argv[2], process.argv[3] || 'latest'); + publishAll(process.argv[2], process.argv[3] || 'latest'); } diff --git a/tools/scripts/sandbox.ts b/tools/scripts/sandbox.ts new file mode 100644 index 00000000..45437e11 --- /dev/null +++ b/tools/scripts/sandbox.ts @@ -0,0 +1,48 @@ +import { execSync } from 'child_process'; +import { + copySync, + ensureDirSync, + existsSync, + readJsonSync, + removeSync, +} from 'fs-extra'; +import { basename, dirname, join, resolve } from 'path'; +import { getWorkspacePackages } from '../utils'; +import { appRootPath } from '@nrwl/tao/src/utils/app-root'; +import { startCleanVerdaccioInstance } from './local-registry/setup'; + +const sandboxDirectory = join(__dirname, '../../tmp/sandbox'); + +export function setup() { + copySync('.npmrc.local', '.npmrc'); + startCleanVerdaccioInstance(); + execSync('ts-node ./tools/scripts/publish-all 99.99.99 local', { + env: { + ...process.env, + NPM_CONFIG_REGISTRY: 'http://localhost:4872', + YARN_REGISTRY: 'http://localhost:4872', + }, + }); +} + +if (require.main === module) { + setup(); + if (existsSync(sandboxDirectory)) { + removeSync(sandboxDirectory); + } + execSync( + `npx create-nx-workspace@latest ${basename( + sandboxDirectory, + )} --preset empty --no-nxCloud --packageManager yarn`, + { + cwd: dirname(sandboxDirectory), + stdio: 'inherit', + }, + ); + copySync('.npmrc.local', join(sandboxDirectory, '.npmrc')); + execSync(`yarn add --dev ${getWorkspacePackages().join(' ')}`, { + cwd: sandboxDirectory, + stdio: 'inherit', + }); + console.log('Sandbox created at', resolve(sandboxDirectory)); +} diff --git a/tools/utils/nx.ts b/tools/utils/nx.ts index 437e524b..ec1eead1 100644 --- a/tools/utils/nx.ts +++ b/tools/utils/nx.ts @@ -1,3 +1,21 @@ +import { appRootPath } from '@nrwl/tao/src/utils/app-root'; +import { existsSync } from 'fs'; +import { readJsonSync } from 'fs-extra'; +import { join } from 'path'; +import { readWorkspaceJson } from './fs'; + export function isDryRun() { return process.argv.includes('--dry-run'); } + +export function getWorkspacePackages(): string[] { + const w = readWorkspaceJson(); + return Object.values(w.projects).reduce((packages, configuration) => { + const path = join(appRootPath, configuration.root, 'package.json'); + if (existsSync(path)) { + const { name } = readJsonSync(path); + packages.push(name); + } + return packages; + }, [] as string[]); +} diff --git a/yarn.lock b/yarn.lock index 900dc338..853a6ff4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6945,6 +6945,11 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" +get-them-args@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/get-them-args/-/get-them-args-1.3.2.tgz#74a20ba8a4abece5ae199ad03f2bcc68fdfc9ba5" + integrity sha1-dKILqKSr7OWuGZrQPyvMaP38m6U= + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -9149,6 +9154,14 @@ keyv@^3.0.0: dependencies: json-buffer "3.0.0" +kill-port@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/kill-port/-/kill-port-1.6.1.tgz#560fe79484583bdf3a5e908557dae614447618aa" + integrity sha512-un0Y55cOM7JKGaLnGja28T38tDDop0AQ8N0KlAdyh+B1nmMoX8AnNmqPNZbS3mUMgiST51DCVqmbFT1gNJpVNw== + dependencies: + get-them-args "1.3.2" + shell-exec "1.0.2" + killable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" @@ -12957,6 +12970,11 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +shell-exec@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/shell-exec/-/shell-exec-1.0.2.tgz#2e9361b0fde1d73f476c4b6671fa17785f696756" + integrity sha512-jyVd+kU2X+mWKMmGhx4fpWbPsjvD53k9ivqetutVW/BQ+WIZoDoP4d8vUMGezV6saZsiNoW2f9GIhg9Dondohg== + shell-quote@1.7.2: version "1.7.2" resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" From 8fdc4790fbb5cf5329e29908e3df61871761200b Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 29 Nov 2021 15:07:16 +0000 Subject: [PATCH 9/9] release: 1.7.0 [skip ci] # [1.7.0](https://github.com/nx-dotnet/nx-dotnet/compare/v1.6.0...v1.7.0) (2021-11-29) ### Features * **core:** support for workspace solution files ([#254](https://github.com/nx-dotnet/nx-dotnet/issues/254)) ([ec342ae](https://github.com/nx-dotnet/nx-dotnet/commit/ec342ae2699b7ca5fad0aee717d67ded3c0a9524)) Nov 29, 2021, 3:07 PM --- CHANGELOG.md | 6 ++++++ package.json | 2 +- packages/core/package.json | 2 +- packages/dotnet/package.json | 2 +- packages/nx-ghpages/package.json | 2 +- packages/nxdoc/package.json | 2 +- packages/typescript/package.json | 2 +- packages/utils/package.json | 2 +- 8 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61688a46..f378c530 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# [1.7.0](https://github.com/nx-dotnet/nx-dotnet/compare/v1.6.0...v1.7.0) (2021-11-29) + +### Features + +- **core:** support for workspace solution files ([#254](https://github.com/nx-dotnet/nx-dotnet/issues/254)) ([ec342ae](https://github.com/nx-dotnet/nx-dotnet/commit/ec342ae2699b7ca5fad0aee717d67ded3c0a9524)) + # [1.6.0](https://github.com/nx-dotnet/nx-dotnet/compare/v1.5.2...v1.6.0) (2021-10-22) ### Features diff --git a/package.json b/package.json index 42dff228..25bf90d7 100644 --- a/package.json +++ b/package.json @@ -92,5 +92,5 @@ "type": "git", "url": "https://github.com/nx-dotnet/nx-dotnet.git" }, - "version": "1.6.0" + "version": "1.7.0" } diff --git a/packages/core/package.json b/packages/core/package.json index 7dfab848..ae2e9ae2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -32,5 +32,5 @@ "nx-migrations": { "migrations": "./migrations.json" }, - "version": "1.6.0" + "version": "1.7.0" } diff --git a/packages/dotnet/package.json b/packages/dotnet/package.json index ed8c81a5..d87204b9 100644 --- a/packages/dotnet/package.json +++ b/packages/dotnet/package.json @@ -20,5 +20,5 @@ "url": "https://github.com/nx-dotnet/nx-dotnet" }, "homepage": "https://nx-dotnet.com/", - "version": "1.6.0" + "version": "1.7.0" } diff --git a/packages/nx-ghpages/package.json b/packages/nx-ghpages/package.json index babc14f3..781b3e51 100644 --- a/packages/nx-ghpages/package.json +++ b/packages/nx-ghpages/package.json @@ -24,5 +24,5 @@ "url": "https://github.com/nx-dotnet/nx-dotnet" }, "homepage": "https://nx-dotnet.com/", - "version": "1.6.0" + "version": "1.7.0" } diff --git a/packages/nxdoc/package.json b/packages/nxdoc/package.json index 4bd496b5..11cb3ef1 100644 --- a/packages/nxdoc/package.json +++ b/packages/nxdoc/package.json @@ -24,5 +24,5 @@ "type": "git", "url": "https://github.com/nx-dotnet/nx-dotnet" }, - "version": "1.6.0" + "version": "1.7.0" } diff --git a/packages/typescript/package.json b/packages/typescript/package.json index 510b11ea..1dbc27bb 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -25,5 +25,5 @@ "type": "git", "url": "https://github.com/nx-dotnet/nx-dotnet" }, - "version": "1.6.0" + "version": "1.7.0" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 0f652070..e0893739 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -24,5 +24,5 @@ "url": "https://github.com/nx-dotnet/nx-dotnet" }, "homepage": "https://nx-dotnet.com/", - "version": "1.6.0" + "version": "1.7.0" }