@capacitor/cli 3.7.0 → 3.9.0

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
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.9.0](https://github.com/ionic-team/capacitor/compare/3.8.0...3.9.0) (2022-10-21)
7
+
8
+
9
+ ### Features
10
+
11
+ * **cli:** backports secure live updates support with portals for capacitor to 3.x ([#5988](https://github.com/ionic-team/capacitor/issues/5988)) ([8146cd2](https://github.com/ionic-team/capacitor/commit/8146cd23456b0737680f47ca0a1859c8a979077c)), closes [#5896](https://github.com/ionic-team/capacitor/issues/5896) [#5955](https://github.com/ionic-team/capacitor/issues/5955)
12
+
13
+
14
+
15
+
16
+
17
+ # [3.8.0](https://github.com/ionic-team/capacitor/compare/3.7.0...3.8.0) (2022-09-08)
18
+
19
+ **Note:** Version bump only for package @capacitor/cli
20
+
21
+
22
+
23
+
24
+
6
25
  # [3.7.0](https://github.com/ionic-team/capacitor/compare/3.6.0...3.7.0) (2022-08-01)
7
26
 
8
27
  **Note:** Version bump only for package @capacitor/cli
Binary file
Binary file
@@ -449,6 +449,7 @@ export interface LiveUpdateConfig {
449
449
  channel: string;
450
450
  autoUpdateMethod: AutoUpdateMethod;
451
451
  maxVersions?: number;
452
+ key?: string;
452
453
  }
453
454
  export declare type AutoUpdateMethod = 'none' | 'background';
454
455
  export interface PluginsConfig {
@@ -468,5 +469,12 @@ export interface PluginsConfig {
468
469
  Portals?: {
469
470
  shell: Portal;
470
471
  apps: Portal[];
472
+ liveUpdatesKey?: string;
471
473
  };
474
+ /**
475
+ * Capacitor Live Updates plugin configuration
476
+ *
477
+ * @since 4.2.0
478
+ */
479
+ LiveUpdates?: LiveUpdateConfig;
472
480
  }
@@ -39,6 +39,7 @@ async function copyCommand(config, selectedPlatformName) {
39
39
  exports.copyCommand = copyCommand;
40
40
  async function copy(config, platformName) {
41
41
  await common_1.runTask(colors_1.default.success(colors_1.default.strong(`copy ${platformName}`)), async () => {
42
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
42
43
  const result = await common_1.checkWebDir(config);
43
44
  if (result) {
44
45
  throw result;
@@ -49,13 +50,24 @@ async function copy(config, platformName) {
49
50
  if (allPlugins.filter(plugin => plugin.id === '@ionic-enterprise/capacitor-portals').length > 0) {
50
51
  usesCapacitorPortals = true;
51
52
  }
53
+ let usesLiveUpdates = false;
54
+ if (allPlugins.filter(plugin => plugin.id === '@capacitor/live-updates')
55
+ .length > 0) {
56
+ usesLiveUpdates = true;
57
+ }
52
58
  if (platformName === config.ios.name) {
53
59
  if (usesCapacitorPortals) {
54
60
  await copyFederatedWebDirs(config, await config.ios.webDirAbs);
61
+ if ((_c = (_b = (_a = config.app.extConfig) === null || _a === void 0 ? void 0 : _a.plugins) === null || _b === void 0 ? void 0 : _b.Portals) === null || _c === void 0 ? void 0 : _c.liveUpdatesKey) {
62
+ await copySecureLiveUpdatesKey(config.app.extConfig.plugins.Portals.liveUpdatesKey, config.app.rootDir, config.ios.nativeTargetDirAbs);
63
+ }
55
64
  }
56
65
  else {
57
66
  await copyWebDir(config, await config.ios.webDirAbs, config.app.webDirAbs);
58
67
  }
68
+ if (usesLiveUpdates && ((_f = (_e = (_d = config.app.extConfig) === null || _d === void 0 ? void 0 : _d.plugins) === null || _e === void 0 ? void 0 : _e.LiveUpdates) === null || _f === void 0 ? void 0 : _f.key)) {
69
+ await copySecureLiveUpdatesKey(config.app.extConfig.plugins.LiveUpdates.key, config.app.rootDir, config.ios.nativeTargetDirAbs);
70
+ }
59
71
  await copyCapacitorConfig(config, config.ios.nativeTargetDirAbs);
60
72
  const cordovaPlugins = await cordova_1.getCordovaPlugins(config, platformName);
61
73
  await cordova_1.handleCordovaPluginsJS(cordovaPlugins, config, platformName);
@@ -63,10 +75,16 @@ async function copy(config, platformName) {
63
75
  else if (platformName === config.android.name) {
64
76
  if (usesCapacitorPortals) {
65
77
  await copyFederatedWebDirs(config, config.android.webDirAbs);
78
+ if ((_j = (_h = (_g = config.app.extConfig) === null || _g === void 0 ? void 0 : _g.plugins) === null || _h === void 0 ? void 0 : _h.Portals) === null || _j === void 0 ? void 0 : _j.liveUpdatesKey) {
79
+ await copySecureLiveUpdatesKey(config.app.extConfig.plugins.Portals.liveUpdatesKey, config.app.rootDir, config.android.assetsDirAbs);
80
+ }
66
81
  }
67
82
  else {
68
83
  await copyWebDir(config, config.android.webDirAbs, config.app.webDirAbs);
69
84
  }
85
+ if (usesLiveUpdates && ((_m = (_l = (_k = config.app.extConfig) === null || _k === void 0 ? void 0 : _k.plugins) === null || _l === void 0 ? void 0 : _l.LiveUpdates) === null || _m === void 0 ? void 0 : _m.key)) {
86
+ await copySecureLiveUpdatesKey(config.app.extConfig.plugins.LiveUpdates.key, config.app.rootDir, config.android.assetsDirAbs);
87
+ }
70
88
  await copyCapacitorConfig(config, config.android.assetsDirAbs);
71
89
  const cordovaPlugins = await cordova_1.getCordovaPlugins(config, platformName);
72
90
  await cordova_1.handleCordovaPluginsJS(cordovaPlugins, config, platformName);
@@ -133,3 +151,16 @@ function isPortal(config) {
133
151
  return (config.webDir !== undefined &&
134
152
  config.name !== undefined);
135
153
  }
154
+ async function copySecureLiveUpdatesKey(secureLiveUpdatesKeyFile, rootDir, nativeAbsDir) {
155
+ const keyAbsFromPath = path_1.join(rootDir, secureLiveUpdatesKeyFile);
156
+ const keyAbsToPath = path_1.join(nativeAbsDir, path_1.basename(keyAbsFromPath));
157
+ const keyRelToDir = path_1.relative(rootDir, nativeAbsDir);
158
+ if (!(await utils_fs_1.pathExists(keyAbsFromPath))) {
159
+ log_1.logger.warn(`Cannot copy Secure Live Updates signature file from ${colors_1.default.strong(keyAbsFromPath)} to ${keyRelToDir}\n` +
160
+ `Signature file does not exist at specified key path.`);
161
+ return;
162
+ }
163
+ await common_1.runTask(`Copying Secure Live Updates key from ${colors_1.default.strong(secureLiveUpdatesKeyFile)} to ${keyRelToDir}`, async () => {
164
+ return utils_fs_1.copy(keyAbsFromPath, keyAbsToPath);
165
+ });
166
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/cli",
3
- "version": "3.7.0",
3
+ "version": "3.9.0",
4
4
  "description": "Capacitor: Cross-platform apps with JavaScript and the web",
5
5
  "homepage": "https://capacitorjs.com",
6
6
  "author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
@@ -70,7 +70,7 @@
70
70
  "@types/prompts": "^2.0.8",
71
71
  "@types/semver": "^7.3.1",
72
72
  "@types/slice-ansi": "^4.0.0",
73
- "@types/tar": "^4.0.4",
73
+ "@types/tar": "^6.1.2",
74
74
  "@types/tmp": "^0.2.0",
75
75
  "@types/xml2js": "0.4.5",
76
76
  "jest": "^26.1.0",
@@ -85,5 +85,5 @@
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "gitHead": "84ec6619623510e345b2637e33febe94b10cc736"
88
+ "gitHead": "70a7e72b7461acd5b9bdc89fc9e0232ae8597005"
89
89
  }