-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into sns-i2c_temp
- Loading branch information
Showing
265 changed files
with
33,365 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# compiled output | ||
dist | ||
node_modules | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
pnpm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# OS | ||
.DS_Store | ||
|
||
# Tests | ||
/coverage | ||
/.nyc_output | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
.turbo | ||
|
||
# .env files | ||
.env | ||
|
||
# influx | ||
influxdb/config | ||
influxdb/data | ||
|
||
# mosquitto persistence & logs | ||
mosquitto/data | ||
mosquitto/log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"endOfLine": "lf" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM node:18.17.0 | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/app | ||
|
||
# Install pnpm | ||
RUN npm install -g pnpm | ||
|
||
# Install dependencies | ||
COPY package.json ./ | ||
COPY packages/constants/package.json ./packages/constants/ | ||
COPY packages/server/package.json ./packages/server/ | ||
COPY packages/types/package.json ./packages/types/ | ||
COPY packages/ui/package.json ./packages/ui/ | ||
COPY packages/public-app/package.json ./packages/public-app/ | ||
COPY packages/fake/package.json ./packages/fake/ | ||
COPY packages/eslint-config/package.json ./packages/eslint-config/ | ||
COPY packages/tsconfig/package.json ./packages/tsconfig/ | ||
COPY packages/e2e-tests/package.json ./packages/e2e-tests/ | ||
COPY pnpm-lock.yaml ./ | ||
COPY pnpm-workspace.yaml ./ | ||
COPY patches ./patches | ||
COPY turbo.json ./ | ||
RUN pnpm install --frozen-lockfile | ||
RUN pnpm --filter=e2e-tests exec playwright install --with-deps | ||
|
||
# Expose ports | ||
EXPOSE 5173 | ||
EXPOSE 3000 | ||
EXPOSE 3001 | ||
EXPOSE 8086 | ||
EXPOSE 9323 | ||
|
||
# Entrypoint | ||
COPY entry.sh ./ | ||
|
||
ENTRYPOINT [ "/usr/src/app/entry.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '3' | ||
|
||
services: | ||
mosquitto: | ||
container_name: mosquitto | ||
image: eclipse-mosquitto:2.0.18 | ||
ports: | ||
- 1883:1883 | ||
- 8080:8080 | ||
volumes: | ||
- ./mosquitto/config:/mosquitto/config | ||
- ./mosquitto/data:/mosquitto/data | ||
- ./mosquitto/log:/mosquitto/log | ||
restart: always | ||
networks: | ||
- telemetry | ||
|
||
volumes: | ||
mosquitto: | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
version: '3' | ||
|
||
services: | ||
telemetry: | ||
container_name: telemetry | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- 5173:5173 | ||
- 3000:3000 | ||
- 3001:3001 | ||
- 9323:9323 | ||
environment: | ||
- PNPM_SCRIPT | ||
- IS_DOCKER=true | ||
- E2E_TEST_MQTT_BROKER=mqtt://mosquitto:1883 | ||
- PWTEST_SKIP_TEST_OUTPUT=1 | ||
volumes: | ||
- ./:/usr/src/app | ||
# Exclude node_modules from being mounted | ||
- /usr/src/app/node_modules | ||
- /usr/src/app/packages/constants/node_modules | ||
- /usr/src/app/packages/server/node_modules | ||
- /usr/src/app/packages/types/node_modules | ||
- /usr/src/app/packages/ui/node_modules | ||
- /usr/src/app/packages/public-app/node_modules | ||
- /usr/src/app/packages/public-app/.next | ||
- /usr/src/app/packages/fake/node_modules | ||
- /usr/src/app/packages/eslint-config/node_modules | ||
- /usr/src/app/packages/e2e-tests/node_modules | ||
networks: | ||
- telemetry | ||
influxdb: | ||
container_name: influxdb | ||
image: influxdb:2.7 | ||
ports: | ||
- 8086:8086 | ||
volumes: | ||
- ./influxdb/data:/var/lib/influxdb2 | ||
- ./influxdb/config:/etc/influxdb2 | ||
- ./influxdb/scripts:/docker-entrypoint-initdb.d | ||
environment: | ||
- DOCKER_INFLUXDB_INIT_MODE=setup | ||
- DOCKER_INFLUXDB_INIT_USERNAME=hyped | ||
- DOCKER_INFLUXDB_INIT_PASSWORD=edinburgh | ||
- DOCKER_INFLUXDB_INIT_ORG=hyped | ||
- DOCKER_INFLUXDB_INIT_BUCKET=telemetry | ||
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=edinburgh | ||
networks: | ||
- telemetry | ||
|
||
volumes: | ||
influxdb: | ||
|
||
networks: | ||
telemetry: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -e # Exit with nonzero exit code if anything fails | ||
|
||
# Use docker env files | ||
cp /usr/src/app/packages/server/.env.docker /usr/src/app/packages/server/.env | ||
|
||
cp /usr/src/app/packages/ui/.env.docker /usr/src/app/packages/ui/.env | ||
|
||
pnpm run $PNPM_SCRIPT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
influx bucket create -n faults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# mqtt protocol | ||
listener 1883 | ||
protocol mqtt | ||
|
||
# websockets protocol (for GUI) | ||
listener 8080 | ||
protocol websockets | ||
|
||
allow_anonymous true | ||
|
||
# persistence & logs | ||
persistence true | ||
persistence_location /mosquitto/data/ | ||
log_dest file /mosquitto/log/mosquitto.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "@hyped/telemetry", | ||
"private": true, | ||
"scripts": { | ||
"preinstall": "npx only-allow pnpm", | ||
"start": "turbo run start", | ||
"dev": "turbo run dev", | ||
"dev:test": "turbo run dev:test", | ||
"ci": "turbo run build lint e2e:test", | ||
"lint": "turbo run lint --parallel", | ||
"lint:fix": "turbo run lint:fix --parallel", | ||
"format": "prettier --write \"**/*.{ts,tsx,md}\"", | ||
"e2e:test": "turbo run e2e:test", | ||
"format:check": "prettier --check \"**/*.{ts,tsx,md}\"", | ||
"build": "turbo run build" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.11.18", | ||
"prettier": "3.2.4", | ||
"turbo": "^1.11.3", | ||
"typescript": "^5.3.3" | ||
}, | ||
"pnpm": { | ||
"patchedDependencies": { | ||
"@nestjs/common@9.4.2": "patches/@nestjs__common@9.4.2.patch", | ||
"nest-mqtt@0.2.0": "patches/nest-mqtt@0.2.0.patch", | ||
"openmct@3.2.0": "patches/openmct@3.2.0.patch" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
root: true, | ||
extends: ['@hyped/eslint-config/basic.js'], | ||
parserOptions: { | ||
project: true, | ||
tsconfigRootDir: __dirname, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "@hyped/telemetry-constants", | ||
"private": true, | ||
"version": "1.0.0", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"module": "dist/telemetry-constants.esm.js", | ||
"files": [ | ||
"dist", | ||
"src" | ||
], | ||
"scripts": { | ||
"start": "tsdx watch", | ||
"build": "tsdx build", | ||
"lint": "eslint \"src/**/*.ts\" --max-warnings 0 --report-unused-disable-directives", | ||
"lint:fix": "eslint \"src/**/*.ts\" --fix" | ||
}, | ||
"devDependencies": { | ||
"@hyped/telemetry-types": "workspace:*", | ||
"@hyped/eslint-config": "workspace:*", | ||
"@hyped/tsconfig": "workspace:*", | ||
"tsdx": "^0.14.1", | ||
"tslib": "^2.5.3", | ||
"typescript": "^5.3.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const FAULT_LEVEL = { | ||
WATCH: 'WATCH', | ||
WARNING: 'WARNING', | ||
CRITICAL: 'CRITICAL', | ||
} as const; | ||
|
||
export type FaultLevel = (typeof FAULT_LEVEL)[keyof typeof FAULT_LEVEL]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export { pods, POD_IDS } from './pods/pods'; | ||
export type { PodId, Pods } from './pods/pods'; | ||
export { | ||
ALL_POD_STATES, | ||
PASSIVE_STATES, | ||
ACTIVE_STATES, | ||
NULL_STATES, | ||
FAILURE_STATES, | ||
getStateType, | ||
} from './pods/states'; | ||
export type { PodStateType, PodStateCategoryType } from './pods/states'; | ||
export { MODES, MODE_EXCLUDED_STATES } from './pods/modes'; | ||
export type { ModeType } from './pods/modes'; | ||
export { openMctObjectTypes } from './openmct/object-types/object-types'; | ||
|
||
export * as socket from './socket'; | ||
|
||
export { FAULT_LEVEL } from './faults/levels'; | ||
export type { FaultLevel } from './faults/levels'; |
54 changes: 54 additions & 0 deletions
54
telemetry/packages/constants/src/openmct/object-types/object-types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import type { OpenMctObjectTypes } from '@hyped/telemetry-types'; | ||
|
||
export const openMctObjectTypes: OpenMctObjectTypes = [ | ||
{ | ||
id: 'temperature', | ||
name: 'Temperature', | ||
icon: 'icon-telemetry', | ||
}, | ||
{ | ||
id: 'thermistor', | ||
name: 'Thermistor', | ||
icon: 'icon-telemetry', | ||
}, | ||
{ | ||
id: 'acceleration', | ||
name: 'Acceleration', | ||
icon: 'icon-telemetry', | ||
}, | ||
{ | ||
id: 'pressure', | ||
name: 'Pressure', | ||
icon: 'icon-telemetry', | ||
}, | ||
{ | ||
id: 'hall_effect', | ||
name: 'Hall Effect', | ||
icon: 'icon-telemetry', | ||
}, | ||
{ | ||
id: 'displacement', | ||
name: 'Displacement', | ||
icon: 'icon-telemetry', | ||
}, | ||
{ | ||
id: 'velocity', | ||
name: 'Velocity', | ||
icon: 'icon-telemetry', | ||
}, | ||
{ | ||
id: 'status', | ||
name: 'status', | ||
icon: 'icon-telemetry', | ||
}, | ||
{ | ||
id: 'keyence', | ||
name: 'Keyence', | ||
icon: 'icon-telemetry', | ||
}, | ||
{ | ||
id: 'brake_feedback', | ||
name: 'Brake Feedback', | ||
icon: 'icon-telemetry', | ||
}, | ||
]; |
Oops, something went wrong.