@@ -49,9 +49,17 @@ export default {
4949 "coverage.reportsDirectory" : " {projectRoot}/coverage/unit-test"
5050 }
5151 },
52+ "code-pushup-js-packages" : {
53+ "cache" : false ,
54+ "executor" : " nx:run-commands" ,
55+ "options" : {
56+ "command" : " npx @code-pushup/cli collect" ,
57+ "args" : [" --config={projectRoot}/code-pushup.config.ts" , " --cache.write=true" , " --persist.skipReports=true" , " --persist.outputDir={projectRoot}/.code-pushup" , " --upload.project={projectName}" ]
58+ }
59+ },
5260 "code-pushup-coverage" : {
5361 "cache" : true ,
54- "outputs" : [" {projectRoot}/.code-pushup/coverage" ],
62+ "outputs" : [" {projectRoot}/.code-pushup/coverage/runner-output.json " ],
5563 "executor" : " nx:run-commands" ,
5664 "options" : {
5765 "command" : " npx @code-pushup/cli collect" ,
@@ -61,13 +69,13 @@ export default {
6169 },
6270 "code-pushup" : {
6371 "cache" : true ,
64- "outputs" : [" {projectRoot}/.code-pushup" ],
72+ "outputs" : [" {projectRoot}/.code-pushup/report.* " ],
6573 "executor" : " nx:run-commands" ,
6674 "options" : {
6775 "command" : " npx @code-pushup/cli" ,
6876 "args" : [" --config={projectRoot}/code-pushup.config.ts" , " --cache.read=true" , " --persist.outputDir={projectRoot}/.code-pushup" , " --upload.project={projectName}" ]
6977 },
70- "dependsOn" : [" code-pushup-coverage" ]
78+ "dependsOn" : [" code-pushup-coverage" , " code-pushup-js-packages " ]
7179 }
7280 }
7381}
@@ -80,12 +88,14 @@ This configuration creates the following task dependency graph:
8088** Legend:**
8189
8290- 🐳 = Cached target
91+ - 💾 = Parallel execution
8392
8493``` mermaid
8594graph TD
86- A[lib-a:code-pushup 🐳] --> B[lib-a:code-pushup-coverage 🐳]
87- B --> C[lib-a:unit-test 🐳]
88- B --> D[lib-a:int-test 🐳]
95+ A[lib-a:code-pushup 🐳] --> B[lib-a:code-pushup-coverage 💾🐳]
96+ A --> C[lib-a:code-pushup-js-packages 💾]
97+ B --> C[lib-a:unit-test 💾🐳]
98+ B --> D[lib-a:int-test 💾🐳]
8999```
90100
91101## Command Line Example
@@ -100,7 +110,7 @@ nx affected --target=code-pushup
100110
101111This approach has the following benefits:
102112
103- 1 . ** Parallel Execution** : Plugins can run in parallel
104- 2 . ** Fine-grained Caching** : Code level cache invalidation enables usage of [ affected] ( https://nx.dev/recipes/affected-tasks ) command
113+ 1 . ** 💾 Parallel Execution** : Plugins can run in parallel
114+ 2 . ** 🐳 Fine-grained Caching** : Code level cache invalidation enables usage of [ affected] ( https://nx.dev/recipes/affected-tasks ) command
1051153 . ** Dependency Management** : Leverage Nx task dependencies and its caching strategy
1061164 . ** Clear Separation** : Each plugin has its own target for better debugging and maintainability
0 commit comments