obsidian-plugin-config 1.0.5 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-plugin-config",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Système d'injection pour plugins Obsidian autonomes",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -129,6 +129,24 @@ function findPluginConfigRoot(): string {
129
129
  return parentPath;
130
130
  }
131
131
 
132
+ // Option 5: Check if we're running from NPM package (global installation)
133
+ // Get the directory of this script file
134
+ const scriptDir = path.dirname(new URL(import.meta.url).pathname);
135
+ const npmPackageRoot = path.resolve(scriptDir, "..");
136
+
137
+ // Check if we're in an NPM package structure
138
+ const npmPackageJson = path.join(npmPackageRoot, "package.json");
139
+ if (fs.existsSync(npmPackageJson)) {
140
+ try {
141
+ const packageContent = JSON.parse(fs.readFileSync(npmPackageJson, 'utf8'));
142
+ if (packageContent.name === "obsidian-plugin-config") {
143
+ return npmPackageRoot;
144
+ }
145
+ } catch (error) {
146
+ // Ignore parsing errors
147
+ }
148
+ }
149
+
132
150
  // Fallback to current directory (original behavior)
133
151
  return process.cwd();
134
152
  }
package/versions.json CHANGED
@@ -4,5 +4,6 @@
4
4
  "1.0.2": "1.8.9",
5
5
  "1.0.3": "1.8.9",
6
6
  "1.0.4": "1.8.9",
7
- "1.0.5": "1.8.9"
7
+ "1.0.5": "1.8.9",
8
+ "1.0.6": "1.8.9"
8
9
  }