cordova-plugin-firebasex-firestore 2.0.4 → 2.0.5

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
@@ -1,3 +1,7 @@
1
+ # Version 2.0.5
2
+ - (ios) fix: apply `IOS_FIREBASE_SDK_VERSION` to both installed and generated Swift package manifests.
3
+ - Resolves https://github.com/dpa99c/cordova-plugin-firebasex/issues/977
4
+
1
5
  # Version 2.0.4
2
6
  feat: add `runTransactionOnFirestoreDocument` to atomically compare field conditions on an existing document and apply field-path updates when all conditions match.
3
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-firebasex-firestore",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "Firestore module for cordova-plugin-firebasex",
5
5
  "cordova": {
6
6
  "id": "cordova-plugin-firebasex-firestore",
package/plugin.xml CHANGED
@@ -1,6 +1,6 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
2
  <plugin id="cordova-plugin-firebasex-firestore"
3
- version="2.0.4"
3
+ version="2.0.5"
4
4
  xmlns="http://apache.org/cordova/ns/plugins/1.0"
5
5
  xmlns:android="http://schemas.android.com/apk/res/android">
6
6
 
@@ -105,11 +105,19 @@ function resolvePluginVariables(context) {
105
105
  function getPackageSwiftPaths(context) {
106
106
  var paths = [
107
107
  path.resolve(__dirname, "..", "..", "Package.swift"),
108
- path.join(context.opts.projectRoot, "plugins", PLUGIN_ID, "Package.swift")
108
+ path.join(context.opts.projectRoot, "plugins", PLUGIN_ID, "Package.swift"),
109
+ path.join(context.opts.projectRoot, "platforms", "ios", "packages", PLUGIN_ID, "Package.swift")
109
110
  ];
110
111
 
111
- return paths.filter(function(packageSwiftPath, index) {
112
- return fs.existsSync(packageSwiftPath) && paths.indexOf(packageSwiftPath) === index;
112
+ var seen = {};
113
+ return paths.filter(function(packageSwiftPath) {
114
+ if (seen[packageSwiftPath]) return false;
115
+ seen[packageSwiftPath] = true;
116
+ if (!fs.existsSync(packageSwiftPath)) {
117
+ console.warn("[FirebasexFirestore] Package.swift not found at " + packageSwiftPath + ". Cannot update the Firebase SDK version in this copy.");
118
+ return false;
119
+ }
120
+ return true;
113
121
  });
114
122
  }
115
123
 
@@ -150,6 +158,7 @@ module.exports = function(context) {
150
158
  var result = rewritePackageSwiftValue(packageSwiftContents, "firebaseSDKVersion", pluginVariables["IOS_FIREBASE_SDK_VERSION"]);
151
159
  if (result.modified) {
152
160
  fs.writeFileSync(packageSwiftPath, result.contents);
161
+ console.log("[FirebasexFirestore] Updated Swift package manifest at " + packageSwiftPath);
153
162
  }
154
163
  });
155
164
  return;