@camera.ui/cli 0.0.1

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 (59) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/CONTRIBUTING.md +1 -0
  3. package/LICENSE.md +22 -0
  4. package/README.md +1 -0
  5. package/dist/commands/build.d.ts +1 -0
  6. package/dist/commands/build.js +158 -0
  7. package/dist/commands/build.js.map +1 -0
  8. package/dist/commands/create.d.ts +1 -0
  9. package/dist/commands/create.js +130 -0
  10. package/dist/commands/create.js.map +1 -0
  11. package/dist/commands/publish.d.ts +2 -0
  12. package/dist/commands/publish.js +128 -0
  13. package/dist/commands/publish.js.map +1 -0
  14. package/dist/index.d.ts +2 -0
  15. package/dist/index.js +33 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/types.d.ts +23 -0
  18. package/dist/types.js +2 -0
  19. package/dist/types.js.map +1 -0
  20. package/dist/utils/banners.d.ts +2 -0
  21. package/dist/utils/banners.js +19 -0
  22. package/dist/utils/banners.js.map +1 -0
  23. package/dist/utils/logger.d.ts +24 -0
  24. package/dist/utils/logger.js +91 -0
  25. package/dist/utils/logger.js.map +1 -0
  26. package/dist/utils/parser.d.ts +6 -0
  27. package/dist/utils/parser.js +151 -0
  28. package/dist/utils/parser.js.map +1 -0
  29. package/dist/utils/pjson.d.ts +2 -0
  30. package/dist/utils/pjson.js +10 -0
  31. package/dist/utils/pjson.js.map +1 -0
  32. package/dist/utils/pluginName.d.ts +6 -0
  33. package/dist/utils/pluginName.js +21 -0
  34. package/dist/utils/pluginName.js.map +1 -0
  35. package/dist/utils/sortDependencies.d.ts +1 -0
  36. package/dist/utils/sortDependencies.js +20 -0
  37. package/dist/utils/sortDependencies.js.map +1 -0
  38. package/dist/utils/templates.d.ts +7 -0
  39. package/dist/utils/templates.js +162 -0
  40. package/dist/utils/templates.js.map +1 -0
  41. package/dist/utils/utils.d.ts +10 -0
  42. package/dist/utils/utils.js +71 -0
  43. package/dist/utils/utils.js.map +1 -0
  44. package/package.json +74 -0
  45. package/templates/base/CHANGELOG.md +8 -0
  46. package/templates/base/CONTRIBUTING.md +1 -0
  47. package/templates/base/LICENSE.md +22 -0
  48. package/templates/base/README.md +1 -0
  49. package/templates/base/SECURITY.md +16 -0
  50. package/templates/base/config.schema.json +0 -0
  51. package/templates/base/package.eslint.json +4 -0
  52. package/templates/base/package.json +23 -0
  53. package/templates/base/package.prettier.json +3 -0
  54. package/templates/python/requirements.dev.txt +1 -0
  55. package/templates/python/requirements.txt +1 -0
  56. package/templates/python/src/main.py +56 -0
  57. package/templates/typescript/package.eslint.json +4 -0
  58. package/templates/typescript/package.json +6 -0
  59. package/templates/typescript/src/index.ts +45 -0
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@camera.ui/cli",
3
+ "version": "0.0.1",
4
+ "description": "camera.ui cli",
5
+ "type": "module",
6
+ "bin": {
7
+ "cui": "dist/index.js"
8
+ },
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/types.d.ts",
12
+ "require": "./dist/types.d.ts",
13
+ "default": "./dist/types.d.ts"
14
+ }
15
+ },
16
+ "scripts": {
17
+ "build": "rimraf dist && tsc",
18
+ "format": "prettier --write 'src/' --ignore-unknown --no-error-on-unmatched-pattern",
19
+ "lint": "eslint --fix .",
20
+ "update": "updates --update ./",
21
+ "install-updates": "npm i --save",
22
+ "prepublishOnly": "npm i --package-lock-only && npm run lint && npm run format && npm run build"
23
+ },
24
+ "dependencies": {
25
+ "@rollup/plugin-commonjs": "^28.0.1",
26
+ "@rollup/plugin-json": "^6.1.0",
27
+ "@rollup/plugin-node-resolve": "^15.3.0",
28
+ "@rollup/plugin-terser": "^0.4.4",
29
+ "@rollup/plugin-typescript": "^12.1.1",
30
+ "adm-zip": "^0.5.16",
31
+ "chalk": "^5.3.0",
32
+ "commander": "^12.1.0",
33
+ "fs-extra": "^11.2.0",
34
+ "gradient-string": "^3.0.0",
35
+ "inquirer": "^12.0.0",
36
+ "ora": "^8.1.0",
37
+ "prompts": "^2.4.2",
38
+ "rollup": "^4.24.0",
39
+ "semver": "^7.6.3",
40
+ "ts-import": "^5.0.0-beta.0",
41
+ "ts-node": "^10.9.2"
42
+ },
43
+ "devDependencies": {
44
+ "@camera.ui/types": "file:../types",
45
+ "@stylistic/eslint-plugin": "^2.9.0",
46
+ "@types/adm-zip": "^0.5.5",
47
+ "@types/fs-extra": "^11.0.4",
48
+ "@types/node": "^22.7.9",
49
+ "@types/prompts": "^2.4.9",
50
+ "@types/semver": "^7.5.8",
51
+ "@typescript-eslint/parser": "^8.11.0",
52
+ "eslint": "^9.13.0",
53
+ "globals": "^15.11.0",
54
+ "prettier": "^3.3.3",
55
+ "rimraf": "^6.0.1",
56
+ "typescript": "^5.6.3",
57
+ "typescript-eslint": "^8.11.0",
58
+ "updates": "^16.4.0"
59
+ },
60
+ "author": "seydx (https://github.com/seydx/camera.ui)",
61
+ "bugs": {
62
+ "url": "https://github.com/seydx/camera.ui/issues"
63
+ },
64
+ "homepage": "https://github.com/seydx/camera.ui#readme",
65
+ "license": "MIT",
66
+ "repository": {
67
+ "type": "git",
68
+ "url": "git+https://github.com/seydx/camera.ui.git"
69
+ },
70
+ "keywords": [
71
+ "camera.ui",
72
+ "cli"
73
+ ]
74
+ }
@@ -0,0 +1,8 @@
1
+ All notable changes to this project will be documented in this file.
2
+
3
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
+
6
+ ## [X.X.X] - ???
7
+
8
+ - Initial Release
@@ -0,0 +1 @@
1
+ # Contributing
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) - NAME
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ # {{projectName}}
@@ -0,0 +1,16 @@
1
+ # Security Policy
2
+
3
+ ## Reporting a Vulnerability
4
+
5
+ We want to ensure camera.ui is secure for everyone. If you've discovered a security vulnerability,
6
+ we appreciate your help in disclosing it to us in a [responsible manner][link-responsible-disclosure].
7
+
8
+ Publicly disclosing a vulnerability can put the entire community at risk. If you've discovered a security concern,
9
+ please send us a [mail](mailto:dev@seydx.com).
10
+ We'll work with you to make sure we understand the scope of the issue, and that we fully address your concern.
11
+ We consider correspondence sent to this email address our highest priority,
12
+ and work to address any issues that arise as quickly as possible.
13
+
14
+ After a security vulnerability has been corrected, a security hotfix release will be deployed as soon as possible.
15
+
16
+ [link-responsible-disclosure]: http://en.wikipedia.org/wiki/Responsible_disclosure
File without changes
@@ -0,0 +1,4 @@
1
+ {
2
+ "eslint": "^9.13.0",
3
+ "globals": "^15.11.0"
4
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "displayName": "",
3
+ "name": "",
4
+ "version": "0.0.1",
5
+ "description": "camera.ui plugin",
6
+ "type": "module",
7
+ "main": "",
8
+ "scripts": {},
9
+ "dependencies": {},
10
+ "devDependencies": {
11
+ "@camera.ui/cli": "^0.0.1",
12
+ "updates": "^16.4.0"
13
+ },
14
+ "engines": {
15
+ "camera.ui": ">=0.0.34-alpha.2",
16
+ "node": ">=20.17.0"
17
+ },
18
+ "keywords": [
19
+ "camera-ui-plugin"
20
+ ],
21
+ "license": "MIT",
22
+ "camera.ui": {}
23
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "prettier": "^3.3.3"
3
+ }
@@ -0,0 +1 @@
1
+ ruff==0.7.1
@@ -0,0 +1 @@
1
+ camera-ui-python-types==0.1.96
@@ -0,0 +1,56 @@
1
+ from typing import Any, Union
2
+
3
+ from camera_ui_python_types import (
4
+ BasePlugin,
5
+ CameraDevice,
6
+ CameraExtension,
7
+ FormSubmitResponse,
8
+ LoggerService,
9
+ PluginAPI,
10
+ )
11
+
12
+
13
+ class SamplePlugin(BasePlugin):
14
+ def __init__(self, logger: LoggerService, api: PluginAPI):
15
+ self.api = api
16
+ self.logger = logger
17
+ self.cameras: dict[str, CameraDevice] = {}
18
+ self.model = None
19
+
20
+ self.api.on("finishLaunching", self.start)
21
+ self.api.on("shutdown", self.stop)
22
+
23
+ self.api.device_manager.on("cameraSelected", self.camera_selected)
24
+ self.api.device_manager.on("cameraDeselected", self.camera_deselected)
25
+
26
+ async def camera_selected(self, camera: CameraDevice, extension: CameraExtension) -> None:
27
+ self.logger.log(f"Camera selected: {camera.name}")
28
+
29
+ if camera.id in self.cameras:
30
+ return
31
+
32
+ self.cameras[camera.id] = camera
33
+
34
+ def camera_deselected(self, id: str, extension: CameraExtension) -> None:
35
+ camera = self.cameras.get(id)
36
+
37
+ if camera:
38
+ self.logger.log(f"Camera deselected: {self.cameras[id].name}")
39
+ del self.cameras[id]
40
+
41
+ def start(self) -> None:
42
+ self.logger.log("Plugin Started")
43
+
44
+ def stop(self) -> None:
45
+ self.logger.log("Plugin Stopped")
46
+
47
+ async def onFormSubmit(self, action_id: str, payload: Any) -> Union[FormSubmitResponse, None]:
48
+ print("Form submitted", action_id, payload)
49
+
50
+ def configureCameras(self, cameras: list[CameraDevice]) -> None:
51
+ for camera in cameras:
52
+ self.cameras[camera.id] = camera
53
+
54
+
55
+ def __main__():
56
+ return SamplePlugin
@@ -0,0 +1,4 @@
1
+ {
2
+ "@typescript-eslint/parser": "^8.11.0",
3
+ "typescript-eslint": "^8.11.0"
4
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "@camera.ui/types": "^0.0.77",
3
+ "@types/node": "^22.7.6",
4
+ "rimraf": "^6.0.1",
5
+ "typescript": "^5.6.3"
6
+ }
@@ -0,0 +1,45 @@
1
+ import type { BasePlugin, CameraDevice, FormSubmitResponse, LoggerService, PluginAPI } from '@camera.ui/types';
2
+
3
+ export default class SamplePlugin implements BasePlugin {
4
+ public logger: LoggerService;
5
+ public api: PluginAPI;
6
+
7
+ private cameras = new Map<string, CameraDevice>();
8
+
9
+ constructor(logger: LoggerService, api: PluginAPI) {
10
+ this.logger = logger;
11
+ this.api = api;
12
+
13
+ this.api.on('finishLaunching', this.start.bind(this));
14
+ this.api.on('shutdown', this.stop.bind(this));
15
+
16
+ this.api.deviceManager.on('cameraSelected', (cameraDevice: CameraDevice) => {
17
+ this.logger.log('Camera selected:', cameraDevice.name);
18
+
19
+ if (!this.cameras.has(cameraDevice.id)) {
20
+ this.cameras.set(cameraDevice.id, cameraDevice);
21
+ }
22
+ });
23
+
24
+ this.api.deviceManager.on('cameraDeselected', (cameraId: string) => {
25
+ const cameraDevice = this.cameras.get(cameraId);
26
+ if (cameraDevice) {
27
+ this.logger.log('Camera deselected:', cameraDevice.name);
28
+ this.cameras.delete(cameraId);
29
+ }
30
+ });
31
+ }
32
+
33
+ public configureCameras(): void {}
34
+
35
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
36
+ public async onFormSubmit(actionId: string, payload: any): Promise<FormSubmitResponse | void> {}
37
+
38
+ private async start(): Promise<void> {
39
+ this.logger.log('Plugin started');
40
+ }
41
+
42
+ private stop(): void {
43
+ this.logger.log('Plugin stopped');
44
+ }
45
+ }