mirror of
https://github.com/fancive/obsidian-parallel-reader.git
synced 2026-07-22 06:53:43 +00:00
chore: check build artifact consistency
Change-Id: I485ee9ef2eaf584a1c1fcf890ee85fb82a34a8fb
This commit is contained in:
parent
70f9a39cd7
commit
2364e62911
2 changed files with 20 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
|||
"main": "main.js",
|
||||
"scripts": {
|
||||
"build": "node esbuild.config.mjs production",
|
||||
"check:build-artifacts": "node scripts/check-build-artifacts.mjs",
|
||||
"dev": "node esbuild.config.mjs watch",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"lint": "biome check main.ts src/",
|
||||
|
|
|
|||
19
scripts/check-build-artifacts.mjs
Normal file
19
scripts/check-build-artifacts.mjs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { execFileSync } from 'node:child_process';
|
||||
|
||||
function diffMainJs() {
|
||||
return execFileSync('git', ['diff', '--', 'main.js'], { encoding: 'utf8' });
|
||||
}
|
||||
|
||||
const before = diffMainJs();
|
||||
|
||||
execFileSync('npm', ['run', 'build'], { stdio: 'inherit' });
|
||||
|
||||
const after = diffMainJs();
|
||||
|
||||
if (after !== before) {
|
||||
console.error('\nmain.js is not in sync with the TypeScript source.');
|
||||
console.error('Run `npm run build` and include the updated main.js in the same change.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log('main.js is in sync with the TypeScript source.');
|
||||
Loading…
Reference in a new issue