@itrocks/handbook 0.0.0-stage → 0.0.1

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.
Files changed (24) hide show
  1. package/AGENTS.md +10 -0
  2. package/LICENSE +14 -0
  3. package/README.md +47 -2
  4. package/docs/agent-conventions/README.md +10 -0
  5. package/docs/framework-changes/README.md +16 -0
  6. package/docs/framework-changes/architecture/README.md +18 -0
  7. package/docs/framework-changes/architecture/browser-components.md +26 -0
  8. package/docs/framework-changes/architecture/dependency-composition.md +20 -0
  9. package/docs/framework-changes/architecture/domain-model-and-metadata.md +22 -0
  10. package/docs/framework-changes/architecture/framework-reuse.md +40 -0
  11. package/docs/framework-changes/architecture/html-templates-and-targets.md +35 -0
  12. package/docs/framework-changes/architecture/package-boundaries.md +18 -0
  13. package/docs/framework-changes/architecture/package-structure-and-build.md +44 -0
  14. package/docs/framework-changes/architecture/persistence-and-schema.md +29 -0
  15. package/docs/framework-changes/architecture/requests-actions-and-routes.md +24 -0
  16. package/docs/framework-changes/architecture/scss-and-assets.md +19 -0
  17. package/docs/framework-changes/architecture/transformations-and-views.md +27 -0
  18. package/docs/framework-changes/documentation/dependencies.md +14 -0
  19. package/docs/framework-changes/documentation/markdown.md +19 -0
  20. package/docs/framework-changes/documentation/package-metadata.md +22 -0
  21. package/docs/framework-changes/documentation/readme.md +45 -0
  22. package/docs/framework-usage/README.md +14 -0
  23. package/docs/framework-usage/coding-conventions.md +77 -0
  24. package/package.json +28 -5
