ui: set target to chrome60

This commit is contained in:
undefined committed 2022-10-21 10:31:34 +08:00
1 parent b51620d634
commit 0d49c4d399
5 files changed
+17 -12

No files matched your search

+4 -4
View File
@@ -32,12 +32,12 @@
"devDependencies": { "devDependencies": {
"@types/autocannon": "^7.9.0", "@types/autocannon": "^7.9.0",
"@types/cross-spawn": "^6.0.2", "@types/cross-spawn": "^6.0.2",
"@types/mocha": "^9.1.1", "@types/mocha": "^10.0.0",
"@types/node": "^18.11.0", "@types/node": "^18.11.2",
"@types/semver": "^7.3.12", "@types/semver": "^7.3.12",
"@types/supertest": "^2.0.12", "@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^5.40.0", "@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.0", "@typescript-eslint/parser": "^5.40.1",
"autocannon": "^7.10.0", "autocannon": "^7.10.0",
"cac": "^6.7.14", "cac": "^6.7.14",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
+2 -2
View File
@@ -73,7 +73,7 @@ export const Types: Types = {
}, },
(v) => { (v) => {
const d = v.split('-'); const d = v.split('-');
assert(d.length === 3); if (d.length !== 3) return false;
const st = `${d[0]}-${d[1].length === 1 ? '0' : ''}${d[1]}-${d[2].length === 1 ? '0' : ''}${d[2]}`; const st = `${d[0]}-${d[1].length === 1 ? '0' : ''}${d[1]}-${d[2].length === 1 ? '0' : ''}${d[2]}`;
return moment(st).isValid(); return moment(st).isValid();
}, },
@@ -86,7 +86,7 @@ export const Types: Types = {
}, },
(v) => { (v) => {
const t = v.split(':'); const t = v.split(':');
assert(t.length === 2); if (t.length !== 2) return false;
return moment(`2020-01-01 ${(t[0].length === 1 ? '0' : '') + t[0]}:${t[1].length === 1 ? '0' : ''}${t[1]}`).isValid(); return moment(`2020-01-01 ${(t[0].length === 1 ? '0' : '') + t[0]}:${t[1].length === 1 ? '0' : ''}${t[1]}`).isValid();
}, },
], ],
+6 -1
View File
@@ -156,7 +156,12 @@ env.addGlobal('formatSeconds', misc.formatSeconds);
env.addGlobal('lib', global.Hydro.lib); env.addGlobal('lib', global.Hydro.lib);
env.addGlobal('model', global.Hydro.model); env.addGlobal('model', global.Hydro.model);
env.addGlobal('ui', global.Hydro.ui); env.addGlobal('ui', global.Hydro.ui);
env.addGlobal('isIE', (str) => (str ? (str.includes('MSIE') || str.includes('rv:11.0')) : false)); env.addGlobal('isIE', (str) => {
if (!str) return false;
if (['MSIE', 'rv:11.0'].some((i) => str.includes(i))) return true;
if (str.includes('Chrome/') && +str.split('Chrome/')[1].split('.')[0] < 60) return true;
return false;
});
env.addGlobal('set', (obj, key, val) => { env.addGlobal('set', (obj, key, val) => {
if (val !== undefined) obj[key] = val; if (val !== undefined) obj[key] = val;
else Object.assign(obj, key); else Object.assign(obj, key);
+2 -2
View File
@@ -19,7 +19,7 @@ export default function (env: { watch?: boolean, production?: boolean, measure?:
loader: 'esbuild-loader', loader: 'esbuild-loader',
options: { options: {
loader: 'tsx', loader: 'tsx',
target: 'chrome80', target: 'chrome60',
sourcemap: true, sourcemap: true,
}, },
}; };
@@ -221,7 +221,7 @@ export default function (env: { watch?: boolean, production?: boolean, measure?:
minifyIdentifiers: true, minifyIdentifiers: true,
treeShaking: true, treeShaking: true,
target: [ target: [
'chrome80', 'chrome60',
], ],
exclude: [/mathmaps/, /\.min\.js$/], exclude: [/mathmaps/, /\.min\.js$/],
})], })],
+3 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/ui-default", "name": "@hydrooj/ui-default",
"version": "4.42.3", "version": "4.42.4",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "index.ts", "main": "index.ts",
@@ -10,8 +10,8 @@
"lint": "eslint" "lint": "eslint"
}, },
"devDependencies": { "devDependencies": {
"@blueprintjs/core": "4.11.3", "@blueprintjs/core": "4.11.4",
"@blueprintjs/select": "4.8.3", "@blueprintjs/select": "4.8.4",
"@fontsource/dm-mono": "^4.5.10", "@fontsource/dm-mono": "^4.5.10",
"@fontsource/fira-code": "^4.5.12", "@fontsource/fira-code": "^4.5.12",
"@fontsource/inconsolata": "^4.5.9", "@fontsource/inconsolata": "^4.5.9",