@code-pushup/nx-plugin 0.53.1 → 0.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,7 +10,7 @@ Register this plugin in your `nx.json` to leverage a set of generators and execu
10
10
  // nx.json
11
11
  {
12
12
  //...
13
- "plugins": ["@code-pushup/nx-plugin"]
13
+ "plugins": ["@code-pushup/nx-plugin"],
14
14
  }
15
15
  ```
16
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-pushup/nx-plugin",
3
- "version": "0.53.1",
3
+ "version": "0.55.0",
4
4
  "license": "MIT",
5
5
  "description": "Nx plugin to integrate the Code PushUp CLI into your workspace 🛠️",
6
6
  "publishConfig": {
@@ -33,10 +33,10 @@
33
33
  "executors": "./executors.json",
34
34
  "dependencies": {
35
35
  "@nx/devkit": "^17.1.3",
36
- "tslib": "2.6.3",
36
+ "tslib": "^2.6.2",
37
37
  "nx": "^17.1.3",
38
- "@code-pushup/models": "0.53.1",
38
+ "@code-pushup/models": "0.55.0",
39
39
  "zod": "^3.22.4",
40
- "@code-pushup/utils": "0.53.1"
40
+ "@code-pushup/utils": "0.55.0"
41
41
  }
42
42
  }
@@ -15,9 +15,9 @@ Configure a target in your project json.
15
15
  "name": "my-project",
16
16
  "targets": {
17
17
  "code-pushup": {
18
- "executor": "@code-pushup/nx-plugin:cli"
19
- }
20
- }
18
+ "executor": "@code-pushup/nx-plugin:cli",
19
+ },
20
+ },
21
21
  }
22
22
  ```
23
23
 
@@ -54,11 +54,11 @@ The following things happen:
54
54
  "options": {
55
55
  "projectPrefix": "cli", // upload.project = cli-my-project
56
56
  "verbose": true,
57
- "progress": false
57
+ "progress": false,
58
58
  // persist and upload options as defined in CoreConfig
59
- }
60
- }
61
- }
59
+ },
60
+ },
61
+ },
62
62
  }
63
63
  ```
64
64
 
@@ -12,12 +12,18 @@ function parseAutorunExecutorOnlyOptions(options) {
12
12
  }
13
13
  exports.parseAutorunExecutorOnlyOptions = parseAutorunExecutorOnlyOptions;
14
14
  function parseAutorunExecutorOptions(options, normalizedContext) {
15
- const { projectPrefix, persist, upload } = options;
15
+ const { projectPrefix, persist, upload, command } = options;
16
+ const needsUploadParams = command === 'upload' || command === 'autorun' || command === undefined;
16
17
  return {
17
18
  ...parseAutorunExecutorOnlyOptions(options),
18
19
  ...(0, config_1.globalConfig)(options, normalizedContext),
19
20
  persist: (0, config_1.persistConfig)({ projectPrefix, ...persist }, normalizedContext),
20
- upload: (0, config_1.uploadConfig)({ projectPrefix, ...upload }, normalizedContext),
21
+ // @TODO This is a hack to avoid validation errors of upload config for commands that dont need it.
22
+ // Fix: use utils and execute the core logic directly
23
+ // Blocked by Nx plugins can't compile to es6
24
+ upload: needsUploadParams
25
+ ? (0, config_1.uploadConfig)({ projectPrefix, ...upload }, normalizedContext)
26
+ : undefined,
21
27
  };
22
28
  }
23
29
  exports.parseAutorunExecutorOptions = parseAutorunExecutorOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/cli/utils.ts"],"names":[],"mappings":";;;AAAA,+CAA+E;AAO/E,SAAgB,+BAA+B,CAC7C,OAAmD;IAEnD,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IACvD,OAAO;QACL,GAAG,CAAC,aAAa,IAAI,EAAE,aAAa,EAAE,CAAC;QACvC,GAAG,CAAC,MAAM,IAAI,IAAI,IAAI,EAAE,MAAM,EAAE,CAAC;QACjC,GAAG,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,CAAC;KACpC,CAAC;AACJ,CAAC;AATD,0EASC;AAED,SAAgB,2BAA2B,CACzC,OAA+C,EAC/C,iBAA4C;IAE5C,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IACnD,OAAO;QACL,GAAG,+BAA+B,CA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AM,EAAE,iBAAiB;YACvB,CAAC,CAAC,IAAA,qBAAY,EAAC,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,EAAE,iBAAiB,CAAC;YAC/D,CAAC,CAAC,SAAS;KACd,CAAC;AACJ,CAAC;AAlBD,kEAkBC"}
@@ -16,8 +16,9 @@ export type ProjectExecutorOnlyOptions = {
16
16
  /**
17
17
  * CLI types that apply globally for all commands.
18
18
  */
19
+ export type Command = 'collect' | 'upload' | 'autorun' | 'print-config' | 'compare' | 'merge-diffs' | 'history';
19
20
  export type GlobalExecutorOptions = {
20
- command?: 'collect' | 'upload' | 'autorun' | 'print-config' | 'compare' | 'merge-diffs' | 'history';
21
+ command?: Command;
21
22
  bin?: string;
22
23
  verbose?: boolean;
23
24
  progress?: boolean;
@@ -15,7 +15,7 @@ Why should you use this plugin?
15
15
  // nx.json
16
16
  {
17
17
  //...
18
- "plugins": ["@code-pushup/nx-plugin"]
18
+ "plugins": ["@code-pushup/nx-plugin"],
19
19
  }
20
20
  ```
21
21
 
@@ -29,10 +29,10 @@ or with options:
29
29
  {
30
30
  "plugin": "@code-pushup/nx-plugin",
31
31
  "options": {
32
- "projectPrefix": "cli"
33
- }
34
- }
35
- ]
32
+ "projectPrefix": "cli",
33
+ },
34
+ },
35
+ ],
36
36
  }
37
37
  ```
38
38