obsidian-plugin-config 1.6.7 โ†’ 1.6.8

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.6.7
6
+ * Version: 1.6.8
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.6.7",
3
+ "version": "1.6.8",
4
4
  "description": "Global CLI injection tool for Obsidian plugins",
5
5
  "type": "module",
6
6
  "bin": {
@@ -661,28 +661,16 @@ export async function cleanNpmArtifactsIfNeeded(targetPath: string): Promise<voi
661
661
  try {
662
662
  // Remove node_modules FIRST (before lock files)
663
663
  if (fs.existsSync(nodeModulesPath)) {
664
- console.log(` โณ Removing node_modules (this may take a moment)...`);
665
-
666
- execSync(`rmdir /s /q "${nodeModulesPath}"`, {
667
- stdio: 'pipe',
668
- windowsHide: true
669
- });
670
-
671
- if (fs.existsSync(nodeModulesPath)) {
672
- // rmdir failed silently (locked .exe files) - rename instead
673
- const timestamp = Date.now();
674
- const oldPath = `${nodeModulesPath}.old.${timestamp}`;
675
- try {
676
- fs.renameSync(nodeModulesPath, oldPath);
677
- console.log(` ๐Ÿ”„ Renamed locked node_modules to ${path.basename(oldPath)}`);
678
- console.log(` ๐Ÿ’ก Delete it manually later: ${oldPath}`);
679
- } catch {
680
- console.log(` โš ๏ธ Could not remove/rename node_modules (locked by processes)`);
681
- console.log(` ๐Ÿ’ก Close Obsidian/VSCode and run: obsidian-inject again`);
682
- throw new Error('node_modules locked - close processes and retry');
683
- }
684
- } else {
685
- console.log(` ๐Ÿ—‘๏ธ Removed node_modules (will be reinstalled with Yarn)`);
664
+ const timestamp = Date.now();
665
+ const oldPath = `${nodeModulesPath}.old.${timestamp}`;
666
+ try {
667
+ fs.renameSync(nodeModulesPath, oldPath);
668
+ console.log(` ๐Ÿ”„ Renamed node_modules to ${path.basename(oldPath)}`);
669
+ console.log(` ๐Ÿ’ก Delete it manually later: ${oldPath}`);
670
+ } catch {
671
+ console.log(` โš ๏ธ Could not rename node_modules (locked by processes)`);
672
+ console.log(` ๐Ÿ’ก Close Obsidian/VSCode and run: obsidian-inject again`);
673
+ throw new Error('node_modules locked - close processes and retry');
686
674
  }
687
675
  }
688
676
 
@@ -780,26 +768,6 @@ export async function performInjection(
780
768
 
781
769
  await runYarnInstall(targetPath);
782
770
 
783
- // Clean up old node_modules if yarn install succeeded
784
- const oldDirs = fs.readdirSync(targetPath)
785
- .filter(name => name.startsWith('node_modules.old.'))
786
- .map(name => path.join(targetPath, name));
787
-
788
- if (oldDirs.length > 0) {
789
- console.log(`\n๐Ÿงน Cleaning up old node_modules...`);
790
- for (const oldDir of oldDirs) {
791
- try {
792
- execSync(`rmdir /s /q "${oldDir}"`, {
793
- stdio: 'pipe',
794
- windowsHide: true
795
- });
796
- console.log(` ๐Ÿ—‘๏ธ Removed ${path.basename(oldDir)}`);
797
- } catch {
798
- console.log(` โš ๏ธ Could not remove ${path.basename(oldDir)} (delete manually)`);
799
- }
800
- }
801
- }
802
-
803
771
  console.log(`\n๐Ÿ“ Creating injection info...`);
804
772
  await createInjectionInfo(targetPath);
805
773