obsidian-plugin-config 1.5.4 → 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.4
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.4",
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",
@@ -344,7 +344,7 @@ function verifyPackage(): void {
344
344
  if (!versions[packageJson.version]) {
345
345
  const manifest = JSON.parse(fs.readFileSync('manifest.json', 'utf8'));
346
346
  versions[packageJson.version] = manifest.minAppVersion;
347
- fs.writeFileSync(versionsPath, JSON.stringify(versions, null, '\t'), 'utf8');
347
+ fs.writeFileSync(versionsPath, JSON.stringify(versions, null, ' '), 'utf8');
348
348
  console.log(` ✅ Added version ${packageJson.version} to versions.json`);
349
349
  } else {
350
350
  console.log(` ✅ Version ${packageJson.version} in versions.json`);
@@ -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
  }
@@ -40,7 +40,7 @@ async function updateJsonFile(
40
40
  try {
41
41
  const content = JSON.parse(await readFile(filename, 'utf8'));
42
42
  updateFn(content);
43
- await writeFile(filename, JSON.stringify(content, null, '\t'));
43
+ await writeFile(filename, JSON.stringify(content, null, ' '));
44
44
  } catch (error) {
45
45
  console.error(
46
46
  `Error updating ${filename}:`,
@@ -68,7 +68,7 @@ async function updateJsonFile(
68
68
  try {
69
69
  const content = JSON.parse(await readFile(filename, 'utf8'));
70
70
  updateFn(content);
71
- await writeFile(filename, JSON.stringify(content, null, '\t'));
71
+ await writeFile(filename, JSON.stringify(content, null, ' '));
72
72
  } catch (error) {
73
73
  console.error(
74
74
  `Error updating ${filename}:`,
package/versions.json CHANGED
@@ -1,56 +1,58 @@
1
1
  {
2
- "1.0.0": "1.8.9",
3
- "1.0.1": "1.8.9",
4
- "1.0.2": "1.8.9",
5
- "1.0.3": "1.8.9",
6
- "1.0.4": "1.8.9",
7
- "1.0.5": "1.8.9",
8
- "1.0.6": "1.8.9",
9
- "1.0.7": "1.8.9",
10
- "1.0.8": "1.8.9",
11
- "1.0.9": "1.8.9",
12
- "1.0.10": "1.8.9",
13
- "1.1.6": "1.8.9",
14
- "1.1.7": "1.8.9",
15
- "1.1.8": "1.8.9",
16
- "1.1.9": "1.8.9",
17
- "1.1.10": "1.8.9",
18
- "1.1.11": "1.8.9",
19
- "1.1.12": "1.8.9",
20
- "1.1.13": "1.8.9",
21
- "1.1.14": "1.8.9",
22
- "1.1.15": "1.8.9",
23
- "1.1.16": "1.8.9",
24
- "1.1.17": "1.8.9",
25
- "1.1.18": "1.8.9",
26
- "1.1.19": "1.8.9",
27
- "1.1.20": "1.8.9",
28
- "1.2.0": "1.8.9",
29
- "1.3.0": "1.8.9",
30
- "1.3.1": "1.8.9",
31
- "1.3.2": "1.8.9",
32
- "1.3.3": "1.8.9",
33
- "1.3.4": "1.8.9",
34
- "1.3.5": "1.8.9",
35
- "1.3.6": "1.8.9",
36
- "1.3.7": "1.8.9",
37
- "1.3.8": "1.8.9",
38
- "1.3.9": "1.8.9",
39
- "1.3.10": "1.8.9",
40
- "1.3.11": "1.8.9",
41
- "1.3.12": "1.8.9",
42
- "1.4.0": "1.8.9",
43
- "1.4.1": "1.8.9",
44
- "1.4.2": "1.8.9",
45
- "1.4.3": "1.8.9",
46
- "1.4.4": "1.8.9",
47
- "1.4.5": "1.8.9",
48
- "1.4.6": "1.8.9",
49
- "1.4.7": "1.8.9",
50
- "1.4.8": "1.8.9",
51
- "1.5.0": "1.8.9",
52
- "1.5.1": "1.8.9",
53
- "1.5.2": "1.8.9",
54
- "1.5.3": "1.8.9",
55
- "1.5.4": "1.8.9"
2
+ "1.0.0": "1.8.9",
3
+ "1.0.1": "1.8.9",
4
+ "1.0.2": "1.8.9",
5
+ "1.0.3": "1.8.9",
6
+ "1.0.4": "1.8.9",
7
+ "1.0.5": "1.8.9",
8
+ "1.0.6": "1.8.9",
9
+ "1.0.7": "1.8.9",
10
+ "1.0.8": "1.8.9",
11
+ "1.0.9": "1.8.9",
12
+ "1.0.10": "1.8.9",
13
+ "1.1.6": "1.8.9",
14
+ "1.1.7": "1.8.9",
15
+ "1.1.8": "1.8.9",
16
+ "1.1.9": "1.8.9",
17
+ "1.1.10": "1.8.9",
18
+ "1.1.11": "1.8.9",
19
+ "1.1.12": "1.8.9",
20
+ "1.1.13": "1.8.9",
21
+ "1.1.14": "1.8.9",
22
+ "1.1.15": "1.8.9",
23
+ "1.1.16": "1.8.9",
24
+ "1.1.17": "1.8.9",
25
+ "1.1.18": "1.8.9",
26
+ "1.1.19": "1.8.9",
27
+ "1.1.20": "1.8.9",
28
+ "1.2.0": "1.8.9",
29
+ "1.3.0": "1.8.9",
30
+ "1.3.1": "1.8.9",
31
+ "1.3.2": "1.8.9",
32
+ "1.3.3": "1.8.9",
33
+ "1.3.4": "1.8.9",
34
+ "1.3.5": "1.8.9",
35
+ "1.3.6": "1.8.9",
36
+ "1.3.7": "1.8.9",
37
+ "1.3.8": "1.8.9",
38
+ "1.3.9": "1.8.9",
39
+ "1.3.10": "1.8.9",
40
+ "1.3.11": "1.8.9",
41
+ "1.3.12": "1.8.9",
42
+ "1.4.0": "1.8.9",
43
+ "1.4.1": "1.8.9",
44
+ "1.4.2": "1.8.9",
45
+ "1.4.3": "1.8.9",
46
+ "1.4.4": "1.8.9",
47
+ "1.4.5": "1.8.9",
48
+ "1.4.6": "1.8.9",
49
+ "1.4.7": "1.8.9",
50
+ "1.4.8": "1.8.9",
51
+ "1.5.0": "1.8.9",
52
+ "1.5.1": "1.8.9",
53
+ "1.5.2": "1.8.9",
54
+ "1.5.3": "1.8.9",
55
+ "1.5.4": "1.8.9",
56
+ "1.5.5": "1.8.9",
57
+ "1.5.6": "1.8.9"
56
58
  }