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 +19 -2
- package/bin/obsidian-inject.js +1 -1
- package/package.json +1 -1
- package/scripts/inject-core.ts +10 -22
- package/templates/.vscode/tasks.json +8 -0
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`,
|
package/bin/obsidian-inject.js
CHANGED
package/package.json
CHANGED
package/scripts/inject-core.ts
CHANGED
|
@@ -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
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
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",
|