MCPcopy Index your code
hub / github.com/changesets/changesets / getUntaggedPackages

Function getUntaggedPackages

packages/cli/src/utils/getUntaggedPackages.ts:4–36  ·  view source on GitHub ↗
(
  packages: Package[],
  cwd: string,
  tool: Tool
)

Source from the content-addressed store, hash-verified

2import { Package, Tool } from "@manypkg/get-packages";
3
4export async function getUntaggedPackages(
5 packages: Package[],
6 cwd: string,
7 tool: Tool
8) {
9 const packageWithTags = await Promise.all(
10 packages.map(async (pkg) => {
11 const tagName =
12 tool === "root"
13 ? `v${pkg.packageJson.version}`
14 : `${pkg.packageJson.name}@${pkg.packageJson.version}`;
15 const isMissingTag = !(
16 (await git.tagExists(tagName, cwd)) ||
17 (await git.remoteTagExists(tagName))
18 );
19
20 return { pkg, isMissingTag };
21 })
22 );
23
24 const untagged: Array<{ name: string; newVersion: string }> = [];
25
26 for (const packageWithTag of packageWithTags) {
27 if (packageWithTag.isMissingTag) {
28 untagged.push({
29 name: packageWithTag.pkg.packageJson.name,
30 newVersion: packageWithTag.pkg.packageJson.version,
31 });
32 }
33 }
34
35 return untagged;
36}

Callers 2

tagFunction · 0.90
publishFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected