Преглед изворни кода

fix(customize): remove uglifycss to preserve CSS Color Level 4 syntax

uglifycss v0.0.29 (unmaintained since 2019) corrupts space-separated
rgb() without alpha channel — valid CSS Color Level 4 syntax — by
converting it to an invalid truncated hex value (e.g. rgb(0 0 255) → #00).

Remove minification entirely. Custom CSS is typically small, so the
minification benefit is negligible compared to the risk of breaking
valid modern CSS syntax.

Fixes #11274
Claude пре 3 дана
родитељ
комит
a442a0f376
3 измењених фајлова са 1 додато и 14 уклоњено
  1. 0 1
      apps/app/package.json
  2. 1 3
      apps/app/src/server/service/customize.ts
  3. 0 10
      pnpm-lock.yaml

+ 0 - 1
apps/app/package.json

@@ -280,7 +280,6 @@
     "ts-node": "^10.9.2",
     "tsconfig-paths": "^4.2.0",
     "tslib": "^2.8.0",
-    "uglifycss": "^0.0.29",
     "uid-safe": "^2.1.5",
     "umzug": "^3.8.2",
     "unified": "^11.0.0",

+ 1 - 3
apps/app/src/server/service/customize.ts

@@ -6,7 +6,6 @@ import {
   PresetThemesMetadatas,
 } from '@growi/preset-themes';
 import path from 'path';
-import uglifycss from 'uglifycss';
 
 import { growiPluginService } from '~/features/growi-plugin/server/services';
 import loggerFactory from '~/utils/logger';
@@ -94,8 +93,7 @@ export class CustomizeService implements S2sMessageHandlable {
   initCustomCss() {
     const rawCss = configManager.getConfig('customize:css') || '';
 
-    // uglify and store
-    this.customCss = uglifycss.processString(rawCss);
+    this.customCss = rawCss;
 
     this.lastLoadedAt = new Date();
   }

+ 0 - 10
pnpm-lock.yaml

@@ -797,9 +797,6 @@ importers:
       tslib:
         specifier: ^2.8.0
         version: 2.8.1
-      uglifycss:
-        specifier: ^0.0.29
-        version: 0.0.29
       uid-safe:
         specifier: ^2.1.5
         version: 2.1.5
@@ -13523,11 +13520,6 @@ packages:
     engines: {node: '>=0.8.0'}
     hasBin: true
 
-  uglifycss@0.0.29:
-    resolution: {integrity: sha512-J2SQ2QLjiknNGbNdScaNZsXgmMGI0kYNrXaDlr4obnPW9ni1jljb1NeEVWAiTgZ8z+EBWP2ozfT9vpy03rjlMQ==}
-    engines: {node: '>=6.4.0'}
-    hasBin: true
-
   uid-safe@2.1.5:
     resolution: {integrity: sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==}
     engines: {node: '>= 0.8'}
@@ -28816,8 +28808,6 @@ snapshots:
   uglify-js@3.19.3:
     optional: true
 
-  uglifycss@0.0.29: {}
-
   uid-safe@2.1.5:
     dependencies:
       random-bytes: 1.0.0