@ethlete/agent-rules 0.1.0-next.5 → 0.1.0-next.51
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/AGENTS.md +28 -0
- package/CHANGELOG.md +759 -0
- package/CLAUDE.md +1 -0
- package/README.md +434 -25
- package/THIRD-PARTY-LICENSES.md +35 -0
- package/content/defaults.json +1 -1
- package/content/git-hooks/post-checkout.sh +10 -0
- package/content/git-hooks/pre-push.sh +5 -0
- package/content/hooks/away-mode.py +327 -0
- package/content/hooks/background-design-commands.py +228 -0
- package/content/hooks/builder-idle-check.py +397 -0
- package/content/hooks/context-warning.py +694 -134
- package/content/hooks/design-live-check.py +136 -0
- package/content/hooks/git-safety.py +213 -0
- package/content/hooks/human-wait-check.py +167 -0
- package/content/hooks/subagent-model-policy.py +261 -0
- package/content/mods/.claude-plugin/marketplace.json +26 -0
- package/content/mods/plugins/codex-runs/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/codex-runs/hooks/hooks.json +1 -0
- package/content/mods/plugins/codex-runs/hooks/progress.ts +130 -0
- package/content/mods/plugins/codex-runs/hooks/register.tsx +103 -0
- package/content/mods/plugins/codex-runs/tsconfig.json +4 -0
- package/content/mods/plugins/codex-runs/types/index.d.ts +19 -0
- package/content/mods/plugins/e2e-progress/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/e2e-progress/hooks/hooks.json +1 -0
- package/content/mods/plugins/e2e-progress/hooks/progress.ts +160 -0
- package/content/mods/plugins/e2e-progress/hooks/register.tsx +442 -0
- package/content/mods/plugins/e2e-progress/tsconfig.json +3 -0
- package/content/mods/plugins/e2e-progress/types/index.d.ts +26 -0
- package/content/mods/plugins/status-line/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/status-line/hooks/hooks.json +1 -0
- package/content/mods/plugins/status-line/hooks/line.ts +74 -0
- package/content/mods/plugins/status-line/hooks/register.tsx +141 -0
- package/content/mods/plugins/status-line/types/index.d.ts +5 -0
- package/content/mods/plugins/usage-line/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/usage-line/hooks/codex.ts +52 -0
- package/content/mods/plugins/usage-line/hooks/format.ts +24 -0
- package/content/mods/plugins/usage-line/hooks/hooks.json +1 -0
- package/content/mods/plugins/usage-line/hooks/register.tsx +67 -0
- package/content/mods/plugins/usage-line/tsconfig.json +4 -0
- package/content/mods/plugins/usage-line/types/index.d.ts +5 -0
- package/content/output-styles/ste-clarity.md +131 -0
- package/content/rules/agent-sessions-wake-up.md +11 -0
- package/content/rules/app-styling.md +66 -0
- package/content/rules/comments.md +4 -1
- package/content/rules/lint-and-format.md +7 -5
- package/content/rules/nx-layout.md +53 -0
- package/content/rules/reactive-state.md +1 -1
- package/content/rules/styling.md +19 -10
- package/content/rules/subagent-models.md +42 -0
- package/content/rules/waiting-on-the-human.md +17 -0
- package/content/skills/agent-sessions/SKILL.md +100 -0
- package/content/skills/agent-sessions/agent-sessions.mjs +1420 -0
- package/content/skills/angular-patterns/SKILL.md +31 -7
- package/content/skills/api-source/SKILL.md +156 -0
- package/content/skills/app-testing/SKILL.md +141 -0
- package/content/skills/codex-subagent/SKILL.md +96 -0
- package/content/skills/codex-subagent/codex-agent.mjs +229 -0
- package/content/skills/codex-subagent/codex-limit.mjs +106 -0
- package/content/skills/design-exploration/SKILL.md +203 -0
- package/content/skills/design-exploration/check-story.mjs +139 -0
- package/content/skills/design-exploration/reference-check-and-notes.md +101 -0
- package/content/skills/design-exploration/reference-flows.md +38 -0
- package/content/skills/design-exploration/reference-inbox-and-mcp.md +54 -0
- package/content/skills/design-exploration/reference-order-and-design-system.md +120 -0
- package/content/skills/design-exploration/reference-products-and-sketches.md +250 -0
- package/content/skills/design-exploration/reference-shots.md +25 -0
- package/content/skills/design-exploration/shoot-template.mjs +61 -0
- package/content/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/content/skills/domain-modeling/SKILL.md +71 -0
- package/content/skills/e2e-triage/SKILL.md +80 -0
- package/content/skills/figma-export/SKILL.md +16 -18
- package/content/skills/git-commit/SKILL.md +21 -7
- package/content/skills/git-flow/SKILL.md +87 -0
- package/content/skills/grill-with-docs/SKILL.md +13 -0
- package/content/skills/grilling/SKILL.md +52 -0
- package/content/skills/handoff/SKILL.md +29 -69
- package/content/skills/handoff/save.md +187 -0
- package/content/skills/query/SKILL.md +165 -70
- package/content/skills/report/SKILL.md +26 -0
- package/content/skills/rxjs-signals/SKILL.md +33 -4
- package/content/skills/sdk-docs/SKILL.md +50 -14
- package/content/skills/sdk-local-build/SKILL.md +26 -8
- package/content/skills/sdk-local-build/sdk-local-baseline.mjs +64 -0
- package/content/skills/sdk-source/SKILL.md +37 -34
- package/content/skills/sdk-update/SKILL.md +103 -0
- package/content/skills/story-styling/SKILL.md +12 -10
- package/content/skills/styleguide/SKILL.md +13 -8
- package/content/skills/styleguide/assets.md +54 -0
- package/content/skills/styleguide/changesets.md +17 -0
- package/content/skills/styleguide/file-structure.md +73 -0
- package/content/skills/styleguide/lint-rule-lookup.md +52 -0
- package/content/skills/styleguide/storybook-structure.md +25 -0
- package/content/skills/theming/SKILL.md +76 -49
- package/content/skills/timetrack/SKILL.md +324 -0
- package/content/skills/verify-in-app/SKILL.md +107 -0
- package/content/skills/verify-in-storybook/SKILL.md +1 -1
- package/migrations/list-state-query-form.md +20 -0
- package/migrations/nx-layout.md +29 -0
- package/migrations/sdk-components-over-hand-built-ui.md +27 -0
- package/migrations/search-query-field.md +52 -0
- package/migrations.json +39 -0
- package/package.json +19 -3
- package/src/index.js +99 -32
- package/src/index.js.map +1 -1
- package/src/lib/cli-args.d.ts +9 -0
- package/src/lib/cli-args.js +48 -0
- package/src/lib/cli-args.js.map +1 -0
- package/src/lib/commitlint.d.ts +10 -0
- package/src/lib/commitlint.js +51 -0
- package/src/lib/commitlint.js.map +1 -0
- package/src/lib/config.d.ts +68 -6
- package/src/lib/config.js +141 -11
- package/src/lib/config.js.map +1 -1
- package/src/lib/filter.d.ts +2 -0
- package/src/lib/filter.js +4 -4
- package/src/lib/filter.js.map +1 -1
- package/src/lib/frontmatter.d.ts +2 -0
- package/src/lib/frontmatter.js +33 -5
- package/src/lib/frontmatter.js.map +1 -1
- package/src/lib/git-flow/build.d.ts +35 -0
- package/src/lib/git-flow/build.js +24 -0
- package/src/lib/git-flow/build.js.map +1 -0
- package/src/lib/git-flow/config.d.ts +59 -0
- package/src/lib/git-flow/config.js +50 -0
- package/src/lib/git-flow/config.js.map +1 -0
- package/src/lib/git-flow/index.d.ts +6 -0
- package/src/lib/git-flow/index.js +23 -0
- package/src/lib/git-flow/index.js.map +1 -0
- package/src/lib/git-flow/parse.d.ts +49 -0
- package/src/lib/git-flow/parse.js +300 -0
- package/src/lib/git-flow/parse.js.map +1 -0
- package/src/lib/git-flow/rename.d.ts +24 -0
- package/src/lib/git-flow/rename.js +70 -0
- package/src/lib/git-flow/rename.js.map +1 -0
- package/src/lib/git-flow/start.d.ts +49 -0
- package/src/lib/git-flow/start.js +57 -0
- package/src/lib/git-flow/start.js.map +1 -0
- package/src/lib/git-flow/validate.d.ts +34 -0
- package/src/lib/git-flow/validate.js +72 -0
- package/src/lib/git-flow/validate.js.map +1 -0
- package/src/lib/git-flow-command.d.ts +4 -0
- package/src/lib/git-flow-command.js +165 -0
- package/src/lib/git-flow-command.js.map +1 -0
- package/src/lib/git-flow-repair.d.ts +17 -0
- package/src/lib/git-flow-repair.js +165 -0
- package/src/lib/git-flow-repair.js.map +1 -0
- package/src/lib/git-flow-start.d.ts +20 -0
- package/src/lib/git-flow-start.js +140 -0
- package/src/lib/git-flow-start.js.map +1 -0
- package/src/lib/git-test-env.fixtures.d.ts +11 -0
- package/src/lib/git-test-env.fixtures.js +31 -0
- package/src/lib/git-test-env.fixtures.js.map +1 -0
- package/src/lib/git.d.ts +64 -0
- package/src/lib/git.js +131 -0
- package/src/lib/git.js.map +1 -0
- package/src/lib/gitlab.d.ts +35 -0
- package/src/lib/gitlab.js +116 -0
- package/src/lib/gitlab.js.map +1 -0
- package/src/lib/index.d.ts +2 -0
- package/src/lib/index.js +26 -11
- package/src/lib/index.js.map +1 -1
- package/src/lib/migrate.js +8 -2
- package/src/lib/migrate.js.map +1 -1
- package/src/lib/output-style-command.d.ts +3 -0
- package/src/lib/output-style-command.js +69 -0
- package/src/lib/output-style-command.js.map +1 -0
- package/src/lib/output-style.d.ts +38 -0
- package/src/lib/output-style.js +134 -0
- package/src/lib/output-style.js.map +1 -0
- package/src/lib/owned-paths.js +8 -2
- package/src/lib/owned-paths.js.map +1 -1
- package/src/lib/package-runner.d.ts +4 -0
- package/src/lib/package-runner.js +86 -0
- package/src/lib/package-runner.js.map +1 -0
- package/src/lib/peer-path.d.ts +12 -0
- package/src/lib/peer-path.js +39 -0
- package/src/lib/peer-path.js.map +1 -0
- package/src/lib/plain-text.d.ts +9 -0
- package/src/lib/plain-text.js +22 -0
- package/src/lib/plain-text.js.map +1 -0
- package/src/lib/plan.d.ts +6 -6
- package/src/lib/plan.js +167 -39
- package/src/lib/plan.js.map +1 -1
- package/src/lib/prettier.d.ts +21 -0
- package/src/lib/prettier.js +51 -0
- package/src/lib/prettier.js.map +1 -0
- package/src/lib/prompt.d.ts +8 -0
- package/src/lib/prompt.js +35 -0
- package/src/lib/prompt.js.map +1 -0
- package/src/lib/render.d.ts +26 -2
- package/src/lib/render.js +45 -10
- package/src/lib/render.js.map +1 -1
- package/src/lib/report-command.d.ts +34 -0
- package/src/lib/report-command.js +316 -0
- package/src/lib/report-command.js.map +1 -0
- package/src/lib/sessions-command.d.ts +4 -0
- package/src/lib/sessions-command.js +16 -0
- package/src/lib/sessions-command.js.map +1 -0
- package/src/lib/sync.d.ts +1 -2
- package/src/lib/sync.js +37 -17
- package/src/lib/sync.js.map +1 -1
- package/src/lib/targets/agents-skills.js +1 -1
- package/src/lib/targets/agents-skills.js.map +1 -1
- package/src/lib/targets/claude-hooks.d.ts +5 -0
- package/src/lib/targets/claude-hooks.js +27 -4
- package/src/lib/targets/claude-hooks.js.map +1 -1
- package/src/lib/targets/claude-mods.d.ts +20 -0
- package/src/lib/targets/claude-mods.js +47 -0
- package/src/lib/targets/claude-mods.js.map +1 -0
- package/src/lib/targets/claude.js +2 -3
- package/src/lib/targets/claude.js.map +1 -1
- package/src/lib/targets/codex-hooks.js +4 -2
- package/src/lib/targets/codex-hooks.js.map +1 -1
- package/src/lib/targets/codex.js +4 -4
- package/src/lib/targets/codex.js.map +1 -1
- package/src/lib/targets/copilot.js +4 -4
- package/src/lib/targets/copilot.js.map +1 -1
- package/src/lib/targets/cursor.js +3 -3
- package/src/lib/targets/cursor.js.map +1 -1
- package/src/lib/targets/git-hooks.d.ts +25 -0
- package/src/lib/targets/git-hooks.js +71 -0
- package/src/lib/targets/git-hooks.js.map +1 -0
- package/src/lib/targets/hooks-shared.d.ts +29 -5
- package/src/lib/targets/hooks-shared.js +130 -36
- package/src/lib/targets/hooks-shared.js.map +1 -1
- package/src/lib/targets/mcp.d.ts +16 -0
- package/src/lib/targets/mcp.js +72 -0
- package/src/lib/targets/mcp.js.map +1 -0
- package/src/lib/targets/shared.d.ts +1 -9
- package/src/lib/targets/shared.js +4 -8
- package/src/lib/targets/shared.js.map +1 -1
- package/src/lib/timetrack-command.d.ts +11 -0
- package/src/lib/timetrack-command.js +1262 -0
- package/src/lib/timetrack-command.js.map +1 -0
- package/src/lib/timetrack-snapshot.d.ts +66 -0
- package/src/lib/timetrack-snapshot.js +146 -0
- package/src/lib/timetrack-snapshot.js.map +1 -0
- package/src/lib/timetrack.d.ts +607 -0
- package/src/lib/timetrack.js +285 -0
- package/src/lib/timetrack.js.map +1 -0
- package/content/skills/styleguide/STYLEGUIDE.md +0 -520
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Assets
|
|
2
|
+
|
|
3
|
+
Read this file when deciding whether an asset belongs to production, local serve, a
|
|
4
|
+
specific app, Storybook, or shared output.
|
|
5
|
+
|
|
6
|
+
Keep assets in the workspace assets library and separate them by consumer and purpose:
|
|
7
|
+
|
|
8
|
+
```plaintext
|
|
9
|
+
assets/
|
|
10
|
+
├── my-app/
|
|
11
|
+
│ ├── build/
|
|
12
|
+
│ ├── serve/
|
|
13
|
+
│ └── storybook/
|
|
14
|
+
├── other-app/
|
|
15
|
+
│ ├── build/
|
|
16
|
+
│ ├── serve/
|
|
17
|
+
│ └── storybook/
|
|
18
|
+
└── shared/
|
|
19
|
+
├── build/
|
|
20
|
+
├── serve/
|
|
21
|
+
└── storybook/
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- `build/` contains production assets.
|
|
25
|
+
- `serve/` contains development-only placeholders or fixtures.
|
|
26
|
+
- `storybook/` contains assets used only by stories.
|
|
27
|
+
- `shared/` contains assets genuinely used by more than one app.
|
|
28
|
+
- Preserve the intended public URL through the project's `assets` configuration. Do not
|
|
29
|
+
expose a `build` directory segment in the final URL.
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"assets": [
|
|
34
|
+
{
|
|
35
|
+
"input": "libs/assets/src/my-app/build",
|
|
36
|
+
"glob": "**/*",
|
|
37
|
+
"output": "assets"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"input": "libs/assets/src/my-app/serve",
|
|
41
|
+
"glob": "**/*",
|
|
42
|
+
"output": "assets/serve"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"input": "libs/assets/src/shared/build",
|
|
46
|
+
"glob": "**/*",
|
|
47
|
+
"output": "assets/shared"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Add only build assets to a production configuration. Add serve and Storybook assets
|
|
54
|
+
only to the configurations that need them.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Changesets
|
|
2
|
+
|
|
3
|
+
Read this fallback only when the repository has no more specific release workflow.
|
|
4
|
+
|
|
5
|
+
- Add a changeset for a consumer-visible change to a published package.
|
|
6
|
+
- Do not add one for formatting, comments, tests, or an internal refactor with no
|
|
7
|
+
consumer-visible effect.
|
|
8
|
+
- Use `patch` for fixes, `minor` for backward-compatible API additions, and `major` for
|
|
9
|
+
breaking API or behavior changes.
|
|
10
|
+
- Keep one logical release note focused. Split unrelated changes.
|
|
11
|
+
- Write the note for the package consumer: state what they now get, not how the change
|
|
12
|
+
was implemented.
|
|
13
|
+
- Keep the note to one sentence, two at most, under 40 words.
|
|
14
|
+
- Do not run an interactive changeset command in a non-interactive agent environment;
|
|
15
|
+
write the repository's changeset file format directly.
|
|
16
|
+
|
|
17
|
+
When a repository supplies its own release skill or policy, that local guidance wins.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# File structure
|
|
2
|
+
|
|
3
|
+
Read this file when placing routes, views, components, providers, or local utilities.
|
|
4
|
+
|
|
5
|
+
Mirror the route tree in folders and suffix routing components with `-view`:
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Routes } from '@angular/router';
|
|
9
|
+
|
|
10
|
+
export const SHOP_ROUTES: Routes = [
|
|
11
|
+
{
|
|
12
|
+
path: 'items',
|
|
13
|
+
loadComponent: () =>
|
|
14
|
+
import('./items-list-view/items-list-view.component').then((module) => module.ItemsListViewComponent),
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
path: 'items/:id',
|
|
18
|
+
loadComponent: () =>
|
|
19
|
+
import('./item-detail-host-view/item-detail-host-view.component').then(
|
|
20
|
+
(module) => module.ItemDetailHostViewComponent,
|
|
21
|
+
),
|
|
22
|
+
children: [
|
|
23
|
+
{
|
|
24
|
+
path: '',
|
|
25
|
+
loadComponent: () =>
|
|
26
|
+
import('./item-detail-host-view/item-detail-view/item-detail-view.component').then(
|
|
27
|
+
(module) => module.ItemDetailViewComponent,
|
|
28
|
+
),
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
path: 'reviews',
|
|
32
|
+
loadComponent: () =>
|
|
33
|
+
import('./item-detail-host-view/item-reviews-view/item-reviews-view.component').then(
|
|
34
|
+
(module) => module.ItemReviewsViewComponent,
|
|
35
|
+
),
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Use these placement rules:
|
|
43
|
+
|
|
44
|
+
- Put reusable view-level pieces in `components/`.
|
|
45
|
+
- Put children used only by one parent in that parent's `partials/`.
|
|
46
|
+
- Put generic presentation-only pieces in `uikit/`.
|
|
47
|
+
- Put application-shell pieces in `shell/`.
|
|
48
|
+
- Keep a directive, pipe, provider, form configuration, or utility beside its narrowest
|
|
49
|
+
consumer. Move it upward only when more consumers appear.
|
|
50
|
+
- Use simple utility names such as `items-list-filter-form.ts`, not `.utils.ts`.
|
|
51
|
+
- Give exportable folders an `index.ts`, but import source files directly. Do not import
|
|
52
|
+
a parent barrel from its subdirectory.
|
|
53
|
+
- Keep application projects thin; move shared or domain logic into buildable libraries
|
|
54
|
+
with clear import paths.
|
|
55
|
+
|
|
56
|
+
```plaintext
|
|
57
|
+
shop/
|
|
58
|
+
├── items-list-view/
|
|
59
|
+
│ ├── components/
|
|
60
|
+
│ │ └── item-card/
|
|
61
|
+
│ │ ├── partials/
|
|
62
|
+
│ │ │ ├── item-image/
|
|
63
|
+
│ │ │ └── item-price/
|
|
64
|
+
│ │ ├── item-card.component.ts
|
|
65
|
+
│ │ └── item-card.component.html
|
|
66
|
+
│ ├── items-list-filter-form.ts
|
|
67
|
+
│ └── items-list-view.component.ts
|
|
68
|
+
└── item-detail-host-view/
|
|
69
|
+
├── item-detail-view/
|
|
70
|
+
├── item-reviews-view/
|
|
71
|
+
├── item-detail.provider.ts
|
|
72
|
+
└── item-detail-host-view.component.ts
|
|
73
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Lint rule lookup
|
|
2
|
+
|
|
3
|
+
Read this file only to explain a lint result or identify which rule owns a mechanical
|
|
4
|
+
convention. Run lint with `--fix`; do not hand-check this table before linting.
|
|
5
|
+
|
|
6
|
+
| Convention | Rule |
|
|
7
|
+
| --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
8
|
+
| No `any` / `$any()`; narrow `unknown` | `@typescript-eslint/no-explicit-any`, `@angular-eslint/template/no-any` |
|
|
9
|
+
| Static strings and booleans use attributes | `@angular-eslint/template/prefer-static-string-properties`, `ethlete/prefer-static-boolean-properties` |
|
|
10
|
+
| `type`, not `interface` (module augmentations stay interfaces) | `ethlete/consistent-type-definitions` |
|
|
11
|
+
| No `enum` or `const enum` | `ethlete/no-enum` |
|
|
12
|
+
| `const` by default; one declaration per statement | `no-var`, `prefer-const`, `one-var` |
|
|
13
|
+
| Strict equality | `eqeqeq` |
|
|
14
|
+
| Maximum two positional parameters | `max-params` |
|
|
15
|
+
| No type-only imports | `ethlete/no-type-only-import` |
|
|
16
|
+
| Descriptive `T`-prefixed generic names | `@typescript-eslint/naming-convention` |
|
|
17
|
+
| No `async` / `await` | `ethlete/no-async-await` |
|
|
18
|
+
| Arrow functions standalone; methods in classes | `no-restricted-syntax` |
|
|
19
|
+
| Blank line before a multiline guard return | `ethlete/guard-return-newline` |
|
|
20
|
+
| No trivially inferable return type | `ethlete/no-trivial-return-type` |
|
|
21
|
+
| Member and local naming conventions | `@typescript-eslint/naming-convention`, `ethlete/no-leading-underscore-class-member`, `ethlete/no-screaming-case-local` |
|
|
22
|
+
| Class constants are `readonly` and upper case | `ethlete/class-constant-property` |
|
|
23
|
+
| No `readonly` on reactive members | `ethlete/no-readonly-signal` |
|
|
24
|
+
| Injected and template-visible member accessibility | `ethlete/inject-member-accessibility`, `ethlete/template-member-accessibility` |
|
|
25
|
+
| No inject chains, pure aliases, or trivial wrappers | `ethlete/no-inject-chain`, `ethlete/no-member-alias`, `ethlete/no-trivial-wrapper-method` |
|
|
26
|
+
| No unused private or protected members | `ethlete/no-unused-class-member` |
|
|
27
|
+
| Pure module-scope provider calls | `ethlete/no-impure-top-level-provider` |
|
|
28
|
+
| No redundant `@internal` | `ethlete/no-redundant-internal` |
|
|
29
|
+
| Observable names end in `$` | `ethlete/require-dollar-suffix` |
|
|
30
|
+
| No subscribe body, subscribe in pipe, or RxJS in signal derivations | `ethlete/no-subscribe-with-body`, `ethlete/no-subscribe-in-pipe`, `ethlete/no-rxjs-in-effect` |
|
|
31
|
+
| `takeUntilDestroyed()` is the last operator in its pipe | `ethlete/take-until-destroyed-last` |
|
|
32
|
+
| Effect teardown uses `onCleanup` or `DestroyRef` | `ethlete/no-effect-cleanup-return` |
|
|
33
|
+
| Prefer `linkedSignal` for writable derived state | `ethlete/prefer-linked-signal` |
|
|
34
|
+
| `linkedSignal` source is a `computed`, not an inline function over an input | `ethlete/prefer-computed-linked-signal-source` |
|
|
35
|
+
| Global component CSS encapsulation | `ethlete/require-view-encapsulation-none` |
|
|
36
|
+
| Angular-version-correct change detection metadata | `ethlete/require-on-push-change-detection`, `ethlete/no-redundant-on-push-change-detection` |
|
|
37
|
+
| No redundant standalone flag or empty metadata arrays | `ethlete/no-standalone-flag`, `ethlete/no-empty-angular-metadata-arrays` |
|
|
38
|
+
| No legacy lifecycle hooks or decorators | `no-restricted-syntax`, `ethlete/no-legacy-angular-decorators` |
|
|
39
|
+
| No injectable services, guards, or resolvers | `no-restricted-syntax` |
|
|
40
|
+
| Output naming | `@angular-eslint/no-output-on-prefix`, `@angular-eslint/no-output-native`, `ethlete/prefer-present-tense-output` |
|
|
41
|
+
| Inputs do not collide with global HTML attributes | `ethlete/no-native-html-input-name` |
|
|
42
|
+
| No pipe logic | `ethlete/no-pipe-logic` |
|
|
43
|
+
| Class members and decorator metadata stay ordered | `ethlete/class-member-order`, `ethlete/angular-decorator-property-order` |
|
|
44
|
+
| Routing views use `-view` / `ViewComponent` | `ethlete/enforce-routing-view-naming` |
|
|
45
|
+
| No direct browser globals, DOM queries, native observers, or cookies | `no-restricted-globals`, `ethlete/no-direct-dom-manipulation`, `ethlete/no-dom-query`, `ethlete/no-native-observers`, `ethlete/no-document-cookie` |
|
|
46
|
+
| No barrel imports | `no-restricted-syntax` |
|
|
47
|
+
| Prefer the SDK wrappers for platform utilities | `ethlete/prefer-clone-equal`, `ethlete/prefer-rxjs-timer`, `ethlete/prefer-match-media`, `ethlete/prefer-viewport-size`, `ethlete/no-angular-seo-services`, `ethlete/no-locale-id`, `ethlete/no-angular-router-api` |
|
|
48
|
+
|
|
49
|
+
Judgment still belongs outside lint: name things after their behavior, use an object
|
|
50
|
+
parameter after two positional parameters, expose injected members directly instead of
|
|
51
|
+
aliasing them, and use `/** @internal */` only on technically public library API that
|
|
52
|
+
must be stripped from declarations.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Storybook structure
|
|
2
|
+
|
|
3
|
+
Read this file when placing a `*.stories.ts` file or code used only to render stories.
|
|
4
|
+
|
|
5
|
+
- Keep the `*.stories.ts` file beside the component it documents.
|
|
6
|
+
- Put private host components, dummy data, and story-only helpers in `storybook/`.
|
|
7
|
+
- Never export Storybook-only code from the component's public barrel.
|
|
8
|
+
- A private `storybook/index.ts` may simplify imports into the adjacent story, but no
|
|
9
|
+
production source may import it.
|
|
10
|
+
|
|
11
|
+
```plaintext
|
|
12
|
+
settings-form/
|
|
13
|
+
├── storybook/
|
|
14
|
+
│ ├── settings-form-storybook.component.ts
|
|
15
|
+
│ ├── settings-form-storybook.component.html
|
|
16
|
+
│ ├── settings-form-dummy-data.ts
|
|
17
|
+
│ └── index.ts
|
|
18
|
+
├── settings-form.component.ts
|
|
19
|
+
├── settings-form.component.html
|
|
20
|
+
├── settings-form.component.stories.ts
|
|
21
|
+
└── index.ts
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The story file stays at the component root; only its private support code goes into
|
|
25
|
+
`storybook/`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: theming
|
|
3
|
-
description: The
|
|
3
|
+
description: The surface and color theming systems in @ethlete/core. Read BEFORE writing or reviewing CSS involving color, background, border or interaction state, or wiring theme context across overlays/portals.
|
|
4
4
|
kind: skill
|
|
5
5
|
scope: consumer
|
|
6
6
|
requires: ['@ethlete/core']
|
|
@@ -13,11 +13,11 @@ vars: [docsBaseUrl]
|
|
|
13
13
|
Two **independent** systems in `@ethlete/core`; most components consume both:
|
|
14
14
|
|
|
15
15
|
- **Surface theming** - the neutral, elevation-aware colors of the box a component
|
|
16
|
-
sits on: background, text, muted/subtle text, borders, and a neutral
|
|
17
|
-
|
|
18
|
-
- **Color theming** - semantic accent palettes (brand
|
|
19
|
-
error): a
|
|
20
|
-
|
|
16
|
+
sits on: background, text, muted/subtle text, borders, and a neutral tint
|
|
17
|
+
for hover/pressed states. Set via `[etProvideSurface]` / `[etAutoSurface]`.
|
|
18
|
+
- **Color theming (tones)** - semantic accent palettes (brand, success,
|
|
19
|
+
warning, error): a fill, the text on that fill, and the tone as text or
|
|
20
|
+
border on the surface (`--et-tone-*`). Set via `[etProvideColor]`.
|
|
21
21
|
|
|
22
22
|
Full reference: {%docsBaseUrl%}/core/theming.
|
|
23
23
|
|
|
@@ -37,74 +37,101 @@ The generated CSS defines the raw vars on `.et-surface--<name>` / `.et-color--<n
|
|
|
37
37
|
classes (plus `:root` defaults) and derives the public tokens below on `:root` **and**
|
|
38
38
|
every scope class - so the tokens are always resolvable and components just read them.
|
|
39
39
|
|
|
40
|
-
**Theme names are yours.**
|
|
41
|
-
|
|
42
|
-
The portable handle is the theme **`type`**: `
|
|
43
|
-
the app registered with `type: 'error'`.
|
|
40
|
+
**Theme names are yours.** Never hardcode them as an SDK-defined union or reusable API
|
|
41
|
+
contract. App-specific docs may name their own themes when they label them as app values.
|
|
42
|
+
The portable handle is the theme **`type`**: `injectSemanticColorTheme('error')` finds
|
|
43
|
+
whichever theme the app registered with `type: 'error'`.
|
|
44
44
|
|
|
45
45
|
## Tokens components may consume
|
|
46
46
|
|
|
47
|
-
Use these
|
|
48
|
-
|
|
49
|
-
_after_ the token is fine).
|
|
47
|
+
Use these tokens - each is a ready color, never a channel triplet. Never use a hardcoded color as the primary value.
|
|
48
|
+
A static fallback inside `var(--token, <fallback>)` is permitted, but not required.
|
|
50
49
|
|
|
51
|
-
Surface
|
|
50
|
+
Surface:
|
|
52
51
|
|
|
53
|
-
| Token
|
|
54
|
-
|
|
|
55
|
-
| `--et-surface-background
|
|
56
|
-
| `--et-surface-
|
|
57
|
-
| `--et-surface-
|
|
58
|
-
| `--et-surface-
|
|
59
|
-
| `--et-surface-border
|
|
60
|
-
| `--et-surface-
|
|
52
|
+
| Token | Use for |
|
|
53
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
54
|
+
| `--et-surface-background` | component/panel background |
|
|
55
|
+
| `--et-surface-text` | text |
|
|
56
|
+
| `--et-surface-text-muted` | secondary text, placeholders, group labels |
|
|
57
|
+
| `--et-surface-text-subtle` | tertiary text |
|
|
58
|
+
| `--et-surface-border` | borders, separators |
|
|
59
|
+
| `--et-surface-tint` | neutral hover/pressed tint source (set by the theme's `tint`, emitted only then) - always mix it with the surface-text fallback: `color-mix(in srgb, var(--et-surface-tint, var(--et-surface-text, gray)) 12%, transparent)`; `--et-surface-control-text[-<state>]` is the text of a neutral control, never a background |
|
|
61
60
|
|
|
62
61
|
Color (from the nearest `[etProvideColor]` scope):
|
|
63
62
|
|
|
64
|
-
| Token
|
|
65
|
-
|
|
|
66
|
-
| `--et-
|
|
67
|
-
| `--et-
|
|
68
|
-
| `--et-
|
|
69
|
-
| `--et-theme-color-ink-solid` | primary-tinted text/border on transparent/tonal fills |
|
|
63
|
+
| Token | Use for |
|
|
64
|
+
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
65
|
+
| `--et-tone-fill` | filled backgrounds and accents at full strength: focus borders, selected marks, spinners. To tint per state, compose it yourself: `color-mix(in srgb, var(--et-tone-fill) calc(var(--_et-tone-fill-opacity, 1) * 100%), transparent)` |
|
|
66
|
+
| `--et-tone-on-fill` | text/icons on a filled background |
|
|
67
|
+
| `--et-tone-text` | the tone as text/border on transparent/tonal fills |
|
|
70
68
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
`[etColorInteractive]` re-resolves the color tokens per CSS state. Put it on the
|
|
70
|
+
interactive element itself, never on a wrapper. Neutral hover and pressed feedback mixes
|
|
71
|
+
`--et-surface-tint` per state at the consumer; `etSurfaceInteractive` is removed.
|
|
72
|
+
|
|
73
|
+
**Never use `hover:bg-et-surface-control-text-hover` for a hover row.** The token is a
|
|
74
|
+
full-strength text colour, so in dark mode it gives a light row with near-white text. Mix
|
|
75
|
+
the tint instead: `hover:bg-et-surface-tint/9 active:bg-et-surface-tint/15`.
|
|
76
|
+
|
|
77
|
+
`--et-surface-next-background` / `bg-et-surface-next-background` is the background of the next
|
|
78
|
+
level (the tint mixed over the background on the topmost level): use it for a "hover = next
|
|
79
|
+
level" row instead of a tint.
|
|
75
80
|
|
|
76
81
|
## Providing context
|
|
77
82
|
|
|
78
|
-
- `[etProvideSurface]="
|
|
79
|
-
elevation) set the surface scope; `[etProvideColor]="
|
|
83
|
+
- `[etProvideSurface]="surfaceThemeName"` / `[etAutoSurface]` (auto-picks the next
|
|
84
|
+
elevation) set the surface scope; `[etProvideColor]="colorThemeName"` sets the color scope.
|
|
80
85
|
A component that owns a themed region usually adds `ProvideColorDirective` /
|
|
81
86
|
`ProvideSurfaceDirective` as `hostDirectives`.
|
|
82
87
|
- **Detached overlay panes (menu, dialog, tooltip…) do not inherit DOM context.**
|
|
83
88
|
Re-apply it: inject `COLOR_PROVIDER` / `SURFACE_PROVIDER` with
|
|
84
89
|
`{ optional: true, skipSelf: true }`, then `ownProvider.syncWithProvider(ctx)` for
|
|
85
|
-
color and
|
|
90
|
+
color, and re-apply the surface one elevation above the trigger's for the surface.
|
|
86
91
|
- **Semantic colors come through DI, not CSS.** There is no global "error color"
|
|
87
92
|
variable - error/warning/success are just color themes. To render something in the
|
|
88
|
-
error color, `
|
|
89
|
-
theme) and either bind it
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
error color, `injectSemanticColorTheme('error')` (reading it throws if the app
|
|
94
|
+
registered no `type: 'error'` theme) and either bind it
|
|
95
|
+
(`[etProvideColor]="errorColorTheme()"`) or force it programmatically
|
|
96
|
+
(`provideColor.forceColor(theme)` / `clearForcedColor()`). Inside that scope,
|
|
97
|
+
`--et-tone-*` _is_ the error color.
|
|
98
|
+
- **A surface swaps a chosen accent; it never picks one.** The chosen accent is the
|
|
99
|
+
nearest `[etProvideColor]`, else the `isDefault` theme, or for
|
|
100
|
+
`injectSemanticColorTheme(type)` the theme of that `type`. The nearest surface's
|
|
101
|
+
`SurfaceTheme.colorThemeVariants` (e.g. `{ brand: 'brand-on-light', success: 'success-on-light' }`,
|
|
102
|
+
variants registered without a `type`) swaps it; an accent without an entry stays the
|
|
103
|
+
same on every surface. With no surface above, the root surface swaps, and
|
|
104
|
+
`provideColorScheme()` paints its swap of the default accent on `<html>`. A neutral that follows the surface is `color="surface"`
|
|
105
|
+
(`controlText`), not a variant. Never add per-surface logic to a color theme or new
|
|
106
|
+
CSS vars for it.
|
|
92
107
|
|
|
93
108
|
## Pitfalls
|
|
94
109
|
|
|
110
|
+
- A surface theme may have `elevation: -1` (a literal unary minus); the generator fails on a theme it cannot
|
|
111
|
+
parse. Filled form fields, table card rows and grid items resolve `parent.elevation + 1`; toasts and
|
|
112
|
+
`@ethlete/cdk` overlays with a backdrop always resolve elevation 1 (without a backdrop, `parent + 1`), and the
|
|
113
|
+
overlay scope class goes from `et-surface--inherited` to `et-surface--<theme>`. `@ethlete/cdk` CSS reads no
|
|
114
|
+
`--et-surface-*` token, so `etProvideSurface` on a cdk host does nothing.
|
|
95
115
|
- `@property` `initial-value` cannot contain `var()`, so a public `--et-*` token
|
|
96
116
|
declared via `@property` can never default to a theme token. If the default should
|
|
97
117
|
come from the theme, don't declare an `@property` - consume the theme token directly
|
|
98
118
|
(optionally behind a `--_et-*` indirection var).
|
|
99
|
-
-
|
|
119
|
+
- `@property` `initial-value` also cannot use a **font-relative or container unit**
|
|
120
|
+
(`em`, `rem`, `ex`, `ch`, `lh`, `cap`, `ic`, `cq*`). The value must be computationally
|
|
121
|
+
independent, so the browser drops the whole rule and leaves the token unregistered -
|
|
122
|
+
with no error. Percentages and viewport units (`vh`, `vw`, `dvh`) are fine. When the
|
|
123
|
+
default has to be relative, use `syntax: '*'` with no `initial-value` and put the
|
|
124
|
+
default in a fallback at each use site: `var(--et-skeleton-size, 1em)`.
|
|
125
|
+
- `--et-tone-*` always resolves to the **nearest color scope**. A
|
|
100
126
|
hardcoded semantic color in CSS can't be replaced by it unless the right theme is
|
|
101
127
|
provided on that element.
|
|
102
|
-
-
|
|
103
|
-
|
|
104
|
-
a hard requirement wherever it is
|
|
105
|
-
- **Cascade layers, not `:where()`,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
128
|
+
- A static fallback (`var(--et-surface-border, rgb(255 255 255 / 0.1))`) is
|
|
129
|
+
permitted for theme-less setups, but themes make it unnecessary. `injectSemanticColorTheme()`
|
|
130
|
+
is a hard requirement wherever it is read.
|
|
131
|
+
- **Cascade layers, not `:where()`, decide who wins against SDK component CSS.** SDK
|
|
132
|
+
styles live in `@layer components.sdk`, nested in `components`, so an app rule in
|
|
133
|
+
`@layer components`, a utility, or unlayered app CSS overrides them. See the
|
|
134
|
+
`app-styling` rule.
|
|
135
|
+
|
|
136
|
+
Styling a **story** file rather than a component? The colour rule is the same. Check the
|
|
137
|
+
repository's Storybook guidance before assuming a Tailwind utility exists.
|