backend-manager 3.0.0 → 3.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/CHANGELOG.md CHANGED
@@ -28,6 +28,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
28
28
  - Updated `uuid` from `8.3.2` --> `9.0.0`
29
29
 
30
30
  - Removed `backend-assistant` dependency and moved to custom library within this module at `./src/manager/helpers/assistant.js`
31
+ - Removed `require('firebase-functions/lib/logger/compat')`
32
+ - Changed default for `options.setupFunctionsLegacy` from `true` --> `false`
31
33
  - Updated geolocation and client data retrieval to new format:
32
34
  #### New Way
33
35
  ```js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -57,7 +57,7 @@
57
57
  "npm-api": "^1.0.1",
58
58
  "paypal-server-api": "^1.0.3",
59
59
  "pushid": "^1.0.0",
60
- "resolve-account": "^1.0.2",
60
+ "resolve-account": "^1.0.3",
61
61
  "semver": "^7.5.4",
62
62
  "shortid": "^2.2.16",
63
63
  "sizeitup": "^1.0.7",
@@ -69,4 +69,4 @@
69
69
  "wonderful-log": "^1.0.5",
70
70
  "yargs": "^17.7.2"
71
71
  }
72
- }
72
+ }
package/src/cli/cli.js CHANGED
@@ -273,7 +273,7 @@ Main.prototype.setup = async function () {
273
273
  return exists;
274
274
  }, fix_isFirebase);
275
275
 
276
- await self.test(`using node ${self.packageJSON.engines.node}`, function () {
276
+ await self.test(`using at least Node.js v${self.packageJSON.engines.node}`, function () {
277
277
  const engineReqMajor = parseInt(self.packageJSON.engines.node.split('.')[0]);
278
278
  const engineHasMajor = parseInt(self.package.engines.node.split('.')[0]);
279
279
  const processMajor = parseInt(process.versions.node.split('.')[0]);
@@ -99,7 +99,7 @@ function User(Manager, settings, options) {
99
99
  userAgent: _.get(settings, 'activity.client.userAgent', defaults ? '' : null),
100
100
  language: _.get(settings, 'activity.client.language', defaults ? '' : null),
101
101
  platform: _.get(settings, 'activity.client.platform', defaults ? '' : null),
102
- mobile: _.get(settings, 'activity.client.mobile', defaults ? '' : null),
102
+ mobile: _.get(settings, 'activity.client.mobile', defaults ? null : null),
103
103
  },
104
104
  },
105
105
  api: {
@@ -37,7 +37,7 @@ Manager.prototype.init = function (exporter, options) {
37
37
  options.initialize = typeof options.initialize === 'undefined' ? true : options.initialize;
38
38
  options.log = typeof options.log === 'undefined' ? false : options.log;
39
39
  options.setupFunctions = typeof options.setupFunctions === 'undefined' ? true : options.setupFunctions;
40
- options.setupFunctionsLegacy = typeof options.setupFunctionsLegacy === 'undefined' ? true : options.setupFunctionsLegacy;
40
+ options.setupFunctionsLegacy = typeof options.setupFunctionsLegacy === 'undefined' ? false : options.setupFunctionsLegacy;
41
41
  options.setupFunctionsIdentity = typeof options.setupFunctionsIdentity === 'undefined' ? true : options.setupFunctionsIdentity;
42
42
  options.initializeLocalStorage = typeof options.initializeLocalStorage === 'undefined' ? false : options.initializeLocalStorage;
43
43
  options.resourceZone = typeof options.resourceZone === 'undefined' ? 'us-central1' : options.resourceZone;
@@ -97,9 +97,9 @@ Manager.prototype.init = function (exporter, options) {
97
97
  process.env.ENVIRONMENT = !process.env.ENVIRONMENT ? self.assistant.meta.environment : process.env.ENVIRONMENT;
98
98
 
99
99
  // Use the working Firebase logger that they disabled for whatever reason
100
- if (process.env.GCLOUD_PROJECT && self.assistant.meta.environment !== 'development' && options.useFirebaseLogger) {
101
- require('firebase-functions/lib/logger/compat');
102
- }
100
+ // if (process.env.GCLOUD_PROJECT && self.assistant.meta.environment !== 'development' && options.useFirebaseLogger) {
101
+ // require('firebase-functions/lib/logger/compat');
102
+ // }
103
103
 
104
104
  // Handle dev environments
105
105
  if (self.assistant.meta.environment === 'development') {
@@ -660,8 +660,8 @@ Manager.prototype.storage = function (options) {
660
660
  const low = require('lowdb');
661
661
  const FileSync = require('lowdb/adapters/FileSync');
662
662
  const dbPath = options.temporary
663
- ? `${require('os').tmpdir()}/${options.name}.json`
664
- : `./.data/${options.name}.json`;
663
+ ? `${require('os').tmpdir()}/storage/${options.name}.json`
664
+ : `./.data/storage/${options.name}.json`;
665
665
  const adapter = new FileSync(dbPath);
666
666
 
667
667
  if (