chaincss 1.13.0 → 1.13.2
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 +3 -1
- package/node/chaincss.js +4 -4
- package/node/prefixer.js +1 -1
- package/node/strVal.js +65 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/chaincss)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
|
|
6
5
|
[](https://chaincss.dev)
|
|
7
6
|
|
|
8
7
|
> Chainable CSS-in-JS with build-time compilation, atomic CSS, and zero-runtime options
|
|
9
8
|
|
|
9
|
+
> **Note:** The previous package `@melcanz85/chaincss` is no longer supported.
|
|
10
|
+
> **Please install `chaincss` instead:** `npm install chaincss`
|
|
11
|
+
|
|
10
12
|
## Features
|
|
11
13
|
|
|
12
14
|
### Core Styling Features
|
package/node/chaincss.js
CHANGED
|
@@ -387,7 +387,7 @@ const processor = async (inputFile, outputFile) => {
|
|
|
387
387
|
stats: chain.atomicStats
|
|
388
388
|
};
|
|
389
389
|
fs.writeFileSync(mapJsonPath, JSON.stringify(mapData, null, 2), 'utf8');
|
|
390
|
-
console.log(
|
|
390
|
+
console.log(` Class map: ${mapJsonPath}`);
|
|
391
391
|
|
|
392
392
|
// Write JS module for easy import
|
|
393
393
|
const jsPath = path.join(outputDir, 'global.classes.js');
|
|
@@ -404,7 +404,7 @@ export const getClass = (selector) => classMap[selector] || '';
|
|
|
404
404
|
export default classMap;
|
|
405
405
|
`;
|
|
406
406
|
fs.writeFileSync(jsPath, jsContent, 'utf8');
|
|
407
|
-
console.log(
|
|
407
|
+
console.log(` JS module: ${jsPath}`);
|
|
408
408
|
|
|
409
409
|
// Write TypeScript definitions
|
|
410
410
|
const dtsPath = path.join(outputDir, 'global.classes.d.ts');
|
|
@@ -419,7 +419,7 @@ declare const _default: Record<string, string>;
|
|
|
419
419
|
export default _default;
|
|
420
420
|
`;
|
|
421
421
|
fs.writeFileSync(dtsPath, dtsContent, 'utf8');
|
|
422
|
-
console.log(
|
|
422
|
+
console.log(` TypeScript definitions: ${dtsPath}`);
|
|
423
423
|
|
|
424
424
|
// Update manifest
|
|
425
425
|
const manifestPath = path.join(outputDir, 'chaincss-manifest.json');
|
|
@@ -442,7 +442,7 @@ export default _default;
|
|
|
442
442
|
};
|
|
443
443
|
|
|
444
444
|
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2), 'utf8');
|
|
445
|
-
console.log(
|
|
445
|
+
console.log(` Manifest: ${manifestPath}`);
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
} catch (err) {
|
package/node/prefixer.js
CHANGED
|
@@ -40,7 +40,7 @@ class ChainCSSPrefixer {
|
|
|
40
40
|
determineMode() {
|
|
41
41
|
if (this.config.mode === 'full' && !this.hasAutoprefixer) {
|
|
42
42
|
console.warn('⚠️ Full mode requested but autoprefixer not installed. Falling back to lightweight mode.');
|
|
43
|
-
console.warn(' To use full mode: npm install autoprefixer postcss caniuse-db browserslist\n');
|
|
43
|
+
console.warn(' To use full mode install this devDenpendecies: "npm install -D autoprefixer postcss caniuse-db browserslist"\n');
|
|
44
44
|
return 'lightweight';
|
|
45
45
|
}
|
|
46
46
|
if (this.config.mode === 'lightweight') {
|
package/node/strVal.js
CHANGED
|
@@ -25,18 +25,81 @@ Usage:
|
|
|
25
25
|
chaincss <inputFile> <outputFile> [options]
|
|
26
26
|
|
|
27
27
|
Options:
|
|
28
|
-
--watch Watch for changes
|
|
28
|
+
--watch Watch for changes and auto-recompile
|
|
29
29
|
--no-prefix Disable automatic prefixing
|
|
30
30
|
--prefixer-mode <mode> Set prefixer mode (auto|lightweight|full)
|
|
31
31
|
--browsers <list> Browser support list (comma-separated)
|
|
32
32
|
--no-source-map Disable source maps
|
|
33
33
|
--source-map-inline Use inline source maps
|
|
34
|
+
|
|
35
|
+
# Atomic CSS Optimization
|
|
36
|
+
--atomic Enable atomic CSS optimization
|
|
37
|
+
--threshold <number> Minimum usage count for atomic classes (default: 3)
|
|
38
|
+
--atomic-naming <type> Atomic class naming (hash|readable) (default: hash)
|
|
39
|
+
--no-atomic-cache Disable atomic CSS cache
|
|
40
|
+
|
|
41
|
+
# Performance & Debug
|
|
42
|
+
--verbose Enable verbose logging
|
|
43
|
+
--debug Enable debug mode with detailed output
|
|
44
|
+
--tree-shake Remove unused CSS classes (dead code elimination)
|
|
45
|
+
|
|
46
|
+
# Output Control
|
|
47
|
+
--minify Minify CSS output (default: true in production)
|
|
48
|
+
--no-minify Disable CSS minification
|
|
49
|
+
--out-dir <dir> Output directory (default: same as outputFile dir)
|
|
50
|
+
--manifest Generate build manifest file
|
|
51
|
+
|
|
52
|
+
# Configuration
|
|
53
|
+
--config <path> Path to config file (default: chaincss.config.cjs)
|
|
54
|
+
--no-config Ignore config file, use CLI options only
|
|
55
|
+
|
|
56
|
+
# Theme Validation
|
|
57
|
+
--validate-themes Validate theme contracts during build
|
|
58
|
+
|
|
59
|
+
# Help
|
|
60
|
+
--help, -h Show this help message
|
|
61
|
+
--version, -v Show version number
|
|
34
62
|
|
|
35
63
|
Examples:
|
|
64
|
+
# Basic compilation
|
|
36
65
|
chaincss style.jcss style.css
|
|
66
|
+
|
|
67
|
+
# Watch mode for development
|
|
37
68
|
chaincss style.jcss style.css --watch
|
|
38
|
-
|
|
69
|
+
|
|
70
|
+
# Atomic CSS optimization
|
|
71
|
+
chaincss style.jcss style.css --atomic
|
|
72
|
+
|
|
73
|
+
# With custom threshold for atomic classes
|
|
74
|
+
chaincss style.jcss style.css --atomic --threshold 5
|
|
75
|
+
|
|
76
|
+
# Full production build with all optimizations
|
|
77
|
+
chaincss style.jcss style.css --atomic --minify --tree-shake --source-map
|
|
78
|
+
|
|
79
|
+
# Custom browser support
|
|
80
|
+
chaincss style.jcss style.css --browsers "> 1%, last 2 versions, not dead"
|
|
81
|
+
|
|
82
|
+
# Full autoprefixer mode
|
|
83
|
+
chaincss style.jcss style.css --prefixer-mode full
|
|
84
|
+
|
|
85
|
+
# Validate themes during build
|
|
86
|
+
chaincss style.jcss style.css --validate-themes
|
|
87
|
+
|
|
88
|
+
# Debug mode with verbose output
|
|
89
|
+
chaincss style.jcss style.css --debug --verbose
|
|
90
|
+
|
|
91
|
+
# Disable prefixing (for modern browsers only)
|
|
39
92
|
chaincss style.jcss style.css --no-prefix
|
|
93
|
+
|
|
94
|
+
# With custom config file
|
|
95
|
+
chaincss style.jcss style.css --config ./my-chaincss.config.cjs
|
|
96
|
+
|
|
97
|
+
Notes:
|
|
98
|
+
- Atomic CSS optimization reduces CSS size by reusing common style patterns
|
|
99
|
+
- Tree shaking removes unused CSS classes from final bundle
|
|
100
|
+
- Theme validation ensures all themes have required tokens
|
|
101
|
+
- Use --watch during development for instant updates
|
|
102
|
+
- Use --atomic --minify --tree-shake for production builds
|
|
40
103
|
`
|
|
41
104
|
}
|
|
42
105
|
|