@ui5/webcomponents-tools 0.0.0-037d08c67
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 +2474 -0
- package/LICENSE.txt +201 -0
- package/README.md +21 -0
- package/assets-meta.js +154 -0
- package/bin/create-ui5-element.js +3 -0
- package/bin/dev.js +22 -0
- package/bin/ui5nps.js +301 -0
- package/components-package/eslint.js +195 -0
- package/components-package/nps.js +177 -0
- package/components-package/postcss.components.js +1 -0
- package/components-package/postcss.themes.js +1 -0
- package/components-package/vite.config.js +9 -0
- package/components-package/wdio.js +421 -0
- package/icons-collection/nps.js +80 -0
- package/lib/amd-to-es6/index.js +109 -0
- package/lib/amd-to-es6/no-remaining-require.js +33 -0
- package/lib/cem/cem.js +16 -0
- package/lib/cem/custom-elements-manifest.config.mjs +575 -0
- package/lib/cem/event.mjs +168 -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 +1422 -0
- package/lib/cem/schema.json +1098 -0
- package/lib/cem/types-internal.d.ts +808 -0
- package/lib/cem/types.d.ts +736 -0
- package/lib/cem/utils.mjs +429 -0
- package/lib/cem/validate.js +81 -0
- package/lib/chokidar/chokidar.js +28 -0
- package/lib/copy-and-watch/index.js +158 -0
- package/lib/copy-list/index.js +36 -0
- package/lib/create-icons/index.js +131 -0
- package/lib/create-illustrations/index.js +210 -0
- package/lib/create-new-component/Component.js +74 -0
- package/lib/create-new-component/ComponentTemplate.js +12 -0
- package/lib/create-new-component/index.js +115 -0
- package/lib/css-processors/css-processor-components.mjs +101 -0
- package/lib/css-processors/css-processor-themes.mjs +121 -0
- package/lib/css-processors/postcss-plugin.mjs +153 -0
- package/lib/css-processors/scope-variables.mjs +51 -0
- package/lib/css-processors/shared.mjs +47 -0
- package/lib/dev-server/custom-hot-update-plugin.js +39 -0
- package/lib/dev-server/dev-server.mjs +78 -0
- package/lib/dev-server/virtual-index-html-plugin.js +56 -0
- package/lib/eslint/eslint.js +44 -0
- package/lib/generate-js-imports/illustrations.js +87 -0
- package/lib/generate-json-imports/i18n.js +93 -0
- package/lib/generate-json-imports/themes.js +75 -0
- package/lib/hbs2lit/index.js +3 -0
- package/lib/hbs2lit/src/compiler.js +60 -0
- package/lib/hbs2lit/src/extendedAttributeMapping.js +12 -0
- package/lib/hbs2lit/src/includesReplacer.js +31 -0
- package/lib/hbs2lit/src/litVisitor2.js +278 -0
- package/lib/hbs2lit/src/partials2.js +51 -0
- package/lib/hbs2lit/src/partialsVisitor.js +187 -0
- package/lib/hbs2lit/src/svgProcessor.js +76 -0
- package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +45 -0
- package/lib/hbs2ui5/index.js +119 -0
- package/lib/i18n/defaults.js +90 -0
- package/lib/i18n/toJSON.js +71 -0
- package/lib/icons-hash/icons-hash.mjs +149 -0
- package/lib/postcss-combine-duplicated-selectors/index.js +185 -0
- package/lib/remove-dev-mode/remove-dev-mode.mjs +51 -0
- package/lib/rimraf/rimraf.js +31 -0
- package/lib/scoping/get-all-tags.js +44 -0
- package/lib/scoping/lint-src.js +32 -0
- package/lib/scoping/missing-dependencies.js +65 -0
- package/lib/scoping/report-tags-usage.js +28 -0
- package/lib/scoping/scope-test-pages.js +41 -0
- package/lib/test-runner/test-runner.js +79 -0
- package/lib/vite-bundler/vite-bundler.mjs +35 -0
- package/package.json +86 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const child_process = require("child_process");
|
|
2
|
+
const { readFileSync } = require("fs");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
|
|
6
|
+
function testFn(outArgv) {
|
|
7
|
+
// search for dev-server port
|
|
8
|
+
// start in current folder
|
|
9
|
+
// traversing upwards in case of mono repo tests and dev-server running in root folder of repository
|
|
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
|
+
}
|
|
24
|
+
|
|
25
|
+
// check if we are in a monorepo and extract path from package.json
|
|
26
|
+
let packageRepositoryPath = "";
|
|
27
|
+
const pkg = require(path.join(process.cwd(), "package.json"));
|
|
28
|
+
packageRepositoryPath = pkg.repository ? pkg.repository.directory : "";
|
|
29
|
+
|
|
30
|
+
// construct base url
|
|
31
|
+
// use devServerPort if a dev server is running, otherwise let the baseUrl in the wdio config be used
|
|
32
|
+
// if a dev server is running in the root of a mono repo, append tha package path like this
|
|
33
|
+
// http://localhost:${devServerPort}/packages/main/
|
|
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
|
+
}
|
|
44
|
+
|
|
45
|
+
if (!baseUrl) {
|
|
46
|
+
console.log("No dev server running, running tests served from `dist`, make sure it is up to date");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// add single spec parameter if passed
|
|
50
|
+
let spec = "";
|
|
51
|
+
if (outArgv.length === 3) {
|
|
52
|
+
const specFile = outArgv[2];
|
|
53
|
+
spec = `--spec ${specFile}`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// more parameters - pass them to wdio
|
|
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'});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (require.main === module) {
|
|
76
|
+
testFn(process.argv)
|
|
77
|
+
}
|
|
78
|
+
|
|
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
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ui5/webcomponents-tools",
|
|
3
|
+
"version": "0.0.0-037d08c67",
|
|
4
|
+
"description": "UI5 Web Components: webcomponents.tools",
|
|
5
|
+
"author": "SAP SE (https://www.sap.com)",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"openui5",
|
|
9
|
+
"sapui5",
|
|
10
|
+
"ui5"
|
|
11
|
+
],
|
|
12
|
+
"bin": {
|
|
13
|
+
"ui5nps": "bin/ui5nps.js",
|
|
14
|
+
"wc-create-ui5-element": "bin/create-ui5-element.js",
|
|
15
|
+
"wc-dev": "bin/dev.js"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/UI5/webcomponents.git",
|
|
20
|
+
"directory": "packages/tools"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@custom-elements-manifest/analyzer": "^0.10.10",
|
|
24
|
+
"@typescript-eslint/eslint-plugin": "^6.9.0",
|
|
25
|
+
"@typescript-eslint/parser": "^6.9.0",
|
|
26
|
+
"@wdio/cli": "^7.19.7",
|
|
27
|
+
"@wdio/dot-reporter": "^7.19.7",
|
|
28
|
+
"@wdio/local-runner": "^7.19.7",
|
|
29
|
+
"@wdio/mocha-framework": "^7.19.7",
|
|
30
|
+
"@wdio/spec-reporter": "^7.19.7",
|
|
31
|
+
"@wdio/static-server-service": "^7.19.5",
|
|
32
|
+
"ajv": "^8.12.0",
|
|
33
|
+
"cem-plugin-vs-code-custom-data-generator": "^1.4.2",
|
|
34
|
+
"chai": "^4.3.4",
|
|
35
|
+
"child_process": "^1.0.2",
|
|
36
|
+
"chokidar": "^3.6.0",
|
|
37
|
+
"command-line-args": "^5.1.1",
|
|
38
|
+
"comment-parser": "^1.4.0",
|
|
39
|
+
"cross-env": "^7.0.3",
|
|
40
|
+
"custom-element-jet-brains-integration": "^1.4.4",
|
|
41
|
+
"dotenv": "^16.5.0",
|
|
42
|
+
"escodegen": "^2.0.0",
|
|
43
|
+
"eslint": "^7.22.0",
|
|
44
|
+
"eslint-config-airbnb-base": "^14.2.1",
|
|
45
|
+
"eslint-plugin-import": "^2.31.0",
|
|
46
|
+
"eslint-plugin-jsx-no-leaked-values": "^0.1.24",
|
|
47
|
+
"esprima": "^4.0.1",
|
|
48
|
+
"getopts": "^2.3.0",
|
|
49
|
+
"glob": "^7.1.6",
|
|
50
|
+
"glob-parent": "^6.0.2",
|
|
51
|
+
"globby": "^13.1.1",
|
|
52
|
+
"handlebars": "^4.7.7",
|
|
53
|
+
"ignore": "^7.0.5",
|
|
54
|
+
"is-port-reachable": "^3.1.0",
|
|
55
|
+
"json-beautify": "^1.1.1",
|
|
56
|
+
"postcss": "^8.4.5",
|
|
57
|
+
"postcss-cli": "^9.1.0",
|
|
58
|
+
"postcss-selector-parser": "^6.0.10",
|
|
59
|
+
"prompts": "^2.4.2",
|
|
60
|
+
"properties-reader": "^2.2.0",
|
|
61
|
+
"recursive-readdir": "^2.2.2",
|
|
62
|
+
"resolve": "^1.20.0",
|
|
63
|
+
"slash": "3.0.0",
|
|
64
|
+
"string-argv": "^0.3.2",
|
|
65
|
+
"vite": "^5.4.8",
|
|
66
|
+
"vite-plugin-istanbul": "^6.0.2",
|
|
67
|
+
"wdio-chromedriver-service": "^7.3.2"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"chromedriver": "*",
|
|
71
|
+
"typescript": "^5.6.2"
|
|
72
|
+
},
|
|
73
|
+
"peerDependenciesMeta": {
|
|
74
|
+
"typescript": {
|
|
75
|
+
"optional": true
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"engines": {
|
|
79
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
80
|
+
},
|
|
81
|
+
"devDependencies": {
|
|
82
|
+
"esbuild": "^0.25.0",
|
|
83
|
+
"yargs": "^17.5.1"
|
|
84
|
+
},
|
|
85
|
+
"gitHead": "bf898bce0e415b2e351820e04514e2a0ee23bdea"
|
|
86
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2021",
|
|
4
|
+
"lib": [
|
|
5
|
+
"DOM",
|
|
6
|
+
"DOM.Iterable",
|
|
7
|
+
"ES2023"
|
|
8
|
+
],
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"sourceMap": true,
|
|
12
|
+
"inlineSources": true,
|
|
13
|
+
"strict": true,
|
|
14
|
+
"moduleResolution": "node",
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
|
+
"jsxImportSource": "@ui5/webcomponents-base",
|
|
17
|
+
}
|
|
18
|
+
}
|