@udixio/theme 0.5.0 → 0.5.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 CHANGED
@@ -1,3 +1,23 @@
1
+ ## 0.5.1 (2025-07-25)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **theme:** make config loading asynchronous to improve initialization flow ([d5de04f](https://github.com/Udixio/UI/commit/d5de04f))
6
+
7
+ ### ❤️ Thank You
8
+
9
+ - Joël VIGREUX
10
+
11
+ ## 0.5.0 (2025-07-25)
12
+
13
+ ### 🚀 Features
14
+
15
+ - **theme:** migrate build system from Rollup to Vite for improved performance and configuration ([3f33657](https://github.com/Udixio/UI/commit/3f33657))
16
+
17
+ ### ❤️ Thank You
18
+
19
+ - Joël VIGREUX
20
+
1
21
  ## 0.4.2 (2025-07-25)
2
22
 
3
23
  ### 🩹 Fixes
package/index.cjs CHANGED
@@ -1,4 +1,26 @@
1
1
  "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
2
24
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
25
  const awilix = require("awilix");
4
26
  const materialColorUtilities = require("@material/material-color-utilities");
@@ -2697,7 +2719,7 @@ class ConfigService {
2697
2719
  this.configPath = "./theme.config";
2698
2720
  this.api = api;
2699
2721
  }
2700
- loadConfig(config) {
2722
+ async loadConfig(config) {
2701
2723
  const {
2702
2724
  sourceColor,
2703
2725
  contrastLevel = 0,
@@ -2707,7 +2729,7 @@ class ConfigService {
2707
2729
  colors,
2708
2730
  useDefaultColors = true,
2709
2731
  plugins
2710
- } = config ?? this.getConfig();
2732
+ } = config ?? await this.getConfig();
2711
2733
  this.api.themes.create({
2712
2734
  contrastLevel,
2713
2735
  isDark,
@@ -2732,17 +2754,17 @@ class ConfigService {
2732
2754
  this.api.plugins.loadPlugins(this.api);
2733
2755
  }
2734
2756
  }
2735
- getConfig() {
2757
+ async getConfig() {
2736
2758
  if (typeof process !== "undefined" && process.release && process.release.name === "node") {
2737
- const path = require("path");
2738
- const fs = require("fs");
2759
+ const path = (await import("path")).default;
2760
+ const fs = (await import("fs")).default;
2739
2761
  const base = path.resolve(this.configPath);
2740
2762
  const extensions = [".js", ".ts", ".jms", ".jcs"];
2741
2763
  let configImport = null;
2742
2764
  for (const ext of extensions) {
2743
2765
  const path2 = base + ext;
2744
2766
  if (fs.existsSync(path2)) {
2745
- configImport = require(path2);
2767
+ configImport = (await import(path2)).default;
2746
2768
  break;
2747
2769
  }
2748
2770
  }
@@ -2848,10 +2870,10 @@ importContainer(AppContainer, [
2848
2870
  function bootstrap() {
2849
2871
  return AppContainer.resolve("api");
2850
2872
  }
2851
- function bootstrapFromConfig(args) {
2873
+ async function bootstrapFromConfig(args) {
2852
2874
  const configService = AppContainer.resolve("configService");
2853
2875
  if (args == null ? void 0 : args.path) configService.configPath = args.path;
2854
- configService.loadConfig(args == null ? void 0 : args.config);
2876
+ await configService.loadConfig(args == null ? void 0 : args.config);
2855
2877
  return AppContainer.resolve("api");
2856
2878
  }
2857
2879
  var FontFamily = /* @__PURE__ */ ((FontFamily2) => {
package/index.js CHANGED
@@ -2695,7 +2695,7 @@ class ConfigService {
2695
2695
  this.configPath = "./theme.config";
2696
2696
  this.api = api;
2697
2697
  }
2698
- loadConfig(config) {
2698
+ async loadConfig(config) {
2699
2699
  const {
2700
2700
  sourceColor,
2701
2701
  contrastLevel = 0,
@@ -2705,7 +2705,7 @@ class ConfigService {
2705
2705
  colors,
2706
2706
  useDefaultColors = true,
2707
2707
  plugins
2708
- } = config ?? this.getConfig();
2708
+ } = config ?? await this.getConfig();
2709
2709
  this.api.themes.create({
2710
2710
  contrastLevel,
2711
2711
  isDark,
@@ -2730,17 +2730,17 @@ class ConfigService {
2730
2730
  this.api.plugins.loadPlugins(this.api);
2731
2731
  }
2732
2732
  }
2733
- getConfig() {
2733
+ async getConfig() {
2734
2734
  if (typeof process !== "undefined" && process.release && process.release.name === "node") {
2735
- const path = require("path");
2736
- const fs = require("fs");
2735
+ const path = (await import("path")).default;
2736
+ const fs = (await import("fs")).default;
2737
2737
  const base = path.resolve(this.configPath);
2738
2738
  const extensions = [".js", ".ts", ".jms", ".jcs"];
2739
2739
  let configImport = null;
2740
2740
  for (const ext of extensions) {
2741
2741
  const path2 = base + ext;
2742
2742
  if (fs.existsSync(path2)) {
2743
- configImport = require(path2);
2743
+ configImport = (await import(path2)).default;
2744
2744
  break;
2745
2745
  }
2746
2746
  }
@@ -2846,10 +2846,10 @@ importContainer(AppContainer, [
2846
2846
  function bootstrap() {
2847
2847
  return AppContainer.resolve("api");
2848
2848
  }
2849
- function bootstrapFromConfig(args) {
2849
+ async function bootstrapFromConfig(args) {
2850
2850
  const configService = AppContainer.resolve("configService");
2851
2851
  if (args == null ? void 0 : args.path) configService.configPath = args.path;
2852
- configService.loadConfig(args == null ? void 0 : args.config);
2852
+ await configService.loadConfig(args == null ? void 0 : args.config);
2853
2853
  return AppContainer.resolve("api");
2854
2854
  }
2855
2855
  var FontFamily = /* @__PURE__ */ ((FontFamily2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@udixio/theme",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "./src/index.d.ts",
@@ -7,7 +7,7 @@ export declare class ConfigService {
7
7
  constructor({ api }: {
8
8
  api: API;
9
9
  });
10
- loadConfig(config?: ConfigInterface): void;
10
+ loadConfig(config?: ConfigInterface): Promise<void>;
11
11
  private getConfig;
12
12
  }
13
13
  //# sourceMappingURL=config.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.service.d.ts","sourceRoot":"","sources":["../../../../../packages/theme/src/config/config.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAG7B,wBAAgB,YAAY,CAAC,YAAY,EAAE,eAAe,GAAG,eAAe,CAQ3E;AAED,qBAAa,aAAa;IACxB,UAAU,SAAoB;IAE9B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;gBAEd,EAAE,GAAG,EAAE,EAAE;QAAE,GAAG,EAAE,GAAG,CAAA;KAAE;IAI1B,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI;IAoCjD,OAAO,CAAC,SAAS;CA2ClB"}
1
+ {"version":3,"file":"config.service.d.ts","sourceRoot":"","sources":["../../../../../packages/theme/src/config/config.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAG7B,wBAAgB,YAAY,CAAC,YAAY,EAAE,eAAe,GAAG,eAAe,CAQ3E;AAED,qBAAa,aAAa;IACxB,UAAU,SAAoB;IAE9B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;gBAEd,EAAE,GAAG,EAAE,EAAE;QAAE,GAAG,EAAE,GAAG,CAAA;KAAE;IAIpB,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;YAoClD,SAAS;CAyCxB"}
package/src/main.d.ts CHANGED
@@ -4,5 +4,5 @@ export declare function bootstrap(): API;
4
4
  export declare function bootstrapFromConfig(args?: {
5
5
  path?: string;
6
6
  config?: ConfigInterface;
7
- }): API;
7
+ }): Promise<API>;
8
8
  //# sourceMappingURL=main.d.ts.map
package/src/main.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../packages/theme/src/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAiB,MAAM,UAAU,CAAC;AAE1D,wBAAgB,SAAS,IAAI,GAAG,CAE/B;AAED,wBAAgB,mBAAmB,CAAC,IAAI,CAAC,EAAE;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B,GAAG,GAAG,CAKN"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../packages/theme/src/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAiB,MAAM,UAAU,CAAC;AAE1D,wBAAgB,SAAS,IAAI,GAAG,CAE/B;AAED,wBAAsB,mBAAmB,CAAC,IAAI,CAAC,EAAE;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B,GAAG,OAAO,CAAC,GAAG,CAAC,CAKf"}