@capacitor/cli 5.0.0-beta.0 → 5.0.0-beta.1

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
package/dist/index.js CHANGED
@@ -182,10 +182,12 @@ function runProgram(config) {
182
182
  }));
183
183
  commander_1.program
184
184
  .command('migrate')
185
+ .option('--noprompt', 'do not prompt for confirmation')
186
+ .option('--packagemanager <packageManager>', 'The package manager to use for dependency installs (npm, pnpm, yarn)')
185
187
  .description('Migrate your current Capacitor app to the latest major version of Capacitor.')
186
- .action((0, cli_1.wrapAction)(async () => {
188
+ .action((0, cli_1.wrapAction)(async ({ noprompt, packagemanager }) => {
187
189
  const { migrateCommand } = await Promise.resolve().then(() => tslib_1.__importStar(require('./tasks/migrate')));
188
- await migrateCommand(config);
190
+ await migrateCommand(config, noprompt, packagemanager);
189
191
  }));
190
192
  commander_1.program.arguments('[command]').action((0, cli_1.wrapAction)(async (cmd) => {
191
193
  if (typeof cmd === 'undefined') {
@@ -50,7 +50,7 @@ const plugins = [
50
50
  const coreVersion = 'next'; // TODO: Update when Capacitor 5 releases
51
51
  const pluginVersion = 'next'; // TODO: Update when Capacitor 5 releases
52
52
  const gradleVersion = '7.5';
53
- async function migrateCommand(config) {
53
+ async function migrateCommand(config, noprompt, packagemanager) {
54
54
  if (config === null) {
55
55
  (0, errors_1.fatal)('Config data missing');
56
56
  }
@@ -69,36 +69,42 @@ async function migrateCommand(config) {
69
69
  };
70
70
  const monorepoWarning = 'Please note this tool is not intended for use in a mono-repo enviroment, please check out the Ionic vscode extension for this functionality.';
71
71
  log_1.logger.info(monorepoWarning);
72
- const { migrateconfirm } = await (0, log_1.logPrompt)(`Capacitor 5 sets a deployment target of iOS 13 and Android 13 (SDK 33). \n`, {
73
- type: 'text',
74
- name: 'migrateconfirm',
75
- message: `Are you sure you want to migrate? (Y/n)`,
76
- initial: 'y',
77
- });
72
+ const { migrateconfirm } = noprompt
73
+ ? { migrateconfirm: 'y' }
74
+ : await (0, log_1.logPrompt)(`Capacitor 5 sets a deployment target of iOS 13 and Android 13 (SDK 33). \n`, {
75
+ type: 'text',
76
+ name: 'migrateconfirm',
77
+ message: `Are you sure you want to migrate? (Y/n)`,
78
+ initial: 'y',
79
+ });
78
80
  if (typeof migrateconfirm === 'string' &&
79
81
  migrateconfirm.toLowerCase() === 'y') {
80
82
  try {
81
- const { depInstallConfirm } = await (0, log_1.logPrompt)(`Would you like the migrator to run npm, yarn, or pnpm install to install the latest versions of capacitor packages? (Those using other package managers should answer N)`, {
82
- type: 'text',
83
- name: 'depInstallConfirm',
84
- message: `Run Dependency Install? (Y/n)`,
85
- initial: 'y',
86
- });
83
+ const { depInstallConfirm } = noprompt
84
+ ? { depInstallConfirm: 'y' }
85
+ : await (0, log_1.logPrompt)(`Would you like the migrator to run npm, yarn, or pnpm install to install the latest versions of capacitor packages? (Those using other package managers should answer N)`, {
86
+ type: 'text',
87
+ name: 'depInstallConfirm',
88
+ message: `Run Dependency Install? (Y/n)`,
89
+ initial: 'y',
90
+ });
87
91
  const runNpmInstall = typeof depInstallConfirm === 'string' &&
88
92
  depInstallConfirm.toLowerCase() === 'y';
89
93
  let installerType = 'npm';
90
94
  if (runNpmInstall) {
91
- const { manager } = await (0, log_1.logPrompt)('What dependency manager do you use?', {
92
- type: 'select',
93
- name: 'manager',
94
- message: `Dependency Management Tool`,
95
- choices: [
96
- { title: 'NPM', value: 'npm' },
97
- { title: 'Yarn', value: 'yarn' },
98
- { title: 'PNPM', value: 'pnpm' },
99
- ],
100
- initial: 0,
101
- });
95
+ const { manager } = packagemanager
96
+ ? { manager: packagemanager }
97
+ : await (0, log_1.logPrompt)('What dependency manager do you use?', {
98
+ type: 'select',
99
+ name: 'manager',
100
+ message: `Dependency Management Tool`,
101
+ choices: [
102
+ { title: 'NPM', value: 'npm' },
103
+ { title: 'Yarn', value: 'yarn' },
104
+ { title: 'PNPM', value: 'pnpm' },
105
+ ],
106
+ initial: 0,
107
+ });
102
108
  installerType = manager;
103
109
  }
104
110
  try {
@@ -240,6 +246,12 @@ async function installLatestLibs(dependencyManager, runInstall, config) {
240
246
  if (runInstall) {
241
247
  rimraf_1.default.sync((0, path_1.join)(config.app.rootDir, 'node_modules/@capacitor/!(cli)'));
242
248
  await (0, subprocess_1.runCommand)(dependencyManager, ['install']);
249
+ if (dependencyManager == 'yarn') {
250
+ await (0, subprocess_1.runCommand)(dependencyManager, ['upgrade']);
251
+ }
252
+ else {
253
+ await (0, subprocess_1.runCommand)(dependencyManager, ['update']);
254
+ }
243
255
  }
244
256
  else {
245
257
  log_1.logger.info(`Please run an install command with your package manager of choice. (ex: yarn install)`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/cli",
3
- "version": "5.0.0-beta.0",
3
+ "version": "5.0.0-beta.1",
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)",
@@ -85,5 +85,5 @@
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "gitHead": "51a548b97129998de8c403b2a8eb0421135af812"
88
+ "gitHead": "354ffd2062b1c20951bdc9539d99e6c37f54675e"
89
89
  }