nx 22.2.0-canary.20251203-2e442d5 → 22.2.0-canary.20251208-300493e

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.
@@ -1,185 +1,185 @@
1
1
  {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "https://nx.dev",
4
- "title": "JSON schema for Nx workspaces",
5
- "type": "object",
6
- "properties": {
7
- "version": {
8
- "type": "number",
9
- "enum": [1, 2]
10
- }
11
- },
12
- "allOf": [
13
- {
14
- "if": {
15
- "properties": { "version": { "const": 2 } },
16
- "required": ["version"]
17
- },
18
- "then": {
19
- "properties": {
20
- "projects": {
21
- "type": "object",
22
- "additionalProperties": {
23
- "oneOf": [
24
- {
25
- "type": "string"
26
- },
27
- {
28
- "type": "object",
29
- "properties": {
30
- "targets": {
31
- "type": "object",
32
- "description": "Configures all the targets which define what tasks you can run against the project",
33
- "additionalProperties": {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "https://nx.dev",
4
+ "title": "JSON schema for Nx workspaces",
5
+ "type": "object",
6
+ "properties": {
7
+ "version": {
8
+ "type": "number",
9
+ "enum": [1, 2]
10
+ }
11
+ },
12
+ "allOf": [
13
+ {
14
+ "if": {
15
+ "properties": { "version": { "const": 2 } },
16
+ "required": ["version"]
17
+ },
18
+ "then": {
19
+ "properties": {
20
+ "projects": {
34
21
  "type": "object",
35
- "properties": {
36
- "executor": {
37
- "description": "The function that Nx will invoke when you run this target",
38
- "type": "string"
39
- },
40
- "options": {
41
- "type": "object"
42
- },
43
- "outputs": {
44
- "type": "array",
45
- "items": {
46
- "type": "string"
47
- }
48
- },
49
- "configurations": {
50
- "type": "object",
51
- "description": "provides extra sets of values that will be merged into the options map",
52
- "additionalProperties": {
53
- "type": "object"
54
- }
55
- },
56
- "dependsOn": {
57
- "type": "array",
58
- "description": "Target dependency.",
59
- "items": {
60
- "oneOf": [
22
+ "additionalProperties": {
23
+ "oneOf": [
61
24
  {
62
- "type": "string"
25
+ "type": "string"
63
26
  },
64
27
  {
65
- "type": "object",
66
- "properties": {
67
- "projects": {
68
- "oneOf": [
69
- {
70
- "type": "string",
71
- "description": "A project name"
28
+ "type": "object",
29
+ "properties": {
30
+ "targets": {
31
+ "type": "object",
32
+ "description": "Configures all the targets which define what tasks you can run against the project",
33
+ "additionalProperties": {
34
+ "type": "object",
35
+ "properties": {
36
+ "executor": {
37
+ "description": "The function that Nx will invoke when you run this target",
38
+ "type": "string"
39
+ },
40
+ "options": {
41
+ "type": "object"
42
+ },
43
+ "outputs": {
44
+ "type": "array",
45
+ "items": {
46
+ "type": "string"
47
+ }
48
+ },
49
+ "configurations": {
50
+ "type": "object",
51
+ "description": "provides extra sets of values that will be merged into the options map",
52
+ "additionalProperties": {
53
+ "type": "object"
54
+ }
55
+ },
56
+ "dependsOn": {
57
+ "type": "array",
58
+ "description": "Target dependency.",
59
+ "items": {
60
+ "oneOf": [
61
+ {
62
+ "type": "string"
63
+ },
64
+ {
65
+ "type": "object",
66
+ "properties": {
67
+ "projects": {
68
+ "oneOf": [
69
+ {
70
+ "type": "string",
71
+ "description": "A project name"
72
+ },
73
+ {
74
+ "type": "array",
75
+ "description": "An array of project names",
76
+ "items": {
77
+ "type": "string"
78
+ }
79
+ }
80
+ ]
81
+ },
82
+ "dependencies": {
83
+ "type": "boolean"
84
+ },
85
+ "target": {
86
+ "type": "string",
87
+ "description": "The name of the target."
88
+ },
89
+ "params": {
90
+ "type": "string",
91
+ "description": "Configuration for params handling.",
92
+ "enum": ["ignore", "forward"],
93
+ "default": "ignore"
94
+ }
95
+ },
96
+ "oneOf": [
97
+ {
98
+ "required": ["projects", "target"]
99
+ },
100
+ {
101
+ "required": ["dependencies", "target"]
102
+ },
103
+ {
104
+ "required": ["target"],
105
+ "not": {
106
+ "anyOf": [
107
+ { "required": ["projects"] },
108
+ { "required": ["dependencies"] }
109
+ ]
110
+ }
111
+ }
112
+ ],
113
+ "additionalProperties": false
114
+ }
115
+ ]
116
+ }
117
+ },
118
+ "command": {
119
+ "type": "string",
120
+ "description": "A shorthand for using the nx:run-commands executor"
121
+ },
122
+ "cache": {
123
+ "type": "boolean",
124
+ "description": "Specifies if the given target should be cacheable"
125
+ }
126
+ }
127
+ }
128
+ },
129
+ "tags": {
130
+ "type": "array",
131
+ "items": {
132
+ "type": "string"
133
+ }
72
134
  },
73
- {
74
- "type": "array",
75
- "description": "An array of project names",
76
- "items": {
77
- "type": "string"
78
- }
135
+ "implicitDependencies": {
136
+ "type": "array",
137
+ "items": {
138
+ "type": "string"
139
+ }
79
140
  }
80
- ]
81
- },
82
- "dependencies": {
83
- "type": "boolean"
84
- },
85
- "target": {
86
- "type": "string",
87
- "description": "The name of the target."
88
- },
89
- "params": {
90
- "type": "string",
91
- "description": "Configuration for params handling.",
92
- "enum": ["ignore", "forward"],
93
- "default": "ignore"
94
141
  }
95
- },
96
- "oneOf": [
97
- {
98
- "required": ["projects", "target"]
99
- },
100
- {
101
- "required": ["dependencies", "target"]
102
- },
103
- {
104
- "required": ["target"],
105
- "not": {
106
- "anyOf": [
107
- { "required": ["projects"] },
108
- { "required": ["dependencies"] }
109
- ]
110
- }
111
- }
112
- ],
113
- "additionalProperties": false
114
142
  }
115
- ]
116
- }
117
- },
118
- "command": {
119
- "type": "string",
120
- "description": "A shorthand for using the nx:run-commands executor"
121
- },
122
- "cache": {
123
- "type": "boolean",
124
- "description": "Specifies if the given target should be cacheable"
125
- }
143
+ ]
126
144
  }
127
- }
128
- },
129
- "tags": {
130
- "type": "array",
131
- "items": {
132
- "type": "string"
133
- }
134
- },
135
- "implicitDependencies": {
136
- "type": "array",
137
- "items": {
138
- "type": "string"
139
- }
140
145
  }
141
- }
142
146
  }
143
- ]
144
- }
145
- }
146
- }
147
- },
148
- "else": {
149
- "properties": {
150
- "projects": {
151
- "type": "object",
152
- "additionalProperties": {
153
- "type": "object",
154
- "properties": {
155
- "architect": {
156
- "type": "object",
157
- "description": "Configures all the targets which define what tasks you can run against the project",
158
- "additionalProperties": {
159
- "type": "object",
160
- "properties": {
161
- "builder": {
162
- "description": "The function that Nx will invoke when you run this architect",
163
- "type": "string"
164
- },
165
- "options": {
166
- "type": "object"
167
- },
168
- "configurations": {
147
+ },
148
+ "else": {
149
+ "properties": {
150
+ "projects": {
169
151
  "type": "object",
170
- "description": "provides extra sets of values that will be merged into the options map",
171
152
  "additionalProperties": {
172
- "type": "object"
153
+ "type": "object",
154
+ "properties": {
155
+ "architect": {
156
+ "type": "object",
157
+ "description": "Configures all the targets which define what tasks you can run against the project",
158
+ "additionalProperties": {
159
+ "type": "object",
160
+ "properties": {
161
+ "builder": {
162
+ "description": "The function that Nx will invoke when you run this architect",
163
+ "type": "string"
164
+ },
165
+ "options": {
166
+ "type": "object"
167
+ },
168
+ "configurations": {
169
+ "type": "object",
170
+ "description": "provides extra sets of values that will be merged into the options map",
171
+ "additionalProperties": {
172
+ "type": "object"
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+ }
173
179
  }
174
- }
175
180
  }
176
- }
177
181
  }
178
- }
179
182
  }
180
- }
181
183
  }
182
- }
183
- }
184
- ]
184
+ ]
185
185
  }
@@ -1,34 +1,34 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "$id": "SetupAiAgents",
4
- "title": "Set Up AI Agents",
5
- "description": "Sets up the Nx MCP & rule files for common AI Agents.",
6
- "type": "object",
7
- "properties": {
8
- "directory": {
9
- "type": "string",
10
- "description": "Directory where the AI agent configuration files will be generated",
11
- "default": "."
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "SetupAiAgents",
4
+ "title": "Set Up AI Agents",
5
+ "description": "Sets up the Nx MCP & rule files for common AI Agents.",
6
+ "type": "object",
7
+ "properties": {
8
+ "directory": {
9
+ "type": "string",
10
+ "description": "Directory where the AI agent configuration files will be generated",
11
+ "default": "."
12
+ },
13
+ "writeNxCloudRules": {
14
+ "type": "boolean",
15
+ "description": "Whether to write Nx Cloud rules",
16
+ "default": false
17
+ },
18
+ "packageVersion": {
19
+ "type": "string",
20
+ "description": "The version of the package to use",
21
+ "default": "latest"
22
+ },
23
+ "agents": {
24
+ "type": "array",
25
+ "description": "The agents to setup Nx configuration for.",
26
+ "items": {
27
+ "type": "string",
28
+ "enum": ["claude", "gemini", "codex", "cursor", "copilot"]
29
+ },
30
+ "default": ["claude", "gemini", "codex", "cursor", "copilot"]
31
+ }
12
32
  },
13
- "writeNxCloudRules": {
14
- "type": "boolean",
15
- "description": "Whether to write Nx Cloud rules",
16
- "default": false
17
- },
18
- "packageVersion": {
19
- "type": "string",
20
- "description": "The version of the package to use",
21
- "default": "latest"
22
- },
23
- "agents": {
24
- "type": "array",
25
- "description": "The agents to setup Nx configuration for.",
26
- "items": {
27
- "type": "string",
28
- "enum": ["claude", "gemini", "codex", "cursor", "copilot"]
29
- },
30
- "default": ["claude", "gemini", "codex", "cursor", "copilot"]
31
- }
32
- },
33
- "required": ["directory"]
33
+ "required": ["directory"]
34
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/graph/graph.ts"],"names":[],"mappings":"AA0BA,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAwBpD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,EAAE,CAAC,CAA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AO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,EACD,gBAAgB,EAAE,MAAM,EAAE,GACzB,OAAO,CAAC,IAAI,CAAC,CA8Tf;AAuvBD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC;CACrB"}
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/graph/graph.ts"],"names":[],"mappings":"AA0BA,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAwBpD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,EAAE,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,EAAE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S,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC;CACrB"}
@@ -92,10 +92,10 @@ function projectExists(projects, projectToFind) {
92
92
  function hasPath(graph, target, node, visited) {
93
93
  if (target === node)
94
94
  return true;
95
- for (let d of graph.dependencies[node] || []) {
96
- if (visited.indexOf(d.target) > -1)
95
+ for (const d of graph.dependencies[node] || []) {
96
+ if (visited.has(d.target))
97
97
  continue;
98
- visited.push(d.target);
98
+ visited.add(d.target);
99
99
  if (hasPath(graph, target, d.target, visited))
100
100
  return true;
101
101
  }
@@ -107,7 +107,8 @@ function filterGraph(graph, focus, exclude) {
107
107
  if (focus !== null) {
108
108
  filteredProjectNames = new Set();
109
109
  projectNames.forEach((p) => {
110
- const isInPath = hasPath(graph, p, focus, []) || hasPath(graph, focus, p, []);
110
+ const isInPath = hasPath(graph, p, focus, new Set()) ||
111
+ hasPath(graph, focus, p, new Set());
111
112
  if (isInPath) {
112
113
  filteredProjectNames.add(p);
113
114
  }
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/git.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAA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,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,SAAS,EAAE,CAEjE;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,IAAI,CAiBP;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,EAAE,CAiC7E;AA2BD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,GAAG;IAC5D,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B,CAKA;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI,CAqDrE;AAED,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,mBAM9C;AAED,wBAAsB,iBAAiB,oBAatC"}
1
+ {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/git.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C,WAAW,EAAE,MAAM,CAA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AAE,CAEjE;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,IAAI,CAiBP;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,EAAE,CAiC7E;AA2BD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,GAAG;IAC5D,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B,CAKA;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI,CAqDrE;AAED,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,mBAM9C;AAED,wBAAsB,iBAAiB,oBAatC"}
@@ -21,6 +21,7 @@ exports.getFirstGitCommit = getFirstGitCommit;
21
21
  */
22
22
  const node_path_1 = require("node:path");
23
23
  const minimatch_1 = require("minimatch");
24
+ const semver_1 = require("semver");
24
25
  const utils_1 = require("../../../tasks-runner/utils");
25
26
  const workspace_root_1 = require("../../../utils/workspace-root");
26
27
  const exec_command_1 = require("./exec-command");
@@ -199,8 +200,16 @@ async function getLatestGitTagForPattern(releaseTagPattern, additionalInterpolat
199
200
  // If not using strict preid, we can just return the first matching tag
200
201
  return extractTagAndVersion(matchingTags[0], tagRegexp, options);
201
202
  }
203
+ // Find stable release tags
204
+ const stableReleaseTags = matchingTags.filter((tag) => {
205
+ const matches = tag.match(tagRegexp);
206
+ if (!matches)
207
+ return false;
208
+ const [, version] = matches;
209
+ return version && !(0, shared_1.isPrerelease)(version);
210
+ });
202
211
  if (preid && preid.length > 0) {
203
- // When a preid is provided, first try to find a tag for it
212
+ // When a preid is provided, find tags matching that preid
204
213
  const preidReleaseTags = matchingTags.filter((tag) => {
205
214
  const match = tag.match(tagRegexp);
206
215
  if (!match)
@@ -208,18 +217,30 @@ async function getLatestGitTagForPattern(releaseTagPattern, additionalInterpolat
208
217
  const version = match.find((part) => part.match(SEMVER_REGEX));
209
218
  return version && version.includes(`-${preid}.`);
210
219
  });
220
+ // If both preid and stable tags exist, compare them to determine which is truly "latest"
221
+ if (preidReleaseTags.length > 0 && stableReleaseTags.length > 0) {
222
+ const preidResult = extractTagAndVersion(preidReleaseTags[0], tagRegexp, options);
223
+ const stableResult = extractTagAndVersion(stableReleaseTags[0], tagRegexp, options);
224
+ // Get the base version of the preid release (e.g., "1.2.4" from "1.2.4-alpha.1")
225
+ const preidBaseVersion = (0, semver_1.coerce)(preidResult.extractedVersion)?.version;
226
+ const stableVersion = stableResult.extractedVersion;
227
+ // If the stable version is >= the preid's base version, use the stable tag
228
+ // This handles the case where a stable release was made after the prerelease
229
+ // (e.g., 1.1.1 stable was released after 1.1.0-alpha.3)
230
+ if (preidBaseVersion &&
231
+ stableVersion &&
232
+ (0, semver_1.gte)(stableVersion, preidBaseVersion)) {
233
+ return stableResult;
234
+ }
235
+ // Otherwise, use the preid tag (prerelease's base is ahead of stable)
236
+ return preidResult;
237
+ }
238
+ // If only preid tags exist (no stable), use the latest preid tag
211
239
  if (preidReleaseTags.length > 0) {
212
240
  return extractTagAndVersion(preidReleaseTags[0], tagRegexp, options);
213
241
  }
242
+ // If no matching preid tags, fall through to find stable tags below
214
243
  }
215
- // Then try to find the latest stable release tag
216
- const stableReleaseTags = matchingTags.filter((tag) => {
217
- const matches = tag.match(tagRegexp);
218
- if (!matches)
219
- return false;
220
- const [, version] = matches;
221
- return version && !(0, shared_1.isPrerelease)(version);
222
- });
223
244
  // If there are stable release tags, use the latest one
224
245
  if (stableReleaseTags.length > 0) {
225
246
  return extractTagAndVersion(stableReleaseTags[0], tagRegexp, options);