Skip to content

Commit f308b45

Browse files
committed
fix: normalize paths for web_app file responses on Windows
- Use posix.relative and posix.join to ensure consistent path separators - Fixes test failure on Windows CI where mixed path separators caused incorrect fullName generation - Child DigitalExperience components now get correct fullNames like 'web_app/zenith/index.html'
1 parent e66354b commit f308b45

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/client/deployMessages.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { basename, dirname, extname, join, posix, relative, sep } from 'node:path/posix';
17+
import { basename, dirname, extname, join, posix, sep } from 'node:path';
1818
import { SfError } from '@salesforce/core/sfError';
1919
import { ensureArray } from '@salesforce/kit';
2020
import { ComponentLike, SourceComponent } from '../resolve';
@@ -101,9 +101,12 @@ export const createResponses = (component: SourceComponent, responseMessages: De
101101
filePath: component.content!,
102102
};
103103
const fileResponses: FileResponseSuccess[] = walkedPaths.map((filePath) => {
104-
const relPath = relative(component.content!, filePath);
104+
// Normalize paths to ensure relative() works correctly on Windows
105+
const normalizedContent = component.content!.split(sep).join(posix.sep);
106+
const normalizedFilePath = filePath.split(sep).join(posix.sep);
107+
const relPath = posix.relative(normalizedContent, normalizedFilePath);
105108
return {
106-
fullName: join(component.fullName, relPath).split(sep).join(posix.sep),
109+
fullName: posix.join(component.fullName, relPath),
107110
type: 'DigitalExperience',
108111
state,
109112
filePath,

0 commit comments

Comments
 (0)