@ui5/webcomponents-tools 1.22.0-rc.0 → 1.22.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 +19 -0
- package/components-package/nps.js +5 -5
- package/lib/amd-to-es6/index.js +104 -0
- package/lib/cem/custom-elements-manifest.config.mjs +57 -21
- package/lib/cem/event.mjs +24 -3
- package/lib/cem/types-internal.d.ts +554 -785
- package/lib/cem/types.d.ts +520 -655
- package/lib/cem/utils.mjs +9 -10
- package/lib/cem/validate.js +15 -13
- package/lib/create-illustrations/index.js +21 -31
- package/lib/create-new-component/tsFileContentTemplate.js +2 -11
- package/lib/generate-custom-elements-manifest/index.js +51 -107
- package/lib/generate-js-imports/illustrations.js +9 -9
- package/package.json +2 -2
- package/lib/esm-abs-to-rel/index.js +0 -61
- package/lib/replace-global-core/index.js +0 -25
@@ -1,25 +0,0 @@
|
|
1
|
-
const fs = require("fs").promises;
|
2
|
-
|
3
|
-
const basePath = process.argv[2];
|
4
|
-
|
5
|
-
const replaceGlobalCoreUsage = async (srcPath) => {
|
6
|
-
|
7
|
-
const original = (await fs.readFile(srcPath)).toString();
|
8
|
-
let replaced = original.replace(/sap\.ui\.getCore\(\)/g, `Core`);
|
9
|
-
|
10
|
-
if (original !== replaced) {
|
11
|
-
replaced = `import Core from 'sap/ui/core/Core';
|
12
|
-
${replaced}`;
|
13
|
-
return fs.writeFile(srcPath, replaced);
|
14
|
-
}
|
15
|
-
};
|
16
|
-
|
17
|
-
const generate = async () => {
|
18
|
-
const { globby } = await import("globby");
|
19
|
-
const fileNames = await globby(basePath.replace(/\\/g, "/") + "**/*.js");
|
20
|
-
return Promise.all(fileNames.map(replaceGlobalCoreUsage).filter(x => !!x));
|
21
|
-
};
|
22
|
-
|
23
|
-
generate().then(() => {
|
24
|
-
console.log("Success: Replaced global core usage in:", basePath);
|
25
|
-
});
|