From 90fd555a9f820955683f1df9d050ae220aee8d4d Mon Sep 17 00:00:00 2001 From: charlie Date: Mon, 23 Mar 2026 14:35:00 +0800 Subject: [PATCH] fix: streamline gulpfile with rawCopySrc utility and enhance container styles --- gulpfile.js | 28 ++++++++++++---------- package.json | 1 - src/main/frontend/components/container.css | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index dbf4434bf0..aea200f330 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,6 +15,8 @@ const mobileJsPath = path.join(mobilePath, 'js') const sourcePath = path.join(__dirname, 'src/main/frontend') const resourceFilePath = path.join(resourcesPath, '**') const outputFilePath = path.join(outputPath, '**') +const rawCopySrc = (globs, options = {}) => + gulp.src(globs, { encoding: false, ...options }) const staticCleanKeep = new Set([ 'entitlements.plist', 'forge.config.js', @@ -76,13 +78,13 @@ const common = { }, syncResourceFile () { - return gulp.src(resourceFilePath).pipe(gulp.dest(outputPath)) + return rawCopySrc(resourceFilePath).pipe(gulp.dest(outputPath)) }, // NOTE: All assets from node_modules are copied to the output directory syncAssetFiles (...params) { return gulp.series( - () => gulp.src([ + () => rawCopySrc([ 'node_modules/katex/dist/katex.min.js', 'node_modules/katex/dist/contrib/mhchem.min.js', 'node_modules/html2canvas/dist/html2canvas.min.js', @@ -106,28 +108,28 @@ const common = { pipe(replace('"@tabler/icons-react"]={},a.react,', '"tablerIcons"]={},a.React,')). pipe(gulp.dest(path.join(outputPath, 'js'))), - () => gulp.src([ + () => rawCopySrc([ 'node_modules/@glidejs/glide/dist/glide.min.js', 'node_modules/@glidejs/glide/dist/css/glide.core.min.css', 'node_modules/@glidejs/glide/dist/css/glide.theme.min.css', ]).pipe(gulp.dest(path.join(outputPath, 'js', 'glide'))), - () => gulp.src([ + () => rawCopySrc([ 'node_modules/pdfjs-dist/legacy/build/pdf.mjs', 'node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs', 'node_modules/pdfjs-dist/legacy/web/pdf_viewer.mjs', ]).pipe(gulp.dest(path.join(outputPath, 'js', 'pdfjs'))), - () => gulp.src([ + () => rawCopySrc([ 'node_modules/pdfjs-dist/cmaps/*.*', ]).pipe(gulp.dest(path.join(outputPath, 'js', 'pdfjs', 'cmaps'))), - () => gulp.src([ + () => rawCopySrc([ 'node_modules/inter-ui/inter.css', ]).pipe(gulp.dest(path.join(outputPath, 'css'))), - () => gulp.src('node_modules/inter-ui/web/*.*'). + () => rawCopySrc('node_modules/inter-ui/web/*.*'). pipe(gulp.dest(path.join(outputPath, 'css', 'web'))), - () => gulp.src([ + () => rawCopySrc([ 'node_modules/katex/dist/fonts/*.woff2', ]).pipe(gulp.dest(path.join(outputPath, 'css', 'fonts'))), - () => gulp.src([ + () => rawCopySrc([ 'node_modules/katex/dist/katex.min.js', 'node_modules/katex/dist/contrib/mhchem.min.js', 'node_modules/marked/lib/marked.umd.js', @@ -143,12 +145,12 @@ const common = { 'packages/ui/dist/ui.js', 'node_modules/@sqlite.org/sqlite-wasm/dist/sqlite3.wasm', ]).pipe(gulp.dest(path.join(outputPath, 'mobile', 'js'))), - () => gulp.src([ + () => rawCopySrc([ 'node_modules/inter-ui/inter.css', ]).pipe(gulp.dest(path.join(outputPath, 'mobile', 'css'))), - () => gulp.src('node_modules/inter-ui/web/*.*'). + () => rawCopySrc('node_modules/inter-ui/web/*.*'). pipe(gulp.dest(path.join(outputPath, 'mobile', 'css', 'web'))), - () => gulp.src([ + () => rawCopySrc([ 'node_modules/katex/dist/fonts/*.woff2', ]).pipe(gulp.dest(path.join(outputPath, 'mobile', 'css', 'fonts'))), )(...params) @@ -160,7 +162,7 @@ const common = { }, syncAllStatic () { - return gulp.src([ + return rawCopySrc([ outputFilePath, '!' + path.join(outputPath, 'node_modules/**'), '!' + path.join(outputPath, 'mobile/**'), diff --git a/package.json b/package.json index 0053d7423c..51d49d43cc 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "@tailwindcss/aspect-ratio": "0.4.2", "@tailwindcss/forms": "0.5.11", "@tailwindcss/typography": "0.5.19", - "@types/gulp": "^4.0.18", "autoprefixer": "^10.4.27", "better-sqlite3": "^12.8.0", "cross-env": "^10.1.0", diff --git a/src/main/frontend/components/container.css b/src/main/frontend/components/container.css index bca1f4d9b8..8f87d4191a 100644 --- a/src/main/frontend/components/container.css +++ b/src/main/frontend/components/container.css @@ -61,7 +61,7 @@ .left-sidebar-inner { &.as-container { @apply relative h-full pt-3 overflow-y-auto overflow-x-hidden transition-transform; - @apply transform-gpu translate-x-[-100%] z-[3]; + @apply transform-gpu translate-x-[-100%] z-[3] antialiased; width: var(--ls-left-sidebar-sm-width); background-color: var(--left-sidebar-bg-color);