Skip to content

Commit

Permalink
fix: 🐛 修复更新通知的格式错误
Browse files Browse the repository at this point in the history
  • Loading branch information
hymbz committed Apr 15, 2024
1 parent 1f85bfb commit 3226307
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
1 change: 1 addition & 0 deletions .xo-config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module.exports = {
prettier: true,
plugins: ["i18next", "jsdoc", "solid"],
extends: ["plugin:solid/typescript", "plugin:jsdoc/recommended"],
ignores: ["*.js"],

rules: {
// 不限制文件名的大小写样式
Expand Down
4 changes: 2 additions & 2 deletions ComicRead.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -6835,9 +6835,9 @@ const useFab = async initProps => {
var _tmpl$$1 = /*#__PURE__*/web.template(\`<h2>🥳 ComicRead 已更新到 v\`),
_tmpl$2 = /*#__PURE__*/web.template(\`<h3>新增\`),
_tmpl$3 = /*#__PURE__*/web.template(\`<ul><li>kemono.su 新增是否加载原图的开关 (<a href=https://github.com/hymbz/ComicReadScript/commit/0fc6ea98ff349b4931b22d8803c03d8a7e141d4d>0fc6ea9</a>), closes <a href=https://github.com/hymbz/ComicReadScript/issues/158>#158\`),
_tmpl$3 = /*#__PURE__*/web.template(\`<ul><li>kemono.su 新增是否加载原图的开关\`),
_tmpl$4 = /*#__PURE__*/web.template(\`<h3>修复\`),
_tmpl$5 = /*#__PURE__*/web.template(\`<ul><li>修复双页模式下两页图片中间有缝隙的 bug (<a href=https://github.com/hymbz/ComicReadScript/commit/0e00e7be57f90efe205ae6a265e4229424e7fbd2>0e00e7b</a>), closes <a href=https://github.com/hymbz/8/issues/pid64549617>8#pid64549617\`);
_tmpl$5 = /*#__PURE__*/web.template(\`<ul><li>修复双页模式下两页图片中间有缝隙的 bug\`);
/** 重命名配置项 */
const renameOption = async (name, list) => {
Expand Down
3 changes: 3 additions & 0 deletions docs/.other/Dev.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## TODO

- 卷轴模式优化
<!-- https://sleazyfork.org/zh-CN/scripts/374903-comicread/discussions/237728 -->

## 调试

```bash
Expand Down
5 changes: 2 additions & 3 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ const latestChangeHtml = await (() => {
.replaceAll('Bug Fixes', '修复')
.replaceAll('Performance Improvements', '优化');
case '*':
return mdText.replace(
// eslint-disable-next-line unicorn/better-regex
/(?<=^\* ):\w+?: |(?<=^.*)\(\[\w+\]\(.+?\)\).*/,
return mdText.replaceAll(
/(?<=^\* ):\w+?: |(?<=^.*)\(\[\w+]\(.+?\)\).*/g,
'',
);
default:
Expand Down
4 changes: 2 additions & 2 deletions src/rollup-plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ const extractI18n: OutputPluginOption = {
.filter((l) => l !== 'zh')
.map(
(langName) =>
`case '${langName}': return '${byPath(
`case '${langName}': return '${byPath<string>(
langMap[langName],
key,
)}';`,
)
.join('')}
default: return '${byPath(langMap.zh, key)}';
default: return '${byPath<string>(langMap.zh, key)}';
}
})`,
);
Expand Down
13 changes: 6 additions & 7 deletions src/rollup-plugin/rollup-solid-svg.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-disable import/no-extraneous-dependencies */
import { readFile } from 'node:fs/promises';
import type { TransformResult } from 'rollup';
import type { Config } from 'svgo';
import { optimize } from 'svgo';
import type { Plugin } from 'vite';

import { type TransformResult } from 'rollup';
import { type Config, optimize } from 'svgo';
import { type Plugin } from 'vite';
import solid from 'vite-plugin-solid';

/** svgo 配置 */
Expand Down Expand Up @@ -47,8 +46,8 @@ export function solidSvg(): Plugin {
code = optimized || code;

return `export default (props = {}) => ${code
.replace(/([{}])/g, "{'$1'}")
.replace(/<!--\s*([\s\S]*?)\s*-->/g, '{/* $1 */}')
.replaceAll(/([{}])/g, "{'$1'}")
.replaceAll(/<!--\s*([\s\S]*?)\s*-->/g, '{/* $1 */}')
.replace(/(?<=<svg.*?)(>)/i, ' {...props}>')}`;
},

Expand Down

0 comments on commit 3226307

Please sign in to comment.