@ui5/webcomponents-tools 2.7.3 → 2.8.0-rc.1

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,7 +3,7 @@
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.7.3](https://github.com/SAP/ui5-webcomponents/compare/v2.7.1...v2.7.3) (2025-02-13)
6
+ # [2.8.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v2.8.0-rc.0...v2.8.0-rc.1) (2025-02-13)
7
7
 
8
8
  **Note:** Version bump only for package @ui5/webcomponents-tools
9
9
 
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- ## [2.7.1](https://github.com/SAP/ui5-webcomponents/compare/v2.7.0...v2.7.1) (2025-02-07)
14
+ # [2.8.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v2.7.0...v2.8.0-rc.0) (2025-02-06)
15
15
 
16
16
  **Note:** Version bump only for package @ui5/webcomponents-tools
17
17
 
@@ -42,9 +42,7 @@ const realEventCmdCallback = (originalFn, element, ...args) => {
42
42
  cy.get(element)
43
43
  .should($el => {
44
44
  if ($el[0].tagName.includes("-") && $el[0].shadowRoot) {
45
- expect($el[0].shadowRoot.hasChildNodes()).to.be.true;
46
- } else {
47
- expect(true).to.be.true;
45
+ expect($el[0].shadowRoot.hasChildNodes(), "Custom elements with shadow DOM have content in their shadow DOM").to.be.true;
48
46
  }
49
47
  })
50
48
  .and("be.visible")
@@ -6,7 +6,7 @@ export interface MountUI5Options extends MountLitTemplateOptions {
6
6
  ui5Configuration: object;
7
7
  }
8
8
  export type MountOptions = Partial<MountUI5Options>;
9
- export declare function mount<T extends keyof HTMLElementTagNameMap = any>(component: JSX.Element, options?: MountOptions): Cypress.Chainable<JQuery<HTMLElementTagNameMap[T]>>;
9
+ export declare function mount(component: JSX.Element, options?: MountOptions): CypressChainable<JQuery<HTMLElement>>;
10
10
  declare global {
11
11
  namespace Cypress {
12
12
  interface Chainable {
@@ -22,23 +22,23 @@ function mount(component, options = {}) {
22
22
  applyConfiguration(options);
23
23
 
24
24
  // Mount JSX Element
25
- return cy.wrap({ preactMount })
26
- .invoke("preactMount", component, container)
27
- .then(() => {
28
- cy.get(container)
29
- .find("*")
30
- .should($el => {
31
- const shadowrootsExist = [...$el].every(el => {
32
- if (el.tagName.includes("-") && el.shadowRoot) {
33
- return el.shadowRoot.hasChildNodes();
34
- }
35
-
36
- return true;
37
- })
38
-
39
- expect(shadowrootsExist, "Custom elements with shadow DOM have content in their shadow DOM").to.be.true;
40
- })
41
- });
25
+ preactMount(component, container);
26
+
27
+ cy.get(container)
28
+ .find("*")
29
+ .should($el => {
30
+ const shadowrootsExist = [...$el].every(el => {
31
+ if (el.tagName.includes("-") && el.shadowRoot) {
32
+ return el.shadowRoot.hasChildNodes();
33
+ }
34
+
35
+ return true;
36
+ })
37
+
38
+ expect(shadowrootsExist, "Custom elements with shadow DOM have content in their shadow DOM").to.be.true;
39
+ })
40
+
41
+ return cy.get(container);
42
42
  }
43
43
 
44
44
  setupHooks(cleanup);
@@ -19,7 +19,7 @@ const getScripts = (options) => {
19
19
  // The script creates the "src/generated/js-imports/Illustration.js" file that registers loaders (dynamic JS imports) for each illustration
20
20
  const createIllustrationsLoadersScript = illustrationsData.map(illustrations => `node ${LIB}/generate-js-imports/illustrations.js ${illustrations.destinationPath} ${illustrations.dynamicImports.outputFile} ${illustrations.set} ${illustrations.collection} ${illustrations.dynamicImports.location} ${illustrations.dynamicImports.filterOut.join(" ")}`).join(" && ");
21
21
 
22
- const tsOption = !options.legacy || options.jsx;
22
+ const tsOption = !options.legacy;
23
23
  const tsCommandOld = tsOption ? "tsc" : "";
24
24
  let tsWatchCommandStandalone = tsOption ? "tsc --watch" : "";
25
25
  // this command is only used for standalone projects. monorepo projects get their watch from vite, so opt-out here
@@ -126,6 +126,7 @@ const getScripts = (options) => {
126
126
  "test-cy-ci-suite-1": `cross-env CYPRESS_COVERAGE=true TEST_SUITE=SUITE1 yarn cypress run --component --browser chrome`,
127
127
  "test-cy-ci-suite-2": `cross-env CYPRESS_COVERAGE=true TEST_SUITE=SUITE2 yarn cypress run --component --browser chrome`,
128
128
  "test-cy-open": `cross-env CYPRESS_COVERAGE=true yarn cypress open --component --browser chrome`,
129
+ "test-cy-single": `cross-env yarn cypress run --component --browser chrome --spec ${process.argv[3]}`,
129
130
  "test-suite-1": `node "${LIB}/test-runner/test-runner.js" --suite suite1`,
130
131
  "test-suite-2": `node "${LIB}/test-runner/test-runner.js" --suite suite2`,
131
132
  startWithScope: "nps scope.prepare scope.watchWithBundle",
@@ -127,7 +127,7 @@ function processClass(ts, classNode, moduleDoc) {
127
127
  }
128
128
 
129
129
  // Events
130
- currClass.events = findAllDecorators(classNode, "event")
130
+ currClass.events = findAllDecorators(classNode, ["event", "eventStrict"])
131
131
  ?.map(event => processEvent(ts, event, classNode, moduleDoc));
132
132
 
133
133
  // TODO: remove after changing Button's click to custom event.
package/lib/cem/utils.mjs CHANGED
@@ -263,12 +263,22 @@ const findDecorator = (node, decoratorName) => {
263
263
  };
264
264
 
265
265
  const findAllDecorators = (node, decoratorName) => {
266
- return (
267
- node?.decorators?.filter(
268
- (decorator) =>
269
- decorator?.expression?.expression?.text === decoratorName
270
- ) || []
271
- );
266
+ if (typeof decoratorName === "string") {
267
+ return node?.decorators?.filter(decorator => decorator?.expression?.expression?.text === decoratorName ) || [];
268
+ }
269
+
270
+ if (Array.isArray(decoratorName)) {
271
+ return node?.decorators?.filter(decorator => {
272
+ if (decorator?.expression?.expression?.text) {
273
+ return decoratorName.includes(decorator.expression.expression.text);
274
+ }
275
+
276
+ return false;
277
+ }
278
+ ) || [];
279
+ }
280
+
281
+ return [];
272
282
  };
273
283
 
274
284
  const hasTag = (jsDoc, tagName) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-tools",
3
- "version": "2.7.3",
3
+ "version": "2.8.0-rc.1",
4
4
  "description": "UI5 Web Components: webcomponents.tools",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -87,8 +87,8 @@
87
87
  "devDependencies": {
88
88
  "@cypress/mount-utils": "^4.1.2",
89
89
  "cypress-real-events": "^1.12.0",
90
- "esbuild": "^0.19.9",
90
+ "esbuild": "^0.25.0",
91
91
  "yargs": "^17.5.1"
92
92
  },
93
- "gitHead": "3c8ad1de49fdfebae5a5a506f07b301cfa4be029"
93
+ "gitHead": "3c8f6db1b5cc6e4f23423ab0075c009e9e4965e4"
94
94
  }