coralite-scripts 0.41.0 → 0.43.0
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/libs/commands/build.js +30 -9
- package/package.json +2 -2
package/libs/commands/build.js
CHANGED
|
@@ -57,6 +57,7 @@ export async function buildCommand (config, options, logger = null) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
const validFiles = new Set()
|
|
60
|
+
let componentSpinner
|
|
60
61
|
|
|
61
62
|
const coralite = await createCoralite({
|
|
62
63
|
components: config.components,
|
|
@@ -81,15 +82,38 @@ export async function buildCommand (config, options, logger = null) {
|
|
|
81
82
|
}
|
|
82
83
|
})
|
|
83
84
|
|
|
84
|
-
|
|
85
|
+
/** @type {any} */
|
|
86
|
+
let spinner = null
|
|
85
87
|
let pageCount = 0
|
|
86
88
|
let skippedCount = 0
|
|
87
89
|
|
|
88
90
|
try {
|
|
89
|
-
const componentCount = 0
|
|
90
|
-
|
|
91
91
|
if (!options.verbose) {
|
|
92
|
-
|
|
92
|
+
componentSpinner = createSpinner('Building components...').start()
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const onComponentBuild = async (info) => {
|
|
96
|
+
if (options.verbose) {
|
|
97
|
+
for (const detail of info.details) {
|
|
98
|
+
const status = detail.status === 'built' ? colours.green('[+] built: ') : colours.gray('[-] skipped: ')
|
|
99
|
+
const reason = detail.reason ? colours.gray(` (${detail.reason})`) : ''
|
|
100
|
+
log(toTime() + status + detail.id + reason + '\n')
|
|
101
|
+
}
|
|
102
|
+
} else if (componentSpinner) {
|
|
103
|
+
if (info.skipped > 0) {
|
|
104
|
+
componentSpinner.succeed(`Components built (${info.completed} completed, ${info.skipped} skipped)`)
|
|
105
|
+
} else {
|
|
106
|
+
componentSpinner.succeed(`Components built (${info.completed} completed)`)
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (!options.verbose) {
|
|
111
|
+
spinner = createSpinner('Building pages...').start()
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const buildOptions = {
|
|
116
|
+
onComponentBuild
|
|
93
117
|
}
|
|
94
118
|
|
|
95
119
|
const updateSpinnerText = () => {
|
|
@@ -100,7 +124,7 @@ export async function buildCommand (config, options, logger = null) {
|
|
|
100
124
|
}
|
|
101
125
|
}
|
|
102
126
|
|
|
103
|
-
await coralite.build(async (result) => {
|
|
127
|
+
await coralite.build(null, buildOptions, async (result) => {
|
|
104
128
|
const relativeDir = relative(config.pages, result.path.dirname)
|
|
105
129
|
const outDir = join(config.output, relativeDir)
|
|
106
130
|
const outFile = join(outDir, result.path.filename)
|
|
@@ -174,15 +198,12 @@ export async function buildCommand (config, options, logger = null) {
|
|
|
174
198
|
}
|
|
175
199
|
}
|
|
176
200
|
|
|
177
|
-
if (!options.verbose) {
|
|
201
|
+
if (!options.verbose && spinner) {
|
|
178
202
|
if (skippedCount > 0) {
|
|
179
203
|
spinner.succeed(`Pages built (${pageCount} completed, ${skippedCount} skipped)`)
|
|
180
204
|
} else {
|
|
181
205
|
spinner.succeed(`Pages built (${pageCount} completed)`)
|
|
182
206
|
}
|
|
183
|
-
if (componentCount > 0) {
|
|
184
|
-
createSpinner(`Components built (${componentCount} completed)`).succeed()
|
|
185
|
-
}
|
|
186
207
|
}
|
|
187
208
|
|
|
188
209
|
const trackedFiles = coralite.getTrackedOutputFiles()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coralite-scripts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"description": "Configuration and scripts for Create Coralite.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"portfinder": "^1.0.38",
|
|
62
62
|
"postcss": "^8.5.15",
|
|
63
63
|
"sass": "^1.101.0",
|
|
64
|
-
"coralite": "0.
|
|
64
|
+
"coralite": "0.43.0"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "premove dist && pnpm build:types",
|