@itrocks/handbook 0.0.10 → 0.0.12
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/docs/framework-changes/architecture/browser-components.md +3 -1
- package/docs/framework-changes/architecture/html-templates-and-targets.md +21 -0
- package/docs/framework-changes/documentation/dependencies.md +1 -1
- package/docs/framework-changes/documentation/markdown.md +11 -0
- package/docs/framework-changes/documentation/readme.md +2 -1
- package/docs/framework-usage/README.md +2 -0
- package/package.json +1 -1
|
@@ -4,7 +4,9 @@ Register independent DOM enhancements by selector with `build()`; use `HasPlugin
|
|
|
4
4
|
extensions around a stable host API.
|
|
5
5
|
|
|
6
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
|
|
7
|
+
Put template-specific registrations in an explicit browser build module declared in the owning template's head.
|
|
8
|
+
Follow [HTML templates and asset loading](html-templates-and-targets.md#fragments-and-assets);
|
|
9
|
+
reserve browser-entry imports for shared infrastructure or necessary host context detection.
|
|
8
10
|
Use semantic selectors and guard repeated activation when components do not already do so.
|
|
9
11
|
Load heavy or optional behaviour inside the callback. Browser subpath imports use explicit `.js` extensions.
|
|
10
12
|
Keep structure in HTML, behaviour in TypeScript and visual state in SCSS, sharing documented classes and attributes.
|
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
Render valid standalone HTML and identify the fragment for asynchronous navigation.
|
|
4
4
|
The action prepares a small named data context and owns business decisions.
|
|
5
5
|
|
|
6
|
+
## Authoring and validation
|
|
7
|
+
|
|
8
|
+
Author page and fragment markup in HTML templates. Server actions prepare data; browser code enhances the rendered DOM.
|
|
9
|
+
Do not assemble view markup in TypeScript strings or construct entire views with DOM creation calls.
|
|
10
|
+
|
|
11
|
+
The rendered standalone document and the DOM after fragment insertion must pass the
|
|
12
|
+
[W3C Nu HTML Checker](https://validator.w3.org/nu/). Validate rendered output, with template expressions resolved,
|
|
13
|
+
including conditional branches and representative dynamic values. Check source templates for valid HTML structure too.
|
|
14
|
+
Use standard HTML and permitted ARIA attributes; application-specific metadata belongs in `data-*` attributes.
|
|
15
|
+
Do not invent bare attributes or rely on the browser silently repairing invalid nesting.
|
|
16
|
+
Context-dependent composite fragments can be enclosed in a `<template>` outside `BEGIN`/`END` to keep their standalone
|
|
17
|
+
document valid without inserting that wrapper into the live DOM.
|
|
18
|
+
|
|
6
19
|
## Expressions
|
|
7
20
|
|
|
8
21
|
- `{property.path}` reads a path; a non-class function is called on its owner.
|
|
@@ -28,6 +41,14 @@ Keep language, title and required assets in the full document. Client navigation
|
|
|
28
41
|
head styles/scripts without duplicating URLs. Includes retain asset dependencies; relative links become application
|
|
29
42
|
paths, with `node_modules/@itrocks` served as `/@itrocks/...` and other dependencies as `/lib/...`.
|
|
30
43
|
|
|
44
|
+
Declare template-specific CSS with `<link rel="stylesheet">` and JavaScript with `<script type="module" src="...">`
|
|
45
|
+
in that template's `<head>`, outside `BEGIN`/`END` when appropriate. These fragment markers do not prevent the framework
|
|
46
|
+
from processing the head: `xtarget` loads the declared assets when the HTML is first used and avoids duplicates.
|
|
47
|
+
Prefer these declarations over application-wide imports or script-driven asset loading.
|
|
48
|
+
Keep only shared application infrastructure and necessary context detection in the application entry.
|
|
49
|
+
When no HTML template owns an optional integration, load it at the relevant context and document why it is needed.
|
|
50
|
+
Framework adapters belong to the framework; importing a reusable package must not implicitly bind it to the framework.
|
|
51
|
+
|
|
31
52
|
Match block delimiters exactly. Keep selectors, attributes and action names consistent with browser and SCSS contracts.
|
|
32
53
|
Verify direct navigation and fragment insertion.
|
|
33
54
|
|
|
@@ -6,8 +6,8 @@ Follow [documentation conventions](markdown.md).
|
|
|
6
6
|
Cover:
|
|
7
7
|
|
|
8
8
|
- Defaults and behaviour for each dependency.
|
|
9
|
-
- Framework-independent configuration showing how a consumer supplies it.
|
|
10
9
|
- The functions or values supplied by it.rocks, with links to their owning package's documentation headings.
|
|
10
|
+
- Configuration showing how a consumer supplies it outside it.rocks.
|
|
11
11
|
|
|
12
12
|
Use `bind()` in [framework/src/dependencies.ts](../../../../framework/src/dependencies.ts) as the source of truth.
|
|
13
13
|
`src/framework.ts` calls it but does not define the bindings.
|
|
@@ -8,6 +8,17 @@ Write in UK English. These rules apply to all Markdown; content requirements are
|
|
|
8
8
|
Document the current state only. When updating or moving documentation, remove obsolete content and redirect stubs;
|
|
9
9
|
do not retain migration notices, previous behaviour or comparisons with earlier versions.
|
|
10
10
|
|
|
11
|
+
Organise package READMEs and supporting documentation in this order, including only applicable sections:
|
|
12
|
+
|
|
13
|
+
1. Normal usage and capabilities shared by it.rocks and other contexts.
|
|
14
|
+
2. Configuration, conventions and behaviour specific to integration with the it.rocks framework.
|
|
15
|
+
3. Usage outside the it.rocks framework: both standalone applications and integration with other frameworks,
|
|
16
|
+
including manual setup and capabilities specific to those contexts.
|
|
17
|
+
|
|
18
|
+
Name context-specific sections explicitly. Keep manual setup and adapter wiring out of shared usage when it.rocks
|
|
19
|
+
already supplies them. Put dependency binding details in [dependency documentation](dependencies.md), linked from
|
|
20
|
+
the relevant context section.
|
|
21
|
+
|
|
11
22
|
## Formatting
|
|
12
23
|
|
|
13
24
|
- Limit source lines to 120 columns, including Markdown syntax. Only indivisible content such as URLs may exceed it.
|
|
@@ -22,7 +22,8 @@ Use the unscoped package name as the title, followed by the canonical descriptio
|
|
|
22
22
|
|
|
23
23
|
## Content selection
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Follow the context order in [documentation conventions](markdown.md#content).
|
|
26
|
+
Within each applicable context, include only useful sections, in usage order:
|
|
26
27
|
|
|
27
28
|
- Actual prerequisites and installation: `npm i @itrocks/<package>`; use `--save-dev` for development tools.
|
|
28
29
|
- Required concepts or initialisation order, then the smallest complete usage example and observable result.
|
|
@@ -6,6 +6,8 @@ then the owning package's README for the feature being used.
|
|
|
6
6
|
Read only the conventions needed by the task:
|
|
7
7
|
|
|
8
8
|
- Application source: [coding conventions](coding-conventions.md).
|
|
9
|
+
- HTML, fragments and front-end assets:
|
|
10
|
+
[templates and targets](../framework-changes/architecture/html-templates-and-targets.md).
|
|
9
11
|
- Markdown: [documentation conventions](../framework-changes/documentation/markdown.md).
|
|
10
12
|
- Framework extension or integration: select the relevant [architecture
|
|
11
13
|
guide](../framework-changes/architecture/README.md).
|
package/package.json
CHANGED