@ui5/webcomponents-tools 1.17.0 → 1.18.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 CHANGED
@@ -3,6 +3,25 @@
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.18.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.18.0-rc.0...v1.18.0-rc.1) (2023-09-21)
7
+
8
+
9
+ ### Reverts
10
+
11
+ * Revert "build: fix dev server page refresh" ([105db9f](https://github.com/SAP/ui5-webcomponents/commit/105db9f3c42e7434c2dc9b0eb967fb45cac9620d))
12
+
13
+
14
+
15
+
16
+
17
+ # [1.18.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.17.0...v1.18.0-rc.0) (2023-09-07)
18
+
19
+ **Note:** Version bump only for package @ui5/webcomponents-tools
20
+
21
+
22
+
23
+
24
+
6
25
  # [1.17.0](https://github.com/SAP/ui5-webcomponents/compare/v1.17.0-rc.2...v1.17.0) (2023-09-01)
7
26
 
8
27
  **Note:** Version bump only for package @ui5/webcomponents-tools
@@ -0,0 +1,39 @@
1
+ const fs = require("fs");
2
+
3
+ /**
4
+ * A change is observed on MacOS since 13.5, where the build generates a large amount
5
+ * of JSON file that spotlight search has to index, as they are considered new files.
6
+ *
7
+ * Starting the vitejs dev server reads all of these files and this triggers the indexing.
8
+ * The indexing has a side effect of changing some file metadata (can be checked with `mdls <path_to_file>`).
9
+ * This metadata change is changing the ctime of the file, but not the mtime. This can be checked with `stat -x <path_to_file>
10
+ *
11
+ * Essentially only metadata is changed, not content. This should not cause a page refresh,
12
+ * but chokidar reports this change and vite refreshes the page.
13
+ * The indexing is running with a 10 second interval, so for roughtly 20 minutes vite is refreshing the page every 10 seconds
14
+ *
15
+ * This plugin checks if the file causing the refresh is a generated json file (dist/*.json) and if ctime is changed after mtime
16
+ * In that case, returing an empty array tells vitejs that a custom update will be made by the plugin,
17
+ * which is in effect ignoring the page refresh.
18
+ */
19
+
20
+ const customHotUpdate = async () => {
21
+ return {
22
+ name: 'custom-hot-update',
23
+ handleHotUpdate(ctx) {
24
+ // custom check for generated json files
25
+ if (ctx.file.includes("dist/") && ctx.file.endsWith(".json")) {
26
+ const stat = fs.statSync(ctx.file);
27
+
28
+ // metadata change only
29
+ if (stat.ctime > stat.mtime) {
30
+ // uncomment for debugging
31
+ // console.log("ignoring hot update for:", ctx.file);
32
+ return [];
33
+ }
34
+ }
35
+ }
36
+ }
37
+ };
38
+
39
+ module.exports = customHotUpdate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-tools",
3
- "version": "1.17.0",
3
+ "version": "1.18.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",
@@ -62,7 +62,7 @@
62
62
  "resolve": "^1.20.0",
63
63
  "rimraf": "^3.0.2",
64
64
  "slash": "3.0.0",
65
- "vite": "^3.0.4",
65
+ "vite": "^4.4.9",
66
66
  "wdio-chromedriver-service": "^7.3.2",
67
67
  "zx": "^7.2.3"
68
68
  },
@@ -78,5 +78,5 @@
78
78
  "devDependencies": {
79
79
  "yargs": "^17.5.1"
80
80
  },
81
- "gitHead": "7494e311b19e26e49c87928cdc0d1165309f24ad"
81
+ "gitHead": "4ee4e15d3bd6e5517090f0fccdb0939b3591cbdc"
82
82
  }