mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: remove static manifest
This commit is contained in:
1 parent
10c3a62168
commit
d7412fcc1e
18 files changed
+50
-124
No files matched your search
@@ -64,7 +64,6 @@ echo 'Installing g++'
|
|||||||
apt-get install -y g++ >/dev/null
|
apt-get install -y g++ >/dev/null
|
||||||
|
|
||||||
# Install HydroOJ
|
# Install HydroOJ
|
||||||
# TODO: install basic addons?
|
|
||||||
echo "Installing Hydro"
|
echo "Installing Hydro"
|
||||||
yarn global add hydrooj @hydrooj/ui-default @hydrooj/hydrojudge
|
yarn global add hydrooj @hydrooj/ui-default @hydrooj/hydrojudge
|
||||||
wget https://s3.undefined.moe/file/executor-amd64 -O /usr/bin/sandbox
|
wget https://s3.undefined.moe/file/executor-amd64 -O /usr/bin/sandbox
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ echo 'Installing g++'
|
|||||||
apt-get install -y g++ >/dev/null
|
apt-get install -y g++ >/dev/null
|
||||||
|
|
||||||
# Install HydroOJ
|
# Install HydroOJ
|
||||||
# TODO: install basic addons?
|
|
||||||
echo "Installing Hydro"
|
echo "Installing Hydro"
|
||||||
yarn global add hydrooj @hydrooj/ui-default @hydrooj/hydrojudge
|
yarn global add hydrooj @hydrooj/ui-default @hydrooj/hydrojudge
|
||||||
wget https://s3.undefined.moe/file/executor-amd64 -O /usr/bin/sandbox
|
wget https://s3.undefined.moe/file/executor-amd64 -O /usr/bin/sandbox
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ echo 'Installing g++'
|
|||||||
apt-get install -y g++ >/dev/null
|
apt-get install -y g++ >/dev/null
|
||||||
|
|
||||||
# Install HydroOJ
|
# Install HydroOJ
|
||||||
# TODO: install basic addons?
|
|
||||||
echo "Installing Hydro"
|
echo "Installing Hydro"
|
||||||
yarn global add hydrooj @hydrooj/ui-default @hydrooj/hydrojudge
|
yarn global add hydrooj @hydrooj/ui-default @hydrooj/hydrojudge
|
||||||
wget https://s3.undefined.moe/file/executor-amd64 -O /usr/bin/sandbox
|
wget https://s3.undefined.moe/file/executor-amd64 -O /usr/bin/sandbox
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.34.9",
|
"version": "2.35.0",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -148,19 +148,6 @@ export async function template(pending: string[], fail: string[]) {
|
|||||||
await bus.serial('app/load/template');
|
await bus.serial('app/load/template');
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function uistatic(pending: string[], fail: string[]) {
|
|
||||||
for (const i of pending) {
|
|
||||||
const p = path.resolve(i, 'public', 'static-manifest.json');
|
|
||||||
if (fs.existsSync(p) && fs.statSync(p).isFile() && !fail.includes(i)) {
|
|
||||||
try {
|
|
||||||
Object.assign(global.Hydro.ui.manifest, eval('require')(p));
|
|
||||||
} catch (e) {
|
|
||||||
fail.push(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function model(pending: string[], fail: string[]) {
|
export async function model(pending: string[], fail: string[]) {
|
||||||
for (const i of pending) {
|
for (const i of pending) {
|
||||||
let p = path.resolve(i, 'model.ts');
|
let p = path.resolve(i, 'model.ts');
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import * as bus from '../service/bus';
|
|||||||
import db from '../service/db';
|
import db from '../service/db';
|
||||||
import {
|
import {
|
||||||
builtinHandler, builtinLib, builtinModel,
|
builtinHandler, builtinLib, builtinModel,
|
||||||
builtinScript, handler, lib, locale, model, script, service, setting, template, uistatic,
|
builtinScript, handler, lib, locale, model, script, service, setting, template,
|
||||||
} from './common';
|
} from './common';
|
||||||
|
|
||||||
const logger = new Logger('worker');
|
const logger = new Logger('worker');
|
||||||
@@ -34,7 +34,6 @@ export async function load() {
|
|||||||
await Promise.all([
|
await Promise.all([
|
||||||
locale(pending, fail),
|
locale(pending, fail),
|
||||||
template(pending, fail),
|
template(pending, fail),
|
||||||
uistatic(pending, fail),
|
|
||||||
]);
|
]);
|
||||||
if (detail) logger.info('finish: locale/template/static');
|
if (detail) logger.info('finish: locale/template/static');
|
||||||
const opts = options();
|
const opts = options();
|
||||||
|
|||||||
@@ -30,7 +30,17 @@ export function addon(addonPath: string, prepend = false) {
|
|||||||
const packagejson = require.resolve(`${addonPath}/package.json`);
|
const packagejson = require.resolve(`${addonPath}/package.json`);
|
||||||
const modulePath = path.dirname(packagejson);
|
const modulePath = path.dirname(packagejson);
|
||||||
const publicPath = path.resolve(modulePath, 'public');
|
const publicPath = path.resolve(modulePath, 'public');
|
||||||
if (fs.existsSync(publicPath)) global.publicDirs[prepend ? 'push' : 'unshift'](publicPath);
|
if (fs.existsSync(publicPath)) {
|
||||||
|
global.publicDirs[prepend ? 'push' : 'unshift'](publicPath);
|
||||||
|
const targets = fs.readdirSync(publicPath);
|
||||||
|
for (const target of targets) {
|
||||||
|
if (global.ui.manifest[target] && !prepend) {
|
||||||
|
global.ui.manifest[target] = publicPath;
|
||||||
|
} else if (!global.staticFiles[target]) {
|
||||||
|
global.ui.manifest[target] = publicPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
global.addons[prepend ? 'unshift' : 'push'](modulePath);
|
global.addons[prepend ? 'unshift' : 'push'](modulePath);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error(`Addon not found: ${addonPath}`);
|
logger.error(`Addon not found: ${addonPath}`);
|
||||||
|
|||||||
@@ -103,7 +103,9 @@ class DomainModel {
|
|||||||
static async getList(domainIds: string[]) {
|
static async getList(domainIds: string[]) {
|
||||||
const r: Record<string, DomainDoc | null> = {};
|
const r: Record<string, DomainDoc | null> = {};
|
||||||
// eslint-disable-next-line no-await-in-loop
|
// eslint-disable-next-line no-await-in-loop
|
||||||
for (const domainId of domainIds) r[domainId] = await DomainModel.get(domainId);
|
const tasks = [];
|
||||||
|
for (const domainId of domainIds) tasks.push(DomainModel.get(domainId).then((ddoc) => { r[domainId] = ddoc; }));
|
||||||
|
await Promise.all(tasks);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,25 +23,16 @@ async function runProblem(...arg: any[]) {
|
|||||||
? await problem.get(arg[0], arg[1])
|
? await problem.get(arg[0], arg[1])
|
||||||
: arg[0];
|
: arg[0];
|
||||||
const udict: ND = (typeof arg[0] === 'string') ? arg[2] : arg[1];
|
const udict: ND = (typeof arg[0] === 'string') ? arg[2] : arg[1];
|
||||||
const [, nPages] = await paginate(
|
const nPages = Math.floor(
|
||||||
problem.getMultiStatus(
|
(await problem.getMultiStatus(
|
||||||
pdoc.domainId, { docId: pdoc.docId, rid: { $ne: null } },
|
pdoc.domainId, { docId: pdoc.docId, rid: { $ne: null } },
|
||||||
),
|
).count() + 99) / 100,
|
||||||
1,
|
|
||||||
100,
|
|
||||||
);
|
);
|
||||||
const nAccept = await problem.getMultiStatus(
|
const p = (pdoc.difficulty || 5) / (Math.sqrt(Math.sqrt(pdoc.nAccept)) + 1);
|
||||||
pdoc.domainId, { docId: pdoc.docId, status: STATUS.STATUS_ACCEPTED },
|
|
||||||
).count();
|
|
||||||
const p = (pdoc.difficulty || 5) / (Math.sqrt(Math.sqrt(nAccept)) + 1);
|
|
||||||
for (let page = 1; page <= nPages; page++) {
|
for (let page = 1; page <= nPages; page++) {
|
||||||
const [psdocs] = await paginate(
|
const psdocs = await problem.getMultiStatus(
|
||||||
problem.getMultiStatus(
|
pdoc.domainId, { docId: pdoc.docId, rid: { $ne: null } },
|
||||||
pdoc.domainId, { docId: pdoc.docId, rid: { $ne: null } },
|
).limit(100).skip((page - 1) * 100).project({ rid: 1 }).toArray();
|
||||||
),
|
|
||||||
page,
|
|
||||||
100,
|
|
||||||
) as any[][];
|
|
||||||
const rdict = await record.getList(pdoc.domainId, psdocs.map((psdoc) => psdoc.rid), true);
|
const rdict = await record.getList(pdoc.domainId, psdocs.map((psdoc) => psdoc.rid), true);
|
||||||
for (const psdoc of psdocs) {
|
for (const psdoc of psdocs) {
|
||||||
if (rdict[psdoc.rid.toHexString()]) {
|
if (rdict[psdoc.rid.toHexString()]) {
|
||||||
@@ -95,8 +86,10 @@ export async function calcLevel(domainId: string, report: Function) {
|
|||||||
const coll = db.collection('domain.user');
|
const coll = db.collection('domain.user');
|
||||||
const ducur = domain.getMultiUserInDomain(domainId, filter).project({ rp: 1 }).sort({ rp: -1 });
|
const ducur = domain.getMultiUserInDomain(domainId, filter).project({ rp: 1 }).sort({ rp: -1 });
|
||||||
let bulk = coll.initializeUnorderedBulkOp();
|
let bulk = coll.initializeUnorderedBulkOp();
|
||||||
while (await ducur.hasNext()) {
|
// eslint-disable-next-line no-constant-condition
|
||||||
|
while (true) {
|
||||||
const dudoc = await ducur.next();
|
const dudoc = await ducur.next();
|
||||||
|
if (!dudoc) break;
|
||||||
if ([0, 1].includes(dudoc.uid)) continue;
|
if ([0, 1].includes(dudoc.uid)) continue;
|
||||||
count++;
|
count++;
|
||||||
if (!dudoc.rp) dudoc.rp = null;
|
if (!dudoc.rp) dudoc.rp = null;
|
||||||
@@ -130,18 +123,6 @@ async function runInDomain(id: string, isSub: boolean, report: Function) {
|
|||||||
...await domain.getMultiUserInDomain('', { domainId }).toArray(),
|
...await domain.getMultiUserInDomain('', { domainId }).toArray(),
|
||||||
], (a, b) => a.uid === b.uid);
|
], (a, b) => a.uid === b.uid);
|
||||||
for (const dudoc of dudocs) deltaudict[dudoc.uid] = dudoc.rpdelta;
|
for (const dudoc of dudocs) deltaudict[dudoc.uid] = dudoc.rpdelta;
|
||||||
const contests: Tdoc<30 | 60>[] = await contest.getMulti('', { domainId, rated: true })
|
|
||||||
.toArray() as any;
|
|
||||||
await report({ message: `Found ${contests.length} contests in ${id}` });
|
|
||||||
for (const i in contests) {
|
|
||||||
const tdoc = contests[i];
|
|
||||||
await runContest(tdoc, udict, report);
|
|
||||||
if (!isSub) {
|
|
||||||
await report({
|
|
||||||
progress: Math.floor(((parseInt(i, 10) + 1) / contests.length) * 100),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// TODO pagination
|
// TODO pagination
|
||||||
const problems = await problem.getMulti('', { domainId, hidden: false }).toArray();
|
const problems = await problem.getMulti('', { domainId, hidden: false }).toArray();
|
||||||
await report({ message: `Found ${problems.length} problems in ${id}` });
|
await report({ message: `Found ${problems.length} problems in ${id}` });
|
||||||
@@ -150,7 +131,19 @@ async function runInDomain(id: string, isSub: boolean, report: Function) {
|
|||||||
await runProblem(pdoc, udict);
|
await runProblem(pdoc, udict);
|
||||||
if (!isSub) {
|
if (!isSub) {
|
||||||
await report({
|
await report({
|
||||||
progress: Math.floor(((parseInt(i, 10) + 1) / problems.length) * 100),
|
progress: Math.floor(((+i + 1) / problems.length) * 100),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const contests: Tdoc<30 | 60>[] = await contest.getMulti('', { domainId, rated: true })
|
||||||
|
.toArray() as any;
|
||||||
|
await report({ message: `Found ${contests.length} contests in ${id}` });
|
||||||
|
for (const i in contests) {
|
||||||
|
const tdoc = contests[i];
|
||||||
|
await runContest(tdoc, udict, report);
|
||||||
|
if (!isSub) {
|
||||||
|
await report({
|
||||||
|
progress: Math.floor(((+i + 1) / contests.length) * 100),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -182,7 +175,7 @@ export async function run({ domainId }, report: Function) {
|
|||||||
memory: 0,
|
memory: 0,
|
||||||
score: 0,
|
score: 0,
|
||||||
},
|
},
|
||||||
progress: Math.floor(((parseInt(i, 10) + 1) / domains.length) * 100),
|
progress: Math.floor(((+i + 1) / domains.length) * 100),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else await runInDomain(domainId, false, report);
|
} else await runInDomain(domainId, false, report);
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ export class HandlerCommon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderTitle(str: string) {
|
renderTitle(str: string) {
|
||||||
const name = this.domain.ui?.name || system.get('server.name');
|
const name = this.domain?.ui?.name || system.get('server.name');
|
||||||
if (this.extraTitleContent) return `${this.translate(str)} - ${this.extraTitleContent} - ${name}`;
|
if (this.extraTitleContent) return `${this.translate(str)} - ${this.extraTitleContent} - ${name}`;
|
||||||
return `${this.translate(str)} - ${name}`;
|
return `${this.translate(str)} - ${name}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ const scripts: UpgradeScript[] = [
|
|||||||
await document.getMulti(d._id, document.TYPE_DISCUSSION_REPLY).forEach((drdoc) => {
|
await document.getMulti(d._id, document.TYPE_DISCUSSION_REPLY).forEach((drdoc) => {
|
||||||
bulk.find({ _id: drdoc._id }).updateOne({ $set: { history: [] } });
|
bulk.find({ _id: drdoc._id }).updateOne({ $set: { history: [] } });
|
||||||
});
|
});
|
||||||
// TODO tail reply
|
|
||||||
await document.getMulti(d._id, document.TYPE_PROBLEM_SOLUTION).forEach((psdoc) => {
|
await document.getMulti(d._id, document.TYPE_PROBLEM_SOLUTION).forEach((psdoc) => {
|
||||||
bulk.find({ _id: psdoc._id }).updateOne({ $set: { history: [] } });
|
bulk.find({ _id: psdoc._id }).updateOne({ $set: { history: [] } });
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import {
|
|||||||
|
|
||||||
const dst = global.Hydro.service.db;
|
const dst = global.Hydro.service.db;
|
||||||
const { discussion, document } = global.Hydro.model;
|
const { discussion, document } = global.Hydro.model;
|
||||||
// TODO output enhancement
|
|
||||||
const map = {};
|
const map = {};
|
||||||
|
|
||||||
const pid = (id) => {
|
const pid = (id) => {
|
||||||
|
|||||||
@@ -115,9 +115,6 @@ nunjucks.runtime.memberLookup = function memberLookup(obj, val) {
|
|||||||
const env = new Nunjucks();
|
const env = new Nunjucks();
|
||||||
env.addGlobal('static_url', (assetName) => {
|
env.addGlobal('static_url', (assetName) => {
|
||||||
const cdnPrefix = process.env.DEV ? '/' : global.Hydro.model.system.get('server.cdn');
|
const cdnPrefix = process.env.DEV ? '/' : global.Hydro.model.system.get('server.cdn');
|
||||||
if (global.Hydro.ui.manifest[assetName]) {
|
|
||||||
return `${cdnPrefix}${global.Hydro.ui.manifest[assetName]}`;
|
|
||||||
}
|
|
||||||
return `${cdnPrefix}${assetName}`;
|
return `${cdnPrefix}${assetName}`;
|
||||||
});
|
});
|
||||||
// eslint-disable-next-line no-eval
|
// eslint-disable-next-line no-eval
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
|||||||
import SpeedMeasurePlugin from 'speed-measure-webpack-plugin';
|
import SpeedMeasurePlugin from 'speed-measure-webpack-plugin';
|
||||||
import WebpackBar from 'webpackbar';
|
import WebpackBar from 'webpackbar';
|
||||||
import mapWebpackUrlPrefix from '../utils/mapWebpackUrlPrefix';
|
import mapWebpackUrlPrefix from '../utils/mapWebpackUrlPrefix';
|
||||||
import StaticManifestPlugin from '../plugins/manifest.webpack';
|
|
||||||
import root from '../utils/root';
|
import root from '../utils/root';
|
||||||
|
|
||||||
const beautifyOutputUrl = mapWebpackUrlPrefix([
|
const beautifyOutputUrl = mapWebpackUrlPrefix([
|
||||||
@@ -237,13 +236,6 @@ export default function (env = {}) {
|
|||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
}),
|
}),
|
||||||
new StaticManifestPlugin({
|
|
||||||
fileName: 'static-manifest.json',
|
|
||||||
ignore: [
|
|
||||||
'img/emoji/',
|
|
||||||
'katex/',
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
...env.measure ? [new BundleAnalyzerPlugin({ analyzerPort: 'auto' })] : [],
|
...env.measure ? [new BundleAnalyzerPlugin({ analyzerPort: 'auto' })] : [],
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -76,6 +76,9 @@ async function main() {
|
|||||||
await runWebpack(argv.options);
|
await runWebpack(argv.options);
|
||||||
if (argv.options.production) {
|
if (argv.options.production) {
|
||||||
fs.removeSync('public/vditor/dist/js/mathjax');
|
fs.removeSync('public/vditor/dist/js/mathjax');
|
||||||
|
fs.removeSync('public/vditor/dist/js/echarts');
|
||||||
|
fs.removeSync('public/vditor/dist/js/graphviz');
|
||||||
|
fs.removeSync('public/vditor/dist/js/mermaid');
|
||||||
fs.removeSync('public/vditor/dist/js/abcjs');
|
fs.removeSync('public/vditor/dist/js/abcjs');
|
||||||
}
|
}
|
||||||
process.chdir(dir);
|
process.chdir(dir);
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
/* eslint-disable import/no-extraneous-dependencies */
|
|
||||||
const _ = require('lodash');
|
|
||||||
const crypto = require('crypto');
|
|
||||||
|
|
||||||
export default class StaticManifestPlugin {
|
|
||||||
constructor({ fileName, ignore }) {
|
|
||||||
this.fileName = fileName;
|
|
||||||
this.ignore = ignore;
|
|
||||||
}
|
|
||||||
|
|
||||||
apply(compiler) {
|
|
||||||
compiler.hooks.emit.tap('sync', (compilation) => {
|
|
||||||
const stats = compilation.getStats().toJson();
|
|
||||||
const manifest = _(stats.assets)
|
|
||||||
.map((asset) => {
|
|
||||||
const { name } = asset;
|
|
||||||
// Skip files listed in ignore
|
|
||||||
if (_.some(this.ignore, (ignorePattern) => name.indexOf(ignorePattern) > -1)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// Skip calculating hash for names like ?xxxx
|
|
||||||
if (name.indexOf('?') > -1) {
|
|
||||||
return [
|
|
||||||
name.replace(/\?[\s\S]*/, ''), // origin name
|
|
||||||
name, // name with hash
|
|
||||||
];
|
|
||||||
}
|
|
||||||
// We need to calculate hash for the remaining files.
|
|
||||||
const source = compilation.assets[asset.name].source();
|
|
||||||
const shasum = crypto.createHash('sha1');
|
|
||||||
shasum.update(source);
|
|
||||||
const hash = shasum.digest('hex').substr(0, 10);
|
|
||||||
return [
|
|
||||||
name, // origin name
|
|
||||||
`${name}?${hash}`, // name with hash
|
|
||||||
];
|
|
||||||
})
|
|
||||||
.filter()
|
|
||||||
.orderBy(['0'])
|
|
||||||
.fromPairs()
|
|
||||||
.value();
|
|
||||||
const json = JSON.stringify(manifest, null, 2);
|
|
||||||
compilation.assets[this.fileName] = {
|
|
||||||
source: () => json,
|
|
||||||
size: () => json.length,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
/* eslint-disable no-return-await */
|
/* eslint-disable no-return-await */
|
||||||
/* eslint-disable camelcase */
|
/* eslint-disable camelcase */
|
||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
import { readdir, readFile } from 'fs-extra';
|
import { readFileSync } from 'fs-extra';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { tmpdir } from 'os';
|
|
||||||
import { ObjectID } from 'mongodb';
|
import { ObjectID } from 'mongodb';
|
||||||
import * as bus from 'hydrooj/src/service/bus';
|
import * as bus from 'hydrooj/src/service/bus';
|
||||||
import { Route, Handler } from 'hydrooj/src/service/server';
|
import { Route, Handler } from 'hydrooj/src/service/server';
|
||||||
@@ -31,8 +30,10 @@ declare module 'hydrooj/src/interface' {
|
|||||||
|
|
||||||
const cache = {};
|
const cache = {};
|
||||||
const coll = db.collection('cache');
|
const coll = db.collection('cache');
|
||||||
|
const pages = Object.keys(global.ui.manifest)
|
||||||
|
.filter((file) => file.endsWith('.page.js'))
|
||||||
|
.map((i) => readFileSync(join(global.ui.manifest[i], i), 'utf-8'));
|
||||||
|
|
||||||
const basedir = join(tmpdir(), 'hydro', 'public');
|
|
||||||
async function constant(args: ConstantArgs) {
|
async function constant(args: ConstantArgs) {
|
||||||
// CompileLangs
|
// CompileLangs
|
||||||
const payload = [`window.LANGS=${JSON.stringify(setting.langs)};`];
|
const payload = [`window.LANGS=${JSON.stringify(setting.langs)};`];
|
||||||
@@ -64,11 +65,7 @@ async function constant(args: ConstantArgs) {
|
|||||||
}` : ''}\`;
|
}` : ''}\`;
|
||||||
document.body.appendChild(e);`;
|
document.body.appendChild(e);`;
|
||||||
|
|
||||||
const files = await readdir(basedir);
|
payload.push(...pages);
|
||||||
const pages = files
|
|
||||||
.filter((file) => file.endsWith('.page.js'))
|
|
||||||
.map((i) => readFile(join(basedir, i), 'utf-8'));
|
|
||||||
payload.push(...await Promise.all(pages));
|
|
||||||
|
|
||||||
const c = crypto.createHash('sha1');
|
const c = crypto.createHash('sha1');
|
||||||
c.update(JSON.stringify(payload));
|
c.update(JSON.stringify(payload));
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.20.8",
|
"version": "4.21.0",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
Reference in new issue
Block a user