Skip to content

Commit

Permalink
build: ⬆️ 升级依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
hymbz committed Aug 9, 2024
1 parent 3326a83 commit 68d7956
Show file tree
Hide file tree
Showing 9 changed files with 1,917 additions and 1,836 deletions.
79 changes: 49 additions & 30 deletions .xo-config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module.exports = {
// 提示未使用的变量
"@typescript-eslint/no-unused-vars": "warn",
// 提示使用了 console
'no-console': ["warn", { allow: ["warn", "error"] }],
'no-debugger': "warn",
"no-console": ["warn", { allow: ["warn", "error"] }],
"no-debugger": "warn",

"no-use-extend-native/no-use-extend-native": "off",

Expand Down Expand Up @@ -37,7 +37,7 @@ module.exports = {
// 不强制使用 querySelector
"unicorn/prefer-query-selector": "off",
// 不限制在 switch case 中使用大括号
"unicorn/switch-case-braces": 'off',
"unicorn/switch-case-braces": "off",

// 允许直接传递函数给迭代器方法
"unicorn/no-array-callback-reference": "off",
Expand All @@ -58,19 +58,22 @@ module.exports = {
// 允许 return await
"no-return-await": "off",
// 允许调用大写开头的函数
"new-cap": ["error", { "capIsNew": false }],
"new-cap": ["error", { capIsNew: false }],
// 允许使用复杂的数组解构
"unicorn/no-unreadable-array-destructuring": "off",
// 允许正常调用异步函数并使用 catch
"unicorn/prefer-top-level-await": "off",
// 允许在相等判断中使用 !
"unicorn/no-negation-in-equality-check": "off",
// structured 无法处理代理对象
"unicorn/prefer-structured-clone": "off",

// import 不同分组之间加上空行
"import/order": ["warn", { "newlines-between": "always" }],

// 使用 process
"n/prefer-global/process": ["error", "always"],


//
// 项目特有的规则
//
Expand All @@ -84,7 +87,13 @@ module.exports = {
"jsdoc/require-returns-type": "off",
// 允许使用其他的 jsdoc 标签,以便使用 typescript-json-schema
"jsdoc/check-tag-names": "off",
"jsdoc/check-param-names": ["warn", { checkDestructured: false }],
"jsdoc/check-param-names": [
"warn",
{
checkDestructured: false,
disableMissingParamChecks: true,
},
],
// 允许不写返回值
"jsdoc/require-returns": "off",
// 允许有参数不被写明
Expand Down Expand Up @@ -125,6 +134,8 @@ module.exports = {
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",

"@typescript-eslint/use-unknown-in-catch-callback-variable": "off",

// 允许 return await
"@typescript-eslint/return-await": [
"off",
Expand All @@ -140,49 +151,57 @@ module.exports = {
// 允许短路表达式
"@typescript-eslint/no-unused-expressions": [
"error",
{ "allowShortCircuit": true }
{ allowShortCircuit: true },
],

// 允许使用 require
"unicorn/prefer-module": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-var-requires": "off",

"@typescript-eslint/consistent-type-imports": ["error", {
// 允许 typeof import
disallowTypeAnnotations: false,
// 使用 内联类型导入
fixStyle: "inline-type-imports",
}],
}
"@typescript-eslint/consistent-type-imports": [
"error",
{
// 允许 typeof import
disallowTypeAnnotations: false,
// 使用 内联类型导入
fixStyle: "inline-type-imports",
},
],
},
},
{
files: "**/!(display)*.tsx",
rules: {
"i18next/no-literal-string": [
"error", {
mode: 'jsx-only',
'jsx-attributes': { include: ['^name'] },
"error",
{
mode: "jsx-only",
"jsx-attributes": { include: ["^name"] },
},
],
},
},
{
files: "src/site/**/*",
rules: {
"no-restricted-imports": ["warn", {
"patterns": [
{
"group": [
"helper/*",
"!helper/languages",
"!helper/eleSelector",
"../**/*"
],
"message": "只能通过 main 导入"
}
]
}],
"no-restricted-imports": [
"warn",
{
patterns: [
{
group: [
"helper/*",
"!helper/languages",
"!helper/eleSelector",
"!helper/dmzjApi",
"../**/*",
],
message: "只能通过 main 导入",
},
],
},
],
},
},
],
Expand Down
14 changes: 7 additions & 7 deletions metaHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
*/
const resourceList: Record<string, [string, string] | [string]> = {
'solid-js': [
'https://registry.npmmirror.com/solid-js/1.8.17/files/dist/solid.cjs',
'https://registry.npmmirror.com/solid-js/1.8.17/files/dist/dev.cjs',
'https://registry.npmmirror.com/solid-js/1.8.19/files/dist/solid.cjs',
'https://registry.npmmirror.com/solid-js/1.8.19/files/dist/dev.cjs',
],
'solid-js/store': [
'https://registry.npmmirror.com/solid-js/1.8.17/files/store/dist/store.cjs',
'https://registry.npmmirror.com/solid-js/1.8.17/files/store/dist/dev.cjs',
'https://registry.npmmirror.com/solid-js/1.8.19/files/store/dist/store.cjs',
'https://registry.npmmirror.com/solid-js/1.8.19/files/store/dist/dev.cjs',
],
'solid-js/web': [
'https://registry.npmmirror.com/solid-js/1.8.17/files/web/dist/web.cjs',
'https://registry.npmmirror.com/solid-js/1.8.17/files/web/dist/dev.cjs',
'https://registry.npmmirror.com/solid-js/1.8.19/files/web/dist/web.cjs',
'https://registry.npmmirror.com/solid-js/1.8.19/files/web/dist/dev.cjs',
],
fflate: ['https://registry.npmmirror.com/fflate/0.8.2/files/umd/index.js'],
'qr-scanner': [
Expand Down Expand Up @@ -149,7 +149,7 @@ export const getMetaData = (isDevMode: boolean) => {
const keyLength = Math.max(...Object.keys(meta).map((key) => key.length)) + 1;

const createMetaHeader = (metaData: Record<string, any>) => {
const _metaData: typeof metaData = JSON.parse(JSON.stringify(metaData));
const _metaData: typeof metaData = structuredClone(metaData);

// 将 @resource 中的 / 替换为 |,以兼容 ios 的油猴扩展
for (const key of Object.keys(_metaData.resource)) {
Expand Down
56 changes: 28 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@
"jsencrypt": "^3.3.2",
"libarchive.js": "2.0.2",
"magic-bytes.js": "^1.10.0",
"marked": "^13.0.1",
"marked": "^14.0.0",
"normalize.css": "^8.0.1",
"protobufjs": "^7.3.2",
"pwa-install-handler": "^2.6.0",
"qr-scanner": "^1.4.2",
"solid-element": "^1.8.0",
"solid-js": "^1.8.17",
"solid-element": "^1.8.1",
"solid-js": "^1.8.19",
"water.css": "^2.1.1"
},
"devDependencies": {
"@babel/core": "^7.24.7",
"@babel/core": "^7.25.2",
"@babel/plugin-proposal-import-attributes-to-assertions": "^7.24.7",
"@babel/plugin-transform-runtime": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/preset-env": "^7.25.3",
"@babel/preset-typescript": "^7.24.7",
"@babel/runtime": "^7.24.7",
"@babel/runtime": "^7.25.0",
"@jackfranklin/rollup-plugin-markdown": "^0.4.0",
"@release-it/conventional-changelog": "^8.0.1",
"@rollup/plugin-alias": "^5.1.0",
Expand All @@ -55,49 +55,49 @@
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.7",
"@solidjs/router": "^0.13.6",
"@solidjs/router": "^0.14.1",
"@types/libarchive.js": "^1.3.4",
"@types/shelljs": "^0.8.15",
"@types/sync-fetch": "^0.4.3",
"@types/wicg-file-system-access": "^2023.10.5",
"@types/wicg-web-app-launch": "^2023.1.4",
"autoprefixer": "^10.4.19",
"axios": "^1.7.2",
"babel-preset-solid": "^1.8.17",
"cssnano": "^7.0.3",
"eslint-plugin-i18next": "^6.0.3",
"eslint-plugin-jsdoc": "^48.4.0",
"autoprefixer": "^10.4.20",
"axios": "^1.7.3",
"babel-preset-solid": "^1.8.19",
"cssnano": "^7.0.4",
"eslint-plugin-i18next": "^6.0.9",
"eslint-plugin-jsdoc": "^50.0.0",
"eslint-plugin-no-autofix": "^2.0.0",
"eslint-plugin-solid": "^0.14.1",
"fake-indexeddb": "^6.0.0",
"image-meta": "^0.2.1",
"jsdom": "^24.1.0",
"jsdom": "^24.1.1",
"postcss-import": "^16.1.0",
"postcss-nesting": "^12.1.5",
"prettier": "^3.3.2",
"release-it": "^17.4.0",
"rollup": "^4.18.0",
"postcss-nesting": "^13.0.0",
"prettier": "^3.3.3",
"release-it": "^17.6.0",
"rollup": "^4.20.0",
"rollup-plugin-styles": "^4.0.0",
"rollup-plugin-ts": "^3.4.5",
"rollup-plugin-watch-external": "^1.0.2",
"shelljs": "^0.8.5",
"stylelint": "^16.6.1",
"stylelint-config-clean-order": "^6.0.0",
"stylelint": "^16.8.1",
"stylelint-config-clean-order": "^6.1.0",
"stylelint-config-standard": "^36.0.1",
"stylelint-high-performance-animation": "^1.10.0",
"stylelint-order": "^6.0.4",
"stylelint-prettier": "^5.0.0",
"stylelint-prettier": "^5.0.2",
"svgo": "^3.3.2",
"sync-fetch": "^0.5.2",
"tslib": "^2.6.3",
"type-fest": "^4.20.1",
"typescript": "^5.5.2",
"vite": "^5.3.1",
"vite-plugin-pwa": "^0.20.0",
"type-fest": "^4.24.0",
"typescript": "^5.5.4",
"vite": "^5.4.0",
"vite-plugin-pwa": "^0.20.1",
"vite-plugin-solid": "^2.10.2",
"vitepress": "1.2.3",
"vitest": "^1.6.0",
"xo": "^0.58.0"
"vitepress": "1.3.2",
"vitest": "^2.0.5",
"xo": "^0.59.3"
},
"prettier": {
"useTabs": false,
Expand Down
Loading

0 comments on commit 68d7956

Please sign in to comment.