@cwcss/crosswind 0.1.5 → 0.1.6
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/LICENSE.md +21 -0
- package/README.md +390 -0
- package/dist/build.d.ts +24 -0
- package/dist/config.d.ts +5 -0
- package/dist/generator.d.ts +31 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +12798 -0
- package/dist/parser.d.ts +42 -0
- package/dist/plugin.d.ts +22 -0
- package/dist/preflight-forms.d.ts +5 -0
- package/dist/preflight.d.ts +2 -0
- package/dist/rules-advanced.d.ts +27 -0
- package/dist/rules-effects.d.ts +25 -0
- package/dist/rules-forms.d.ts +7 -0
- package/dist/rules-grid.d.ts +13 -0
- package/dist/rules-interactivity.d.ts +41 -0
- package/dist/rules-layout.d.ts +26 -0
- package/dist/rules-transforms.d.ts +33 -0
- package/dist/rules-typography.d.ts +41 -0
- package/dist/rules.d.ts +39 -0
- package/dist/scanner.d.ts +18 -0
- package/dist/transformer-compile-class.d.ts +37 -0
- package/{src/types.ts → dist/types.d.ts} +17 -86
- package/package.json +1 -1
- package/PLUGIN.md +0 -235
- package/benchmark/framework-comparison.bench.ts +0 -850
- package/bin/cli.ts +0 -365
- package/bin/crosswind +0 -0
- package/bin/headwind +0 -0
- package/build.ts +0 -8
- package/crosswind.config.ts +0 -9
- package/example/comprehensive.html +0 -70
- package/example/index.html +0 -21
- package/example/output.css +0 -236
- package/examples/plugin/README.md +0 -112
- package/examples/plugin/build.ts +0 -32
- package/examples/plugin/src/index.html +0 -34
- package/examples/plugin/src/index.ts +0 -7
- package/headwind +0 -2
- package/src/build.ts +0 -101
- package/src/config.ts +0 -529
- package/src/generator.ts +0 -2173
- package/src/index.ts +0 -10
- package/src/parser.ts +0 -1471
- package/src/plugin.ts +0 -118
- package/src/preflight-forms.ts +0 -229
- package/src/preflight.ts +0 -388
- package/src/rules-advanced.ts +0 -477
- package/src/rules-effects.ts +0 -461
- package/src/rules-forms.ts +0 -103
- package/src/rules-grid.ts +0 -241
- package/src/rules-interactivity.ts +0 -525
- package/src/rules-layout.ts +0 -385
- package/src/rules-transforms.ts +0 -412
- package/src/rules-typography.ts +0 -486
- package/src/rules.ts +0 -809
- package/src/scanner.ts +0 -84
- package/src/transformer-compile-class.ts +0 -275
- package/test/advanced-features.test.ts +0 -911
- package/test/arbitrary.test.ts +0 -396
- package/test/attributify.test.ts +0 -592
- package/test/bracket-syntax.test.ts +0 -1133
- package/test/build.test.ts +0 -99
- package/test/colors.test.ts +0 -934
- package/test/flexbox.test.ts +0 -669
- package/test/generator.test.ts +0 -597
- package/test/grid.test.ts +0 -584
- package/test/layout.test.ts +0 -404
- package/test/modifiers.test.ts +0 -417
- package/test/parser.test.ts +0 -564
- package/test/performance-regression.test.ts +0 -376
- package/test/performance.test.ts +0 -568
- package/test/plugin.test.ts +0 -160
- package/test/scanner.test.ts +0 -94
- package/test/sizing.test.ts +0 -481
- package/test/spacing.test.ts +0 -394
- package/test/transformer-compile-class.test.ts +0 -287
- package/test/transforms.test.ts +0 -448
- package/test/typography.test.ts +0 -632
- package/test/variants-form-states.test.ts +0 -225
- package/test/variants-group-peer.test.ts +0 -66
- package/test/variants-media.test.ts +0 -213
- package/test/variants-positional.test.ts +0 -58
- package/test/variants-pseudo-elements.test.ts +0 -47
- package/test/variants-state.test.ts +0 -62
- package/tsconfig.json +0 -18
package/test/build.test.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { afterAll, beforeAll, describe, expect, it } from 'bun:test'
|
|
2
|
-
import { mkdir, rm, writeFile } from 'node:fs/promises'
|
|
3
|
-
import { join } from 'node:path'
|
|
4
|
-
import { build, buildAndWrite } from '../src/build'
|
|
5
|
-
import { defaultConfig } from '../src/config'
|
|
6
|
-
|
|
7
|
-
const TEST_DIR = join(import.meta.dir, '.build-test')
|
|
8
|
-
|
|
9
|
-
describe('build', () => {
|
|
10
|
-
beforeAll(async () => {
|
|
11
|
-
await mkdir(TEST_DIR, { recursive: true })
|
|
12
|
-
|
|
13
|
-
await writeFile(
|
|
14
|
-
join(TEST_DIR, 'test.html'),
|
|
15
|
-
'<div class="flex p-4 m-2 bg-gray-500 text-white hover:bg-gray-600"></div>',
|
|
16
|
-
)
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
afterAll(async () => {
|
|
20
|
-
await rm(TEST_DIR, { recursive: true, force: true })
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
it('should build CSS from files', async () => {
|
|
24
|
-
const config = {
|
|
25
|
-
...defaultConfig,
|
|
26
|
-
content: [join(TEST_DIR, '*.html')],
|
|
27
|
-
minify: false,
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const result = await build(config)
|
|
31
|
-
|
|
32
|
-
expect(result.css).toContain('.flex')
|
|
33
|
-
expect(result.css).toContain('display: flex;')
|
|
34
|
-
expect(result.css).toContain('.p-4')
|
|
35
|
-
expect(result.css).toContain('padding: 1rem;')
|
|
36
|
-
expect(result.css).toContain('.m-2')
|
|
37
|
-
expect(result.css).toContain('margin: 0.5rem;')
|
|
38
|
-
expect(result.css).toContain('.bg-gray-500')
|
|
39
|
-
expect(result.css).toContain('background-color: oklch(55.1% 0.027 264.364);')
|
|
40
|
-
expect(result.css).toContain('.text-white')
|
|
41
|
-
expect(result.css).toContain('color: #fff;')
|
|
42
|
-
expect(result.classes.size).toBeGreaterThan(0)
|
|
43
|
-
expect(result.duration).toBeGreaterThan(0)
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
it('should include hover variants', async () => {
|
|
47
|
-
const config = {
|
|
48
|
-
...defaultConfig,
|
|
49
|
-
content: [join(TEST_DIR, '*.html')],
|
|
50
|
-
minify: false,
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const result = await build(config)
|
|
54
|
-
expect(result.css).toContain(':hover')
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
it('should minify CSS when enabled', async () => {
|
|
58
|
-
const config = {
|
|
59
|
-
...defaultConfig,
|
|
60
|
-
content: [join(TEST_DIR, '*.html')],
|
|
61
|
-
minify: true,
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const result = await build(config)
|
|
65
|
-
expect(result.css).not.toContain('\n ')
|
|
66
|
-
expect(result.css).toContain('.flex{display:flex}')
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
it('should include safelist classes', async () => {
|
|
70
|
-
const config = {
|
|
71
|
-
...defaultConfig,
|
|
72
|
-
content: [join(TEST_DIR, '*.html')],
|
|
73
|
-
safelist: ['container', 'hidden'],
|
|
74
|
-
minify: false,
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const result = await build(config)
|
|
78
|
-
expect(result.css).toContain('.hidden')
|
|
79
|
-
expect(result.classes.has('container')).toBe(true)
|
|
80
|
-
expect(result.classes.has('hidden')).toBe(true)
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
it('should write CSS to file', async () => {
|
|
84
|
-
const outputPath = join(TEST_DIR, 'output.css')
|
|
85
|
-
const config = {
|
|
86
|
-
...defaultConfig,
|
|
87
|
-
content: [join(TEST_DIR, '*.html')],
|
|
88
|
-
output: outputPath,
|
|
89
|
-
minify: false,
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const result = await buildAndWrite(config)
|
|
93
|
-
const file = Bun.file(outputPath)
|
|
94
|
-
const content = await file.text()
|
|
95
|
-
|
|
96
|
-
expect(content).toBe(result.css)
|
|
97
|
-
expect(content).toContain('.flex')
|
|
98
|
-
})
|
|
99
|
-
})
|