obsidian-plugin-config 1.5.5 โ†’ 1.5.6

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.
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Obsidian Plugin Config - CLI Entry Point
5
5
  * Global command: obsidian-inject
6
- * Version: 1.5.5
6
+ * Version: 1.5.6
7
7
  */
8
8
 
9
9
  import { execSync } from 'child_process';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-plugin-config",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "description": "Systรจme d'injection pour plugins Obsidian autonomes",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -608,19 +608,30 @@ export function readInjectionInfo(targetPath: string): Record<string, string> |
608
608
  }
609
609
 
610
610
  /**
611
- * Clean NPM artifacts if package-lock.json is found
611
+ * Clean NPM/Yarn lock files and node_modules to ensure fresh install
612
612
  */
613
613
  export async function cleanNpmArtifactsIfNeeded(targetPath: string): Promise<void> {
614
614
  const packageLockPath = path.join(targetPath, 'package-lock.json');
615
+ const yarnLockPath = path.join(targetPath, 'yarn.lock');
616
+ const nodeModulesPath = path.join(targetPath, 'node_modules');
615
617
 
616
- if (fs.existsSync(packageLockPath)) {
617
- console.log(`\n๐Ÿงน NPM installation detected, cleaning artifacts...`);
618
+ const hasPackageLock = fs.existsSync(packageLockPath);
619
+ const hasYarnLock = fs.existsSync(yarnLockPath);
620
+
621
+ if (hasPackageLock || hasYarnLock) {
622
+ console.log(`\n๐Ÿงน Cleaning lock files and node_modules...`);
618
623
 
619
624
  try {
620
- fs.unlinkSync(packageLockPath);
621
- console.log(` ๐Ÿ—‘๏ธ Removed package-lock.json`);
625
+ if (hasPackageLock) {
626
+ fs.unlinkSync(packageLockPath);
627
+ console.log(` ๐Ÿ—‘๏ธ Removed package-lock.json`);
628
+ }
629
+
630
+ if (hasYarnLock) {
631
+ fs.unlinkSync(yarnLockPath);
632
+ console.log(` ๐Ÿ—‘๏ธ Removed yarn.lock`);
633
+ }
622
634
 
623
- const nodeModulesPath = path.join(targetPath, 'node_modules');
624
635
  if (fs.existsSync(nodeModulesPath)) {
625
636
  fs.rmSync(nodeModulesPath, { recursive: true, force: true });
626
637
  console.log(
@@ -628,11 +639,11 @@ export async function cleanNpmArtifactsIfNeeded(targetPath: string): Promise<voi
628
639
  );
629
640
  }
630
641
 
631
- console.log(` โœ… NPM artifacts cleaned to avoid Yarn conflicts`);
642
+ console.log(` โœ… Lock files and artifacts cleaned for fresh install`);
632
643
  } catch (error) {
633
- console.error(` โŒ Failed to clean NPM artifacts: ${error}`);
644
+ console.error(` โŒ Failed to clean artifacts: ${error}`);
634
645
  console.log(
635
- ` ๐Ÿ’ก You may need to manually remove package-lock.json and node_modules`
646
+ ` ๐Ÿ’ก You may need to manually remove package-lock.json, yarn.lock and node_modules`
636
647
  );
637
648
  }
638
649
  }
package/versions.json CHANGED
@@ -53,5 +53,6 @@
53
53
  "1.5.2": "1.8.9",
54
54
  "1.5.3": "1.8.9",
55
55
  "1.5.4": "1.8.9",
56
- "1.5.5": "1.8.9"
56
+ "1.5.5": "1.8.9",
57
+ "1.5.6": "1.8.9"
57
58
  }