@nardole/firebase-core 0.0.14
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/dist/main.d.ts +35 -0
- package/dist/main.js +79 -0
- package/package.json +57 -0
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Analytics } from 'firebase/analytics';
|
|
2
|
+
import { Auth } from 'firebase/auth';
|
|
3
|
+
import { Database } from 'firebase/database';
|
|
4
|
+
import { FirebaseApp } from 'firebase/app';
|
|
5
|
+
import { FirebaseOptions } from 'firebase/app';
|
|
6
|
+
import { FirebasePerformance } from 'firebase/performance';
|
|
7
|
+
import { FirebaseStorage } from 'firebase/storage';
|
|
8
|
+
import { Firestore } from 'firebase/firestore';
|
|
9
|
+
import { RemoteConfig } from 'firebase/remote-config';
|
|
10
|
+
|
|
11
|
+
export declare class FirebaseAppCore {
|
|
12
|
+
static instance: FirebaseAppCore;
|
|
13
|
+
private _app;
|
|
14
|
+
private _analytics;
|
|
15
|
+
private _performance;
|
|
16
|
+
private _remoteConfig;
|
|
17
|
+
private _storage;
|
|
18
|
+
private _auth;
|
|
19
|
+
private _database;
|
|
20
|
+
private _firestore;
|
|
21
|
+
constructor();
|
|
22
|
+
init(options: FirebaseOptions, name?: string, override?: boolean): void;
|
|
23
|
+
get app(): FirebaseApp;
|
|
24
|
+
get analytics(): Analytics;
|
|
25
|
+
get performance(): FirebasePerformance;
|
|
26
|
+
get remoteConfig(): RemoteConfig;
|
|
27
|
+
get storage(): FirebaseStorage;
|
|
28
|
+
get auth(): Auth;
|
|
29
|
+
get database(): Database;
|
|
30
|
+
get firestore(): Firestore;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export declare const firebaseService: FirebaseAppCore;
|
|
34
|
+
|
|
35
|
+
export { }
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { registerVersion, initializeApp } from "@firebase/app";
|
|
2
|
+
import { getAnalytics } from "@firebase/analytics";
|
|
3
|
+
import { getPerformance } from "@firebase/performance";
|
|
4
|
+
import { getStorage } from "@firebase/storage";
|
|
5
|
+
import { getRemoteConfig } from "@firebase/remote-config";
|
|
6
|
+
import { getAuth } from "@firebase/auth";
|
|
7
|
+
import { getDatabase } from "@firebase/database";
|
|
8
|
+
import { getFirestore } from "@firebase/firestore";
|
|
9
|
+
var name = "firebase";
|
|
10
|
+
var version = "12.9.0";
|
|
11
|
+
registerVersion(name, version, "app");
|
|
12
|
+
class FirebaseAppCore {
|
|
13
|
+
constructor() {
|
|
14
|
+
if (!FirebaseAppCore.instance) {
|
|
15
|
+
FirebaseAppCore.instance = this;
|
|
16
|
+
}
|
|
17
|
+
return FirebaseAppCore.instance;
|
|
18
|
+
}
|
|
19
|
+
init(options, name2, override) {
|
|
20
|
+
if (!this._app || override) {
|
|
21
|
+
this._app = initializeApp(options, name2);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
throw new Error("Firebase app already initialized");
|
|
25
|
+
}
|
|
26
|
+
get app() {
|
|
27
|
+
if (!this._app) {
|
|
28
|
+
throw new Error("Firebase app not initialized");
|
|
29
|
+
}
|
|
30
|
+
return this._app;
|
|
31
|
+
}
|
|
32
|
+
get analytics() {
|
|
33
|
+
if (!this._analytics) {
|
|
34
|
+
this._analytics = getAnalytics(this.app);
|
|
35
|
+
}
|
|
36
|
+
return this._analytics;
|
|
37
|
+
}
|
|
38
|
+
get performance() {
|
|
39
|
+
if (!this._performance) {
|
|
40
|
+
this._performance = getPerformance(this.app);
|
|
41
|
+
}
|
|
42
|
+
return this._performance;
|
|
43
|
+
}
|
|
44
|
+
get remoteConfig() {
|
|
45
|
+
if (!this._remoteConfig) {
|
|
46
|
+
this._remoteConfig = getRemoteConfig(this.app);
|
|
47
|
+
}
|
|
48
|
+
return this._remoteConfig;
|
|
49
|
+
}
|
|
50
|
+
get storage() {
|
|
51
|
+
if (!this._storage) {
|
|
52
|
+
this._storage = getStorage(this.app);
|
|
53
|
+
}
|
|
54
|
+
return this._storage;
|
|
55
|
+
}
|
|
56
|
+
get auth() {
|
|
57
|
+
if (!this._auth) {
|
|
58
|
+
this._auth = getAuth(this.app);
|
|
59
|
+
}
|
|
60
|
+
return this._auth;
|
|
61
|
+
}
|
|
62
|
+
get database() {
|
|
63
|
+
if (!this._database) {
|
|
64
|
+
this._database = getDatabase(this.app);
|
|
65
|
+
}
|
|
66
|
+
return this._database;
|
|
67
|
+
}
|
|
68
|
+
get firestore() {
|
|
69
|
+
if (!this._firestore) {
|
|
70
|
+
this._firestore = getFirestore(this.app);
|
|
71
|
+
}
|
|
72
|
+
return this._firestore;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const firebaseService = new FirebaseAppCore();
|
|
76
|
+
export {
|
|
77
|
+
FirebaseAppCore,
|
|
78
|
+
firebaseService
|
|
79
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nardole/firebase-core",
|
|
3
|
+
"version": "0.0.14",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"react",
|
|
6
|
+
"mui",
|
|
7
|
+
"dialog",
|
|
8
|
+
"material-ui"
|
|
9
|
+
],
|
|
10
|
+
"author": {
|
|
11
|
+
"name": "Luiz Braga",
|
|
12
|
+
"email": "me@nardole.dev"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"dev": "vite",
|
|
17
|
+
"build": "tsc -b && vite build",
|
|
18
|
+
"lint": "eslint .",
|
|
19
|
+
"preview": "vite preview",
|
|
20
|
+
"prepublishOnly": "yarn build"
|
|
21
|
+
},
|
|
22
|
+
"main": "dist/main.js",
|
|
23
|
+
"types": "dist/main.d.ts",
|
|
24
|
+
"module": "dist/main.js",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/main.d.ts",
|
|
28
|
+
"import": "./dist/main.js"
|
|
29
|
+
},
|
|
30
|
+
"./*": {
|
|
31
|
+
"types": "./dist/*.d.ts",
|
|
32
|
+
"import": "./dist/*.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist"
|
|
37
|
+
],
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public",
|
|
40
|
+
"registry": "https://registry.npmjs.org/"
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "https://github.com/btmluiz/nardole-firebase",
|
|
45
|
+
"directory": "packages/firebase-core"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"firebase": "^12.9.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"firebase": "^12.9.0",
|
|
52
|
+
"typescript": "^5.9.3",
|
|
53
|
+
"vite": "^7.3.1",
|
|
54
|
+
"vite-plugin-dts": "^4.5.4"
|
|
55
|
+
},
|
|
56
|
+
"packageManager": "yarn@4.10.3"
|
|
57
|
+
}
|