obsidian-plugin-config 1.3.7 β 1.3.8
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/bin/obsidian-inject.js +1 -1
- package/package.json +1 -1
- package/scripts/build-npm.ts +39 -20
- package/versions.json +2 -1
package/bin/obsidian-inject.js
CHANGED
package/package.json
CHANGED
package/scripts/build-npm.ts
CHANGED
|
@@ -199,44 +199,63 @@ main();
|
|
|
199
199
|
*/
|
|
200
200
|
function buildAndPublishNpm(): void {
|
|
201
201
|
console.log(`π Obsidian Plugin Config - Complete NPM Workflow`);
|
|
202
|
-
console.log(
|
|
202
|
+
console.log(
|
|
203
|
+
`Full automation: version β exports β bin β commit β publish\n`
|
|
204
|
+
);
|
|
203
205
|
|
|
204
206
|
try {
|
|
205
|
-
// Step 1: Update version
|
|
207
|
+
// Step 1: Update version in package.json only
|
|
208
|
+
// (no commit yet - we'll do one big commit after)
|
|
206
209
|
console.log(`π Step 1/6: Updating version...`);
|
|
207
|
-
execSync('tsx scripts/update-version-config.ts', {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
console.log(`\nπ€ Step 2/6: Committing and pushing changes...`);
|
|
211
|
-
try {
|
|
212
|
-
execSync('echo "Prepare NPM package publication" | tsx scripts/acp.ts -b', { stdio: 'inherit' });
|
|
213
|
-
} catch {
|
|
214
|
-
console.log(` βΉοΈ No additional changes to commit`);
|
|
215
|
-
}
|
|
210
|
+
execSync('tsx scripts/update-version-config.ts', {
|
|
211
|
+
stdio: 'inherit'
|
|
212
|
+
});
|
|
216
213
|
|
|
217
|
-
// Step
|
|
218
|
-
console.log(`\nπ¦ Step
|
|
214
|
+
// Step 2: Update exports automatically
|
|
215
|
+
console.log(`\nπ¦ Step 2/6: Updating exports...`);
|
|
219
216
|
execSync('yarn update-exports', { stdio: 'inherit' });
|
|
220
217
|
|
|
221
|
-
// Step
|
|
222
|
-
console.log(`\nπ§ Step
|
|
218
|
+
// Step 3: Generate bin file (uses updated version)
|
|
219
|
+
console.log(`\nπ§ Step 3/6: Generating bin/obsidian-inject.js...`);
|
|
223
220
|
generateBinFile();
|
|
224
221
|
|
|
225
|
-
// Step
|
|
226
|
-
|
|
222
|
+
// Step 4: Verify package and sync versions.json
|
|
223
|
+
// (must happen before commit so versions.json is included)
|
|
224
|
+
console.log(`\nπ Step 4/6: Verifying package...`);
|
|
227
225
|
verifyPackage();
|
|
228
226
|
|
|
227
|
+
// Step 5: Commit and push ALL changes together
|
|
228
|
+
// (package.json version, bin/, versions.json, exports)
|
|
229
|
+
console.log(`\nπ€ Step 5/6: Committing and pushing changes...`);
|
|
230
|
+
try {
|
|
231
|
+
execSync(
|
|
232
|
+
'echo "Publish NPM package" | tsx scripts/acp.ts -b',
|
|
233
|
+
{ stdio: 'inherit' }
|
|
234
|
+
);
|
|
235
|
+
} catch {
|
|
236
|
+
console.log(` βΉοΈ No additional changes to commit`);
|
|
237
|
+
}
|
|
238
|
+
|
|
229
239
|
// Step 6: Publish to NPM
|
|
230
240
|
console.log(`\nπ€ Step 6/6: Publishing to NPM...`);
|
|
231
|
-
execSync(
|
|
241
|
+
execSync(
|
|
242
|
+
'npm publish --registry https://registry.npmjs.org/',
|
|
243
|
+
{ stdio: 'inherit' }
|
|
244
|
+
);
|
|
232
245
|
|
|
233
246
|
console.log(`\nπ Complete workflow successful!`);
|
|
234
247
|
console.log(`\nπ Next steps:`);
|
|
235
248
|
console.log(` 1. npm install -g obsidian-plugin-config`);
|
|
236
|
-
console.log(
|
|
249
|
+
console.log(
|
|
250
|
+
` 2. Test injection: cd any-plugin && obsidian-inject`
|
|
251
|
+
);
|
|
237
252
|
|
|
238
253
|
} catch (error) {
|
|
239
|
-
console.error(
|
|
254
|
+
console.error(
|
|
255
|
+
`\nβ Workflow failed: ${
|
|
256
|
+
error instanceof Error ? error.message : String(error)
|
|
257
|
+
}`
|
|
258
|
+
);
|
|
240
259
|
process.exit(1);
|
|
241
260
|
}
|
|
242
261
|
}
|