obsidian-plugin-config 1.6.8 โ 1.6.10
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 +13 -0
- package/bin/obsidian-inject.js +1 -1
- package/package.json +1 -1
- package/scripts/inject-core.ts +35 -10
package/README.md
CHANGED
|
@@ -139,6 +139,19 @@ yarn build # Production build
|
|
|
139
139
|
yarn real # Build to production vault
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
+
### VSCode Tasks (Ctrl+Shift+P โ "Run Task")
|
|
143
|
+
|
|
144
|
+
After injection, VSCode tasks are available for quick access:
|
|
145
|
+
|
|
146
|
+
- **Build** - Production build
|
|
147
|
+
- **Lint** / **Lint: Fix** - ESLint check/fix
|
|
148
|
+
- **Prettier: Check** / **Prettier: Fix** - Format check/fix
|
|
149
|
+
- **Obsidian Inject** - Re-inject configuration (with confirmation)
|
|
150
|
+
- **Obsidian Inject (no confirm)** - Re-inject without confirmation
|
|
151
|
+
- **Cleanup: Lint + Prettier + Build** - Full cleanup sequence
|
|
152
|
+
|
|
153
|
+
๐ก **Tip**: Use `Ctrl+Shift+B` (Windows/Linux) or `Cmd+Shift+B` (Mac) for the default Build task.
|
|
154
|
+
|
|
142
155
|
### Version & Release
|
|
143
156
|
|
|
144
157
|
```bash
|
package/bin/obsidian-inject.js
CHANGED
package/package.json
CHANGED
package/scripts/inject-core.ts
CHANGED
|
@@ -661,16 +661,28 @@ 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
|
-
|
|
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)`);
|
|
674
686
|
}
|
|
675
687
|
}
|
|
676
688
|
|
|
@@ -779,6 +791,19 @@ export async function performInjection(
|
|
|
779
791
|
console.log(
|
|
780
792
|
` 4. yarn acp # Commit changes (or yarn bacp for build+commit)`
|
|
781
793
|
);
|
|
794
|
+
|
|
795
|
+
// Check for .old directories and remind user to delete them
|
|
796
|
+
const oldDirs = fs.readdirSync(targetPath)
|
|
797
|
+
.filter(name => name.startsWith('node_modules.old.'))
|
|
798
|
+
.map(name => path.basename(name));
|
|
799
|
+
|
|
800
|
+
if (oldDirs.length > 0) {
|
|
801
|
+
console.log(`\n๐งน Cleanup reminder:`);
|
|
802
|
+
for (const oldDir of oldDirs) {
|
|
803
|
+
console.log(` ๐๏ธ Delete manually: ${oldDir}`);
|
|
804
|
+
}
|
|
805
|
+
console.log(` ๐ก Close all processes first, then delete these folders`);
|
|
806
|
+
}
|
|
782
807
|
} catch (error) {
|
|
783
808
|
console.error(`\nโ Injection failed: ${error}`);
|
|
784
809
|
throw error;
|