@capacitor/cli 6.0.1-nightly-20240610T150502.0 → 6.1.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.
Binary file
Binary file
Binary file
package/dist/common.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseApkNameFromFlavor = exports.checkJDKMajorVersion = exports.resolvePlatform = exports.checkPlatformVersions = exports.getAddedPlatforms = exports.getPlatformTargetName = exports.promptForPlatformTarget = exports.promptForPlatform = exports.isValidEnterprisePlatform = exports.getKnownEnterprisePlatforms = exports.isValidCommunityPlatform = exports.getKnownCommunityPlatforms = exports.isValidPlatform = exports.getKnownPlatforms = exports.selectPlatforms = exports.getProjectPlatformDirectory = exports.getCLIVersion = exports.getCoreVersion = exports.getCapacitorPackageVersion = exports.requireCapacitorPackage = exports.getCapacitorPackage = exports.runTask = exports.runPlatformHook = exports.wait = exports.checkAppName = exports.checkAppId = exports.checkAppDir = exports.checkAppConfig = exports.checkCapacitorPlatform = exports.checkPackage = exports.checkWebDir = exports.check = void 0;
3
+ exports.parseApkNameFromFlavor = exports.checkJDKMajorVersion = exports.resolvePlatform = exports.checkPlatformVersions = exports.getAddedPlatforms = exports.getPlatformTargetName = exports.promptForPlatformTarget = exports.promptForPlatform = exports.isValidEnterprisePlatform = exports.getKnownEnterprisePlatforms = exports.isValidCommunityPlatform = exports.getKnownCommunityPlatforms = exports.isValidPlatform = exports.getKnownPlatforms = exports.selectPlatforms = exports.getProjectPlatformDirectory = exports.getCLIVersion = exports.getCoreVersion = exports.getCapacitorPackageVersion = exports.requireCapacitorPackage = exports.getCapacitorPackage = exports.runTask = exports.runPlatformHook = exports.runHooks = exports.wait = exports.checkAppName = exports.checkAppId = exports.checkAppDir = exports.checkAppConfig = exports.checkCapacitorPlatform = exports.checkPackage = exports.checkWebDir = exports.check = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const utils_fs_1 = require("@ionic/utils-fs");
6
6
  const utils_terminal_1 = require("@ionic/utils-terminal");
@@ -8,6 +8,7 @@ const path_1 = require("path");
8
8
  const colors_1 = tslib_1.__importDefault(require("./colors"));
9
9
  const errors_1 = require("./errors");
10
10
  const log_1 = require("./log");
11
+ const plugin_1 = require("./plugin");
11
12
  const monorepotools_1 = require("./util/monorepotools");
12
13
  const node_1 = require("./util/node");
13
14
  const subprocess_1 = require("./util/subprocess");
@@ -112,6 +113,14 @@ async function wait(time) {
112
113
  return new Promise(resolve => setTimeout(resolve, time));
113
114
  }
114
115
  exports.wait = wait;
116
+ async function runHooks(config, platformName, dir, hook) {
117
+ await runPlatformHook(config, platformName, dir, hook);
118
+ const allPlugins = await (0, plugin_1.getPlugins)(config, platformName);
119
+ allPlugins.forEach(async (p) => {
120
+ await runPlatformHook(config, platformName, p.rootPath, hook);
121
+ });
122
+ }
123
+ exports.runHooks = runHooks;
115
124
  async function runPlatformHook(config, platformName, platformDir, hook) {
116
125
  var _a;
117
126
  const { spawn } = await Promise.resolve().then(() => tslib_1.__importStar(require('child_process')));
@@ -47,7 +47,7 @@ async function copy(config, platformName, inline = false) {
47
47
  if (result) {
48
48
  throw result;
49
49
  }
50
- await (0, common_1.runPlatformHook)(config, platformName, config.app.rootDir, 'capacitor:copy:before');
50
+ await (0, common_1.runHooks)(config, platformName, config.app.rootDir, 'capacitor:copy:before');
51
51
  const allPlugins = await (0, plugin_1.getPlugins)(config, platformName);
52
52
  let usesFederatedCapacitor = false;
53
53
  if (allPlugins.filter(plugin => plugin.id === '@ionic-enterprise/federated-capacitor').length > 0) {
@@ -121,7 +121,7 @@ async function copy(config, platformName, inline = false) {
121
121
  await (0, sourcemaps_1.inlineSourceMaps)(config, platformName);
122
122
  }
123
123
  });
124
- await (0, common_1.runPlatformHook)(config, platformName, config.app.rootDir, 'capacitor:copy:after');
124
+ await (0, common_1.runHooks)(config, platformName, config.app.rootDir, 'capacitor:copy:after');
125
125
  }
126
126
  exports.copy = copy;
127
127
  async function copyCapacitorConfig(config, nativeAbsDir) {
@@ -46,7 +46,7 @@ async function syncCommand(config, selectedPlatformName, deployment, inline = fa
46
46
  exports.syncCommand = syncCommand;
47
47
  async function sync(config, platformName, deployment, inline = false) {
48
48
  var _a;
49
- await (0, common_1.runPlatformHook)(config, platformName, config.app.rootDir, 'capacitor:sync:before');
49
+ await (0, common_1.runHooks)(config, platformName, config.app.rootDir, 'capacitor:sync:before');
50
50
  try {
51
51
  await (0, copy_1.copy)(config, platformName, inline);
52
52
  }
@@ -54,6 +54,6 @@ async function sync(config, platformName, deployment, inline = false) {
54
54
  log_1.logger.error((_a = e.stack) !== null && _a !== void 0 ? _a : e);
55
55
  }
56
56
  await (0, update_1.update)(config, platformName, deployment);
57
- await (0, common_1.runPlatformHook)(config, platformName, config.app.rootDir, 'capacitor:sync:after');
57
+ await (0, common_1.runHooks)(config, platformName, config.app.rootDir, 'capacitor:sync:after');
58
58
  }
59
59
  exports.sync = sync;
@@ -61,14 +61,14 @@ function updateChecks(config, platforms) {
61
61
  exports.updateChecks = updateChecks;
62
62
  async function update(config, platformName, deployment) {
63
63
  await (0, common_1.runTask)(colors_1.default.success(colors_1.default.strong(`update ${platformName}`)), async () => {
64
- await (0, common_1.runPlatformHook)(config, platformName, config.app.rootDir, 'capacitor:update:before');
64
+ await (0, common_1.runHooks)(config, platformName, config.app.rootDir, 'capacitor:update:before');
65
65
  if (platformName === config.ios.name) {
66
66
  await (0, update_2.updateIOS)(config, deployment);
67
67
  }
68
68
  else if (platformName === config.android.name) {
69
69
  await (0, update_1.updateAndroid)(config);
70
70
  }
71
- await (0, common_1.runPlatformHook)(config, platformName, config.app.rootDir, 'capacitor:update:after');
71
+ await (0, common_1.runHooks)(config, platformName, config.app.rootDir, 'capacitor:update:after');
72
72
  });
73
73
  }
74
74
  exports.update = update;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/cli",
3
- "version": "6.0.1-nightly-20240610T150502.0",
3
+ "version": "6.1.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)",