obsidian-plugin-config 1.3.12 → 1.4.0

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.
@@ -90,6 +90,14 @@
90
90
  "presentation": { "reveal": "always", "panel": "shared" },
91
91
  "problemMatcher": []
92
92
  },
93
+ {
94
+ "label": "Upgrade All (yarn upgrade + sync templates)",
95
+ "type": "shell",
96
+ "command": "yarn upgrade-all",
97
+ "group": "build",
98
+ "presentation": { "reveal": "always", "panel": "shared" },
99
+ "problemMatcher": []
100
+ },
93
101
  {
94
102
  "label": "NPM Publish",
95
103
  "type": "shell",
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Obsidian Plugin Config - CLI Entry Point
5
5
  * Global command: obsidian-inject
6
- * Version: 1.3.12
6
+ * Version: 1.4.0
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.12",
3
+ "version": "1.4.0",
4
4
  "description": "Système d'injection pour plugins Obsidian autonomes",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -36,7 +36,8 @@
36
36
  "inject-prompt": "tsx scripts/inject-prompt.ts",
37
37
  "inject": "tsx scripts/inject-prompt.ts",
38
38
  "check-plugin": "tsx scripts/inject-path.ts --dry-run",
39
- "build-npm": "tsx scripts/build-npm.ts",
39
+ "sync-template-deps": "tsx scripts/sync-template-deps.ts",
40
+ "upgrade-all": "yarn upgrade && tsx scripts/sync-template-deps.ts",
40
41
  "npm-publish": "tsx scripts/build-npm.ts",
41
42
  "help": "tsx scripts/help.ts",
42
43
  "h": "tsx scripts/help.ts"
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env tsx
2
+
3
+ import fs from "fs";
4
+ import path from "path";
5
+
6
+ const TEMPLATES_PKG = "templates/package.json";
7
+ const TEMPLATES_SASS = "templates/package-sass.json";
8
+
9
+ function resolvedVersion(dep: string): string | null {
10
+ const pkgPath = path.join("node_modules", dep, "package.json");
11
+ if (!fs.existsSync(pkgPath)) return null;
12
+ try {
13
+ return JSON.parse(fs.readFileSync(pkgPath, "utf8")).version as string;
14
+ } catch {
15
+ return null;
16
+ }
17
+ }
18
+
19
+ function updateDeps(deps: Record<string, string>): { updated: string[] } {
20
+ const updated: string[] = [];
21
+
22
+ for (const dep of Object.keys(deps)) {
23
+ const current = deps[dep];
24
+ // Skip wildcards like "*"
25
+ if (current === "*") continue;
26
+
27
+ const resolved = resolvedVersion(dep);
28
+ if (!resolved) continue;
29
+
30
+ // Keep "latest" as-is, update pinned/range versions
31
+ if (current !== "latest") {
32
+ const newVersion = `^${resolved}`;
33
+ if (deps[dep] !== newVersion) {
34
+ deps[dep] = newVersion;
35
+ updated.push(`${dep}: ${current} → ${newVersion}`);
36
+ }
37
+ }
38
+ }
39
+
40
+ return { updated };
41
+ }
42
+
43
+ function syncFile(filePath: string): void {
44
+ const pkg = JSON.parse(fs.readFileSync(filePath, "utf8"));
45
+ const { updated } = updateDeps(pkg.devDependencies ?? {});
46
+
47
+ if (updated.length) {
48
+ fs.writeFileSync(filePath, JSON.stringify(pkg, null, 2) + "\n", "utf8");
49
+ console.log(`\n✅ ${filePath}`);
50
+ for (const u of updated) console.log(` ${u}`);
51
+ } else {
52
+ console.log(`\n✅ ${filePath} — already up to date`);
53
+ }
54
+ }
55
+
56
+ console.log("🔄 Syncing template deps from node_modules...");
57
+ syncFile(TEMPLATES_PKG);
58
+ syncFile(TEMPLATES_SASS);
59
+ console.log("\n✅ Done.");
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "devDependencies": {
3
- "esbuild-sass-plugin": "^3.3.1"
3
+ "esbuild-sass-plugin": "latest"
4
4
  }
5
5
  }
@@ -22,22 +22,22 @@
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/eslint": "latest",
25
- "@types/node": "^22.15.26",
26
- "@types/semver": "^7.7.0",
25
+ "@types/node": "latest",
26
+ "@types/semver": "latest",
27
27
  "@typescript-eslint/eslint-plugin": "latest",
28
28
  "@typescript-eslint/parser": "latest",
29
- "builtin-modules": "3.3.0",
30
- "dedent": "^1.6.0",
31
- "dotenv": "^16.4.5",
29
+ "builtin-modules": "latest",
30
+ "dedent": "latest",
31
+ "dotenv": "latest",
32
32
  "esbuild": "latest",
33
33
  "eslint": "latest",
34
34
  "eslint-import-resolver-typescript": "latest",
35
35
  "jiti": "latest",
36
36
  "obsidian": "*",
37
37
  "obsidian-typings": "latest",
38
- "prettier": "^3.4.0",
39
- "semver": "^7.7.2",
40
- "tsx": "^4.19.4",
41
- "typescript": "^5.8.2"
38
+ "prettier": "latest",
39
+ "semver": "latest",
40
+ "tsx": "latest",
41
+ "typescript": "latest"
42
42
  }
43
43
  }
package/versions.json CHANGED
@@ -38,5 +38,6 @@
38
38
  "1.3.9": "1.8.9",
39
39
  "1.3.10": "1.8.9",
40
40
  "1.3.11": "1.8.9",
41
- "1.3.12": "1.8.9"
41
+ "1.3.12": "1.8.9",
42
+ "1.4.0": "1.8.9"
42
43
  }