obsidian-plugin-config 1.6.6 → 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.
package/README.md CHANGED
@@ -20,15 +20,24 @@ npm install -g obsidian-plugin-config@latest --force
20
20
  ## Usage (global CLI)
21
21
 
22
22
  ```bash
23
- # Inject in current plugin directory
23
+ # Inject in current plugin directory (with confirmation)
24
24
  obsidian-inject
25
25
 
26
- # Inject by path
26
+ # Inject by path (with confirmation)
27
27
  obsidian-inject ../my-plugin
28
28
 
29
+ # Inject without confirmation
30
+ obsidian-inject ../my-plugin --no
31
+
29
32
  # Inject with SASS support (adds esbuild-sass-plugin)
30
33
  obsidian-inject ../my-plugin --sass
31
34
 
35
+ # Interactive mode (choose what to inject)
36
+ obsidian-inject ../my-plugin --interactive
37
+
38
+ # Use preset
39
+ obsidian-inject ../my-plugin --preset=minimal
40
+
32
41
  # Verification only (no changes)
33
42
  obsidian-inject ../my-plugin --dry-run
34
43
 
@@ -36,6 +45,14 @@ obsidian-inject ../my-plugin --dry-run
36
45
  obsidian-inject --help
37
46
  ```
38
47
 
48
+ ## CLI Options
49
+
50
+ - `--no`, `-n` - Skip confirmation prompts (auto-confirm)
51
+ - `--sass` - Add SASS support (esbuild-sass-plugin)
52
+ - `--interactive`, `-i` - Choose what to inject interactively
53
+ - `--preset=<name>` - Use preset (minimal, scripts-only, config-only)
54
+ - `--dry-run` - Verification only (no changes)
55
+
39
56
  ## What is injected
40
57
 
41
58
  - ✅ **Standalone local scripts**: `esbuild.config.ts`, `acp.ts`,
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Obsidian Plugin Config - CLI Entry Point
5
5
  * Global command: obsidian-inject
6
- * Version: 1.6.6
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.6",
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
 
@@ -49,6 +49,14 @@
49
49
  "presentation": { "reveal": "always", "panel": "shared" },
50
50
  "problemMatcher": []
51
51
  },
52
+ {
53
+ "label": "Obsidian Inject (no confirm)",
54
+ "type": "shell",
55
+ "command": "obsidian-inject --no",
56
+ "group": "build",
57
+ "presentation": { "reveal": "always", "panel": "shared" },
58
+ "problemMatcher": []
59
+ },
52
60
  {
53
61
  "label": "Cleanup: Lint + Prettier + Build",
54
62
  "dependsOrder": "sequence",