Skip to content

Commit 1511388

Browse files
mshanemcskesanthoshsvc-cli-bot
authored
fix: use always forward slash for DEB and DE fullName
--------- Co-authored-by: Santhosh Emmadoju <[email protected]> Co-authored-by: svc-cli-bot <[email protected]>
1 parent bcadade commit 1511388

File tree

13 files changed

+49
-47
lines changed

13 files changed

+49
-47
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ jobs:
7777
matrix:
7878
command:
7979
- 'yarn test:nuts:convert'
80+
- 'yarn test:nuts:deb'
8081
- 'yarn test:nuts:delete'
8182
- 'yarn test:nuts:deploy:async'
8283
- 'yarn test:nuts:deploy:destructive'
@@ -100,6 +101,7 @@ jobs:
100101
postbuildCommands: 'cp src/registry/metadataRegistry.json lib/src/registry'
101102
preExternalBuildCommands: 'shx rm -rf node_modules/@salesforce/source-tracking/node_modules/@salesforce/source-deploy-retrieve'
102103
os: ubuntu-latest
104+
branch: sm/qa-771
103105
secrets: inherit
104106

105107
# now run the rest of the nuts for each os via cached version of all the setup steps
@@ -111,6 +113,7 @@ jobs:
111113
matrix:
112114
command:
113115
- 'yarn test:nuts:convert'
116+
- 'yarn test:nuts:deb'
114117
- 'yarn test:nuts:delete'
115118
- 'yarn test:nuts:deploy:async'
116119
- 'yarn test:nuts:deploy:destructive'
@@ -134,4 +137,5 @@ jobs:
134137
postbuildCommands: 'cp src/registry/metadataRegistry.json lib/src/registry'
135138
preExternalBuildCommands: 'shx rm -rf node_modules/@salesforce/source-tracking/node_modules/@salesforce/source-deploy-retrieve'
136139
os: windows-latest
140+
branch: sm/qa-771
137141
secrets: inherit

