Skip to content

Commit 9c0b900

Browse files
authored
fix: digitalExperiences create files to right folders @W-20967044@ (#1680)
* fix: digitalExperiences create files to right folders @W-20967044@ * fix: removed erroneous test.only * fix: unit test replaced with snapshot @W-209670044@
1 parent 630463b commit 9c0b900

269 files changed

Lines changed: 6426 additions & 2 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/convert/transformers/defaultMetadataTransformer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ const getContentSourceDestination = (
9292
if (
9393
source.endsWith('content.json') ||
9494
source.endsWith('_meta.json') ||
95-
!(fs.existsSync(dir) && fs.statSync(dir).isDirectory())
95+
(!(fs.existsSync(dir) && fs.statSync(dir).isDirectory()) &&
96+
!source.endsWith('mobile.json') &&
97+
!source.endsWith('tablet.json'))
9698
) {
9799
return join(mergeWith.content, basename(source));
98100
} else {

test/convert/transformers/defaultMetadataTransformer.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ describe('DefaultMetadataTransformer', () => {
297297
});
298298

299299
it('should merge output with merge component when content is a directory', async () => {
300-
assert(typeof bundle.COMPONENT.name === 'string');
301300
const root = join('path', 'to', 'another', bundle.COMPONENT.type.directoryName, bundle.COMPONENT.name);
302301
const component = SourceComponent.createVirtualComponent(
303302
{
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
The way this test works is a little complicated. What's happening here is as follows:
2+
3+
- `force-app` contains a source-formatted project with the folder `main/default/digitalExperiences/site/DemoSite/sfdc_cms__view/demo1/mobile` containing a `mobile.json` file
4+
- `force-app-destination` is identical except it lacks this folder
5+
- The snapshot test merges `force-app` into `force-app-destination` and verifies that the `mobile.json` file is placed into a `mobile` folder instead of placed at the root of the `demo1` page
6+
7+
This snapshot locks in the fix for @W-20967044@
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<DigitalExperienceBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3+
<digitalExperienceFolderShares/>
4+
<label>DemoSite1</label>
5+
<modules>
6+
<module>
7+
<fullyQualifiedName>sfdc_cms__collection</fullyQualifiedName>
8+
<status>ENABLED</status>
9+
</module>
10+
<module>
11+
<fullyQualifiedName>sfdc_cms__mobilePublisherConfig</fullyQualifiedName>
12+
<status>ENABLED</status>
13+
</module>
14+
</modules>
15+
</DigitalExperienceBundle>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"apiName": "mainAppPage",
3+
"type": "sfdc_cms__appPage",
4+
"path": ""
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"type": "sfdc_cms__appPage",
3+
"title": "main",
4+
"contentBody": {
5+
"currentThemeId": "Build_Your_Own_LWR",
6+
"headMarkup": "<title>Welcome to LWC Communities!</title>\n\n<!-- branding stylesheets -->\n\r\n<link rel=\"stylesheet\" href=\"{ basePath }/assets/styles/slds/salesforce-lightning-design-system-part1.css?{ versionKey }\"/>\n<link rel=\"stylesheet\" href=\"{ basePath }/assets/styles/slds/salesforce-lightning-design-system-part2.css?{ versionKey }\"/>\n<link rel=\"stylesheet\" href=\"{ basePath }/assets/styles/slds/salesforce-lightning-design-system-part3.css?{ versionKey }\"/>\n<link rel=\"stylesheet\" href=\"{ basePath }/assets/styles/slds/salesforce-lightning-design-system-part4.css?{ versionKey }\"/>\r\n<link rel=\"stylesheet\" href=\"{ basePath }/assets/styles/dxp-site-spacing-styling-hooks.min.css?{ versionKey }\" />\n<link rel=\"stylesheet\" href=\"{ basePath }/assets/styles/dxp-styling-hooks.min.css?{ versionKey }\" />\n<link rel=\"stylesheet\" href=\"{ basePath }/assets/styles/dxp-slds-extensions.min.css?{ versionKey }\" />\n\n\n\n<!-- branding stylesheets-->\n\n<link rel=\"stylesheet\" href=\"{ styles/styles.css }\" />\n<link rel=\"stylesheet\" href=\"{ styles/print.css }\" media=\"print\"/>\n",
7+
"isLockerServiceEnabled": true,
8+
"isRelaxedCSPLevel": false,
9+
"templateName": "talon-template-byo"
10+
},
11+
"urlName": "main"
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"apiName": "Build_Your_Own_LWR",
3+
"type": "sfdc_cms__brandingSet",
4+
"path": "brandingSets"
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,280 @@
1+
{
2+
"type": "sfdc_cms__brandingSet",
3+
"title": "Build Your Own (LWR)",
4+
"contentBody": {
5+
"brandingSetType": "APP",
6+
"definitionName": "talon-template-byo:branding",
7+
"values": {
8+
"BackgroundColor": "#ffffff",
9+
"BaseFont": "var(--dxp-g-root-font-family)",
10+
"BaseFontSize": "1rem",
11+
"BodyFont": "var(--dxp-s-html-font-family)",
12+
"BodyFontSize": "1rem",
13+
"BodyFontStyle": "normal",
14+
"BodyFontWeight": "400",
15+
"BodyLetterSpacing": "0em",
16+
"BodyLineHeight": "1.5",
17+
"BodySmallFont": "var(--dxp-s-html-font-family)",
18+
"BodySmallFontSize": "0.75rem",
19+
"BodySmallFontStyle": "normal",
20+
"BodySmallFontWeight": "400",
21+
"BodySmallLetterSpacing": "0em",
22+
"BodySmallLineHeight": "1.25",
23+
"BodySmallTextColor": "var(--dxp-g-root-contrast)",
24+
"BodySmallTextDecoration": "none",
25+
"BodySmallTextTransform": "none",
26+
"BodyTextColor": "var(--dxp-g-root-contrast)",
27+
"BodyTextDecoration": "none",
28+
"BodyTextTransform": "none",
29+
"ButtonBorderColor": "var(--dxp-s-button-color)",
30+
"ButtonBorderRadius": "4px",
31+
"ButtonColor": "var(--dxp-g-brand)",
32+
"ButtonFocusBorderColor": "var(--dxp-s-button-color-focus)",
33+
"ButtonFocusColor": "var(--dxp-s-button-color-1)",
34+
"ButtonFocusTextColor": "var(--dxp-s-button-color-contrast-1)",
35+
"ButtonFont": "var(--dxp-s-html-font-family)",
36+
"ButtonFontSize": "1rem",
37+
"ButtonFontStyle": "normal",
38+
"ButtonFontWeight": "400",
39+
"ButtonHoverBorderColor": "var(--dxp-s-button-color-hover)",
40+
"ButtonHoverColor": "var(--dxp-s-button-color-1)",
41+
"ButtonHoverTextColor": "var(--dxp-s-button-color-contrast-1)",
42+
"ButtonLargeBorderRadius": "4px",
43+
"ButtonLargeFontSize": "1.25rem",
44+
"ButtonLargePadding": "1.25rem",
45+
"ButtonLargeVerticalPadding": "0rem",
46+
"ButtonLetterSpacing": "0em",
47+
"ButtonLineHeight": "2",
48+
"ButtonPadding": "1rem",
49+
"ButtonSmallBorderRadius": "4px",
50+
"ButtonSmallFontSize": "0.75rem",
51+
"ButtonSmallPadding": "0.75rem",
52+
"ButtonSmallVerticalPadding": "0rem",
53+
"ButtonTextColor": "var(--dxp-g-brand-contrast)",
54+
"ButtonTextDecoration": "none",
55+
"ButtonTextTransform": "none",
56+
"ButtonVerticalPadding": "0rem",
57+
"ColumnSpacerSizeDesktop": "1rem",
58+
"ColumnSpacerSizeMobile": "0.75rem",
59+
"ComponentSpacerSizeDesktop": "1.5rem",
60+
"ComponentSpacerSizeMobile": "1.5rem",
61+
"DropdownBackgroundColor": "var(--dxp-g-root)",
62+
"DropdownBackgroundHoverColor": "var(--dxp-g-neutral)",
63+
"DropdownBorderColor": "var(--dxp-g-neutral)",
64+
"DropdownTextColor": "var(--dxp-g-root-contrast)",
65+
"DropdownTextHoverColor": "var(--dxp-g-neutral-contrast)",
66+
"FormElementBackgroundColor": "var(--dxp-g-root)",
67+
"FormElementBackgroundFocusColor": "var(--dxp-s-form-element-color-background)",
68+
"FormElementBorderColor": "var(--dxp-g-neutral-3)",
69+
"FormElementBorderFocusColor": "var(--dxp-g-brand)",
70+
"FormElementBorderRadius": "4px",
71+
"FormElementBorderWidth": "1px",
72+
"FormElementCaptionTextDecoration": "none",
73+
"FormElementCaptionTextFont": "var(--dxp-s-html-font-family)",
74+
"FormElementCaptionTextFontSize": "0.75rem",
75+
"FormElementCaptionTextFontStyle": "normal",
76+
"FormElementCaptionTextFontWeight": "400",
77+
"FormElementCaptionTextLetterSpacing": "0",
78+
"FormElementCaptionTextLineHeight": "1.5",
79+
"FormElementCaptionTextTransform": "none",
80+
"FormElementCheckboxBackgroundColor": "var(--dxp-s-form-element-color-background)",
81+
"FormElementCheckboxBackgroundColorChecked": "var(--dxp-s-form-checkbox-color-background)",
82+
"FormElementCheckboxBorderColor": "var(--dxp-s-form-element-color-border)",
83+
"FormElementCheckboxBorderColorChecked": "var(--dxp-s-form-checkbox-color-border)",
84+
"FormElementCheckboxBorderRadius": "4px",
85+
"FormElementCheckboxBorderWidth": "1px",
86+
"FormElementInputPlaceholderColor": "var(--dxp-g-neutral-3)",
87+
"FormElementLabelColor": "var(--dxp-g-root-contrast)",
88+
"FormElementLabelFont": "var(--dxp-s-html-font-family)",
89+
"FormElementLabelFontSize": "1rem",
90+
"FormElementLabelFontStyle": "normal",
91+
"FormElementLabelFontWeight": "400",
92+
"FormElementLabelLetterSpacing": "0",
93+
"FormElementLabelLineHeight": "1.5",
94+
"FormElementLabelTextDecoration": "none",
95+
"FormElementLabelTextTransform": "none",
96+
"FormElementLetterSpacing": "0",
97+
"FormElementPaddingBottom": "0px",
98+
"FormElementPaddingLeft": "12px",
99+
"FormElementPaddingRight": "16px",
100+
"FormElementPaddingTop": "0px",
101+
"FormElementTextColor": "var(--dxp-g-root-contrast)",
102+
"FormElementTextDecoration": "none",
103+
"FormElementTextFocusColor": "var(--dxp-s-form-element-text-color)",
104+
"FormElementTextFont": "var(--dxp-s-html-font-family)",
105+
"FormElementTextFontSize": "1rem",
106+
"FormElementTextFontStyle": "normal",
107+
"FormElementTextFontWeight": "400",
108+
"FormElementTextLineHeight": "1.5",
109+
"FormElementTextTransform": "none",
110+
"HeadingExtraExtraSmallColor": "var(--dxp-g-root-contrast)",
111+
"HeadingExtraExtraSmallFont": "var(--dxp-s-html-font-family)",
112+
"HeadingExtraExtraSmallFontSize": "0.625rem",
113+
"HeadingExtraExtraSmallFontStyle": "normal",
114+
"HeadingExtraExtraSmallFontWeight": "600",
115+
"HeadingExtraExtraSmallLetterSpacing": "0em",
116+
"HeadingExtraExtraSmallLineHeight": "1.25",
117+
"HeadingExtraExtraSmallTextDecoration": "none",
118+
"HeadingExtraExtraSmallTextTransform": "none",
119+
"HeadingExtraLargeColor": "var(--dxp-g-root-contrast)",
120+
"HeadingExtraLargeFont": "var(--dxp-s-html-font-family)",
121+
"HeadingExtraLargeFontSize": "2.5rem",
122+
"HeadingExtraLargeFontStyle": "normal",
123+
"HeadingExtraLargeFontWeight": "300",
124+
"HeadingExtraLargeLetterSpacing": "0em",
125+
"HeadingExtraLargeLineHeight": "1.25",
126+
"HeadingExtraLargeTextDecoration": "none",
127+
"HeadingExtraLargeTextTransform": "none",
128+
"HeadingExtraSmallColor": "var(--dxp-g-root-contrast)",
129+
"HeadingExtraSmallFont": "var(--dxp-s-html-font-family)",
130+
"HeadingExtraSmallFontSize": "0.8125rem",
131+
"HeadingExtraSmallFontStyle": "normal",
132+
"HeadingExtraSmallFontWeight": "600",
133+
"HeadingExtraSmallLetterSpacing": "0em",
134+
"HeadingExtraSmallLineHeight": "1.25",
135+
"HeadingExtraSmallTextDecoration": "none",
136+
"HeadingExtraSmallTextTransform": "none",
137+
"HeadingLargeColor": "var(--dxp-g-root-contrast)",
138+
"HeadingLargeFont": "var(--dxp-s-html-font-family)",
139+
"HeadingLargeFontSize": "1.75rem",
140+
"HeadingLargeFontStyle": "normal",
141+
"HeadingLargeFontWeight": "300",
142+
"HeadingLargeLetterSpacing": "0em",
143+
"HeadingLargeLineHeight": "1.25",
144+
"HeadingLargeTextDecoration": "none",
145+
"HeadingLargeTextTransform": "none",
146+
"HeadingMediumColor": "var(--dxp-g-root-contrast)",
147+
"HeadingMediumFont": "var(--dxp-s-html-font-family)",
148+
"HeadingMediumFontSize": "1.25rem",
149+
"HeadingMediumFontStyle": "normal",
150+
"HeadingMediumFontWeight": "300",
151+
"HeadingMediumLetterSpacing": "0em",
152+
"HeadingMediumLineHeight": "1.25",
153+
"HeadingMediumTextDecoration": "none",
154+
"HeadingMediumTextTransform": "none",
155+
"HeadingSmallColor": "var(--dxp-g-root-contrast)",
156+
"HeadingSmallFont": "var(--dxp-s-html-font-family)",
157+
"HeadingSmallFontSize": "1.125rem",
158+
"HeadingSmallFontStyle": "normal",
159+
"HeadingSmallFontWeight": "300",
160+
"HeadingSmallLetterSpacing": "0em",
161+
"HeadingSmallLineHeight": "1.25",
162+
"HeadingSmallTextDecoration": "none",
163+
"HeadingSmallTextTransform": "none",
164+
"HorizontalRowPaddingDesktop": "1rem",
165+
"HorizontalRowPaddingMobile": "0.75rem",
166+
"LinkColor": "var(--dxp-g-brand)",
167+
"LinkHoverColor": "var(--dxp-s-link-text-color-1)",
168+
"LinkTextDecoration": "none",
169+
"LinkTextDecorationFocus": "underline",
170+
"LinkTextDecorationHover": "underline",
171+
"MaxContentWidthDesktop": "1800px",
172+
"MaxContentWidthMobile": "none",
173+
"MobileBaseFontSize": "1rem",
174+
"PrimaryAccentColor": "#005fb2",
175+
"PrimaryAccentForegroundColor": "#ffffff",
176+
"SecondaryButtonBorderColor": "var(--dxp-s-button-color)",
177+
"SecondaryButtonColor": "var(--dxp-g-root)",
178+
"SecondaryButtonFocusBorderColor": "var(--dxp-s-secondary-button-border-color-1)",
179+
"SecondaryButtonFocusColor": "var(--dxp-s-secondary-button-color-1)",
180+
"SecondaryButtonFocusTextColor": "var(--dxp-s-secondary-button-text-color-1)",
181+
"SecondaryButtonHoverBorderColor": "var(--dxp-s-secondary-button-border-color-1)",
182+
"SecondaryButtonHoverColor": "var(--dxp-s-secondary-button-color-1)",
183+
"SecondaryButtonHoverTextColor": "var(--dxp-s-secondary-button-text-color-1)",
184+
"SecondaryButtonTextColor": "var(--dxp-s-button-color)",
185+
"SiteLogo": "",
186+
"TertiaryButtonBorderColor": "rgba(0,0,0,0)",
187+
"TertiaryButtonColor": "rgba(0,0,0,0)",
188+
"TertiaryButtonFocusBorderColor": "var(--dxp-s-tertiary-button-border-color-1)",
189+
"TertiaryButtonFocusColor": "var(--dxp-s-tertiary-button-color-1)",
190+
"TertiaryButtonFocusTextColor": "var(--dxp-s-tertiary-button-text-color-1)",
191+
"TertiaryButtonHoverBorderColor": "var(--dxp-s-tertiary-button-border-color-1)",
192+
"TertiaryButtonHoverColor": "var(--dxp-s-tertiary-button-color-1)",
193+
"TertiaryButtonHoverTextColor": "var(--dxp-s-tertiary-button-text-color-1)",
194+
"TertiaryButtonTextColor": "var(--dxp-s-button-color)",
195+
"TextColor": "#1a1b1e",
196+
"VerticalRowPaddingDesktop": "1rem",
197+
"VerticalRowPaddingMobile": "0.75rem",
198+
"_BackgroundColor1": "#ebebeb",
199+
"_BackgroundColor2": "#c2c2c2",
200+
"_BackgroundColor3": "#858585",
201+
"_ButtonActiveBorderColor": "var(--dxp-s-button-border-color-focus)",
202+
"_ButtonActiveColor": "var(--dxp-s-button-color-focus)",
203+
"_ButtonActiveTextColor": "var(--dxp-s-button-color-focus-contrast)",
204+
"_ButtonColor1": "var(--dxp-g-brand-1)",
205+
"_ButtonTextColor1": "var(--dxp-g-brand-contrast-1)",
206+
"_DestructiveColor": "#c23934",
207+
"_DestructiveColor1": "#a2302b",
208+
"_DestructiveColor2": "#611d1a",
209+
"_DestructiveColor3": "#010000",
210+
"_DestructiveForegroundColor": "#ffffff",
211+
"_DestructiveForegroundColor1": "#ffffff",
212+
"_DestructiveForegroundColor2": "#ffffff",
213+
"_DestructiveForegroundColor3": "#ffffff",
214+
"_InfoColor": "#16325c",
215+
"_InfoColor1": "#0e203b",
216+
"_InfoColor2": "#000000",
217+
"_InfoColor3": "#000000",
218+
"_InfoForegroundColor": "#ffffff",
219+
"_InfoForegroundColor1": "#ffffff",
220+
"_InfoForegroundColor2": "#ffffff",
221+
"_InfoForegroundColor3": "#ffffff",
222+
"_LinkColor1": "var(--dxp-g-brand-1)",
223+
"_NeutralColor": "#ecebea",
224+
"_NeutralColor1": "#d9d7d5",
225+
"_NeutralColor2": "#b2aeaa",
226+
"_NeutralColor3": "#76716b",
227+
"_NeutralForegroundColor": "#000000",
228+
"_NeutralForegroundColor1": "#000000",
229+
"_NeutralForegroundColor2": "#000000",
230+
"_NeutralForegroundColor3": "#ffffff",
231+
"_OfflineColor": "#444444",
232+
"_OfflineColor1": "#303030",
233+
"_OfflineColor2": "#070707",
234+
"_OfflineColor3": "#000000",
235+
"_OfflineForegroundColor": "#ffffff",
236+
"_OfflineForegroundColor1": "#ffffff",
237+
"_OfflineForegroundColor2": "#ffffff",
238+
"_OfflineForegroundColor3": "#ffffff",
239+
"_PrimaryAccentColor1": "#004989",
240+
"_PrimaryAccentColor2": "#001e38",
241+
"_PrimaryAccentColor3": "#000000",
242+
"_PrimaryAccentForegroundColor1": "#ffffff",
243+
"_PrimaryAccentForegroundColor2": "#ffffff",
244+
"_PrimaryAccentForegroundColor3": "#ffffff",
245+
"_SecondaryButtonActiveBorderColor": "var(--dxp-s-secondary-button-border-color-focus)",
246+
"_SecondaryButtonActiveColor": "var(--dxp-s-secondary-button-color-focus)",
247+
"_SecondaryButtonActiveTextColor": "var(--dxp-s-secondary-button-text-color-focus)",
248+
"_SecondaryButtonBorderColor1": "var(--dxp-s-button-color-1)",
249+
"_SecondaryButtonColor1": "var(--dxp-g-root-1)",
250+
"_SecondaryButtonTextColor1": "var(--dxp-s-button-color-1)",
251+
"_SiteLogoUrl": "",
252+
"_SuccessColor": "#4bca81",
253+
"_SuccessColor1": "#36b66c",
254+
"_SuccessColor2": "#237747",
255+
"_SuccessColor3": "#07190f",
256+
"_SuccessForegroundColor": "#000000",
257+
"_SuccessForegroundColor1": "#000000",
258+
"_SuccessForegroundColor2": "#ffffff",
259+
"_SuccessForegroundColor3": "#ffffff",
260+
"_TertiaryButtonActiveBorderColor": "var(--dxp-s-tertiary-button-border-color-focus)",
261+
"_TertiaryButtonActiveColor": "var(--dxp-s-tertiary-button-color-focus)",
262+
"_TertiaryButtonActiveTextColor": "var(--dxp-s-tertiary-button-text-color-focus)",
263+
"_TertiaryButtonBorderColor1": "rgba(0,0,0,0)",
264+
"_TertiaryButtonColor1": "rgba(0,0,0,0)",
265+
"_TertiaryButtonTextColor1": "var(--dxp-s-button-color-1)",
266+
"_TextColor1": "#000000",
267+
"_TextColor2": "#000000",
268+
"_TextColor3": "#000000",
269+
"_WarningColor": "#ffb75d",
270+
"_WarningColor1": "#ffa534",
271+
"_WarningColor2": "#e27d00",
272+
"_WarningColor3": "#673900",
273+
"_WarningForegroundColor": "#000000",
274+
"_WarningForegroundColor1": "#000000",
275+
"_WarningForegroundColor2": "#000000",
276+
"_WarningForegroundColor3": "#ffffff"
277+
}
278+
},
279+
"urlName": "build-your-own-lwr"
280+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"apiName": "languages",
3+
"type": "sfdc_cms__languageSettings",
4+
"path": "_settings"
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"type": "sfdc_cms__languageSettings",
3+
"title": "LanguageContent",
4+
"contentBody": {
5+
"languages": [
6+
{
7+
"locale": "en_US",
8+
"label": "English (US)",
9+
"isActive": true,
10+
"isAuthoringOnly": false
11+
}
12+
],
13+
"defaultLocale": "en_US"
14+
},
15+
"urlName": "languagecontent"
16+
}

0 commit comments

Comments
 (0)