diff --git a/build.gradle b/build.gradle index 7fc0df07..d571ba1c 100644 --- a/build.gradle +++ b/build.gradle @@ -198,12 +198,11 @@ node { } npmInstall { - args = System.getenv('CI') ? [] : ['--workspaces'] + args = System.getenv('CI') ? [] : [ + '--workspaces', + '--include-workspace-root' + ] inputs.files 'package.json', 'package-lock.json' - inputs.dir fileTree('.') { - include 'node_modules/**' - exclude 'node_modules/.cache/**' - } } task npmRunLint(type: NpmTask) { diff --git a/package-lock.json b/package-lock.json index 50da6aaf..37db3b91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "@types/node": "^20.11.10", "@typescript-eslint/eslint-plugin": "^6.19.1", "@typescript-eslint/parser": "^6.19.1", + "cross-env": "^7.0.3", "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", @@ -3289,6 +3290,24 @@ "resolved": "https://registry.npmjs.org/cookieconsent/-/cookieconsent-3.1.1.tgz", "integrity": "sha512-v8JWLJcI7Zs9NWrs8hiVldVtm3EBF70TJI231vxn6YToBGj0c9dvdnYwltydkAnrbBMOM/qX1xLFrnTfm5wTag==" }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", diff --git a/package.json b/package.json index 622c3fc4..a7c880af 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@types/node": "^20.11.10", "@typescript-eslint/eslint-plugin": "^6.19.1", "@typescript-eslint/parser": "^6.19.1", + "cross-env": "^7.0.3", "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", diff --git a/src/main/java/com/team1701/robot/states/RobotState.java b/src/main/java/com/team1701/robot/states/RobotState.java index 0658015f..44092df5 100644 --- a/src/main/java/com/team1701/robot/states/RobotState.java +++ b/src/main/java/com/team1701/robot/states/RobotState.java @@ -15,6 +15,7 @@ import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.math.geometry.Translation3d; import edu.wpi.first.math.kinematics.SwerveModulePosition; +import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj.Timer; import org.littletonrobotics.junction.AutoLogOutput; @@ -36,6 +37,11 @@ public void periodic() { mDetectedNotes.removeIf(note -> note.lastDetectedTimestamp < timeout); } + @AutoLogOutput + public double getMatchTime() { + return DriverStation.getMatchTime(); + } + @AutoLogOutput public Pose2d getPose2d() { return mPoseEstimator.getEstimatedPosition(); diff --git a/src/main/ts/dashboard/package.json b/src/main/ts/dashboard/package.json index fc14410e..d8cbf9f5 100644 --- a/src/main/ts/dashboard/package.json +++ b/src/main/ts/dashboard/package.json @@ -9,8 +9,9 @@ "lint:ci": "eslint .", "dev": "vite", "build": "vite build", - "build:deploy": "DASHBOARD_BASE='dashboard' DASHBOARD_OUT_DIR='../../deploy/web/dashboard' vite build", + "build:deploy": "cross-env DASHBOARD_BASE='dashboard' DASHBOARD_OUT_DIR='../../deploy/web/dashboard' vite build", "watch": "vite build --watch", + "watch:deploy": "cross-env DASHBOARD_BASE='dashboard' DASHBOARD_OUT_DIR='../../deploy/web/dashboard' vite build --watch", "preview": "vite preview", "check": "svelte-check --tsconfig ./tsconfig.json" }, diff --git a/src/main/ts/dashboard/src/components/index.ts b/src/main/ts/dashboard/src/components/index.ts new file mode 100644 index 00000000..e60c15da --- /dev/null +++ b/src/main/ts/dashboard/src/components/index.ts @@ -0,0 +1 @@ +export * from './match-timer'; diff --git a/src/main/ts/dashboard/src/components/match-timer.ts b/src/main/ts/dashboard/src/components/match-timer.ts new file mode 100644 index 00000000..1bd3b884 --- /dev/null +++ b/src/main/ts/dashboard/src/components/match-timer.ts @@ -0,0 +1,36 @@ +//liam is the greatest most bestest president - sorryen +import { LitElement, css, html } from 'lit'; +import { customElement, property } from 'lit/decorators.js'; +import { ClassInfo, classMap } from 'lit/directives/class-map.js'; +import { globalStylesCss } from '../styles/styles'; + +@customElement('team1701-match-timer') +export class MatchTimer extends LitElement { + @property({ type: Number }) + timer = 0; + + render() { + const roundedTimer = Math.floor(this.timer); + return html`