Skip to content

Commit 4e2c4d8

Browse files
authored
docs: use assets in samples (#12585)
1 parent d9bbac7 commit 4e2c4d8

File tree

41 files changed

+142
-25
lines changed

Some content is hidden

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

41 files changed

+142
-25
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"generate": "yarn workspaces foreach --all --parallel run generate",
1414
"generateAPI": "yarn workspaces foreach --all --parallel run generateAPI",
1515
"generateProd": "yarn workspaces foreach --all --parallel run generateProd",
16-
"ts": "tsc -b packages/compat/tsconfig.json packages/fiori/tsconfig.json packages/ai/tsconfig.json",
16+
"ts": "tsc -b",
1717
"bundle": "yarn workspaces foreach --all --parallel run bundle",
1818
"clean": "yarn workspaces foreach --all --parallel run clean",
1919
"scopePrepare:main": "yarn workspace @ui5/webcomponents ui5nps scope.prepare",

packages/ai/src/Assets-fetch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// main package assets (transitively base, theming and icons)
22
import "@ui5/webcomponents/dist/Assets-fetch.js";
33

4-
// own fiori package assets
4+
// own ai package assets
55
import "./generated/json-imports/Themes-fetch.js";
66
import "./generated/json-imports/i18n-fetch.js";

packages/ai/src/Assets-node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
// main package assets (transitively base, theming and icons)
1414
import "@ui5/webcomponents/dist/Assets-node.js";
1515

16-
// own fiori package assets
16+
// own ai package assets
1717
import "./generated/json-imports/Themes-node.js";
1818
import "./generated/json-imports/i18n-node.js";
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// main package assets (transitively base, theming and icons)
2+
import "@ui5/webcomponents/dist/Assets-fetch.js";
3+
4+
// own compat package assets
5+
import "./generated/json-imports/Themes-fetch.js";
6+
import "./generated/json-imports/i18n-fetch.js";

packages/compat/src/Assets-node.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* The `Assets-node` entry point is used to import all CLDR, theming, and i18n assets.
3+
*
4+
* It serves as an alternative to the `Assets` and `Assets-fetch` modules and supports the
5+
* `with: { type: 'json' }` import attribute for loading JSON files.
6+
*
7+
* This import attribute is required in some environments, such as Node.js with server-side rendering (SSR).
8+
*
9+
* Example usage:
10+
* await import("../assets/i18n/messagebundle_bg.json", { with: { type: 'json' } })
11+
*/
12+
13+
// main package assets (transitively base, theming and icons)
14+
import "@ui5/webcomponents/dist/Assets-node.js";
15+
16+
// own compat package assets
17+
import "./generated/json-imports/Themes-node.js";
18+
import "./generated/json-imports/i18n-node.js";

packages/compat/tsconfig.json

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,35 @@
77
"compilerOptions": {
88
"outDir": "dist",
99
"experimentalDecorators": true,
10-
"verbatimModuleSyntax": true,
10+
"composite": true,
11+
"rootDir": "src",
12+
"tsBuildInfoFile": "dist/.tsbuildinfo",
1113
"module": "NodeNext",
1214
"moduleResolution": "NodeNext",
15+
"verbatimModuleSyntax": true,
1316
"paths": {
1417
"@ui5/webcomponents-base/dist/*": [
1518
"../base/src/*"
1619
],
1720
"@ui5/webcomponents/dist/*": [
1821
"../main/src/*"
1922
],
23+
"@ui5/webcomponents-localization/dist/*": [
24+
"../localization/src/*"
25+
],
2026
"@ui5/webcomponents-theming/dist/*": [
2127
"../theming/src/*"
2228
],
23-
},
29+
"@ui5/webcomponents-icons/dist/*": [
30+
"../icons/src/*"
31+
],
32+
"@ui5/webcomponents-icons-business-suite/dist/*": [
33+
"../icons-business-suite/src/*"
34+
],
35+
"@ui5/webcomponents-icons-tnt/dist/*": [
36+
"../icons-tnt/src/*"
37+
]
38+
}
2439
},
2540
"references": [
2641
{
@@ -29,8 +44,20 @@
2944
{
3045
"path": "../main"
3146
},
47+
{
48+
"path": "../localization"
49+
},
3250
{
3351
"path": "../theming"
3452
},
53+
{
54+
"path": "../icons"
55+
},
56+
{
57+
"path": "../icons-business-suite"
58+
},
59+
{
60+
"path": "../icons-tnt"
61+
}
3562
]
3663
}

packages/main/src/DynamicDateRange.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ interface IDynamicDateRangeOption {
132132
@customElement({
133133
tag: "ui5-dynamic-date-range",
134134
languageAware: true,
135+
cldr: true,
135136
template: DynamicDateRangeTemplate,
136137
renderer: jsxRenderer,
137138
styles: [

packages/website/build-scripts/local-cdn.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ await Promise.all([
2828
]);
2929

3030
const files = await readdir("local-cdn", {recursive: true, withFileTypes: true});
31+
// console.log(files.filter(f => f.path.includes("localization/dist/generated/assets/cldr")))
3132
const filesToDelete = files.filter(f => {
32-
return f.isFile() && !f.name.endsWith(".js") && !f.name.endsWith(".svg") && !f.name.endsWith(".d.ts") && !f.name.endsWith("package.json")
33+
return f.isFile() && !f.name.endsWith(".js")&& !f.name.endsWith(".json") && !f.name.endsWith(".svg") && !f.name.endsWith(".d.ts") && !f.name.endsWith("package.json")
3334
});
35+
36+
console.log(filesToDelete.filter(f => f.path.includes("localization/dist/generated/assets/cldr")))
3437
filesToDelete.map(f => rm(path.join(f.path ?? f.parentPath, f.name)));

packages/website/docs/_samples/fiori/SideNavigation/OverlayMode/main.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/* playground-hide */
2-
import "./playground-support.js";
3-
/* playground-hide-end */
41
import "@ui5/webcomponents-fiori/dist/SideNavigationItem.js";
52
import "@ui5/webcomponents-fiori/dist/SideNavigationSubItem.js";
63
import "@ui5/webcomponents-fiori/dist/SideNavigationGroup.js";
@@ -21,7 +18,7 @@ import "@ui5/webcomponents-icons/dist/group.js";
2118
import "@ui5/webcomponents-icons/dist/locate-me.js";
2219
import "@ui5/webcomponents-icons/dist/calendar.js";
2320
import "@ui5/webcomponents-icons/dist/history.js";
24-
import "@ui5/webcomponents-icons/dist/customer.js";
21+
import "@ui5/webcomponents-icons/dist/customer.js";
2522
import "@ui5/webcomponents-icons/dist/menu2.js";
2623
import "@ui5/webcomponents-icons/dist/write-new.js";
2724
import "@ui5/webcomponents-icons/dist/widgets.js";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
import "@ui5/webcomponents/dist/Assets-fetch.js";
12
import "@ui5/webcomponents/dist/Calendar.js";

0 commit comments

Comments
 (0)