@lmjs/cli 1.0.36 → 1.0.38
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/lib/fcs.js +46 -52
- package/package.json +1 -1
package/lib/fcs.js
CHANGED
|
@@ -237,25 +237,11 @@ function create(conf) {
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
function
|
|
241
|
-
for (const key in st) {
|
|
242
|
-
st[key] = st[key].replace(/\/\*[\s\S]*?\*\/|(?<=[^:])\/\/.*|^\/\/.*/g, "");
|
|
243
|
-
// st[key] = st[key].replace(/(\r?\n|\n)/g, "");
|
|
244
|
-
// st[key] = st[key].replace(" var ", " ;var ");
|
|
245
|
-
// st[key] = st[key].replace(" let ", " ;let ");
|
|
246
|
-
// st[key] = st[key].replace(" const ", " ;const ");
|
|
247
|
-
st[key] = st[key].replace(/(\t)/g, "");
|
|
248
|
-
// st[key] = st[key].replace(/\s\s+/g, " ");
|
|
249
|
-
}
|
|
250
|
-
return st;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
function getAllFiles(dirPath, arrayOfFiles) {
|
|
240
|
+
function getAllFiles(dirPath, arrayOfFiles = {}, mini = false) {
|
|
254
241
|
files = fs.readdirSync(dirPath);
|
|
255
|
-
arrayOfFiles = arrayOfFiles || {};
|
|
256
242
|
files.forEach(function (file) {
|
|
257
243
|
if (fs.statSync(dirPath + path.sep + file).isDirectory()) {
|
|
258
|
-
arrayOfFiles = getAllFiles(dirPath + path.sep + file, arrayOfFiles);
|
|
244
|
+
arrayOfFiles = getAllFiles(dirPath + path.sep + file, arrayOfFiles, mini);
|
|
259
245
|
} else {
|
|
260
246
|
let filePath = path.join(dirPath, path.sep, file);
|
|
261
247
|
let fileKey = Buffer.from(
|
|
@@ -265,43 +251,47 @@ function getAllFiles(dirPath, arrayOfFiles) {
|
|
|
265
251
|
.split("\\")
|
|
266
252
|
.join("/")
|
|
267
253
|
).toString("base64");
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
254
|
+
if (mini) {
|
|
255
|
+
var result = _min(fs.readFileSync(filePath, { encoding: "utf8" }), {
|
|
256
|
+
removeAttributeQuotes: false,
|
|
257
|
+
caseSensitive: true,
|
|
258
|
+
collapseWhitespace: true,
|
|
259
|
+
collapseInlineTagWhitespace: true,
|
|
260
|
+
conservativeCollapse: true,
|
|
261
|
+
removeComments: true,
|
|
262
|
+
minifyJS: true,
|
|
263
|
+
minifyCSS: false,
|
|
264
|
+
processConditionalComments: true,
|
|
265
|
+
collapseBooleanAttributes: true,
|
|
266
|
+
decodeEntities: true,
|
|
267
|
+
html5: true,
|
|
268
|
+
includeAutoGeneratedTags: false,
|
|
269
|
+
keepClosingSlash: true,
|
|
270
|
+
maxLineLength: null,
|
|
271
|
+
minifyURLs: "",
|
|
272
|
+
preserveLineBreaks: false,
|
|
273
|
+
preventAttributesEscaping: false,
|
|
274
|
+
processScripts: ["text/html"],
|
|
275
|
+
quoteCharacter: "",
|
|
276
|
+
removeEmptyAttributes: true,
|
|
277
|
+
removeEmptyElements: false,
|
|
278
|
+
removeOptionalTags: true,
|
|
279
|
+
removeRedundantAttributes: true,
|
|
280
|
+
removeScriptTypeAttributes: true,
|
|
281
|
+
removeStyleLinkTypeAttributes: true,
|
|
282
|
+
removeTagWhitespace: false,
|
|
283
|
+
sortAttributes: false,
|
|
284
|
+
sortClassName: false,
|
|
285
|
+
trimCustomFragments: true,
|
|
286
|
+
useShortDoctype: true,
|
|
287
|
+
});
|
|
288
|
+
} else {
|
|
289
|
+
var result = fs.readFileSync(filePath, { encoding: "utf8" });
|
|
290
|
+
}
|
|
301
291
|
arrayOfFiles[fileKey] = result;
|
|
302
292
|
}
|
|
303
293
|
});
|
|
304
|
-
return
|
|
294
|
+
return arrayOfFiles;
|
|
305
295
|
}
|
|
306
296
|
|
|
307
297
|
function copyDir(src, dest, projectName) {
|
|
@@ -483,10 +473,14 @@ async function _bp(cmds) {
|
|
|
483
473
|
var dest = projectPath + path.sep + "dist";
|
|
484
474
|
|
|
485
475
|
let _views = getAllFiles(
|
|
486
|
-
`${process.cwd()}` + path.sep + `src` + path.sep + `views` + path.sep
|
|
476
|
+
`${process.cwd()}` + path.sep + `src` + path.sep + `views` + path.sep,
|
|
477
|
+
{},
|
|
478
|
+
true
|
|
487
479
|
);
|
|
488
480
|
let _tpls = getAllFiles(
|
|
489
|
-
`${process.cwd()}` + path.sep + `src` + path.sep + `tpls` + path.sep
|
|
481
|
+
`${process.cwd()}` + path.sep + `src` + path.sep + `tpls` + path.sep,
|
|
482
|
+
{},
|
|
483
|
+
true
|
|
490
484
|
);
|
|
491
485
|
|
|
492
486
|
var indexCode = fs.readFileSync(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmjs/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38",
|
|
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",
|