mirror of
https://github.com/whyour/qinglong.git
synced 2026-11-02 15:56:59 +08:00
feat: ship verified platform upgrades with channel bundle releases
Package production dependencies per architecture for online and offline upgrades. Validate dependencies and isolated backend startup before readiness, repair once when permitted, and preserve service/data through failed preparation or rollback. Publish release bundles with master images and expose an opt-in develop build sharing the development index across Alpine and Debian images.
This commit is contained in:
@@ -23,6 +23,9 @@ function fixture() {
|
||||
let invalidations = 0;
|
||||
const module = { exports: {} };
|
||||
const localRequire = createRequire(path.resolve('back/app.ts'));
|
||||
const middlewareRequire = createRequire(
|
||||
path.resolve('back/loaders/httpApplication.ts'),
|
||||
);
|
||||
const mocks = {
|
||||
'./config': { cors: { origin: ['http://localhost'] } },
|
||||
'./loaders/logger': { error() {}, warn() {}, info() {} },
|
||||
@@ -37,6 +40,33 @@ function fixture() {
|
||||
new Function('require', 'module', 'exports', 'process', compiled)(
|
||||
(name) => {
|
||||
required.push(name);
|
||||
if (name === './loaders/httpApplication') {
|
||||
const helper = { exports: {} };
|
||||
const code = ts.transpileModule(
|
||||
fs.readFileSync('back/loaders/httpApplication.ts', 'utf8'),
|
||||
{
|
||||
compilerOptions: {
|
||||
module: ts.ModuleKind.CommonJS,
|
||||
target: ts.ScriptTarget.ES2020,
|
||||
esModuleInterop: true,
|
||||
},
|
||||
},
|
||||
).outputText;
|
||||
new Function('require', 'module', 'exports', code)(
|
||||
(dependency) => {
|
||||
required.push(dependency);
|
||||
const alias = dependency.startsWith('../')
|
||||
? './' + dependency.slice(3)
|
||||
: dependency;
|
||||
return Object.hasOwn(mocks, alias)
|
||||
? mocks[alias]
|
||||
: middlewareRequire(dependency);
|
||||
},
|
||||
helper,
|
||||
helper.exports,
|
||||
);
|
||||
return helper.exports;
|
||||
}
|
||||
return Object.hasOwn(mocks, name) ? mocks[name] : localRequire(name);
|
||||
},
|
||||
module,
|
||||
|
||||
Reference in New Issue
Block a user