@udixio/theme 2.1.1 → 2.1.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,13 @@
1
+ ## 2.1.2 (2025-10-17)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **theme, plugins-tailwind:** improve container caching and enhance debugging logs ([a8f955d](https://github.com/Udixio/UI/commit/a8f955d))
6
+
7
+ ### ❤️ Thank You
8
+
9
+ - Joël VIGREUX
10
+
1
11
  ## 2.1.1 (2025-10-17)
2
12
 
3
13
  ### 🩹 Fixes
@@ -1,4 +1,6 @@
1
- import { Resolver } from 'awilix';
1
+ import { AwilixContainer, Resolver } from 'awilix';
2
2
  export type Module = Record<string, Resolver<any>>;
3
- export declare const AppContainer: () => import('awilix').AwilixContainer<any>;
3
+ export declare const AppContainer: (options?: {
4
+ fresh?: boolean;
5
+ }) => AwilixContainer<any>;
4
6
  //# sourceMappingURL=app.container.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.container.d.ts","sourceRoot":"","sources":["../src/app.container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAOlE,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AAEnD,eAAO,MAAM,YAAY,6CAuBxB,CAAC"}
1
+ {"version":3,"file":"app.container.d.ts","sourceRoot":"","sources":["../src/app.container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAkC,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAOnF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AAInD,eAAO,MAAM,YAAY,GAAI,UAAU;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,yBA4BzD,CAAC"}
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-Bvj18-eg.cjs");
5
+ const loadFromPath = require("./load-from-path-pZQNcEPJ.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-CjLV8qqN.js";
4
+ import { l as loadFromPath } from "./load-from-path-BPJUOVxu.js";
5
5
  const program = new Command();
6
6
  async function runOnce(configPath) {
7
7
  try {
package/dist/browser.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const loader = require("./loader-DuLiOKuW.cjs");
4
- const font_plugin = require("./font.plugin-Czq_-M7T.cjs");
3
+ const loader = require("./loader-CQxzpARY.cjs");
4
+ const font_plugin = require("./font.plugin-DLv04PSX.cjs");
5
5
  exports.API = loader.API;
6
6
  exports.AppContainer = loader.AppContainer;
7
7
  exports.AppModule = loader.AppModule;
package/dist/browser.js CHANGED
@@ -1,5 +1,5 @@
1
- import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader-Dy9GSe3X.js";
2
- import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-B2IbI3Qs.js";
1
+ import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader-qCj0ikgY.js";
2
+ import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-CDZs7YLM.js";
3
3
  export {
4
4
  A as API,
5
5
  a as AppContainer,
@@ -1 +1 @@
1
- {"version":3,"file":"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E3B;IACD,IAAI,OAAO,IAHU,OAAO,CAK3B;IAED,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC;IAW5D,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,MAAM,OAAO,CAAC,EAAE,KAAK,IAAI,GAAG,IAAI;CAG/D"}
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import "./loader-Dy9GSe3X.js";
4
+ import "./loader-qCj0ikgY.js";
5
5
  class PluginAbstract {
6
6
  constructor(options) {
7
7
  __publicField(this, "options");
@@ -2,7 +2,7 @@
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- require("./loader-DuLiOKuW.cjs");
5
+ require("./loader-CQxzpARY.cjs");
6
6
  class PluginAbstract {
7
7
  constructor(options) {
8
8
  __publicField(this, "options");
@@ -1,4 +1,4 @@
1
- import { p as loader } from "./loader-Dy9GSe3X.js";
1
+ import { p as loader } from "./loader-qCj0ikgY.js";
2
2
  import * as fs from "node:fs";
3
3
  async function resolveConfig(configPath = "./theme.config") {
4
4
  const { createJiti } = await import("jiti");
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
22
  mod
23
23
  ));
24
- const loader = require("./loader-DuLiOKuW.cjs");
24
+ const loader = require("./loader-CQxzpARY.cjs");
25
25
  const fs = require("node:fs");
26
26
  var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
27
27
  function _interopNamespaceDefault(e) {
@@ -44,7 +44,7 @@ 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-Bvj18-eg.cjs", document.baseURI).href, {
47
+ const jiti = createJiti(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("load-from-path-pZQNcEPJ.cjs", document.baseURI).href, {
48
48
  debug: process.env.NODE_ENV === "development",
49
49
  fsCache: true,
50
50
  interopDefault: true
@@ -2526,8 +2526,7 @@ class Context {
2526
2526
  }
2527
2527
  set(options) {
2528
2528
  if (this._options) {
2529
- console.error(this._options);
2530
- throw new Error("Options already set");
2529
+ return this.update(options);
2531
2530
  }
2532
2531
  if (typeof options.sourceColor === "string") {
2533
2532
  options.sourceColor = Hct.fromInt(materialColorUtilities.argbFromHex(options.sourceColor));
@@ -2797,7 +2796,14 @@ const PaletteModule = {
2797
2796
  paletteApi: awilix.asClass(PaletteApi).scoped(),
2798
2797
  paletteManager: awilix.asClass(PaletteManager).scoped()
2799
2798
  };
2800
- const AppContainer = () => {
2799
+ let cachedContainer = null;
2800
+ const AppContainer = (options) => {
2801
+ if (!(options == null ? void 0 : options.fresh) && cachedContainer) {
2802
+ return cachedContainer;
2803
+ }
2804
+ const container = awilix.createContainer({
2805
+ injectionMode: awilix.InjectionMode.PROXY
2806
+ });
2801
2807
  function registerModule(...modules) {
2802
2808
  modules.forEach((module2) => {
2803
2809
  Object.entries(module2).forEach(([name, moduleClass]) => {
@@ -2806,9 +2812,6 @@ const AppContainer = () => {
2806
2812
  });
2807
2813
  return AppContainer;
2808
2814
  }
2809
- const container = awilix.createContainer({
2810
- injectionMode: awilix.InjectionMode.PROXY
2811
- });
2812
2815
  registerModule(
2813
2816
  AppModule,
2814
2817
  PluginModule,
@@ -2816,6 +2819,7 @@ const AppContainer = () => {
2816
2819
  PaletteModule,
2817
2820
  ContextModule
2818
2821
  );
2822
+ cachedContainer = container;
2819
2823
  return container;
2820
2824
  };
2821
2825
  function bootstrap() {
@@ -2525,8 +2525,7 @@ class Context {
2525
2525
  }
2526
2526
  set(options) {
2527
2527
  if (this._options) {
2528
- console.error(this._options);
2529
- throw new Error("Options already set");
2528
+ return this.update(options);
2530
2529
  }
2531
2530
  if (typeof options.sourceColor === "string") {
2532
2531
  options.sourceColor = Hct.fromInt(argbFromHex(options.sourceColor));
@@ -2796,7 +2795,14 @@ const PaletteModule = {
2796
2795
  paletteApi: asClass(PaletteApi).scoped(),
2797
2796
  paletteManager: asClass(PaletteManager).scoped()
2798
2797
  };
2799
- const AppContainer = () => {
2798
+ let cachedContainer = null;
2799
+ const AppContainer = (options) => {
2800
+ if (!(options == null ? void 0 : options.fresh) && cachedContainer) {
2801
+ return cachedContainer;
2802
+ }
2803
+ const container = createContainer({
2804
+ injectionMode: InjectionMode.PROXY
2805
+ });
2800
2806
  function registerModule(...modules) {
2801
2807
  modules.forEach((module) => {
2802
2808
  Object.entries(module).forEach(([name, moduleClass]) => {
@@ -2805,9 +2811,6 @@ const AppContainer = () => {
2805
2811
  });
2806
2812
  return AppContainer;
2807
2813
  }
2808
- const container = createContainer({
2809
- injectionMode: InjectionMode.PROXY
2810
- });
2811
2814
  registerModule(
2812
2815
  AppModule,
2813
2816
  PluginModule,
@@ -2815,6 +2818,7 @@ const AppContainer = () => {
2815
2818
  PaletteModule,
2816
2819
  ContextModule
2817
2820
  );
2821
+ cachedContainer = container;
2818
2822
  return container;
2819
2823
  };
2820
2824
  function bootstrap() {
package/dist/node.cjs CHANGED
@@ -22,9 +22,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  mod
23
23
  ));
24
24
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
25
- const loader = require("./loader-DuLiOKuW.cjs");
26
- const font_plugin = require("./font.plugin-Czq_-M7T.cjs");
27
- const loadFromPath = require("./load-from-path-Bvj18-eg.cjs");
25
+ const loader = require("./loader-CQxzpARY.cjs");
26
+ const font_plugin = require("./font.plugin-DLv04PSX.cjs");
27
+ const loadFromPath = require("./load-from-path-pZQNcEPJ.cjs");
28
28
  let unpluginInstance = null;
29
29
  const createUnpluginTheme = async () => {
30
30
  if (unpluginInstance) {
package/dist/node.js CHANGED
@@ -1,7 +1,7 @@
1
- import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader-Dy9GSe3X.js";
2
- import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-B2IbI3Qs.js";
3
- import { l as loadFromPath } from "./load-from-path-CjLV8qqN.js";
4
- import { r as r2 } from "./load-from-path-CjLV8qqN.js";
1
+ import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader-qCj0ikgY.js";
2
+ import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-CDZs7YLM.js";
3
+ import { l as loadFromPath } from "./load-from-path-BPJUOVxu.js";
4
+ import { r as r2 } from "./load-from-path-BPJUOVxu.js";
5
5
  let unpluginInstance = null;
6
6
  const createUnpluginTheme = async () => {
7
7
  if (unpluginInstance) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@udixio/theme",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "type": "module",
5
5
  "main": "./dist/node.js",
6
6
  "module": "./dist/node.js",
@@ -1,4 +1,4 @@
1
- import { createContainer, InjectionMode, Resolver } from 'awilix';
1
+ import { AwilixContainer, createContainer, InjectionMode, Resolver } from 'awilix';
2
2
  import { ColorModule } from './color';
3
3
  import { AppModule } from './app.module';
4
4
  import { PluginModule } from './plugin';
@@ -7,7 +7,17 @@ import { ContextModule } from './context';
7
7
 
8
8
  export type Module = Record<string, Resolver<any>>;
9
9
 
10
- export const AppContainer = () => {
10
+ let cachedContainer: AwilixContainer | null = null;
11
+
12
+ export const AppContainer = (options?: { fresh?: boolean }) => {
13
+ if (!options?.fresh && cachedContainer) {
14
+ return cachedContainer;
15
+ }
16
+
17
+ const container = createContainer({
18
+ injectionMode: InjectionMode.PROXY,
19
+ });
20
+
11
21
  function registerModule(...modules: Module[]) {
12
22
  modules.forEach((module) => {
13
23
  Object.entries(module).forEach(([name, moduleClass]) => {
@@ -17,10 +27,6 @@ export const AppContainer = () => {
17
27
  return AppContainer;
18
28
  }
19
29
 
20
- const container = createContainer({
21
- injectionMode: InjectionMode.PROXY,
22
- });
23
-
24
30
  registerModule(
25
31
  AppModule,
26
32
  PluginModule,
@@ -29,5 +35,6 @@ export const AppContainer = () => {
29
35
  ContextModule,
30
36
  );
31
37
 
38
+ cachedContainer = container;
32
39
  return container;
33
40
  };
@@ -60,8 +60,7 @@ export class Context {
60
60
 
61
61
  set(options: ContextOptions) {
62
62
  if (this._options) {
63
- console.error(this._options);
64
- throw new Error('Options already set');
63
+ return this.update(options);
65
64
  }
66
65
  if (typeof options.sourceColor === 'string') {
67
66
  options.sourceColor = Hct.fromInt(argbFromHex(options.sourceColor));