@ethlete/agent-rules 0.1.0-next.22 → 0.1.0-next.23
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @ethlete/agent-rules
|
|
2
2
|
|
|
3
|
+
## 0.1.0-next.23
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- The `api-source` skill now finds the managed clone in `.ethlete/<name>` when `apiRepoPaths` has no entry, and reads the checkout and the local url from `yarn et api help <name>`.
|
|
8
|
+
- Theming: `provideColorScheme()` now swaps the default accent of the root surface through its `colorThemeVariants`, so the app root needs no `[etProvideSurface]` for it.
|
|
9
|
+
- Theming: add `SurfaceTheme.colorThemeVariants`, which swaps any chosen accent for a version that reads well on the surface, and deprecate `colorTheme` and `semanticColorThemes`.
|
|
10
|
+
|
|
3
11
|
## 0.1.0-next.22
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: api-source
|
|
3
|
-
description: How to read the source of the API an app in this repo talks to, from a local backend checkout
|
|
3
|
+
description: How to read the source of the API an app in this repo talks to, from a local backend checkout - the one apiRepoPaths names, or the managed clone et api keeps in .ethlete/<name>. Read when a response shape, a status code, an error body, an enum or an auth rule has to be confirmed rather than guessed - and never edit that checkout as part of work in this repo.
|
|
4
4
|
kind: skill
|
|
5
5
|
scope: consumer
|
|
6
6
|
---
|
|
@@ -24,9 +24,34 @@ the checkout is not deployed until the API team ships it.
|
|
|
24
24
|
|
|
25
25
|
## 1. Resolve the checkout for your app
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
`ethlete.config.local.json` at the repo root
|
|
27
|
+
A checkout can come from two places, and `et api` checks them in this order:
|
|
28
|
+
|
|
29
|
+
1. `apiRepoPaths[<name>]` in the gitignored `ethlete.config.local.json` at the repo root.
|
|
30
|
+
2. The managed clone `.ethlete/<name>` in the repo root, which `et api clone` creates.
|
|
31
|
+
|
|
32
|
+
A missing `apiRepoPaths` entry is therefore not a missing checkout. Look for the managed clone
|
|
33
|
+
before you report anything.
|
|
34
|
+
|
|
35
|
+
### With `ethlete.apis.js`
|
|
36
|
+
|
|
37
|
+
When the repo root has `ethlete.apis.js` (or `ethlete.apis.cjs`), it declares each API by name.
|
|
38
|
+
Find the API your app calls in that file, then let the CLI resolve it:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
yarn et api help <name> # url, services, and the checkout path and state
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The `Checkout` section names the directory to search, or the problem that stops it. The `url`
|
|
45
|
+
line is where the local API runs. Use this output, not a memory note, an old handoff or a sibling
|
|
46
|
+
folder that looks right: the configuration on disk can have changed since they were written.
|
|
47
|
+
|
|
48
|
+
If the CLI reports no checkout and the API declares a `repoUrl`, the fix is
|
|
49
|
+
`yarn et api clone <name>`. Ask the user before you run it. It uses the network and writes a
|
|
50
|
+
clone into the repo.
|
|
51
|
+
|
|
52
|
+
### Without `ethlete.apis.js`
|
|
53
|
+
|
|
54
|
+
The paths are a map in `ethlete.config.local.json`:
|
|
30
55
|
|
|
31
56
|
```json
|
|
32
57
|
{
|
|
@@ -44,16 +69,17 @@ app to checkout. They are per machine, so the map lives in the gitignored
|
|
|
44
69
|
Older checkouts still keep these keys in `ethlete-agents.config.local.json`. Read that file as a
|
|
45
70
|
fallback when `ethlete.config.local.json` is absent.
|
|
46
71
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- **The key is the app** as this repo names it - the workspace project name, which is
|
|
50
|
-
normally also the folder under `apps/`. Match the app you are working in.
|
|
72
|
+
- **The key is the API name** from `ethlete.apis.js`. Without that file, it is the app as this
|
|
73
|
+
repo names it - the workspace project name, normally also the folder under `apps/`.
|
|
51
74
|
- **A relative path resolves from the repo root**, not from the app folder.
|
|
52
|
-
- **Require an exact
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
75
|
+
- **Require an exact key.** If several apps intentionally share one API, configure the explicit
|
|
76
|
+
`"*"` fallback. Never treat an unrelated single entry as a fallback.
|
|
77
|
+
|
|
78
|
+
### No checkout anywhere - stop and ask
|
|
79
|
+
|
|
80
|
+
Do not guess a sibling folder, and do not clone without approval. Say which app you needed
|
|
81
|
+
the API for, and offer the `apiRepoPaths` snippet above. The file is gitignored, so adding it
|
|
82
|
+
changes nothing for anyone else.
|
|
57
83
|
|
|
58
84
|
Without a checkout, fall back to what the running API tells you: the generated API
|
|
59
85
|
description if the project serves one (`/openapi.json`, `/swagger`, `/api/doc`), and the
|
|
@@ -90,11 +90,16 @@ the interactive element itself, never on a wrapper.
|
|
|
90
90
|
(`[etProvideColor]="errorColorTheme()"`) or force it programmatically
|
|
91
91
|
(`provideColor.forceColor(theme)` / `clearForcedColor()`). Inside that scope,
|
|
92
92
|
`--et-theme-color-primary-*` _is_ the error color.
|
|
93
|
-
-
|
|
94
|
-
|
|
95
|
-
`
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
- **A surface swaps a chosen accent; it never picks one.** The chosen accent is the
|
|
94
|
+
nearest `[etProvideColor]`, else the `isDefault` theme, or for
|
|
95
|
+
`injectSemanticColorTheme(type)` the theme of that `type`. The nearest surface's
|
|
96
|
+
`SurfaceTheme.colorThemeVariants` (e.g. `{ brand: 'brand-on-light', success: 'success-on-light' }`,
|
|
97
|
+
variants registered without a `type`) swaps it; an accent without an entry stays the
|
|
98
|
+
same on every surface. With no surface above, the root surface swaps, and
|
|
99
|
+
`provideColorScheme()` paints its swap of the default accent on `<html>`. A neutral that follows the surface is `color="surface"`
|
|
100
|
+
(`interactionColor`), not a variant. `colorTheme` and `semanticColorThemes` are
|
|
101
|
+
deprecated. Never add per-surface logic to a color theme or new CSS vars for it.
|
|
102
|
+
`injectErrorTheme()`, `injectWarningTheme()` and `injectSuccessTheme()` are
|
|
98
103
|
deprecated: they ignore the surface.
|
|
99
104
|
|
|
100
105
|
## Pitfalls
|