@fullstackunicorn/style 1.0.4 → 1.0.5

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/index.js CHANGED
@@ -78,7 +78,7 @@ export const run = async (setup) => {
78
78
  files.writeUse(isWeb, isNative, defaultSass, defaultHtmlSass)
79
79
  files.writeFonts(fontContents.alphabets, fontContents.names)
80
80
 
81
- logs.prepare( fontContents.fonts, colorContents, styleContents)
81
+ logs.prepare( fontContents.fonts, colorContents, styleContents, parsed)
82
82
  logs.toConsole()
83
83
  logs.toMarkdown(setup.LOGS_PATH)
84
84
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.4",
2
+ "version": "1.0.5",
3
3
  "name": "@fullstackunicorn/style",
4
4
  "author": "lucanigido (https://fullstackunicorn.dev/author/lucanigido)",
5
5
  "description": "A development utility for generating responsive web and native styles (CSS, SCSS, JS, RN) from a declarative style.config.js file.",
package/sources/logs.js CHANGED
@@ -1,4 +1,5 @@
1
- import { fss, path } from '#@/dependencies.js'
1
+ import { fss } from '#@/imports/index.js'
2
+ import path from 'path'
2
3
 
3
4
  class Logs {
4
5
 
@@ -15,10 +16,27 @@ class Logs {
15
16
  })
16
17
  }
17
18
 
18
- prepare(fonts, colors, styles) {
19
+ // fonts = fontContents.fonts
20
+ // colors = colorContents
21
+ // styles = styleContents
22
+ // parsed = { f, c, s }
23
+ prepare(fonts, colors, styles, parsed) {
24
+
25
+ const totals = {
26
+ fonts: parsed?.f?.length || 0,
27
+ colors: parsed?.c?.length || 0,
28
+ styles: parsed?.s?.length || 0
29
+ }
30
+
19
31
  this.data = {
20
32
  date: this.humanDate(),
21
33
 
34
+ all: {
35
+ fonts: parsed?.f || [],
36
+ colors: parsed?.c || [],
37
+ styles: parsed?.s || []
38
+ },
39
+
22
40
  missing: {
23
41
  fonts: fonts.missingFont || [],
24
42
  colors: colors.missing || [],
@@ -35,50 +53,41 @@ class Logs {
35
53
  fonts: fonts.present || [] // platform variants
36
54
  },
37
55
 
38
- totals: {
39
- fonts: fonts.total || 0,
40
- colors: colors.total || 0,
41
- styles: styles.total || 0
42
- },
43
-
44
- platformsMissing: fonts.missingPlatform || 0
56
+ totals,
57
+ platformsMissing: (fonts.missingPlatform || []).length
45
58
  }
46
59
  }
47
60
 
48
61
  toConsole() {
49
62
  const d = this.data
50
63
 
51
- console.log("")
52
- console.log("FONT MISSING:", d.missing.fonts.length)
53
- console.log("FONT PLATFORM MISSING:", d.platformsMissing)
54
- console.log("FONT variants:", d.variants.fonts.length)
55
- console.log("FONT present:", d.present.fonts.length)
56
- console.log("FONT total:", d.totals.fonts)
57
- console.log("")
58
-
59
- console.log("COLORS MISSING:", d.missing.colors.length)
60
- console.log("COLORS present:", d.present.colors.length)
61
- console.log("COLORS total:", d.totals.colors)
62
- console.log("")
63
-
64
- console.log("STYLES MISSING:", d.missing.styles.length)
65
- console.log("STYLES present:", d.present.styles.length)
66
- console.log("STYLES total:", d.totals.styles)
67
- console.log("")
68
-
69
- console.log("Missing font:", d.missing.fonts.length)
70
- console.log("Missing font platform:", d.platformsMissing)
71
- console.log("Colors missing:", d.missing.colors.length)
72
- console.log("Styles missing:", d.missing.styles.length)
73
- console.log("")
64
+ console.log(`\nFONT MISSING: ${d.missing.fonts.length}`)
65
+ console.log(`FONT PLATFORM MISSING: ${d.platformsMissing}`)
66
+ console.log(`FONT variants: ${d.variants.fonts.length}`)
67
+ console.log(`FONT present: ${d.present.fonts.length}`)
68
+ console.log(`FONT total: ${d.totals.fonts}\n`)
69
+
70
+ console.log(`COLORS MISSING: ${d.missing.colors.length}`)
71
+ console.log(`COLORS present: ${d.present.colors.length}`)
72
+ console.log(`COLORS total: ${d.totals.colors}\n`)
73
+
74
+ console.log(`STYLES MISSING: ${d.missing.styles.length}`)
75
+ console.log(`STYLES present: ${d.present.styles.length}`)
76
+ console.log(`STYLES total: ${d.totals.styles}\n`)
77
+
78
+ console.log(`Missing font: ${d.missing.fonts.length}`)
79
+ console.log(`Missing font platform: ${d.platformsMissing}`)
80
+ console.log(`Colors missing: ${d.missing.colors.length}`)
81
+ console.log(`Styles missing: ${d.missing.styles.length}\n`)
74
82
  }
75
83
 
76
84
  markdownList(arr) {
77
- if (!arr?.length) return "(none)"
85
+ if (!arr?.length) return '(none)'
78
86
  return arr.join('\n')
79
87
  }
80
88
 
81
89
  toMarkdown(dirPath) {
90
+
82
91
  const folder = dirPath || './.devtools'
83
92
  if (!fss.exists(folder)) fss.ensureDir(folder)
84
93
 
@@ -100,6 +109,18 @@ ${this.markdownList(d.missing.colors)}
100
109
  ${this.markdownList(d.missing.styles)}
101
110
 
102
111
 
112
+ ## All
113
+
114
+ ### Fonts (${d.totals.fonts})
115
+ ${this.markdownList(d.all.fonts)}
116
+
117
+ ### Colors (${d.totals.colors})
118
+ ${this.markdownList(d.all.colors)}
119
+
120
+ ### Styles (${d.totals.styles})
121
+ ${this.markdownList(d.all.styles)}
122
+
123
+
103
124
  ## Present
104
125
 
105
126
  ### Fonts (${d.present.fonts.length})