update-workspace-root-version 0.2.0 → 0.3.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/dist/src/steps/get-new-version.js +1 -1
- package/dist/src/steps/get-package-versions.js +5 -2
- package/dist/src/steps/get-workspace-root-version.js +1 -1
- package/dist/src/utils/version/allow.js +6 -0
- package/dist/src/utils/{versions → version}/index.js +1 -0
- package/package.json +1 -1
- /package/dist/src/utils/{versions → version}/compare.js +0 -0
- /package/dist/src/utils/{versions → version}/increment.js +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
import { findFiles } from '@codemod-utils/files';
|
|
3
3
|
import { readPackageJson } from '@codemod-utils/json';
|
|
4
|
+
import { allow } from '../utils/version/index.js';
|
|
4
5
|
function getPackageRoots(options) {
|
|
5
6
|
const { projectRoot } = options;
|
|
6
7
|
const packageRoots = findFiles('**/package.json', {
|
|
@@ -18,8 +19,10 @@ function getPackageRoots(options) {
|
|
|
18
19
|
}
|
|
19
20
|
export function getPackageVersions(options) {
|
|
20
21
|
const packageRoots = getPackageRoots(options);
|
|
21
|
-
return packageRoots
|
|
22
|
+
return packageRoots
|
|
23
|
+
.map((packageRoot) => {
|
|
22
24
|
const packageJson = readPackageJson({ projectRoot: packageRoot });
|
|
23
25
|
return packageJson['version'];
|
|
24
|
-
})
|
|
26
|
+
})
|
|
27
|
+
.filter(allow);
|
|
25
28
|
}
|
|
@@ -2,5 +2,5 @@ import { readPackageJson } from '@codemod-utils/json';
|
|
|
2
2
|
export function getWorkspaceRootVersion(options) {
|
|
3
3
|
const { projectRoot } = options;
|
|
4
4
|
const packageJson = readPackageJson({ projectRoot });
|
|
5
|
-
return packageJson['version'];
|
|
5
|
+
return packageJson['version'] ?? '0.0.0';
|
|
6
6
|
}
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|