@massimo-cassandro/minimo 1.19.4 → 1.19.6
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.
- package/design-tokens/README.md +1 -1
- package/design-tokens/_src/color-accent.minimo.tokens.mjs +6 -9
- package/design-tokens/_src/text.minimo.tokens.mjs +1 -1
- package/design-tokens/tokens/design-tokens/_src/color-accent.minimo.tokens.jsonc +6 -8
- package/design-tokens/tokens/design-tokens/_src/text.minimo.tokens.jsonc +0 -6
- package/design-tokens/tokens/src/web-components/s-datatable-component/simple-datatable.minimo.tokens.jsonc +1 -1
- package/design-tokens/tokens-config-sample.mjs +6 -0
- package/design-tokens/utilities/check-unresolved-custom-props.mjs +23 -11
- package/dev-tools/starter-kit/templates/package-tpl.json +1 -1
- package/package.json +1 -1
- package/src/css/text.css +1 -1
- package/src/custom-properties.css +3 -4
- package/src/web-components/s-datatable-component/simple-datatable.minimo.tokens.mjs +1 -1
package/design-tokens/README.md
CHANGED
|
@@ -163,7 +163,7 @@ Alias references (`{color.brand.primary}`) are preserved in the output so Penpot
|
|
|
163
163
|
Scans all `.css` files in `dirToCheck` (recursively) and reports:
|
|
164
164
|
|
|
165
165
|
- **unresolved properties** — `var(--...)` references that are not defined in the generated token CSS file or in any `extraCustomPropsFiles`
|
|
166
|
-
- **unused properties** — custom properties defined in the generated token CSS file (or an `extraCustomPropsFiles` entry) but never referenced via `var()` in any scanned CSS file. Only reported if `checkUnused: true` is set in the config, since it re-runs the Style Dictionary transform pipeline over the token sources to resolve, when possible, the `.mjs` source file for each unused property.
|
|
166
|
+
- **unused properties** — custom properties defined in the generated token CSS file (or an `extraCustomPropsFiles` entry) but never referenced via `var()` in any scanned CSS file. Only reported if `checkUnused: true` is set in the config, since it re-runs the Style Dictionary transform pipeline over the token sources to resolve, when possible, the `.mjs` source file for each unused property. When `ignoreUnusedInNodeModules` is true (default), properties sourced from a token file under `node_modules` (e.g. a third-party token package) are never reported as unused.
|
|
167
167
|
|
|
168
168
|
Results are written to `unresolved-unused-props.md` in the same directory as the config file.
|
|
169
169
|
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
accent: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
'
|
|
8
|
-
|
|
9
|
-
$type: 'color'
|
|
10
|
-
}
|
|
3
|
+
$value: '#567d0d',
|
|
4
|
+
$type: 'color'
|
|
5
|
+
},
|
|
6
|
+
'accent-fg': {
|
|
7
|
+
$value: '#fff',
|
|
8
|
+
$type: 'color'
|
|
11
9
|
}
|
|
12
|
-
|
|
13
10
|
};
|
|
@@ -6,13 +6,11 @@
|
|
|
6
6
|
// -----------------------------------------------------------------------
|
|
7
7
|
{
|
|
8
8
|
"accent": {
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
"$value": "#fff"
|
|
16
|
-
}
|
|
9
|
+
"$type": "color",
|
|
10
|
+
"$value": "#567d0d"
|
|
11
|
+
},
|
|
12
|
+
"accent-fg": {
|
|
13
|
+
"$type": "color",
|
|
14
|
+
"$value": "#fff"
|
|
17
15
|
}
|
|
18
16
|
}
|
|
@@ -5,12 +5,6 @@
|
|
|
5
5
|
// Re-generate with: node build-tokens.mjs --config <path/to/config>
|
|
6
6
|
// -----------------------------------------------------------------------
|
|
7
7
|
{
|
|
8
|
-
"accent": {
|
|
9
|
-
"color": {
|
|
10
|
-
"$type": "color",
|
|
11
|
-
"$value": "{accent.100}"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
8
|
"text": {
|
|
15
9
|
"muted": {
|
|
16
10
|
"$type": "color",
|
|
@@ -96,6 +96,12 @@ const config = {
|
|
|
96
96
|
// .mjs source file for each unused property. Default: false.
|
|
97
97
|
checkUnused: true,
|
|
98
98
|
|
|
99
|
+
// When checkUnused is true: if true (default), custom properties sourced
|
|
100
|
+
// from a token file under node_modules (e.g. a third-party token package)
|
|
101
|
+
// are never reported as unused — the consuming project isn't expected to
|
|
102
|
+
// prune those.
|
|
103
|
+
ignoreUnusedInNodeModules: true,
|
|
104
|
+
|
|
99
105
|
// Additional CSS files that define custom properties used in the project
|
|
100
106
|
// but not generated by build-tokens (e.g. third-party libraries)
|
|
101
107
|
extraCustomPropsFiles: [
|
|
@@ -143,19 +143,13 @@ async function run() {
|
|
|
143
143
|
// just to resolve source files, which adds a noticeable cost.
|
|
144
144
|
const checkUnused = config.checkUnused === true;
|
|
145
145
|
|
|
146
|
-
//
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
|
|
150
|
-
// ---------------------------------------------------------------------------
|
|
151
|
-
const unused_props = checkUnused
|
|
152
|
-
? defined_props
|
|
153
|
-
.filter(item => !used_props_set.has(item.prop))
|
|
154
|
-
.sort((a, b) => a.prop.localeCompare(b.prop))
|
|
155
|
-
: [];
|
|
146
|
+
// If true (default), properties sourced from a token file under
|
|
147
|
+
// node_modules (e.g. a third-party token package) are never reported as
|
|
148
|
+
// unused — the consuming project isn't expected to prune those.
|
|
149
|
+
const ignoreUnusedInNodeModules = config.ignoreUnusedInNodeModules !== false;
|
|
156
150
|
|
|
157
151
|
// ---------------------------------------------------------------------------
|
|
158
|
-
//
|
|
152
|
+
// 5. Best-effort: resolve the .mjs token source file for each defined
|
|
159
153
|
// property, by running the same transform pipeline used to generate the
|
|
160
154
|
// CSS (see build-tokens-src/formats/css.mjs) over the token sources
|
|
161
155
|
// declared in config.source. Properties that only exist in the generated
|
|
@@ -184,6 +178,24 @@ async function run() {
|
|
|
184
178
|
}
|
|
185
179
|
}
|
|
186
180
|
|
|
181
|
+
// ---------------------------------------------------------------------------
|
|
182
|
+
// 6. Build the list of unused custom properties (defined but never
|
|
183
|
+
// referenced via var() in any scanned CSS file) — the opposite check
|
|
184
|
+
// of section 4. Properties sourced from node_modules are skipped when
|
|
185
|
+
// ignoreUnusedInNodeModules is true (default).
|
|
186
|
+
// ---------------------------------------------------------------------------
|
|
187
|
+
const unused_props = checkUnused
|
|
188
|
+
? defined_props
|
|
189
|
+
.filter(item => !used_props_set.has(item.prop))
|
|
190
|
+
.filter(item => {
|
|
191
|
+
if (!ignoreUnusedInNodeModules) return true;
|
|
192
|
+
const sourceFilePath = sourceFileByProp.get(item.prop);
|
|
193
|
+
if (!sourceFilePath) return true;
|
|
194
|
+
return !/(^|[\\/])node_modules([\\/]|$)/.test(sourceFilePath);
|
|
195
|
+
})
|
|
196
|
+
.sort((a, b) => a.prop.localeCompare(b.prop))
|
|
197
|
+
: [];
|
|
198
|
+
|
|
187
199
|
// ---------------------------------------------------------------------------
|
|
188
200
|
// 7. Write the report
|
|
189
201
|
// ---------------------------------------------------------------------------
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"launchChrome": "open -n -a 'Google Chrome' --args --profile-directory='Profile 3'",
|
|
28
28
|
"python server": "python3 -m http.server 8000 # --directory __dirname__ # 8000 = default port",
|
|
29
29
|
"php server": "php -S localhost:8000 # -t root_dir/",
|
|
30
|
-
"symfony
|
|
30
|
+
"symfony server": "symfony serve -d --port=8100 --listen-ip=0.0.0.0 # symfony server:stop # http://192.168.1.135:8100",
|
|
31
31
|
"node server": "node serve # richiede ‘npm i serve’",
|
|
32
32
|
"build tokens": "npx buildTokens --config ./path/to/tokens-config.mjs",
|
|
33
33
|
"check unresolved props": "npx checkUnresolvedProps --config ./path/to/tokens-config.mjs"
|
package/package.json
CHANGED
package/src/css/text.css
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--accent
|
|
3
|
-
--accent-
|
|
4
|
-
--accent-color: var(--accent-100);
|
|
2
|
+
--accent: #567d0d;
|
|
3
|
+
--accent-fg: #fff;
|
|
5
4
|
|
|
6
5
|
--alert-border-radius: var(--radius-sm);
|
|
7
6
|
--alert-box-shadow: 0 0 .5rem 0 oklch(0% 0 0 / .5);
|
|
@@ -275,7 +274,7 @@
|
|
|
275
274
|
--sdt-pagination-border: var(--btn-border-width) var(--neutral-100);
|
|
276
275
|
--sdt-pagination-padding-block: var(--size-xxs);
|
|
277
276
|
--sdt-pagination-padding-inline: var(--size-xs);
|
|
278
|
-
--sdt-thead-hover-background-color: color-mix(in srgb, var(--table-thead-background-color) 90%, var(--accent
|
|
277
|
+
--sdt-thead-hover-background-color: color-mix(in srgb, var(--table-thead-background-color) 90%, var(--accent));
|
|
279
278
|
|
|
280
279
|
--secondary-100: #650853;
|
|
281
280
|
--secondary-100-fg: #fff;
|