Skip to content

Commit 667ba83

Browse files
committed
patch(core): fix dependency resolution in deployment pipeline
1 parent b870ffd commit 667ba83

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

.github/scripts/prepare-publish.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,38 @@ const publishPkg = {
6363
devDependencies: undefined
6464
};
6565

66+
// Resolve workspace:* dependencies to actual versions
67+
if (publishPkg.dependencies) {
68+
const packagesDir = path.join('..', '..');
69+
for (const [name, version] of Object.entries(publishPkg.dependencies)) {
70+
if (typeof version === 'string' && version.startsWith('workspace:')) {
71+
// Find the package directory by scanning packages/*
72+
const packagesDirPath = path.join(packagesDir, 'packages');
73+
const packageDirs = fs.readdirSync(packagesDirPath);
74+
75+
for (const dir of packageDirs) {
76+
const depPkgPath = path.join(packagesDirPath, dir, 'package.json');
77+
if (fs.existsSync(depPkgPath)) {
78+
const depPkg = JSON.parse(fs.readFileSync(depPkgPath, 'utf8'));
79+
if (depPkg.name === name) {
80+
// Handle workspace:*, workspace:^, workspace:~
81+
const versionSpec = version.replace('workspace:', '');
82+
if (versionSpec === '*') {
83+
publishPkg.dependencies[name] = depPkg.version;
84+
} else if (versionSpec === '^' || versionSpec === '~') {
85+
publishPkg.dependencies[name] = versionSpec + depPkg.version;
86+
} else {
87+
publishPkg.dependencies[name] = depPkg.version;
88+
}
89+
console.log(`✓ Resolved ${name}: ${version}${publishPkg.dependencies[name]}`);
90+
break;
91+
}
92+
}
93+
}
94+
}
95+
}
96+
}
97+
6698
// Copy root files from monorepo root
6799
['README.md','LICENSE.md'].forEach(f => {
68100
const source = path.join('..', '..', f);

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@flow-scanner/lightning-flow-scanner-core",
33
"description": "A lightweight engine for Flow metadata in Node.js, and browser environments. Assess and enhance Salesforce Flow automations for best practices, security, governor limits, and performance issues.",
4-
"version": "6.17.0",
4+
"version": "6.17.2",
55
"main": "out/index.js",
66
"exports": {
77
".": {

0 commit comments

Comments
 (0)