recanica 0.0.0-stage → 0.2.0
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 +9 -0
- package/README.md +63 -2
- package/package.json +35 -3
- package/src/audit-browser.d.ts +14 -0
- package/src/audit-browser.js +615 -0
- package/src/audit.js +101 -0
- package/src/check.js +222 -0
- package/src/config.js +105 -0
- package/src/copy-rules.d.ts +2 -0
- package/src/copy-rules.js +56 -0
- package/src/decisions.js +207 -0
- package/src/guard.js +136 -0
- package/src/index.js +548 -0
- package/src/kickoff.js +362 -0
- package/src/report.js +87 -0
- package/src/review.js +222 -0
- package/src/slop-list.js +186 -0
- package/src/slop.js +75 -0
- package/src/test.mjs +448 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aturanica Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,64 @@
|
|
|
1
|
-
#
|
|
1
|
+
# recanica
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Add Recanica (UI framework by Aturanica Labs) to any project.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx recanica init
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Detects Next.js, Vite/React, Tailwind v3, plain HTML, Flutter, SwiftUI and Jetpack Compose. Installs or copies the right
|
|
10
|
+
outputs, wires your global CSS, and writes `AGENTS.md` (+ `CLAUDE.md` importing it) so AI tools follow Recanica.
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx recanica init --stack flutter --yes # skip detection / confirmation
|
|
14
|
+
npx recanica init --dry-run # show what would change
|
|
15
|
+
npx recanica add data-table # copy a pattern or block into your app
|
|
16
|
+
npx recanica tokens swiftui --out Theme/RecanicaTokens.swift
|
|
17
|
+
npx recanica rules # design rules for any LLM
|
|
18
|
+
npx recanica mcp # MCP setup for AI tools
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Guard the design language
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx recanica check src # exit 1 on hard-coded colours, palette hues, bold weights, gradients, AI-jargon copy
|
|
25
|
+
npx recanica check src --all # also warnings: arbitrary radius/spacing, uppercase labels, vague copy
|
|
26
|
+
npx recanica check --json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Add it to CI or a pre-commit hook. Allow a deliberate exception with a `recanica-ignore: <reason>` comment on the line,
|
|
30
|
+
or list paths in `recanica.config.json`:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{ "ignore": ["emails/**"], "rules": { "arbitrary-radius": "off" } }
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Audit the rendered site
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm i -D playwright && npx playwright install chromium
|
|
40
|
+
npx recanica audit http://localhost:3000 --crawl # every reachable page at 375/900/1280px
|
|
41
|
+
npx recanica audit https://staging.example --paths /,/pricing --json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Same rules as Recanica's own CI:
|
|
45
|
+
- **Layout:** overflow, overlap, wrapped labels, table edges, surface padding.
|
|
46
|
+
- **Recanica spec:** token colours only, no bold, pill buttons, radius scale, same component = same look.
|
|
47
|
+
- **Copy:** AI jargon and placeholder text in rendered copy.
|
|
48
|
+
- **Accessibility:** names, labels, 24px targets, dead links.
|
|
49
|
+
|
|
50
|
+
## Rework an existing project (not just reskin)
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx recanica review http://localhost:3000 --crawl # writes recanica-review.md
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
For every page the review lists what makes it busy, with the Recanica fix for each item:
|
|
57
|
+
- competing primary buttons
|
|
58
|
+
- too many text sizes, colours or borders
|
|
59
|
+
- nested cards
|
|
60
|
+
- a crowded first screen
|
|
61
|
+
- wide tables, long unsectioned forms, long nav
|
|
62
|
+
- tiny text, or a missing title
|
|
63
|
+
|
|
64
|
+
It also suggests the Recanica pattern to rebuild the page as, and leaves a keep / change / remove table to agree **before** changing code.
|
package/package.json
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "recanica",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Add Recanica (UI framework by Aturanica Labs) to any project: npx recanica init",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Aturanica Labs",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/booyen/recanica.git",
|
|
10
|
+
"directory": "packages/cli"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"recanica",
|
|
14
|
+
"design-system",
|
|
15
|
+
"cli",
|
|
16
|
+
"tailwindcss",
|
|
17
|
+
"flutter",
|
|
18
|
+
"swiftui",
|
|
19
|
+
"jetpack-compose"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"bin": {
|
|
23
|
+
"recanica": "./src/index.js"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"src",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@recanica/mcp": "0.2.0"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"test": "node src/test.mjs"
|
|
37
|
+
}
|
|
6
38
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Issue = { rule: string; detail: string };
|
|
2
|
+
export function auditPage(): Issue[];
|
|
3
|
+
export const LAYOUT_RULES: string[];
|
|
4
|
+
export const UX_RULES: string[];
|
|
5
|
+
export function auditSpec(copyRules?: [string, string, string, string][]): Issue[];
|
|
6
|
+
export const SPEC_RULES: string[];
|
|
7
|
+
export type BusyFinding = { rule: string; detail: string; fix: string };
|
|
8
|
+
export function auditBusyness(limits?: Partial<typeof DEFAULT_THRESHOLDS>): { metrics: Record<string, number | boolean>; findings: BusyFinding[]; signals: Record<string, unknown>; deepest: string | null };
|
|
9
|
+
export const BUSY_RULES: string[];
|
|
10
|
+
export type QualityFinding = { dimension: string; rule: string; detail: string; fix: string };
|
|
11
|
+
export function auditQuality(): { measures: Record<string, number | boolean | null>; findings: QualityFinding[] };
|
|
12
|
+
export const RULE_LEVELS: { must: string[]; should: string[] };
|
|
13
|
+
export function levelOf(rule: string): "must" | "should";
|
|
14
|
+
export const DEFAULT_THRESHOLDS: Record<string, number>;
|