obsidian-plugin-config 1.6.1 β 1.6.3
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/bin/obsidian-inject.js +1 -1
- package/package.json +1 -1
- package/scripts/build-npm.ts +12 -8
- package/scripts/inject-core.ts +28 -6
package/bin/obsidian-inject.js
CHANGED
package/package.json
CHANGED
package/scripts/build-npm.ts
CHANGED
|
@@ -290,14 +290,18 @@ async function buildAndPublishNpm(): Promise<void> {
|
|
|
290
290
|
|
|
291
291
|
// Optional: Update global CLI automatically
|
|
292
292
|
console.log(`\nπ Updating global CLI...`);
|
|
293
|
-
console.log(` β³ Waiting
|
|
294
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
293
|
+
console.log(` β³ Waiting 30s for NPM registry propagation...`);
|
|
294
|
+
await new Promise((resolve) => setTimeout(resolve, 30000));
|
|
295
|
+
try {
|
|
296
|
+
execSync(
|
|
297
|
+
'npm install -g obsidian-plugin-config@latest --force --engine-strict=false',
|
|
298
|
+
{ stdio: 'inherit' }
|
|
299
|
+
);
|
|
300
|
+
console.log(` β
Global CLI updated`);
|
|
301
|
+
} catch {
|
|
302
|
+
console.log(` β οΈ Global CLI update failed (NPM registry may need more time)`);
|
|
303
|
+
console.log(` π‘ Run manually in a few minutes: npm install -g obsidian-plugin-config@latest --force`);
|
|
304
|
+
}
|
|
301
305
|
console.log(`\nπ Complete workflow successful!`);
|
|
302
306
|
console.log(` Test: cd any-plugin && obsidian-inject`);
|
|
303
307
|
} catch (error) {
|
package/scripts/inject-core.ts
CHANGED
|
@@ -670,15 +670,37 @@ export async function cleanNpmArtifactsIfNeeded(targetPath: string): Promise<voi
|
|
|
670
670
|
}
|
|
671
671
|
|
|
672
672
|
if (fs.existsSync(nodeModulesPath)) {
|
|
673
|
+
console.log(` β³ Removing node_modules (this may take a moment)...`);
|
|
673
674
|
try {
|
|
674
|
-
|
|
675
|
+
// Try standard rmdir first
|
|
676
|
+
execSync(`rmdir /s /q "${nodeModulesPath}"`, {
|
|
677
|
+
stdio: 'pipe',
|
|
678
|
+
windowsHide: true
|
|
679
|
+
});
|
|
680
|
+
console.log(
|
|
681
|
+
` ποΈ Removed node_modules (will be reinstalled with Yarn)`
|
|
682
|
+
);
|
|
675
683
|
} catch {
|
|
676
|
-
//
|
|
677
|
-
|
|
684
|
+
// If locked, rename it and let yarn install create a fresh one
|
|
685
|
+
try {
|
|
686
|
+
const timestamp = Date.now();
|
|
687
|
+
const oldPath = `${nodeModulesPath}.old.${timestamp}`;
|
|
688
|
+
fs.renameSync(nodeModulesPath, oldPath);
|
|
689
|
+
console.log(
|
|
690
|
+
` π Renamed locked node_modules to ${path.basename(oldPath)}`
|
|
691
|
+
);
|
|
692
|
+
console.log(
|
|
693
|
+
` π‘ You can delete it manually later when processes are closed`
|
|
694
|
+
);
|
|
695
|
+
} catch {
|
|
696
|
+
console.log(
|
|
697
|
+
` β οΈ Could not remove node_modules (files locked by running processes)`
|
|
698
|
+
);
|
|
699
|
+
console.log(
|
|
700
|
+
` π‘ Yarn will update it anyway, but close processes for clean install`
|
|
701
|
+
);
|
|
702
|
+
}
|
|
678
703
|
}
|
|
679
|
-
console.log(
|
|
680
|
-
` ποΈ Removed node_modules (will be reinstalled with Yarn)`
|
|
681
|
-
);
|
|
682
704
|
}
|
|
683
705
|
|
|
684
706
|
console.log(` β
Lock files and artifacts cleaned for fresh install`);
|