@camera.ui/cli 0.0.15 → 0.0.17

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.
@@ -20,16 +20,12 @@ export function sortDependencies(packageJson) {
20
20
  export function sortScripts(packageJson) {
21
21
  const sorted = {};
22
22
  if (packageJson.scripts) {
23
- sorted.scripts = {};
24
23
  Object.keys(packageJson.scripts)
25
24
  .sort()
26
25
  .forEach((name) => {
27
- sorted.scripts[name] = packageJson.scripts[name];
26
+ sorted[name] = packageJson.scripts[name];
28
27
  });
29
28
  }
30
- return {
31
- ...packageJson,
32
- ...sorted,
33
- };
29
+ return sorted;
34
30
  }
35
31
  //# sourceMappingURL=sort.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sort.js","sourceRoot":"","sources":["../../src/utils/sort.ts"],"names":[],"mappings":"AAAA,yHAAyH;AACzH,MAAM,UAAU,gBAAgB,CAAC,WAAgC;IAC/D,MAAM,MAAM,GAAwB,EAAE,CAAC;IAEvC,MAAM,QAAQ,GAAG,CAAC,cAAc,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,CAAC,CAAC;IAEjG,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;YAErB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;iBAC9B,IAAI,EAAE;iBACN,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;gBAChB,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC,CAAC,CAAC;QACP,CAAC;IACH,CAAC;IAED,OAAO;QACL,GAAG,WAAW;QACd,GAAG,MAAM;KACV,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,W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MAAM,GAAwB,EAAE,CAAC;IAEvC,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;QACxB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;aAC7B,IAAI,EAAE;aACN,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAChB,MAAM,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACP,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camera.ui/cli",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "camera.ui cli",
5
5
  "type": "module",
6
6
  "bin": {
@@ -45,7 +45,7 @@
45
45
  "@stylistic/eslint-plugin": "^2.9.0",
46
46
  "@types/adm-zip": "^0.5.5",
47
47
  "@types/fs-extra": "^11.0.4",
48
- "@types/node": "^22.7.9",
48
+ "@types/node": "^22.8.0",
49
49
  "@types/prompts": "^2.4.9",
50
50
  "@types/semver": "^7.5.8",
51
51
  "@typescript-eslint/parser": "^8.11.0",
@@ -4,53 +4,191 @@
4
4
 
5
5
  # {{projectName}}
6
6
 
7
+ A plugin for [camera.ui](https://github.com/SeydX/camera.ui) that allows you to extend the functionality of your camera system.
8
+
9
+ ## Setup Development Environment
10
+
11
+ 1. Make sure you have [Node.js](https://nodejs.org) 20.x or later installed
12
+ 2. Install dependencies as described below
13
+
14
+ ## Install Development Dependencies
15
+
16
+ Install Node dependencies:
17
+ ```bash
18
+ npm install
19
+ ```
20
+
21
+ For Python plugins, also install Python dependencies:
22
+ ```bash
23
+ pip install -r requirements.txt
24
+ pip install -r requirements.dev.txt
25
+ ```
26
+
27
+ Note: Create a virtual environment for Python plugins to avoid conflicts with system packages.
28
+
29
+ ## Update package.json
30
+
31
+ Open the [`package.json`](./package.json) and customize the following attributes:
32
+
33
+ - `name` - Must be prefixed with `camera-ui-` or `@username/camera-ui-` (e.g., `camera-ui-motion` or `@john/camera-ui-motion`)
34
+ - `displayName` - The user-friendly name shown in the camera.ui interface
35
+ - `description` - A short description of your plugin's functionality
36
+ - `author` - Your name and email address
37
+ - `homepage` - Link to your plugin's README.md
38
+ - `repository.url` - Link to your GitHub repository
39
+ - `bugs.url` - Link to your GitHub issues page
40
+
41
+ Set `private` to `false` when you're ready to publish.
42
+
43
+ ## Config Schema
44
+
45
+ The plugin configuration is defined in `config.schema.json`. This schema defines the configuration options available to users.
46
+
47
+ Example schema:
48
+ ```json
49
+ {
50
+ "schema": {
51
+ "items": {
52
+ "type": "object",
53
+ "title": "Remove Models",
54
+ "opened": true,
55
+ "properties": {
56
+ "model": {
57
+ "type": "string",
58
+ "title": "Model",
59
+ "description": "Model to use for object detection",
60
+ "required": true,
61
+ "store": false,
62
+ "defaultValue": "yolov9m_320 - FP16",
63
+ "enum": [
64
+ "yolo3-tinyu - INT8",
65
+ "yolo3-tinyu_320 - INT8",
66
+ "yolo3-tinyu - FP16",
67
+ "yolo3-tinyu_320 - FP16",
68
+ "yolov5nu - INT8",
69
+ "yolov5nu_320 - INT8",
70
+ "yolov5mu - INT8",
71
+ "yolov5mu_320 - INT8"
72
+ ]
73
+ }
74
+ },
75
+ "buttons": [
76
+ {
77
+ "label": "Remove",
78
+ "onSubmit": "onRemove"
79
+ }
80
+ ]
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ ## Bundle Plugin
87
+
88
+ To create a production bundle of your plugin:
89
+
90
+ ```bash
91
+ npm run bundle
92
+ ```
93
+
94
+ This will:
95
+ 1. Run code quality checks (if enabled)
96
+ 2. Build the source code
97
+ 3. Copy required files
98
+ 4. Create a distributable bundle.zip
99
+
100
+ The bundled plugin will be available in the `bundle` directory.
101
+
102
+ ## Watch For Changes and Build Automatically
103
+
7
104
  // TODO
8
105
 
9
- ### Setup Development Environment
106
+ ## Customize Plugin
10
107
 
11
- // TODO:
108
+ ### JavaScript/TypeScript Plugins
12
109
 
13
- ### Install Development Dependencies
110
+ The main entry point is `src/index.ts` (or `src/index.js`). Here you can define your plugin's functionality:
14
111
 
15
- // TODO
112
+ ```typescript
113
+ import type { BasePlugin, LoggerService, PluginAPI } from '@camera.ui/types';
16
114
 
17
- ### Update package.json
115
+ export default class SamplePlugin implements BasePlugin {
116
+ constructor(logger: LoggerService, api: PluginAPI) {
117
+ ...
118
+ }
119
+ }
120
+ ```
18
121
 
19
- Open the [`package.json`](./package.json) and change the following attributes:
122
+ ### Python Plugins
20
123
 
21
- - `name` - this should be prefixed with `camera-ui-` or `@username/camera-ui-`, is case-sensitive, and contains no spaces nor special characters apart from a dash `-`
22
- - `displayName` - this is the "nice" name displayed in the camera.ui interface
23
- - `author` - this should be your name and email address
24
- - `homepage` - link to your GitHub repo's `README.md`
25
- - `repository.url` - link to your GitHub repo
26
- - `bugs.url` - link to your GitHub repo issues page
124
+ The main entry point is `src/main.py`. Example:
27
125
 
28
- When you are ready to publish the plugin you should set `private` to false, or remove the attribute entirely.
126
+ ```python
127
+ from camera_ui_python_types import (
128
+ BasePlugin,
129
+ LoggerService,
130
+ PluginAPI,
131
+ )
29
132
 
30
- ### Config Schema
133
+ class SamplePlugin(BasePlugin):
134
+ def __init__(self, logger: LoggerService, api: PluginAPI):
135
+ ...
31
136
 
32
- // TODO
137
+ def __main__():
138
+ return SamplePlugin
139
+ ```
33
140
 
34
- ### Bundle Plugin
141
+ ## Publish Package
35
142
 
36
- // TODO
143
+ When your plugin is ready for release:
37
144
 
38
- ### Watch For Changes and Build Automatically
145
+ 1. Make sure all tests pass and the bundle builds successfully
146
+ 2. Choose the appropriate publishing command:
147
+ ```bash
148
+ # For alpha releases
149
+ npm run publish:alpha
39
150
 
40
- // TODO
151
+ # For beta releases
152
+ npm run publish:beta
41
153
 
42
- ### Customise Plugin
154
+ # For stable releases
155
+ npm run publish:latest
156
+ ```
43
157
 
44
- // TODO
158
+ The CLI will guide you through version selection and publishing.
45
159
 
46
- ### Publish Package
160
+ ## Best Practices
47
161
 
48
- // TODO
162
+ 1. **Version Management**
163
+ - Use semantic versioning (MAJOR.MINOR.PATCH)
164
+ - Start with alpha/beta releases for testing
165
+ - Document breaking changes
49
166
 
50
- ### Best Practices
167
+ 2. **Code Quality**
168
+ - Enable and use the provided linting tools
169
+ - Write clear documentation
170
+ - Include usage examples
51
171
 
52
- // TODO
172
+ 3. **Configuration**
173
+ - Provide sensible defaults
174
+ - Validate user input
175
+ - Document all options
176
+
177
+ 4. **Testing**
178
+ - Test with different camera.ui versions
179
+ - Verify all configuration options
180
+ - Test error handling
181
+
182
+ 5. **Performance**
183
+ - Minimize dependencies
184
+ - Optimize resource usage
185
+ - Handle cleanup properly
53
186
 
54
- ### Useful Links
187
+ ## Useful Links
55
188
 
56
- // TODO
189
+ - [camera.ui Documentation](https://github.com/SeydX/camera.ui/wiki)
190
+ - [Plugin Development Guide](https://github.com/SeydX/camera.ui/wiki/plugins)
191
+ - [JSON Schema Documentation](https://json-schema.org/)
192
+ - [Node.js Documentation](https://nodejs.org/docs)
193
+ - [TypeScript Documentation](https://www.typescriptlang.org/docs/)
194
+ - [Python Documentation](https://docs.python.org/)