purgetss 6.2.47 → 6.2.49
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/bin/purgetss +1 -0
- package/dist/purgetss.ui.js +1 -1
- package/index.js +8 -7
- package/lib/templates/purgetss.config.js +3 -3
- package/package.json +1 -1
package/bin/purgetss
CHANGED
|
@@ -39,6 +39,7 @@ program
|
|
|
39
39
|
.help(`Create a new Alloy Project with ${chalk.green('PurgeTSS')} configured. You’ll need to have ${chalk.yellow('app.idprefix')} and ${chalk.yellow('app.workspace')} already configured.`)
|
|
40
40
|
.option('-f, --force', 'Force create even if the project already exists')
|
|
41
41
|
.option('-d, --dependencies', `Install ${chalk.green('ESLint')} and ${chalk.green('Tailwind CSS')} for a better development experience using PurgeTSS`)
|
|
42
|
+
.option('-m, --module', `Install ${chalk.yellow('purgetss.ui.js')} module to the project's ${chalk.yellow('lib')} folder`)
|
|
42
43
|
.option('-v, --vendor <arguments>', `Use any of the following arguments to copy specific font vendors:\n ${chalk.yellow('fa')} = Font Awesome Icons\n ${chalk.yellow('mi')} = Material Icons\n ${chalk.yellow('ms')} = Material Symbols\n ${chalk.yellow('f7')} = Framework7 Icons`)
|
|
43
44
|
.argument('<name>', 'The name of the project')
|
|
44
45
|
.action((args, options, logger) => {
|
package/dist/purgetss.ui.js
CHANGED
package/index.js
CHANGED
|
@@ -381,7 +381,7 @@ function create(args, options) {
|
|
|
381
381
|
|
|
382
382
|
if (fs.existsSync(`${workspace}/${args.name}`)) {
|
|
383
383
|
if (options.force) {
|
|
384
|
-
logger.info('Deleting existing project folder')
|
|
384
|
+
logger.info('Deleting existing project’s folder')
|
|
385
385
|
exec(`chown -R $USER "${workspace}/${args.name}" && rm -rf "${workspace}/${args.name}"`, error => {
|
|
386
386
|
if (error) return logger.error(error)
|
|
387
387
|
createProject(workspace, args.name, projectID, options)
|
|
@@ -394,7 +394,7 @@ function create(args, options) {
|
|
|
394
394
|
default: false
|
|
395
395
|
}]).then(answers => {
|
|
396
396
|
if (answers.delete) {
|
|
397
|
-
logger.info('Deleting existing project folder')
|
|
397
|
+
logger.info('Deleting existing project’s folder')
|
|
398
398
|
exec(`chown -R $USER "${workspace}/${args.name}" && rm -rf "${workspace}/${args.name}"`, error => {
|
|
399
399
|
if (error) return logger.error(error)
|
|
400
400
|
createProject(workspace, args.name, projectID, options)
|
|
@@ -538,6 +538,11 @@ function createProject(workspace, argsName, projectID, options) {
|
|
|
538
538
|
execSync(`cd ${projectDirectory} && purgetss il -m -v=${options.vendor}`)
|
|
539
539
|
}
|
|
540
540
|
|
|
541
|
+
if (options.module) {
|
|
542
|
+
logger.info(`Installing ${chalk.green('purgetss.ui')}`)
|
|
543
|
+
execSync(`cd ${projectDirectory} && purgetss m`)
|
|
544
|
+
}
|
|
545
|
+
|
|
541
546
|
if (options.dependencies) {
|
|
542
547
|
logger.info(`Creating a new ${chalk.yellow('package.json')} file`)
|
|
543
548
|
execSync(`cd ${projectDirectory} && npm init -y`)
|
|
@@ -686,7 +691,7 @@ function buildFonts(options) {
|
|
|
686
691
|
tssClasses += processFontsCSS(cssFile, prefix)
|
|
687
692
|
|
|
688
693
|
// ! JavaScript Module
|
|
689
|
-
if (options.module) {
|
|
694
|
+
if (options.module || fs.existsSync(`${projectsLibFolder}/purgetss.fonts.js`)) {
|
|
690
695
|
fontJS += processFontsJS(cssFile, `\n\t// ${theCSSFileName}`, prefix)
|
|
691
696
|
fontFamiliesJS += processFontFamilyNamesJS(cssFile, `\n\t// ${theCSSFileName}`, prefix)
|
|
692
697
|
}
|
|
@@ -727,10 +732,6 @@ function buildFonts(options) {
|
|
|
727
732
|
})
|
|
728
733
|
|
|
729
734
|
logger.info(`${chalk.yellow('./app/lib/purgetss.fonts.js')} file created!`)
|
|
730
|
-
} else {
|
|
731
|
-
if (fs.existsSync(`${projectsLibFolder}/purgetss.fonts.js`)) {
|
|
732
|
-
fs.unlinkSync(`${projectsLibFolder}/purgetss.fonts.js`)
|
|
733
|
-
}
|
|
734
735
|
}
|
|
735
736
|
|
|
736
737
|
if (files.length > 0) {
|
|
@@ -6,9 +6,9 @@ module.exports = {
|
|
|
6
6
|
|
|
7
7
|
// These options are passed directly to PurgeTSS
|
|
8
8
|
options: {
|
|
9
|
-
legacy: false, // Generates &
|
|
10
|
-
missing: true, //
|
|
11
|
-
widgets: false, //
|
|
9
|
+
legacy: false, // Generates & purges tailwind.tss v5.x classes
|
|
10
|
+
missing: true, // Reports missing classes
|
|
11
|
+
widgets: false, // Purges widgets too
|
|
12
12
|
safelist: [], // Array of classes to keep
|
|
13
13
|
plugins: [] // Array of properties to ignore
|
|
14
14
|
}
|