backend-manager 5.9.8 → 5.9.10
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/package.json +1 -1
- package/src/cli/commands/setup-tests/bem-config.js +3 -2
- package/src/cli/commands/setup-tests/helpers.js +5 -0
- package/src/cli/commands/setup-tests/project-id-consistency.js +2 -1
- package/src/cli/commands/setup.js +9 -0
- package/src/test/fixtures/firebase-project/.temp/test-mode.json +1 -1
- package/src/test/fixtures/firebase-project/database-debug.log +8 -8
- package/src/test/fixtures/firebase-project/firestore-debug.log +57 -55
- package/src/test/fixtures/firebase-project/pubsub-debug.log +3 -3
- package/templates/index.js +12 -0
package/package.json
CHANGED
|
@@ -40,9 +40,10 @@ class BemConfigTest extends BaseTest {
|
|
|
40
40
|
async fix() {
|
|
41
41
|
const ui = require('../../utils/ui');
|
|
42
42
|
|
|
43
|
-
//
|
|
43
|
+
// Copy template if config doesn't exist or is empty
|
|
44
44
|
if (!this.context.hasContent(this.self.bemConfigJSON)) {
|
|
45
|
-
|
|
45
|
+
const templatePath = path.resolve(__dirname, '../../../../templates/backend-manager-config.json');
|
|
46
|
+
jetpack.copy(templatePath, `${this.self.firebaseProjectPath}/functions/backend-manager-config.json`, { overwrite: true });
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
// Collect the keys that are still missing (these are what the user must fill in).
|
|
@@ -9,6 +9,10 @@ function loadJSON(path) {
|
|
|
9
9
|
return JSON5.parse(contents);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
function saveJSON5(filePath, data) {
|
|
13
|
+
jetpack.write(filePath, JSON5.stringify(data, null, 2) + '\n');
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
function hasContent(object) {
|
|
13
17
|
return Object.keys(object).length > 0;
|
|
14
18
|
}
|
|
@@ -19,6 +23,7 @@ function isLocal(name) {
|
|
|
19
23
|
|
|
20
24
|
module.exports = {
|
|
21
25
|
loadJSON,
|
|
26
|
+
saveJSON5,
|
|
22
27
|
hasContent,
|
|
23
28
|
isLocal,
|
|
24
29
|
};
|
|
@@ -2,6 +2,7 @@ const BaseTest = require('./base-test');
|
|
|
2
2
|
const jetpack = require('fs-jetpack');
|
|
3
3
|
const JSON5 = require('json5');
|
|
4
4
|
const chalk = require('chalk').default;
|
|
5
|
+
const helpers = require('./helpers');
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Ensures projectId is consistent across all configuration files:
|
|
@@ -142,7 +143,7 @@ class ProjectIdConsistencyTest extends BaseTest {
|
|
|
142
143
|
bemConfigData.firebaseConfig = bemConfigData.firebaseConfig || {};
|
|
143
144
|
bemConfigData.firebaseConfig.projectId = expectedProjectId;
|
|
144
145
|
|
|
145
|
-
|
|
146
|
+
helpers.saveJSON5(bemConfigPath, bemConfigData);
|
|
146
147
|
console.log(chalk.green(`Fixed: backend-manager-config.json → firebaseConfig.projectId = ${expectedProjectId}`));
|
|
147
148
|
}
|
|
148
149
|
|
|
@@ -298,6 +298,15 @@ class SetupCommand extends BaseCommand {
|
|
|
298
298
|
touched++;
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
// index.js — entry point for Cloud Functions
|
|
302
|
+
const indexPath = `${self.firebaseProjectPath}/functions/index.js`;
|
|
303
|
+
if (!jetpack.exists(indexPath)) {
|
|
304
|
+
const templatePath = path.join(templatesDir, 'index.js');
|
|
305
|
+
jetpack.copy(templatePath, indexPath);
|
|
306
|
+
ui.status('add', `Created ${chalk.cyan('functions/index.js')}`, { level: 2 });
|
|
307
|
+
touched++;
|
|
308
|
+
}
|
|
309
|
+
|
|
301
310
|
return touched;
|
|
302
311
|
}
|
|
303
312
|
|
|
@@ -2,11 +2,11 @@ WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
|
|
|
2
2
|
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by akka.util.Unsafe (file:/Users/ian/.cache/firebase/emulators/firebase-database-emulator-v4.11.2.jar)
|
|
3
3
|
WARNING: Please consider reporting this to the maintainers of class akka.util.Unsafe
|
|
4
4
|
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
21:48:49.365 [NamespaceSystem-akka.actor.default-dispatcher-4] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
|
|
6
|
+
21:48:49.461 [main] INFO com.firebase.server.forge.App$ - Listening at 127.0.0.1:9000
|
|
7
|
+
21:48:59.683 [NamespaceSystem-akka.actor.default-dispatcher-4] INFO com.firebase.core.namespace.NamespaceActor - demo-backend-manager-default-rtdb successfully activated FBKV (SurveyIdle(0)) wait: 76ms, init: 0ms
|
|
8
|
+
21:48:59.719 [NamespaceSystem-blocking-namespace-operation-dispatcher-6] INFO com.firebase.core.namespace.StateManager - Namespace demo-backend-manager-default-rtdb status Active to Active
|
|
9
|
+
21:49:11.203 [Thread-0] INFO com.firebase.server.forge.App$ - Attempting graceful shutdown.
|
|
10
|
+
21:49:11.207 [NamespaceSystem-akka.actor.default-dispatcher-5] INFO com.firebase.core.namespace.Terminator$Terminator - 1 actors left to terminate: demo-backend-manager-default-rtdb
|
|
11
|
+
21:49:11.211 [NamespaceSystem-akka.actor.default-dispatcher-5] INFO com.firebase.core.namespace.NamespaceActor - stopped namespace actor for demo-backend-manager-default-rtdb
|
|
12
|
+
21:49:11.214 [Thread-0] INFO com.firebase.server.forge.App$ - Graceful shutdown complete.
|
|
@@ -2,7 +2,7 @@ WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
|
|
|
2
2
|
WARNING: sun.misc.Unsafe::allocateMemory has been called by io.netty.util.internal.PlatformDependent0$2 (file:/Users/ian/.cache/firebase/emulators/cloud-firestore-emulator-v1.21.0.jar)
|
|
3
3
|
WARNING: Please consider reporting this to the maintainers of class io.netty.util.internal.PlatformDependent0$2
|
|
4
4
|
WARNING: sun.misc.Unsafe::allocateMemory will be removed in a future release
|
|
5
|
-
Jun
|
|
5
|
+
Jun 25, 2026 9:48:48 PM com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer start
|
|
6
6
|
INFO: Started WebSocket server on ws://127.0.0.1:9150
|
|
7
7
|
|
|
8
8
|
API endpoint: http://127.0.0.1:8080
|
|
@@ -20,113 +20,115 @@ If you are running a Firestore in Datastore Mode project, run:
|
|
|
20
20
|
Note: Support for Datastore Mode is in preview. If you encounter any bugs please file at https://github.com/firebase/firebase-tools/issues.
|
|
21
21
|
Dev App Server is now running.
|
|
22
22
|
|
|
23
|
-
Jun
|
|
23
|
+
Jun 25, 2026 9:48:58 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
24
24
|
INFO: Detected non-HTTP/2 connection.
|
|
25
|
-
Jun
|
|
25
|
+
Jun 25, 2026 9:48:59 PM io.grpc.netty.TcpMetrics loadEpollInfo
|
|
26
26
|
INFO: Epoll available during static init of TcpMetrics:false
|
|
27
|
-
Jun
|
|
27
|
+
Jun 25, 2026 9:48:59 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
28
28
|
INFO: Detected HTTP/2 connection.
|
|
29
|
-
Jun
|
|
29
|
+
Jun 25, 2026 9:49:00 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
30
30
|
INFO: Detected HTTP/2 connection.
|
|
31
|
-
Jun
|
|
31
|
+
Jun 25, 2026 9:49:00 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
32
32
|
INFO: Detected HTTP/2 connection.
|
|
33
|
-
Jun
|
|
33
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
34
34
|
INFO: Detected HTTP/2 connection.
|
|
35
|
-
Jun
|
|
35
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
36
36
|
INFO: Detected HTTP/2 connection.
|
|
37
|
-
Jun
|
|
37
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
38
38
|
INFO: Detected HTTP/2 connection.
|
|
39
|
-
Jun
|
|
39
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
40
40
|
INFO: Detected HTTP/2 connection.
|
|
41
|
-
Jun
|
|
41
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
42
42
|
INFO: Detected HTTP/2 connection.
|
|
43
|
-
Jun
|
|
43
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
44
44
|
INFO: Detected HTTP/2 connection.
|
|
45
|
-
Jun
|
|
45
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
46
46
|
INFO: Detected HTTP/2 connection.
|
|
47
|
-
Jun
|
|
47
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
48
48
|
INFO: Detected HTTP/2 connection.
|
|
49
|
-
Jun
|
|
49
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
50
50
|
INFO: Detected HTTP/2 connection.
|
|
51
|
-
Jun
|
|
51
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
52
52
|
INFO: Detected HTTP/2 connection.
|
|
53
|
-
Jun
|
|
53
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
54
54
|
INFO: Detected HTTP/2 connection.
|
|
55
|
-
Jun
|
|
55
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
56
56
|
INFO: Detected HTTP/2 connection.
|
|
57
|
-
Jun
|
|
57
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
58
58
|
INFO: Detected HTTP/2 connection.
|
|
59
|
-
Jun
|
|
59
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
60
60
|
INFO: Detected HTTP/2 connection.
|
|
61
|
-
Jun
|
|
61
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
62
62
|
INFO: Detected HTTP/2 connection.
|
|
63
|
-
Jun
|
|
63
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
64
64
|
INFO: Detected HTTP/2 connection.
|
|
65
|
-
Jun
|
|
65
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
66
66
|
INFO: Detected HTTP/2 connection.
|
|
67
|
-
Jun
|
|
67
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
68
68
|
INFO: Detected HTTP/2 connection.
|
|
69
|
-
Jun
|
|
69
|
+
Jun 25, 2026 9:49:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
70
70
|
INFO: Detected HTTP/2 connection.
|
|
71
|
-
Jun
|
|
71
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
72
72
|
INFO: Detected HTTP/2 connection.
|
|
73
|
-
Jun
|
|
73
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
74
74
|
INFO: Detected HTTP/2 connection.
|
|
75
|
-
Jun
|
|
75
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
76
76
|
INFO: Detected HTTP/2 connection.
|
|
77
|
-
Jun
|
|
77
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
78
78
|
INFO: Detected HTTP/2 connection.
|
|
79
|
-
Jun
|
|
79
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
80
80
|
INFO: Detected HTTP/2 connection.
|
|
81
|
-
Jun
|
|
81
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
82
82
|
INFO: Detected HTTP/2 connection.
|
|
83
|
-
Jun
|
|
83
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
84
84
|
INFO: Detected HTTP/2 connection.
|
|
85
|
-
Jun
|
|
85
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
86
86
|
INFO: Detected HTTP/2 connection.
|
|
87
|
-
Jun
|
|
87
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
88
88
|
INFO: Detected HTTP/2 connection.
|
|
89
|
-
Jun
|
|
89
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
90
90
|
INFO: Detected HTTP/2 connection.
|
|
91
|
-
Jun
|
|
91
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
92
92
|
INFO: Detected HTTP/2 connection.
|
|
93
|
-
Jun
|
|
93
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
94
94
|
INFO: Detected HTTP/2 connection.
|
|
95
|
-
Jun
|
|
95
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
96
96
|
INFO: Detected HTTP/2 connection.
|
|
97
|
-
Jun
|
|
97
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
98
98
|
INFO: Detected HTTP/2 connection.
|
|
99
|
-
Jun
|
|
99
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
100
100
|
INFO: Detected HTTP/2 connection.
|
|
101
|
-
Jun
|
|
101
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
102
102
|
INFO: Detected HTTP/2 connection.
|
|
103
|
-
Jun
|
|
103
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
104
104
|
INFO: Detected HTTP/2 connection.
|
|
105
|
-
Jun
|
|
105
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
106
106
|
INFO: Detected HTTP/2 connection.
|
|
107
|
-
Jun
|
|
107
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
108
108
|
INFO: Detected HTTP/2 connection.
|
|
109
|
-
Jun
|
|
109
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
110
110
|
INFO: Detected HTTP/2 connection.
|
|
111
|
-
Jun
|
|
111
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
112
112
|
INFO: Detected HTTP/2 connection.
|
|
113
|
-
Jun
|
|
113
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
114
114
|
INFO: Detected HTTP/2 connection.
|
|
115
|
-
Jun
|
|
115
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
116
116
|
INFO: Detected HTTP/2 connection.
|
|
117
|
-
Jun
|
|
117
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
118
118
|
INFO: Detected HTTP/2 connection.
|
|
119
|
-
Jun
|
|
119
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
120
120
|
INFO: Detected HTTP/2 connection.
|
|
121
|
-
Jun
|
|
121
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
122
122
|
INFO: Detected HTTP/2 connection.
|
|
123
|
-
Jun
|
|
123
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
124
124
|
INFO: Detected HTTP/2 connection.
|
|
125
|
-
Jun
|
|
125
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
126
126
|
INFO: Detected HTTP/2 connection.
|
|
127
|
-
Jun
|
|
127
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
128
128
|
INFO: Detected HTTP/2 connection.
|
|
129
|
-
Jun
|
|
129
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
130
|
+
INFO: Detected HTTP/2 connection.
|
|
131
|
+
Jun 25, 2026 9:49:10 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
130
132
|
INFO: Detected HTTP/2 connection.
|
|
131
133
|
*** shutting down gRPC server since JVM is shutting down
|
|
132
134
|
*** server shut down
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
This is the Google Pub/Sub fake.
|
|
2
2
|
Implementation may be incomplete or differ from the real system.
|
|
3
|
-
Jun
|
|
3
|
+
Jun 25, 2026 9:48:52 PM com.google.cloud.pubsub.testing.v1.Main main
|
|
4
4
|
INFO: IAM integration is disabled. IAM policy methods and ACL checks are not supported
|
|
5
5
|
SLF4J(W): No SLF4J providers were found.
|
|
6
6
|
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
|
|
@@ -9,9 +9,9 @@ WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
|
|
|
9
9
|
WARNING: sun.misc.Unsafe::allocateMemory has been called by io.netty.util.internal.PlatformDependent0$2 (file:/Users/ian/.cache/firebase/emulators/pubsub-emulator-0.8.33/pubsub-emulator/lib/cloud-pubsub-emulator-0.8.33-all.jar)
|
|
10
10
|
WARNING: Please consider reporting this to the maintainers of class io.netty.util.internal.PlatformDependent0$2
|
|
11
11
|
WARNING: sun.misc.Unsafe::allocateMemory will be removed in a future release
|
|
12
|
-
Jun
|
|
12
|
+
Jun 25, 2026 9:48:53 PM com.google.cloud.pubsub.testing.v1.Main main
|
|
13
13
|
INFO: Server started, listening on 8085
|
|
14
|
-
Jun
|
|
14
|
+
Jun 25, 2026 9:48:59 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
|
|
15
15
|
INFO: Detected HTTP/2 connection.
|
|
16
16
|
*** shutting down gRPC server since JVM is shutting down
|
|
17
17
|
*** server shut down
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Initialize
|
|
3
|
+
*/
|
|
4
|
+
const Manager = (new (require('backend-manager'))).init(exports, {
|
|
5
|
+
});
|
|
6
|
+
const { functions } = Manager.libraries;
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
Routes
|
|
10
|
+
Add custom routes below. Built-in routes (auth, payments, newsletters,
|
|
11
|
+
usage, etc.) are registered automatically by Backend Manager.
|
|
12
|
+
*/
|