@ui5/webcomponents-tools 0.0.0-701b14e36 → 0.0.0-7a547f8cc

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/README.md +5 -6
  3. package/bin/dev.js +1 -5
  4. package/components-package/eslint.js +28 -0
  5. package/components-package/nps.js +76 -44
  6. package/components-package/postcss.components.js +13 -13
  7. package/components-package/postcss.themes.js +15 -15
  8. package/components-package/vite.config.js +12 -0
  9. package/components-package/wdio.js +28 -4
  10. package/components-package/wdio.sync.js +1 -1
  11. package/icons-collection/nps.js +6 -3
  12. package/lib/copy-and-watch/index.js +0 -1
  13. package/lib/copy-list/index.js +2 -2
  14. package/lib/create-icons/index.js +27 -9
  15. package/lib/create-new-component/index.js +5 -5
  16. package/lib/dev-server/dev-server.js +66 -0
  17. package/lib/dev-server/virtual-index-html-plugin.js +53 -0
  18. package/lib/generate-custom-elements-manifest/index.js +327 -0
  19. package/lib/generate-js-imports/illustrations.js +72 -0
  20. package/lib/generate-json-imports/themes.js +3 -3
  21. package/lib/hbs2lit/src/compiler.js +8 -0
  22. package/lib/hbs2lit/src/litVisitor2.js +46 -8
  23. package/lib/i18n/defaults.js +18 -2
  24. package/lib/jsdoc/configTypescript.json +29 -0
  25. package/lib/jsdoc/plugin.js +32 -0
  26. package/lib/jsdoc/preprocess.js +146 -0
  27. package/lib/jsdoc/template/publish.js +9 -1
  28. package/lib/postcss-css-to-esm/index.js +51 -6
  29. package/lib/postcss-css-to-json/index.js +12 -1
  30. package/lib/postcss-p/postcss-p.mjs +3 -0
  31. package/lib/scoping/get-all-tags.js +1 -8
  32. package/lib/scoping/scope-test-pages.js +1 -1
  33. package/lib/test-runner/test-runner.js +63 -0
  34. package/package.json +15 -15
  35. package/components-package/rollup-plugins/empty-module.js +0 -15
  36. package/components-package/rollup.js +0 -150
  37. package/lib/documentation/index.js +0 -168
  38. package/lib/documentation/templates/api-component-since.js +0 -3
  39. package/lib/documentation/templates/api-css-variables-section.js +0 -24
  40. package/lib/documentation/templates/api-events-section.js +0 -35
  41. package/lib/documentation/templates/api-methods-section.js +0 -26
  42. package/lib/documentation/templates/api-properties-section.js +0 -42
  43. package/lib/documentation/templates/api-slots-section.js +0 -28
  44. package/lib/documentation/templates/template.js +0 -39
  45. package/lib/serve/index.js +0 -46
  46. package/lib/serve/serve.json +0 -3
  47. package/package-lock.json +0 -48
