@capacitor/cli 4.1.0 → 4.1.1-nightly-e4c143d4.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/LICENSE CHANGED
@@ -1,23 +1,21 @@
1
- Copyright 2017-present Ionic
2
- https://ionic.io
3
-
4
1
  MIT License
5
2
 
6
- Permission is hereby granted, free of charge, to any person obtaining
7
- a copy of this software and associated documentation files (the
8
- "Software"), to deal in the Software without restriction, including
9
- without limitation the rights to use, copy, modify, merge, publish,
10
- distribute, sublicense, and/or sell copies of the Software, and to
11
- permit persons to whom the Software is furnished to do so, subject to
12
- the following conditions:
3
+ Copyright (c) 2017-present Drifty Co.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
13
11
 
14
- The above copyright notice and this permission notice shall be
15
- included in all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
16
14
 
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
Binary file
Binary file
@@ -9,10 +9,11 @@ const common_1 = require("../common");
9
9
  const native_run_1 = require("../util/native-run");
10
10
  const subprocess_1 = require("../util/subprocess");
11
11
  const debug = debug_1.default('capacitor:android:run');
12
- async function runAndroid(config, { target: selectedTarget }) {
12
+ async function runAndroid(config, { target: selectedTarget, flavor: selectedFlavor }) {
13
13
  var _a;
14
14
  const target = await common_1.promptForPlatformTarget(await native_run_1.getPlatformTargets('android'), selectedTarget);
15
- const arg = `assemble${((_a = config.android) === null || _a === void 0 ? void 0 : _a.flavor) || ''}Debug`;
15
+ const runFlavor = selectedFlavor || ((_a = config.android) === null || _a === void 0 ? void 0 : _a.flavor) || '';
16
+ const arg = `assemble${runFlavor}Debug`;
16
17
  const gradleArgs = [arg];
17
18
  debug('Invoking ./gradlew with args: %O', gradleArgs);
18
19
  try {
@@ -476,6 +476,7 @@ export interface LiveUpdateConfig {
476
476
  channel: string;
477
477
  autoUpdateMethod: AutoUpdateMethod;
478
478
  maxVersions?: number;
479
+ key?: string;
479
480
  }
480
481
  export declare type AutoUpdateMethod = 'none' | 'background';
481
482
  export interface PluginsConfig {
@@ -496,4 +497,10 @@ export interface PluginsConfig {
496
497
  shell: Portal;
497
498
  apps: Portal[];
498
499
  };
500
+ /**
501
+ * Capacitor Live Updates plugin configuration
502
+ *
503
+ * @since 4.2.0
504
+ */
505
+ LiveUpdates?: LiveUpdateConfig;
499
506
  }
package/dist/index.js CHANGED
@@ -88,14 +88,22 @@ function runProgram(config) {
88
88
  commander_1.program
89
89
  .command(`run [platform]`)
90
90
  .description(`runs ${colors_1.default.input('sync')}, then builds and deploys the native app`)
91
+ .option('--scheme <schemeName>', 'set the scheme of the iOS project')
92
+ .option('--flavor <flavorName>', 'set the flavor of the Android project')
91
93
  .option('--list', 'list targets, then quit')
92
94
  // TODO: remove once --json is a hidden option (https://github.com/tj/commander.js/issues/1106)
93
95
  .allowUnknownOption(true)
94
96
  .option('--target <id>', 'use a specific target')
95
97
  .option('--no-sync', `do not run ${colors_1.default.input('sync')}`)
96
- .action(cli_1.wrapAction(telemetry_1.telemetryAction(config, async (platform, { list, target, sync }) => {
98
+ .action(cli_1.wrapAction(telemetry_1.telemetryAction(config, async (platform, { scheme, flavor, list, target, sync }) => {
97
99
  const { runCommand } = await Promise.resolve().then(() => tslib_1.__importStar(require('./tasks/run')));
98
- await runCommand(config, platform, { list, target, sync });
100
+ await runCommand(config, platform, {
101
+ scheme,
102
+ flavor,
103
+ list,
104
+ target,
105
+ sync,
106
+ });
99
107
  })));
100
108
  commander_1.program
101
109
  .command('open [platform]')
@@ -16,7 +16,7 @@ exports.checkIOSPackage = checkIOSPackage;
16
16
  async function checkCocoaPods(config) {
17
17
  if (!(await subprocess_1.isInstalled(config.ios.podPath)) && config.cli.os === "mac" /* Mac */) {
18
18
  return (`CocoaPods is not installed.\n` +
19
- `See this install guide: ${colors_1.default.strong('https://guides.cocoapods.org/using/getting-started.html#installation')}`);
19
+ `See this install guide: ${colors_1.default.strong('https://capacitorjs.com/docs/getting-started/environment-setup#homebrew')}`);
20
20
  }
21
21
  return null;
22
22
  }
package/dist/ios/run.js CHANGED
@@ -9,14 +9,15 @@ const common_1 = require("../common");
9
9
  const native_run_1 = require("../util/native-run");
10
10
  const subprocess_1 = require("../util/subprocess");
11
11
  const debug = debug_1.default('capacitor:ios:run');
12
- async function runIOS(config, { target: selectedTarget }) {
12
+ async function runIOS(config, { target: selectedTarget, scheme: selectedScheme }) {
13
13
  const target = await common_1.promptForPlatformTarget(await native_run_1.getPlatformTargets('ios'), selectedTarget);
14
+ const runScheme = selectedScheme || config.ios.scheme;
14
15
  const derivedDataPath = path_1.resolve(config.ios.platformDirAbs, 'DerivedData', target.id);
15
16
  const xcodebuildArgs = [
16
17
  '-workspace',
17
18
  path_1.basename(await config.ios.nativeXcodeWorkspaceDirAbs),
18
19
  '-scheme',
19
- config.ios.scheme,
20
+ runScheme,
20
21
  '-configuration',
21
22
  'Debug',
22
23
  '-destination',
@@ -28,7 +29,7 @@ async function runIOS(config, { target: selectedTarget }) {
28
29
  await common_1.runTask('Running xcodebuild', async () => subprocess_1.runCommand('xcrun', ['xcodebuild', ...xcodebuildArgs], {
29
30
  cwd: config.ios.nativeProjectDirAbs,
30
31
  }));
31
- const appName = `${config.ios.scheme}.app`;
32
+ const appName = `${runScheme}.app`;
32
33
  const appPath = path_1.resolve(derivedDataPath, 'Build/Products', target.virtual ? 'Debug-iphonesimulator' : 'Debug-iphoneos', appName);
33
34
  const nativeRunArgs = ['ios', '--app', appPath, '--target', target.id];
34
35
  debug('Invoking native-run with args: %O', nativeRunArgs);
@@ -49,6 +49,11 @@ async function copy(config, platformName) {
49
49
  if (allPlugins.filter(plugin => plugin.id === '@ionic-enterprise/capacitor-portals').length > 0) {
50
50
  usesCapacitorPortals = true;
51
51
  }
52
+ let usesLiveUpdates = false;
53
+ if (allPlugins.filter(plugin => plugin.id === '@capacitor/live-updates')
54
+ .length > 0) {
55
+ usesLiveUpdates = true;
56
+ }
52
57
  if (platformName === config.ios.name) {
53
58
  if (usesCapacitorPortals) {
54
59
  await copyFederatedWebDirs(config, await config.ios.webDirAbs);
@@ -56,6 +61,9 @@ async function copy(config, platformName) {
56
61
  else {
57
62
  await copyWebDir(config, await config.ios.webDirAbs, config.app.webDirAbs);
58
63
  }
64
+ if (usesLiveUpdates) {
65
+ await copySecureLiveUpdatesKey(config, config.ios.nativeTargetDirAbs);
66
+ }
59
67
  await copyCapacitorConfig(config, config.ios.nativeTargetDirAbs);
60
68
  const cordovaPlugins = await cordova_1.getCordovaPlugins(config, platformName);
61
69
  await cordova_1.handleCordovaPluginsJS(cordovaPlugins, config, platformName);
@@ -67,6 +75,9 @@ async function copy(config, platformName) {
67
75
  else {
68
76
  await copyWebDir(config, config.android.webDirAbs, config.app.webDirAbs);
69
77
  }
78
+ if (usesLiveUpdates) {
79
+ await copySecureLiveUpdatesKey(config, config.android.assetsDirAbs);
80
+ }
70
81
  await copyCapacitorConfig(config, config.android.assetsDirAbs);
71
82
  const cordovaPlugins = await cordova_1.getCordovaPlugins(config, platformName);
72
83
  await cordova_1.handleCordovaPluginsJS(cordovaPlugins, config, platformName);
@@ -133,3 +144,21 @@ function isPortal(config) {
133
144
  return (config.webDir !== undefined &&
134
145
  config.name !== undefined);
135
146
  }
147
+ async function copySecureLiveUpdatesKey(config, nativeAbsDir) {
148
+ var _a, _b, _c;
149
+ if (!((_c = (_b = (_a = config.app.extConfig) === null || _a === void 0 ? void 0 : _a.plugins) === null || _b === void 0 ? void 0 : _b.LiveUpdates) === null || _c === void 0 ? void 0 : _c.key)) {
150
+ return;
151
+ }
152
+ const secureLiveUpdatesKeyFile = config.app.extConfig.plugins.LiveUpdates.key;
153
+ const keyAbsFromPath = path_1.join(config.app.rootDir, secureLiveUpdatesKeyFile);
154
+ const keyAbsToPath = path_1.join(nativeAbsDir, path_1.basename(keyAbsFromPath));
155
+ const keyRelToDir = path_1.relative(config.app.rootDir, nativeAbsDir);
156
+ if (!(await utils_fs_1.pathExists(keyAbsFromPath))) {
157
+ log_1.logger.warn(`Cannot copy Secure Live Updates signature file from ${colors_1.default.strong(keyAbsFromPath)} to ${keyRelToDir}\n` +
158
+ `Signature file does not exist at specified key path.`);
159
+ return;
160
+ }
161
+ await common_1.runTask(`Copying Secure Live Updates key from ${colors_1.default.strong(secureLiveUpdatesKeyFile)} to ${keyRelToDir}`, async () => {
162
+ return utils_fs_1.copy(keyAbsFromPath, keyAbsToPath);
163
+ });
164
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/cli",
3
- "version": "4.1.0",
3
+ "version": "4.1.1-nightly-e4c143d4.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)",
@@ -83,5 +83,5 @@
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
86
- "gitHead": "0b5c2b740e9613512a100051b8822fd1361f4aeb"
86
+ "gitHead": "e4c143d4da653533570215964808c2f32f5469d3"
87
87
  }