@ui5/webcomponents-tools 1.23.0 → 1.23.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 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.23.1](https://github.com/SAP/ui5-webcomponents/compare/v1.23.1-rc.0...v1.23.1) (2024-03-08)
7
+
8
+ **Note:** Version bump only for package @ui5/webcomponents-tools
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.23.1-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.23.0...v1.23.1-rc.0) (2024-03-07)
15
+
16
+ **Note:** Version bump only for package @ui5/webcomponents-tools
17
+
18
+
19
+
20
+
21
+
6
22
  # [1.23.0](https://github.com/SAP/ui5-webcomponents/compare/v1.23.0-rc.5...v1.23.0) (2024-03-06)
7
23
 
8
24
 
@@ -72,9 +72,10 @@ const getScripts = (options) => {
72
72
  default: "nps prepare lint build.bundle", // build.bundle2
73
73
  templates: `mkdirp src/generated/templates && ${tsCrossEnv} node "${LIB}/hbs2ui5/index.js" -d src/ -o src/generated/templates`,
74
74
  styles: {
75
- default: `concurrently "nps build.styles.themes" "nps build.styles.components"`,
75
+ default: `concurrently "nps build.styles.themes" "nps build.styles.components" "nps build.styles.componentStyles"`,
76
76
  themes: `node "${LIB}/css-processors/css-processor-themes.mjs"`,
77
77
  components: `node "${LIB}/css-processors/css-processor-components.mjs"`,
78
+ componentStyles: `node "${LIB}/css-processors/css-processor-component-styles.mjs"`,
78
79
  },
79
80
  i18n: {
80
81
  default: "nps build.i18n.defaultsjs build.i18n.json",
@@ -108,9 +109,10 @@ const getScripts = (options) => {
108
109
  props: 'nps "copy.props --watch --safe --skip-initial-copy"',
109
110
  bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
110
111
  styles: {
111
- default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components"',
112
+ default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components" "nps watch.styles.componentStyles" ',
112
113
  themes: 'nps "build.styles.themes -w"',
113
114
  components: `nps "build.styles.components -w"`,
115
+ componentStyles: `nps "build.styles.componentStyles -w"`,
114
116
  },
115
117
  templates: 'chokidar "src/**/*.hbs" -c "nps build.templates"',
116
118
  api: 'chokidar "test/**/*.sample.html" -c "nps generateAPI"',
@@ -0,0 +1,47 @@
1
+ import { globby } from "globby";
2
+ import * as esbuild from 'esbuild'
3
+ import * as fs from "fs";
4
+ import * as path from "path";
5
+ import { writeFile, mkdir } from "fs/promises";
6
+ import scopeVariables from "./scope-variables.mjs";
7
+
8
+ const packageJSON = JSON.parse(fs.readFileSync("./package.json"))
9
+ const inputFiles = await globby("src/styles/*.module.css");
10
+ const restArgs = process.argv.slice(2);
11
+
12
+ let componentStylesPlugin = {
13
+ name: 'component-styles',
14
+ setup(build) {
15
+ build.initialOptions.write = false;
16
+
17
+ build.onEnd(result => {
18
+ result.outputFiles.forEach(async f => {
19
+ // scoping
20
+ const newText = scopeVariables(f.text, packageJSON);
21
+ await mkdir(path.dirname(f.path), {recursive: true});
22
+ writeFile(f.path, newText);
23
+ writeFile(f.path.replace(".module.css", ".css"), newText);
24
+ });
25
+ })
26
+ },
27
+ }
28
+
29
+ const config = {
30
+ entryPoints: inputFiles,
31
+ outdir: 'dist',
32
+ outbase: 'src',
33
+ loader: {
34
+ ".module.css": "global-css"
35
+ },
36
+ plugins: [
37
+ componentStylesPlugin,
38
+ ]
39
+ };
40
+
41
+ if (restArgs.includes("-w")) {
42
+ let ctx = await esbuild.context(config);
43
+ await ctx.watch()
44
+ console.log('watching...')
45
+ } else {
46
+ await esbuild.build(config);
47
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-tools",
3
- "version": "1.23.0",
3
+ "version": "1.23.1",
4
4
  "description": "UI5 Web Components: webcomponents.tools",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -79,5 +79,5 @@
79
79
  "esbuild": "^0.19.9",
80
80
  "yargs": "^17.5.1"
81
81
  },
82
- "gitHead": "6c2f16f7d091aed0a487986cfebe5f6aabf71160"
82
+ "gitHead": "e2a6552d95088eed035e98e1ca2604e500313a35"
83
83
  }