package/AGENTS.md ADDED
@@ -0,0 +1,10 @@
1
+ # it.rocks handbook
2
+
3
+ Read the guide matching the task before making changes, then follow the documents it references.
4
+ Paths below are relative to this package.
5
+
6
+ - Use the framework in an application: [framework usage](docs/framework-usage/README.md).
7
+ - Modify or create framework packages: [framework changes](docs/framework-changes/README.md).
8
+ - Update instructions or conventions for AI agents: [agent conventions](docs/agent-conventions/README.md).
9
+
10
+ If a task spans several categories, read each applicable guide.
package/LICENSE ADDED
@@ -0,0 +1,14 @@
1
+ ISC License
2
+ Copyright (C) 2026, Baptiste Pillot <baptiste@pillot.fr>
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted, provided that the above
6
+ copyright notice and this permission notice appear in all copies.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13
+ OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14
+ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,48 @@
1
- # Temporary Holding Version
1
+ [![npm version](https://img.shields.io/npm/v/@itrocks/handbook?logo=npm)](https://www.npmjs.org/package/@itrocks/handbook)
2
+ [![npm downloads](https://img.shields.io/npm/dm/@itrocks/handbook)](https://www.npmjs.org/package/@itrocks/handbook)
3
+ [![GitHub](https://img.shields.io/github/last-commit/itrocks-ts/handbook?color=2dba4e&label=commit&logo=github)](https://github.com/itrocks-ts/handbook)
4
+ [![issues](https://img.shields.io/github/issues/itrocks-ts/handbook)](https://github.com/itrocks-ts/handbook/issues)
5
+ [![discord](https://img.shields.io/discord/1314141024020467782?color=7289da&label=discord&logo=discord&logoColor=white)](https://25.re/ditr)
2
6
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
7
+ # handbook
8
+
9
+ Provides framework usage and development guides for developers and AI agents.
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ npm i --save-dev @itrocks/handbook
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ Reference `node_modules/@itrocks/handbook/AGENTS.md` from the application's root `AGENTS.md`.
20
+ The [agent entry point](AGENTS.md) routes tasks to the relevant documentation.
21
+
22
+ Developers can start directly with [framework usage](docs/framework-usage/README.md),
23
+ [framework changes](docs/framework-changes/README.md) or [agent conventions](docs/agent-conventions/README.md).
24
+
25
+ This package contains documentation only and has no runtime API or build step.
26
+ Conventions live in this package. Framework usage and reference implementations link to the installed `@itrocks`
27
+ packages.
28
+
29
+ ## Documentation layout
30
+
31
+ ```text
32
+ docs/
33
+ ├── framework-usage/
34
+ │ ├── README.md
35
+ │ └── coding-conventions.md
36
+ ├── framework-changes/
37
+ │ ├── README.md
38
+ │ ├── architecture/
39
+ │ │ ├── README.md
40
+ │ │ └── topic-specific guides
41
+ │ └── documentation/
42
+ │ ├── dependencies.md
43
+ │ ├── markdown.md
44
+ │ ├── package-metadata.md
45
+ │ └── readme.md
46
+ └── agent-conventions/
47
+ └── README.md
48
+ ```
@@ -0,0 +1,10 @@
1
+ # Agent conventions
2
+
3
+ When creating or updating instructions for AI agents:
4
+
5
+ - State only project-specific directives; omit tasks an AI agent already knows how to perform.
6
+ - Check existing guides for repetition and link to the authoritative rule instead of copying it.
7
+ - Keep wording minimal, clear and understandable by both AI agents and human readers.
8
+ - Put each rule in the guide for its task and update the routing link when adding a guide.
9
+
10
+ Follow [documentation conventions](../framework-changes/documentation/markdown.md).
@@ -0,0 +1,16 @@
1
+ # Framework changes
2
+
3
+ Read the affected package's README and local instructions, then select the applicable conventions:
4
+
5
+ - Source or tests: [coding conventions](../framework-usage/coding-conventions.md).
6
+ - Markdown: [documentation conventions](documentation/markdown.md).
7
+ - README: [README content](documentation/readme.md).
8
+ - Description or keywords: [package metadata](documentation/package-metadata.md).
9
+ - Dependency configuration documentation: [dependency documentation](documentation/dependencies.md).
10
+ - Architecture or integration contract: select the relevant [architecture guide](architecture/README.md).
11
+
12
+ For a new package, read [structure and build](architecture/package-structure-and-build.md),
13
+ [boundaries](architecture/package-boundaries.md), [reuse](architecture/framework-reuse.md),
14
+ README content and package metadata. Read coding conventions only if adding source.
15
+
16
+ A local implementation change preserving existing contracts does not require architecture reading.
@@ -0,0 +1,18 @@
1
+ # Architecture routing
2
+
3
+ Read only the guides for the contracts or responsibilities being changed. Combine guides when a task crosses boundaries.
4
+ A package is a published `@itrocks/*` module; `HasPlugins` and `Plugin<T>` refer specifically to browser extensions.
5
+
6
+ - Files, naming, metadata, outputs or build: [structure and build](package-structure-and-build.md).
7
+ - Responsibility, public API or server/browser separation: [boundaries](package-boundaries.md).
8
+ - Reuse, extension mechanism or port: [reuse](framework-reuse.md).
9
+ - Model, decorator, reflection or inheritance: [domain metadata](domain-model-and-metadata.md).
10
+ - Dependency binding, configuration or bootstrap: [composition](dependency-composition.md).
11
+ - Request, route, action, response or workflow: [actions and routes](requests-actions-and-routes.md).
12
+ - Conversion or view metadata: [transformations and views](transformations-and-views.md).
13
+ - Template, include, fragment or target: [HTML templates](html-templates-and-targets.md).
14
+ - DOM activation, navigation or browser plugin: [browser components](browser-components.md).
15
+ - Selector, UI state, stylesheet or asset: [SCSS and assets](scss-and-assets.md).
16
+ - Storage, relations, schema or database adapter: [persistence](persistence-and-schema.md).
17
+
18
+ Reference implementation paths in these guides are relative to `node_modules/@itrocks/`.
@@ -0,0 +1,26 @@
1
+ # Browser components
2
+
3
+ Register independent DOM enhancements by selector with `build()`; use `HasPlugins` and `Plugin<T>` for ordered optional
4
+ extensions around a stable host API.
5
+
6
+ `build()` handles matching elements in `document.body` and later insertions; it can also register prioritised listeners.
7
+ Put registrations in an explicit browser build module imported by the browser entry or a template dependency.
8
+ Use semantic selectors and guard repeated activation when components do not already do so.
9
+ Load heavy or optional behaviour inside the callback. Browser subpath imports use explicit `.js` extensions.
10
+ Keep structure in HTML, behaviour in TypeScript and visual state in SCSS, sharing documented classes and attributes.
11
+
12
+ ## Plugins and navigation
13
+
14
+ A host extends `HasPlugins<Host>`, accepts `Partial<Options<Host>>`, establishes its base state, then calls
15
+ `constructPlugins()` and `initPlugins()`.
16
+ A plugin extends `Plugin<Host, PluginOptions>` and receives its host as `of`.
17
+ Put wrappers and listeners in `init()` unless an earlier lifecycle is defined.
18
+
19
+ When wrapping a method, save the previous method, preserve its host receiver, return value and asynchronous behaviour.
20
+ Use a normal function when dynamic `this` is needed. Each plugin wraps earlier behaviour, so configure order explicitly.
21
+ Pass classes for default options and instances for configured options; define listener/style cleanup.
22
+
23
+ Extend `XTarget` policies with its plugins rather than building another navigation pipeline.
24
+ Check initial DOM, dynamic insertion, reinsertion and failed fetches; preserve native links/forms without JavaScript.
25
+
26
+ References: `build/build.ts`, `plugin/plugin.ts`, `xtarget/src/xtarget.ts`, `list/src/front/build.ts`.
@@ -0,0 +1,20 @@
1
+ # Dependency composition
2
+
3
+ For the choice between direct import, injection, port and composition, read [reuse](framework-reuse.md).
4
+
5
+ Expose a small typed `Dependencies` contract with deterministic local defaults and one `*DependsOn`,
6
+ `set*Dependencies` or `init*` entry. Merge `Partial<Dependencies>` without erasing unspecified defaults.
7
+ When an existing function directly fulfils a dependency, preserve its name, parameter meaning and order so bootstrap
8
+ can bind it directly. Add an adapter only when values or semantics differ.
9
+
10
+ Bootstrap order: load layered configuration, install export composition, bind dependencies and transformer registries,
11
+ then start servers. Avoid import-time metadata reads that freeze configuration before binding.
12
+
13
+ Configuration merges in dependency order; application files override or extend it.
14
+ Relative paths belong to the configuration file declaring them.
15
+ Use `config.compose` and `@itrocks/compose` for import-compatible exported class replacement or `@Uses` augmentation.
16
+ Keep replacement chains short and check order-dependent method and metadata resolution.
17
+ Do not use export composition for ordinary function dependencies or browser `Plugin<T>` for server injection.
18
+
19
+ References: `framework/src/dependencies.ts`, `framework/src/framework.ts`, `config/src/config.ts`,
20
+ `compose/src/compose.ts`.
@@ -0,0 +1,22 @@
1
+ # Domain model and metadata
2
+
3
+ Use plain domain classes and focused decorators. Discover fields through `ReflectClass` and `ReflectProperty`,
4
+ not duplicated field lists.
5
+
6
+ - Declare rendered or persisted fields with explicit types and meaningful default initialisers.
7
+ - Keep zero-argument construction usable: `ReflectClass.propertyNames` instantiates the class.
8
+ - Use inheritance for an is-a relationship and `@Uses(...mixins)` for orthogonal reusable components.
9
+ - Keep storage identifiers out of domain classes; see [persistence](persistence-and-schema.md).
10
+
11
+ A metadata package owns a private `Symbol`, a PascalCase decorator using `@itrocks/decorator/class` or `/property`,
12
+ and a lower-camel accessor ending in `Of` that defines defaults and inheritance.
13
+ Decorators may register metadata or a target transformer; global dependency binding belongs in bootstrap.
14
+
15
+ Reflection requires a readable `.d.ts` beside the runtime module for property types and the corresponding TypeScript
16
+ source for defaults. Imported model types may resolve lazily to tolerate cycles. Values are cached on first access:
17
+ complete configurable binding before reading them. Read `collectionType` only for collection properties.
18
+
19
+ Verify inheritance, optionality, collection element types and defaults when changing reflection behaviour.
20
+ Keep presentation, conversion and database behaviour in their consumer layers.
21
+
22
+ References: `decorator/src/class.ts`, `reflect/src/class.ts`, `property-type/src/property-type.ts`, `uses/src/uses.ts`.
@@ -0,0 +1,40 @@
1
+ # Framework reuse and extension
2
+
3
+ Search existing package names, exports, READMEs and source before creating infrastructure.
4
+ Reuse the narrowest public contract; import its public entry or exported subpath, never private files.
5
+
6
+ ## Find the owner
7
+
8
+ - Model inspection: `reflect`, `property-type`, `property-default`, `class-type`.
9
+ - Semantics: existing decorators, otherwise `decorator` helpers.
10
+ - Class composition: `uses`; application export replacement: `compose`.
11
+ - Presentation: `class-view`, `property-view`, `list-properties`.
12
+ - Conversion: `transformer`, `core-transformers`, `data-to-object`.
13
+ - HTTP data: `request-response`, `core-responses`; URL/actions: `action-request`, `route`, `action`.
14
+ - Rendering: `template`, normally through `template-insight`.
15
+ - Storage/schema: `storage`, `store`, `schema`; concrete adapters remain outside domain code.
16
+ - Dynamic DOM: `build`; navigation/forms/assets: `xtarget`, `form-fetch`, `asset-loader`.
17
+ - Browser extensions: `plugin`; shared UI: `ux-core`, `action-bar`, `notifications`, `table`.
18
+
19
+ Use `business-pack` as the baseline for domain packages, `action-pack` for actions/views and `crud-pack` for standard
20
+ CRUD.
21
+ Import concrete APIs from their owners. Outside a documented pack, declare runtime owners directly rather than relying
22
+ on transitive dependencies.
23
+
24
+ ## Select the extension
25
+
26
+ - Class/property fact: focused decorator and `*Of` accessor.
27
+ - Representation change: transformer.
28
+ - Behaviour supplied by a higher layer: typed `Dependencies`, defaults and `*DependsOn()` binding.
29
+ - Interchangeable stateful infrastructure: abstract port implemented by adapters.
30
+ - One-time registration: explicit `init*`, `set*` or side-effect `build` module.
31
+ - Optional browser host behaviour: `Plugin<T>`.
32
+ - Global exported class replacement/augmentation: configuration with `compose`/`Uses` at the composition root.
33
+
34
+ Use direct imports for stable lower-level contracts. Inject only where an import would create a cycle or point reusable
35
+ code towards framework, application, adapter or presentation code. Put ports where they are consumed, in domain terms.
36
+ Domain and reusable core must not import the framework or concrete server/database adapters.
37
+ For function dependencies, keep narrow typed contracts and deterministic defaults; for stateful lifecycles, prefer ports
38
+ and explicit construction. See [composition](dependency-composition.md) for binding and bootstrap rules.
39
+
40
+ References: `framework/src/dependencies.ts`, `core-transformers/src/core-transformers.ts`, `storage/src/data-source.ts`.
@@ -0,0 +1,35 @@
1
+ # HTML templates and targets
2
+
3
+ Render valid standalone HTML and identify the fragment for asynchronous navigation.
4
+ The action prepares a small named data context and owns business decisions.
5
+
6
+ ## Expressions
7
+
8
+ - `{property.path}` reads a path; a non-class function is called on its owner.
9
+ - `{?property}` or `{property?}` suppresses the attribute contribution or block when falsy.
10
+ - `<!--items-->...<!--end-->` renders a truthy value once or iterates it with each item as context.
11
+ - `{./file.html}` includes a relative template with the current context.
12
+ - `{{template}}` resolves an included template path from data.
13
+ - `{@display}`, `{@output}`, `{@route}` read decorator semantics.
14
+ - `{%property.name}`, `{%orderedProperties}` traverse reflected metadata.
15
+
16
+ Use `data-if="{condition}" ... data-end` for several conditional attributes.
17
+ `template-insight` translates literal text; use `.tr` for data-derived strings needing translation.
18
+ Use `app://(expression)` for application URLs in `action`, `formaction`, `href`, `location` and `src`.
19
+
20
+ ## Fragments and assets
21
+
22
+ - `<!--BEGIN-->` and `<!--END-->` delimit the asynchronous response fragment.
23
+ - `<!--#selector-->...<!--#end-->` updates a target; several target blocks may coexist.
24
+ - Target modes: `:content` (default), `:replace`, `:before`, `:after`, `:prepend`, `:append`, `:auto`.
25
+ - Reuse application-owned targets such as `main` and `#notifications:prepend`.
26
+
27
+ Keep language, title and required assets in the full document. Client navigation updates the title and imports missing
28
+ head styles/scripts without duplicating URLs. Includes retain asset dependencies; relative links become application
29
+ paths, with `node_modules/@itrocks` served as `/@itrocks/...` and other dependencies as `/lib/...`.
30
+
31
+ Match block delimiters exactly. Keep selectors, attributes and action names consistent with browser and SCSS contracts.
32
+ Verify direct navigation and fragment insertion.
33
+
34
+ References: `template/src/template.ts`, `template-insight/src/template.ts`, `edit/src/edit.html`,
35
+ `xtarget/src/begin-end.ts`, `xtarget/src/composite.ts`.
@@ -0,0 +1,18 @@
1
+ # Package boundaries
2
+
3
+ Give each package one coherent responsibility and the smallest public contract its consumers need.
4
+ Domain and reusable infrastructure packages must remain independent of `@itrocks/framework` and concrete adapters.
5
+ The framework binds implementations and starts the application.
6
+
7
+ - Separate server and browser surfaces. Browser imports must not load Node.js APIs or CommonJS-only modules.
8
+ - Expose named exports through a facade or explicit subpaths.
9
+ - Reserve side-effect modules such as `build.js` for activation; ordinary API imports must not start servers or
10
+ mutate global registries.
11
+ - Keep declarative routes, menus and other contributions package-local and additive; application overrides belong
12
+ in application configuration.
13
+ - Keep tests and demos outside runtime entries.
14
+
15
+ For source layout and generated outputs, follow [structure and build](package-structure-and-build.md).
16
+ For dependency direction and extension choices, follow [reuse](framework-reuse.md).
17
+
18
+ References: `action/src/action.ts`, `framework/src/front/app.ts`, `list/src/front/build.ts`.
@@ -0,0 +1,44 @@
1
+ # Package structure and build
2
+
3
+ Preserve an existing package's layout unless migrating it. For new packages, use kebab-case filenames and one concern
4
+ per file. Author runtime files in `src/`; never hand-edit generated JS, declarations, CSS or copied assets.
5
+
6
+ ## Layout by surface
7
+
8
+ - Backend: `src/*.ts` → `cjs/`, with a root export and optional subpaths. Reference: `required`.
9
+ - Backend with templates: HTML → `cjs/`; SCSS and assets → `css/`. Reference: `action`.
10
+ - Mixed: backend in `src/`, browser in `src/front/`; browser outputs at package root. Reference: `list`.
11
+ - Browser-only: ES modules published as root subpaths. Reference: `xtarget`.
12
+ - CSS-only: SCSS partials and entries in `css/`. Reference: `ux-core`.
13
+ - Metadata or documentation only: no TypeScript configuration or runtime entry.
14
+
15
+ Keep owning HTML, SCSS and assets beside their source; tests in `test/`; declarative contributions in `config.yaml`.
16
+ Name the facade after the package unless `index.ts` is the intended public entry.
17
+ Use `build.ts` for browser registration and `transformers.ts` for transformer registration.
18
+ Use separate CJS/ESM builds only when consumers require both; reference `route`.
19
+
20
+ ## Compiler and publication
21
+
22
+ Start from the closest reference package and remove unused options.
23
+ Backend defaults: strict checking, declarations, `module: nodenext`, `rootDir: src`, `outDir: cjs`, source maps,
24
+ consistent casing and skipped library checking. Add Node types or legacy decorators only when needed.
25
+ Exclude `src/front` from the backend build. Mixed browser builds extend the base configuration with `module: esnext`,
26
+ `target: es2022`, no source maps and the intended public output directory.
27
+ Use `@itrocks/prepare-module` where compiled browser subpaths must be copied to the root.
28
+
29
+ Package metadata includes author, description, keywords, homepage, license, scoped name, repository and version.
30
+ Start an unreleased package at `0.0.1`; do not bump existing versions incidentally.
31
+ Use `itrocks-ts/<package>` for the repository and keep the license consistent with `LICENSE`.
32
+
33
+ - Runtime imports belong in `dependencies`; internal packages use `latest`.
34
+ - Build and test tools belong in `devDependencies`; use optional dependencies only for optional integrations.
35
+ - Set `engines.node` to the project baseline for Node.js runtime packages.
36
+ - Declare the public entry with `exports`; browser packages may expose published subpaths.
37
+ - Use a positive `files` allowlist. Publish only existing files; exclude maps unless deliberately required.
38
+ - Copy HTML and assets explicitly; compile SCSS with `--no-source-map`.
39
+ - For Node tests, use `npm run build && node --test --test-isolation=none test/*.test.js`.
40
+
41
+ When moving a public file, update layout, compiler settings, exports, files, build, examples and tests together.
42
+ Run the applicable build and tests, then `npm pack --dry-run` to check the published files.
43
+
44
+ See [package metadata](../documentation/package-metadata.md) and [README content](../documentation/readme.md).
@@ -0,0 +1,29 @@
1
+ # Persistence and schema
2
+
3
+ Domain classes do not own persistence identifiers. Opt in with `@Store()`; supply a name only to override convention
4
+ and use `@Store(false)` to opt out. At the storage boundary, instances are `Entity<T>` with an attached `id`.
5
+
6
+ Use abstract `DataSource` operations for count, read, search, save, delete and collections.
7
+ Select the configured engine with `createDataSource`; do not construct MySQL adapters in actions or models.
8
+ Pass typed query options rather than SQL.
9
+
10
+ Stored object collections use relation operations and identifiers. `@Component` marks owned data and `@Composite`
11
+ its back-reference. Ownership affects loading, saving, deletion and edit rendering; declare it explicitly.
12
+
13
+ ## Schema layers
14
+
15
+ 1. Reflection and metadata describe the model.
16
+ 2. `reflect-to-schema` produces neutral `Database`, `Table`, `Column`, `Index` and `Type` objects.
17
+ 3. Introspection (e.g. `mysql-to-schema`) produces the same neutral model from the database.
18
+ 4. `schema-diff` compares models.
19
+ 5. A dialect adapter (e.g. `schema-to-mysql`) renders SQL.
20
+
21
+ Naming, former names, length/range/precision, optionality, representative indexes and relation metadata belong in
22
+ reflection conversion. SQL syntax and dialect limits belong in the dialect adapter.
23
+ Value conversion uses `SQL`/`READ` and `SQL`/`SAVE` transformers; see [transformations](transformations-and-views.md).
24
+ Check new/existing entities, optional values, relations, collection diffs, conversion symmetry and migration
25
+ preservation
26
+ of former names and representative indexes.
27
+
28
+ References: `storage/src/data-source.ts`, `reflect-to-schema/src/to-column.ts`,
29
+ `schema-to-mysql/src/schema-to-mysql.ts`.
@@ -0,0 +1,24 @@
1
+ # Requests, actions and routes
2
+
3
+ Keep transport-neutral data in `request-response`, URL interpretation in `action-request` and adapter details in the
4
+ server adapter.
5
+
6
+ Pipeline: adapter request → `action-request.Request` → route resolution → format method on an action → generic response.
7
+ The URL shape is `/route[/ids][/action][/format]`; the request resolves the domain type and lazily loads objects.
8
+ Default operations: collection `GET` → `list`, identified `GET` → `output`, `POST` → `save`, `DELETE` → `delete`.
9
+ Declare explicit routes for other operations.
10
+
11
+ - Configure destinations as module paths with optional `:ExportName`.
12
+ - Use `@Route` for reusable action identity and link generation.
13
+ - Extend `Action<T>` for format-specific operations (`html`, `json`, etc.); share domain work below those methods.
14
+ - Return `htmlResponse`, `htmlTemplateResponse` or `jsonResponse`, not adapter-specific responses.
15
+ - Use `@Need('object', alternative)` or `@Need('Store', alternative)` for structural prerequisites;
16
+ authorisation and business validation remain explicit logic.
17
+ - Use the request's resolved type and objects, or `DataSource`; do not reparse identifiers in each action.
18
+
19
+ `@Actions` declares available operations. `ActionFlow(from, to, definition)` and the action repository describe UI links
20
+ (caption, target, CSS, template); they do not register HTTP routes.
21
+ Check missing objects/stores, multiple identifiers, format negotiation and error statuses when changing the pipeline.
22
+
23
+ References: `action-request/src/action-request.ts`, `route/src/routes.ts`, `action/src/action.ts`,
24
+ `action/src/repository.ts`, `framework/src/main.ts`.
@@ -0,0 +1,19 @@
1
+ # SCSS and assets
2
+
3
+ Put shared layout and element defaults in `ux-core`; feature structure, state and icons belong to the package owning
4
+ the corresponding HTML or browser behaviour.
5
+
6
+ Use stable semantic elements, feature classes, action names and `data-*` attributes.
7
+ Nest by DOM ownership and use direct-child selectors where structure is contractual; avoid leaking styles into includes.
8
+ Represent interactive state with classes or attributes toggled by TypeScript, such as `.visible` or `[data-sort]`.
9
+ Do not rely on temporary wrappers present only during partial navigation.
10
+
11
+ Compose reusable partials with Sass `@use`. Each standalone template links the styles it needs so inserted fragments
12
+ can load them through head processing. Reuse existing breakpoints and containers for shared layout changes.
13
+
14
+ Action icons use `.action.save, ul.actions > li.save` with `background-image: url('save.svg')`.
15
+ Keep the action name consistent across routes, templates, selectors and asset filenames.
16
+ Resolve asset URLs against compiled CSS and copy assets to the matching published location.
17
+ Check `url(...)` and `@use` paths, plus full-page and fragment rendering.
18
+
19
+ References: `ux-core/css/app.scss`, `action-bar/action.scss`, `list/src/list.scss`, `save/src/action.scss`.
@@ -0,0 +1,27 @@
1
+ # Transformations and views
2
+
3
+ Use the transformer registry for property representation changes; use view metadata to select presentation.
4
+
5
+ Selection uses format (`HTML`, `SQL`, etc.) and direction (`EDIT`, `INPUT`, `OUTPUT`, `READ`, `SAVE`).
6
+ Precedence: property → property type → `ALL`, with empty format/direction fallbacks.
7
+ Type lookup supports canonical types, domain types, collections and base types.
8
+
9
+ Register with `@Transform`, `setPropertyTransformer` or `setPropertyTypeTransformer`.
10
+ Use a type transformer for a shared rule and a property transformer for an exceptional field.
11
+ Return `IGNORE` to leave a property untouched; `undefined` is a legitimate transformed value.
12
+
13
+ - Form → domain: `HTML`/`INPUT` through `dataToObject`.
14
+ - Domain → edit/display: `HTML`/`EDIT` or `HTML`/`OUTPUT` through framework `ReflectProperty`.
15
+ - Row → domain: `SQL`/`READ`.
16
+ - Domain → database: `SQL`/`SAVE`.
17
+
18
+ Prefer pure transformers. Bind collaborators and register shared transformers during bootstrap.
19
+ Format-level post-processing is for rules shared by every transformer in that format.
20
+ Check precedence, asynchronous and optional values, collections and `IGNORE` when changing resolution.
21
+
22
+ `@Display` names classes/properties; `@DisplayOrder` orders detail fields; `@List` selects collection fields;
23
+ `@Representative` identifies objects in links and summaries. Defaults are inherited and reflection-based.
24
+ Templates consume reflected metadata and decorated helpers instead of rebuilding labels or formatting.
25
+
26
+ References: `transformer/src/transformer.ts`, `data-to-object/src/data-to-object.ts`,
27
+ `framework/src/reflect-property.ts`, `class-view/src/representative.ts`.
@@ -0,0 +1,14 @@
1
+ # Dependency documentation
2
+
3
+ For consumer-supplied dependencies, add `docs/dependencies.md` to the affected package and link it from its README.
4
+ Follow [documentation conventions](markdown.md).
5
+
6
+ Cover:
7
+
8
+ - Defaults and behaviour for each dependency.
9
+ - Framework-independent configuration showing how a consumer supplies it.
10
+ - The functions or values supplied by it.rocks, with links to their owning package's documentation headings.
11
+
12
+ Use `bind()` in [framework/src/dependencies.ts](../../../../framework/src/dependencies.ts) as the source of truth.
13
+ `src/framework.ts` calls it but does not define the bindings.
14
+ Describe the mapping without copying the framework implementation.
@@ -0,0 +1,19 @@
1
+ # Documentation conventions
2
+
3
+ Write in UK English. These rules apply to all Markdown; content requirements are routed by
4
+ [framework changes](../README.md).
5
+
6
+ ## Content
7
+
8
+ Document the current state only. When updating or moving documentation, remove obsolete content and redirect stubs;
9
+ do not retain migration notices, previous behaviour or comparisons with earlier versions.
10
+
11
+ ## Formatting
12
+
13
+ - Limit source lines to 120 columns, including Markdown syntax. Only indivisible content such as URLs may exceed it.
14
+ - Wrap prose at natural phrase boundaries; keep code examples within the limit where syntax permits.
15
+ - Align table pipes with padding and size separator cells to their columns, preserving alignment markers.
16
+ - If a table exceeds the limit, shorten cells or split it. Realign it after edits.
17
+ - Use sentence case headings, one level-one title and hierarchical heading levels.
18
+ - Mark packages, symbols, commands, filenames and literal values with backticks.
19
+ - Link to existing explanations rather than repeating them. Use relative links within this documentation package.
@@ -0,0 +1,22 @@
1
+ # Package metadata
2
+
3
+ Treat the README opening, `package.json.description` and `keywords` as one documentation surface.
4
+ Review them together whenever the package's responsibility changes.
5
+
6
+ ## Description
7
+
8
+ Describe the existing public capability in one phrase, without a trailing full stop.
9
+ The first sentence after the README title must reproduce it exactly, adding only the full stop.
10
+ Put qualifications in a separate sentence.
11
+
12
+ Use present tense, a concrete subject and the defining environment only when relevant.
13
+ Avoid the package name, version claims, marketing adjectives and secondary feature lists.
14
+
15
+ ## Keywords
16
+
17
+ Use unique, relevant search terms drawn from the package's capability, operations, platform and technologies.
18
+ Include `it.rocks` for framework packages. Prefer 7–15 terms; relevance takes precedence over the count.
19
+ Use lowercase except established acronyms; sort alphabetically, ignoring case.
20
+ Do not add vague terms, dependency inventories or spelling variants merely to increase the count.
21
+
22
+ Parse the JSON and check description agreement, keyword uniqueness and ordering after editing.
@@ -0,0 +1,45 @@
1
+ # Package README content
2
+
3
+ Follow [documentation conventions](markdown.md) and review
4
+ [package metadata](package-metadata.md) alongside the README.
5
+
6
+ Document developer-facing usage and the current public contract. Move dependency binding and framework wiring to
7
+ [dependency documentation](dependencies.md), linked from the README.
8
+
9
+ ## Opening
10
+
11
+ Start with these badges, replacing `<package>` with the unscoped package name:
12
+
13
+ ```markdown
14
+ [![npm version](https://img.shields.io/npm/v/@itrocks/<package>?logo=npm)](https://www.npmjs.org/package/@itrocks/<package>)
15
+ [![npm downloads](https://img.shields.io/npm/dm/@itrocks/<package>)](https://www.npmjs.org/package/@itrocks/<package>)
16
+ [![GitHub](https://img.shields.io/github/last-commit/itrocks-ts/<package>?color=2dba4e&label=commit&logo=github)](https://github.com/itrocks-ts/<package>)
17
+ [![issues](https://img.shields.io/github/issues/itrocks-ts/<package>)](https://github.com/itrocks-ts/<package>/issues)
18
+ [![discord](https://img.shields.io/discord/1314141024020467782?color=7289da&label=discord&logo=discord&logoColor=white)](https://25.re/ditr)
19
+ ```
20
+
21
+ Use the unscoped package name as the title, followed by the canonical description from package metadata.
22
+
23
+ ## Content selection
24
+
25
+ Include only useful sections, in usage order:
26
+
27
+ - Actual prerequisites and installation: `npm i @itrocks/<package>`; use `--save-dev` for development tools.
28
+ - Required concepts or initialisation order, then the smallest complete usage example and observable result.
29
+ - Public API: signatures, defaults, return values, side effects and non-obvious constraints.
30
+ - Limitations or recurring mistakes where they help prevent misuse.
31
+
32
+ Document public exports except wiring-only exports, which belong in dependency documentation.
33
+ For decorators, explain targets, inheritance and omitted or `false` arguments.
34
+ For callbacks, specify the signature and invocation timing. For commands, describe inputs, filesystem or registry
35
+ changes, output, exit behaviour and any dry-run mode.
36
+
37
+ Examples must use actual exports, include necessary imports, use `await` for asynchronous calls and state filenames
38
+ when several files participate. Use fenced blocks with the appropriate language.
39
+
40
+ A dependency bundle lists its packages and their roles, states whether it exports runtime code and shows imports
41
+ from the owning packages. Browser packages show script and stylesheet imports plus dynamic DOM activation requirements.
42
+
43
+ Link the first useful mention of another package to its repository or relevant heading; use authoritative sources
44
+ for platform concepts. Check examples and API claims against source, exports and generated files, and remove obsolete
45
+ instructions with the corresponding implementation.
@@ -0,0 +1,14 @@
1
+ # Framework usage
2
+
3
+ Read the [framework README](../../../framework/README.md) for application setup and configuration,
4
+ then the owning package's README for the feature being used.
5
+
6
+ Read only the conventions needed by the task:
7
+
8
+ - Application source: [coding conventions](coding-conventions.md).
9
+ - Markdown: [documentation conventions](../framework-changes/documentation/markdown.md).
10
+ - Framework extension or integration: select the relevant [architecture
11
+ guide](../framework-changes/architecture/README.md).
12
+
13
+ Keep application overrides in application configuration. Import public package entries or exported subpaths;
14
+ do not depend on another package's private implementation.
@@ -0,0 +1,77 @@
1
+ # Coding conventions
2
+
3
+ Apply these rules to application and framework source, tests and development files.
4
+
5
+ ## Layout and blocks
6
+
7
+ - Limit lines to 120 columns; count each indentation tab as two columns. Only indivisible content may exceed it.
8
+ - Indent with tabs wherever permitted, including HTML and SCSS; use spaces for alignment or tab-forbidding formats
9
+ such as YAML.
10
+ - Omit semicolons; use single quotes and template literals for interpolation or multiline text.
11
+ - Space postfix operators: `index ++`, `index --`.
12
+ - Align `from`, `=`, `:` and values in adjacent related lines where the limit allows.
13
+ - Put `{` on the next line for classes, interfaces, functions, methods and constructors.
14
+ - Keep `{` on the control line for conditions, loops, `switch`, `try`, `catch` and `finally`.
15
+ - Put `else`, `catch` and `finally` on a new line after the preceding `}`.
16
+ - Braces may be omitted for a single-line control body; multiline bodies require them.
17
+ - Leave a blank line after a non-empty class opening brace and before its closing brace.
18
+
19
+ ## Signatures
20
+
21
+ Choose the first layout below that fits 120 columns. Apply the same parameter and return-type breaks to methods,
22
+ constructors, overloads and arrow functions. When only the return type causes overflow, move it before splitting
23
+ parameters. After splitting at parentheses, keep parameters together if they fit; otherwise use one per line.
24
+ Omit the trailing comma and keep `): ReturnType` together.
25
+
26
+ ```ts
27
+ function calculate(input: Input, options: Options): Result
28
+ {
29
+ }
30
+
31
+ function calculate(input: Input, options: Options)
32
+ : Promise<Result>
33
+ {
34
+ }
35
+
36
+ function calculate(
37
+ input: Input, options: Options
38
+ ): Promise<Result>
39
+ {
40
+ }
41
+
42
+ function calculate(
43
+ input: Input,
44
+ options: Options
45
+ ): Promise<Result>
46
+ {
47
+ }
48
+ ```
49
+
50
+ ## Ordering
51
+
52
+ Sort homogeneous sequences alphabetically by stable name wherever order has no semantic significance.
53
+ This includes configuration, documentation, object/array entries, declarations, members, imports, exports,
54
+ parameters and test cases. Separate coherent kinds where useful, then sort within each group.
55
+ Preserve required initialisation, side effects, fallback, precedence, lifecycle, overload, protocol and runtime order;
56
+ comment non-obvious constraints.
57
+
58
+ Group module declarations as: types/interfaces, constants, `let`, functions, classes.
59
+
60
+ For side-effect-free imports, locality precedes alphabetical order:
61
+
62
+ 1. Bare specifiers, including packages and Node.js built-ins.
63
+ 2. Parent-relative paths, farthest first (`../../../`, `../../`, `../`).
64
+ 3. Subdirectory paths, deepest first.
65
+ 4. Same-directory paths (`./` without a subdirectory).
66
+
67
+ Within the same locality and depth, sort by specifier; repeated specifiers sort by imported symbol.
68
+
69
+ ## Modules and declarations
70
+
71
+ - Start TypeScript modules with a blank line unless imports come first; imports have no preceding blank line.
72
+ - Keep imports first, one symbol per declaration, with aligned `from`.
73
+ - Omit `.js` and `.ts` from specifiers when resolution permits; browser imports require explicit `.js`
74
+ as described in [browser components](../framework-changes/architecture/browser-components.md).
75
+ - Prefer named exports; use default exports only for external API requirements.
76
+ - Use `const` unless reassignment is required; never `var`.
77
+ - Use object property/method shorthand and concise arrows for a single returned expression.
package/package.json CHANGED
@@ -1,6 +1,29 @@
1
1
  {
2
- "name": "@itrocks/handbook",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "author": {
3
+ "name": "Baptiste Pillot",
4
+ "email": "baptiste@pillot.fr"
5
+ },
6
+ "description": "Provides it.rocks framework usage and development guides for developers and AI agents",
7
+ "files": [
8
+ "AGENTS.md",
9
+ "LICENSE",
10
+ "README.md",
11
+ "docs"
12
+ ],
13
+ "homepage": "https://it.rocks",
14
+ "keywords": [
15
+ "ai",
16
+ "conventions",
17
+ "development",
18
+ "documentation",
19
+ "guides",
20
+ "it.rocks"
21
+ ],
22
+ "license": "ISC",
23
+ "name": "@itrocks/handbook",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/itrocks-ts/handbook.git"
27
+ },
28
+ "version": "0.0.1"
29
+ }