openc3 7.5.1 → 7.6.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.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -0
  3. data/bin/openc3cli +82 -5
  4. data/data/config/_params.yaml +3 -0
  5. data/data/config/command_modifiers.yaml +5 -3
  6. data/data/config/default_plugins.yaml +1 -0
  7. data/data/config/interface_modifiers.yaml +17 -1
  8. data/data/config/item_modifiers.yaml +24 -1
  9. data/data/config/microservice.yaml +15 -1
  10. data/data/config/parameter_modifiers.yaml +4 -4
  11. data/data/config/plugins.yaml +511 -3
  12. data/data/config/settings.yaml +17 -0
  13. data/data/config/target.yaml +53 -0
  14. data/data/config/telemetry.yaml +58 -2
  15. data/data/config/widgets.yaml +30 -0
  16. data/lib/openc3/accessors/accessor.rb +14 -2
  17. data/lib/openc3/accessors/binary_accessor.rb +25 -5
  18. data/lib/openc3/api/CLAUDE.md +1 -0
  19. data/lib/openc3/api/api.rb +1 -0
  20. data/lib/openc3/api/cmd_api.rb +9 -1
  21. data/lib/openc3/api/interface_api.rb +7 -2
  22. data/lib/openc3/api/limits_api.rb +93 -41
  23. data/lib/openc3/api/router_api.rb +7 -2
  24. data/lib/openc3/api/settings_api.rb +4 -1
  25. data/lib/openc3/api/shared_resource_api.rb +107 -0
  26. data/lib/openc3/api/tlm_api.rb +10 -0
  27. data/lib/openc3/interfaces/http_client_interface.rb +84 -27
  28. data/lib/openc3/interfaces/protocols/preidentified_protocol.rb +6 -2
  29. data/lib/openc3/interfaces/tcpip_server_interface.rb +205 -125
  30. data/lib/openc3/io/json_api.rb +2 -10
  31. data/lib/openc3/io/json_api_object.rb +2 -10
  32. data/lib/openc3/logs/packet_log_writer.rb +8 -3
  33. data/lib/openc3/microservices/decom_common.rb +4 -1
  34. data/lib/openc3/microservices/decom_microservice.rb +52 -6
  35. data/lib/openc3/microservices/interface_decom_common.rb +13 -0
  36. data/lib/openc3/microservices/interface_microservice.rb +50 -11
  37. data/lib/openc3/microservices/limits_group_microservice.rb +513 -0
  38. data/lib/openc3/microservices/log_microservice.rb +22 -8
  39. data/lib/openc3/microservices/microservice.rb +8 -2
  40. data/lib/openc3/microservices/multi_microservice.rb +76 -22
  41. data/lib/openc3/microservices/queue_microservice.rb +29 -24
  42. data/lib/openc3/migrations/20260704000000_default_bridge.rb +1 -2
  43. data/lib/openc3/migrations/20261103000001_limits_group_backfill.rb +193 -0
  44. data/lib/openc3/models/bridge_model.rb +3 -3
  45. data/lib/openc3/models/cvt_model.rb +3 -1
  46. data/lib/openc3/models/host_interface_microservice_model.rb +4 -4
  47. data/lib/openc3/models/interface_model.rb +27 -7
  48. data/lib/openc3/models/microservice_group.rb +167 -0
  49. data/lib/openc3/models/microservice_model.rb +88 -2
  50. data/lib/openc3/models/panel_model.rb +109 -0
  51. data/lib/openc3/models/plugin_model.rb +1006 -26
  52. data/lib/openc3/models/plugin_store_model.rb +6 -1
  53. data/lib/openc3/models/protected_storage_model.rb +64 -0
  54. data/lib/openc3/models/queue_model.rb +19 -10
  55. data/lib/openc3/models/scope_model.rb +80 -3
  56. data/lib/openc3/models/setting_model.rb +2 -2
  57. data/lib/openc3/models/shared_resource_model.rb +381 -0
  58. data/lib/openc3/models/target_model.rb +324 -68
  59. data/lib/openc3/operators/microservice_operator.rb +76 -9
  60. data/lib/openc3/operators/operator.rb +29 -0
  61. data/lib/openc3/packets/commands.rb +16 -16
  62. data/lib/openc3/packets/limits.rb +2 -0
  63. data/lib/openc3/packets/packet.rb +75 -4
  64. data/lib/openc3/packets/packet_config.rb +152 -13
  65. data/lib/openc3/packets/packet_item.rb +35 -14
  66. data/lib/openc3/packets/packet_item_limits.rb +67 -6
  67. data/lib/openc3/packets/parsers/limits_parser.rb +69 -2
  68. data/lib/openc3/packets/parsers/packet_item_parser.rb +6 -0
  69. data/lib/openc3/packets/parsers/packet_parser.rb +45 -0
  70. data/lib/openc3/packets/parsers/state_parser.rb +1 -1
  71. data/lib/openc3/script/CLAUDE.md +1 -0
  72. data/lib/openc3/script/api_shared.rb +17 -9
  73. data/lib/openc3/script/calendar.rb +18 -6
  74. data/lib/openc3/script/commands.rb +11 -9
  75. data/lib/openc3/script/critical_cmd.rb +22 -2
  76. data/lib/openc3/script/metadata.rb +30 -4
  77. data/lib/openc3/script/plugins.rb +8 -0
  78. data/lib/openc3/script/script.rb +8 -24
  79. data/lib/openc3/script/web_socket_api.rb +23 -17
  80. data/lib/openc3/system/system.rb +9 -3
  81. data/lib/openc3/top_level.rb +17 -0
  82. data/lib/openc3/topics/command_topic.rb +7 -1
  83. data/lib/openc3/topics/decom_interface_topic.rb +9 -3
  84. data/lib/openc3/topics/discovery_topic.rb +84 -0
  85. data/lib/openc3/topics/limits_event_topic.rb +236 -17
  86. data/lib/openc3/topics/telemetry_decom_topic.rb +12 -3
  87. data/lib/openc3/topics/topic.rb +2 -1
  88. data/lib/openc3/utilities/authentication.rb +67 -16
  89. data/lib/openc3/utilities/cli_generator.rb +117 -25
  90. data/lib/openc3/utilities/client_ip_header_filter.rb +38 -0
  91. data/lib/openc3/utilities/config_overlay.rb +24 -1
  92. data/lib/openc3/utilities/cosmos_rails_formatter.rb +18 -10
  93. data/lib/openc3/utilities/hardware_discovery.rb +279 -0
  94. data/lib/openc3/utilities/limits_rollup.rb +81 -0
  95. data/lib/openc3/utilities/local_mode.rb +48 -5
  96. data/lib/openc3/utilities/questdb_client.rb +130 -22
  97. data/lib/openc3/utilities/reingest_job.rb +12 -3
  98. data/lib/openc3/utilities/running_script.rb +206 -49
  99. data/lib/openc3/utilities/script.rb +24 -12
  100. data/lib/openc3/utilities/script_env.rb +164 -0
  101. data/lib/openc3/utilities/script_message_signing.rb +133 -0
  102. data/lib/openc3/utilities/store_autoload.rb +32 -1
  103. data/lib/openc3/utilities/store_queued.rb +5 -1
  104. data/lib/openc3/version.rb +6 -6
  105. data/templates/command_validator/command_validator.py +9 -9
  106. data/templates/{tool_react/pnpm-workspace.yaml → panel/.prettierrc.cjs} +7 -5
  107. data/templates/panel/Rakefile +24 -0
  108. data/templates/panel/package.json +17 -0
  109. data/templates/{tool_angular → panel}/pnpm-workspace.yaml +5 -0
  110. data/templates/panel/src/Panel.js +52 -0
  111. data/templates/panel/src/Panel.vue +60 -0
  112. data/templates/panel/src/panelSdk.js +24 -0
  113. data/templates/panel/vite-Panel.config.js +43 -0
  114. data/templates/tool_vue/package.json +3 -3
  115. data/templates/widget/package.json +2 -2
  116. metadata +24 -56
  117. data/templates/tool_angular/.editorconfig +0 -16
  118. data/templates/tool_angular/.gitignore +0 -44
  119. data/templates/tool_angular/.vscode/extensions.json +0 -4
  120. data/templates/tool_angular/.vscode/launch.json +0 -20
  121. data/templates/tool_angular/.vscode/tasks.json +0 -42
  122. data/templates/tool_angular/angular.json +0 -111
  123. data/templates/tool_angular/extra-webpack.config.js +0 -8
  124. data/templates/tool_angular/package.json +0 -48
  125. data/templates/tool_angular/src/app/app-routing.module.ts +0 -15
  126. data/templates/tool_angular/src/app/app.component.html +0 -22
  127. data/templates/tool_angular/src/app/app.component.scss +0 -18
  128. data/templates/tool_angular/src/app/app.component.spec.ts +0 -29
  129. data/templates/tool_angular/src/app/app.component.ts +0 -52
  130. data/templates/tool_angular/src/app/app.module.ts +0 -30
  131. data/templates/tool_angular/src/app/custom-overlay-container.ts +0 -17
  132. data/templates/tool_angular/src/app/empty-route/empty-route.component.ts +0 -7
  133. data/templates/tool_angular/src/app/openc3-api.d.ts +0 -1
  134. data/templates/tool_angular/src/assets/.gitkeep +0 -0
  135. data/templates/tool_angular/src/environments/environment.prod.ts +0 -3
  136. data/templates/tool_angular/src/environments/environment.ts +0 -16
  137. data/templates/tool_angular/src/favicon.ico +0 -0
  138. data/templates/tool_angular/src/index.html +0 -13
  139. data/templates/tool_angular/src/main.single-spa.ts +0 -40
  140. data/templates/tool_angular/src/single-spa/asset-url.ts +0 -12
  141. data/templates/tool_angular/src/single-spa/single-spa-props.ts +0 -8
  142. data/templates/tool_angular/src/styles.scss +0 -1
  143. data/templates/tool_angular/tsconfig.app.json +0 -13
  144. data/templates/tool_angular/tsconfig.json +0 -33
  145. data/templates/tool_angular/tsconfig.spec.json +0 -14
  146. data/templates/tool_react/.eslintrc +0 -7
  147. data/templates/tool_react/.gitignore +0 -71
  148. data/templates/tool_react/.prettierignore +0 -8
  149. data/templates/tool_react/babel.config.json +0 -29
  150. data/templates/tool_react/jest.config.js +0 -12
  151. data/templates/tool_react/package.json +0 -51
  152. data/templates/tool_react/src/openc3-tool_name.js +0 -24
  153. data/templates/tool_react/src/root.component.js +0 -88
  154. data/templates/tool_react/src/root.component.test.js +0 -9
  155. data/templates/tool_react/webpack.config.js +0 -27
  156. data/templates/tool_svelte/.gitignore +0 -71
  157. data/templates/tool_svelte/.prettierignore +0 -8
  158. data/templates/tool_svelte/.prettierrc.js +0 -5
  159. data/templates/tool_svelte/babel.config.js +0 -12
  160. data/templates/tool_svelte/build/smui.css +0 -1
  161. data/templates/tool_svelte/jest.config.js +0 -9
  162. data/templates/tool_svelte/package.json +0 -49
  163. data/templates/tool_svelte/pnpm-workspace.yaml +0 -20
  164. data/templates/tool_svelte/rollup.config.js +0 -74
  165. data/templates/tool_svelte/src/App.svelte +0 -42
  166. data/templates/tool_svelte/src/App.test.js +0 -9
  167. data/templates/tool_svelte/src/theme/_smui-theme.scss +0 -25
  168. data/templates/tool_svelte/src/tool_name.js +0 -17
  169. data/templates/widget/LICENSE.md +0 -20
