ezfw-core 1.0.1 → 1.0.3

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/services.ts CHANGED
@@ -76,7 +76,7 @@ export class EzServices {
76
76
  return;
77
77
  }
78
78
 
79
- const { CryptoService } = await import('../services/crypto.js');
79
+ const { CryptoService } = await import(/* @vite-ignore */ '../services/crypto.js');
80
80
  await CryptoService.init(env.VITE_CRYPTO_SECRET);
81
81
  this._crypto = CryptoService;
82
82
  }
@@ -97,7 +97,7 @@ export class EzServices {
97
97
  projectId: env.VITE_FIREBASE_PROJECT_ID,
98
98
  };
99
99
 
100
- const { FirebaseService } = await import('../services/firebase.js');
100
+ const { FirebaseService } = await import(/* @vite-ignore */ '../services/firebase.js');
101
101
  this._firebase = new FirebaseService(firebaseConfig) as unknown as FirebaseService;
102
102
  await this._firebase!.init();
103
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezfw-core",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Ez Framework - A declarative component framework for building modern web applications",
5
5
  "type": "module",
6
6
  "main": "./core/ez.ts",
@@ -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
  }