obsidian-plugin-config 1.6.6 โ 1.6.7
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 +20 -0
- 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
|
@@ -780,6 +780,26 @@ export async function performInjection(
|
|
|
780
780
|
|
|
781
781
|
await runYarnInstall(targetPath);
|
|
782
782
|
|
|
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
|
+
|
|
783
803
|
console.log(`\n๐ Creating injection info...`);
|
|
784
804
|
await createInjectionInfo(targetPath);
|
|
785
805
|
|
|
@@ -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",
|