Skip to content

Commit 487a464

Browse files
Merge pull request #30 from zeixcom/feature/improve-skill
Feature/improve skill
2 parents e61b90e + fb7dc9e commit 487a464

File tree

240 files changed

+4996
-402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+4996
-402
lines changed

ARCHITECTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ The file contains a type-level CSS selector parser that infers the correct `HTML
206206

207207
## The Parser System
208208

209-
Parsers transform HTML attribute strings into typed JavaScript values. The key design choice: **a Parser is a function with ≥2 parameters** (`(ui, value, old?) => T`), while a **Reader is any function with 1 parameter** (`(ui) => T`). This distinction is checked at runtime via `value.length >= 2` in `isParser()`.
209+
Parsers transform HTML attribute strings into typed JavaScript values. The key design choice: **a Parser is a function branded with `PARSER_BRAND`** (`(ui, value, old?) => T`), while a **Reader is any function with 1 parameter** (`(ui) => T`). Always create custom parsers with `asParser()` — it attaches the brand so `isParser()` can identify them reliably. Relying on `fn.length >= 2` as the parser signal is deprecated and may be removed in a future major version; in `DEV_MODE`, unbranded two-argument functions trigger a `console.warn`.
210210

211211
Parsers serve dual duty:
212212
1. As property initializers — `{ config: asJSON({ theme: 'light' }) }` — called during `connectedCallback` with the attribute's initial value

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## [Unreleased]
4+
5+
### Fixed
6+
7+
- **`DEV_MODE` no longer throws a `ReferenceError` when bundled from source without `--define`**: `process.env.DEV_MODE` is now guarded with `typeof process !== 'undefined'`, so bundlers that consume `index.ts` directly (via the `module` field) get `false` at runtime rather than crashing. Bundlers that do define `process.env.DEV_MODE=false` still tree-shake the dead code as before.
8+
9+
### Added
10+
11+
- **Five Claude Code skills for structured AI assistance**: `le-truc` (component authoring guidance with progressive disclosure), `le-truc-dev` (library internals and API development), `docs-server-dev` (docs build pipeline and Markdoc), `tech-writer` (keeping docs in sync with source), and `changelog-keeper` (maintaining CHANGELOG.md). Each skill ships with curated references and workflow prompts under `skills/<name>/`.
12+
313
## 1.0.0
414

515
### Changed

docs-src/api/classes/ContextRequestEvent.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Class: ContextRequestEvent\<T\>
22

3-
Defined in: [src/context.ts:78](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/context.ts#L78)
3+
Defined in: [src/context.ts:78](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/context.ts#L78)
44

55
Class for context-request events
66

@@ -31,7 +31,7 @@ function to the callback which requesters can invoke to indicate they no longer
3131

3232
> **new ContextRequestEvent**\<`T`\>(`context`, `callback`, `subscribe?`): `ContextRequestEvent`\<`T`\>
3333
34-
Defined in: [src/context.ts:83](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/context.ts#L83)
34+
Defined in: [src/context.ts:83](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/context.ts#L83)
3535

3636
###### Parameters
3737

@@ -101,7 +101,7 @@ Defined in: node\_modules/typescript/lib/lib.dom.d.ts:11463
101101

102102
> `readonly` **callback**: [`ContextCallback`](../type-aliases/ContextCallback.md)\<[`ContextType`](../type-aliases/ContextType.md)\<`T`\>\>
103103
104-
Defined in: [src/context.ts:80](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/context.ts#L80)
104+
Defined in: [src/context.ts:80](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/context.ts#L80)
105105

106106
callback function for value getter and unsubscribe function
107107

@@ -173,7 +173,7 @@ The read-only **`composed`** property of the or not the event will propagate acr
173173

174174
> `readonly` **context**: `T`
175175
176-
Defined in: [src/context.ts:79](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/context.ts#L79)
176+
Defined in: [src/context.ts:79](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/context.ts#L79)
177177

178178
context key
179179

@@ -295,7 +295,7 @@ The deprecated **`Event.srcElement`** is an alias for the Event.target property.
295295

296296
> `readonly` **subscribe**: `boolean`
297297
298-
Defined in: [src/context.ts:81](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/context.ts#L81)
298+
Defined in: [src/context.ts:81](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/context.ts#L81)
299299

300300
whether to subscribe to context changes
301301

docs-src/api/classes/DependencyTimeoutError.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Class: DependencyTimeoutError
22

3-
Defined in: [src/errors.ts:104](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/errors.ts#L104)
3+
Defined in: [src/errors.ts:104](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/errors.ts#L104)
44

55
Error when a component's dependencies are not met within a specified timeout
66

@@ -18,7 +18,7 @@ Error when a component's dependencies are not met within a specified timeout
1818

1919
> **new DependencyTimeoutError**(`host`, `missing`): `DependencyTimeoutError`
2020
21-
Defined in: [src/errors.ts:109](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/errors.ts#L109)
21+
Defined in: [src/errors.ts:109](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/errors.ts#L109)
2222

2323
###### Parameters
2424

docs-src/api/classes/InvalidComponentNameError.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Class: InvalidComponentNameError
22

3-
Defined in: [src/errors.ts:11](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/errors.ts#L11)
3+
Defined in: [src/errors.ts:11](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/errors.ts#L11)
44

55
Error thrown when component name violates rules for custom element names
66

@@ -18,7 +18,7 @@ Error thrown when component name violates rules for custom element names
1818

1919
> **new InvalidComponentNameError**(`component`): `InvalidComponentNameError`
2020
21-
Defined in: [src/errors.ts:15](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/errors.ts#L15)
21+
Defined in: [src/errors.ts:15](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/errors.ts#L15)
2222

2323
###### Parameters
2424

docs-src/api/classes/InvalidCustomElementError.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Class: InvalidCustomElementError
22

3-
Defined in: [src/errors.ts:141](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/errors.ts#L141)
3+
Defined in: [src/errors.ts:141](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/errors.ts#L141)
44

55
Error thrown when target element is not a custom element as expected
66

@@ -18,7 +18,7 @@ Error thrown when target element is not a custom element as expected
1818

1919
> **new InvalidCustomElementError**(`target`, `where`): `InvalidCustomElementError`
2020
21-
Defined in: [src/errors.ts:146](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/errors.ts#L146)
21+
Defined in: [src/errors.ts:146](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/errors.ts#L146)
2222

2323
###### Parameters
2424

docs-src/api/classes/InvalidEffectsError.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Class: InvalidEffectsError
22

3-
Defined in: [src/errors.ts:47](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/errors.ts#L47)
3+
Defined in: [src/errors.ts:47](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/errors.ts#L47)
44

55
Error thrown when setup function does not return effects
66

@@ -18,7 +18,7 @@ Error thrown when setup function does not return effects
1818

1919
> **new InvalidEffectsError**(`host`, `cause?`): `InvalidEffectsError`
2020
21-
Defined in: [src/errors.ts:52](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/errors.ts#L52)
21+
Defined in: [src/errors.ts:52](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/errors.ts#L52)
2222

2323
###### Parameters
2424

docs-src/api/classes/InvalidPropertyNameError.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Class: InvalidPropertyNameError
22

3-
Defined in: [src/errors.ts:28](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/errors.ts#L28)
3+
Defined in: [src/errors.ts:28](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/errors.ts#L28)
44

55
Error thrown when trying to assign a property name that conflicts with reserved words or inherited HTMLElement properties
66

@@ -18,7 +18,7 @@ Error thrown when trying to assign a property name that conflicts with reserved
1818

1919
> **new InvalidPropertyNameError**(`component`, `prop`, `reason`): `InvalidPropertyNameError`
2020
21-
Defined in: [src/errors.ts:34](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/errors.ts#L34)
21+
Defined in: [src/errors.ts:34](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/errors.ts#L34)
2222

2323
###### Parameters
2424

docs-src/api/classes/InvalidReactivesError.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Class: InvalidReactivesError
22

3-
Defined in: [src/errors.ts:122](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/errors.ts#L122)
3+
Defined in: [src/errors.ts:122](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/errors.ts#L122)
44

55
Error thrown when reactives passed to a component are invalid
66

@@ -18,7 +18,7 @@ Error thrown when reactives passed to a component are invalid
1818

1919
> **new InvalidReactivesError**(`host`, `target`, `reactives`): `InvalidReactivesError`
2020
21-
Defined in: [src/errors.ts:128](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/errors.ts#L128)
21+
Defined in: [src/errors.ts:128](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/errors.ts#L128)
2222

2323
###### Parameters
2424

docs-src/api/classes/InvalidUIKeyError.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Class: InvalidUIKeyError
22

3-
Defined in: [src/errors.ts:66](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/errors.ts#L66)
3+
Defined in: [src/errors.ts:66](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/errors.ts#L66)
44

55
Error thrown if UI key is invalid
66

@@ -18,7 +18,7 @@ Error thrown if UI key is invalid
1818

1919
> **new InvalidUIKeyError**(`host`, `key`, `where`): `InvalidUIKeyError`
2020
21-
Defined in: [src/errors.ts:72](https://github.com/zeixcom/le-truc/blob/a5013c130127298d8b63211d91f5f6fe8e9cd5f9/src/errors.ts#L72)
21+
Defined in: [src/errors.ts:72](https://github.com/zeixcom/le-truc/blob/84654ba213d2f93af20025001d10957b6f1486c9/src/errors.ts#L72)
2222

2323
###### Parameters
2424

0 commit comments

Comments
 (0)