nubond 1.0.12 → 1.0.13

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 (2) hide show
  1. package/README.md +155 -154
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,155 +1,156 @@
1
- <h1 align="center">WEB Development made simple and fun again</h1>
2
-
3
- <p align="center">
4
- <img src="https://raw.githubusercontent.com/nubond/nubond/refs/heads/main/assets/icon.png" alt="nuBond" width="100" height="100" />
5
- </p>
6
-
7
- <h1 align="center">nuBond</h1>
8
-
9
- <p align="center">
10
- <strong>A declarative TypeScript progressive framework with Web Components, Shadow DOM, and an attribute-driven binding system.</strong>
11
- </p>
12
-
13
- <p align="center">
14
- <a href="https://github.com/nubond/nubond/blob/main/LICENSE"><img alt="license" src="https://img.shields.io/npm/l/nubond.svg"></a>
15
- <img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-5.x-3178c6?logo=typescript&logoColor=white">
16
- <img alt="web components" src="https://img.shields.io/badge/Web%20Components-Shadow%20DOM-blue">
17
- <img alt="Made in Ukraine" src="https://img.shields.io/badge/Made_in-Ukraine-FFD800.svg?labelColor=0056B9">
18
- </p>
19
-
20
- ---
21
-
22
- ## What is nuBond?
23
-
24
- nuBond is a lightweight UI framework for building reactive progressive web applications in TypeScript that respects vanilla web development. It pairs **Web Components and Shadow DOM** with a familiar **decorator + HTML/CSS templates** authoring model, an **attribute-based binding system**, **dependency injection**, **routing**, and **automatic change detection** — all in one cohesive package.
25
-
26
- ## Why nuBond?
27
- - **Simple** — 15 minutes and you know all the basics, 15 minutes more and you know everything
28
- - **No dependencies** — the framework has no release dependencies and only one dev dependency — `tslib`
29
- - **Lightweight** — as lightweight as possible without compromising functionality
30
- - **Fast** — blazingly fast performance at any application size
31
- - **Feature rich** — powerful and feature rich, no compromises and no limitations
32
- - **Portable** — can be compiled into a single JavaScript file
33
- - **Easy migration** — can co-exist with other UI frameworks/libraries on the same page and integrate with them
34
-
35
- ## Highlights
36
-
37
- - **Declarative templates** — `nb-value`, `nb-class`, `nb-if`, `nb-repeat`, `nb-event:click`, and more.
38
- - **Decorator-based metadata** — `@AppRoot`, `@Container`, `@Component`, `@Aspect`, `@Transformer`, `@Injectable`.
39
- - **Web Components first** — components are real Custom Elements with isolated Shadow DOM and scoped styles.
40
- - **Built-in DI** — constructor injection with singleton or transient lifetimes.
41
- - **Automatic change detection** — automatically triggered based on events and input changes, with the ability to trigger manually via injection or the `@Detector()` / `@Eventer()` decorators.
42
- - **Routing** — hash-based or path-based routing with declarative slot binding (`nb-container="%slot"`).
43
- - **Aspects** — reusable element-level behaviors that mix into any element without creating a new scope.
44
- - **Transformers** — global pure functions usable from any expression (`{{ dateFormat(...) }}`).
45
- - **Content projection** — powerful HTML template processing based on named and default slots with append-or-replace semantics.
46
- - **Adopted styles** — share `CSSStyleSheet` instances across components.
47
- - **W3C compliance mode** — switch from `nb-*` to `data-nb-*` attributes when strict HTML conformance is required.
48
-
49
- ## Quick Start
50
-
51
- The fastest way to scaffold a new app is via `create nubond`:
52
-
53
- ```bash
54
- npm create nubond blank my-app
55
- cd my-app
56
- npm start
57
- ```
58
-
59
- Or add nuBond to an existing TypeScript project:
60
-
61
- ```bash
62
- npm install nubond
63
- ```
64
-
65
- > **Requires** TypeScript with `experimentalDecorators` and `emitDecoratorMetadata` enabled.
66
-
67
- ## Hello, world
68
-
69
- **`src/index.ts`** — bootstrap the app with `@AppRoot`:
70
-
71
- ```typescript
72
- import { AppRoot } from 'nubond';
73
- import { Main } from './pages/main/main';
74
-
75
- @AppRoot(
76
- { showDebugInfo: true },
77
- '/#[page=main]',
78
- Main
79
- )
80
- export class App { }
81
- ```
82
-
83
- **`src/pages/main/main.ts`** — a container with HTML template:
84
-
85
- ```typescript
86
- import html from './main.html';
87
- import { Container } from 'nubond';
88
-
89
- @Container(html)
90
- export class Main {
91
- public name = 'world';
92
-
93
- public greet() {
94
- this.name = 'nuBond';
95
- }
96
- }
97
- ```
98
-
99
- **`src/pages/main/main.html`** — declarative binding via `nb-*` attributes:
100
-
101
- ```html
102
- <h1>Hello, {{this.name}}</h1>
103
- <button nb-event:click="this.greet()">Greet</button>
104
- ```
105
-
106
- ## A taste of the binding system
107
-
108
- ```html
109
- <!-- Text & HTML -->
110
- <p nb-value="this.user.fullName"></p>
111
- <div nb-html="this.richContent"></div>
112
-
113
- <!-- Classes & styles -->
114
- <div nb-class="{active: this.isOpen; disabled: !this.canEdit}"></div>
115
- <div nb-style="opacity: this.fade; color: this.theme.text"></div>
116
-
117
- <!-- Conditional & iteration -->
118
- <p nb-if="this.items.length">You have items.</p>
119
- <li nb-repeat="this.items" nb-value="`${index + 1}. ${item.title}`"></li>
120
-
121
- <!-- Events with optional debounce -->
122
- <input nb-event:input:300="this.search(event)" />
123
-
124
- <!-- Components & containers with input passing -->
125
- <my-card nb-in:title="this.headline" nb-event:save="this.onSave(data)"></my-card>
126
- <div nb-container="@SettingsPanel" nb-in-ref:user="this.currentUser"></div>
127
-
128
- <!-- Route slot binding -->
129
- <div nb-container="%page"></div>
130
- ```
131
-
132
- ## Documentation
133
-
134
- **[`Documentation & Feature Reference`](https://github.com/nubond/nubond/blob/main/FEATURES.md)**
135
-
136
- In addition all features and details are available in the `showcase` app:
137
- ```bash
138
- npm create nubond showcase showcase-app
139
- cd showcase-app
140
- npm start
141
- ```
142
-
143
- ## Ecosystem
144
-
145
- nuBond ships alongside a set of satellite packages:
146
-
147
- | Package | Purpose |
148
- |---|---|
149
- | **[`create-nubond`](https://www.npmjs.com/package/create-nubond)** | Project scaffolder — `npm create nubond`. Includes `blank`, `native`, and `showcase` templates. |
150
- | **[`posthtml-value-interpolation`](https://www.npmjs.com/package/@nubond/posthtml-value-interpolation)** | Parcel/PostHTML plugin enabling `{{ expression }}` text interpolation in templates. |
151
- | **[`nuBond Language Service`](https://marketplace.visualstudio.com/items?itemName=nuBond.nubond-language-service)** | VS Code extension: hover, completion, go-to-definition, rename, references, diagnostics, CodeLens, and a TypeScript plugin for cross-file template ↔ class navigation. |
152
-
153
- ## License
154
-
1
+ <h1 align="center">WEB Development made simple and fun again</h1>
2
+
3
+ <p align="center">
4
+ <img src="https://raw.githubusercontent.com/nubond/nubond/refs/heads/main/assets/icon.png" alt="nuBond" width="100" height="100" />
5
+ </p>
6
+
7
+ <h1 align="center">nuBond</h1>
8
+
9
+ <p align="center">
10
+ <strong>A declarative TypeScript progressive framework with Web Components, Shadow DOM, and an attribute-driven binding system.</strong>
11
+ </p>
12
+
13
+ <p align="center">
14
+ <a href="https://github.com/nubond/nubond/blob/main/LICENSE"><img alt="license" src="https://img.shields.io/npm/l/nubond.svg"></a>
15
+ <img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-5.x-3178c6?logo=typescript&logoColor=white">
16
+ <img alt="web components" src="https://img.shields.io/badge/Web%20Components-Shadow%20DOM-blue">
17
+ <img alt="Made in Ukraine" src="https://img.shields.io/badge/Made_in-Ukraine-FFD800.svg?labelColor=0056B9">
18
+ </p>
19
+
20
+ ---
21
+
22
+ ## What is nuBond?
23
+
24
+ nuBond is a lightweight UI framework for building reactive progressive web applications in TypeScript that respects vanilla web development. It pairs **Web Components and Shadow DOM** with a familiar **decorator + HTML/CSS templates** authoring model, an **attribute-based binding system**, **dependency injection**, **routing**, and **automatic change detection** — all in one cohesive package.
25
+
26
+ ## Why nuBond?
27
+ - **Simple** — 15 minutes and you know all the basics, 15 minutes more and you know everything
28
+ - **No dependencies** — the framework has no release dependencies and only one dev dependency — `tslib`
29
+ - **Lightweight** — as lightweight as possible without compromising functionality
30
+ - **Fast** — blazingly fast performance at any application size
31
+ - **Feature rich** — powerful and feature rich, no compromises and no limitations
32
+ - **Portable** — can be compiled into a single JavaScript file
33
+ - **Easy migration** — can co-exist with other UI frameworks/libraries on the same page and integrate with them
34
+
35
+ ## Highlights
36
+
37
+ - **Declarative templates** — `nb-value`, `nb-class`, `nb-if`, `nb-repeat`, `nb-event:click`, and more.
38
+ - **Decorator-based metadata** — `@AppRoot`, `@Container`, `@Component`, `@Aspect`, `@Transformer`, `@Injectable`.
39
+ - **Web Components first** — components are real Custom Elements with isolated Shadow DOM and scoped styles.
40
+ - **Built-in DI** — constructor injection with singleton or transient lifetimes.
41
+ - **Automatic change detection** — automatically triggered based on events and input changes, with the ability to trigger manually via injection or the `@Detector()` / `@Eventer()` decorators.
42
+ - **Routing** — hash-based or path-based routing with declarative slot binding (`nb-container="%slot"`).
43
+ - **Aspects** — reusable element-level behaviors that mix into any element without creating a new scope.
44
+ - **Transformers** — global pure functions usable from any expression (`{{ dateFormat(...) }}`).
45
+ - **Content projection** — powerful HTML template processing based on named and default slots with append-or-replace semantics.
46
+ - **Adopted styles** — share `CSSStyleSheet` instances across components.
47
+ - **W3C compliance mode** — switch from `nb-*` to `data-nb-*` attributes when strict HTML conformance is required.
48
+
49
+ ## Quick Start
50
+
51
+ The fastest way to scaffold a new app is via `create nubond`:
52
+
53
+ ```bash
54
+ npm create nubond blank my-app
55
+ cd my-app
56
+ npm start
57
+ ```
58
+
59
+ Or add nuBond to an existing TypeScript project:
60
+
61
+ ```bash
62
+ npm install nubond
63
+ ```
64
+
65
+ > **Requires** TypeScript with `experimentalDecorators` and `emitDecoratorMetadata` enabled.
66
+
67
+ ## Hello, world
68
+
69
+ **`src/index.ts`** — bootstrap the app with `@AppRoot`:
70
+
71
+ ```typescript
72
+ import { AppRoot } from 'nubond';
73
+ import { Main } from './pages/main/main';
74
+
75
+ @AppRoot(
76
+ { showDebugInfo: true },
77
+ '/#[page=main]',
78
+ Main
79
+ )
80
+ export class App { }
81
+ ```
82
+
83
+ **`src/pages/main/main.ts`** — a container with HTML template:
84
+
85
+ ```typescript
86
+ import html from './main.html';
87
+ import { Container } from 'nubond';
88
+
89
+ @Container(html)
90
+ export class Main {
91
+ public name = 'world';
92
+
93
+ public greet() {
94
+ this.name = 'nuBond';
95
+ }
96
+ }
97
+ ```
98
+
99
+ **`src/pages/main/main.html`** — declarative binding via `nb-*` attributes:
100
+
101
+ ```html
102
+ <h1>Hello, {{this.name}}</h1>
103
+ <button nb-event:click="this.greet()">Greet</button>
104
+ ```
105
+
106
+ ## A taste of the binding system
107
+
108
+ ```html
109
+ <!-- Text & HTML -->
110
+ <p nb-value="this.user.fullName"></p>
111
+ <div nb-html="this.richContent"></div>
112
+
113
+ <!-- Classes & styles -->
114
+ <div nb-class="{active: this.isOpen; disabled: !this.canEdit}"></div>
115
+ <div nb-style="opacity: this.fade; color: this.theme.text"></div>
116
+
117
+ <!-- Conditional & iteration -->
118
+ <p nb-if="this.items.length">You have items.</p>
119
+ <li nb-repeat="this.items" nb-value="`${index + 1}. ${item.title}`"></li>
120
+
121
+ <!-- Events with optional debounce -->
122
+ <input nb-event:input:300="this.search(event)" />
123
+
124
+ <!-- Components & containers with input passing -->
125
+ <my-card nb-in:title="this.headline" nb-event:save="this.onSave(data)"></my-card>
126
+ <div nb-container="@SettingsPanel" nb-in-ref:user="this.currentUser"></div>
127
+
128
+ <!-- Route slot binding -->
129
+ <div nb-container="%page"></div>
130
+ ```
131
+
132
+ ## Documentation
133
+
134
+ - **[`Interactive documentation`](https://nubond.github.io/)**
135
+ - **[`Documentation & Feature Reference document`](https://github.com/nubond/nubond/blob/main/FEATURES.md)**
136
+
137
+ In addition all features and details are available in the `showcase` app:
138
+ ```bash
139
+ npm create nubond showcase showcase-app
140
+ cd showcase-app
141
+ npm start
142
+ ```
143
+
144
+ ## Ecosystem
145
+
146
+ nuBond ships alongside a set of satellite packages:
147
+
148
+ | Package | Purpose |
149
+ |---|---|
150
+ | **[`create-nubond`](https://www.npmjs.com/package/create-nubond)** | Project scaffolder — `npm create nubond`. Includes `blank`, `native`, and `showcase` templates. |
151
+ | **[`posthtml-value-interpolation`](https://www.npmjs.com/package/@nubond/posthtml-value-interpolation)** | Parcel/PostHTML plugin enabling `{{ expression }}` text interpolation in templates. |
152
+ | **[`nuBond Language Service`](https://marketplace.visualstudio.com/items?itemName=nuBond.nubond-language-service)** | VS Code extension: hover, completion, go-to-definition, rename, references, diagnostics, CodeLens, and a TypeScript plugin for cross-file template ↔ class navigation. |
153
+
154
+ ## License
155
+
155
156
  [MIT](https://github.com/nubond/nubond/blob/main/LICENSE) © Dmytro Tomayly
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "url": "git+https://github.com/nubond/nubond.git"
15
15
  },
16
16
  "license": "MIT",
17
- "version": "1.0.12",
17
+ "version": "1.0.13",
18
18
  "main": "src/index.js",
19
19
  "types": "src/index.d.ts",
20
20
  "devDependencies": {