obsidian-plugin-config 1.5.3 → 1.5.4

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.
@@ -106,6 +106,14 @@
106
106
  "presentation": { "reveal": "always", "panel": "shared" },
107
107
  "problemMatcher": []
108
108
  },
109
+ {
110
+ "label": "Install/Update obsidian-inject",
111
+ "type": "shell",
112
+ "command": "npm list -g obsidian-plugin-config --depth=0 && npm install -g obsidian-plugin-config@latest --force --engine-strict=false && npm list -g obsidian-plugin-config --depth=0",
113
+ "group": "build",
114
+ "presentation": { "reveal": "always", "panel": "shared" },
115
+ "problemMatcher": []
116
+ },
109
117
  {
110
118
  "label": "Cleanup: Lint + Prettier + Build",
111
119
  "dependsOrder": "sequence",
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Obsidian Plugin Config - CLI Entry Point
5
5
  * Global command: obsidian-inject
6
- * Version: 1.5.3
6
+ * Version: 1.5.4
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.5.3",
3
+ "version": "1.5.4",
4
4
  "description": "Système d'injection pour plugins Obsidian autonomes",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -78,8 +78,8 @@ async function doNextSteps(message: string, tag: string): Promise<void> {
78
78
  await ensureGitSync();
79
79
 
80
80
  execSync('git push');
81
- } catch (error: any) {
82
- console.error('Error:', error.message);
81
+ } catch (error: unknown) {
82
+ console.error('Error:', error instanceof Error ? error.message : String(error));
83
83
  }
84
84
  try {
85
85
  execSync(`git tag -a ${tag} ${tagMessage}`);
@@ -63,7 +63,7 @@ async function getTargetVersion(currentVersion: string): Promise<string> {
63
63
 
64
64
  async function updateJsonFile(
65
65
  filename: string,
66
- updateFn: (json: any) => void
66
+ updateFn: (json: Record<string, unknown>) => void
67
67
  ): Promise<void> {
68
68
  try {
69
69
  const content = JSON.parse(await readFile(filename, 'utf8'));
@@ -79,17 +79,21 @@ export async function copyFilesToTargetDir(buildPath: string): Promise<void> {
79
79
 
80
80
  try {
81
81
  await mkdir(buildPath, { recursive: true });
82
- } catch (error: any) {
83
- if (error.code !== 'EEXIST') {
84
- console.error(`Error creating directory: ${error.message}`);
82
+ } catch (error: unknown) {
83
+ if ((error as NodeJS.ErrnoException).code !== 'EEXIST') {
84
+ console.error(
85
+ `Error creating directory: ${error instanceof Error ? error.message : String(error)}`
86
+ );
85
87
  }
86
88
  }
87
89
 
88
90
  // Copy manifest
89
91
  try {
90
92
  await copyFile(manifestSrc, manifestDest);
91
- } catch (error: any) {
92
- console.error(`Error copying manifest: ${error.message}`);
93
+ } catch (error: unknown) {
94
+ console.error(
95
+ `Error copying manifest: ${error instanceof Error ? error.message : String(error)}`
96
+ );
93
97
  }
94
98
 
95
99
  // Copy CSS
@@ -110,16 +114,21 @@ export async function copyFilesToTargetDir(buildPath: string): Promise<void> {
110
114
  } else {
111
115
  return;
112
116
  }
113
- } catch (error: any) {
114
- console.error(`Error copying CSS: ${error.message}`);
117
+ } catch (error: unknown) {
118
+ console.error(
119
+ `Error copying CSS: ${error instanceof Error ? error.message : String(error)}`
120
+ );
115
121
  }
116
122
  }
117
123
 
118
124
  export function gitExec(command: string): void {
119
125
  try {
120
126
  execSync(command, { stdio: 'inherit' });
121
- } catch (error: any) {
122
- console.error(`Error executing '${command}':`, error.message);
127
+ } catch (error: unknown) {
128
+ console.error(
129
+ `Error executing '${command}':`,
130
+ error instanceof Error ? error.message : String(error)
131
+ );
123
132
  throw error;
124
133
  }
125
134
  }
@@ -144,8 +153,10 @@ export async function ensureGitSync(): Promise<void> {
144
153
  } else {
145
154
  console.log('✅ Repository is synchronized with remote');
146
155
  }
147
- } catch (error: any) {
148
- console.error(`❌ Git sync failed: ${error.message}`);
156
+ } catch (error: unknown) {
157
+ console.error(
158
+ `❌ Git sync failed: ${error instanceof Error ? error.message : String(error)}`
159
+ );
149
160
  throw error;
150
161
  }
151
162
  }
@@ -158,9 +169,11 @@ export async function removeMainCss(outdir: string): Promise<void> {
158
169
  const mainCssPath = path.join(outdir, 'main.css');
159
170
  try {
160
171
  await rm(mainCssPath);
161
- } catch (error: any) {
162
- if (error.code !== 'ENOENT') {
163
- console.warn(`Warning: Could not remove main.css: ${error.message}`);
172
+ } catch (error: unknown) {
173
+ if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {
174
+ console.warn(
175
+ `Warning: Could not remove main.css: ${error instanceof Error ? error.message : String(error)}`
176
+ );
164
177
  }
165
178
  }
166
179
  }
package/versions.json CHANGED
@@ -51,5 +51,6 @@
51
51
  "1.5.0": "1.8.9",
52
52
  "1.5.1": "1.8.9",
53
53
  "1.5.2": "1.8.9",
54
- "1.5.3": "1.8.9"
54
+ "1.5.3": "1.8.9",
55
+ "1.5.4": "1.8.9"
55
56
  }