@intrig/core 0.0.15-17 → 0.0.15-18

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.
Files changed (2) hide show
  1. package/main.js +45 -10
  2. package/package.json +1 -1
package/main.js CHANGED
@@ -19109,17 +19109,52 @@ class InitCommand extends src.CommandRunner {
19109
19109
  cwd: rootDir,
19110
19110
  stdio: 'pipe'
19111
19111
  });
19112
- installSpinner.text = `Installing @intrig/core as dev dependency...`;
19113
- // Install @intrig/core as a dev dependency
19114
- execSync('npm install --save-dev @intrig/core', {
19115
- cwd: rootDir,
19116
- stdio: 'pipe'
19117
- });
19118
- installSpinner.succeed(`Plugin ${plugin.name} and @intrig/core installed successfully`);
19112
+ installSpinner.succeed(`Plugin ${plugin.name} installed successfully`);
19119
19113
  } catch (npmError) {
19120
- installSpinner.fail(`Failed to install plugin ${plugin.name}`);
19121
- console.log(source_default().red('❌ Error:'), npmError?.message);
19122
- throw new Error(`Failed to install plugin ${plugin.name}: ${npmError?.message}`);
19114
+ const errorMessage = npmError?.stderr?.toString() || npmError?.message || '';
19115
+ // Check if this is a peer dependency conflict (ERESOLVE error)
19116
+ if (errorMessage.includes('ERESOLVE') || errorMessage.includes('--legacy-peer-deps')) {
19117
+ installSpinner.warn(`Peer dependency conflict detected while installing ${plugin.name}`);
19118
+ console.log(source_default().yellow('\n⚠️ This is usually caused by conflicting package versions in your project.'));
19119
+ console.log(source_default().yellow(' Using --legacy-peer-deps may resolve this, but could cause runtime issues.\n'));
19120
+ let shouldRetry = skipPrompts; // Auto-accept if --yes flag is set
19121
+ if (!skipPrompts) {
19122
+ const { confirmRetry } = await inquirer_dist_esm.prompt([
19123
+ {
19124
+ type: 'confirm',
19125
+ name: 'confirmRetry',
19126
+ message: 'Retry with --legacy-peer-deps?',
19127
+ default: false
19128
+ }
19129
+ ]);
19130
+ shouldRetry = confirmRetry;
19131
+ } else {
19132
+ console.log(source_default().blue('ℹ️ --yes flag set, automatically retrying with --legacy-peer-deps'));
19133
+ }
19134
+ if (shouldRetry) {
19135
+ const retrySpinner = ora_default()(`Retrying installation with --legacy-peer-deps...`).start();
19136
+ try {
19137
+ execSync(`npm install --save-dev ${plugin.name} --legacy-peer-deps`, {
19138
+ cwd: rootDir,
19139
+ stdio: 'pipe'
19140
+ });
19141
+ retrySpinner.succeed(`Plugin ${plugin.name} installed successfully (with --legacy-peer-deps)`);
19142
+ console.log(source_default().yellow('⚠️ Note: Installed with --legacy-peer-deps. Verify your application works correctly.'));
19143
+ } catch (retryError) {
19144
+ retrySpinner.fail(`Failed to install plugin ${plugin.name} even with --legacy-peer-deps`);
19145
+ throw new Error(`Failed to install plugin ${plugin.name}: ${retryError?.message}`);
19146
+ }
19147
+ } else {
19148
+ console.log(source_default().blue('\nℹ️ Installation cancelled. To resolve manually:'));
19149
+ console.log(source_default().blue(' 1. Fix the conflicting dependencies in your project, or'));
19150
+ console.log(source_default().blue(` 2. Run: npm install --save-dev ${plugin.name} --legacy-peer-deps\n`));
19151
+ throw new Error(`Installation cancelled due to peer dependency conflict`);
19152
+ }
19153
+ } else {
19154
+ installSpinner.fail(`Failed to install plugin ${plugin.name}`);
19155
+ console.log(source_default().red('❌ Error:'), npmError?.message);
19156
+ throw new Error(`Failed to install plugin ${plugin.name}: ${npmError?.message}`);
19157
+ }
19123
19158
  }
19124
19159
  // Now use createRequire to load the plugin
19125
19160
  const loadSpinner = ora_default()(`Loading and initializing plugin: ${plugin.name}`).start();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intrig/core",
3
- "version": "0.0.15-17",
3
+ "version": "0.0.15-18",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {