mirror of
https://github.com/whyour/qinglong.git
synced 2026-12-01 01:39:52 +08:00
Return committed trigger IDs and add CLI wait and trigger-specific logs while preserving API, CLI, transaction, deduplication and unknown-result semantics. Move scheduling, lifecycle, settlement, queries and legacy adapters into back/cron; remove obsolete internal import paths and circular dependencies. Apply project formatting across the repository, cover CJS/MJS in formatting hooks, add prettier:check and require formatting checks in AGENTS.md. Validation: backend build; 1398 backend/frontend tests passed (17 platform skips); 327 CLI tests passed (6 platform skips); 670 files pass format checks.
57 lines
1.8 KiB
JavaScript
57 lines
1.8 KiB
JavaScript
// Run from the panel root, including via stdin inside an offline release image.
|
|
const assert = require('node:assert/strict');
|
|
const fs = require('node:fs');
|
|
const path = require('node:path');
|
|
const { createRequire } = require('node:module');
|
|
const yaml = require('js-yaml');
|
|
|
|
assert.equal(
|
|
process.versions.node,
|
|
fs.readFileSync('.nvmrc', 'utf8').trim(),
|
|
'Node runtime differs from the production version',
|
|
);
|
|
|
|
const panelRequire = createRequire(path.resolve('package.json'));
|
|
const manifest = panelRequire('./package.json');
|
|
const lock = yaml.load(fs.readFileSync('pnpm-lock.yaml', 'utf8'));
|
|
|
|
function verifyDirect(name) {
|
|
const entry = lock.dependencies[name];
|
|
assert.equal(
|
|
entry?.specifier,
|
|
manifest.dependencies[name],
|
|
`${name}: manifest/lock mismatch`,
|
|
);
|
|
// pnpm appends peer resolution context, e.g. 6.37.8(@whyour/sqlite3@1.1.5).
|
|
assert.equal(
|
|
panelRequire(`${name}/package.json`).version,
|
|
entry.version.split('(')[0],
|
|
`${name}: installed/lock mismatch`,
|
|
);
|
|
return entry.version;
|
|
}
|
|
|
|
for (const name of ['@grpc/grpc-js', 'compression', 'multer', 'sequelize']) {
|
|
verifyDirect(name);
|
|
}
|
|
|
|
for (const [parent, name] of [
|
|
['express', 'proxy-addr'],
|
|
['sockjs', 'websocket-driver'],
|
|
]) {
|
|
const version = verifyDirect(parent);
|
|
const expected = lock.packages[`/${parent}@${version}`]?.dependencies?.[name];
|
|
assert.ok(expected, `${parent} > ${name}: missing lock entry`);
|
|
const parentRequire = createRequire(panelRequire.resolve(parent));
|
|
assert.equal(
|
|
parentRequire(`${name}/package.json`).version,
|
|
expected.split('(')[0],
|
|
`${parent} > ${name}: installed/lock mismatch`,
|
|
);
|
|
}
|
|
|
|
for (const name of ['sqlite3', 'nodemailer', 'undici']) panelRequire(name);
|
|
console.log(
|
|
'Production dependencies match the manifest and lockfile; runtime imports verified',
|
|
);
|