MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / loadPackages

Function loadPackages

tooling/publish/publish.ts:80–107  ·  view source on GitHub ↗
(
  releaseType: ReleaseType
)

Source from the content-addressed store, hash-verified

78
79// Core functions
80const loadPackages = (
81 releaseType: ReleaseType
82): Record<string, PackageInfo> => {
83 const sdksPath = workspacePath('./packages/sdks');
84 const sdks = fs
85 .readdirSync(sdksPath, { withFileTypes: true })
86 .filter((dirent) => dirent.isDirectory() && !dirent.name.startsWith('.'))
87 .map((dirent) => dirent.name);
88
89 return Object.fromEntries(
90 sdks.map((sdk) => {
91 const pkgPath = join(sdksPath, sdk, 'package.json');
92 const pkgJson = JSON.parse(
93 fs.readFileSync(pkgPath, 'utf-8')
94 ) as PackageJson;
95 const version = pkgJson.version.replace(/-local$/, '');
96 return [
97 pkgJson.name,
98 {
99 ...pkgJson,
100 version,
101 nextVersion: getNextVersion(version, releaseType),
102 localPath: `./packages/sdks/${sdk}`,
103 },
104 ];
105 })
106 );
107};
108
109const findDependents = (
110 packages: Record<string, PackageInfo>,

Callers 1

mainFunction · 0.85

Calls 6

joinFunction · 0.85
getNextVersionFunction · 0.85
parseMethod · 0.80
replaceMethod · 0.80
workspacePathFunction · 0.70
mapMethod · 0.45

Tested by

no test coverage detected