@massimo-cassandro/minimo 1.38.3 → 1.38.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,9 @@
4
4
  // and a `dark` mode, custom properties present in BOTH — matched by name —
5
5
  // are written once, as `--name: light-dark(<light-value>, <dark-value>);`,
6
6
  // instead of being split across the base mode's top-level `:root { ... }`
7
- // block and a `@media (prefers-color-scheme: dark) { ... }` block.
7
+ // block and a `@media (prefers-color-scheme: dark) { ... }` block. If the two
8
+ // values are identical, light-dark() would be redundant: the bare value is
9
+ // written instead, e.g. `--name: <value>;`.
8
10
  //
9
11
  // Only `light` and `dark` are affected:
10
12
  // - a third mode (e.g. a custom `high-contrast` key in sourceModes) is left
@@ -74,7 +76,12 @@ export const applyLightDarkFunc = ({ modeFinalProps, modeNames, baseMode, select
74
76
  // Prefers the light-side trailing comment (e.g. a token $description);
75
77
  // falls back to the dark-side one if light has none.
76
78
  const comment = light.comment || dark.comment;
77
- sharedProps[name] = `light-dark(${light.value}, ${dark.value});${comment ? ` ${comment}` : ''}`;
79
+ // Equal light/dark values: light-dark(x, x) would be redundant — use the
80
+ // bare value directly instead.
81
+ const value = light.value === dark.value
82
+ ? light.value
83
+ : `light-dark(${light.value}, ${dark.value})`;
84
+ sharedProps[name] = `${value};${comment ? ` ${comment}` : ''}`;
78
85
  }
79
86
 
80
87
  const stripCommon = (props) => {
@@ -138,7 +138,7 @@ const { CustomPropsPurgeCssPlugin } = runCustomPropsPlugin
138
138
  // NB: PurgeCSS elabora ogni asset css singolarmente, quindi i @keyframes
139
139
  // definiti nello `shared.css` ma usati solo in un altro asset (es. un css di
140
140
  // progetto che usa una animation di minimo) verrebbero rimossi: in tal caso
141
- // aggiungerli a `safelist.keyframes` o impostare `keyframes: false` in
141
+ // aggiungerli a 'safelist.keyframes' o impostare `keyframes: false` in
142
142
  // `purgeCSSOptions`
143
143
  const shared_chunk_paths = (module) => {
144
144
 
@@ -146,7 +146,6 @@ const shared_chunk_paths = (module) => {
146
146
  const sep = '[\\\\/]'; // stringa che produce [\\/] nel pattern
147
147
  const pathsRegexp = new RegExp([
148
148
  'node_modules',
149
- 'app/src',
150
149
  'app/src/js',
151
150
  'app/src/web-components',
152
151
  'app/src/components',
@@ -411,8 +410,7 @@ const config = {
411
410
  // fileName: path.join(output_dir, 'manifest.json'),
412
411
  // sf: fileName: 'manifest.json', // scrive in output.path
413
412
  // // basePath: item.source_dirname
414
- // // removeKeyHash: /(^(_assets\/(?!(fonts\/))))|((\?as_asset)$)/,
415
- // removeKeyHash: true, // /([a-f0-9]{32}\.?)/gi, // /(\?as_asset)$/,
413
+ // // removeKeyHash: /\?.*$/, // /([a-f0-9]{32}\.?)/gi, // /(\?as_asset)$/,
416
414
  // // rimuove i font dal manifest. Non necessari, rendono il file inutilmente grande
417
415
  // filter: isDevelopment? undefined : (FileDescriptor) => {
418
416
  // return /fonts/.test(FileDescriptor.path)? false : true;
@@ -8,6 +8,10 @@ Le versioni precedenti sono conservate in `archived/webpack-config-v2/` del repo
8
8
 
9
9
  ---
10
10
 
11
+ ## Fix da verificare sempre
12
+ * WebpackManifestPlugin: impostare `removeKeyHash: /\?.*$/, // /([a-f0-9]{32}\.?)/gi, // /(\?as_asset)$/,`, sostituendo eventuali impostazione `removeKeyHash: true` se presente
13
+
14
+
11
15
  ## Da v2 a v3
12
16
 
13
17
  Novità della v3: le definizioni delle custom properties non sono più gestite da PurgeCSS (`variables`) né da postcss-jit-props, ma da un plugin webpack dedicato, `custom-props-purgecss-plugin.mjs`, che opera sugli asset CSS finali (dopo la minificazione) e inietta solo le custom properties effettivamente usate (dipendenze transitive incluse), partendo dal file master `app/css/custom-properties.css`. Il plugin è attivabile con un flag, indipendente da `usePurgeCss`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massimo-cassandro/minimo",
3
- "version": "1.38.3",
3
+ "version": "1.38.4",
4
4
  "description": "Light css framework & utilities",
5
5
  "type": "module",
6
6
  "main": "./index.js",