| 1 | import assert from 'node:assert/strict'; |
| 2 | import fs from 'node:fs'; |
| 3 | import path from 'node:path'; |
| 4 | import { fileURLToPath } from 'node:url'; |
| 5 | const root=fileURLToPath(new URL('../',import.meta.url)); |
| 6 | const version=fs.readFileSync(path.join(root,'VERSION'),'utf8').trim(); |
| 7 | assert.match(version,/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/); |
| 8 | for(const directory of ['ui','www']){ |
| 9 | const pkg=JSON.parse(fs.readFileSync(path.join(root,directory,'package.json'),'utf8')); |
| 10 | const lock=JSON.parse(fs.readFileSync(path.join(root,directory,'package-lock.json'),'utf8')); |
| 11 | for(const actual of [pkg.version,lock.version,lock.packages[''].version]) assert.equal(actual,version,`${directory}: version differs from VERSION`); |
| 12 | } |
| 13 | console.log(`Application package versions match VERSION: ${version}`); |