ultimate-jekyll-manager 0.0.57 → 0.0.58

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.
@@ -138,34 +138,35 @@ function sass(complete) {
138
138
  'src/assets/js/**/*.js',
139
139
  ];
140
140
 
141
- // Log the files that will be analyzed
142
- logger.log('PurgeCSS content patterns:', contentPatterns);
143
-
144
- // Separate inclusion and exclusion patterns for glob
145
- const includePatterns = contentPatterns.filter(p => !p.startsWith('!'));
146
- const excludePatterns = contentPatterns.filter(p => p.startsWith('!')).map(p => p.substring(1));
147
-
148
- // Use glob to get the actual files (respecting exclusions)
149
- const allFiles = glob(includePatterns, { ignore: excludePatterns });
150
-
151
- logger.log(`PurgeCSS will analyze ${allFiles.length} total files:`);
152
-
153
- // Group files by type for better readability
154
- const fileGroups = {
155
- 'HTML/Liquid/MD files': allFiles.filter(f => /\.(html|liquid|md)$/.test(f)),
156
- 'JavaScript files': allFiles.filter(f => /\.js$/.test(f))
157
- };
158
-
159
- Object.entries(fileGroups).forEach(([groupName, files]) => {
160
- if (files.length > 0) {
161
- logger.log(` ${groupName}: ${files.length} files`);
162
- // Show first 5 files as examples
163
- files.forEach(file => {
164
- logger.log(` - ${file}`);
165
- });
166
- }
167
- });
168
-
141
+ // // Log the files that will be analyzed
142
+ // logger.log('PurgeCSS content patterns:', contentPatterns);
143
+
144
+ // // Separate inclusion and exclusion patterns for glob
145
+ // const includePatterns = contentPatterns.filter(p => !p.startsWith('!'));
146
+ // const excludePatterns = contentPatterns.filter(p => p.startsWith('!')).map(p => p.substring(1));
147
+
148
+ // // Use glob to get the actual files (respecting exclusions)
149
+ // const allFiles = glob(includePatterns, { ignore: excludePatterns });
150
+
151
+ // logger.log(`PurgeCSS will analyze ${allFiles.length} total files:`);
152
+
153
+ // // Group files by type for better readability
154
+ // const fileGroups = {
155
+ // 'HTML/Liquid/MD files': allFiles.filter(f => /\.(html|liquid|md)$/.test(f)),
156
+ // 'JavaScript files': allFiles.filter(f => /\.js$/.test(f))
157
+ // };
158
+
159
+ // Object.entries(fileGroups).forEach(([groupName, files]) => {
160
+ // if (files.length > 0) {
161
+ // logger.log(` ${groupName}: ${files.length} files`);
162
+ // // Show first 5 files as examples
163
+ // files.forEach(file => {
164
+ // logger.log(` - ${file}`);
165
+ // });
166
+ // }
167
+ // });
168
+
169
+ // Apply PurgeCSS
169
170
  stream = stream.pipe(postcss([
170
171
  purgeCss({
171
172
  content: contentPatterns,
@@ -248,6 +249,7 @@ function sass(complete) {
248
249
  ]));
249
250
  }
250
251
 
252
+ // Process
251
253
  return stream
252
254
  .pipe(cleanCSS({
253
255
  format: Manager.actLikeProduction() ? 'compressed' : 'beautify',
@@ -307,15 +307,33 @@ function webpack(complete) {
307
307
  // Log
308
308
  logger.log('Finished!');
309
309
 
310
- // Error
310
+ // Handle fatal webpack errors
311
311
  if (e) {
312
- logger.error(e);
313
- } else {
314
- logger.log('Stats:\n', stats.toString({ colors: true }));
312
+ logger.error('Fatal webpack error:', e);
313
+ return complete(e);
314
+ }
315
+
316
+ // Log stats
317
+ const statsString = stats.toString({ colors: true });
318
+ logger.log('Stats:\n', statsString);
319
+
320
+ // Check for compilation errors
321
+ if (stats.hasErrors()) {
322
+ const info = stats.toJson();
323
+ logger.error('Webpack compilation failed with errors');
324
+ // Create an error to pass to complete() so the build fails
325
+ const compilationError = new Error(`Webpack compilation failed: ${info.errors.length} error(s)`);
326
+ return complete(compilationError);
315
327
  }
316
328
 
317
- // Complete
318
- return complete(e);
329
+ // Check for warnings (optional - don't fail build but log them)
330
+ if (stats.hasWarnings()) {
331
+ const info = stats.toJson();
332
+ logger.warn(`Webpack compilation completed with ${info.warnings.length} warning(s)`);
333
+ }
334
+
335
+ // Complete successfully
336
+ return complete();
319
337
  });
320
338
  }
321
339
  // Watcher task
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultimate-jekyll-manager",
3
- "version": "0.0.57",
3
+ "version": "0.0.58",
4
4
  "description": "Ultimate Jekyll dependency manager",
5
5
  "main": "dist/index.js",
6
6
  "exports": {