purgetss 3.1.3 → 3.2.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/README.md +25 -11
- package/assets/fonts/FontAwesome6Brands-Regular.ttf +0 -0
- package/assets/fonts/FontAwesome6Free-Regular.ttf +0 -0
- package/assets/fonts/FontAwesome6Free-Solid.ttf +0 -0
- package/assets/images/mapicon-font.png +0 -0
- package/assets/images/microns-font.png +0 -0
- package/bin/purgetss +11 -1
- package/dist/fontawesome.js +1439 -759
- package/dist/fontawesome.tss +1451 -767
- package/dist/purgetss.ui.js +6 -5
- package/dist/tailwind.tss +816 -691
- package/docs/configuring-guide.md +5 -8
- package/docs/whats-new/v2.5.0.md +2 -2
- package/docs/whats-new/v3.1.5.md +266 -0
- package/docs/whats-new/v3.1.7.md +17 -0
- package/docs/whats-new/v3.2.0.md +161 -0
- package/index.js +379 -42
- package/lib/build-fontawesome-free-js.js +2 -2
- package/lib/build-fontawesome-free-tss.js +2 -2
- package/lib/build-fonts-folder.js +3 -3
- package/lib/build-tailwind.js +6 -2
- package/lib/helpers.js +148 -46
- package/lib/templates/custom-icon-fonts/reset.tss +2 -0
- package/lib/templates/custom-icon-fonts/template.js +3 -0
- package/lib/templates/custom-icon-fonts/template.tss +1 -0
- package/lib/templates/fontawesome/beta-reset.tss +6 -0
- package/lib/templates/fontawesome/free-reset.tss +12 -8
- package/lib/templates/fontawesome/free-template.js +1 -1
- package/lib/templates/fontawesome/free-template.tss +1 -1
- package/lib/templates/fontawesome/pro-reset.tss +19 -11
- package/lib/templates/fontawesome/pro-template.js +1 -1
- package/lib/templates/fontawesome/pro-template.tss +1 -1
- package/lib/templates/tailwind/template.tss +1 -1
- package/package.json +4 -5
- package/assets/fonts/FontAwesome5Brands-Regular.ttf +0 -0
- package/assets/fonts/FontAwesome5Free-Regular.ttf +0 -0
- package/assets/fonts/FontAwesome5Free-Solid.ttf +0 -0
package/index.js
CHANGED
|
@@ -69,10 +69,11 @@ const srcFontAwesomeProWebFontsFolderAlternate = cwd + '/app/lib/node_modules/@f
|
|
|
69
69
|
const srcFontAwesomeProResetTSS = './lib/templates/fontawesome/pro-reset.tss';
|
|
70
70
|
const srcFontAwesomeProTemplateTSS = './lib/templates/fontawesome/pro-template.tss';
|
|
71
71
|
const srcFontAwesomeProFontFamilies = {
|
|
72
|
-
'fa-
|
|
73
|
-
'fa-
|
|
74
|
-
'fa-
|
|
75
|
-
'fa-
|
|
72
|
+
'fa-thin-100.ttf': 'FontAwesome6Pro-Thin.ttf',
|
|
73
|
+
'fa-light-300.ttf': 'FontAwesome6Pro-Light.ttf',
|
|
74
|
+
'fa-brands-400.ttf': 'FontAwesome6Brands-Regular.ttf',
|
|
75
|
+
'fa-regular-400.ttf': 'FontAwesome6Pro-Regular.ttf',
|
|
76
|
+
'fa-solid-900.ttf': 'FontAwesome6Pro-Solid.ttf'
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
// BETA
|
|
@@ -230,6 +231,8 @@ function purgeClasses(options) {
|
|
|
230
231
|
|
|
231
232
|
tempPurged += purgeBootstrapIcons(uniqueClasses, cleanUniqueClasses);
|
|
232
233
|
|
|
234
|
+
tempPurged += purgeCustomFonts(uniqueClasses, cleanUniqueClasses);
|
|
235
|
+
|
|
233
236
|
saveFile(destAppTSSFile, tempPurged);
|
|
234
237
|
|
|
235
238
|
logger.file('app.tss');
|
|
@@ -283,7 +286,7 @@ function create(args, options) {
|
|
|
283
286
|
console.log('');
|
|
284
287
|
logger.info('Creating a new Titanium project');
|
|
285
288
|
|
|
286
|
-
let projectName = args.name
|
|
289
|
+
let projectName = `"${args.name}"`;
|
|
287
290
|
let projectID = `${idPrefix}.${args.name.replace(/ /g, '').replace(/-/g, '').replace(/_/g, '').toLowerCase()}`;
|
|
288
291
|
|
|
289
292
|
let tiCreateCommand = `ti create -t app -p all -n ${projectName} --no-prompt --id ${projectID}`;
|
|
@@ -312,9 +315,9 @@ function create(args, options) {
|
|
|
312
315
|
if (options.tailwind) {
|
|
313
316
|
logger.info('Installing Tailwind CSS');
|
|
314
317
|
|
|
315
|
-
fs.writeFileSync(`${workspace}/${args.name}/package.json`, JSON.stringify({ "name": `${args.name.replace(/ /g, '-').toLowerCase()}
|
|
318
|
+
fs.writeFileSync(`${workspace}/${args.name}/package.json`, JSON.stringify({ "name": `${args.name.replace(/ /g, '-').toLowerCase()}`, "private": true }));
|
|
316
319
|
|
|
317
|
-
let installTailwind = `cd ${workspace}/${projectName} && npm init -y && npm i tailwindcss -D &&
|
|
320
|
+
let installTailwind = `cd ${workspace}/${projectName} && npm init -y && npm i tailwindcss -D && npx tailwindcss init`;
|
|
318
321
|
exec(installTailwind, (error) => {
|
|
319
322
|
if (error) return logger.error(error);
|
|
320
323
|
|
|
@@ -390,20 +393,6 @@ function processCustomFontAwesomeTSS(CSSFile, templateTSS, resetTSS, fontFamilie
|
|
|
390
393
|
});
|
|
391
394
|
}
|
|
392
395
|
|
|
393
|
-
function prettifyFontName(str) {
|
|
394
|
-
str = str.replace('fa-', '');
|
|
395
|
-
var temp = str.split('-'), i, pretty;
|
|
396
|
-
|
|
397
|
-
for (i = 0; i < temp.length; i++) {
|
|
398
|
-
temp[i] = temp[i].charAt(0).toUpperCase() + temp[i].slice(1);
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
pretty = temp.join('').replace(':', '');
|
|
402
|
-
pretty = pretty.replace(/^.{1}/g, pretty[0].toLowerCase());
|
|
403
|
-
|
|
404
|
-
return pretty;
|
|
405
|
-
};
|
|
406
|
-
|
|
407
396
|
function buildCustomFontAwesomeJS() {
|
|
408
397
|
if (fs.existsSync(srcFontAwesomeBetaCSSFile)) {
|
|
409
398
|
processCustomFontAwesomeJS(srcFontAwesomeBetaCSSFile, './lib/templates/fontawesome/beta-template.js');
|
|
@@ -433,7 +422,7 @@ function processCustomFontAwesomeJS(CSSFile, faJS) {
|
|
|
433
422
|
|
|
434
423
|
_.each(rules, rule => {
|
|
435
424
|
if (rule) {
|
|
436
|
-
exportIcons += `\t'${prettifyFontName(rule.selector)}': '\\u${rule.property}',\n`;
|
|
425
|
+
exportIcons += `\t'${prettifyFontName(rule.selector, 'fa-')}': '\\u${rule.property}',\n`;
|
|
437
426
|
}
|
|
438
427
|
});
|
|
439
428
|
|
|
@@ -455,9 +444,9 @@ function processCustomFontAwesomeJS(CSSFile, faJS) {
|
|
|
455
444
|
|
|
456
445
|
function copyFreeFonts() {
|
|
457
446
|
// FontAwesome Fonts
|
|
458
|
-
fs.copyFile(srcFontsFolder + '/
|
|
459
|
-
fs.copyFile(srcFontsFolder + '/
|
|
460
|
-
fs.copyFile(srcFontsFolder + '/
|
|
447
|
+
fs.copyFile(srcFontsFolder + '/FontAwesome6Brands-Regular.ttf', destFontsFolder + '/FontAwesome6Brands-Regular.ttf', callback);
|
|
448
|
+
fs.copyFile(srcFontsFolder + '/FontAwesome6Free-Regular.ttf', destFontsFolder + '/FontAwesome6Free-Regular.ttf', callback);
|
|
449
|
+
fs.copyFile(srcFontsFolder + '/FontAwesome6Free-Solid.ttf', destFontsFolder + '/FontAwesome6Free-Solid.ttf', callback);
|
|
461
450
|
|
|
462
451
|
logger.info('Font Awesome Free Icons Fonts copied to', chalk.yellow('./app/assets/fonts'), 'folder');
|
|
463
452
|
}
|
|
@@ -557,6 +546,330 @@ function processFontawesomeStyles(data) {
|
|
|
557
546
|
return convertedTSSClasses;
|
|
558
547
|
}
|
|
559
548
|
|
|
549
|
+
// ! Build fonts.tss
|
|
550
|
+
function getFiles(dir) {
|
|
551
|
+
return fs.readdirSync(dir).flatMap((item) => {
|
|
552
|
+
const path = `${dir}/${item}`;
|
|
553
|
+
if (fs.statSync(path).isDirectory()) {
|
|
554
|
+
return getFiles(path);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
return path;
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
function buildCustomFonts(options) {
|
|
562
|
+
if (fs.existsSync(cwd + '/purgetss/fonts/')) {
|
|
563
|
+
start();
|
|
564
|
+
|
|
565
|
+
let files = getFiles(cwd + '/purgetss/fonts').filter(file => {
|
|
566
|
+
return file.endsWith('.ttf') || file.endsWith('.otf') || file.endsWith('.css') || file.endsWith('.TTF') || file.endsWith('.OTF') || file.endsWith('.CSS');
|
|
567
|
+
});
|
|
568
|
+
|
|
569
|
+
let fontMeta = '';
|
|
570
|
+
let customFontsJS = '';
|
|
571
|
+
const FontName = require('fontname');
|
|
572
|
+
let tssClasses = `// Fonts TSS file generated with PurgeTSS\n// https://github.com/macCesar/purgeTSS\n`;
|
|
573
|
+
let prefix, tssPrefix = '';
|
|
574
|
+
|
|
575
|
+
_.each(files, file => {
|
|
576
|
+
if (file.endsWith('.ttf') || file.endsWith('.otf') || file.endsWith('.TTF') || file.endsWith('.OTF')) {
|
|
577
|
+
fontMeta = FontName.parse(fs.readFileSync(file))[0];
|
|
578
|
+
|
|
579
|
+
tssClasses += processFontMeta(fontMeta);
|
|
580
|
+
|
|
581
|
+
tssClasses += `\n'.${fontMeta.postScriptName.replace(/\//g, '').toLowerCase()}': { font: { fontFamily: '${fontMeta.postScriptName.replace(/\//g, '')}' } }\n`;
|
|
582
|
+
|
|
583
|
+
//! Copy Font File
|
|
584
|
+
makeSureFolderExists(destFontsFolder);
|
|
585
|
+
let fontExtension = file.split('.').pop();
|
|
586
|
+
fs.copyFile(file, `${destFontsFolder}/${fontMeta.postScriptName.replace(/\//g, '')}.${fontExtension}`, err => { });
|
|
587
|
+
logger.info('Copying font', `${chalk.yellow(file.split('/').pop())}...`);
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
let oneTimeMessage = `\n// Unicode Characters\n// To use your Icon Fonts in Buttons AND Labels each class sets 'text' and 'title' properties\n`;
|
|
592
|
+
|
|
593
|
+
_.each(files, file => {
|
|
594
|
+
if (file.endsWith('.css') || file.endsWith('.CSS')) {
|
|
595
|
+
let cssFileString = fs.readFileSync(file).toString();
|
|
596
|
+
|
|
597
|
+
let syntax = cssFileString.includes('::before') ? '::before' : ':before';
|
|
598
|
+
|
|
599
|
+
tssClasses += oneTimeMessage + `\n// ${file.split('/').pop()}\n`;
|
|
600
|
+
oneTimeMessage = '';
|
|
601
|
+
|
|
602
|
+
tssClasses += processCustomFontsCSS(readCSS(file), syntax, prefix, tssPrefix);
|
|
603
|
+
|
|
604
|
+
//! JavaScript Module
|
|
605
|
+
if (options.modules) {
|
|
606
|
+
customFontsJS += processCustomFontsJS(readCSS(file), syntax, prefix, tssPrefix, `\n // ${file.split('/').pop()}`);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
// !Done processing stylesheet
|
|
610
|
+
logger.info('Processing', `${chalk.yellow(file.split('/').pop())}...`);
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
|
|
614
|
+
fs.writeFileSync(cwd + '/purgetss/fonts.tss', tssClasses, err => {
|
|
615
|
+
throw err;
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
makeSureFolderExists(destLibFolder);
|
|
619
|
+
|
|
620
|
+
if (customFontsJS) {
|
|
621
|
+
let exportIcons = fs.readFileSync(path.resolve(__dirname, './lib/templates/icon-functions.js'), 'utf8');
|
|
622
|
+
exportIcons += '\nconst icons = {';
|
|
623
|
+
exportIcons += customFontsJS
|
|
624
|
+
exportIcons += '};\n';
|
|
625
|
+
exportIcons += 'exports.icons = icons;\n';
|
|
626
|
+
|
|
627
|
+
fs.writeFileSync(destLibFolder + '/purgetss.fonts.js', exportIcons, err => {
|
|
628
|
+
throw err;
|
|
629
|
+
});
|
|
630
|
+
|
|
631
|
+
logger.info(`${chalk.yellow('./app/lib/purgetss.fonts.js')} file created!`);
|
|
632
|
+
} else {
|
|
633
|
+
if (fs.existsSync(destLibFolder + '/purgetss.fonts.js')) {
|
|
634
|
+
fs.unlinkSync(destLibFolder + '/purgetss.fonts.js');
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
if (files.length > 0) {
|
|
639
|
+
console.log();
|
|
640
|
+
|
|
641
|
+
finish(`Finished building ${chalk.yellow('fonts.tss')} in`);
|
|
642
|
+
} else {
|
|
643
|
+
logger.info('No fonts found in', chalk.yellow('./purgetss/fonts'), 'folder!');
|
|
644
|
+
}
|
|
645
|
+
} else {
|
|
646
|
+
logger.info(`Add fonts and css files to ${chalk.yellow('./purgetss/fonts')} and run this command again!`);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
module.exports.buildCustomFonts = buildCustomFonts;
|
|
650
|
+
|
|
651
|
+
function readFilesAndFolers(currentDirPath, callback) {
|
|
652
|
+
const getAllFiles = dir =>
|
|
653
|
+
fs.readdirSync(dir).reduce((files, file) => {
|
|
654
|
+
const name = path.join(dir, file);
|
|
655
|
+
const isDirectory = fs.statSync(name).isDirectory();
|
|
656
|
+
return isDirectory ? [...files, ...getAllFiles(name)] : [...files, name];
|
|
657
|
+
}, []);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
function processCustomFontsCSS(data, syntax, prefix, tssPrefix) {
|
|
661
|
+
let rules = getRules(data, syntax, prefix, tssPrefix);
|
|
662
|
+
|
|
663
|
+
let paraTSS = '';
|
|
664
|
+
|
|
665
|
+
_.each(rules, rule => {
|
|
666
|
+
if (rule) {
|
|
667
|
+
paraTSS += `'${rule.selector}': { text: '\\u${rule.property}', title: '\\u${rule.property}' }\n`;
|
|
668
|
+
}
|
|
669
|
+
});
|
|
670
|
+
|
|
671
|
+
return paraTSS;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
function processCustomFontsJS(data, syntax, prefix, tssPrefix, fontFamily = '') {
|
|
675
|
+
let rules = getRules(data, syntax, prefix, tssPrefix);
|
|
676
|
+
|
|
677
|
+
let exportIcons = `${fontFamily}\n`;
|
|
678
|
+
|
|
679
|
+
_.each(rules, rule => {
|
|
680
|
+
if (rule) {
|
|
681
|
+
exportIcons += `\t'${prettifyFontName(rule.selector.replace('.', ''))}': '\\u${rule.property}',\n`;
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
|
|
685
|
+
return exportIcons;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
function getRules(data, syntax, prefix, tssPrefix) {
|
|
689
|
+
let rules = _.map(data.stylesheet.rules, rule => {
|
|
690
|
+
if (rule.type === 'rule' && rule.declarations[0].property === 'content') {
|
|
691
|
+
return {
|
|
692
|
+
'selector': '.' + rule.selectors[0].replace('.', '').replace(prefix, tssPrefix ? tssPrefix : prefix).replace(syntax, ''),
|
|
693
|
+
'property': ('0000' + rule.declarations[0].value.replace('\"\\', '').replace('\"', '').replace('\'\\', '').replace('\'', '')).slice(-4)
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
|
|
698
|
+
return rules;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
function processFontMeta(fontMeta) {
|
|
702
|
+
let fontMetaString = `\n/**\n * ${fontMeta.fullName}`;
|
|
703
|
+
|
|
704
|
+
fontMetaString += `\n * ${fontMeta.version}`;
|
|
705
|
+
|
|
706
|
+
// if (fontMeta.description) {
|
|
707
|
+
// fontMetaString += `\n * description: ${fontMeta.description}`;
|
|
708
|
+
// }
|
|
709
|
+
|
|
710
|
+
if (fontMeta.designer) {
|
|
711
|
+
fontMetaString += `\n * ${fontMeta.designer}`;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
if (fontMeta.urlVendor) {
|
|
715
|
+
fontMetaString += `\n * ${fontMeta.urlVendor}`;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
// if (fontMeta.urlDesigner) {
|
|
719
|
+
// fontMetaString += `\n * urlDesigner: ${fontMeta.urlDesigner}`;
|
|
720
|
+
// }
|
|
721
|
+
|
|
722
|
+
if (fontMeta.copyright) {
|
|
723
|
+
fontMetaString += `\n * ${fontMeta.copyright}`;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
if (fontMeta.trademark) {
|
|
727
|
+
fontMetaString += `\n * ${fontMeta.trademark}`;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
if (fontMeta.licence) {
|
|
731
|
+
fontMetaString += `\n * ${fontMeta.licence.split('\n')[0]}`;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
if (fontMeta.licenceURL) {
|
|
735
|
+
fontMetaString += `\n * ${fontMeta.licenceURL}`;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
fontMetaString += `\n */`;
|
|
739
|
+
|
|
740
|
+
return fontMetaString;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
//! Purge Custom Fonts
|
|
744
|
+
function purgeCustomFonts(uniqueClasses, cleanUniqueClasses) {
|
|
745
|
+
if (fs.existsSync(cwd + '/purgetss/fonts.tss')) {
|
|
746
|
+
let purgedClasses = '\n// Custom Fonts styles\n';
|
|
747
|
+
|
|
748
|
+
let sourceTSS = fs.readFileSync(cwd + '/purgetss/fonts.tss', 'utf8').split(/\r?\n/);
|
|
749
|
+
|
|
750
|
+
purgedClasses += purgeFontIcons(sourceTSS, uniqueClasses, 'Purging Custom Fonts styles...', cleanUniqueClasses, []);
|
|
751
|
+
|
|
752
|
+
return (purgedClasses === '\n// Custom Fonts styles\n') ? '' : purgedClasses;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
return '';
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
function prettifyFontName(str, prefix) {
|
|
759
|
+
str = str.replace(/_/g, '-');
|
|
760
|
+
|
|
761
|
+
if (prefix) {
|
|
762
|
+
str = str.replace(prefix, '');
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
str = str.replace(/\s/g, '');
|
|
766
|
+
|
|
767
|
+
let temp = str.split('-'), i, pretty;
|
|
768
|
+
|
|
769
|
+
for (i = 1; i < temp.length; i++) {
|
|
770
|
+
temp[i] = temp[i].charAt(0).toUpperCase() + temp[i].slice(1);
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
pretty = temp.join('').replace(':', '');
|
|
774
|
+
|
|
775
|
+
pretty = pretty.replace(/^.{1}/g, pretty[0].toLowerCase());
|
|
776
|
+
|
|
777
|
+
return pretty;
|
|
778
|
+
};
|
|
779
|
+
|
|
780
|
+
function buildCustomFontsXXX() {
|
|
781
|
+
let configFile = require(destConfigJSFile);
|
|
782
|
+
|
|
783
|
+
if (configFile.fonts) {
|
|
784
|
+
start();
|
|
785
|
+
const FontName = require('fontname');
|
|
786
|
+
let tssClasses = `// Fonts TSS file generated with PurgeTSS\n// https://github.com/macCesar/purgeTSS\n`;
|
|
787
|
+
let exportIcons = fs.readFileSync(path.resolve(__dirname, './lib/templates/icon-functions.js'), 'utf8');
|
|
788
|
+
let customFontsJS = '';
|
|
789
|
+
|
|
790
|
+
_.each(configFile.fonts, customFont => {
|
|
791
|
+
let { folder, prefix, tssPrefix } = customFont;
|
|
792
|
+
|
|
793
|
+
if (!fs.existsSync(cwd + `/purgetss/fonts/${folder}`)) {
|
|
794
|
+
throw new Error(`The folder '${folder}' does not exist`);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
// use glob.sync to read .ttf and otf files
|
|
798
|
+
let fontFiles = glob.sync(cwd + `/purgetss/fonts/${folder}/*.{ttf,otf}`);
|
|
799
|
+
// let trueType = glob.sync(cwd + `/purgetss/fonts/${folder}/*.ttf`,);
|
|
800
|
+
// let openType = glob.sync(cwd + `/purgetss/fonts/${folder}/*.otf`);
|
|
801
|
+
|
|
802
|
+
if (fontFiles.length === 0) {
|
|
803
|
+
throw new Error(`The folder '${folder}' does not contain any font file`);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
// let fontFiles = trueType.length > 0 ? trueType : openType.length > 0 ? openType : '';
|
|
807
|
+
let fontMeta = '';
|
|
808
|
+
|
|
809
|
+
_.each(fontFiles, fontFile => {
|
|
810
|
+
fontMeta = FontName.parse(fs.readFileSync(fontFile))[0];
|
|
811
|
+
|
|
812
|
+
// Add font information and font-family
|
|
813
|
+
tssClasses += processFontMeta(fontMeta);
|
|
814
|
+
|
|
815
|
+
if (fontFiles.length > 0) {
|
|
816
|
+
tssClasses += `\n'.${fontMeta.postScriptName.replace(/\//g, '').toLowerCase()}': { font: { fontFamily: '${fontMeta.postScriptName.replace(/\//g, '')}' } }\n`;
|
|
817
|
+
} else {
|
|
818
|
+
tssClasses += `\n'.${tssPrefix ? tssPrefix.replace('-', '') : prefix ? prefix : fontMeta.postScriptName.replace(/\//g, '').toLowerCase()}': { font: { fontFamily: '${fontMeta.postScriptName.replace(/\//g, '')}' } }\n`;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
//! Copy Font File
|
|
822
|
+
makeSureFolderExists(destFontsFolder);
|
|
823
|
+
let fontExtension = fontFile.split('.').pop();
|
|
824
|
+
fs.copyFile(fontFile, `${destFontsFolder}/${fontMeta.postScriptName.replace(/\//g, '')}.${fontExtension}`, err => { });
|
|
825
|
+
});
|
|
826
|
+
|
|
827
|
+
//! Stylesheet
|
|
828
|
+
let stylesheetFiles = glob.sync(cwd + `/purgetss/fonts/${folder}/*.css`);
|
|
829
|
+
_.each(stylesheetFiles, stylesheet => {
|
|
830
|
+
// let stylesheet = stylesheetFiles.length > 0 ? stylesheetFiles[0] : '';
|
|
831
|
+
|
|
832
|
+
let cssFileString = fs.readFileSync(stylesheet).toString();
|
|
833
|
+
|
|
834
|
+
let syntax = cssFileString.includes('::before') ? '::before' : ':before';
|
|
835
|
+
|
|
836
|
+
tssClasses += `\n// Unicode Characters\n// To use your Icon Fonts in Buttons AND Labels each class sets 'text' and 'title' properties\n`;
|
|
837
|
+
|
|
838
|
+
tssClasses += processCustomFontsCSS(readCSS(stylesheet), syntax, prefix, tssPrefix);
|
|
839
|
+
|
|
840
|
+
// !JavaScript Module
|
|
841
|
+
customFontsJS += processCustomFontsJS(readCSS(stylesheet), syntax, prefix, tssPrefix, processFontMeta(fontMeta));
|
|
842
|
+
|
|
843
|
+
// !Done processing stylesheet
|
|
844
|
+
logger.info('Processing', `${chalk.yellow(stylesheet.split('/').pop())}...`);
|
|
845
|
+
});
|
|
846
|
+
});
|
|
847
|
+
|
|
848
|
+
fs.writeFileSync(cwd + '/purgetss/fonts.tss', tssClasses, err => {
|
|
849
|
+
throw err;
|
|
850
|
+
});
|
|
851
|
+
|
|
852
|
+
makeSureFolderExists(destLibFolder);
|
|
853
|
+
|
|
854
|
+
if (customFontsJS) {
|
|
855
|
+
exportIcons += '\nconst icons = {';
|
|
856
|
+
exportIcons += customFontsJS
|
|
857
|
+
exportIcons += '};\n';
|
|
858
|
+
fs.writeFileSync(destLibFolder + '/purgetss.fonts.js', exportIcons, err => {
|
|
859
|
+
throw err;
|
|
860
|
+
});
|
|
861
|
+
} else {
|
|
862
|
+
if (fs.existsSync(destLibFolder + '/purgetss.fonts.js')) {
|
|
863
|
+
fs.unlinkSync(destLibFolder + '/purgetss.fonts.js');
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
console.log();
|
|
868
|
+
finish(`Finished building ${chalk.yellow('fonts.tss')} in`);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
module.exports.buildCustomFontsXXX = buildCustomFontsXXX;
|
|
872
|
+
|
|
560
873
|
//! Helper Functions
|
|
561
874
|
function addHook() {
|
|
562
875
|
logger.warn(chalk.green('Adding Auto-Purging hook!'));
|
|
@@ -655,7 +968,7 @@ function getUniqueClasses() {
|
|
|
655
968
|
|
|
656
969
|
let viewPaths = [];
|
|
657
970
|
|
|
658
|
-
|
|
971
|
+
readAllXMLFiles(cwd + '/app/views', viewPath => {
|
|
659
972
|
viewPaths.push(viewPath);
|
|
660
973
|
});
|
|
661
974
|
|
|
@@ -839,6 +1152,7 @@ function buildCustomTailwind(message = 'file created!') {
|
|
|
839
1152
|
configFile.theme.dropShadow = {};
|
|
840
1153
|
configFile.theme.dropShadowColor = combineKeys(configFile.theme, base.colors, 'dropShadowColor');
|
|
841
1154
|
configFile.theme.editable = {};
|
|
1155
|
+
configFile.theme.elevation = combineKeys(configFile.theme, _.merge(base.spacing, configFile.theme.spacing, configFile.theme.extend.spacing), 'elevation');
|
|
842
1156
|
configFile.theme.ellipsize = {};
|
|
843
1157
|
configFile.theme.enableCopy = {};
|
|
844
1158
|
configFile.theme.enableReturnKey = {};
|
|
@@ -883,6 +1197,7 @@ function buildCustomTailwind(message = 'file created!') {
|
|
|
883
1197
|
configFile.theme.loginKeyboardType = {};
|
|
884
1198
|
configFile.theme.loginReturnKeyType = {};
|
|
885
1199
|
configFile.theme.margin = combineKeys(configFile.theme, base.spacing, 'margin');
|
|
1200
|
+
configFile.theme.maxElevation = combineKeys(configFile.theme, _.merge(base.spacing, configFile.theme.spacing, configFile.theme.extend.spacing), 'maxElevation');
|
|
886
1201
|
configFile.theme.modal = {};
|
|
887
1202
|
configFile.theme.navBarHidden = {};
|
|
888
1203
|
configFile.theme.navTintColor = combineKeys(configFile.theme, base.colors, 'navTintColor');
|
|
@@ -902,6 +1217,7 @@ function buildCustomTailwind(message = 'file created!') {
|
|
|
902
1217
|
configFile.theme.pickerType = {};
|
|
903
1218
|
configFile.theme.placeholderColor = combineKeys(configFile.theme, base.colors, 'placeholderColor');
|
|
904
1219
|
configFile.theme.placement = {};
|
|
1220
|
+
configFile.theme.preventCornerOverlap = {};
|
|
905
1221
|
configFile.theme.preventDefaultImage = {};
|
|
906
1222
|
configFile.theme.repeat = {};
|
|
907
1223
|
configFile.theme.returnKeyType = {};
|
|
@@ -920,6 +1236,7 @@ function buildCustomTailwind(message = 'file created!') {
|
|
|
920
1236
|
configFile.theme.statusBar = {};
|
|
921
1237
|
configFile.theme.sustainedPerformanceMode = {};
|
|
922
1238
|
configFile.theme.swipeToClose = {};
|
|
1239
|
+
configFile.theme.useCompatPadding = {};
|
|
923
1240
|
configFile.theme.tabBarHidden = {};
|
|
924
1241
|
configFile.theme.tabGroupStyle = {};
|
|
925
1242
|
configFile.theme.tabsBackgroundColor = combineKeys(configFile.theme, base.colors, 'tabsBackgroundColor');
|
|
@@ -932,8 +1249,8 @@ function buildCustomTailwind(message = 'file created!') {
|
|
|
932
1249
|
configFile.theme.titleColor = combineKeys(configFile.theme, base.colors, 'titleColor');
|
|
933
1250
|
configFile.theme.touchFeedbackColor = combineKeys(configFile.theme, base.colors, 'touchFeedbackColor');
|
|
934
1251
|
configFile.theme.transition = {};
|
|
935
|
-
configFile.theme.transitionDelay = combineKeys(configFile.theme, { ...{ '0': '0ms', '25': '25ms', '50': '50ms', '2000': '2000ms', '3000': '3000ms', '4000': '4000ms', '5000': '5000ms' }, ...defaultTheme.transitionDelay }, 'transitionDelay');
|
|
936
|
-
configFile.theme.transitionDuration = combineKeys(configFile.theme, { ...{ 0: '0ms', 25: '25ms', 50: '50ms' }, ...defaultTheme.transitionDuration }, 'transitionDuration');
|
|
1252
|
+
configFile.theme.transitionDelay = combineKeys(configFile.theme, { ...{ '0': '0ms', '25': '25ms', '50': '50ms', '250': '250ms', '350': '350ms', '400': '400ms', '450': '450ms', '600': '600ms', '800': '800ms', '900': '900ms', '2000': '2000ms', '3000': '3000ms', '4000': '4000ms', '5000': '5000ms' }, ...defaultTheme.transitionDelay }, 'transitionDelay');
|
|
1253
|
+
configFile.theme.transitionDuration = combineKeys(configFile.theme, { ...{ '0': '0ms', '25': '25ms', '50': '50ms', '250': '250ms', '350': '350ms', '400': '400ms', '450': '450ms', '600': '600ms', '800': '800ms', '900': '900ms', '2000': '2000ms', '3000': '3000ms', '4000': '4000ms', '5000': '5000ms' }, ...defaultTheme.transitionDuration }, 'transitionDuration');
|
|
937
1254
|
configFile.theme.translucent = {};
|
|
938
1255
|
configFile.theme.useSpinner = {};
|
|
939
1256
|
configFile.theme.verticalAlignment = {};
|
|
@@ -1025,6 +1342,7 @@ function helpersToBuildCustomTailwindClasses(key, value) {
|
|
|
1025
1342
|
case 'dropShadow': return helpers.dropShadow();
|
|
1026
1343
|
case 'dropShadowColor': return helpers.dropShadowColor(value);
|
|
1027
1344
|
case 'editable': return helpers.editable();
|
|
1345
|
+
case 'elevation': return helpers.elevation(value);
|
|
1028
1346
|
case 'ellipsize': return helpers.ellipsize();
|
|
1029
1347
|
case 'enableCopy': return helpers.enableCopy();
|
|
1030
1348
|
case 'enableReturnKey': return helpers.enableReturnKey();
|
|
@@ -1069,6 +1387,7 @@ function helpersToBuildCustomTailwindClasses(key, value) {
|
|
|
1069
1387
|
case 'loginKeyboardType': return helpers.loginKeyboardType();
|
|
1070
1388
|
case 'loginReturnKeyType': return helpers.loginReturnKeyType();
|
|
1071
1389
|
case 'margin': return helpers.margin(value);
|
|
1390
|
+
case 'maxElevation': return helpers.maxElevation(value);
|
|
1072
1391
|
case 'modal': return helpers.modal();
|
|
1073
1392
|
case 'navBarHidden': return helpers.navBarHidden();
|
|
1074
1393
|
case 'navTintColor': return helpers.navTintColor(value);
|
|
@@ -1088,6 +1407,7 @@ function helpersToBuildCustomTailwindClasses(key, value) {
|
|
|
1088
1407
|
case 'pickerType': return helpers.pickerType();
|
|
1089
1408
|
case 'placeholderColor': return helpers.placeholderColor(value);
|
|
1090
1409
|
case 'placement': return helpers.placement();
|
|
1410
|
+
case 'preventCornerOverlap': return helpers.preventCornerOverlap();
|
|
1091
1411
|
case 'preventDefaultImage': return helpers.preventDefaultImage();
|
|
1092
1412
|
case 'repeat': return helpers.repeat();
|
|
1093
1413
|
case 'returnKeyType': return helpers.returnKeyType();
|
|
@@ -1106,6 +1426,7 @@ function helpersToBuildCustomTailwindClasses(key, value) {
|
|
|
1106
1426
|
case 'statusBar': return helpers.statusBar();
|
|
1107
1427
|
case 'sustainedPerformanceMode': return helpers.sustainedPerformanceMode();
|
|
1108
1428
|
case 'swipeToClose': return helpers.swipeToClose();
|
|
1429
|
+
case 'useCompatPadding': return helpers.useCompatPadding();
|
|
1109
1430
|
case 'tabBarHidden': return helpers.tabBarHidden();
|
|
1110
1431
|
case 'tabGroupStyle': return helpers.tabGroupStyle();
|
|
1111
1432
|
case 'tabsBackgroundColor': return helpers.tabsBackgroundColor(value);
|
|
@@ -1160,7 +1481,7 @@ function callback(err) {
|
|
|
1160
1481
|
if (err) throw err;
|
|
1161
1482
|
}
|
|
1162
1483
|
|
|
1163
|
-
function
|
|
1484
|
+
function readAllXMLFiles(currentDirPath, callback) {
|
|
1164
1485
|
let files = fs.readdirSync(currentDirPath);
|
|
1165
1486
|
|
|
1166
1487
|
files.filter(junk.not).forEach(name => {
|
|
@@ -1173,7 +1494,7 @@ function walkSync(currentDirPath, callback) {
|
|
|
1173
1494
|
callback(filePath, stat);
|
|
1174
1495
|
}
|
|
1175
1496
|
} else if (stat.isDirectory()) {
|
|
1176
|
-
|
|
1497
|
+
readAllXMLFiles(filePath, callback);
|
|
1177
1498
|
}
|
|
1178
1499
|
});
|
|
1179
1500
|
}
|
|
@@ -1483,6 +1804,7 @@ const arbitraryValuesTable = {
|
|
|
1483
1804
|
'delay': '{ delay: {value} }',
|
|
1484
1805
|
'drop-shadow': '{ shadowColor: {value} } }',
|
|
1485
1806
|
'duration': '{ duration: {value} }',
|
|
1807
|
+
'elevation': '{ elevation: {value} }',
|
|
1486
1808
|
'feedback': '{ touchFeedback: true, touchFeedbackColor: {value} }',
|
|
1487
1809
|
'font': '{ fontWeight: {value} }',
|
|
1488
1810
|
'from': '{ backgroundGradient: { colors: [ {value1}, {value} ] } }',
|
|
@@ -1492,6 +1814,7 @@ const arbitraryValuesTable = {
|
|
|
1492
1814
|
'indicator': '{ indicatorColor: {value} }',
|
|
1493
1815
|
'left': '{ left: {value} }',
|
|
1494
1816
|
'm': '{ top: {value}, right: {value}, bottom: {value}, left: {value} }',
|
|
1817
|
+
'max-elevation': '{ maxElevation: {value} }',
|
|
1495
1818
|
'max-scale': '{ maxZoomScale: {value} }',
|
|
1496
1819
|
'mb': '{ bottom: {value} }',
|
|
1497
1820
|
'min-scale': '{ minZoomScale: {value} }',
|
|
@@ -1625,8 +1948,8 @@ function purgeFontAwesome(uniqueClasses, cleanUniqueClasses) {
|
|
|
1625
1948
|
|
|
1626
1949
|
if (fs.existsSync(customFontAwesomeFile)) {
|
|
1627
1950
|
sourceFolder = customFontAwesomeFile;
|
|
1628
|
-
purgedClasses = '\n//
|
|
1629
|
-
purgingMessage = `Purging ${chalk.yellow('
|
|
1951
|
+
purgedClasses = '\n// Pro/Beta Font Awesome styles\n';
|
|
1952
|
+
purgingMessage = `Purging ${chalk.yellow('Pro/Beta Font Awesome')} styles...')`;
|
|
1630
1953
|
} else {
|
|
1631
1954
|
sourceFolder = srcFontAwesomeTSSFile;
|
|
1632
1955
|
purgedClasses = '\n// Default Font Awesome styles\n';
|
|
@@ -1635,9 +1958,9 @@ function purgeFontAwesome(uniqueClasses, cleanUniqueClasses) {
|
|
|
1635
1958
|
|
|
1636
1959
|
let sourceTSS = fs.readFileSync(sourceFolder, 'utf8').split(/\r?\n/);
|
|
1637
1960
|
|
|
1638
|
-
purgedClasses +=
|
|
1961
|
+
purgedClasses += purgeFontIcons(sourceTSS, uniqueClasses, purgingMessage, cleanUniqueClasses, ['fa', 'fat', 'fas', 'fal', 'far', 'fab', 'fa-thin', 'fa-solid', 'fa-light', 'fa-regular', 'fa-brands', 'fontawesome', 'fontawesome-thin', 'fontawesome-solid', 'fontawesome-light', 'fontawesome-regular', 'fontawesome-brands']);
|
|
1639
1962
|
|
|
1640
|
-
return (purgedClasses === '\n//
|
|
1963
|
+
return (purgedClasses === '\n// Pro/Beta Font Awesome styles\n' || purgedClasses === '\n// Default Font Awesome styles\n') ? '' : purgedClasses;
|
|
1641
1964
|
}
|
|
1642
1965
|
|
|
1643
1966
|
//! Material Design Icons
|
|
@@ -1646,7 +1969,7 @@ function purgeMaterialDesign(uniqueClasses, cleanUniqueClasses) {
|
|
|
1646
1969
|
|
|
1647
1970
|
let sourceTSS = fs.readFileSync(srcMaterialDesignIconsTSSFile, 'utf8').split(/\r?\n/);
|
|
1648
1971
|
|
|
1649
|
-
purgedClasses +=
|
|
1972
|
+
purgedClasses += purgeFontIcons(sourceTSS, uniqueClasses, 'Purging Material Design Icons styles...', cleanUniqueClasses, ['md', 'mdo', 'mdr', 'mds', 'mdt', '.materialdesign', '.materialdesign-round', '.materialdesign-sharp', '.materialdesign-two-tone', '.materialdesign-outlined', '.material-icons', '.material-icons-round', '.material-icons-sharp', '.material-icons-two-tone', '.material-icons-outlined']);
|
|
1650
1973
|
|
|
1651
1974
|
return (purgedClasses === '\n// Material Design Icons styles\n') ? '' : purgedClasses;
|
|
1652
1975
|
}
|
|
@@ -1657,7 +1980,7 @@ function purgeLineIcons(uniqueClasses, cleanUniqueClasses) {
|
|
|
1657
1980
|
|
|
1658
1981
|
let sourceTSS = fs.readFileSync(srcLineiconsFontTSSFile, 'utf8').split(/\r?\n/);
|
|
1659
1982
|
|
|
1660
|
-
purgedClasses +=
|
|
1983
|
+
purgedClasses += purgeFontIcons(sourceTSS, uniqueClasses, 'Purging LineIcons styles...', cleanUniqueClasses, ['li', 'lni', 'lineicons']);
|
|
1661
1984
|
|
|
1662
1985
|
return (purgedClasses === '\n// LineIcons styles\n') ? '' : purgedClasses;
|
|
1663
1986
|
}
|
|
@@ -1668,7 +1991,7 @@ function purgeFramework7(uniqueClasses, cleanUniqueClasses) {
|
|
|
1668
1991
|
|
|
1669
1992
|
let sourceTSS = fs.readFileSync(srcFramework7FontTSSFile, 'utf8').split(/\r?\n/);
|
|
1670
1993
|
|
|
1671
|
-
purgedClasses +=
|
|
1994
|
+
purgedClasses += purgeFontIcons(sourceTSS, uniqueClasses, 'Purging Framework7 Icons styles...', cleanUniqueClasses, ['f7', 'f7i', 'framework7']);
|
|
1672
1995
|
|
|
1673
1996
|
return (purgedClasses === '\n// Framework7 styles\n') ? '' : purgedClasses;
|
|
1674
1997
|
}
|
|
@@ -1679,7 +2002,7 @@ function purgeBoxIcons(uniqueClasses, cleanUniqueClasses) {
|
|
|
1679
2002
|
|
|
1680
2003
|
let sourceTSS = fs.readFileSync(srcBoxIconsFontTSSFile, 'utf8').split(/\r?\n/);
|
|
1681
2004
|
|
|
1682
|
-
purgedClasses +=
|
|
2005
|
+
purgedClasses += purgeFontIcons(sourceTSS, uniqueClasses, 'Purging BoxIcons styles...', cleanUniqueClasses, ['bx', 'bxi', 'boxicons']);
|
|
1683
2006
|
|
|
1684
2007
|
return (purgedClasses === '\n// BoxIcons styles\n') ? '' : purgedClasses;
|
|
1685
2008
|
}
|
|
@@ -1690,7 +2013,7 @@ function purgeTablerIcons(uniqueClasses, cleanUniqueClasses) {
|
|
|
1690
2013
|
|
|
1691
2014
|
let sourceTSS = fs.readFileSync(srcTablerIconsFontTSSFile, 'utf8').split(/\r?\n/);
|
|
1692
2015
|
|
|
1693
|
-
purgedClasses +=
|
|
2016
|
+
purgedClasses += purgeFontIcons(sourceTSS, uniqueClasses, 'Purging Tabler Icons styles...', cleanUniqueClasses, ['ti', 'tablericons', 'tabler']);
|
|
1694
2017
|
|
|
1695
2018
|
return (purgedClasses === '\n// Tabler Icons styles\n') ? '' : purgedClasses;
|
|
1696
2019
|
}
|
|
@@ -1701,16 +2024,30 @@ function purgeBootstrapIcons(uniqueClasses, cleanUniqueClasses) {
|
|
|
1701
2024
|
|
|
1702
2025
|
let sourceTSS = fs.readFileSync(srcBootstrapIconsFontTSSFile, 'utf8').split(/\r?\n/);
|
|
1703
2026
|
|
|
1704
|
-
purgedClasses +=
|
|
2027
|
+
purgedClasses += purgeFontIcons(sourceTSS, uniqueClasses, 'Purging Bootstrap Icons styles...', cleanUniqueClasses, ['bi', 'bootstrap']);
|
|
1705
2028
|
|
|
1706
2029
|
return (purgedClasses === '\n// Bootstrap Icons styles\n') ? '' : purgedClasses;
|
|
1707
2030
|
}
|
|
1708
2031
|
|
|
1709
|
-
function
|
|
2032
|
+
function purgeFontIcons(sourceTSS, uniqueClasses, message, cleanUniqueClasses, prefixes) {
|
|
1710
2033
|
let purgedClasses = '';
|
|
1711
2034
|
let soc = sourceTSS.toString();
|
|
1712
2035
|
|
|
1713
|
-
if (
|
|
2036
|
+
if (prefixes.length > 0) {
|
|
2037
|
+
if (cleanUniqueClasses.some(element => prefixes.includes(element))) {
|
|
2038
|
+
logger.info(message);
|
|
2039
|
+
uniqueClasses.forEach(className => {
|
|
2040
|
+
let cleanClassName = cleanClassNameFn(className);
|
|
2041
|
+
if (soc.includes(`'.${cleanClassName}'`)) {
|
|
2042
|
+
sourceTSS.forEach(line => {
|
|
2043
|
+
if (line.startsWith(`'.${cleanClassName}'`)) {
|
|
2044
|
+
purgedClasses += helpers.checkPlatformAndDevice(line, uniqueClasses[uniqueClasses.indexOf(className)]);
|
|
2045
|
+
}
|
|
2046
|
+
});
|
|
2047
|
+
}
|
|
2048
|
+
});
|
|
2049
|
+
}
|
|
2050
|
+
} else {
|
|
1714
2051
|
logger.info(message);
|
|
1715
2052
|
uniqueClasses.forEach(className => {
|
|
1716
2053
|
let cleanClassName = cleanClassNameFn(className);
|
|
@@ -17,8 +17,8 @@ if (!fs.existsSync('./dist')) {
|
|
|
17
17
|
let rules = _.map(data.stylesheet.rules, rule => {
|
|
18
18
|
if (rule.type === 'rule' && rule.selectors[0].includes(':before')) {
|
|
19
19
|
return {
|
|
20
|
-
'selector': rule.selectors[0].replace(':before', '').replace('.', ''),
|
|
21
|
-
'property': rule.declarations[0].value.replace('\"\\', '').replace('\"', '')
|
|
20
|
+
'selector': rule.selectors[0].replace('::before', '').replace(':before', '').replace('.', ''),
|
|
21
|
+
'property': ('0000' + rule.declarations[0].value.replace('\"\\', '').replace('\"', '')).slice(-4)
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -32,8 +32,8 @@ function processCSS(data) {
|
|
|
32
32
|
let rules = _.map(data.stylesheet.rules, rule => {
|
|
33
33
|
if (rule.type === 'rule' && rule.selectors[0].includes(':before')) {
|
|
34
34
|
return {
|
|
35
|
-
'selector': rule.selectors[0].replace(':before', ''),
|
|
36
|
-
'property': rule.declarations[0].value.replace('\"\\', '').replace('\"', '')
|
|
35
|
+
'selector': rule.selectors[0].replace('::before', '').replace(':before', ''),
|
|
36
|
+
'property': ('0000' + rule.declarations[0].value.replace('\"\\', '').replace('\"', '')).slice(-4)
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
});
|
|
@@ -18,9 +18,9 @@ function callback(err) {
|
|
|
18
18
|
fs.mkdirSync(detinationFontsFolder)
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
fs.copyFile(sourceFontsFolder + '/fa-brands-400.ttf', detinationFontsFolder + '/
|
|
22
|
-
fs.copyFile(sourceFontsFolder + '/fa-regular-400.ttf', detinationFontsFolder + '/
|
|
23
|
-
fs.copyFile(sourceFontsFolder + '/fa-solid-900.ttf', detinationFontsFolder + '/
|
|
21
|
+
fs.copyFile(sourceFontsFolder + '/fa-brands-400.ttf', detinationFontsFolder + '/FontAwesome6Brands-Regular.ttf', callback);
|
|
22
|
+
fs.copyFile(sourceFontsFolder + '/fa-regular-400.ttf', detinationFontsFolder + '/FontAwesome6Free-Regular.ttf', callback);
|
|
23
|
+
fs.copyFile(sourceFontsFolder + '/fa-solid-900.ttf', detinationFontsFolder + '/FontAwesome6Free-Solid.ttf', callback);
|
|
24
24
|
|
|
25
25
|
console.log(`${purgeLabel} Font Awesome Free copied to './assets/fonts'`);
|
|
26
26
|
|