@ui5/webcomponents-tools 2.6.0-rc.0 → 2.6.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.6.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.6.0-rc.1...v2.6.0-rc.2) (2024-12-19)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **build:** generation of custom-elements.json ([#10403](https://github.com/SAP/ui5-webcomponents/issues/10403)) ([c4eb55c](https://github.com/SAP/ui5-webcomponents/commit/c4eb55cba3e45677c464df1f8cf2a17e6855f2a0))
12
+
13
+
14
+
15
+
16
+
17
+ # [2.6.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v2.6.0-rc.0...v2.6.0-rc.1) (2024-12-16)
18
+
19
+ **Note:** Version bump only for package @ui5/webcomponents-tools
20
+
21
+
22
+
23
+
24
+
6
25
  # [2.6.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v2.5.0...v2.6.0-rc.0) (2024-12-12)
7
26
 
8
27
 
@@ -4,9 +4,9 @@ const tsMode = fs.existsSync(path.join(process.cwd(), "tsconfig.json"));
4
4
 
5
5
  /**
6
6
  * Returns eslint rules specific to typescript files
7
- * @returns
7
+ * @returns
8
8
  */
9
- const getTsModeOverrides = () => {
9
+ const getTsModeOverrides = () => {
10
10
  const tsConfiguration = {
11
11
  files: ["*.ts"],
12
12
  parser: "@typescript-eslint/parser",
@@ -25,6 +25,7 @@ const getTsModeOverrides = () => {
25
25
  rules: {
26
26
  "no-shadow": "off",
27
27
  "@typescript-eslint/consistent-type-imports": "error",
28
+ "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
28
29
  "@typescript-eslint/no-shadow": ["error"],
29
30
  "@typescript-eslint/no-unsafe-member-access": "off",
30
31
  "@typescript-eslint/no-floating-promises": "off",
package/lib/cem/event.mjs CHANGED
@@ -112,12 +112,12 @@ function processEvent(ts, event, classNode, moduleDoc) {
112
112
  : sinceTag.name;
113
113
  }
114
114
 
115
- const eventDetailType = classNode.members?.find(member => member.name.text === "eventDetails")?.type;
115
+ const eventDetailType = classNode.members?.find(member => {
116
+ return ts.isPropertyDeclaration(member) && member.name.text === "eventDetails"
117
+ })?.type;
116
118
  const eventDetailRef = eventDetailType?.members?.find(member => member.name.text === name) || eventDetailType?.types?.[eventDetailType?.types?.length - 1]?.members?.find(member => member.name.text === name);
117
119
  const hasGeneric = !!event?.expression?.typeArguments
118
- // if (name ==="value-state-change") {
119
- // debugger
120
- // }
120
+
121
121
  if (commentParams.length) {
122
122
  if (eventDetailRef && hasGeneric) {
123
123
  logDocumentationError(moduleDoc.path, `Event details for event '${name}' has to be defined either with generic or with eventDetails.`)
@@ -28,7 +28,7 @@ let customPlugin = {
28
28
 
29
29
  // JS/TS
30
30
  const jsPath = f.path.replace(/dist[\/\\]css/, "src/generated/").replace(".css", extension);
31
- const jsContent = getFileContent(tsMode, jsPath, packageJSON.name, "\`" + newText + "\`", true);
31
+ const jsContent = getFileContent(packageJSON.name, "\`" + newText + "\`", true);
32
32
  writeFileIfChanged(jsPath, jsContent);
33
33
  });
34
34
  })
@@ -42,16 +42,11 @@ let scopingPlugin = {
42
42
  // JSON
43
43
  const jsonPath = f.path.replace(/dist[\/\\]css/, "dist/generated/assets").replace(".css", ".css.json");
44
44
  await mkdir(path.dirname(jsonPath), {recursive: true});
45
- const data = {
46
- packageName: packageJSON.name,
47
- fileName: jsonPath.substr(jsonPath.lastIndexOf("themes")),
48
- content: newText,
49
- };
50
- writeFileIfChanged(jsonPath, JSON.stringify({_: data}));
45
+ writeFileIfChanged(jsonPath, JSON.stringify(newText));
51
46
 
52
47
  // JS/TS
53
48
  const jsPath = f.path.replace(/dist[\/\\]css/, "src/generated/").replace(".css", extension);
54
- const jsContent = getFileContent(tsMode, jsPath, packageJSON.name, "\`" + newText + "\`");
49
+ const jsContent = getFileContent(packageJSON.name, "\`" + newText + "\`");
55
50
  writeFileIfChanged(jsPath, jsContent);
56
51
  });
57
52
  })
@@ -47,30 +47,10 @@ registerThemePropertiesLoader("${packageName}", "${DEFAULT_THEME}", async () =>
47
47
  `;
48
48
  };
49
49
 
50
- const getFileContent = (tsMode, targetFile, packageName, css, includeDefaultTheme) => {
51
- if (tsMode) {
52
- return getTSContent(targetFile, packageName, css, includeDefaultTheme);
53
- }
54
-
55
- return getJSContent(targetFile, packageName, css, includeDefaultTheme);
56
- }
57
-
58
- const getTSContent = (targetFile, packageName, css, includeDefaultTheme) => {
59
- const typeImport = "import type { StyleData } from \"@ui5/webcomponents-base/dist/types.js\";"
50
+ const getFileContent = (packageName, css, includeDefaultTheme) => {
60
51
  const defaultTheme = includeDefaultTheme ? getDefaultThemeCode(packageName) : "";
61
-
62
- // tabs are intentionally mixed to have proper identation in the produced file
63
- return `${typeImport}
64
- ${defaultTheme}
65
- const styleData: StyleData = {packageName:"${packageName}",fileName:"${targetFile.substr(targetFile.lastIndexOf("themes"))}",content:${css}};
66
- export default styleData;
67
- `;
52
+ return `${defaultTheme}export default ${css.trim()}`
68
53
  }
69
54
 
70
- const getJSContent = (targetFile, packageName, css, includeDefaultTheme) => {
71
- const defaultTheme = includeDefaultTheme ? getDefaultThemeCode(packageName) : "";
72
-
73
- return `${defaultTheme}export default {packageName:"${packageName}",fileName:"${targetFile.substr(targetFile.lastIndexOf("themes"))}",content:${css}}`
74
- }
75
55
 
76
56
  export { writeFileIfChanged, stripThemingBaseContent, getFileContent}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-tools",
3
- "version": "2.6.0-rc.0",
3
+ "version": "2.6.0-rc.2",
4
4
  "description": "UI5 Web Components: webcomponents.tools",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -48,7 +48,7 @@
48
48
  "eslint": "^7.22.0",
49
49
  "eslint-config-airbnb-base": "^14.2.1",
50
50
  "eslint-plugin-cypress": "^3.4.0",
51
- "eslint-plugin-import": "^2.22.1",
51
+ "eslint-plugin-import": "^2.31.0",
52
52
  "esprima": "^4.0.1",
53
53
  "getopts": "^2.3.0",
54
54
  "glob": "^7.1.6",
@@ -86,5 +86,5 @@
86
86
  "esbuild": "^0.19.9",
87
87
  "yargs": "^17.5.1"
88
88
  },
89
- "gitHead": "17869d45f20b28009feaac9d6f59054ba530b3ae"
89
+ "gitHead": "1d0e96fdf4cf4126817c45a9dad1c893d52a63fc"
90
90
  }
package/tsconfig.json CHANGED
@@ -12,5 +12,7 @@
12
12
  "inlineSources": true,
13
13
  "strict": true,
14
14
  "moduleResolution": "node",
15
+ "jsx": "react-jsx",
16
+ "jsxImportSource": "@ui5/webcomponents-base",
15
17
  }
16
18
  }