@storm-software/workspace-tools 1.286.0 → 1.287.1
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/CHANGELOG.md +31 -0
- package/README.md +1 -1
- package/dist/{chunk-GF6O2RXB.js → chunk-7JZOFDL2.js} +189 -15
- package/dist/{chunk-NTQG45CW.js → chunk-DA53ZKBY.js} +22 -1
- package/dist/{chunk-5BP7WBYT.mjs → chunk-M7ZPKNJT.mjs} +22 -1
- package/dist/{chunk-QEPFDTFD.js → chunk-Q27SXGNA.js} +11 -30
- package/dist/{chunk-OZFFOIQJ.mjs → chunk-ROQYWBA4.mjs} +185 -11
- package/dist/{chunk-BNDXPQJL.mjs → chunk-YTQNRG2E.mjs} +3 -22
- package/dist/executors.js +3 -4
- package/dist/executors.mjs +2 -3
- package/dist/generators.js +3 -3
- package/dist/generators.mjs +2 -2
- package/dist/index.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +5 -9
- package/dist/index.mjs +4 -8
- package/dist/src/executors/npm-publish/executor.js +3 -4
- package/dist/src/executors/npm-publish/executor.mjs +2 -3
- package/dist/src/generators/release-version/generator.js +3 -3
- package/dist/src/generators/release-version/generator.mjs +2 -2
- package/dist/src/utils/index.d.mts +0 -1
- package/dist/src/utils/index.d.ts +0 -1
- package/dist/src/utils/index.js +2 -6
- package/dist/src/utils/index.mjs +1 -5
- package/package.json +22 -24
- package/dist/chunk-F6X43VUX.js +0 -163
- package/dist/chunk-KHT5W6AJ.mjs +0 -163
- package/dist/src/utils/pnpm-deps-update.d.mts +0 -9
- package/dist/src/utils/pnpm-deps-update.d.ts +0 -9
- package/dist/src/utils/pnpm-deps-update.js +0 -7
- package/dist/src/utils/pnpm-deps-update.mjs +0 -8
- /package/dist/{chunk-XCVH63OO.mjs → chunk-6YZ3OUJB.mjs} +0 -0
- /package/dist/{chunk-DO2X7OZO.js → chunk-JGP4YWZY.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Storm Ops - Workspace Tools
|
|
4
4
|
|
|
5
|
+
## [1.287.0](https://github.com/storm-software/storm-ops/releases/tag/workspace-tools%401.287.0) (2025-09-13)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- **pnpm-tools:** Initial check-in of `pnpm-tools` utility package
|
|
10
|
+
([3bb1916af](https://github.com/storm-software/storm-ops/commit/3bb1916af))
|
|
11
|
+
|
|
12
|
+
### Miscellaneous
|
|
13
|
+
|
|
14
|
+
- **monorepo:** Regenerate README markdown files
|
|
15
|
+
([f6d595334](https://github.com/storm-software/storm-ops/commit/f6d595334))
|
|
16
|
+
|
|
17
|
+
### Updated Dependencies
|
|
18
|
+
|
|
19
|
+
- Updated pnpm-tools to 0.1.0
|
|
20
|
+
- Updated npm-tools to 0.1.1
|
|
21
|
+
- Updated prettier to 0.54.1
|
|
22
|
+
- Updated esbuild to 0.49.1
|
|
23
|
+
- Updated unbuild to 0.53.1
|
|
24
|
+
|
|
25
|
+
## [1.286.0](https://github.com/storm-software/storm-ops/releases/tag/workspace-tools%401.286.0) (2025-09-13)
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
- **npm-tools:** Initial check-in of the npm utility tools package
|
|
30
|
+
([caf8e3fd4](https://github.com/storm-software/storm-ops/commit/caf8e3fd4))
|
|
31
|
+
|
|
32
|
+
### Updated Dependencies
|
|
33
|
+
|
|
34
|
+
- Updated npm-tools to 0.1.0
|
|
35
|
+
|
|
5
36
|
## [1.285.0](https://github.com/storm-software/storm-ops/releases/tag/workspace-tools%401.285.0) (2025-09-13)
|
|
6
37
|
|
|
7
38
|
### Features
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
|
@@ -3,26 +3,200 @@
|
|
|
3
3
|
var _chunk73IC2JQVjs = require('./chunk-73IC2JQV.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var _chunkF6X43VUXjs = require('./chunk-F6X43VUX.js');
|
|
7
6
|
|
|
7
|
+
var _chunkDA53ZKBYjs = require('./chunk-DA53ZKBY.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkHNFKVXBVjs = require('./chunk-HNFKVXBV.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunk53DNHF7Bjs = require('./chunk-53DNHF7B.js');
|
|
14
14
|
|
|
15
|
-
// src/
|
|
16
|
-
|
|
15
|
+
// ../pnpm-tools/src/helpers/replace-deps-aliases.ts
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
var _devkit = require('@nx/devkit');
|
|
20
|
+
var _fs = require('fs');
|
|
17
21
|
var _promises = require('fs/promises');
|
|
18
22
|
var _prettier = require('prettier');
|
|
23
|
+
|
|
24
|
+
// ../pnpm-tools/src/helpers/catalog.ts
|
|
25
|
+
var _semver = require('semver');
|
|
26
|
+
|
|
27
|
+
// ../pnpm-tools/src/helpers/pnpm-workspace.ts
|
|
28
|
+
var _jsyaml = require('js-yaml');
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
function getPnpmWorkspaceFilePath(workspaceRoot = _chunkHNFKVXBVjs.findWorkspaceRoot.call(void 0, process.cwd())) {
|
|
32
|
+
const pnpmWorkspacePath = _chunk53DNHF7Bjs.joinPaths.call(void 0, workspaceRoot, "pnpm-workspace.yaml");
|
|
33
|
+
if (!_fs.existsSync.call(void 0, pnpmWorkspacePath)) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${pnpmWorkspacePath}).`
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return pnpmWorkspacePath;
|
|
39
|
+
}
|
|
40
|
+
async function readPnpmWorkspaceFile(workspaceRoot = _chunkHNFKVXBVjs.findWorkspaceRoot.call(void 0, process.cwd())) {
|
|
41
|
+
return _jsyaml.load.call(void 0, getPnpmWorkspaceFilePath(workspaceRoot));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// ../pnpm-tools/src/helpers/catalog.ts
|
|
45
|
+
async function getCatalog(workspaceRoot = _chunkHNFKVXBVjs.findWorkspaceRoot.call(void 0, process.cwd())) {
|
|
46
|
+
const pnpmWorkspaceFile = await readPnpmWorkspaceFile(workspaceRoot);
|
|
47
|
+
if (_optionalChain([pnpmWorkspaceFile, 'optionalAccess', _ => _.catalog])) {
|
|
48
|
+
return Object.fromEntries(
|
|
49
|
+
Object.entries(pnpmWorkspaceFile.catalog).map(([key, value]) => {
|
|
50
|
+
return [key, value.replaceAll(/^"/g, "").replaceAll(/"$/g, "")];
|
|
51
|
+
})
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
if (!pnpmWorkspaceFile) {
|
|
55
|
+
throw new Error("No pnpm-workspace.yaml file found");
|
|
56
|
+
}
|
|
57
|
+
if (!pnpmWorkspaceFile.catalog) {
|
|
58
|
+
console.warn(
|
|
59
|
+
`No catalog found in pnpm-workspace.yaml file located in workspace root: ${workspaceRoot}`
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return pnpmWorkspaceFile.catalog;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// ../pnpm-tools/src/helpers/replace-deps-aliases.ts
|
|
66
|
+
async function replaceDepsAliases(packageRoot = process.cwd(), workspaceRoot = _chunkHNFKVXBVjs.findWorkspaceRoot.call(void 0, packageRoot)) {
|
|
67
|
+
const packageJsonPath = _chunk53DNHF7Bjs.joinPaths.call(void 0, packageRoot, "package.json");
|
|
68
|
+
const packageJsonFile = await _promises.readFile.call(void 0, packageJsonPath, "utf8");
|
|
69
|
+
if (!packageJsonFile) {
|
|
70
|
+
throw new Error(
|
|
71
|
+
"No package.json file found in package root: " + packageRoot
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
const catalog = await getCatalog(workspaceRoot);
|
|
75
|
+
const packageJson = JSON.parse(packageJsonFile);
|
|
76
|
+
const pnpmWorkspacePath = _chunk53DNHF7Bjs.joinPaths.call(void 0, workspaceRoot, "pnpm-workspace.yaml");
|
|
77
|
+
if (!_fs.existsSync.call(void 0, pnpmWorkspacePath)) {
|
|
78
|
+
console.warn(
|
|
79
|
+
`No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${pnpmWorkspacePath}). Skipping pnpm catalog read for now.`
|
|
80
|
+
);
|
|
81
|
+
return packageJson;
|
|
82
|
+
}
|
|
83
|
+
if (!catalog) {
|
|
84
|
+
console.warn(
|
|
85
|
+
`No pnpm catalog found. Skipping dependencies replacement for now.`
|
|
86
|
+
);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
for (const dependencyType of [
|
|
90
|
+
"dependencies",
|
|
91
|
+
"devDependencies",
|
|
92
|
+
"peerDependencies"
|
|
93
|
+
]) {
|
|
94
|
+
const dependencies = packageJson[dependencyType];
|
|
95
|
+
if (!dependencies) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
for (const dependencyName of Object.keys(dependencies)) {
|
|
99
|
+
if (dependencies[dependencyName] === "catalog:") {
|
|
100
|
+
if (!catalog) {
|
|
101
|
+
throw new Error(
|
|
102
|
+
`Dependency ${dependencyName} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
const catalogVersion = catalog[dependencyName];
|
|
106
|
+
if (!catalogVersion) {
|
|
107
|
+
throw new Error("Missing pnpm catalog version for " + dependencyName);
|
|
108
|
+
}
|
|
109
|
+
dependencies[dependencyName] = catalogVersion;
|
|
110
|
+
} else if (dependencies[dependencyName].startsWith("catalog:")) {
|
|
111
|
+
throw new Error("multiple named catalogs not supported");
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
let projectGraph;
|
|
116
|
+
try {
|
|
117
|
+
projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
118
|
+
} catch (e) {
|
|
119
|
+
await _devkit.createProjectGraphAsync.call(void 0, );
|
|
120
|
+
projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
121
|
+
}
|
|
122
|
+
const workspacePackages = {};
|
|
123
|
+
if (projectGraph) {
|
|
124
|
+
await Promise.all(
|
|
125
|
+
Object.keys(projectGraph.nodes).map(async (node) => {
|
|
126
|
+
const projectNode = projectGraph.nodes[node];
|
|
127
|
+
if (_optionalChain([projectNode, 'optionalAccess', _2 => _2.data, 'access', _3 => _3.root])) {
|
|
128
|
+
const projectPackageJsonPath = _chunk53DNHF7Bjs.joinPaths.call(void 0,
|
|
129
|
+
workspaceRoot,
|
|
130
|
+
projectNode.data.root,
|
|
131
|
+
"package.json"
|
|
132
|
+
);
|
|
133
|
+
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
134
|
+
const projectPackageJsonContent = await _promises.readFile.call(void 0,
|
|
135
|
+
projectPackageJsonPath,
|
|
136
|
+
"utf8"
|
|
137
|
+
);
|
|
138
|
+
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
139
|
+
if (projectPackageJson.private !== true) {
|
|
140
|
+
workspacePackages[projectPackageJson.name] = projectPackageJson.version;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
for (const dependencyType of [
|
|
148
|
+
"dependencies",
|
|
149
|
+
"devDependencies",
|
|
150
|
+
"peerDependencies"
|
|
151
|
+
]) {
|
|
152
|
+
const dependencies = packageJson[dependencyType];
|
|
153
|
+
if (!dependencies) {
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
for (const dependencyName of Object.keys(dependencies)) {
|
|
157
|
+
if (dependencies[dependencyName].startsWith("workspace:")) {
|
|
158
|
+
if (workspacePackages[dependencyName]) {
|
|
159
|
+
dependencies[dependencyName] = `^${workspacePackages[dependencyName]}`;
|
|
160
|
+
} else {
|
|
161
|
+
throw new Error(
|
|
162
|
+
`Workspace dependency ${dependencyName} not found in workspace packages.`
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return _promises.writeFile.call(void 0,
|
|
169
|
+
packageJsonPath,
|
|
170
|
+
await _prettier.format.call(void 0, JSON.stringify(packageJson), {
|
|
171
|
+
parser: "json",
|
|
172
|
+
proseWrap: "always",
|
|
173
|
+
trailingComma: "none",
|
|
174
|
+
tabWidth: 2,
|
|
175
|
+
semi: true,
|
|
176
|
+
singleQuote: false,
|
|
177
|
+
quoteProps: "as-needed",
|
|
178
|
+
insertPragma: false,
|
|
179
|
+
bracketSameLine: true,
|
|
180
|
+
printWidth: 80,
|
|
181
|
+
bracketSpacing: true,
|
|
182
|
+
arrowParens: "avoid",
|
|
183
|
+
endOfLine: "lf",
|
|
184
|
+
plugins: ["prettier-plugin-pkg"]
|
|
185
|
+
})
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// src/executors/npm-publish/executor.ts
|
|
190
|
+
var _child_process = require('child_process');
|
|
191
|
+
|
|
192
|
+
|
|
19
193
|
var LARGE_BUFFER = 1024 * 1e6;
|
|
20
194
|
async function npmPublishExecutorFn(options, context) {
|
|
21
195
|
const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
|
|
22
196
|
if (!context.projectName) {
|
|
23
197
|
throw new Error("The `npm-publish` executor requires a `projectName`.");
|
|
24
198
|
}
|
|
25
|
-
const projectConfig = _optionalChain([context, 'access',
|
|
199
|
+
const projectConfig = _optionalChain([context, 'access', _4 => _4.projectsConfigurations, 'optionalAccess', _5 => _5.projects, 'optionalAccess', _6 => _6[context.projectName]]);
|
|
26
200
|
if (!projectConfig) {
|
|
27
201
|
throw new Error(
|
|
28
202
|
`Could not find project configuration for \`${context.projectName}\``
|
|
@@ -32,7 +206,7 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
32
206
|
context.root,
|
|
33
207
|
options.packageRoot || _chunk53DNHF7Bjs.joinPaths.call(void 0, "dist", projectConfig.root)
|
|
34
208
|
);
|
|
35
|
-
const projectRoot = _optionalChain([context, 'access',
|
|
209
|
+
const projectRoot = _optionalChain([context, 'access', _7 => _7.projectsConfigurations, 'access', _8 => _8.projects, 'access', _9 => _9[context.projectName], 'optionalAccess', _10 => _10.root]) ? _chunk53DNHF7Bjs.joinPaths.call(void 0,
|
|
36
210
|
context.root,
|
|
37
211
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
38
212
|
context.projectsConfigurations.projects[context.projectName].root
|
|
@@ -89,13 +263,13 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
89
263
|
);
|
|
90
264
|
return { success: true };
|
|
91
265
|
}
|
|
92
|
-
await
|
|
266
|
+
await replaceDepsAliases(packageRoot, context.root);
|
|
93
267
|
await _chunk73IC2JQVjs.addPackageJsonGitHead.call(void 0, packageRoot);
|
|
94
268
|
const npmPublishCommandSegments = [`npm publish --json`];
|
|
95
269
|
const npmViewCommandSegments = [
|
|
96
270
|
`npm view ${packageName} versions dist-tags --json`
|
|
97
271
|
];
|
|
98
|
-
const registry = await _asyncNullishCoalesce(options.registry, async () => ( (await
|
|
272
|
+
const registry = await _asyncNullishCoalesce(options.registry, async () => ( (await _chunkDA53ZKBYjs.getRegistry.call(void 0, ) || _chunkDA53ZKBYjs.getNpmRegistry.call(void 0, ))));
|
|
99
273
|
if (registry) {
|
|
100
274
|
npmPublishCommandSegments.push(`--registry="${registry}" `);
|
|
101
275
|
npmViewCommandSegments.push(`--registry="${registry}" `);
|
|
@@ -198,16 +372,16 @@ Note: If this is the first time this package has been published to NPM, this can
|
|
|
198
372
|
`
|
|
199
373
|
);
|
|
200
374
|
console.info("");
|
|
201
|
-
const stdoutData = JSON.parse(_optionalChain([err, 'access',
|
|
202
|
-
if (_optionalChain([stdoutData, 'optionalAccess',
|
|
375
|
+
const stdoutData = JSON.parse(_optionalChain([err, 'access', _11 => _11.stdout, 'optionalAccess', _12 => _12.toString, 'call', _13 => _13()]) || "{}");
|
|
376
|
+
if (_optionalChain([stdoutData, 'optionalAccess', _14 => _14.error]) && !(_optionalChain([stdoutData, 'access', _15 => _15.error, 'optionalAccess', _16 => _16.code, 'optionalAccess', _17 => _17.includes, 'call', _18 => _18("E404")]) && _optionalChain([stdoutData, 'access', _19 => _19.error, 'optionalAccess', _20 => _20.summary, 'optionalAccess', _21 => _21.includes, 'call', _22 => _22("no such package available")])) && !(_optionalChain([err, 'access', _23 => _23.stderr, 'optionalAccess', _24 => _24.toString, 'call', _25 => _25(), 'access', _26 => _26.includes, 'call', _27 => _27("E404")]) && _optionalChain([err, 'access', _28 => _28.stderr, 'optionalAccess', _29 => _29.toString, 'call', _30 => _30(), 'access', _31 => _31.includes, 'call', _32 => _32("no such package available")]))) {
|
|
203
377
|
console.error(
|
|
204
378
|
"npm dist-tag add error please see below for more information:"
|
|
205
379
|
);
|
|
206
380
|
if (stdoutData.error.summary) {
|
|
207
|
-
console.error(_optionalChain([stdoutData, 'access',
|
|
381
|
+
console.error(_optionalChain([stdoutData, 'access', _33 => _33.error, 'optionalAccess', _34 => _34.summary]));
|
|
208
382
|
}
|
|
209
383
|
if (stdoutData.error.detail) {
|
|
210
|
-
console.error(_optionalChain([stdoutData, 'access',
|
|
384
|
+
console.error(_optionalChain([stdoutData, 'access', _35 => _35.error, 'optionalAccess', _36 => _36.detail]));
|
|
211
385
|
}
|
|
212
386
|
if (context.isVerbose) {
|
|
213
387
|
console.error(
|
|
@@ -236,8 +410,8 @@ ${JSON.stringify(err2)}`
|
|
|
236
410
|
);
|
|
237
411
|
console.error(error);
|
|
238
412
|
console.info("");
|
|
239
|
-
const stdoutData = JSON.parse(_optionalChain([err, 'access',
|
|
240
|
-
if (!(_optionalChain([stdoutData, 'access',
|
|
413
|
+
const stdoutData = JSON.parse(_optionalChain([err, 'access', _37 => _37.stdout, 'optionalAccess', _38 => _38.toString, 'call', _39 => _39()]) || "{}");
|
|
414
|
+
if (!(_optionalChain([stdoutData, 'access', _40 => _40.error, 'optionalAccess', _41 => _41.code, 'optionalAccess', _42 => _42.includes, 'call', _43 => _43("E404")]) && _optionalChain([stdoutData, 'access', _44 => _44.error, 'optionalAccess', _45 => _45.summary, 'optionalAccess', _46 => _46.toLowerCase, 'call', _47 => _47(), 'access', _48 => _48.includes, 'call', _49 => _49("not found")])) && !(_optionalChain([err, 'access', _50 => _50.stderr, 'optionalAccess', _51 => _51.toString, 'call', _52 => _52(), 'access', _53 => _53.includes, 'call', _54 => _54("E404")]) && _optionalChain([err, 'access', _55 => _55.stderr, 'optionalAccess', _56 => _56.toString, 'call', _57 => _57(), 'access', _58 => _58.toLowerCase, 'call', _59 => _59(), 'access', _60 => _60.includes, 'call', _61 => _61("not found")]))) {
|
|
241
415
|
console.error(
|
|
242
416
|
`Something unexpected went wrong when checking for existing dist-tags.
|
|
243
417
|
|
|
@@ -284,7 +458,7 @@ Execution response: ${result.toString()}` : ""}
|
|
|
284
458
|
console.error("An error occured running npm publish.");
|
|
285
459
|
console.error("Please see below for more information:");
|
|
286
460
|
console.info("");
|
|
287
|
-
const stdoutData = JSON.parse(_optionalChain([err, 'access',
|
|
461
|
+
const stdoutData = JSON.parse(_optionalChain([err, 'access', _62 => _62.stdout, 'optionalAccess', _63 => _63.toString, 'call', _64 => _64()]) || "{}");
|
|
288
462
|
if (stdoutData.error.summary) {
|
|
289
463
|
console.error(stdoutData.error.summary);
|
|
290
464
|
console.error(stdoutData.error.summary);
|
|
@@ -44,9 +44,30 @@ async function getGitHubRegistry() {
|
|
|
44
44
|
return DEFAULT_GITHUB_REGISTRY;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
// ../npm-tools/src/helpers/get-version.ts
|
|
48
|
+
|
|
49
|
+
async function getVersion(packageName, tag = DEFAULT_NPM_TAG, options = {}) {
|
|
50
|
+
const { registry = getRegistry() } = options;
|
|
51
|
+
return new Promise((resolve, reject) => {
|
|
52
|
+
_child_process.exec.call(void 0,
|
|
53
|
+
`npm view ${packageName} version --registry=${registry} --tag=${tag}`,
|
|
54
|
+
(error, stdout, stderr) => {
|
|
55
|
+
if (error) {
|
|
56
|
+
return reject(error);
|
|
57
|
+
}
|
|
58
|
+
if (stderr) {
|
|
59
|
+
return reject(stderr);
|
|
60
|
+
}
|
|
61
|
+
return resolve(stdout.trim());
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
47
68
|
|
|
48
69
|
|
|
49
70
|
|
|
50
71
|
|
|
51
72
|
|
|
52
|
-
exports.DEFAULT_NPM_TAG = DEFAULT_NPM_TAG; exports.getRegistry = getRegistry; exports.getNpmRegistry = getNpmRegistry; exports.getGitHubRegistry = getGitHubRegistry;
|
|
73
|
+
exports.DEFAULT_NPM_TAG = DEFAULT_NPM_TAG; exports.getRegistry = getRegistry; exports.getNpmRegistry = getNpmRegistry; exports.getGitHubRegistry = getGitHubRegistry; exports.getVersion = getVersion;
|
|
@@ -44,9 +44,30 @@ async function getGitHubRegistry() {
|
|
|
44
44
|
return DEFAULT_GITHUB_REGISTRY;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
// ../npm-tools/src/helpers/get-version.ts
|
|
48
|
+
import { exec as exec2 } from "node:child_process";
|
|
49
|
+
async function getVersion(packageName, tag = DEFAULT_NPM_TAG, options = {}) {
|
|
50
|
+
const { registry = getRegistry() } = options;
|
|
51
|
+
return new Promise((resolve, reject) => {
|
|
52
|
+
exec2(
|
|
53
|
+
`npm view ${packageName} version --registry=${registry} --tag=${tag}`,
|
|
54
|
+
(error, stdout, stderr) => {
|
|
55
|
+
if (error) {
|
|
56
|
+
return reject(error);
|
|
57
|
+
}
|
|
58
|
+
if (stderr) {
|
|
59
|
+
return reject(stderr);
|
|
60
|
+
}
|
|
61
|
+
return resolve(stdout.trim());
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
47
67
|
export {
|
|
48
68
|
DEFAULT_NPM_TAG,
|
|
49
69
|
getRegistry,
|
|
50
70
|
getNpmRegistry,
|
|
51
|
-
getGitHubRegistry
|
|
71
|
+
getGitHubRegistry,
|
|
72
|
+
getVersion
|
|
52
73
|
};
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
var _chunkDA53ZKBYjs = require('./chunk-DA53ZKBY.js');
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
|
|
@@ -299,28 +300,8 @@ var DEFAULT_CONVENTIONAL_COMMITS_CONFIG = {
|
|
|
299
300
|
types: COMMIT_TYPES
|
|
300
301
|
};
|
|
301
302
|
|
|
302
|
-
// ../npm-tools/src/helpers/get-version.ts
|
|
303
|
-
var _child_process = require('child_process');
|
|
304
|
-
async function getVersion(packageName, tag = _chunkNTQG45CWjs.DEFAULT_NPM_TAG, options = {}) {
|
|
305
|
-
const { registry = _chunkNTQG45CWjs.getRegistry.call(void 0, ) } = options;
|
|
306
|
-
return new Promise((resolve, reject) => {
|
|
307
|
-
_child_process.exec.call(void 0,
|
|
308
|
-
`npm view ${packageName} version --registry=${registry} --tag=${tag}`,
|
|
309
|
-
(error, stdout, stderr) => {
|
|
310
|
-
if (error) {
|
|
311
|
-
return reject(error);
|
|
312
|
-
}
|
|
313
|
-
if (stderr) {
|
|
314
|
-
return reject(stderr);
|
|
315
|
-
}
|
|
316
|
-
return resolve(stdout.trim());
|
|
317
|
-
}
|
|
318
|
-
);
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
|
|
322
303
|
// src/generators/release-version/generator.ts
|
|
323
|
-
|
|
304
|
+
var _child_process = require('child_process');
|
|
324
305
|
var _path = require('path');
|
|
325
306
|
var _config = require('nx/src/command-line/release/config/config');
|
|
326
307
|
|
|
@@ -466,19 +447,19 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
|
|
|
466
447
|
switch (options.currentVersionResolver) {
|
|
467
448
|
case "registry": {
|
|
468
449
|
const metadata = _nullishCoalesce(options.currentVersionResolverMetadata, () => ( {}));
|
|
469
|
-
const tag = _nullishCoalesce(metadata.tag, () => (
|
|
470
|
-
const registry = await _asyncNullishCoalesce(metadata.registry, async () => ( await
|
|
471
|
-
const npmRegistry = await
|
|
472
|
-
const githubRegistry = await
|
|
450
|
+
const tag = _nullishCoalesce(metadata.tag, () => ( _chunkDA53ZKBYjs.DEFAULT_NPM_TAG));
|
|
451
|
+
const registry = await _asyncNullishCoalesce(metadata.registry, async () => ( await _chunkDA53ZKBYjs.getRegistry.call(void 0, )));
|
|
452
|
+
const npmRegistry = await _chunkDA53ZKBYjs.getNpmRegistry.call(void 0, );
|
|
453
|
+
const githubRegistry = await _chunkDA53ZKBYjs.getGitHubRegistry.call(void 0, );
|
|
473
454
|
if (options.releaseGroup.projectsRelationship === "independent") {
|
|
474
455
|
try {
|
|
475
|
-
currentVersion = await getVersion(packageName, tag, { registry });
|
|
456
|
+
currentVersion = await _chunkDA53ZKBYjs.getVersion.call(void 0, packageName, tag, { registry });
|
|
476
457
|
if (!currentVersion) {
|
|
477
|
-
currentVersion = await getVersion(packageName, tag, {
|
|
458
|
+
currentVersion = await _chunkDA53ZKBYjs.getVersion.call(void 0, packageName, tag, {
|
|
478
459
|
registry: npmRegistry
|
|
479
460
|
});
|
|
480
461
|
if (!currentVersion) {
|
|
481
|
-
currentVersion = await getVersion(packageName, tag, {
|
|
462
|
+
currentVersion = await _chunkDA53ZKBYjs.getVersion.call(void 0, packageName, tag, {
|
|
482
463
|
registry: githubRegistry
|
|
483
464
|
});
|
|
484
465
|
}
|
|
@@ -488,7 +469,7 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
|
|
|
488
469
|
);
|
|
489
470
|
} catch (e) {
|
|
490
471
|
try {
|
|
491
|
-
currentVersion = await getVersion(packageName, tag, {
|
|
472
|
+
currentVersion = await _chunkDA53ZKBYjs.getVersion.call(void 0, packageName, tag, {
|
|
492
473
|
registry: githubRegistry
|
|
493
474
|
});
|
|
494
475
|
log(
|