@lmjs/cli 1.0.36 → 1.0.37

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.
Files changed (2) hide show
  1. package/lib/fcs.js +47 -39
  2. package/package.json +1 -1
package/lib/fcs.js CHANGED
@@ -250,12 +250,11 @@ function _mini(st) {
250
250
  return st;
251
251
  }
252
252
 
253
- function getAllFiles(dirPath, arrayOfFiles) {
253
+ function getAllFiles(dirPath, arrayOfFiles = {}, mini = false) {
254
254
  files = fs.readdirSync(dirPath);
255
- arrayOfFiles = arrayOfFiles || {};
256
255
  files.forEach(function (file) {
257
256
  if (fs.statSync(dirPath + path.sep + file).isDirectory()) {
258
- arrayOfFiles = getAllFiles(dirPath + path.sep + file, arrayOfFiles);
257
+ arrayOfFiles = getAllFiles(dirPath + path.sep + file, arrayOfFiles, mini);
259
258
  } else {
260
259
  let filePath = path.join(dirPath, path.sep, file);
261
260
  let fileKey = Buffer.from(
@@ -265,43 +264,48 @@ function getAllFiles(dirPath, arrayOfFiles) {
265
264
  .split("\\")
266
265
  .join("/")
267
266
  ).toString("base64");
268
- var result = _min(fs.readFileSync(filePath, { encoding: "utf8" }), {
269
- removeAttributeQuotes: false,
270
- caseSensitive: true,
271
- collapseWhitespace: true,
272
- collapseInlineTagWhitespace: true,
273
- conservativeCollapse: true,
274
- minifyJS: true,
275
- minifyCSS: false,
276
- removeComments: true,
277
- processConditionalComments: true,
278
- collapseBooleanAttributes: true,
279
- decodeEntities: true,
280
- html5: true,
281
- includeAutoGeneratedTags: false,
282
- keepClosingSlash: true,
283
- maxLineLength: null,
284
- minifyURLs: "",
285
- preserveLineBreaks: false,
286
- preventAttributesEscaping: false,
287
- processScripts: ["text/html"],
288
- quoteCharacter: "",
289
- removeEmptyAttributes: true,
290
- removeEmptyElements: false,
291
- removeOptionalTags: true,
292
- removeRedundantAttributes: true,
293
- removeScriptTypeAttributes: true,
294
- removeStyleLinkTypeAttributes: true,
295
- removeTagWhitespace: false,
296
- sortAttributes: false,
297
- sortClassName: false,
298
- trimCustomFragments: true,
299
- useShortDoctype: true,
300
- });
267
+ if (mini) {
268
+ var result = _min(fs.readFileSync(filePath, { encoding: "utf8" }), {
269
+ removeAttributeQuotes: false,
270
+ caseSensitive: true,
271
+ collapseWhitespace: true,
272
+ collapseInlineTagWhitespace: true,
273
+ conservativeCollapse: true,
274
+ minifyJS: true,
275
+ minifyCSS: false,
276
+ removeComments: true,
277
+ processConditionalComments: true,
278
+ collapseBooleanAttributes: true,
279
+ decodeEntities: true,
280
+ html5: true,
281
+ includeAutoGeneratedTags: false,
282
+ keepClosingSlash: true,
283
+ maxLineLength: null,
284
+ minifyURLs: "",
285
+ preserveLineBreaks: false,
286
+ preventAttributesEscaping: false,
287
+ processScripts: ["text/html"],
288
+ quoteCharacter: "",
289
+ removeEmptyAttributes: true,
290
+ removeEmptyElements: false,
291
+ removeOptionalTags: true,
292
+ removeRedundantAttributes: true,
293
+ removeScriptTypeAttributes: true,
294
+ removeStyleLinkTypeAttributes: true,
295
+ removeTagWhitespace: false,
296
+ sortAttributes: false,
297
+ sortClassName: false,
298
+ trimCustomFragments: true,
299
+ useShortDoctype: true,
300
+ });
301
+ } else {
302
+ var result = fs.readFileSync(filePath, { encoding: "utf8" });
303
+ }
301
304
  arrayOfFiles[fileKey] = result;
302
305
  }
303
306
  });
304
- return _mini(arrayOfFiles);
307
+ if(mini) return _mini(arrayOfFiles);
308
+ return arrayOfFiles;
305
309
  }
306
310
 
307
311
  function copyDir(src, dest, projectName) {
@@ -483,10 +487,14 @@ async function _bp(cmds) {
483
487
  var dest = projectPath + path.sep + "dist";
484
488
 
485
489
  let _views = getAllFiles(
486
- `${process.cwd()}` + path.sep + `src` + path.sep + `views` + path.sep
490
+ `${process.cwd()}` + path.sep + `src` + path.sep + `views` + path.sep,
491
+ {},
492
+ true
487
493
  );
488
494
  let _tpls = getAllFiles(
489
- `${process.cwd()}` + path.sep + `src` + path.sep + `tpls` + path.sep
495
+ `${process.cwd()}` + path.sep + `src` + path.sep + `tpls` + path.sep,
496
+ {},
497
+ true
490
498
  );
491
499
 
492
500
  var indexCode = fs.readFileSync(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lmjs/cli",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "description": "Command line interface for super fast LumenJS development. LumenJS is a tiny robust reactive javascript framework for building scalable and high-performant web applications and web user interfaces, be it simple or complex, with standard HTML, CSS and JavaScript",
5
5
  "bin": {
6
6
  "lm": "./bin/commands.js",