@@ -1,52 +0,0 @@
1
- import { Component, ViewChild, AfterViewInit, OnDestroy } from '@angular/core';
2
- import {CdkPortal, DomPortalOutlet} from '@angular/cdk/portal';
3
- import { OpenC3Api } from "@openc3/js-common/services";
4
-
5
- @Component({
6
- selector: 'openc3-tool-<%= tool_name %>-root',
7
- templateUrl: './app.component.html',
8
- styleUrls: ['./app.component.scss'],
9
- })
10
- export class AppComponent implements AfterViewInit, OnDestroy {
11
- @ViewChild(CdkPortal)
12
- private portal: CdkPortal | undefined;
13
- private host: DomPortalOutlet | undefined;
14
-
15
- clickHandler = function() {
16
- let api = new OpenC3Api();
17
- api.cmd("INST", "COLLECT", { TYPE: "NORMAL" }).then((response: any) => {
18
- alert("Command Sent!");
19
- });
20
- }
21
- getMenuElement() {
22
- let elem = document.getElementById("openc3-menu")
23
- if (elem) {
24
- return elem
25
- } else {
26
- return document.createElement('span')
27
- }
28
- }
29
- ngAfterViewInit(): void {
30
- this.host = new DomPortalOutlet(
31
- this.getMenuElement()
32
- );
33
- this.host.attach(this.portal);
34
- document.title = "<%= tool_name_display %>";
35
- let tool = document.querySelector('#openc3-tool');
36
- if (tool == null) {
37
- tool = document.createElement('div')
38
- }
39
- let overlay = document.querySelector('.cdk-overlay-container');
40
- if (overlay == null) {
41
- overlay = document.createElement('div')
42
- overlay.classList.add('cdk-overlay-container');
43
- }
44
- // Move stuff
45
- tool.append(overlay);
46
- }
47
- ngOnDestroy(): void {
48
- if (this.host) {
49
- this.host.detach();
50
- }
51
- }
52
- }
@@ -1,30 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { BrowserModule } from '@angular/platform-browser';
3
- import { PortalModule } from '@angular/cdk/portal';
4
-
5
- import { AppRoutingModule } from './app-routing.module';
6
- import { AppComponent } from './app.component';
7
- import {MatCardModule} from '@angular/material/card';
8
- import {MatButtonModule} from '@angular/material/button';
9
- import {MatMenuModule} from '@angular/material/menu';
10
- import {OverlayContainer} from '@angular/cdk/overlay';
11
- import {AppOverlayContainer} from './custom-overlay-container';
12
-
13
- @NgModule({
14
- declarations: [
15
- AppComponent
16
- ],
17
- imports: [
18
- BrowserModule,
19
- AppRoutingModule,
20
- PortalModule,
21
- MatCardModule,
22
- MatButtonModule,
23
- MatMenuModule
24
- ],
25
- providers: [
26
- { provide: OverlayContainer, useClass: AppOverlayContainer },
27
- ],
28
- bootstrap: [AppComponent]
29
- })
30
- export class AppModule { }
@@ -1,17 +0,0 @@
1
- import { Injectable, OnDestroy } from '@angular/core';
2
- import { OverlayContainer } from '@angular/cdk/overlay';
3
-
4
- export class AppOverlayContainer extends OverlayContainer {
5
-
6
- override _createContainer(): void {
7
- let container = document.createElement('div');
8
- container.classList.add('cdk-overlay-container');
9
-
10
- let elem = document.querySelector('#openc3-tool');
11
- if (!elem) {
12
- elem = document.createElement('div')
13
- }
14
- elem.appendChild(container);
15
- this._containerElement = container;
16
- }
17
- }
@@ -1,7 +0,0 @@
1
- import { Component } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'openc3-tool-<%= tool_name %>-empty-route',
5
- template: '',
6
- })
7
- export class EmptyRouteComponent {}
@@ -1 +0,0 @@
1
- declare module '@openc3/js-common/services';
File without changes
@@ -1,3 +0,0 @@
1
- export const environment = {
2
- production: true
3
- };
@@ -1,16 +0,0 @@
1
- // This file can be replaced during build by using the `fileReplacements` array.
2
- // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3
- // The list of file replacements can be found in `angular.json`.
4
-
5
- export const environment = {
6
- production: false
7
- };
8
-
9
- /*
10
- * For easier debugging in development mode, you can import the following file
11
- * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12
- *
13
- * This import should be commented out in production mode because it will have a negative impact
14
- * on performance if an error is thrown.
15
- */
16
- import 'zone.js/dist/zone-error'; // Included with Angular CLI.
Binary file
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Openc3ToolTemplateAngular</title>
6
- <base href="/">
7
- <meta name="viewport" content="width=device-width, initial-scale=1">
8
- <link rel="icon" type="image/x-icon" href="favicon.ico">
9
- </head>
10
- <body>
11
- <openc3-tool-template-angular-root></openc3-tool-template-angular-root>
12
- </body>
13
- </html>
@@ -1,40 +0,0 @@
1
- import 'zone.js/dist/zone'
2
-
3
- import { enableProdMode, NgZone } from '@angular/core';
4
-
5
- import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
6
- import { Router, NavigationStart } from '@angular/router';
7
-
8
- import { singleSpaAngular, getSingleSpaExtraProviders } from 'single-spa-angular';
9
-
10
-
11
- import { AppModule } from './app/app.module';
12
- import { environment } from './environments/environment';
13
- import { singleSpaPropsSubject } from './single-spa/single-spa-props';
14
-
15
- if (environment.production) {
16
- enableProdMode();
17
- }
18
-
19
- const lifecycles = singleSpaAngular({
20
- bootstrapFunction: singleSpaProps => {
21
- singleSpaPropsSubject.next(singleSpaProps);
22
- return platformBrowserDynamic(getSingleSpaExtraProviders()).bootstrapModule(AppModule);
23
- },
24
- template: '<openc3-tool-<%= tool_name %>-root />',
25
- Router,
26
- NavigationStart,
27
- NgZone,
28
- domElementGetter: function() {
29
- let elem = document.getElementById("openc3-tool")
30
- if (elem) {
31
- return elem
32
- } else {
33
- return document.createElement('div')
34
- }
35
- },
36
- });
37
-
38
- export const bootstrap = lifecycles.bootstrap;
39
- export const mount = lifecycles.mount;
40
- export const unmount = lifecycles.unmount;
@@ -1,12 +0,0 @@
1
- // In single-spa, the assets need to be loaded from a dynamic location,
2
- // instead of hard coded to `/assets`. We use webpack public path for this.
3
- // See https://webpack.js.org/guides/public-path/#root
4
-
5
- export function assetUrl(url: string): string {
6
- // @ts-ignore
7
- const publicPath = __webpack_public_path__;
8
- const publicPathSuffix = publicPath.endsWith('/') ? '' : '/';
9
- const urlPrefix = url.startsWith('/') ? '' : '/';
10
-
11
- return `${publicPath}${publicPathSuffix}assets${urlPrefix}${url}`;
12
- }
@@ -1,8 +0,0 @@
1
- import { ReplaySubject } from 'rxjs';
2
- import { AppProps } from 'single-spa';
3
-
4
- export const singleSpaPropsSubject = new ReplaySubject<SingleSpaProps>(1);
5
-
6
- // Add any custom single-spa props you have to this type def
7
- // https://single-spa.js.org/docs/building-applications.html#custom-props
8
- export type SingleSpaProps = AppProps; // & {};
@@ -1 +0,0 @@
1
- /* You can add global styles to this file, and also import other style files */
@@ -1,13 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "./out-tsc/app",
5
- "types": []
6
- },
7
- "files": [
8
- "src/main.single-spa.ts"
9
- ],
10
- "include": [
11
- "src/**/*.d.ts"
12
- ]
13
- }
@@ -1,33 +0,0 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
- {
3
- "compileOnSave": false,
4
- "compilerOptions": {
5
- "baseUrl": "./",
6
- "outDir": "./dist/out-tsc",
7
- "forceConsistentCasingInFileNames": true,
8
- "strict": true,
9
- "noImplicitOverride": true,
10
- "noPropertyAccessFromIndexSignature": true,
11
- "noImplicitReturns": true,
12
- "noFallthroughCasesInSwitch": true,
13
- "sourceMap": true,
14
- "declaration": false,
15
- "downlevelIteration": true,
16
- "experimentalDecorators": true,
17
- "moduleResolution": "node",
18
- "importHelpers": true,
19
- "target": "ES2022",
20
- "module": "ES2022",
21
- "useDefineForClassFields": false,
22
- "lib": [
23
- "ES2022",
24
- "dom"
25
- ]
26
- },
27
- "angularCompilerOptions": {
28
- "enableI18nLegacyMessageIdFormat": false,
29
- "strictInjectionParameters": true,
30
- "strictInputAccessModifiers": true,
31
- "strictTemplates": true
32
- }
33
- }
@@ -1,14 +0,0 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
- {
3
- "extends": "./tsconfig.json",
4
- "compilerOptions": {
5
- "outDir": "./out-tsc/spec",
6
- "types": [
7
- "jasmine"
8
- ]
9
- },
10
- "include": [
11
- "src/**/*.spec.ts",
12
- "src/**/*.d.ts"
13
- ]
14
- }
@@ -1,7 +0,0 @@
1
- {
2
- "extends": [
3
- "react-important-stuff",
4
- "plugin:prettier/recommended"
5
- ],
6
- "parser": "@babel/eslint-parser"
7
- }
@@ -1,71 +0,0 @@
1
- # Logs
2
- logs
3
- *.log
4
- npm-debug.log*
5
- pnpm-debug.log*
6
-
7
- # Runtime data
8
- pids
9
- *.pid
10
- *.seed
11
- *.pid.lock
12
-
13
- # Directory for instrumented libs generated by jscoverage/JSCover
14
- lib-cov
15
-
16
- # Coverage directory used by tools like istanbul
17
- coverage
18
-
19
- # nyc test coverage
20
- .nyc_output
21
-
22
- # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
23
- .grunt
24
-
25
- # Bower dependency directory (https://bower.io/)
26
- bower_components
27
-
28
- # node-waf configuration
29
- .lock-wscript
30
-
31
- # Compiled binary addons (https://nodejs.org/api/addons.html)
32
- build/Release
33
-
34
- # Dependency directories
35
- node_modules/
36
- jspm_packages/
37
-
38
- # TypeScript v1 declaration files
39
- typings/
40
-
41
- # Optional npm cache directory
42
- .npm
43
-
44
- # Optional eslint cache
45
- .eslintcache
46
-
47
- # Optional REPL history
48
- .node_repl_history
49
-
50
- # Output of 'npm pack'
51
- *.tgz
52
-
53
- # Yarn Integrity file
54
- .yarn-integrity
55
-
56
- # dotenv environment variables file
57
- .env
58
-
59
- # next.js build output
60
- .next
61
- tools
62
-
63
- # Editor directories and files
64
- .idea
65
- .vscode
66
- *.suo
67
- *.ntvs*
68
- *.njsproj
69
- *.sln
70
- *.sw?
71
- .DS_Store
@@ -1,8 +0,0 @@
1
- .gitignore
2
- .prettierignore
3
- yarn.lock
4
- yarn-error.log
5
- package-lock.json
6
- dist
7
- coverage
8
- pnpm-lock.yaml
@@ -1,29 +0,0 @@
1
- {
2
- "presets": [
3
- "@babel/preset-env",
4
- [
5
- "@babel/preset-react",
6
- {
7
- "runtime": "automatic"
8
- }
9
- ],
10
- ],
11
- "plugins": [
12
- [
13
- "@babel/plugin-transform-runtime",
14
- {
15
- "useESModules": true,
16
- "regenerator": false
17
- }
18
- ]
19
- ],
20
- "env": {
21
- "test": {
22
- "presets": [
23
- ["@babel/preset-env", {
24
- "targets": "current node"
25
- }]
26
- ]
27
- }
28
- }
29
- }
@@ -1,12 +0,0 @@
1
- module.exports = {
2
- rootDir: "src",
3
- testEnvironment: "jsdom",
4
- transform: {
5
- "^.+\\.(j|t)sx?$": "babel-jest",
6
- },
7
- moduleNameMapper: {
8
- "\\.(css)$": "identity-obj-proxy",
9
- "single-spa-react/parcel": "single-spa-react/lib/cjs/parcel.cjs",
10
- },
11
- setupFilesAfterEnv: ["@testing-library/jest-dom"],
12
- };
@@ -1,51 +0,0 @@
1
- {
2
- "scripts": {
3
- "start": "webpack serve",
4
- "start:standalone": "webpack serve --env standalone",
5
- "build": "concurrently pnpm:build:*",
6
- "build:webpack": "webpack --mode=production",
7
- "analyze": "webpack --mode=production --env analyze",
8
- "lint": "eslint src --ext js",
9
- "format": "prettier --write .",
10
- "check-format": "prettier --check .",
11
- "test": "cross-env BABEL_ENV=test jest",
12
- "watch-tests": "cross-env BABEL_ENV=test jest --watch",
13
- "coverage": "cross-env BABEL_ENV=test jest --coverage"
14
- },
15
- "dependencies": {
16
- "@emotion/react": "^11.13.3",
17
- "@emotion/styled": "^11.11.0",
18
- "@mui/material": "^6.1.1",
19
- "@openc3/js-common": "7.5.1",
20
- "react": "^18.2.0",
21
- "react-dom": "^18.2.0",
22
- "single-spa-react": "^5.1.4"
23
- },
24
- "devDependencies": {
25
- "@babel/core": "^7.25.2",
26
- "@babel/eslint-parser": "^7.25.1",
27
- "@babel/plugin-transform-runtime": "^7.25.4",
28
- "@babel/preset-env": "^7.25.4",
29
- "@babel/preset-react": "^7.23.3",
30
- "@babel/runtime": "^7.25.6",
31
- "@testing-library/jest-dom": "^6.5.0",
32
- "@testing-library/react": "^16.0.1",
33
- "babel-jest": "^29.7.0",
34
- "concurrently": "^9.0.1",
35
- "cross-env": "^7.0.3",
36
- "eslint": "^8.56.0",
37
- "eslint-config-prettier": "^9.1.0",
38
- "eslint-config-react-important-stuff": "^3.0.0",
39
- "eslint-plugin-prettier": "^5.1.2",
40
- "identity-obj-proxy": "^3.0.0",
41
- "jest": "^29.7.0",
42
- "jest-cli": "^29.7.0",
43
- "prettier": "^3.1.1",
44
- "pretty-quick": "^4.0.0",
45
- "webpack": "^5.95.0",
46
- "webpack-cli": "^5.1.4",
47
- "webpack-config-single-spa-react": "^4.0.5",
48
- "webpack-dev-server": "^5.1.0",
49
- "webpack-merge": "^6.0.1"
50
- }
51
- }
@@ -1,24 +0,0 @@
1
- import React from "react";
2
- import ReactDOM from "react-dom";
3
- import singleSpaReact from "single-spa-react";
4
- import Root from "./root.component";
5
-
6
- const lifecycles = singleSpaReact({
7
- React,
8
- ReactDOM,
9
- rootComponent: Root,
10
- errorBoundary(err, info, props) {
11
- // Customize the root error boundary for your microfrontend here.
12
- return null;
13
- },
14
- domElementGetter: function () {
15
- let elem = document.getElementById("openc3-tool");
16
- if (elem) {
17
- return elem;
18
- } else {
19
- return new HTMLElement();
20
- }
21
- },
22
- });
23
-
24
- export const { bootstrap, mount, unmount } = lifecycles;
@@ -1,88 +0,0 @@
1
- import React from "react";
2
- import { createPortal } from "react-dom";
3
- import Button from "@mui/material/Button";
4
- import Card from "@mui/material/Card";
5
- import CardContent from "@mui/material/CardContent";
6
- import Menu from "@mui/material/Menu";
7
- import MenuItem from "@mui/material/MenuItem";
8
- import { OpenC3Api } from "@openc3/js-common/services";
9
-
10
- export default function Root(props) {
11
- const [anchorEl, setAnchorEl] = React.useState();
12
- const open = Boolean(anchorEl);
13
- const handleClick = (event) => {
14
- setAnchorEl(event.currentTarget);
15
- };
16
- const sendCommand = () => {
17
- let api = new OpenC3Api();
18
- api.cmd("INST", "COLLECT", { TYPE: "NORMAL" }).then((response) => {
19
- alert("Command Sent!");
20
- });
21
- };
22
- const handleClose = () => {
23
- setAnchorEl(null);
24
- sendCommand();
25
- };
26
-
27
- document.title = "<%= tool_name_display %>";
28
-
29
- return (
30
- <Card variant="outlined">
31
- <CardContent>
32
- <Button variant="contained" onClick={sendCommand}>
33
- Send Command!
34
- </Button>
35
- </CardContent>
36
- {createPortal(
37
- <div>
38
- <Button
39
- id="basic-button"
40
- aria-controls={open ? "basic-menu" : undefined}
41
- aria-haspopup="true"
42
- aria-expanded={open ? "true" : undefined}
43
- onClick={handleClick}
44
- variant="contained"
45
- disableElevation
46
- >
47
- File
48
- </Button>
49
- <Menu
50
- id="basic-menu"
51
- anchorEl={anchorEl}
52
- open={open}
53
- onClose={handleClose}
54
- MenuListProps={{
55
- "aria-labelledby": "basic-button",
56
- }}
57
- >
58
- <MenuItem onClick={handleClose}>Send Command</MenuItem>
59
- </Menu>
60
- <div
61
- style={{
62
- "align-items": "center",
63
- "text-align": "center",
64
- width: "80%",
65
- display: "inline-flex",
66
- position: "relative",
67
- "z-index": 0,
68
- padding: "4px 16px",
69
- }}
70
- >
71
- <div
72
- style={{
73
- "font-size": "1.25rem",
74
- "line-height": 1.5,
75
- "text-overflow": "ellipsis",
76
- "white-space": "nowrap",
77
- width: "100%",
78
- }}
79
- >
80
- <%= tool_name_display %>
81
- </div>
82
- </div>
83
- </div>,
84
- document.getElementById("openc3-menu")
85
- )}
86
- </Card>
87
- );
88
- }
@@ -1,9 +0,0 @@
1
- import { render } from "@testing-library/react";
2
- import Root from "./root.component";
3
-
4
- describe("Root component", () => {
5
- it("should be in the document", () => {
6
- const { getByText } = render(<Root name="Testapp" />);
7
- expect(getByText(/Testapp is mounted!/i)).toBeInTheDocument();
8
- });
9
- });
@@ -1,27 +0,0 @@
1
- const { merge } = require("webpack-merge");
2
- const singleSpaDefaults = require("webpack-config-single-spa-react");
3
- const path = require("path");
4
-
5
- function resolve(dir) {
6
- return path.join(__dirname, "..", dir);
7
- }
8
-
9
- module.exports = (webpackConfigEnv, argv) => {
10
- const defaultConfig = singleSpaDefaults({
11
- orgName: "openc3",
12
- projectName: "<%= tool_name %>",
13
- webpackConfigEnv,
14
- argv,
15
- orgPackagesAsExternal: false,
16
- });
17
-
18
- delete defaultConfig.externals;
19
-
20
- return merge(defaultConfig, {
21
- output: {
22
- path: path.resolve(__dirname, "tools/<%= tool_name %>"),
23
- filename: "main.js",
24
- libraryTarget: "system", // This line is in all the vue.config.js files, is it needed here?
25
- },
26
- });
27
- };