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.
package/.vscode/tasks.json
CHANGED
|
@@ -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",
|
package/bin/obsidian-inject.js
CHANGED
package/package.json
CHANGED
|
@@ -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:
|
|
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:
|
|
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:
|
|
83
|
-
if (error.code !== 'EEXIST') {
|
|
84
|
-
console.error(
|
|
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:
|
|
92
|
-
console.error(
|
|
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:
|
|
114
|
-
console.error(
|
|
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:
|
|
122
|
-
console.error(
|
|
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:
|
|
148
|
-
console.error(
|
|
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:
|
|
162
|
-
if (error.code !== 'ENOENT') {
|
|
163
|
-
console.warn(
|
|
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
|
}
|