package/CHANGELOG.md CHANGED
@@ -3,6 +3,164 @@
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
+ # [1.11.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.0...v1.11.0-rc.1) (2023-02-09)
7
+
8
+ **Note:** Version bump only for package @ui5/webcomponents-tools
9
+
10
+
11
+
12
+
13
+
14
+ # [1.11.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.10.4-rc.0...v1.11.0-rc.0) (2023-02-02)
15
+
16
+ **Note:** Version bump only for package @ui5/webcomponents-tools
17
+
18
+
19
+
20
+
21
+
22
+ ## [1.10.4-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.10.3...v1.10.4-rc.0) (2023-01-26)
23
+
24
+ **Note:** Version bump only for package @ui5/webcomponents-tools
25
+
26
+
27
+
28
+
29
+
30
+ ## [1.10.3](https://github.com/SAP/ui5-webcomponents/compare/v1.10.2...v1.10.3) (2023-01-25)
31
+
32
+ **Note:** Version bump only for package @ui5/webcomponents-tools
33
+
34
+
35
+
36
+
37
+
38
+ ## [1.10.2](https://github.com/SAP/ui5-webcomponents/compare/v1.10.1...v1.10.2) (2023-01-25)
39
+
40
+ **Note:** Version bump only for package ui5-webcomponents
41
+
42
+ ## [1.10.1](https://github.com/SAP/ui5-webcomponents/compare/v0.0.0-7b49a7ff1...v1.10.1) (2023-01-24)
43
+
44
+ **Note:** Version bump only for package @ui5/webcomponents-tools
45
+
46
+
47
+
48
+
49
+
50
+ # [1.10.0](https://github.com/SAP/ui5-webcomponents/compare/v1.9.3...v1.10.0) (2023-01-20)
51
+
52
+
53
+ ### Bug Fixes
54
+
55
+ * **infra:** set Content-Type header on testsuite ([#6108](https://github.com/SAP/ui5-webcomponents/issues/6108)) ([fae3f91](https://github.com/SAP/ui5-webcomponents/commit/fae3f91975ab1dad7135bea2227f61986eff403f))
56
+
57
+
58
+ ### Features
59
+
60
+ * enable TS in main, fiori ([#6064](https://github.com/SAP/ui5-webcomponents/issues/6064)) ([0b56130](https://github.com/SAP/ui5-webcomponents/commit/0b561307b93b8af465dc5bee67650069ee138f7f))
61
+ * migrate illustrated-message component to TS, small refactor ([#6195](https://github.com/SAP/ui5-webcomponents/issues/6195)) ([046c779](https://github.com/SAP/ui5-webcomponents/commit/046c779f654648172619dd720c0d90342ec78fb9))
62
+ * support decorators for custom elements metadata ([#6072](https://github.com/SAP/ui5-webcomponents/issues/6072)) ([fc9ee6e](https://github.com/SAP/ui5-webcomponents/commit/fc9ee6e2af10b4315fde072a50ab37efa180c809))
63
+ * **ui5-button, ui5-date-picker, ui5-calendar:** migrate to TS ([#6173](https://github.com/SAP/ui5-webcomponents/issues/6173)) ([7232ca0](https://github.com/SAP/ui5-webcomponents/commit/7232ca08f286c5dde10080373fb62247f1acf7b7)), closes [#6080](https://github.com/SAP/ui5-webcomponents/issues/6080)
64
+ * use Typescript for the `base` package ([#5982](https://github.com/SAP/ui5-webcomponents/issues/5982)) ([bd184d8](https://github.com/SAP/ui5-webcomponents/commit/bd184d81a4218328bc7bf04baf2bc1f69a361679))
65
+
66
+
67
+
68
+
69
+
70
+ ## [1.9.3](https://github.com/SAP/ui5-webcomponents/compare/v1.9.2...v1.9.3) (2022-12-16)
71
+
72
+ **Note:** Version bump only for package @ui5/webcomponents-tools
73
+
74
+
75
+
76
+
77
+
78
+ ## [1.9.1](https://github.com/SAP/ui5-webcomponents/compare/v1.9.0...v1.9.1) (2022-11-10)
79
+
80
+
81
+ ### Bug Fixes
82
+
83
+ * **framework:** fix paths for generating illustration imports in nps ([#5997](https://github.com/SAP/ui5-webcomponents/issues/5997)) ([e932f7d](https://github.com/SAP/ui5-webcomponents/commit/e932f7d069ebf10f73219bff7154558b7b0d849e))
84
+
85
+
86
+
87
+
88
+
89
+ # [1.9.0](https://github.com/SAP/ui5-webcomponents/compare/v1.8.0...v1.9.0) (2022-10-31)
90
+
91
+
92
+ ### Bug Fixes
93
+
94
+ * **framework:** fix contexts management in hbs-2-lit compiler ([#5958](https://github.com/SAP/ui5-webcomponents/issues/5958)) ([94d1619](https://github.com/SAP/ui5-webcomponents/commit/94d16199ed7dc79b21d99a0637533e93af54c90a)), closes [#4701](https://github.com/SAP/ui5-webcomponents/issues/4701)
95
+
96
+
97
+ ### Features
98
+
99
+ * **framework:** fetch illustrations on demand ([#5927](https://github.com/SAP/ui5-webcomponents/issues/5927)) ([f8e1033](https://github.com/SAP/ui5-webcomponents/commit/f8e1033643626261dcad8a38f65c325ba9aff99f))
100
+ * **framework:** generate custom elements manifest ([#5964](https://github.com/SAP/ui5-webcomponents/issues/5964)) ([0d62770](https://github.com/SAP/ui5-webcomponents/commit/0d62770cace54fd9aef73d9632dd06d8a83680e9))
101
+
102
+
103
+
104
+
105
+
106
+ # [1.8.0](https://github.com/SAP/ui5-webcomponents/compare/v1.7.1...v1.8.0) (2022-10-03)
107
+
108
+
109
+ ### Features
110
+
111
+ * **icons:** create type-definitions for icon imports ([#5753](https://github.com/SAP/ui5-webcomponents/issues/5753)) ([2de4a04](https://github.com/SAP/ui5-webcomponents/commit/2de4a045f56e2f166d3e846ff11e6f9d76e98009)), closes [#5747](https://github.com/SAP/ui5-webcomponents/issues/5747) [#5335](https://github.com/SAP/ui5-webcomponents/issues/5335)
112
+ * **main:** add support for custom SVG icons ([#5865](https://github.com/SAP/ui5-webcomponents/issues/5865)) ([d8b7200](https://github.com/SAP/ui5-webcomponents/commit/d8b7200f30c16d94b7f15ddbdf9808d8efbaa38c))
113
+
114
+
115
+
116
+
117
+
118
+ ## [1.7.1](https://github.com/SAP/ui5-webcomponents/compare/v1.7.0...v1.7.1) (2022-09-08)
119
+
120
+ **Note:** Version bump only for package @ui5/webcomponents-tools
121
+
122
+
123
+
124
+
125
+
126
+ # [1.7.0](https://github.com/SAP/ui5-webcomponents/compare/v1.6.0...v1.7.0) (2022-09-02)
127
+
128
+ **Note:** Version bump only for package @ui5/webcomponents-tools
129
+
130
+
131
+
132
+
133
+
134
+ # [1.6.0](https://github.com/SAP/ui5-webcomponents/compare/v1.5.0...v1.6.0) (2022-07-25)
135
+
136
+
137
+ ### Bug Fixes
138
+
139
+ * **MultoComboBox:** fix component scoping ([#5553](https://github.com/SAP/ui5-webcomponents/issues/5553)) ([9c26e8e](https://github.com/SAP/ui5-webcomponents/commit/9c26e8e)), closes [#5521](https://github.com/SAP/ui5-webcomponents/issues/5521)
140
+
141
+
142
+
143
+
144
+
145
+ # [1.5.0](https://github.com/SAP/ui5-webcomponents/compare/v1.4.0...v1.5.0) (2022-07-03)
146
+
147
+ **Note:** Version bump only for package @ui5/webcomponents-tools
148
+
149
+
150
+
151
+
152
+
153
+ # [1.4.0](https://github.com/SAP/ui5-webcomponents/compare/v1.3.1...v1.4.0) (2022-05-25)
154
+
155
+
156
+ ### Features
157
+
158
+ **Note:** Version bump only for package @ui5/webcomponents-icons-tnt
159
+
160
+
161
+
162
+
163
+
6
164
  ## [1.3.1](https://github.com/SAP/ui5-webcomponents/compare/v1.3.0...v1.3.1) (2022-04-27)
7
165
 
8
166
  **Note:** Version bump only for package @ui5/webcomponents-tools
package/README.md CHANGED
@@ -1,24 +1,23 @@
1
- ![UI5 icon](https://raw.githubusercontent.com/SAP/ui5-webcomponents/master/docs/images/UI5_logo_wide.png)
1
+ ![UI5 icon](https://raw.githubusercontent.com/SAP/ui5-webcomponents/main/docs/images/UI5_logo_wide.png)
2
2
 
3
3
  # UI5 Web Components - Tools
4
4
 
5
- [![Travis CI Build Status](https://travis-ci.org/SAP/ui5-webcomponents.svg?branch=master)](https://travis-ci.org/SAP/ui5-webcomponents)
6
5
  [![npm Package Version](https://badge.fury.io/js/%40ui5%2Fwebcomponents.svg)](https://www.npmjs.com/package/@ui5/webcomponents)
7
6
 
8
7
  Provides libraries, configuration files and build artifacts,
9
8
  used by other UI5 Web Components packages, such as `main` and `fiori`.
10
9
 
11
10
  ## Resources
12
- - [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/master/README.md)
11
+ - [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/main/README.md)
13
12
  - [UI5 Web Components - Home Page](https://sap.github.io/ui5-webcomponents)
14
13
  - [UI5 Web Components - Playground and API Reference](https://sap.github.io/ui5-webcomponents/playground/)
15
14
 
16
15
  ## Support
17
- We welcome all comments, suggestions, questions, and bug reports. Please follow our [Support Guidelines](https://github.com/SAP/ui5-webcomponents/blob/master/SUPPORT.md#-content) on how to report an issue, or chat with us in the `#webcomponents` channel of the [OpenUI5 Community Slack](https://join-ui5-slack.herokuapp.com/).
16
+ We welcome all comments, suggestions, questions, and bug reports. Please follow our [Support Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/SUPPORT.md#-content) on how to report an issue, or chat with us in the `#webcomponents` channel of the [OpenUI5 Community Slack](https://join-ui5-slack.herokuapp.com/).
18
17
 
19
18
  ## Contribute
20
- Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/master/docs/6-contributing/02-conventions-and-guidelines.md).
19
+ Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/docs/6-contributing/02-conventions-and-guidelines.md).
21
20
 
22
21
  ## License
23
22
  Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
24
- This file is licensed under the Apache Software License, Version 2.0 except as noted otherwise in the [LICENSE](https://github.com/SAP/ui5-webcomponents/blob/master/LICENSE.txt) file.
23
+ This file is licensed under the Apache Software License, Version 2.0 except as noted otherwise in the [LICENSE](https://github.com/SAP/ui5-webcomponents/blob/main/LICENSE.txt) file.
package/bin/dev.js CHANGED
@@ -10,11 +10,7 @@ if (command === "watch") {
10
10
  command = `watch.${argument}`;
11
11
  }
12
12
  } else if (command === "test") {
13
- if (argument === "--no-server") { // yarn test --no-server
14
- command = `test.run`;
15
- } else if (argument) { // yarn test test/specs/Button.spec.js
16
- command = `test.spec --spec ${argument}`;
17
- }
13
+ command = `test ${process.argv.slice(3).join(" ")}`;
18
14
  }
19
15
 
20
16
  child_process.execSync(`npx nps "${command}"`, {stdio: 'inherit'});
@@ -5,6 +5,34 @@ module.exports = {
5
5
  },
6
6
  "root": true,
7
7
  "extends": "airbnb-base",
8
+ overrides: [{
9
+ files: ["*.ts"],
10
+ parser: "@typescript-eslint/parser",
11
+ plugins: ["@typescript-eslint"],
12
+ extends: [
13
+ "plugin:@typescript-eslint/recommended",
14
+ "plugin:@typescript-eslint/recommended-requiring-type-checking"
15
+ ],
16
+ parserOptions: {
17
+ "project": ["./tsconfig.json", "./packages/*/tsconfig.json"],
18
+ },
19
+ /**
20
+ * Typescript Rules
21
+ */
22
+ rules: {
23
+ "no-shadow": "off",
24
+ "@typescript-eslint/no-shadow": ["error"],
25
+ "@typescript-eslint/no-unsafe-member-access": "off",
26
+ "@typescript-eslint/no-floating-promises": "off",
27
+ "@typescript-eslint/no-explicit-any": "off",
28
+ "@typescript-eslint/no-unsafe-assignment": "off",
29
+ "@typescript-eslint/ban-ts-comment": "off",
30
+ "@typescript-eslint/no-unsafe-call": "off",
31
+ "@typescript-eslint/no-non-null-assertion": "off",
32
+ "@typescript-eslint/no-empty-function": "off",
33
+ "lines-between-class-members": "off",
34
+ }
35
+ }],
8
36
  "parserOptions": {
9
37
  "ecmaVersion": 2018,
10
38
  "sourceType": "module"
@@ -1,30 +1,60 @@
1
1
  const path = require("path");
2
2
  const fs = require("fs");
3
-
3
+ const resolve = require("resolve");
4
4
  const LIB = path.join(__dirname, `../lib/`);
5
- const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
5
+ const preprocessJSDocScript = resolve.sync("@ui5/webcomponents-tools/lib/jsdoc/preprocess.js");
6
6
 
7
7
  const getScripts = (options) => {
8
8
 
9
- const port = options.port || 8080; // preferred port
10
- const portStep = options.portStep || 1; // step to check for available ports, if preferred port is already used
11
- let illustrations = options.illustrationsData || [];
9
+ // The script creates all JS modules (dist/illustrations/{illustrationName}.js) out of the existing SVGs
10
+ const illustrationsData = options.illustrationsData || [];
11
+ const illustrations = illustrationsData.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath}`);
12
+ const createIllustrationsJSImportsScript = illustrations.join(" && ");
13
+
14
+ // The script creates the "dist/generated/js-imports/Illustration.js" file that registers loaders (dynamic JS imports) for each illustration
15
+ const illustrationDestinationPaths = illustrationsData.map(illustrations => illustrations.destinationPath);
16
+ const createIllustrationsLoadersScript = options.fioriPackage ? `node ${LIB}/generate-js-imports/illustrations.js ${illustrationDestinationPaths[0]} ${illustrationDestinationPaths[1]} dist/generated/js-imports` : "";
17
+ const tsOption = options.typescript;
18
+ const tsCommand = tsOption ? "tsc" : "";
19
+ const tsWatchCommand = tsOption ? "tsc --watch" : "";
20
+ const tsCrossEnv = tsOption ? "cross-env UI5_TS=true" : "";
12
21
 
13
- illustrations = illustrations.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath}`);
22
+ let viteConfig;
23
+ if (fs.existsSync("config/vite.config.js")) {
24
+ // old project setup where config file is in separate folder
25
+ viteConfig = "-c config/vite.config.js";
26
+ } else if (fs.existsSync("vite.config.js")) {
27
+ // preferred way of custom configuration in root project folder
28
+ viteConfig = "";
29
+ } else {
30
+ // no custom configuration - use default from tools project
31
+ viteConfig = `-c "${require.resolve("@ui5/webcomponents-tools/components-package/vite.config.js")}"`;
32
+ }
14
33
 
15
- let illustrationsScript = illustrations.join(" && ");
34
+ let eslintConfig;
35
+ if (fs.existsSync("config/.eslintrc.js")) {
36
+ // old project setup where config file is in separate folder
37
+ eslintConfig = "--config config/.eslintrc.js";
38
+ } else if (fs.existsSync(".eslintrc.js")) {
39
+ // preferred way of custom configuration in root project folder
40
+ eslintConfig = "";
41
+ } else {
42
+ // no custom configuration - use default from tools project
43
+ eslintConfig = `--config "${require.resolve("@ui5/webcomponents-tools/components-package/eslint.js")}"`;
44
+ }
16
45
 
17
46
  const scripts = {
18
- clean: "rimraf dist && rimraf .port",
19
- lint: "eslint . --config config/.eslintrc.js",
20
- lintfix: "eslint . --config config/.eslintrc.js --fix",
47
+ clean: 'rimraf jsdoc-dist && rimraf src/generated && rimraf dist && rimraf .port && nps "scope.testPages.clean"',
48
+ lint: `eslint . ${eslintConfig}`,
49
+ lintfix: `eslint . ${eslintConfig}`,
21
50
  prepare: {
22
- default: "nps clean prepare.all",
23
- all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps build.samples" "nps build.illustrations"',
24
- styleRelated: "nps build.styles build.jsonImports",
51
+ default: `${tsCrossEnv} nps clean prepare.all typescript generateAPI`,
52
+ all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps build.illustrations"',
53
+ styleRelated: "nps build.styles build.jsonImports build.jsImports",
25
54
  },
55
+ typescript: tsCommand,
26
56
  build: {
27
- default: "nps lint prepare build.bundle",
57
+ default: "nps prepare lint build.bundle",
28
58
  templates: `mkdirp dist/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o dist/generated/templates`,
29
59
  styles: {
30
60
  default: "nps build.styles.themes build.styles.components",
@@ -33,7 +63,7 @@ const getScripts = (options) => {
33
63
  },
34
64
  i18n: {
35
65
  default: "nps build.i18n.defaultsjs build.i18n.json",
36
- defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n dist/generated/i18n`,
66
+ defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n src/generated/i18n`,
37
67
  json: `node "${LIB}/i18n/toJSON.js" src/i18n dist/generated/assets/i18n`,
38
68
  },
39
69
  jsonImports: {
@@ -41,26 +71,25 @@ const getScripts = (options) => {
41
71
  themes: `node "${LIB}/generate-json-imports/themes.js" dist/generated/assets/themes dist/generated/json-imports`,
42
72
  i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n dist/generated/json-imports`,
43
73
  },
44
- bundle: "rollup --config config/rollup.config.js",
45
- samples: {
46
- default: "nps build.samples.api build.samples.docs",
47
- api: `jsdoc -c "${LIB}/jsdoc/config.json"`,
48
- docs: `node "${LIB}/documentation/index.js" dist/api.json`,
74
+ jsImports: {
75
+ default: "mkdirp dist/generated/js-imports && nps build.jsImports.illustrationsLoaders",
76
+ illustrationsLoaders: createIllustrationsLoadersScript,
49
77
  },
50
- illustrations: illustrationsScript
78
+ bundle: `vite build ${viteConfig}`,
79
+ illustrations: createIllustrationsJSImportsScript,
51
80
  },
52
81
  copy: {
53
- default: "nps copy.src copy.props copy.test",
82
+ default: "nps copy.src copy.props",
54
83
  src: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.js" dist/`,
55
84
  props: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.properties" dist/`,
56
- test: `node "${LIB}/copy-and-watch/index.js" --silent "test/**/*.*" dist/test-resources`,
57
85
  },
58
86
  watch: {
59
- default: 'concurrently "nps watch.templates" "nps watch.samples" "nps watch.test" "nps watch.src" "nps watch.bundle" "nps watch.styles" "nps watch.i18n"',
87
+ default: 'concurrently "nps watch.templates" "nps watch.api" "nps watch.src" "nps watch.typescript" "nps watch.styles" "nps watch.i18n" "nps watch.props"',
88
+ devServer: 'concurrently "nps watch.default" "nps watch.bundle"',
60
89
  src: 'nps "copy.src --watch --safe --skip-initial-copy"',
90
+ typescript: tsWatchCommand,
61
91
  props: 'nps "copy.props --watch --safe --skip-initial-copy"',
62
- test: 'nps "copy.test --watch --safe --skip-initial-copy"',
63
- bundle: 'rollup --config config/rollup.config.js -w --environment DEV',
92
+ bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
64
93
  styles: {
65
94
  default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components"',
66
95
  themes: 'nps "build.styles.themes -w"',
@@ -71,32 +100,35 @@ const getScripts = (options) => {
71
100
  },
72
101
  },
73
102
  templates: 'chokidar "src/**/*.hbs" -c "nps build.templates"',
74
- samples: 'chokidar "test/**/*.sample.html" -c "nps build.samples"',
103
+ api: 'chokidar "test/**/*.sample.html" -c "nps generateAPI"',
75
104
  i18n: 'chokidar "src/i18n/messagebundle.properties" -c "nps build.i18n.defaultsjs"'
76
105
  },
77
- dev: 'concurrently "nps serve" "nps watch"',
78
- start: "nps prepare dev",
79
- serve: `node "${LIB}/serve/index.js" --dir="dist/" --port=${port} --portStep=${portStep} --packageName="${packageName}"`,
80
- test: {
81
- // --success first - report the exit code of the test run (first command to finish), as serve is always terminated and has a non-0 exit code
82
- default: 'concurrently "nps serve" "nps test.run" --kill-others --success first',
83
- run: "cross-env WDIO_LOG_LEVEL=error wdio config/wdio.conf.js",
84
- spec: "wdio run config/wdio.conf.js",
85
- },
86
- startWithScope: "nps scope.prepare scope.dev",
106
+ start: "nps prepare watch.devServer",
107
+ test: `node "${LIB}/test-runner/test-runner.js"`,
108
+ "test-suite-1": `node "${LIB}/test-runner/test-runner.js" --suite suite1`,
109
+ "test-suite-2": `node "${LIB}/test-runner/test-runner.js" --suite suite2`,
110
+ startWithScope: "nps scope.prepare scope.watchWithBundle",
87
111
  scope: {
88
112
  prepare: "nps scope.lint prepare scope.testPages",
89
113
  lint: `node "${LIB}/scoping/lint-src.js"`,
90
114
  testPages: {
91
115
  default: "nps scope.testPages.clean scope.testPages.copy scope.testPages.replace",
92
- clean: "rimraf dist/test-resources/pages/scoped",
93
- copy: `node "${LIB}/copy-and-watch/index.js" --silent "dist/test-resources/pages/**/*" dist/test-resources/scoped`,
94
- replace: `node "${LIB}/scoping/scope-test-pages.js" dist/test-resources/scoped demo`,
116
+ clean: "rimraf test/pages/scoped",
117
+ copy: `node "${LIB}/copy-and-watch/index.js" --silent "test/pages/**/*" test/pages/scoped`,
118
+ replace: `node "${LIB}/scoping/scope-test-pages.js" test/pages/scoped demo`,
95
119
  },
96
- dev: 'concurrently "nps serve" "nps scope.watch"',
97
- watch: 'concurrently "nps watch.templates" "nps watch.samples" "nps watch.test" "nps watch.src" "nps watch.props" "nps scope.bundle" "nps watch.styles"',
98
- bundle: 'rollup --config config/rollup.config.js -w --environment DEV,SCOPE'
99
- }
120
+ watchWithBundle: 'concurrently "nps scope.watch" "nps scope.bundle" ',
121
+ watch: 'concurrently "nps watch.templates" "nps watch.api" "nps watch.src" "nps watch.props" "nps watch.styles"',
122
+ bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
123
+ },
124
+ generateAPI: {
125
+ default: "nps generateAPI.prepare generateAPI.preprocess generateAPI.jsdoc generateAPI.cleanup generateAPI.prepareManifest",
126
+ prepare: `node "${LIB}/copy-and-watch/index.js" --silent "dist/**/*.js" jsdoc-dist/`,
127
+ prepareManifest: `node "${LIB}/generate-custom-elements-manifest/index.js" dist dist`,
128
+ preprocess: `node "${preprocessJSDocScript}" jsdoc-dist/ src`,
129
+ jsdoc: `jsdoc -c "${LIB}/jsdoc/configTypescript.json"`,
130
+ cleanup: "rimraf jsdoc-dist/"
131
+ },
100
132
  };
101
133
 
102
134
  return scripts;
@@ -6,16 +6,16 @@ const fs = require("fs");
6
6
  const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
7
7
 
8
8
  module.exports = {
9
- plugins: [
10
- postcssImport(),
11
- cssnano({
12
- preset: [
13
- 'default', {
14
- mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675
15
- mergeRules: false, // https://github.com/cssnano/cssnano/issues/730
16
- },
17
- ]
18
- }),
19
- postcssCSStoESM({toReplace: 'src', includeDefaultTheme: true, packageName}),
20
- ]
21
- };
9
+ plugins: [
10
+ postcssImport(),
11
+ cssnano({
12
+ preset: [
13
+ 'default', {
14
+ mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675
15
+ mergeRules: false, // https://github.com/cssnano/cssnano/issues/730
16
+ },
17
+ ]
18
+ }),
19
+ postcssCSStoESM({ toReplace: 'src', includeDefaultTheme: true, packageName }),
20
+ ]
21
+ }
@@ -8,19 +8,19 @@ const fs = require("fs");
8
8
  const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
9
9
 
10
10
  module.exports = {
11
- plugins: [
12
- postcssImport(),
13
- combineSelectors({
14
- removeDuplicatedProperties: true
15
- }),
16
- cssnano({
17
- preset: [
18
- 'default', {
19
- mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675
20
- },
21
- ]
22
- },),
23
- postcssCSStoJSON({toReplace: 'src', packageName}),
24
- postcssCSStoESM({toReplace: 'src', packageName}),
25
- ]
11
+ plugins: [
12
+ postcssImport(),
13
+ combineSelectors({
14
+ removeDuplicatedProperties: true
15
+ }),
16
+ cssnano({
17
+ preset: [
18
+ 'default', {
19
+ mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675
20
+ },
21
+ ]
22
+ },),
23
+ postcssCSStoJSON({ toReplace: 'src', packageName }),
24
+ postcssCSStoESM({ toReplace: 'src', packageName }),
25
+ ]
26
26
  };
@@ -0,0 +1,12 @@
1
+ // vite.config.js
2
+ const { defineConfig } = require('vite');
3
+ const virtualIndex = require("../lib/dev-server/virtual-index-html-plugin.js");
4
+
5
+ module.exports = defineConfig(async () => {
6
+ return {
7
+ build: {
8
+ emptyOutDir: false,
9
+ },
10
+ plugins: [await virtualIndex()],
11
+ }
12
+ });
@@ -50,7 +50,7 @@ exports.config = {
50
50
  // maxInstances can get overwritten per capability. So if you have an in-house Selenium
51
51
  // grid with only 5 firefox instances available you can make sure that not more than
52
52
  // 5 instances get started at a time.
53
- maxInstances: process.env.TRAVIS ? 1 : 5,
53
+ maxInstances: 5,
54
54
  //
55
55
  browserName: 'chrome',
56
56
  'goog:chromeOptions': {
@@ -82,7 +82,7 @@ exports.config = {
82
82
  // with `/`, the base url gets prepended, not including the path portion of your baseUrl.
83
83
  // If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
84
84
  // gets prepended directly.
85
- baseUrl: undefined, // This is important since WDIO 7+ does not accept an empty string for baseUrl
85
+ baseUrl: 'http://localhost:4567', // This is important since WDIO 7+ does not accept an empty string for baseUrl
86
86
  path: '',
87
87
  //
88
88
  // Default timeout for all waitFor* commands.
@@ -99,7 +99,14 @@ exports.config = {
99
99
  // Services take over a specific job you don't want to take care of. They enhance
100
100
  // your test setup with almost no effort. Unlike plugins, they don't add new
101
101
  // commands. Instead, they hook themselves up into the test process.
102
- services: ['chromedriver'],
102
+ services: ['chromedriver', 'devtools',
103
+ ['static-server', {
104
+ folders: [
105
+ { mount: '/', path: './dist' },
106
+ ],
107
+ port: '4567',
108
+ }],
109
+ ],
103
110
  // options
104
111
  chromeDriverArgs: ['--port=9515'], // default
105
112
  // Framework you want to run your specs with.
@@ -210,6 +217,12 @@ exports.config = {
210
217
  }, this, className);
211
218
  }, true);
212
219
 
220
+ await browser.addCommand("hasAttribute", async function(attrName) {
221
+ return browser.executeAsync((elem, attrName, done) => {
222
+ done(elem.hasAttribute(attrName));
223
+ }, this, attrName);
224
+ }, true);
225
+
213
226
  await browser.addCommand("getStaticAreaItemClassName", async function(selector) {
214
227
  return browser.executeAsync(async (selector, done) => {
215
228
  const staticAreaItem = await document.querySelector(selector).getStaticAreaItemDomRef();
@@ -231,6 +244,7 @@ exports.config = {
231
244
  "$",
232
245
  "$$",
233
246
  "getAttribute",
247
+ "hasAttribute", // custom
234
248
  "getCSSProperty",
235
249
  "getHTML",
236
250
  "getProperty",
@@ -316,7 +330,6 @@ exports.config = {
316
330
  "click",
317
331
  "doubleClick",
318
332
  "dragAndDrop",
319
- "keys",
320
333
  "pause",
321
334
  "removeAttribute", // custom
322
335
  "scrollIntoView",
@@ -327,10 +340,21 @@ exports.config = {
327
340
  "touchAction",
328
341
  "url",
329
342
  ];
343
+
344
+ const waitForWithDelay = [
345
+ "keys",
346
+ ];
347
+
330
348
  if (waitFor.includes(commandName)) {
331
349
  await browser.executeAsync(function (done) {
332
350
  window["sap-ui-webcomponents-bundle"].renderFinished().then(done);
333
351
  });
352
+ } else if (waitForWithDelay.includes(commandName)) {
353
+ await browser.executeAsync(function (done) {
354
+ setTimeout(() => {
355
+ window["sap-ui-webcomponents-bundle"].renderFinished().then(done);
356
+ }, 10);
357
+ });
334
358
  }
335
359
  },
336
360
  /**
@@ -50,7 +50,7 @@ exports.config = {
50
50
  // maxInstances can get overwritten per capability. So if you have an in-house Selenium
51
51
  // grid with only 5 firefox instances available you can make sure that not more than
52
52
  // 5 instances get started at a time.
53
- maxInstances: process.env.TRAVIS ? 1 : 5,
53
+ maxInstances: 5,
54
54
  //
55
55
  browserName: 'chrome',
56
56
  'goog:chromeOptions': {
@@ -41,15 +41,17 @@ const copyIconAssetsCommand = (options) => {
41
41
  const getScripts = (options) => {
42
42
  const createJSImportsCmd = createIconImportsCommand(options);
43
43
  const copyAssetsCmd = copyIconAssetsCommand(options);
44
+ const tsCommand = options.typescript ? "tsc" : "";
45
+ const tsCrossEnv = options.typescript ? "cross-env UI5_TS=true" : "";
44
46
 
45
47
  const scripts = {
46
- clean: "rimraf dist",
48
+ clean: "rimraf dist && rimraf src/generated",
47
49
  copy: copyAssetsCmd,
48
50
  build: {
49
- default: `nps clean copy build.i18n build.icons build.jsonImports`,
51
+ default: `${tsCrossEnv} nps clean copy build.i18n typescript build.icons build.jsonImports`,
50
52
  i18n: {
51
53
  default: "nps build.i18n.defaultsjs build.i18n.json",
52
- defaultsjs: `mkdirp dist/generated/i18n && node "${LIB}/i18n/defaults.js" src/i18n dist/generated/i18n`,
54
+ defaultsjs: `mkdirp dist/generated/i18n && node "${LIB}/i18n/defaults.js" src/i18n src/generated/i18n`,
53
55
  json: `mkdirp dist/generated/assets/i18n && node "${LIB}/i18n/toJSON.js" src/i18n dist/generated/assets/i18n`,
54
56
  },
55
57
  jsonImports: {
@@ -58,6 +60,7 @@ const getScripts = (options) => {
58
60
  },
59
61
  icons: createJSImportsCmd,
60
62
  },
63
+ typescript: tsCommand,
61
64
  };
62
65
 
63
66
  return scripts;
@@ -27,7 +27,6 @@ const path = require('path');
27
27
  const chokidar = require('chokidar');
28
28
  const glob = require('glob');
29
29
  const globParent = require('glob-parent');
30
- require('colors');
31
30
 
32
31
  /* CODE */
33
32
 
@@ -3,7 +3,7 @@ const path = require("path");
3
3
 
4
4
  const fileList = process.argv[2];
5
5
  const dest = process.argv[3];
6
- const src = "../../node_modules/@openui5/sap.ui.core/src/";
6
+ const src = "@openui5/sap.ui.core/src/";
7
7
 
8
8
  const generate = async () => {
9
9
  const filesToCopy = (await fs.readFile(fileList)).toString();
@@ -15,7 +15,7 @@ const generate = async () => {
15
15
  const trimFile = file => file.trim();
16
16
 
17
17
  return filesToCopy.split("\n").map(trimFile).filter(shouldCopy).map(async moduleName => {
18
- const srcPath = path.join(src, moduleName);
18
+ const srcPath = require.resolve(path.join(src, moduleName), {paths: [process.cwd()]});
19
19
  const destPath = path.join(dest, moduleName);
20
20
 
21
21
  await fs.mkdir(path.dirname(destPath), { recursive: true });