@ui5/webcomponents-tools 1.10.4-rc.0 → 1.11.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 +16 -0
- package/components-package/nps.js +5 -5
- package/icons-collection/nps.js +3 -3
- package/lib/i18n/defaults.js +4 -3
- package/lib/postcss-css-to-esm/index.js +13 -7
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,22 @@
|
|
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
|
+
|
6
22
|
## [1.10.4-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.10.3...v1.10.4-rc.0) (2023-01-26)
|
7
23
|
|
8
24
|
**Note:** Version bump only for package @ui5/webcomponents-tools
|
@@ -42,17 +42,17 @@ const getScripts = (options) => {
|
|
42
42
|
}
|
43
43
|
|
44
44
|
const scripts = {
|
45
|
-
clean: 'rimraf jsdoc-dist && rimraf dist && rimraf .port && nps "scope.testPages.clean"',
|
45
|
+
clean: 'rimraf jsdoc-dist && rimraf src/generated && rimraf dist && rimraf .port && nps "scope.testPages.clean"',
|
46
46
|
lint: `eslint . ${eslintConfig}`,
|
47
47
|
lintfix: `eslint . ${eslintConfig}`,
|
48
48
|
prepare: {
|
49
|
-
default: "nps clean prepare.all generateAPI",
|
50
|
-
all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps
|
49
|
+
default: "nps clean prepare.all typescript generateAPI",
|
50
|
+
all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps build.illustrations"',
|
51
51
|
styleRelated: "nps build.styles build.jsonImports build.jsImports",
|
52
52
|
},
|
53
53
|
typescript: tsCommand,
|
54
54
|
build: {
|
55
|
-
default: "nps lint
|
55
|
+
default: "nps prepare lint build.bundle",
|
56
56
|
templates: `mkdirp dist/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o dist/generated/templates`,
|
57
57
|
styles: {
|
58
58
|
default: "nps build.styles.themes build.styles.components",
|
@@ -61,7 +61,7 @@ const getScripts = (options) => {
|
|
61
61
|
},
|
62
62
|
i18n: {
|
63
63
|
default: "nps build.i18n.defaultsjs build.i18n.json",
|
64
|
-
defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n
|
64
|
+
defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n src/generated/i18n`,
|
65
65
|
json: `node "${LIB}/i18n/toJSON.js" src/i18n dist/generated/assets/i18n`,
|
66
66
|
},
|
67
67
|
jsonImports: {
|
package/icons-collection/nps.js
CHANGED
@@ -43,13 +43,13 @@ const getScripts = (options) => {
|
|
43
43
|
const copyAssetsCmd = copyIconAssetsCommand(options);
|
44
44
|
|
45
45
|
const scripts = {
|
46
|
-
clean: "rimraf dist",
|
46
|
+
clean: "rimraf dist && rimraf src/generated",
|
47
47
|
copy: copyAssetsCmd,
|
48
48
|
build: {
|
49
|
-
default: `nps clean
|
49
|
+
default: `nps clean copy build.i18n typescript build.icons build.jsonImports`,
|
50
50
|
i18n: {
|
51
51
|
default: "nps build.i18n.defaultsjs build.i18n.json",
|
52
|
-
defaultsjs: `mkdirp dist/generated/i18n && node "${LIB}/i18n/defaults.js" src/i18n
|
52
|
+
defaultsjs: `mkdirp dist/generated/i18n && node "${LIB}/i18n/defaults.js" src/i18n src/generated/i18n`,
|
53
53
|
json: `mkdirp dist/generated/assets/i18n && node "${LIB}/i18n/toJSON.js" src/i18n dist/generated/assets/i18n`,
|
54
54
|
},
|
55
55
|
jsonImports: {
|
package/lib/i18n/defaults.js
CHANGED
@@ -8,7 +8,7 @@ const generate = async () => {
|
|
8
8
|
|
9
9
|
const messageBundle = path.normalize(`${process.argv[2]}/messagebundle.properties`);
|
10
10
|
const messageBundleDefaultLanguage = path.normalize(`${process.argv[2]}/messagebundle_${defaultLanguage}.properties`);
|
11
|
-
const outputFile = path.normalize(`${process.argv[3]}/i18n-defaults.
|
11
|
+
const outputFile = path.normalize(`${process.argv[3]}/i18n-defaults.ts`);
|
12
12
|
|
13
13
|
if (!messageBundle || !outputFile) {
|
14
14
|
return;
|
@@ -45,7 +45,7 @@ const generate = async () => {
|
|
45
45
|
let effectiveValue = defaultLanguageValue || value;
|
46
46
|
effectiveValue = effectiveValue.replace(/\"/g, "\\\""); // escape double quotes in translations
|
47
47
|
|
48
|
-
return `const ${key} = {key: "${key}", defaultText: "${effectiveValue}"};`;
|
48
|
+
return `const ${key}: I18nText = {key: "${key}", defaultText: "${effectiveValue}"};`;
|
49
49
|
};
|
50
50
|
|
51
51
|
/*
|
@@ -62,7 +62,8 @@ const generate = async () => {
|
|
62
62
|
const textKeys = Object.keys(properties);
|
63
63
|
const texts = textKeys.map(prop => getTextInfo(prop, properties[prop], defaultLanguageProperties && defaultLanguageProperties[prop])).join('');
|
64
64
|
|
65
|
-
return
|
65
|
+
return `import { I18nText } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
66
|
+
${texts}
|
66
67
|
export {${textKeys.join()}};`;
|
67
68
|
};
|
68
69
|
|
@@ -4,15 +4,17 @@ const mkdirp = require('mkdirp');
|
|
4
4
|
const assets = require("../../assets-meta.js");
|
5
5
|
|
6
6
|
const DEFAULT_THEME = assets.themes.default;
|
7
|
+
const requiredImports = "import type { StyleData } from \"@ui5/webcomponents-base/dist/types.js\";";
|
7
8
|
|
8
9
|
const getDefaultThemeCode = packageName => {
|
9
10
|
return `import { registerThemePropertiesLoader } from "@ui5/webcomponents-base/dist/asset-registries/Themes.js";
|
11
|
+
${requiredImports}
|
10
12
|
|
11
13
|
import defaultThemeBase from "@ui5/webcomponents-theming/dist/generated/themes/${DEFAULT_THEME}/parameters-bundle.css.js";
|
12
14
|
import defaultTheme from "./${DEFAULT_THEME}/parameters-bundle.css.js";
|
13
15
|
|
14
|
-
registerThemePropertiesLoader("@ui5/webcomponents-theming", "${DEFAULT_THEME}", () => defaultThemeBase);
|
15
|
-
registerThemePropertiesLoader("${packageName}", "${DEFAULT_THEME}", () => defaultTheme);
|
16
|
+
registerThemePropertiesLoader("@ui5/webcomponents-theming", "${DEFAULT_THEME}", async () => defaultThemeBase);
|
17
|
+
registerThemePropertiesLoader("${packageName}", "${DEFAULT_THEME}", async () => defaultTheme);
|
16
18
|
`;
|
17
19
|
};
|
18
20
|
|
@@ -33,12 +35,12 @@ module.exports = function (opts) {
|
|
33
35
|
let css = root.toString();
|
34
36
|
css = proccessCSS(css);
|
35
37
|
|
36
|
-
const targetFile = root.source.input.from.replace(`/${opts.toReplace}/`, "/
|
38
|
+
const targetFile = root.source.input.from.replace(`/${opts.toReplace}/`, "/src/generated/").replace(`\\${opts.toReplace}\\`, "\\src\\generated\\");
|
37
39
|
mkdirp.sync(path.dirname(targetFile));
|
38
40
|
|
39
|
-
const filePath = `${targetFile}.
|
40
|
-
const defaultTheme = opts.includeDefaultTheme ? getDefaultThemeCode(opts.packageName) :
|
41
|
-
|
41
|
+
const filePath = `${targetFile}.ts`;
|
42
|
+
const defaultTheme = opts.includeDefaultTheme ? getDefaultThemeCode(opts.packageName) : requiredImports;
|
43
|
+
|
42
44
|
// it seems slower to read the old content, but writing the same content with no real changes
|
43
45
|
// (as in initial build and then watch mode) will cause an unnecessary dev server refresh
|
44
46
|
let oldContent = "";
|
@@ -47,7 +49,11 @@ module.exports = function (opts) {
|
|
47
49
|
} catch (e) {
|
48
50
|
// file not found
|
49
51
|
}
|
50
|
-
|
52
|
+
|
53
|
+
const content = `${defaultTheme}
|
54
|
+
const styleData: StyleData = {packageName:"${opts.packageName}",fileName:"${targetFile.substr(targetFile.lastIndexOf("themes"))}",content:${css}};
|
55
|
+
export default styleData;
|
56
|
+
`;
|
51
57
|
if (content !== oldContent) {
|
52
58
|
fs.writeFileSync(filePath, content);
|
53
59
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/webcomponents-tools",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.11.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",
|
@@ -72,5 +72,5 @@
|
|
72
72
|
"devDependencies": {
|
73
73
|
"yargs": "^17.5.1"
|
74
74
|
},
|
75
|
-
"gitHead": "
|
75
|
+
"gitHead": "a76323e09b0190bbb72cbff141bb8093b8d0f4ff"
|
76
76
|
}
|