@udixio/theme 2.1.21 → 2.1.22
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 +10 -0
- package/dist/bin.cjs +1 -1
- package/dist/bin.js +1 -1
- package/dist/config/resolver-config.d.ts.map +1 -1
- package/dist/{load-from-path-CvD4a_os.js → load-from-path-2P9fmkmd.js} +4 -1
- package/dist/{load-from-path-CuBpH2Cs.cjs → load-from-path-ClZfPFk2.cjs} +5 -2
- package/dist/loader/unplugin.d.ts.map +1 -1
- package/dist/node.cjs +13 -6
- package/dist/node.js +14 -7
- package/package.json +1 -1
- package/src/config/resolver-config.ts +4 -1
- package/src/loader/unplugin.ts +16 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 2.1.22 (2026-04-11)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **theme:** enhance config file watching and optimize HMR handling ([e558ec6](https://github.com/Udixio/UI/commit/e558ec6))
|
|
6
|
+
|
|
7
|
+
### ❤️ Thank You
|
|
8
|
+
|
|
9
|
+
- Joël VIGREUX
|
|
10
|
+
|
|
1
11
|
## 2.1.21 (2026-04-11)
|
|
2
12
|
|
|
3
13
|
This was a version bump only for @udixio/theme to align it with other projects, there were no code changes.
|
package/dist/bin.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const commander = require("commander");
|
|
3
3
|
const chokidar = require("chokidar");
|
|
4
4
|
const chalk = require("chalk");
|
|
5
|
-
const loadFromPath = require("./load-from-path-
|
|
5
|
+
const loadFromPath = require("./load-from-path-ClZfPFk2.cjs");
|
|
6
6
|
const program = new commander.Command();
|
|
7
7
|
async function runOnce(configPath) {
|
|
8
8
|
try {
|
package/dist/bin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import chokidar from "chokidar";
|
|
3
3
|
import chalk from "chalk";
|
|
4
|
-
import { l as loadFromPath } from "./load-from-path-
|
|
4
|
+
import { l as loadFromPath } from "./load-from-path-2P9fmkmd.js";
|
|
5
5
|
const program = new Command();
|
|
6
6
|
async function runOnce(configPath) {
|
|
7
7
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver-config.d.ts","sourceRoot":"","sources":["../../src/config/resolver-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG1C,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,UAAU,SAAmB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,
|
|
1
|
+
{"version":3,"file":"resolver-config.d.ts","sourceRoot":"","sources":["../../src/config/resolver-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG1C,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,UAAU,SAAmB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAqC/B"}
|
|
@@ -5,7 +5,10 @@ async function resolveConfig(configPath = "./theme.config") {
|
|
|
5
5
|
const { resolve } = await import("pathe");
|
|
6
6
|
const jiti = createJiti(import.meta.url, {
|
|
7
7
|
debug: process.env.NODE_ENV === "development",
|
|
8
|
-
fsCache
|
|
8
|
+
// fsCache en prod uniquement — en dev, on veut toujours relire le fichier frais
|
|
9
|
+
fsCache: process.env.NODE_ENV !== "development",
|
|
10
|
+
// Pas de cache mémoire entre les appels (watch)
|
|
11
|
+
moduleCache: false,
|
|
9
12
|
interopDefault: true
|
|
10
13
|
});
|
|
11
14
|
const tryPaths = [];
|
|
@@ -44,9 +44,12 @@ const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
|
|
|
44
44
|
async function resolveConfig(configPath = "./theme.config") {
|
|
45
45
|
const { createJiti } = await import("jiti");
|
|
46
46
|
const { resolve } = await import("pathe");
|
|
47
|
-
const jiti = createJiti(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("load-from-path-
|
|
47
|
+
const jiti = createJiti(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("load-from-path-ClZfPFk2.cjs", document.baseURI).href, {
|
|
48
48
|
debug: process.env.NODE_ENV === "development",
|
|
49
|
-
fsCache
|
|
49
|
+
// fsCache en prod uniquement — en dev, on veut toujours relire le fichier frais
|
|
50
|
+
fsCache: process.env.NODE_ENV !== "development",
|
|
51
|
+
// Pas de cache mémoire entre les appels (watch)
|
|
52
|
+
moduleCache: false,
|
|
50
53
|
interopDefault: true
|
|
51
54
|
});
|
|
52
55
|
const tryPaths = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.d.ts","sourceRoot":"","sources":["../../src/loader/unplugin.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"unplugin.d.ts","sourceRoot":"","sources":["../../src/loader/unplugin.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAsID,eAAO,MAAM,UAAU,GAAU,UAAU,kBAAkB,iBAG5D,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,UAAU,kBAAkB,iBAG/D,CAAC;AAEF,eAAO,MAAM,YAAY,GAAU,UAAU,kBAAkB,iBAG9D,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,UAAU,kBAAkB,iBAG/D,CAAC;AAGF,eAAO,MAAM,mBAAmB;qBArBW,kBAAkB;wBAKf,kBAAkB;uBAKnB,kBAAkB;wBAKjB,kBAAkB;CAW/D,CAAC;AAGF,eAAe,mBAAmB,CAAC"}
|
package/dist/node.cjs
CHANGED
|
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
25
25
|
const loader = require("./loader-BN_VoxCd.cjs");
|
|
26
26
|
const serialize = require("./serialize-DBJHQrbL.cjs");
|
|
27
|
-
const loadFromPath = require("./load-from-path-
|
|
27
|
+
const loadFromPath = require("./load-from-path-ClZfPFk2.cjs");
|
|
28
28
|
let unpluginInstance = null;
|
|
29
29
|
const createUnpluginTheme = async () => {
|
|
30
30
|
if (unpluginInstance) {
|
|
@@ -59,8 +59,11 @@ const createUnpluginTheme = async () => {
|
|
|
59
59
|
return {
|
|
60
60
|
name: "udixio-theme",
|
|
61
61
|
// Hook appelé au début du build (tous les bundlers)
|
|
62
|
-
buildStart: async ()
|
|
62
|
+
buildStart: async function() {
|
|
63
63
|
await loadTheme();
|
|
64
|
+
if (resolvedConfigPath) {
|
|
65
|
+
this.addWatchFile(resolvedConfigPath);
|
|
66
|
+
}
|
|
64
67
|
},
|
|
65
68
|
// Hook appelé pendant la génération (Rollup/Vite)
|
|
66
69
|
generateBundle: async () => {
|
|
@@ -68,20 +71,24 @@ const createUnpluginTheme = async () => {
|
|
|
68
71
|
},
|
|
69
72
|
// Support spécifique Vite pour HMR
|
|
70
73
|
vite: {
|
|
71
|
-
|
|
74
|
+
configureServer: async (server) => {
|
|
72
75
|
if (!resolvedConfigPath) {
|
|
73
76
|
const result = await loadFromPath.loadFromPath(configPath);
|
|
74
77
|
resolvedConfigPath = (result == null ? void 0 : result.filePath) || "";
|
|
75
78
|
}
|
|
76
|
-
if (resolvedConfigPath
|
|
79
|
+
if (resolvedConfigPath) {
|
|
80
|
+
server.watcher.add(resolvedConfigPath);
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
handleHotUpdate: async ({ server, file }) => {
|
|
84
|
+
if (resolvedConfigPath && resolvedConfigPath === file) {
|
|
77
85
|
if (verbose) {
|
|
78
86
|
console.log(`🔄 Theme config changed: ${file}`);
|
|
79
87
|
}
|
|
80
88
|
await loadTheme();
|
|
81
89
|
server.ws.send({ type: "full-reload", path: "*" });
|
|
82
|
-
return
|
|
90
|
+
return [];
|
|
83
91
|
}
|
|
84
|
-
return;
|
|
85
92
|
}
|
|
86
93
|
},
|
|
87
94
|
// Support spécifique Webpack pour HMR
|
package/dist/node.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { A, a, b, C, c, d, e, f, g, h, i, j, k, D, H, P, l, m, n, o, V, p, q, r, s, t, u, v, w, x, y, z, B, E, F, G, I } from "./loader-J0nrh600.js";
|
|
2
2
|
import { F as F2, a as a2, P as P2, b as b2, d as d2, s as s2 } from "./serialize-FzII8uv3.js";
|
|
3
|
-
import { l as loadFromPath } from "./load-from-path-
|
|
4
|
-
import { r as r2 } from "./load-from-path-
|
|
3
|
+
import { l as loadFromPath } from "./load-from-path-2P9fmkmd.js";
|
|
4
|
+
import { r as r2 } from "./load-from-path-2P9fmkmd.js";
|
|
5
5
|
let unpluginInstance = null;
|
|
6
6
|
const createUnpluginTheme = async () => {
|
|
7
7
|
if (unpluginInstance) {
|
|
@@ -36,8 +36,11 @@ const createUnpluginTheme = async () => {
|
|
|
36
36
|
return {
|
|
37
37
|
name: "udixio-theme",
|
|
38
38
|
// Hook appelé au début du build (tous les bundlers)
|
|
39
|
-
buildStart: async ()
|
|
39
|
+
buildStart: async function() {
|
|
40
40
|
await loadTheme();
|
|
41
|
+
if (resolvedConfigPath) {
|
|
42
|
+
this.addWatchFile(resolvedConfigPath);
|
|
43
|
+
}
|
|
41
44
|
},
|
|
42
45
|
// Hook appelé pendant la génération (Rollup/Vite)
|
|
43
46
|
generateBundle: async () => {
|
|
@@ -45,20 +48,24 @@ const createUnpluginTheme = async () => {
|
|
|
45
48
|
},
|
|
46
49
|
// Support spécifique Vite pour HMR
|
|
47
50
|
vite: {
|
|
48
|
-
|
|
51
|
+
configureServer: async (server) => {
|
|
49
52
|
if (!resolvedConfigPath) {
|
|
50
53
|
const result = await loadFromPath(configPath);
|
|
51
54
|
resolvedConfigPath = (result == null ? void 0 : result.filePath) || "";
|
|
52
55
|
}
|
|
53
|
-
if (resolvedConfigPath
|
|
56
|
+
if (resolvedConfigPath) {
|
|
57
|
+
server.watcher.add(resolvedConfigPath);
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
handleHotUpdate: async ({ server, file }) => {
|
|
61
|
+
if (resolvedConfigPath && resolvedConfigPath === file) {
|
|
54
62
|
if (verbose) {
|
|
55
63
|
console.log(`🔄 Theme config changed: ${file}`);
|
|
56
64
|
}
|
|
57
65
|
await loadTheme();
|
|
58
66
|
server.ws.send({ type: "full-reload", path: "*" });
|
|
59
|
-
return
|
|
67
|
+
return [];
|
|
60
68
|
}
|
|
61
|
-
return;
|
|
62
69
|
}
|
|
63
70
|
},
|
|
64
71
|
// Support spécifique Webpack pour HMR
|
package/package.json
CHANGED
|
@@ -18,7 +18,10 @@ export async function resolveConfig(
|
|
|
18
18
|
|
|
19
19
|
const jiti = createJiti(import.meta.url, {
|
|
20
20
|
debug: process.env.NODE_ENV === 'development',
|
|
21
|
-
fsCache
|
|
21
|
+
// fsCache en prod uniquement — en dev, on veut toujours relire le fichier frais
|
|
22
|
+
fsCache: process.env.NODE_ENV !== 'development',
|
|
23
|
+
// Pas de cache mémoire entre les appels (watch)
|
|
24
|
+
moduleCache: false,
|
|
22
25
|
interopDefault: true,
|
|
23
26
|
});
|
|
24
27
|
|
package/src/loader/unplugin.ts
CHANGED
|
@@ -49,8 +49,12 @@ const createUnpluginTheme = async () => {
|
|
|
49
49
|
name: 'udixio-theme',
|
|
50
50
|
|
|
51
51
|
// Hook appelé au début du build (tous les bundlers)
|
|
52
|
-
buildStart: async ()
|
|
52
|
+
buildStart: async function () {
|
|
53
53
|
await loadTheme();
|
|
54
|
+
// Indique au bundler (Rollup/Vite) de surveiller le fichier config
|
|
55
|
+
if (resolvedConfigPath) {
|
|
56
|
+
this.addWatchFile(resolvedConfigPath);
|
|
57
|
+
}
|
|
54
58
|
},
|
|
55
59
|
|
|
56
60
|
// Hook appelé pendant la génération (Rollup/Vite)
|
|
@@ -60,21 +64,28 @@ const createUnpluginTheme = async () => {
|
|
|
60
64
|
|
|
61
65
|
// Support spécifique Vite pour HMR
|
|
62
66
|
vite: {
|
|
63
|
-
|
|
67
|
+
configureServer: async (server) => {
|
|
68
|
+
// Résoudre le chemin du config si pas encore fait
|
|
64
69
|
if (!resolvedConfigPath) {
|
|
65
70
|
const result = await loadFromPath(configPath);
|
|
66
71
|
resolvedConfigPath = result?.filePath || '';
|
|
67
72
|
}
|
|
73
|
+
// Enregistrer explicitement le fichier config dans le watcher de Vite
|
|
74
|
+
if (resolvedConfigPath) {
|
|
75
|
+
server.watcher.add(resolvedConfigPath);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
68
78
|
|
|
69
|
-
|
|
79
|
+
handleHotUpdate: async ({ server, file }) => {
|
|
80
|
+
if (resolvedConfigPath && resolvedConfigPath === file) {
|
|
70
81
|
if (verbose) {
|
|
71
82
|
console.log(`🔄 Theme config changed: ${file}`);
|
|
72
83
|
}
|
|
73
84
|
await loadTheme();
|
|
74
85
|
server.ws.send({ type: 'full-reload', path: '*' });
|
|
75
|
-
|
|
86
|
+
// Retourner [] pour stopper le traitement HMR par défaut
|
|
87
|
+
return [];
|
|
76
88
|
}
|
|
77
|
-
return;
|
|
78
89
|
},
|
|
79
90
|
},
|
|
80
91
|
|