@bookklik/senangstart-css 0.2.9 → 0.2.12
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/.agent/skills/add-utility/SKILL.md +65 -0
- package/.agent/workflows/add-utility.md +2 -0
- package/.agent/workflows/build.md +2 -0
- package/.agent/workflows/dev.md +2 -0
- package/AGENTS.md +30 -0
- package/dist/senangstart-css.js +607 -180
- package/dist/senangstart-css.min.js +234 -195
- package/dist/senangstart-tw.js +274 -8
- package/dist/senangstart-tw.min.js +1 -1
- package/docs/SYNTAX-REFERENCE.md +1731 -1590
- package/docs/guide/preflight.md +20 -1
- package/docs/ms/guide/preflight.md +19 -0
- package/docs/ms/reference/breakpoints.md +14 -0
- package/docs/ms/reference/visual/border-radius.md +50 -10
- package/docs/ms/reference/visual/contain.md +57 -0
- package/docs/ms/reference/visual/content-visibility.md +53 -0
- package/docs/ms/reference/visual/placeholder-color.md +92 -0
- package/docs/ms/reference/visual/ring-color.md +2 -2
- package/docs/ms/reference/visual/ring-offset.md +3 -3
- package/docs/ms/reference/visual/ring.md +5 -5
- package/docs/ms/reference/visual/writing-mode.md +53 -0
- package/docs/ms/reference/visual.md +6 -0
- package/docs/public/assets/senangstart-css.min.js +234 -195
- package/docs/public/llms.txt +45 -12
- package/docs/reference/breakpoints.md +14 -0
- package/docs/reference/visual/border-radius.md +50 -10
- package/docs/reference/visual/contain.md +57 -0
- package/docs/reference/visual/content-visibility.md +53 -0
- package/docs/reference/visual/placeholder-color.md +92 -0
- package/docs/reference/visual/ring-color.md +2 -2
- package/docs/reference/visual/ring-offset.md +3 -3
- package/docs/reference/visual/ring.md +5 -5
- package/docs/reference/visual/writing-mode.md +53 -0
- package/docs/reference/visual.md +7 -0
- package/docs/syntax-reference.json +2185 -2009
- package/package.json +1 -1
- package/scripts/convert-tailwind.js +300 -26
- package/scripts/generate-docs.js +403 -403
- package/src/cdn/senangstart-engine.js +5 -5
- package/src/cdn/tw-conversion-engine.js +305 -8
- package/src/cli/commands/build.js +51 -13
- package/src/cli/commands/dev.js +157 -93
- package/src/compiler/generators/css.js +467 -208
- package/src/compiler/generators/preflight.js +26 -13
- package/src/compiler/generators/typescript.js +3 -1
- package/src/compiler/index.js +27 -3
- package/src/compiler/parser.js +13 -6
- package/src/compiler/tokenizer.js +25 -23
- package/src/config/defaults.js +3 -0
- package/src/core/tokenizer-core.js +46 -19
- package/src/definitions/index.js +4 -1
- package/src/definitions/visual-borders.js +10 -10
- package/src/definitions/visual-performance.js +126 -0
- package/src/definitions/visual.js +25 -9
- package/src/utils/common.js +456 -27
- package/src/utils/node-io.js +82 -0
- package/tests/integration/dev-recovery.test.js +231 -0
- package/tests/unit/cli/memory-limits.test.js +169 -0
- package/tests/unit/compiler/css-generation-error-handling.test.js +204 -0
- package/tests/unit/compiler/generators/css-errors.test.js +102 -0
- package/tests/unit/compiler/generators/css.test.js +102 -5
- package/tests/unit/convert-tailwind.test.js +518 -431
- package/tests/unit/utils/common.test.js +376 -26
- package/tests/unit/utils/file-timeout.test.js +154 -0
- package/tests/unit/utils/theme-validation.test.js +181 -0
- package/tests/unit/compiler/generators/css.coverage.test.js +0 -833
- package/tests/unit/convert-tailwind.cli.test.js +0 -95
- package/tests/unit/security.test.js +0 -206
- /package/tests/unit/{convert-tailwind.coverage.test.js → convert-tailwind-edgecases.test.js} +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Add Utility
|
|
3
|
+
description: Add new CSS utilities to the framework with definitions, engine, docs, and tests
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Add Utility Skill
|
|
7
|
+
|
|
8
|
+
This skill guides you through the process of adding a new utility to the SenangStart CSS framework.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Adding a utility involves four main steps:
|
|
13
|
+
1. **Definition**: Define the utility's metadata and syntax in `src/definitions/`.
|
|
14
|
+
2. **Engine Implementation**: Add handling logic to the JIT engine.
|
|
15
|
+
3. **Documentation**: Document the new utility in the VitePress docs.
|
|
16
|
+
4. **Testing**: Add unit and synchronization tests.
|
|
17
|
+
|
|
18
|
+
## 1. Define the Utility
|
|
19
|
+
|
|
20
|
+
Add a new definition in the appropriate file in `src/definitions/` (e.g., `visual.js`, `layout.js`, or `space.js`).
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
{
|
|
24
|
+
name: 'my-utility',
|
|
25
|
+
property: 'my-css-property',
|
|
26
|
+
category: 'visual',
|
|
27
|
+
attribute: 'visual',
|
|
28
|
+
description: '...',
|
|
29
|
+
descriptionMs: '...',
|
|
30
|
+
syntax: 'value1 | value2 | [arbitrary]',
|
|
31
|
+
values: [
|
|
32
|
+
{ name: 'value1', value: 'css-value1', description: '...' }
|
|
33
|
+
],
|
|
34
|
+
examples: [
|
|
35
|
+
{ code: 'visual="my-utility:value1"', description: '...' }
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 2. Update the JIT Engine
|
|
41
|
+
|
|
42
|
+
Modify `src/cdn/senangstart-engine.js` to handle the new utility in the appropriate generator function (`generateVisualRule`, `generateLayoutRule`, or `generateSpaceRule`).
|
|
43
|
+
|
|
44
|
+
```javascript
|
|
45
|
+
if (prop === 'my-utility') {
|
|
46
|
+
const scaleValue = config.theme.myScale?.[value];
|
|
47
|
+
if (scaleValue) return `my-css-property: ${scaleValue}`;
|
|
48
|
+
if (value.startsWith('[') && value.endsWith(']')) {
|
|
49
|
+
return `my-css-property: ${value.slice(1, -1)}`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 3. Update Documentation
|
|
55
|
+
|
|
56
|
+
Add the utility to the relevant documentation file in `docs/utilities/`.
|
|
57
|
+
|
|
58
|
+
## 4. Add Tests
|
|
59
|
+
|
|
60
|
+
1. **Unit Test**: Add a test in `tests/unit/compiler/generators/`.
|
|
61
|
+
2. **Sync Test**: Ensure the utility is covered by synchronization tests.
|
|
62
|
+
|
|
63
|
+
## Workflows
|
|
64
|
+
|
|
65
|
+
Use the `/add-utility` workflow to assist with these steps.
|
package/.agent/workflows/dev.md
CHANGED
package/AGENTS.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Agents
|
|
2
|
+
|
|
3
|
+
This project uses a set of specialized skills and workflows to manage the development of SenangStart CSS.
|
|
4
|
+
|
|
5
|
+
## Skills
|
|
6
|
+
|
|
7
|
+
Skills are specialized knowledge domains and instructions for the agent to perform specific tasks.
|
|
8
|
+
|
|
9
|
+
- **[Compiler Development](file:///.agent/skills/compiler-development/SKILL.md)**: Understanding and extending the CLI compiler with parser, tokenizer, and CSS generators.
|
|
10
|
+
- **[JIT Engine Development](file:///.agent/skills/jit-engine/SKILL.md)**: Developing and extending the browser-based JIT CSS engine.
|
|
11
|
+
- **[SenangStart CSS Architecture](file:///.agent/skills/senangstart-architecture/SKILL.md)**: Understanding the core architecture and design patterns of the SenangStart CSS framework.
|
|
12
|
+
- **[Tailwind CSS Conversion](file:///.agent/skills/tailwind-conversion/SKILL.md)**: Converting Tailwind CSS to SenangStart CSS using the conversion engine.
|
|
13
|
+
- **[Add Utility](file:///.agent/skills/add-utility/SKILL.md)**: Add new CSS utilities to the framework with definitions, engine, docs, and tests.
|
|
14
|
+
|
|
15
|
+
## Workflows
|
|
16
|
+
|
|
17
|
+
Workflows are multi-step processes for common development tasks.
|
|
18
|
+
|
|
19
|
+
- **[/add-utility](file:///.agent/workflows/add-utility.md)**: Add new CSS utilities to the framework with definitions, engine, docs, and tests.
|
|
20
|
+
- **[/build](file:///.agent/workflows/build.md)**: Build distribution files and publish to npm.
|
|
21
|
+
- **[/dev](file:///.agent/workflows/dev.md)**: Start development server with hot reload for docs or CLI watch mode.
|
|
22
|
+
- **[/docs](file:///.agent/workflows/docs.md)**: Generate, build, and manage documentation from definitions.
|
|
23
|
+
- **[/test](file:///.agent/workflows/test.md)**: Run tests including unit, integration, sync, and coverage reports.
|
|
24
|
+
|
|
25
|
+
## Standards
|
|
26
|
+
|
|
27
|
+
- All skills must have a `SKILL.md` file in their respective directory under `.agent/skills/`.
|
|
28
|
+
- All workflows must be defined as `.md` files in `.agent/workflows/`.
|
|
29
|
+
- Use `// turbo` or `// turbo-all` in workflows to indicate steps that are safe to auto-run.
|
|
30
|
+
- Prefer `// turbo-all` for workflows where all commands are safe (e.g., build, test, docs).
|