@bonsae/nrg 0.21.1 → 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 +2 -3
- package/package.json +14 -9
- package/schemas/labels.schema.json +15 -5
- package/server/index.cjs +2 -1346
- package/test/client/component/index.js +41 -224
- package/test/client/component/setup.js +201 -1475
- package/test/client/e2e/config.js +12 -0
- package/test/client/e2e/index.js +422 -199
- package/test/client/unit/index.js +19 -32
- package/test/client/unit/setup.js +28 -21
- package/test/server/integration/index.js +2 -26
- package/test/server/unit/index.js +2 -184
- package/types/client.d.ts +1 -259
- package/types/server.d.ts +1 -892
- package/types/test-client-component.d.ts +7 -143
- package/types/test-client-e2e.d.ts +0 -6
- package/types/test-client-unit.d.ts +11 -105
- package/types/test-server-integration.d.ts +73 -49
- package/types/test-server-unit.d.ts +26 -2
- package/types/vite.d.ts +2 -0
- package/vite/index.js +381 -150
- package/server/resources/nrg-client.js +0 -7495
- package/test/client/component/nrg.css +0 -1
- package/types/shims/brands.d.ts +0 -32
- package/types/shims/client/form/components/node-red-config-input.vue.d.ts +0 -125
- package/types/shims/client/form/components/node-red-editor-input.vue.d.ts +0 -124
- package/types/shims/client/form/components/node-red-input-label.vue.d.ts +0 -34
- package/types/shims/client/form/components/node-red-input.vue.d.ts +0 -123
- package/types/shims/client/form/components/node-red-json-schema-form.vue.d.ts +0 -772
- package/types/shims/client/form/components/node-red-select-input.vue.d.ts +0 -132
- package/types/shims/client/form/components/node-red-toggle.vue.d.ts +0 -36
- package/types/shims/client/form/components/node-red-typed-input.vue.d.ts +0 -151
- package/types/shims/client/globals.d.ts +0 -320
- package/types/shims/client/types.d.ts +0 -220
- package/types/shims/components.d.ts +0 -23
- package/types/shims/constants.d.ts +0 -4
- package/types/shims/schema-options.d.ts +0 -24
- package/types/shims/shims-vue.d.ts +0 -5
- package/types/shims/typebox.d.ts +0 -10
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
CHANGED
|
@@ -19,11 +19,10 @@ Build Node-RED nodes with Vue 3, TypeScript, JSON Schema validations, Vite and V
|
|
|
19
19
|
## Quick Start
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
pnpm add @bonsae/nrg
|
|
23
|
-
pnpm add -D vite vue node-red
|
|
22
|
+
pnpm add -D @bonsae/nrg node-red vue vite vitest
|
|
24
23
|
```
|
|
25
24
|
|
|
26
|
-
>
|
|
25
|
+
> All of these are dev dependencies — they are only needed at build time. `@bonsae/nrg` is the authoring toolkit; a built node depends only on `@bonsae/nrg-runtime` (declared automatically in the generated `dist/package.json`), never the toolkit. Vue is included as a dependency of the runtime and served automatically to the editor.
|
|
27
26
|
|
|
28
27
|
### Node-RED Resolution
|
|
29
28
|
|
package/package.json
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonsae/nrg",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "NRG framework — build Node-RED nodes with Vue 3, TypeScript, and JSON Schema",
|
|
5
5
|
"author": "Allan Oricil <allanoricil@duck.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"homepage": "https://bonsaedev.github.io/nrg/",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/bonsaedev/nrg/issues"
|
|
11
|
+
},
|
|
9
12
|
"repository": {
|
|
10
|
-
"url": "https://github.com/bonsaedev/nrg",
|
|
11
|
-
"type": "git"
|
|
13
|
+
"url": "git+https://github.com/bonsaedev/nrg.git",
|
|
14
|
+
"type": "git",
|
|
15
|
+
"directory": "packages/toolkit"
|
|
12
16
|
},
|
|
13
17
|
"publishConfig": {
|
|
14
18
|
"access": "public"
|
|
@@ -73,6 +77,7 @@
|
|
|
73
77
|
"types": "./types/test-client-e2e.d.ts",
|
|
74
78
|
"default": "./test/client/e2e/index.js"
|
|
75
79
|
},
|
|
80
|
+
"./test/client/e2e/config": "./test/client/e2e/config.js",
|
|
76
81
|
"./tsconfig/base.json": "./tsconfig/base.json",
|
|
77
82
|
"./tsconfig/core/server.json": "./tsconfig/core/server.json",
|
|
78
83
|
"./tsconfig/core/client.json": "./tsconfig/core/client.json",
|
|
@@ -86,6 +91,7 @@
|
|
|
86
91
|
"@vitest/browser-playwright": "^4.0.0",
|
|
87
92
|
"@vitest/coverage-istanbul": "^4.0.0",
|
|
88
93
|
"@vitest/coverage-v8": "^4.0.0",
|
|
94
|
+
"happy-dom": "^20.0.0",
|
|
89
95
|
"playwright": "^1.50.0",
|
|
90
96
|
"vite": "^6.0.0",
|
|
91
97
|
"vitest": "^4.0.0",
|
|
@@ -93,6 +99,9 @@
|
|
|
93
99
|
"vue": "^3.5.14"
|
|
94
100
|
},
|
|
95
101
|
"peerDependenciesMeta": {
|
|
102
|
+
"happy-dom": {
|
|
103
|
+
"optional": true
|
|
104
|
+
},
|
|
96
105
|
"@vitest/coverage-istanbul": {
|
|
97
106
|
"optional": true
|
|
98
107
|
},
|
|
@@ -110,10 +119,10 @@
|
|
|
110
119
|
}
|
|
111
120
|
},
|
|
112
121
|
"dependencies": {
|
|
122
|
+
"@bonsae/nrg-runtime": "0.22.0",
|
|
113
123
|
"@clack/prompts": "^1.0.1",
|
|
114
124
|
"@sinclair/typebox": "^0.34.33",
|
|
115
125
|
"@vitejs/plugin-vue": "^5.2.3",
|
|
116
|
-
"@vitest/browser-playwright": "^4.1.5",
|
|
117
126
|
"ajv": "^8.17.1",
|
|
118
127
|
"ajv-errors": "^3.0.0",
|
|
119
128
|
"ajv-formats": "^3.0.1",
|
|
@@ -122,15 +131,11 @@
|
|
|
122
131
|
"es-toolkit": "^1.37.2",
|
|
123
132
|
"esbuild": "^0.25.4",
|
|
124
133
|
"get-port": "^7.1.0",
|
|
125
|
-
"happy-dom": "^20.10.2",
|
|
126
134
|
"jsonpointer": "^5.0.1",
|
|
127
135
|
"mime-types": "^3.0.1",
|
|
128
|
-
"playwright": "^1.60.0",
|
|
129
136
|
"tree-kill": "^1.2.2",
|
|
130
137
|
"typescript": "^5.8.3",
|
|
131
138
|
"vite-plugin-dts": "^4.5.4",
|
|
132
|
-
"vite-plugin-static-copy": "^3.1.0",
|
|
133
|
-
"vitest-browser-vue": "^2.1.0",
|
|
134
139
|
"vue": "^3.5.14"
|
|
135
140
|
}
|
|
136
|
-
}
|
|
141
|
+
}
|
|
@@ -44,11 +44,14 @@
|
|
|
44
44
|
"description": "Labels for input schema properties"
|
|
45
45
|
},
|
|
46
46
|
"outputs": {
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
"oneOf": [
|
|
48
|
+
{
|
|
49
|
+
"type": "array",
|
|
50
|
+
"items": { "$ref": "#/$defs/labelMap" }
|
|
51
|
+
},
|
|
52
|
+
{ "$ref": "#/$defs/portLabelMap" }
|
|
53
|
+
],
|
|
54
|
+
"description": "Per-port output labels. Use an array (matching outputsSchema order; a single output uses a one-element array) for positional outputs, or an object keyed by port name for named outputs."
|
|
52
55
|
},
|
|
53
56
|
"errors": {
|
|
54
57
|
"$ref": "#/$defs/labelMap",
|
|
@@ -63,6 +66,13 @@
|
|
|
63
66
|
"type": "string"
|
|
64
67
|
},
|
|
65
68
|
"description": "Maps property keys to human-readable labels"
|
|
69
|
+
},
|
|
70
|
+
"portLabelMap": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"additionalProperties": {
|
|
73
|
+
"$ref": "#/$defs/labelMap"
|
|
74
|
+
},
|
|
75
|
+
"description": "Maps output port names to their per-property labels (named output ports)"
|
|
66
76
|
}
|
|
67
77
|
}
|
|
68
78
|
}
|