@ui5/webcomponents-tools 0.0.0-b132dd7b9 → 0.0.0-b3a4f8020
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 +501 -0
- package/LICENSE.txt +201 -0
- package/README.md +7 -7
- package/bin/dev.js +10 -4
- package/bin/ui5nps.js +301 -0
- package/components-package/nps.js +97 -94
- package/components-package/wdio.js +8 -2
- package/icons-collection/nps.js +30 -21
- package/lib/amd-to-es6/index.js +17 -10
- package/lib/cem/cem.js +16 -0
- package/lib/cem/custom-elements-manifest.config.mjs +56 -4
- package/lib/cem/merge.mjs +220 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/cli.js +128 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/package.json +59 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/browser-entrypoint.js +23 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/create.js +117 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/arrow-function.js +26 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/class-jsdoc.js +157 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/classes.js +20 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/createArrowFunction.js +17 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/createAttribute.js +24 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/createClass.js +301 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/createClassField.js +26 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/createFunctionLike.js +73 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/createMixin.js +33 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/createVariable.js +22 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/handlers.js +338 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/custom-elements-define-calls.js +90 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/exports.js +156 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/function-like.js +24 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/mixins.js +29 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/reexported-wrapped-mixin-exports.js +84 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/variables.js +34 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/collect-phase/collect-imports.js +101 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/catalyst/catalyst.js +11 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/catalyst/controller.js +34 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/catalyst-major-2/catalyst.js +11 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/catalyst-major-2/controller.js +34 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/decorators/attr.js +53 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/decorators/custom-element-decorator.js +36 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/fast/fast.js +7 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/lit/lit.js +13 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/lit/member-denylist.js +21 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/lit/method-denylist.js +20 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/lit/property-decorator.js +94 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/lit/static-properties.js +121 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/lit/utils.js +66 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/stencil/stencil.js +129 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/index.js +80 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/link-phase/cleanup-classes.js +25 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/link-phase/field-denylist.js +22 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/link-phase/method-denylist.js +25 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/post-processing/apply-inheritance.js +78 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/post-processing/is-custom-element.js +34 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/post-processing/link-class-to-tagname.js +27 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/post-processing/remove-unexported-declarations.js +23 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/post-processing/resolve-initializers.js +52 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/ast-helpers.js +186 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/cli-helpers.js +164 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/exports.js +44 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/find-external-manifests.js +67 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/imports.js +25 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/index.js +71 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/jsdoc.js +19 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/manifest-helpers.js +194 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/mixins.js +112 -0
- package/lib/cem/schema-internal.json +41 -1
- package/lib/cem/schema.json +41 -1
- package/lib/cem/types-internal.d.ts +32 -2
- package/lib/cem/types.d.ts +32 -2
- package/lib/cem/utils.mjs +13 -3
- package/lib/cem/validate.js +61 -47
- package/lib/chokidar/chokidar.js +28 -0
- package/lib/copy-and-watch/index.js +110 -97
- package/lib/copy-list/index.js +18 -10
- package/lib/create-icons/index.js +19 -15
- package/lib/create-illustrations/index.js +57 -29
- package/lib/create-new-component/index.js +5 -3
- package/lib/css-processors/css-processor-components.mjs +85 -60
- package/lib/css-processors/css-processor-themes.mjs +105 -57
- package/lib/css-processors/postcss-plugin.mjs +153 -0
- package/lib/css-processors/scope-variables.mjs +26 -1
- package/lib/css-processors/shared.mjs +8 -17
- package/lib/dev-server/dev-server.mjs +23 -11
- package/lib/eslint/eslint.js +44 -0
- package/lib/generate-js-imports/illustrations.js +55 -54
- package/lib/generate-json-imports/i18n.js +22 -11
- package/lib/generate-json-imports/themes.js +24 -12
- package/lib/i18n/defaults.js +14 -7
- package/lib/i18n/toJSON.js +40 -12
- package/lib/icons-hash/icons-hash.mjs +149 -0
- package/lib/remove-dev-mode/remove-dev-mode.mjs +38 -24
- package/lib/rimraf/rimraf.js +31 -0
- package/lib/test-runner/test-runner.js +56 -48
- package/lib/vite-bundler/vite-bundler.mjs +35 -0
- package/package.json +15 -14
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
const rimraf = dir => {
|
|
5
|
+
if (fs.existsSync(dir)) {
|
|
6
|
+
fs.readdirSync(dir).forEach(entry => {
|
|
7
|
+
const entryPath = path.join(dir, entry);
|
|
8
|
+
if (fs.lstatSync(entryPath).isDirectory()) {
|
|
9
|
+
rimraf(entryPath);
|
|
10
|
+
} else {
|
|
11
|
+
fs.unlinkSync(entryPath);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
fs.rmdirSync(dir);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const main = argv => {
|
|
19
|
+
if (argv.length < 3) {
|
|
20
|
+
console.error("rimraf <dir>");
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
const dir = argv[2];
|
|
24
|
+
rimraf(dir);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
if (require.main === module) {
|
|
28
|
+
main(process.argv)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
exports._ui5mainFn = main;
|
|
@@ -3,69 +3,77 @@ const { readFileSync } = require("fs");
|
|
|
3
3
|
const path = require("path");
|
|
4
4
|
const fs = require("fs");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
function testFn(outArgv) {
|
|
7
|
+
// search for dev-server port
|
|
7
8
|
// start in current folder
|
|
8
9
|
// traversing upwards in case of mono repo tests and dev-server running in root folder of repository
|
|
9
|
-
let devServerFolder = process.cwd();
|
|
10
|
-
let devServerPort;
|
|
11
|
-
while (true) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
10
|
+
let devServerFolder = process.cwd();
|
|
11
|
+
let devServerPort;
|
|
12
|
+
while (true) {
|
|
13
|
+
try {
|
|
14
|
+
devServerPort = readFileSync(path.join(devServerFolder, ".dev-server-port")).toString();
|
|
15
|
+
break; // found
|
|
16
|
+
} catch (e) {
|
|
17
|
+
// file not found
|
|
18
|
+
if (devServerFolder === path.dirname(devServerFolder)) {
|
|
19
|
+
break; // reached root folder "/"
|
|
20
|
+
}
|
|
21
|
+
devServerFolder = path.dirname(devServerFolder);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
23
24
|
|
|
24
25
|
// check if we are in a monorepo and extract path from package.json
|
|
25
|
-
let packageRepositoryPath = "";
|
|
26
|
-
const pkg = require(path.join(process.cwd(), "package.json"));
|
|
27
|
-
packageRepositoryPath = pkg.repository ? pkg.repository.directory : "";
|
|
26
|
+
let packageRepositoryPath = "";
|
|
27
|
+
const pkg = require(path.join(process.cwd(), "package.json"));
|
|
28
|
+
packageRepositoryPath = pkg.repository ? pkg.repository.directory : "";
|
|
28
29
|
|
|
29
30
|
// construct base url
|
|
30
31
|
// use devServerPort if a dev server is running, otherwise let the baseUrl in the wdio config be used
|
|
31
32
|
// if a dev server is running in the root of a mono repo, append tha package path like this
|
|
32
33
|
// http://localhost:${devServerPort}/packages/main/
|
|
33
|
-
let baseUrl = "";
|
|
34
|
-
if (devServerPort) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
34
|
+
let baseUrl = "";
|
|
35
|
+
if (devServerPort) {
|
|
36
|
+
console.log(`Found port ${devServerPort} from '${path.join(devServerFolder, ".dev-server-port")}'`);
|
|
37
|
+
const devServerInRoot = !devServerFolder.includes(packageRepositoryPath);
|
|
38
|
+
if (devServerInRoot) {
|
|
39
|
+
baseUrl = `--base-url http://localhost:${devServerPort}/${packageRepositoryPath}/`;
|
|
40
|
+
} else {
|
|
41
|
+
baseUrl = `--base-url http://localhost:${devServerPort}/`;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
43
44
|
|
|
44
|
-
if (!baseUrl) {
|
|
45
|
-
|
|
46
|
-
}
|
|
45
|
+
if (!baseUrl) {
|
|
46
|
+
console.log("No dev server running, running tests served from `dist`, make sure it is up to date");
|
|
47
|
+
}
|
|
47
48
|
|
|
48
49
|
// add single spec parameter if passed
|
|
49
|
-
let spec = "";
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
50
|
+
let spec = "";
|
|
51
|
+
if (outArgv.length === 3) {
|
|
52
|
+
const specFile = outArgv[2];
|
|
53
|
+
spec = `--spec ${specFile}`;
|
|
54
|
+
}
|
|
54
55
|
|
|
55
56
|
// more parameters - pass them to wdio
|
|
56
|
-
let restParams = "";
|
|
57
|
-
if (
|
|
58
|
-
|
|
57
|
+
let restParams = "";
|
|
58
|
+
if (outArgv.length > 3) {
|
|
59
|
+
restParams = outArgv.slice(2).join(" ");
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
let wdioConfig = "";
|
|
63
|
+
if (fs.existsSync("config/wdio.conf.cjs")) {
|
|
64
|
+
wdioConfig = "config/wdio.conf.cjs";
|
|
65
|
+
} else if (fs.existsSync("config/wdio.conf.js")) {
|
|
66
|
+
wdioConfig = "config/wdio.conf.js";
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// run wdio with calculated parameters
|
|
70
|
+
const cmd = `npx cross-env WDIO_LOG_LEVEL=error wdio ${wdioConfig} ${spec} ${baseUrl} ${restParams}`;
|
|
71
|
+
console.log(`executing: ${cmd}`);
|
|
72
|
+
child_process.execSync(cmd, {stdio: 'inherit'});
|
|
59
73
|
}
|
|
60
74
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
wdioConfig = "config/wdio.conf.cjs";
|
|
64
|
-
} else if (fs.existsSync("config/wdio.conf.js")) {
|
|
65
|
-
wdioConfig = "config/wdio.conf.js";
|
|
75
|
+
if (require.main === module) {
|
|
76
|
+
testFn(process.argv)
|
|
66
77
|
}
|
|
67
78
|
|
|
68
|
-
|
|
69
|
-
const cmd = `yarn cross-env WDIO_LOG_LEVEL=error wdio ${wdioConfig} ${spec} ${baseUrl} ${restParams}`;
|
|
70
|
-
console.log(`executing: ${cmd}`);
|
|
71
|
-
child_process.execSync(cmd, {stdio: 'inherit'});
|
|
79
|
+
exports._ui5mainFn = testFn;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { build } from 'vite';
|
|
2
|
+
import yargs from 'yargs';
|
|
3
|
+
import { hideBin } from 'yargs/helpers';
|
|
4
|
+
import { pathToFileURL } from "url";
|
|
5
|
+
|
|
6
|
+
async function start(outArgv) {
|
|
7
|
+
const argv = yargs(hideBin(outArgv))
|
|
8
|
+
.alias("c", "config")
|
|
9
|
+
.alias("mode", "mode")
|
|
10
|
+
.alias("base", "base")
|
|
11
|
+
.argv;
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
await build({
|
|
15
|
+
configFile: argv.config || undefined,
|
|
16
|
+
mode: argv.mode || undefined,
|
|
17
|
+
base: argv.base || undefined,
|
|
18
|
+
logLevel: 'info',
|
|
19
|
+
});
|
|
20
|
+
} catch (e) {
|
|
21
|
+
console.error(e)
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const filePath = process.argv[1];
|
|
27
|
+
const fileUrl = pathToFileURL(filePath).href;
|
|
28
|
+
|
|
29
|
+
if (import.meta.url === fileUrl) {
|
|
30
|
+
start(process.argv)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
_ui5mainFn: start
|
|
35
|
+
}
|
package/package.json
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-tools",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-b3a4f8020",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.tools",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
-
"private": false,
|
|
8
7
|
"keywords": [
|
|
9
8
|
"openui5",
|
|
10
9
|
"sapui5",
|
|
11
10
|
"ui5"
|
|
12
11
|
],
|
|
13
|
-
"scripts": {},
|
|
14
12
|
"bin": {
|
|
15
|
-
"
|
|
16
|
-
"wc-create-ui5-element": "bin/create-ui5-element.js"
|
|
13
|
+
"ui5nps": "bin/ui5nps.js",
|
|
14
|
+
"wc-create-ui5-element": "bin/create-ui5-element.js",
|
|
15
|
+
"wc-dev": "bin/dev.js"
|
|
17
16
|
},
|
|
18
17
|
"repository": {
|
|
19
18
|
"type": "git",
|
|
20
|
-
"url": "https://github.com/
|
|
19
|
+
"url": "https://github.com/UI5/webcomponents.git",
|
|
21
20
|
"directory": "packages/tools"
|
|
22
21
|
},
|
|
23
22
|
"dependencies": {
|
|
24
|
-
"@custom-elements-manifest/analyzer": "^0.10.
|
|
23
|
+
"@custom-elements-manifest/analyzer": "^0.10.10",
|
|
25
24
|
"@typescript-eslint/eslint-plugin": "^6.9.0",
|
|
26
25
|
"@typescript-eslint/parser": "^6.9.0",
|
|
27
26
|
"@wdio/cli": "^7.19.7",
|
|
@@ -35,12 +34,11 @@
|
|
|
35
34
|
"chai": "^4.3.4",
|
|
36
35
|
"child_process": "^1.0.2",
|
|
37
36
|
"chokidar": "^3.6.0",
|
|
38
|
-
"chokidar-cli": "^3.0.0",
|
|
39
37
|
"command-line-args": "^5.1.1",
|
|
40
38
|
"comment-parser": "^1.4.0",
|
|
41
|
-
"concurrently": "^6.0.0",
|
|
42
39
|
"cross-env": "^7.0.3",
|
|
43
40
|
"custom-element-jet-brains-integration": "^1.4.4",
|
|
41
|
+
"dotenv": "^16.5.0",
|
|
44
42
|
"escodegen": "^2.0.0",
|
|
45
43
|
"eslint": "^7.22.0",
|
|
46
44
|
"eslint-config-airbnb-base": "^14.2.1",
|
|
@@ -52,10 +50,9 @@
|
|
|
52
50
|
"glob-parent": "^6.0.2",
|
|
53
51
|
"globby": "^13.1.1",
|
|
54
52
|
"handlebars": "^4.7.7",
|
|
53
|
+
"ignore": "^7.0.5",
|
|
55
54
|
"is-port-reachable": "^3.1.0",
|
|
56
55
|
"json-beautify": "^1.1.1",
|
|
57
|
-
"mkdirp": "^1.0.4",
|
|
58
|
-
"nps": "^5.10.0",
|
|
59
56
|
"postcss": "^8.4.5",
|
|
60
57
|
"postcss-cli": "^9.1.0",
|
|
61
58
|
"postcss-selector-parser": "^6.0.10",
|
|
@@ -63,8 +60,8 @@
|
|
|
63
60
|
"properties-reader": "^2.2.0",
|
|
64
61
|
"recursive-readdir": "^2.2.2",
|
|
65
62
|
"resolve": "^1.20.0",
|
|
66
|
-
"rimraf": "^3.0.2",
|
|
67
63
|
"slash": "3.0.0",
|
|
64
|
+
"string-argv": "^0.3.2",
|
|
68
65
|
"vite": "^5.4.8",
|
|
69
66
|
"vite-plugin-istanbul": "^6.0.2",
|
|
70
67
|
"wdio-chromedriver-service": "^7.3.2"
|
|
@@ -78,8 +75,12 @@
|
|
|
78
75
|
"optional": true
|
|
79
76
|
}
|
|
80
77
|
},
|
|
78
|
+
"engines": {
|
|
79
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
80
|
+
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"esbuild": "^0.25.0",
|
|
83
83
|
"yargs": "^17.5.1"
|
|
84
|
-
}
|
|
85
|
-
|
|
84
|
+
},
|
|
85
|
+
"gitHead": "0a174f7ce9239f60c2840e8920fd70e3cf935a61"
|
|
86
|
+
}
|