obsidian-plugin-config 1.3.5 → 1.3.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/bin/obsidian-inject.js +1 -1
- package/package.json +1 -1
- package/scripts/inject-core.ts +16 -3
- package/tsconfig.json +2 -2
- package/versions.json +3 -1
package/bin/obsidian-inject.js
CHANGED
package/package.json
CHANGED
package/scripts/inject-core.ts
CHANGED
|
@@ -293,8 +293,11 @@ export async function injectScripts(targetPath: string, useSass: boolean = false
|
|
|
293
293
|
"templates/scripts/help.ts"
|
|
294
294
|
];
|
|
295
295
|
|
|
296
|
-
// Files
|
|
297
|
-
//
|
|
296
|
+
// Files that should NOT be overwritten if they
|
|
297
|
+
// already exist (contain user-specific config)
|
|
298
|
+
const skipIfExists = new Set([".env"]);
|
|
299
|
+
|
|
300
|
+
// Files with .template suffix (NPM excludes dotfiles)
|
|
298
301
|
// Map: { source: targetName }
|
|
299
302
|
const configFileMap: Record<string, string> = {
|
|
300
303
|
"templates/tsconfig.json": "tsconfig.json",
|
|
@@ -339,10 +342,20 @@ export async function injectScripts(targetPath: string, useSass: boolean = false
|
|
|
339
342
|
configFileMap
|
|
340
343
|
)) {
|
|
341
344
|
try {
|
|
342
|
-
const content = copyFromLocal(src);
|
|
343
345
|
const targetFile = path.join(
|
|
344
346
|
targetPath, destName
|
|
345
347
|
);
|
|
348
|
+
// Skip if file exists and is user-specific
|
|
349
|
+
if (
|
|
350
|
+
skipIfExists.has(destName) &&
|
|
351
|
+
fs.existsSync(targetFile)
|
|
352
|
+
) {
|
|
353
|
+
console.log(
|
|
354
|
+
` ⏭️ ${destName} (kept existing)`
|
|
355
|
+
);
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
const content = copyFromLocal(src);
|
|
346
359
|
fs.writeFileSync(targetFile, content, "utf8");
|
|
347
360
|
console.log(` ✅ ${destName}`);
|
|
348
361
|
} catch (error) {
|
package/tsconfig.json
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
],
|
|
6
6
|
"paths": {
|
|
7
7
|
"obsidian-typings/implementations": [
|
|
8
|
-
"./node_modules/obsidian-typings/dist/implementations.d.
|
|
9
|
-
"./node_modules/obsidian-typings/dist/implementations.
|
|
8
|
+
"./node_modules/obsidian-typings/dist/cjs/implementations.d.cts",
|
|
9
|
+
"./node_modules/obsidian-typings/dist/esm/implementations.mjs"
|
|
10
10
|
]
|
|
11
11
|
},
|
|
12
12
|
"inlineSourceMap": true,
|