src/resolve/adapters/digitalExperienceSourceAdapter.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class DigitalExperienceSourceAdapter extends BundleSourceAdapter {
103103

104104
private getBundleName(contentPath: string): string {
105105
const bundlePath = this.getBundleMetadataXmlPath(contentPath);
106-
return `${parentName(dirname(bundlePath))}${sep}${parentName(bundlePath)}`;
106+
return `${parentName(dirname(bundlePath))}/${parentName(bundlePath)}`;
107107
}
108108

109109
private getBundleMetadataXmlPath(path: string): string {
@@ -129,5 +129,4 @@ export class DigitalExperienceSourceAdapter extends BundleSourceAdapter {
129129
* @param contentPath This hook is called only after trimPathToContent() is called. so this will always be a folder structure
130130
* @returns name of type/apiName format
131131
*/
132-
const calculateNameFromPath = (contentPath: string): string =>
133-
`${parentName(contentPath)}${sep}${baseName(contentPath)}`;
132+
const calculateNameFromPath = (contentPath: string): string => `${parentName(contentPath)}/${baseName(contentPath)}`;

test/collections/componentSet.test.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,8 +1257,9 @@ describe('ComponentSet', () => {
12571257
type: digitalExperienceBundle.DEB_TYPE.id,
12581258
};
12591259

1260-
const debMetaFilePath = join('path', 'to', 'digitalExperiences', 'site', 'foo', 'foo.digitalExperience-meta.xml');
1261-
expect(set.getComponentFilenamesByNameAndType(deb)).to.have.members([debMetaFilePath]);
1260+
expect(set.getComponentFilenamesByNameAndType(deb)).to.have.members([
1261+
digitalExperienceBundle.BUNDLE_META_FILE_PATH,
1262+
]);
12621263
});
12631264

12641265
it('should correctly return DE (DigitalExperience) component file paths', () => {
@@ -1272,12 +1273,10 @@ describe('ComponentSet', () => {
12721273
type: digitalExperienceBundle.DE_TYPE.id,
12731274
};
12741275

1275-
const deViewHomePath = join('path', 'to', 'digitalExperiences', 'site', 'foo', 'sfdc_cms__view', 'home');
1276-
12771276
expect(set.getComponentFilenamesByNameAndType(de)).to.have.members([
1278-
join(deViewHomePath, 'content.json'),
1279-
join(deViewHomePath, 'fr.json'),
1280-
join(deViewHomePath, '_meta.json'),
1277+
join(digitalExperienceBundle.HOME_VIEW_PATH, 'content.json'),
1278+
join(digitalExperienceBundle.HOME_VIEW_PATH, 'fr.json'),
1279+
join(digitalExperienceBundle.HOME_VIEW_PATH, '_meta.json'),
12811280
]);
12821281
});
12831282
});

test/mock/type-constants/digitalExperienceBundleConstants.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import { join } from 'path';
88
import { registry, SourceComponent } from '../../../src';
99
import { META_XML_SUFFIX } from '../../../src/common';
1010

11-
export const DE_TYPE = registry.types.digitalexperiencebundle.children.types.digitalexperience;
1211
export const DEB_TYPE = registry.types.digitalexperiencebundle;
12+
export const DE_TYPE = DEB_TYPE.children.types.digitalexperience;
1313

1414
// metaFileName = metaFileSuffix for DigitalExperience.
1515
export const DE_METAFILE = DE_TYPE.metaFileSuffix;
1616

17-
export const BUNDLE_NAME = join('site', 'foo');
17+
export const BUNDLE_NAME = 'site/foo';
1818
export const BUNDLE_FULL_NAME = BUNDLE_NAME;
19-
export const HOME_VIEW_NAME = join('sfdc_cms__view', 'home');
19+
export const HOME_VIEW_NAME = 'sfdc_cms__view/home';
2020
export const HOME_VIEW_FULL_NAME = `${BUNDLE_FULL_NAME}.${HOME_VIEW_NAME}`;
2121

2222
export const BUNDLE_META_FILE = `foo.${DEB_TYPE.suffix}${META_XML_SUFFIX}`;
@@ -25,9 +25,9 @@ export const HOME_VIEW_CONTENT_FILE = 'content.json';
2525
export const HOME_VIEW_FRENCH_VARIANT_FILE = 'fr.json';
2626

2727
export const BASE_PATH = join('path', 'to', DEB_TYPE.directoryName);
28-
export const BUNDLE_PATH = join(BASE_PATH, BUNDLE_NAME);
28+
export const BUNDLE_PATH = join(BASE_PATH, 'site', 'foo');
2929
export const BUNDLE_META_FILE_PATH = join(BUNDLE_PATH, BUNDLE_META_FILE);
30-
export const HOME_VIEW_PATH = join(BUNDLE_PATH, HOME_VIEW_NAME);
30+
export const HOME_VIEW_PATH = join(BUNDLE_PATH, 'sfdc_cms__view', 'home');
3131
export const HOME_VIEW_CONTENT_FILE_PATH = join(HOME_VIEW_PATH, HOME_VIEW_CONTENT_FILE);
3232
export const HOME_VIEW_FRENCH_VARIANT_FILE_PATH = join(HOME_VIEW_PATH, HOME_VIEW_FRENCH_VARIANT_FILE);
3333

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[
22
{
33
"name": "componentSetCreate",
4-
"duration": 221.1766770000104
4+
"duration": 220.98211799998535
55
},
66
{
77
"name": "sourceToMdapi",
8-
"duration": 6279.265217999986
8+
"duration": 5883.410992000019
99
},
1010
{
1111
"name": "sourceToZip",
12-
"duration": 4784.06782299999
12+
"duration": 4195.635892999999
1313
},
1414
{
1515
"name": "mdapiToSource",
16-
"duration": 4182.580141999992
16+
"duration": 4158.288854999992
1717
}
1818
]
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[
22
{
33
"name": "componentSetCreate",
4-
"duration": 458.3479590000061
4+
"duration": 423.7058580000303
55
},
66
{
77
"name": "sourceToMdapi",
8-
"duration": 9421.391817999975
8+
"duration": 9075.414397999994
99
},
1010
{
1111
"name": "sourceToZip",
12-
"duration": 6710.942861999996
12+
"duration": 6641.056959000009
1313
},
1414
{
1515
"name": "mdapiToSource",
16-
"duration": 4806.480233000009
16+
"duration": 4751.506416000018
1717
}
1818
]
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[
22
{
33
"name": "componentSetCreate",
4-
"duration": 753.9240889999783
4+
"duration": 761.5197770000086
55
},
66
{
77
"name": "sourceToMdapi",
8-
"duration": 11511.726317000022
8+
"duration": 12648.731094999996
99
},
1010
{
1111
"name": "sourceToZip",
12-
"duration": 10486.967529999965
12+
"duration": 10670.394476999994
1313
},
1414
{
1515
"name": "mdapiToSource",
16-
"duration": 8522.32658199995
16+
"duration": 8812.610347000009
1717
}
1818
]
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[
22
{
33
"name": "componentSetCreate",
4-
"duration": 207.436284000054
4+
"duration": 208.37945000000764
55
},
66
{
77
"name": "sourceToMdapi",
8-
"duration": 5423.031130000018
8+
"duration": 5163.694585999998
99
},
1010
{
1111
"name": "sourceToZip",
12-
"duration": 5202.063126999885
12+
"duration": 4249.0233250000165
1313
},
1414
{
1515
"name": "mdapiToSource",
16-
"duration": 3417.4116909999866
16+
"duration": 3356.330946000002
1717
}
1818
]
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[
22
{
33
"name": "componentSetCreate",
4-
"duration": 444.3853680000175
4+
"duration": 408.6128360000148
55
},
66
{
77
"name": "sourceToMdapi",
8-
"duration": 8262.888810999924
8+
"duration": 7221.068067000015
99
},
1010
{
1111
"name": "sourceToZip",
12-
"duration": 7476.526809000177
12+
"duration": 5880.985977000004
1313
},
1414
{
1515
"name": "mdapiToSource",
16-
"duration": 4032.80767800007
16+
"duration": 4112.393477000005
1717
}
1818
]
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[
22
{
33
"name": "componentSetCreate",
4-
"duration": 707.5937909998465
4+
"duration": 707.7821399999957
55
},
66
{
77
"name": "sourceToMdapi",
8-
"duration": 10896.007658000104
8+
"duration": 9948.782891999988
99
},
1010
{
1111
"name": "sourceToZip",
12-
"duration": 9609.415148
12+
"duration": 9234.353405000002
1313
},
1414
{
1515
"name": "mdapiToSource",
16-
"duration": 6808.866952999961
16+
"duration": 7288.00951600002
1717
}
1818
]

0 commit comments

Comments
 (0)