tiny-essentials 1.26.1 → 1.26.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/README.md CHANGED
@@ -94,7 +94,7 @@ Feel free to fork, contribute, and create pull requests for improvements! Whethe
94
94
 
95
95
  ## 📝 License
96
96
 
97
- This project is licensed under the GPL-3.0 License - see the [LICENSE](LICENSE) file for details.
97
+ This project is licensed under the LGPL-3.0 License - see the [LICENSE](LICENSE) file for details.
98
98
 
99
99
  ### 💡 Credits
100
100
 
@@ -0,0 +1,10 @@
1
+ ## ✨ New Features & Additions
2
+
3
+ ### ⚙️ **TinyClassManager** (`libs/TinyClassManager.mjs`)
4
+
5
+ A lightweight, immutable manager designed to linearly compose a base class with multiple modular plugins (mixins). It acts as a safe pipeline for class extension.
6
+
7
+ * **🔒 Immutable Chain State:** Each `.use()` call consumes the previous manager instance and returns a new one. This ensures predictable state transitions and prevents unwanted side effects or accidental reuses of an old chain.
8
+ * **🧩 Smart Dependency Verification:** Plugins can define a `dependencies` array. The manager automatically verifies that all required modules are installed *before* applying the new plugin. If a dependency is missing, it throws a clear, descriptive error.
9
+ * **🛑 Duplicate Conflict Protection:** Accidentally applying the same plugin twice? The manager actively prevents this by tracking applied plugins and throwing an error if a conflict is detected.
10
+ * **🛠️ Clean Build Pipeline:** The `.build()` method finalizes the composition, locking the manager and returning the fully compiled class, ready to be instantiated.
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e={d:(s,n)=>{for(var a in n)e.o(n,a)&&!e.o(s,a)&&Object.defineProperty(s,a,{enumerable:!0,get:n[a]})},o:(e,s)=>Object.prototype.hasOwnProperty.call(e,s)},s={};e.d(s,{TinyClassManager:()=>a});class n{#e=new Set;get appliedPlugins(){return[...this.#e]}get size(){return this.#e.size+1}#s;get currentClass(){return this.#s}#n=!1;get used(){return this.#n}constructor(e){this.#s=e}use(e){if(this.#n)throw new Error("[TinyClassManager] Cannot reuse a consumed manager instance.");if(this.#e.has(e.name))throw new Error(`[TinyClassManager] Plugin conflict: "${e.name}" is already installed.`);const s=e.dependencies||[];for(const n of s)if(!this.#e.has(n))throw new Error(`[TinyClassManager] Missing Dependency: "${e.name}" requires "${n}" to be installed first.`);const a=new n(e.apply(this.#s));return this.#e.forEach(e=>a.#e.add(e)),a.#e.add(e.name),this.#n=!0,this.#e.clear(),a}build(){if(this.#n)throw new Error("[TinyClassManager] Cannot build from an already finalized manager.");return this.#n=!0,this.#e.clear(),this.#s}}const a=n;window.TinyClassManager=s.TinyClassManager})();