@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.
Files changed (69) hide show
  1. package/.agent/skills/add-utility/SKILL.md +65 -0
  2. package/.agent/workflows/add-utility.md +2 -0
  3. package/.agent/workflows/build.md +2 -0
  4. package/.agent/workflows/dev.md +2 -0
  5. package/AGENTS.md +30 -0
  6. package/dist/senangstart-css.js +607 -180
  7. package/dist/senangstart-css.min.js +234 -195
  8. package/dist/senangstart-tw.js +274 -8
  9. package/dist/senangstart-tw.min.js +1 -1
  10. package/docs/SYNTAX-REFERENCE.md +1731 -1590
  11. package/docs/guide/preflight.md +20 -1
  12. package/docs/ms/guide/preflight.md +19 -0
  13. package/docs/ms/reference/breakpoints.md +14 -0
  14. package/docs/ms/reference/visual/border-radius.md +50 -10
  15. package/docs/ms/reference/visual/contain.md +57 -0
  16. package/docs/ms/reference/visual/content-visibility.md +53 -0
  17. package/docs/ms/reference/visual/placeholder-color.md +92 -0
  18. package/docs/ms/reference/visual/ring-color.md +2 -2
  19. package/docs/ms/reference/visual/ring-offset.md +3 -3
  20. package/docs/ms/reference/visual/ring.md +5 -5
  21. package/docs/ms/reference/visual/writing-mode.md +53 -0
  22. package/docs/ms/reference/visual.md +6 -0
  23. package/docs/public/assets/senangstart-css.min.js +234 -195
  24. package/docs/public/llms.txt +45 -12
  25. package/docs/reference/breakpoints.md +14 -0
  26. package/docs/reference/visual/border-radius.md +50 -10
  27. package/docs/reference/visual/contain.md +57 -0
  28. package/docs/reference/visual/content-visibility.md +53 -0
  29. package/docs/reference/visual/placeholder-color.md +92 -0
  30. package/docs/reference/visual/ring-color.md +2 -2
  31. package/docs/reference/visual/ring-offset.md +3 -3
  32. package/docs/reference/visual/ring.md +5 -5
  33. package/docs/reference/visual/writing-mode.md +53 -0
  34. package/docs/reference/visual.md +7 -0
  35. package/docs/syntax-reference.json +2185 -2009
  36. package/package.json +1 -1
  37. package/scripts/convert-tailwind.js +300 -26
  38. package/scripts/generate-docs.js +403 -403
  39. package/src/cdn/senangstart-engine.js +5 -5
  40. package/src/cdn/tw-conversion-engine.js +305 -8
  41. package/src/cli/commands/build.js +51 -13
  42. package/src/cli/commands/dev.js +157 -93
  43. package/src/compiler/generators/css.js +467 -208
  44. package/src/compiler/generators/preflight.js +26 -13
  45. package/src/compiler/generators/typescript.js +3 -1
  46. package/src/compiler/index.js +27 -3
  47. package/src/compiler/parser.js +13 -6
  48. package/src/compiler/tokenizer.js +25 -23
  49. package/src/config/defaults.js +3 -0
  50. package/src/core/tokenizer-core.js +46 -19
  51. package/src/definitions/index.js +4 -1
  52. package/src/definitions/visual-borders.js +10 -10
  53. package/src/definitions/visual-performance.js +126 -0
  54. package/src/definitions/visual.js +25 -9
  55. package/src/utils/common.js +456 -27
  56. package/src/utils/node-io.js +82 -0
  57. package/tests/integration/dev-recovery.test.js +231 -0
  58. package/tests/unit/cli/memory-limits.test.js +169 -0
  59. package/tests/unit/compiler/css-generation-error-handling.test.js +204 -0
  60. package/tests/unit/compiler/generators/css-errors.test.js +102 -0
  61. package/tests/unit/compiler/generators/css.test.js +102 -5
  62. package/tests/unit/convert-tailwind.test.js +518 -431
  63. package/tests/unit/utils/common.test.js +376 -26
  64. package/tests/unit/utils/file-timeout.test.js +154 -0
  65. package/tests/unit/utils/theme-validation.test.js +181 -0
  66. package/tests/unit/compiler/generators/css.coverage.test.js +0 -833
  67. package/tests/unit/convert-tailwind.cli.test.js +0 -95
  68. package/tests/unit/security.test.js +0 -206
  69. /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.
@@ -2,6 +2,8 @@
2
2
  description: Add new CSS utilities to the framework with definitions, engine, docs, and tests
3
3
  ---
4
4
 
5
+ // turbo-all
6
+
5
7
  # Add New Utility Workflow
6
8
 
7
9
  ## Overview
@@ -2,6 +2,8 @@
2
2
  description: Build distribution files and publish to npm
3
3
  ---
4
4
 
5
+ // turbo-all
6
+
5
7
  # Build & Release Workflow
6
8
 
7
9
  ## Build Distribution Files
@@ -2,6 +2,8 @@
2
2
  description: Start development server with hot reload for docs or CLI watch mode
3
3
  ---
4
4
 
5
+ // turbo-all
6
+
5
7
  # Development Workflow
6
8
 
7
9
  ## Start Documentation Dev Server
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).