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.
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Obsidian Plugin Config - CLI Entry Point
5
5
  * Global command: obsidian-inject
6
- * Version: 1.3.5
6
+ * Version: 1.3.7
7
7
  */
8
8
 
9
9
  import { execSync } from 'child_process';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-plugin-config",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "Système d'injection pour plugins Obsidian autonomes",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -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 with .template suffix are renamed by NPM
297
- // exclusion rules (.gitignore, .npmrc, .env)
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.ts",
9
- "./node_modules/obsidian-typings/dist/implementations.cjs"
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,
package/versions.json CHANGED
@@ -31,5 +31,7 @@
31
31
  "1.3.2": "1.8.9",
32
32
  "1.3.3": "1.8.9",
33
33
  "1.3.4": "1.8.9",
34
- "1.3.5": "1.8.9"
34
+ "1.3.5": "1.8.9",
35
+ "1.3.6": "1.8.9",
36
+ "1.3.7": "1.8.9"
35
37
  }