purgetss 6.3.13 → 7.1.1

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 (107) hide show
  1. package/README.md +68 -15
  2. package/bin/purgetss +404 -120
  3. package/dist/colores.js +8 -0
  4. package/dist/configs/vscode/extensions.json +1 -1
  5. package/dist/fontawesome.js +2494 -2494
  6. package/dist/framework7icons.js +1254 -1254
  7. package/dist/materialicons.js +2293 -2293
  8. package/dist/materialsymbols.js +3023 -3023
  9. package/dist/purgetss.ui.js +1 -1
  10. package/dist/tailwind.tss +1 -1
  11. package/experimental/completions2.js +21 -12
  12. package/lib/color-shades/defaultHexcodes.js +1 -1
  13. package/lib/color-shades/findClosestColor.js +2 -2
  14. package/lib/color-shades/generateColorShades.js +5 -6
  15. package/lib/color-shades/generateTailwindColorsFile.js +2 -2
  16. package/lib/color-shades/tailwindColors.js +1 -1
  17. package/lib/completions/titanium/completions-v3.json +34321 -34321
  18. package/lib/logger.js +4 -3
  19. package/lib/templates/custom-template.tss +1 -1
  20. package/lib/templates/{purgetss.config.js → purgetss.config.js.cjs} +1 -2
  21. package/lib/templates/{purgetss.ui.js → purgetss.ui.js.cjs} +1 -1
  22. package/lib/templates/tailwind/custom-template.tss +1 -1
  23. package/lib/test-function.js +1 -1
  24. package/package.json +37 -30
  25. package/src/cli/commands/build.js +38 -0
  26. package/src/cli/commands/color-module.js +49 -0
  27. package/src/cli/commands/create.js +171 -0
  28. package/src/cli/commands/dependencies.js +72 -0
  29. package/src/cli/commands/fonts.js +594 -0
  30. package/src/cli/commands/icon-library.js +402 -0
  31. package/src/cli/commands/init.js +200 -0
  32. package/src/cli/commands/module.js +53 -0
  33. package/src/cli/commands/purge.js +489 -0
  34. package/src/cli/commands/shades.js +187 -0
  35. package/src/cli/commands/update.js +48 -0
  36. package/src/cli/commands/watch.js +92 -0
  37. package/src/cli/utils/cli-helpers.js +79 -0
  38. package/src/cli/utils/file-operations.js +110 -0
  39. package/src/cli/utils/font-utilities.js +129 -0
  40. package/src/cli/utils/hook-management.js +169 -0
  41. package/src/cli/utils/project-detection.js +97 -0
  42. package/src/core/analyzers/class-extractor.js +203 -0
  43. package/src/core/analyzers/file-scanner.js +73 -0
  44. package/src/core/analyzers/missing-classes.js +81 -0
  45. package/src/core/builders/tailwind-builder.js +393 -0
  46. package/src/core/builders/tailwind-helpers.js +448 -0
  47. package/src/core/purger/fonts-purger.js +31 -0
  48. package/src/core/purger/icon-purger.js +155 -0
  49. package/src/core/purger/tailwind-purger.js +237 -0
  50. package/src/dev/builders/fontawesome-builder.js +250 -0
  51. package/src/dev/builders/fonts-folder-builder.js +63 -0
  52. package/src/dev/builders/icon-builders/fontawesome-builder.js +82 -0
  53. package/src/dev/builders/icon-builders/fontawesome-js-builder.js +98 -0
  54. package/src/dev/builders/icon-builders/framework7-builder.js +75 -0
  55. package/src/dev/builders/icon-builders/framework7-js-builder.js +90 -0
  56. package/src/dev/builders/icon-builders/material-icons-builder.js +58 -0
  57. package/src/dev/builders/icon-builders/material-icons-js-builder.js +99 -0
  58. package/src/dev/builders/icon-builders/material-symbols-builder.js +57 -0
  59. package/src/dev/builders/icon-builders/material-symbols-js-builder.js +97 -0
  60. package/src/dev/builders/module-builder.js +41 -0
  61. package/src/dev/builders/tailwind-builder.js +26 -0
  62. package/src/dev/utils/codepoints-processor.js +31 -0
  63. package/{index.js → src/index-legacy.js} +164 -92
  64. package/src/index.js +22 -0
  65. package/src/shared/brand-colors.js +8 -0
  66. package/src/shared/config-manager.js +148 -0
  67. package/src/shared/constants.js +197 -0
  68. package/src/shared/helpers/accessibility.js +209 -0
  69. package/src/shared/helpers/animation.js +548 -0
  70. package/src/shared/helpers/colors.js +731 -0
  71. package/src/shared/helpers/core.js +21 -0
  72. package/src/shared/helpers/form-controls.js +247 -0
  73. package/src/shared/helpers/input.js +539 -0
  74. package/src/shared/helpers/layout.js +695 -0
  75. package/src/shared/helpers/lists.js +708 -0
  76. package/src/shared/helpers/media.js +660 -0
  77. package/src/shared/helpers/platform.js +462 -0
  78. package/src/shared/helpers/scrolling.js +363 -0
  79. package/src/shared/helpers/typography.js +271 -0
  80. package/src/shared/helpers/ui-properties.js +1329 -0
  81. package/src/shared/helpers/utils.js +1074 -0
  82. package/src/shared/helpers.js +44 -0
  83. package/src/shared/logger.js +84 -0
  84. package/src/shared/utils.js +150 -0
  85. package/experimental/completions.js +0 -791
  86. package/lib/build-fontawesome-free-js.js +0 -65
  87. package/lib/build-fontawesome-free-tss.js +0 -49
  88. package/lib/build-fonts-folder.js +0 -33
  89. package/lib/build-framework7-icons-js.js +0 -57
  90. package/lib/build-framework7-icons-tss.js +0 -42
  91. package/lib/build-material-icons-js.js +0 -66
  92. package/lib/build-material-icons-tss.js +0 -53
  93. package/lib/build-material-symbols-js.js +0 -64
  94. package/lib/build-material-symbols-tss.js +0 -51
  95. package/lib/build-module.js +0 -12
  96. package/lib/build-tailwind-legacy.js +0 -7
  97. package/lib/build-tailwind.js +0 -5
  98. package/lib/colores.js +0 -8
  99. package/lib/helpers.js +0 -7361
  100. /package/lib/templates/custom-icon-fonts/{template.js → template.js.cjs} +0 -0
  101. /package/lib/templates/fontawesome/{beta-template.js → beta-template.js.cjs} +0 -0
  102. /package/lib/templates/fontawesome/{free-template.js → free-template.js.cjs} +0 -0
  103. /package/lib/templates/fontawesome/{pro-template.js → pro-template.js.cjs} +0 -0
  104. /package/lib/templates/framework7/{template.js → template.js.cjs} +0 -0
  105. /package/lib/templates/{icon-functions.js → icon-functions.js.cjs} +0 -0
  106. /package/lib/templates/materialicons/{template.js → template.js.cjs} +0 -0
  107. /package/lib/templates/materialsymbols/{template.js → template.js.cjs} +0 -0
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="https://codigomovil.mx/images/logotipo-purgetss-gris.svg" height="230" width="230" alt="PurgeCSS logo"/>
2
+ <img src="https://codigomovil.mx/images/logotipo-purgetss-gris.svg" height="230" width="230" alt="PurgeCSS logo"/>
3
3
  </p>
