backend-manager 2.0.5 → 2.0.6
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 +2 -2
- package/src/cli/cli.js +13 -8
package/package.json
CHANGED
package/src/cli/cli.js
CHANGED
|
@@ -241,6 +241,11 @@ Main.prototype.setup = async function () {
|
|
|
241
241
|
this.projectUrl = `https://console.firebase.google.com/project/${this.projectName}`;
|
|
242
242
|
log(chalk.black(`Id: `, chalk.bold(`${this.projectName}`)));
|
|
243
243
|
log(chalk.black(`Url:`, chalk.bold(`${this.projectUrl}`)));
|
|
244
|
+
|
|
245
|
+
if (!self.package || !self.package.engines || !self.package.engines.node) {
|
|
246
|
+
throw new Error('Missing <engines.node> in package.json')
|
|
247
|
+
}
|
|
248
|
+
|
|
244
249
|
await this.test('is a firebase project', async function () {
|
|
245
250
|
let exists = fs.exists(`${self.firebaseProjectPath}/firebase.json`);
|
|
246
251
|
return exists;
|
|
@@ -263,17 +268,17 @@ Main.prototype.setup = async function () {
|
|
|
263
268
|
return self.package.engines.node.toString() === CLI_CONFIG.node && processMajor >= engineMajor;
|
|
264
269
|
}, fix_nodeVersion);
|
|
265
270
|
|
|
266
|
-
await this.test('project level package.json exists', async function () {
|
|
267
|
-
|
|
268
|
-
}, fix_projpackage);
|
|
271
|
+
// await this.test('project level package.json exists', async function () {
|
|
272
|
+
// return !!(self.projectPackage && self.projectPackage.version && self.projectPackage.name);
|
|
273
|
+
// }, fix_projpackage);
|
|
269
274
|
|
|
270
275
|
await this.test('functions level package.json exists', async function () {
|
|
271
|
-
return !!self.package.dependencies && !!self.package.devDependencies;
|
|
276
|
+
return !!self.package && !!self.package.dependencies && !!self.package.devDependencies;
|
|
272
277
|
}, fix_deps);
|
|
273
278
|
|
|
274
|
-
await this.test('functions level package.json has updated version', async function () {
|
|
275
|
-
|
|
276
|
-
}, fix_packageversion);
|
|
279
|
+
// await this.test('functions level package.json has updated version', async function () {
|
|
280
|
+
// return self.package.version === self.projectPackage.version;
|
|
281
|
+
// }, fix_packageversion);
|
|
277
282
|
|
|
278
283
|
await this.test('using updated firebase-admin', async function () {
|
|
279
284
|
let pkg = 'firebase-admin';
|
|
@@ -656,7 +661,7 @@ async function fix_serviceAccount(self) {
|
|
|
656
661
|
|
|
657
662
|
function fix_nodeVersion(self) {
|
|
658
663
|
return new Promise(function(resolve, reject) {
|
|
659
|
-
_.set(self.package, 'engines.node',
|
|
664
|
+
_.set(self.package, 'engines.node', CLI_CONFIG.node)
|
|
660
665
|
|
|
661
666
|
fs.write(`${self.firebaseProjectPath}/functions/package.json`, JSON.stringify(self.package, null, 2) );
|
|
662
667
|
resolve();
|