pasika 0.1.6 → 0.3.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/README.md +99 -78
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +132 -0
- package/dist/enforcement/coverage.d.ts +51 -0
- package/dist/enforcement/coverage.js +210 -0
- package/dist/enforcement/docs-check.d.ts +17 -0
- package/dist/enforcement/docs-check.js +159 -0
- package/dist/enforcement/normalize.d.ts +11 -0
- package/dist/enforcement/normalize.js +21 -0
- package/dist/enforcement/parse-docs.d.ts +58 -0
- package/dist/enforcement/parse-docs.js +94 -0
- package/dist/enforcement/types.d.ts +57 -0
- package/dist/enforcement/types.js +59 -0
- package/dist/eslint/pasika/index.d.ts +13 -1
- package/dist/eslint/pasika/index.js +24 -11
- package/dist/eslint/pasika/project/ccf.d.ts +48 -0
- package/dist/eslint/pasika/project/ccf.js +119 -0
- package/dist/eslint/pasika/project/index.d.ts +21 -0
- package/dist/eslint/pasika/project/index.js +139 -0
- package/dist/eslint/pasika/project/parse-module.d.ts +27 -0
- package/dist/eslint/pasika/project/parse-module.js +128 -0
- package/dist/eslint/pasika/rules/component-placement.d.ts +11 -0
- package/dist/eslint/pasika/rules/component-placement.js +75 -0
- package/dist/eslint/pasika/rules/enforce-barrel-exports.d.ts +9 -0
- package/dist/eslint/pasika/rules/enforce-barrel-exports.js +78 -0
- package/dist/eslint/pasika/rules/enforce-cn-merge.d.ts +9 -0
- package/dist/eslint/pasika/rules/enforce-cn-merge.js +84 -0
- package/dist/eslint/pasika/rules/enforce-cva-variant-props.d.ts +9 -0
- package/dist/eslint/pasika/rules/enforce-cva-variant-props.js +81 -0
- package/dist/eslint/pasika/rules/filename-case.js +10 -0
- package/dist/eslint/pasika/rules/import-boundaries.d.ts +2 -0
- package/dist/eslint/pasika/rules/{organization-imports.js → import-boundaries.js} +62 -19
- package/dist/eslint/pasika/rules/no-arbitrary-tailwind.d.ts +9 -0
- package/dist/eslint/pasika/rules/no-arbitrary-tailwind.js +97 -0
- package/dist/eslint/pasika/rules/no-mixed-concerns.d.ts +9 -0
- package/dist/eslint/pasika/rules/no-mixed-concerns.js +84 -0
- package/dist/eslint/pasika/rules/support-file-placement.d.ts +15 -0
- package/dist/eslint/pasika/rules/support-file-placement.js +70 -0
- package/enforcement/registry.json +1139 -0
- package/package.json +21 -15
- package/claude/hooks/.vulyk +0 -3
- package/claude/hooks/AGENTS.md +0 -3
- package/claude/hooks/CLAUDE.md +0 -1
- package/claude/hooks/claude-hooks.md +0 -30
- package/claude/hooks/notification.sh +0 -38
- package/claude/hooks/protect-files.sh +0 -21
- package/claude/hooks/status-line/index.js +0 -57
- package/claude/scripts/render-settings.ts +0 -223
- package/claude/settings.base.json +0 -38
- package/dist/claude/scripts/render-settings.js +0 -145
- package/dist/eslint/pasika/rules/organization-imports.d.ts +0 -2
- package/dist/eslint.config.js +0 -7
- package/dist/scripts/pasika.js +0 -59
- package/docs/agent-conventions.md +0 -27
- package/docs/claude/hooks.md +0 -30
- package/docs/code-organization-guide/code-organization-guide.md +0 -69
- package/docs/code-organization-guide/references/application-architecture-reference.md +0 -149
- package/docs/code-organization-guide/rules/component-placement-rule.md +0 -119
- package/docs/code-organization-guide/rules/configuration-rule.md +0 -42
- package/docs/code-organization-guide/rules/constants-rule.md +0 -74
- package/docs/code-organization-guide/rules/exports-and-imports-rule.md +0 -84
- package/docs/code-organization-guide/rules/folder-nesting-rule.md +0 -82
- package/docs/code-organization-guide/rules/hook-extraction-rule.md +0 -141
- package/docs/code-organization-guide/rules/interactive-component-rule.md +0 -97
- package/docs/code-organization-guide/rules/jsx-hygiene-rule.md +0 -67
- package/docs/code-organization-guide/rules/locales-rule.md +0 -53
- package/docs/code-organization-guide/rules/nameable-visual-concept-rule.md +0 -66
- package/docs/code-organization-guide/rules/no-mixed-concerns-rule.md +0 -63
- package/docs/code-organization-guide/rules/repeated-structure-rule.md +0 -93
- package/docs/code-organization-guide/rules/smart-vs-dumb-component-rule.md +0 -112
- package/docs/code-organization-guide/rules/sole-state-owner-rule.md +0 -101
- package/docs/code-organization-guide/rules/types-and-schemas-rule.md +0 -139
- package/docs/code-organization-guide/rules/utilities-rule.md +0 -86
- package/docs/documentation-guide/_templates/grouped-reference.md +0 -11
- package/docs/documentation-guide/_templates/guide.md +0 -19
- package/docs/documentation-guide/_templates/rule.md +0 -21
- package/docs/documentation-guide/_templates/single-lookup-reference.md +0 -5
- package/docs/documentation-guide/documentation-guide.md +0 -13
- package/docs/documentation-guide/references/documentation-types-reference.md +0 -9
- package/docs/documentation-guide/rules/guide-creation-rule.md +0 -113
- package/docs/documentation-guide/rules/reference-creation-rule.md +0 -132
- package/docs/documentation-guide/rules/rule-creation-rule.md +0 -81
- package/docs/documentation-guide/rules/template-usage-rule.md +0 -49
- package/docs/shadcn-theme.md +0 -121
- package/docs/styling-guide/rules/arbitrary-value-rule.md +0 -31
- package/docs/styling-guide/rules/class-composition-rule.md +0 -52
- package/docs/styling-guide/rules/component-ui-state-rule.md +0 -53
- package/docs/styling-guide/rules/component-variant-rule.md +0 -125
- package/docs/styling-guide/rules/global-stylesheet-rule.md +0 -67
- package/docs/styling-guide/rules/theme-and-utility-definition-rule.md +0 -86
- package/docs/styling-guide/styling-guide.md +0 -14
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# Global Stylesheet Rule
|
|
2
|
-
|
|
3
|
-
Use the global stylesheet to define Tailwind, the shared theme, and base styles. This rule keeps all of the project's global CSS in one entry point and ordered predictably.
|
|
4
|
-
|
|
5
|
-
- A repository MUST have one global stylesheet entry point that registers Tailwind.
|
|
6
|
-
- The project's global CSS MUST live in the global stylesheet entry point and MUST NOT be imported from another file.
|
|
7
|
-
- The global stylesheet MUST reset Tailwind's default theme with `--*: initial`.
|
|
8
|
-
- Every value used for the project's styling MUST be defined as a CSS variable in `:root`, even when no theme selector overrides it. A Tailwind theme variable MUST reference that CSS variable through `@theme inline`.
|
|
9
|
-
- Style declarations added by the project inside global selectors MUST use `@apply`.
|
|
10
|
-
- The global stylesheet MUST order imports, `@custom-variant` definitions, `:root` variables and the selectors that override them, `@theme` definitions, custom utilities, base styles, and keyframes in that order.
|
|
11
|
-
- The global base layer MUST apply `base-canvas` and `base-ink` to the document body as the default page pair.
|
|
12
|
-
|
|
13
|
-
## Incorrect — Global Styles Split Across Unrelated Files
|
|
14
|
-
|
|
15
|
-
```css
|
|
16
|
-
/* globals.css */
|
|
17
|
-
@import "tailwindcss";
|
|
18
|
-
|
|
19
|
-
@theme {
|
|
20
|
-
--spacing: 0.25rem;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/* editor.css */
|
|
24
|
-
@import "tailwindcss";
|
|
25
|
-
|
|
26
|
-
@theme {
|
|
27
|
-
--font-editor: Georgia, serif;
|
|
28
|
-
}
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Why: Tailwind and theme definitions are split across competing global entry points, so neither file clearly owns the system.
|
|
32
|
-
|
|
33
|
-
## Correct — One Global Stylesheet Owns the System
|
|
34
|
-
|
|
35
|
-
```css
|
|
36
|
-
@import "tailwindcss";
|
|
37
|
-
|
|
38
|
-
:root {
|
|
39
|
-
--spacing: 0.25rem;
|
|
40
|
-
--base-canvas: #ffffff;
|
|
41
|
-
--base-ink: #111827;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@theme {
|
|
45
|
-
--*: initial;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@theme inline {
|
|
49
|
-
--spacing: var(--spacing);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
@utility bg-base-canvas {
|
|
53
|
-
@apply bg-(--base-canvas);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@utility text-base-ink {
|
|
57
|
-
@apply text-(--base-ink);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@layer base {
|
|
61
|
-
body {
|
|
62
|
-
@apply bg-base-canvas text-base-ink;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Why: one entry point registers Tailwind, defines the shared system, and applies document defaults in a predictable order.
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
# Theme and Utility Definition Rule
|
|
2
|
-
|
|
3
|
-
This rule decides when styling stays with one component or becomes a shared utility, and how project values are exposed through Tailwind.
|
|
4
|
-
|
|
5
|
-
- Styling used by only one component MUST stay in that component file as static Tailwind utility classes and MUST NOT be moved to the global stylesheet.
|
|
6
|
-
- A style or group of styles that two or more components use together and should change together MUST become one named custom utility. The group MAY include utilities generated by theme variables, built-in utilities, other custom utilities, and interaction styles.
|
|
7
|
-
- A value that needs at least two utility classes from the same [Tailwind theme-variable namespace](https://tailwindcss.com/docs/theme#theme-variable-namespaces) MUST use that namespace and have the same name in `:root`.
|
|
8
|
-
- A CSS variable intended only for a background MUST be named `--<role>-canvas`, and one intended only for readable text MUST be named `--<role>-ink`. When a named custom utility exposes one of those values by itself, it MUST use `bg-<role>-canvas` or `text-<role>-ink`.
|
|
9
|
-
- A repeated combination of canvas, ink, and related styles MUST become a `*-surface` custom Tailwind utility that owns the combination.
|
|
10
|
-
- A custom utility MUST use `@apply` for every styling declaration added by the project. When no named built-in utility represents a property value, it MUST apply the Tailwind custom-property or arbitrary-property utility instead.
|
|
11
|
-
|
|
12
|
-
## Incorrect — Property-Specific Color Exposed Broadly
|
|
13
|
-
|
|
14
|
-
```css
|
|
15
|
-
:root {
|
|
16
|
-
--color-header-ink: #111827;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@theme inline {
|
|
20
|
-
--color-header-ink: var(--color-header-ink);
|
|
21
|
-
}
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
```tsx
|
|
25
|
-
<h1 className="text-header-ink">Title</h1>
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Why: registering a text-only color in `--color-*` also creates unintended background, border, ring, and other color utilities.
|
|
29
|
-
|
|
30
|
-
## Correct — Property-Specific Utility
|
|
31
|
-
|
|
32
|
-
```css
|
|
33
|
-
:root {
|
|
34
|
-
--header-ink: #111827;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@utility text-header-ink {
|
|
38
|
-
@apply text-(--header-ink);
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
```tsx
|
|
43
|
-
// SiteHeader.tsx
|
|
44
|
-
<h1 className="text-header-ink">Title</h1>
|
|
45
|
-
|
|
46
|
-
// PageHeader.tsx
|
|
47
|
-
<h2 className="text-header-ink">Settings</h2>
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Why: both components use the same text-only color, so one named text utility owns it without creating background, border, or ring utilities.
|
|
51
|
-
|
|
52
|
-
## Incorrect — Property-Specific Colors Exposed Broadly
|
|
53
|
-
|
|
54
|
-
```css
|
|
55
|
-
@theme {
|
|
56
|
-
--color-primary-canvas: #d87943;
|
|
57
|
-
--color-primary-ink: #ffffff;
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
```tsx
|
|
62
|
-
<button className="bg-primary-canvas text-primary-ink">Save</button>
|
|
63
|
-
<button className="bg-primary-canvas text-primary-ink">Continue</button>
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Why: property-specific colors are exposed as broad Tailwind colors, and the repeated combination has no named owner.
|
|
67
|
-
|
|
68
|
-
## Correct — Color Roles Expose Their Intended API
|
|
69
|
-
|
|
70
|
-
```css
|
|
71
|
-
:root {
|
|
72
|
-
--primary-canvas: #d87943;
|
|
73
|
-
--primary-ink: #ffffff;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@utility primary-surface {
|
|
77
|
-
@apply bg-(--primary-canvas) text-(--primary-ink);
|
|
78
|
-
}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
```tsx
|
|
82
|
-
<button className="primary-surface">Save</button>
|
|
83
|
-
<button className="primary-surface">Continue</button>
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Why: canvas and ink CSS variables are used only by `primary-surface`, and the repeated combination has one named owner.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Styling Guide
|
|
2
|
-
|
|
3
|
-
This guide keeps component styling predictable without making consumers learn a component's DOM or a project's CSS internals. It applies whenever UI styling is added or changed.
|
|
4
|
-
|
|
5
|
-
## How To Style a Component
|
|
6
|
-
|
|
7
|
-
Use this workflow when implementing a component or changing its appearance.
|
|
8
|
-
|
|
9
|
-
1. Follow the [Global Stylesheet Rule](rules/global-stylesheet-rule.md) so one stylesheet entry point owns all of the project's global CSS.
|
|
10
|
-
2. Follow the [Theme and Utility Definition Rule](rules/theme-and-utility-definition-rule.md) so CSS variables, Tailwind namespaces, and custom utilities expose only the intended API.
|
|
11
|
-
3. Follow the [Arbitrary Value Rule](rules/arbitrary-value-rule.md) so values used for the project's styling use named utilities or tokens instead of literal arbitrary classes.
|
|
12
|
-
4. Follow the [Class Composition Rule](rules/class-composition-rule.md) so conditional and consumer-supplied classes merge predictably.
|
|
13
|
-
5. Follow the [Component Variant Rule](rules/component-variant-rule.md) so supported internal appearances are a typed component API.
|
|
14
|
-
6. Follow the [Component UI State Rule](rules/component-ui-state-rule.md) so interaction, disabled, selected, loading, and error UI states stay coherent.
|