4
4
 
5
5
  <div align="center">
@@ -10,38 +10,91 @@
10
10
 
11
11
  </div>
12
12
 
13
- **Purge TSS** is a toolkit designed to enhance the development of mobile applications using the **[Titanium framework](https://titaniumsdk.com)**. It introduces several key features to streamline the app development process, making it simpler and more efficient for developers.
13
+ **PurgeTSS** is a toolkit designed to enhance the development of mobile applications using the **[Titanium framework](https://titaniumsdk.com)**. It introduces several key features to streamline the app development process, making it simpler and more efficient for developers.
14
14
 
15
15
  It offers a range of tools such as customizable utility classes, support for icon fonts, a user-friendly Animation module, a straightforward grid system, and the added convenience of the `shades` command for crafting personalized colors.
16
16
 
17
- With **Purge TSS**, creating visually appealing and dynamic mobile apps becomes more accessible and efficient.
17
+ With **PurgeTSS**, creating visually appealing and dynamic mobile apps becomes more accessible and efficient.
18
18
 
19
19
  ---
20
20
 
21
- Here are its main functionalities:
21
+ ## What's New in v7.1.0
22
+
23
+ **Major Refactoring & ESM Migration**: PurgeTSS v7.1 has been completely refactored with improved code organization, better ESM compatibility, enhanced error handling, and a more intuitive CLI experience.
24
+
25
+ ### ⚠️ Breaking Changes
26
+
27
+ - **Node.js 16+** required (ESM support)
28
+ - **Configuration file**: `config.js` → `config.cjs` (same content, different extension for CommonJS compatibility)
29
+ - **Removed deprecated commands**:
30
+ - `copy-fonts` (use `icon-library` instead)
31
+ - `build-legacy` (legacy Tailwind build removed)
32
+ - **Complete legacy mode removal**:
33
+ - All legacy-related code and conditional checks eliminated
34
+ - Legacy mode no longer supported anywhere in the codebase
35
+ - `purge.options.legacy` configuration option completely removed
36
+ - **Simplified font generation**:
37
+ - `build-fonts` `-p` flag removed (now handled by `-f` flag)
38
+ - `build-fonts` command options simplified for better consistency
39
+ - **Updated dependencies** to latest ESM versions (chalk v5+, etc.)
40
+
41
+ ### ✅ What's Maintained
42
+
43
+ - **Same CLI interface** - All commands and options preserved
44
+ - **100% API compatibility** - All existing commands work the same
45
+ - **Same configuration structure** - Your existing config content works unchanged
46
+
47
+ ### 🔄 Command Improvements
48
+
49
+ - **Enhanced CLI error handling**: Improved error messages with command suggestions when unknown commands are entered
50
+ - **CLI reorganization**: Commands are now organized in logical categories (Setup, Development, Assets, Utilities, Maintenance) for better discoverability
51
+ - **`build-fonts` simplified**:
52
+ - Removed `-p` (--icon-prefix-from-filename) flag
53
+ - The `-f` flag now controls both font class names AND icon prefixes using filenames
54
+ - More consistent and intuitive behavior
55
+ - **Internal code modularization**: Refactored monolithic helper files into specialized modules for better maintainability
56
+ - **Complete legacy mode removal**: Removed `build-legacy` command and all legacy-related code for cleaner, modern codebase
57
+
58
+ ### 🔧 Migration Guide
59
+
60
+ For most users, upgrading is seamless:
61
+ ```bash
62
+ npm install -g purgetss@7.1.0
63
+ ```
64
+
65
+ **Key changes to note:**
66
+ - Only requirement: **Node.js 16 or higher**
67
+ - If you used the `build-legacy` command, use the regular `build` command instead
68
+ - **Enhanced CLI**: Unknown commands now provide helpful suggestions instead of generic errors
69
+ - If you had `legacy: true` in your config, remove this option (legacy mode completely discontinued)
70
+ - If you used `build-fonts` with the `-p` flag, now use `-f` instead (handles both font classes and icon prefixes)
22
71
 
23
- - **Tailwind-like Utility Classes**: Purge TSS offers over 21,000 utility classes similar to Tailwind CSS, providing a vast array of styling options for your projects.
72
+ ---
24
73
 
25
- - **Efficient Style Management**: It parses all your XML files to create a clean `app.tss` file, containing only the classes actually used in your project. This helps in reducing file size and improving performance.
74
+ Here are its main functionalities:
26
75
 
76
+ - **Tailwind-like Utility Classes**: *PurgeTSS* offers over 21,000 utility classes similar to Tailwind CSS, providing a vast array of styling options for your projects.
77
+ - **Efficient Style Management**: It parses all your XML files to create a clean `app.tss` file, containing only the classes actually used in your project. This helps in reducing file size and improving performance.
27
78
  - **Customization and JIT Classes**: Developers can customize default classes via a simple configuration file. It also supports just-in-time (JIT) classes, allowing the creation of arbitrary values within views for tailored styling.
28
-
29
- - **Icon Fonts Integration**: Purge TSS facilitates the use of popular icon fonts such as Font Awesome, Material Icons, Material Symbols, and Framework7-Icons in Buttons and Labels.
30
-
31
- - **Fonts.tss Generation**: This process creates a `fonts.tss` file with class definitions and fontFamily selectors for various font types, making it easy to add custom fonts, including icon fonts, to a project.
32
-
79
+ - **Icon Fonts Integration**: *PurgeTSS* facilitates the use of popular icon fonts such as *Font Awesome*, *Material Icons*, *Material Symbols*, and *Framework7-Icons* in Buttons and Labels.
80
+ - **fonts.tss Generation**: The `build-fonts` command creates a `fonts.tss` file with class definitions and fontFamily selectors for various font types. It supports both regular fonts and icon fonts, with simplified options for using filenames as class names and icon prefixes.
33
81
  - **Shades Command**: The toolkit includes a `shades` command that enables developers to generate custom color shades from a specified hex color, eliminating the need for external tools.
34
-
35
- - **Animation Module**: Purge TSS comes with an Animation module to apply basic 2D Matrix animations or transformations to elements or arrays of elements.
36
-
82
+ - **Animation Module**: *PurgeTSS* comes with an Animation module to apply basic 2D Matrix animations or transformations to elements or arrays of elements.
37
83
  - **Grid System**: It includes a simple yet effective two-dimensional grid system to align and distribute elements within views.
38
84
 
39
- Overall, Purge TSS aims to simplify the mobile app development process, offering tools and features that enhance productivity and creativity in designing user interfaces.
85
+ Overall, *PurgeTSS* aims to simplify the mobile app development process, offering tools and features that enhance productivity and creativity in designing user interfaces.
40
86
 
41
87
  ### Visit the official documentation site at [purgetss.com](https://purgetss.com) to learn more.
42
88
 
89
+ ## Requirements
90
+
91
+ - **Titanium SDK** (any recent version)
92
+ - **Alloy Framework** (for most commands)
93
+ - **Node.js 16+** (required for ESM support)
94
+
43
95
  ## Table of Content
44
96
 
97
+ - [What's New in v7.1](#-whats-new-in-v710)
45
98
  - [Installation](https://purgetss.com/docs/installation)
46
99
  - [Commands](https://purgetss.com/docs/commands)
47
100
  - Customization