ezfw-core 1.0.0 → 1.0.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/core/ez.ts CHANGED
@@ -603,8 +603,11 @@ const ez: EzFramework = {
603
603
  utils: EzUtils
604
604
  };
605
605
 
606
- await ez._initModules();
607
- ez._initTheme();
606
+ // Initialize framework
607
+ (async () => {
608
+ await ez._initModules();
609
+ ez._initTheme();
610
+ })();
608
611
 
609
612
  window.ez = ez;
610
613
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezfw-core",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Ez Framework - A declarative component framework for building modern web applications",
5
5
  "type": "module",
6
6
  "main": "./core/ez.ts",
@@ -43,7 +43,13 @@
43
43
  },
44
44
  "peerDependencies": {
45
45
  "vite": ">=5.0.0",
46
- "sass": ">=1.69.0"
46
+ "sass": ">=1.69.0",
47
+ "firebase": ">=10.0.0",
48
+ "libsodium-wrappers": ">=0.7.0"
49
+ },
50
+ "peerDependenciesMeta": {
51
+ "firebase": { "optional": true },
52
+ "libsodium-wrappers": { "optional": true }
47
53
  },
48
54
  "engines": {
49
55
  "node": ">=18.0.0"
@@ -6,9 +6,13 @@ export const CryptoService = {
6
6
  async init(secret) {
7
7
  if (_ready) return;
8
8
 
9
- // Dynamic import - libsodium only loads when init() is called
10
- const { default: sodium } = await import('libsodium-wrappers');
11
- _sodium = sodium;
9
+ try {
10
+ // Dynamic import - libsodium only loads when init() is called
11
+ const { default: sodium } = await import(/* @vite-ignore */ 'libsodium-wrappers');
12
+ _sodium = sodium;
13
+ } catch (e) {
14
+ throw new Error('[CryptoService] libsodium-wrappers is required. Run: npm install libsodium-wrappers');
15
+ }
12
16
 
13
17
  await _sodium.ready;
14
18
 
@@ -9,14 +9,18 @@ export class FirebaseService {
9
9
  async init() {
10
10
  if (this.initialized) return;
11
11
 
12
- const { initializeApp } = await import('firebase/app');
13
- const { getAuth } = await import('firebase/auth');
12
+ try {
13
+ const { initializeApp } = await import(/* @vite-ignore */ 'firebase/app');
14
+ const { getAuth } = await import(/* @vite-ignore */ 'firebase/auth');
14
15
 
15
- this.app = initializeApp(this.config);
16
- this.auth = getAuth(this.app);
17
- this.initialized = true;
16
+ this.app = initializeApp(this.config);
17
+ this.auth = getAuth(this.app);
18
+ this.initialized = true;
18
19
 
19
- console.log('[ez] Firebase initialized');
20
+ console.log('[ez] Firebase initialized');
21
+ } catch (e) {
22
+ throw new Error('[FirebaseService] firebase is required. Run: npm install firebase');
23
+ }
20
24
  }
21
25
 
22
26
  async loginWithEmail(email, password) {
@@ -24,7 +28,7 @@ export class FirebaseService {
24
28
  await this.init();
25
29
  }
26
30
 
27
- const { signInWithEmailAndPassword } = await import('firebase/auth');
31
+ const { signInWithEmailAndPassword } = await import(/* @vite-ignore */ 'firebase/auth');
28
32
  return signInWithEmailAndPassword(this.auth, email, password);
29
33
  }
30
34
  }