@bonsae/nrg-runtime 0.22.0
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/LICENSE +21 -0
- package/README.md +24 -0
- package/internal/README.md +30 -0
- package/internal/client/components.mjs +1287 -0
- package/internal/client/index.mjs +229 -0
- package/internal/server/index.cjs +298 -0
- package/package.json +67 -0
- package/server/index.cjs +1407 -0
- package/server/resources/nrg-client.js +7493 -0
- package/types/client.d.ts +266 -0
- package/types/internal/client/components.d.ts +9 -0
- package/types/internal/client/index.d.ts +9 -0
- package/types/internal/server/index.d.ts +422 -0
- package/types/server.d.ts +941 -0
- package/types/shims/brands.d.ts +32 -0
- package/types/shims/client/form/components/node-red-config-input.vue.d.ts +125 -0
- package/types/shims/client/form/components/node-red-editor-input.vue.d.ts +124 -0
- package/types/shims/client/form/components/node-red-input-label.vue.d.ts +34 -0
- package/types/shims/client/form/components/node-red-input.vue.d.ts +123 -0
- package/types/shims/client/form/components/node-red-json-schema-form.vue.d.ts +772 -0
- package/types/shims/client/form/components/node-red-select-input.vue.d.ts +132 -0
- package/types/shims/client/form/components/node-red-toggle.vue.d.ts +36 -0
- package/types/shims/client/form/components/node-red-typed-input.vue.d.ts +151 -0
- package/types/shims/client/globals.d.ts +320 -0
- package/types/shims/client/types.d.ts +227 -0
- package/types/shims/components.d.ts +23 -0
- package/types/shims/constants.d.ts +4 -0
- package/types/shims/schema-options.d.ts +24 -0
- package/types/shims/shims-vue.d.ts +5 -0
- package/types/shims/typebox.d.ts +10 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-present Allan Oricil
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://www.npmjs.com/package/@bonsae/nrg-runtime"><img src="https://img.shields.io/npm/v/@bonsae/nrg-runtime.svg" alt="npm package"></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# @bonsae/nrg-runtime
|
|
6
|
+
|
|
7
|
+
The runtime for Node-RED nodes built with [`@bonsae/nrg`](https://www.npmjs.com/package/@bonsae/nrg) — node base classes, JSON Schema types, the AJV validator, and the editor client runtime. It carries only what a built node needs at runtime (TypeBox, AJV, Vue) and **none** of the build tooling (no Vite/esbuild/TypeScript).
|
|
8
|
+
|
|
9
|
+
> [!NOTE]
|
|
10
|
+
> You normally don't install this directly. `@bonsae/nrg` depends on it, and a node you build declares `@bonsae/nrg-runtime` (not the toolkit) as its only nrg dependency — so installing a built node pulls just this small runtime, never the authoring toolchain.
|
|
11
|
+
|
|
12
|
+
## What's inside
|
|
13
|
+
|
|
14
|
+
- Node base classes (`IONode`, `Node`, `ConfigNode`) and type registration
|
|
15
|
+
- `SchemaType` (TypeBox) schema builders and the AJV validator
|
|
16
|
+
- The editor client runtime (form rendering and validation), served as a static asset
|
|
17
|
+
|
|
18
|
+
## Versioning
|
|
19
|
+
|
|
20
|
+
Published lockstep with `@bonsae/nrg` at the same version. While nrg is at `v0`, breaking changes can land in any release without a major bump — pin an exact version and review the [changelog](https://github.com/bonsaedev/nrg/blob/main/CHANGELOG.md) before upgrading.
|
|
21
|
+
|
|
22
|
+
## License
|
|
23
|
+
|
|
24
|
+
See [LICENSE](./LICENSE).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# `internal/` — test-support surface (not public API)
|
|
2
|
+
|
|
3
|
+
These modules are **not public API**. They exist so `@bonsae/nrg`'s published
|
|
4
|
+
test utilities (`@bonsae/nrg/test/*`) can reach the framework internals they
|
|
5
|
+
need to exercise a consumer's nodes:
|
|
6
|
+
|
|
7
|
+
- **`server/`** — Node-side internals (the wiring symbol, context setup,
|
|
8
|
+
validator init, and internal types) used by the server unit/integration test
|
|
9
|
+
harness.
|
|
10
|
+
- **`client/`** — the form composables (`index`, kept `.vue`-free) and the real
|
|
11
|
+
Vue form components (`components`) used by the component test harness.
|
|
12
|
+
|
|
13
|
+
## Why they ship in the published package
|
|
14
|
+
|
|
15
|
+
A consumer testing their nodes imports `@bonsae/nrg/test/*`, which at runtime
|
|
16
|
+
imports these from the **installed** `@bonsae/nrg-runtime`. The test harness has
|
|
17
|
+
to operate on the **same** runtime instance the consumer's nodes use — the
|
|
18
|
+
`WIRE_HANDLERS` symbol and `instanceof` checks only hold when both sides share
|
|
19
|
+
one copy. So these can't be bundled into the toolkit; they must be a real,
|
|
20
|
+
importable part of this package. (There's no such thing as a published-but-hidden
|
|
21
|
+
export — anything in `exports` is importable.)
|
|
22
|
+
|
|
23
|
+
This is the same pattern as `svelte/internal` and `@angular/core/testing`:
|
|
24
|
+
shipped, importable, but not part of the supported API.
|
|
25
|
+
|
|
26
|
+
## Stability
|
|
27
|
+
|
|
28
|
+
**No semver guarantees.** Don't import `@bonsae/nrg-runtime/internal/*` directly
|
|
29
|
+
in your own code — use the documented `@bonsae/nrg/test/*` utilities instead.
|
|
30
|
+
These entry points can change in any release.
|