@fullstackunicorn/style 1.0.4 → 1.0.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/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.6",
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
@@ -15,10 +15,27 @@ class Logs {
15
15
  })
16
16
  }
17
17
 
18
- prepare(fonts, colors, styles) {
18
+ // fonts = fontContents.fonts
19
+ // colors = colorContents
20
+ // styles = styleContents
21
+ // parsed = { f, c, s }
22
+ prepare(fonts, colors, styles, parsed) {
23
+
24
+ const totals = {
25
+ fonts: parsed?.f?.length || 0,
26
+ colors: parsed?.c?.length || 0,
27
+ styles: parsed?.s?.length || 0
28
+ }
29
+
19
30
  this.data = {
20
31
  date: this.humanDate(),
21
32
 
33
+ all: {
34
+ fonts: parsed?.f || [],
35
+ colors: parsed?.c || [],
36
+ styles: parsed?.s || []
37
+ },
38
+
22
39
  missing: {
23
40
  fonts: fonts.missingFont || [],
24
41
  colors: colors.missing || [],
@@ -35,50 +52,41 @@ class Logs {
35
52
  fonts: fonts.present || [] // platform variants
36
53
  },
37
54
 
38
- totals: {
39
- fonts: fonts.total || 0,
40
- colors: colors.total || 0,
41
- styles: styles.total || 0
42
- },
43
-
44
- platformsMissing: fonts.missingPlatform || 0
55
+ totals,
56
+ platformsMissing: (fonts.missingPlatform || []).length
45
57
  }
46
58
  }
47
59
 
48
60
  toConsole() {
49
61
  const d = this.data
50
62
 
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("")
63
+ console.log(`\nFONT MISSING: ${d.missing.fonts.length}`)
64
+ console.log(`FONT PLATFORM MISSING: ${d.platformsMissing}`)
65
+ console.log(`FONT variants: ${d.variants.fonts.length}`)
66
+ console.log(`FONT present: ${d.present.fonts.length}`)
67
+ console.log(`FONT total: ${d.totals.fonts}\n`)
68
+
69
+ console.log(`COLORS MISSING: ${d.missing.colors.length}`)
70
+ console.log(`COLORS present: ${d.present.colors.length}`)
71
+ console.log(`COLORS total: ${d.totals.colors}\n`)
72
+
73
+ console.log(`STYLES MISSING: ${d.missing.styles.length}`)
74
+ console.log(`STYLES present: ${d.present.styles.length}`)
75
+ console.log(`STYLES total: ${d.totals.styles}\n`)
76
+
77
+ console.log(`Missing font: ${d.missing.fonts.length}`)
78
+ console.log(`Missing font platform: ${d.platformsMissing}`)
79
+ console.log(`Colors missing: ${d.missing.colors.length}`)
80
+ console.log(`Styles missing: ${d.missing.styles.length}\n`)
74
81
  }
75
82
 
76
83
  markdownList(arr) {
77
- if (!arr?.length) return "(none)"
84
+ if (!arr?.length) return '(none)'
78
85
  return arr.join('\n')
79
86
  }
80
87
 
81
88
  toMarkdown(dirPath) {
89
+
82
90
  const folder = dirPath || './.devtools'
83
91
  if (!fss.exists(folder)) fss.ensureDir(folder)
84
92
 
@@ -100,6 +108,18 @@ ${this.markdownList(d.missing.colors)}
100
108
  ${this.markdownList(d.missing.styles)}
101
109
 
102
110
 
111
+ ## All
112
+
113
+ ### Fonts (${d.totals.fonts})
114
+ ${this.markdownList(d.all.fonts)}
115
+
116
+ ### Colors (${d.totals.colors})
117
+ ${this.markdownList(d.all.colors)}
118
+
119
+ ### Styles (${d.totals.styles})
120
+ ${this.markdownList(d.all.styles)}
121
+
122
+
103
123
  ## Present
104
124
 
105
125
  ### Fonts (${d.present.fonts.length})