MCPcopy Create free account
hub / github.com/TanStack/cli / getPublishablePackages

Function getPublishablePackages

scripts/generate-semantic-changeset.mjs:25–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23}
24
25async function getPublishablePackages() {
26 const packages = []
27
28 for (const workspaceDir of WORKSPACE_DIRS) {
29 const absWorkspaceDir = path.resolve(workspaceDir)
30 if (!existsSync(absWorkspaceDir)) continue
31
32 const dirEntries = await readdir(absWorkspaceDir, { withFileTypes: true })
33 for (const dirEntry of dirEntries) {
34 if (!dirEntry.isDirectory()) continue
35
36 const relDir = path.join(workspaceDir, dirEntry.name)
37 const packageJsonPath = path.resolve(relDir, 'package.json')
38 if (!existsSync(packageJsonPath)) continue
39
40 const raw = await readFile(packageJsonPath, 'utf8')
41 const pkg = JSON.parse(raw)
42 if (pkg.private || typeof pkg.name !== 'string') continue
43
44 packages.push({
45 name: pkg.name,
46 dir: relDir.replace(/\\/g, '/'),
47 })
48 }
49 }
50
51 return packages
52}
53
54function getBaseSha() {
55 const lastReleaseSha = runGit(`log --format=%H --grep="^${RELEASE_COMMIT_PREFIX}" -n 1 HEAD`)

Callers 1

mainFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected