From ebab35de87531910b6ee91d37e15c1472c66d19d Mon Sep 17 00:00:00 2001 From: oxdev03 <140103378+oxdev03@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:32:22 +0200 Subject: [PATCH] feat: add git versioning info for process (#32) * feat: add git versioning info for process --- README.md | 8 +- apps/backend/handlers/updateData.ts | 2 + apps/backend/package.json | 4 +- apps/backend/types/info.ts | 7 + apps/backend/utils/processInfo.ts | 7 + .../components/process/ProcessGitMetric.tsx | 40 +++ .../components/process/ProcessItem.tsx | 2 +- .../components/process/ProcessMetricRow.tsx | 9 +- apps/dashboard/package.json | 12 +- package-lock.json | 285 +++++++----------- package.json | 2 +- packages/eslint-config/package.json | 10 +- packages/mongoose-models/models/process.ts | 22 ++ packages/mongoose-models/package.json | 4 +- packages/typescript-config/package.json | 2 +- packages/typings/package.json | 4 +- packages/typings/src/process.ts | 7 + 17 files changed, 223 insertions(+), 204 deletions(-) create mode 100644 apps/dashboard/components/process/ProcessGitMetric.tsx diff --git a/README.md b/README.md index 6c8561f..33f59c9 100644 --- a/README.md +++ b/README.md @@ -36,10 +36,10 @@ Once pm2.web is installed and running, you can perform the following actions: - Stop, restart, or delete processes from the process list page. - Access the logs generated by your processes. - - View key metrics and graphs to assess the performance of your applications. + - View key metrics, git versioning info and graphs to assess the performance of your applications. - Pm2 Settings & Git Feature -- **Server Management (Planned)**: +- **Server Management (Planned/On Demand)**: - Control server-level functions such as shutdown or restart using the dedicated server management page. - Execute these actions securely without the need for direct server access. @@ -55,7 +55,7 @@ Once pm2.web is installed and running, you can perform the following actions: - Configure settings such as the update interval, log rotation, and more. -- **Alert Setup (Planned)**: +- **Alert Setup (Planned/On Demand)**: - Configure alerts to receive notifications for specific actions. - Define alert rules based on events like shutdown, restart, or kill actions. @@ -74,7 +74,7 @@ Once pm2.web is installed and running, you can perform the following actions: - **Usage**: Only registered users (per credentials) can login with auth2, which links the oauth2 with the existing user account in the database - **Setup Registration Code** - Go to the settings page and add/generate the registration code - - **Setup Google OAuth** + - **Setup Google OAuth (Planned/On Demand)** - TBD ## Up Next diff --git a/apps/backend/handlers/updateData.ts b/apps/backend/handlers/updateData.ts index 76d8d5d..f53151c 100644 --- a/apps/backend/handlers/updateData.ts +++ b/apps/backend/handlers/updateData.ts @@ -48,6 +48,7 @@ export default async function updateData( await processModel.updateOne(processQuery, { name: process.name, status: process.status, + versioning: process.versioning, $push: { logs: { $each: logs, @@ -64,6 +65,7 @@ export default async function updateData( type: process.type, logs: logs, status: process.status, + versioning: process.versioning, restartCount: 0, deleteCount: 0, toggleCount: 0, diff --git a/apps/backend/package.json b/apps/backend/package.json index cc3b541..81cd580 100644 --- a/apps/backend/package.json +++ b/apps/backend/package.json @@ -1,6 +1,6 @@ { "name": "backend", - "version": "1.4.2", + "version": "1.5.0", "main": "dist/index.js", "description": "Dashboard for PM2", "author": { @@ -41,6 +41,6 @@ "@pm2.web/typescript-config": "*", "@types/bcrypt": "^5.0.2", "eslint": "^8.57.0", - "typescript": "^5.5.3" + "typescript": "^5.5.4" } } diff --git a/apps/backend/types/info.ts b/apps/backend/types/info.ts index 01bb4f7..053d4c0 100644 --- a/apps/backend/types/info.ts +++ b/apps/backend/types/info.ts @@ -10,6 +10,13 @@ interface IProcessInfo { memoryMax: number; uptime: number; }; + versioning: { + url?: string; + revision?: string; + comment?: string; + branch?: string; + unstaged?: boolean; + }; status: IProcessStatus; type: string; } diff --git a/apps/backend/utils/processInfo.ts b/apps/backend/utils/processInfo.ts index 868c806..6930adc 100644 --- a/apps/backend/utils/processInfo.ts +++ b/apps/backend/utils/processInfo.ts @@ -36,6 +36,13 @@ const getProcessInfo = async (): Promise => { memoryMax: 0, uptime: Date.now() - (item?.pm2_env?.pm_uptime || 0), }, + versioning: { + url: item.pm2_env?.versioning?.url, + revision: item.pm2_env?.versioning?.revision, + comment: item.pm2_env?.versioning?.comment, + branch: item.pm2_env?.versioning?.branch, + unstaged: item.pm2_env?.versioning?.unstaged ?? true, + }, status: item?.pm2_env?.status || "offline", type: item?.pm2_env?.exec_interpreter || "", }; diff --git a/apps/dashboard/components/process/ProcessGitMetric.tsx b/apps/dashboard/components/process/ProcessGitMetric.tsx new file mode 100644 index 0000000..0319027 --- /dev/null +++ b/apps/dashboard/components/process/ProcessGitMetric.tsx @@ -0,0 +1,40 @@ +import { Anchor, Flex, Paper, Popover, Text } from "@mantine/core"; +import { useDisclosure } from "@mantine/hooks"; +import { IProcess } from "@pm2.web/typings"; +import { IconGitMerge } from "@tabler/icons-react"; + +import classes from "@/styles/process.module.css"; + +export default function ProcessGitMetric({ versioning }: { versioning?: IProcess["versioning"] }) { + const [opened, { close, open }] = useDisclosure(false); + + return ( + + + + + + + {versioning?.branch} + {versioning?.unstaged && "*"} + + + + + + {versioning?.comment?.split("\n")?.map((t, tIdx) => ( + + {t} + + ))} + + + ); +} diff --git a/apps/dashboard/components/process/ProcessItem.tsx b/apps/dashboard/components/process/ProcessItem.tsx index 13957bd..3307973 100644 --- a/apps/dashboard/components/process/ProcessItem.tsx +++ b/apps/dashboard/components/process/ProcessItem.tsx @@ -49,7 +49,7 @@ export default function ProcessItem({ process, setting }: ProcessItemProps) { diff --git a/apps/dashboard/components/process/ProcessMetricRow.tsx b/apps/dashboard/components/process/ProcessMetricRow.tsx index 10c1204..8444811 100644 --- a/apps/dashboard/components/process/ProcessMetricRow.tsx +++ b/apps/dashboard/components/process/ProcessMetricRow.tsx @@ -1,21 +1,23 @@ import { Flex } from "@mantine/core"; +import { IProcess } from "@pm2.web/typings"; import { IconCpu, IconDeviceSdCard, IconHistory } from "@tabler/icons-react"; import ms from "ms"; import { formatBytes } from "@/utils/format"; import { trpc } from "@/utils/trpc"; +import ProcessGitMetric from "./ProcessGitMetric"; import ProcessItemMetric from "./ProcessMetric"; interface ProcessActionProps { - processId: string; + process: IProcess; refetchInterval: number; showMetric: boolean; } -export default function ProcessMetricRow({ processId, refetchInterval, showMetric }: ProcessActionProps) { +export default function ProcessMetricRow({ process, refetchInterval, showMetric }: ProcessActionProps) { const getStat = trpc.process.getStat.useQuery( - { processId }, + { processId: process._id }, { refetchInterval, }, @@ -23,6 +25,7 @@ export default function ProcessMetricRow({ processId, refetchInterval, showMetri return ( + {process?.versioning?.url && } =20.0.0" @@ -1419,9 +1419,9 @@ } }, "node_modules/@typescript-eslint/scope-manager/node_modules/@typescript-eslint/types": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.16.1.tgz", - "integrity": "sha512-AQn9XqCzUXd4bAVEsAXM/Izk11Wx2u4H3BAfQVhSfzfDOm/wAON9nP7J5rpkCxts7E5TELmN845xTUCQrD1xIQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", "engines": { "node": "^18.18.0 || >=20.0.0" }, @@ -1431,12 +1431,12 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.16.1.tgz", - "integrity": "sha512-rbu/H2MWXN4SkjIIyWcmYBjlp55VT+1G3duFOIukTNFxr9PI35pLc2ydwAfejCEitCv4uztA07q0QWanOHC7dA==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", + "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", "dependencies": { - "@typescript-eslint/typescript-estree": "7.16.1", - "@typescript-eslint/utils": "7.16.1", + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/utils": "7.18.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1457,9 +1457,9 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.16.1.tgz", - "integrity": "sha512-AQn9XqCzUXd4bAVEsAXM/Izk11Wx2u4H3BAfQVhSfzfDOm/wAON9nP7J5rpkCxts7E5TELmN845xTUCQrD1xIQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", "engines": { "node": "^18.18.0 || >=20.0.0" }, @@ -1469,12 +1469,12 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.16.1.tgz", - "integrity": "sha512-0vFPk8tMjj6apaAZ1HlwM8w7jbghC8jc1aRNJG5vN8Ym5miyhTQGMqU++kuBFDNKe9NcPeZ6x0zfSzV8xC1UlQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", + "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", "dependencies": { - "@typescript-eslint/types": "7.16.1", - "@typescript-eslint/visitor-keys": "7.16.1", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1565,14 +1565,14 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.16.1.tgz", - "integrity": "sha512-WrFM8nzCowV0he0RlkotGDujx78xudsxnGMBHI88l5J8wEhED6yBwaSLP99ygfrzAjsQvcYQ94quDwI0d7E1fA==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", + "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.16.1", - "@typescript-eslint/types": "7.16.1", - "@typescript-eslint/typescript-estree": "7.16.1" + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -1586,9 +1586,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.16.1.tgz", - "integrity": "sha512-AQn9XqCzUXd4bAVEsAXM/Izk11Wx2u4H3BAfQVhSfzfDOm/wAON9nP7J5rpkCxts7E5TELmN845xTUCQrD1xIQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", "engines": { "node": "^18.18.0 || >=20.0.0" }, @@ -1598,12 +1598,12 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.16.1.tgz", - "integrity": "sha512-0vFPk8tMjj6apaAZ1HlwM8w7jbghC8jc1aRNJG5vN8Ym5miyhTQGMqU++kuBFDNKe9NcPeZ6x0zfSzV8xC1UlQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", + "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", "dependencies": { - "@typescript-eslint/types": "7.16.1", - "@typescript-eslint/visitor-keys": "7.16.1", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1639,11 +1639,11 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.16.1.tgz", - "integrity": "sha512-Qlzzx4sE4u3FsHTPQAAQFJFNOuqtuY0LFrZHwQ8IHK705XxBiWOFkfKRWu6niB7hwfgnwIpO4jTC75ozW1PHWg==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", + "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", "dependencies": { - "@typescript-eslint/types": "7.16.1", + "@typescript-eslint/types": "7.18.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -1655,9 +1655,9 @@ } }, "node_modules/@typescript-eslint/visitor-keys/node_modules/@typescript-eslint/types": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.16.1.tgz", - "integrity": "sha512-AQn9XqCzUXd4bAVEsAXM/Izk11Wx2u4H3BAfQVhSfzfDOm/wAON9nP7J5rpkCxts7E5TELmN845xTUCQrD1xIQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", "engines": { "node": "^18.18.0 || >=20.0.0" }, @@ -3143,9 +3143,9 @@ "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==" }, "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "dependencies": { "ms": "2.1.2" }, @@ -4057,17 +4057,17 @@ } }, "node_modules/eslint-plugin-unicorn": { - "version": "54.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-54.0.0.tgz", - "integrity": "sha512-XxYLRiYtAWiAjPv6z4JREby1TAE2byBC7wlh0V4vWDCpccOSU1KovWV//jqPXF6bq3WKxqX9rdjoRQ1EhdmNdQ==", + "version": "55.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-55.0.0.tgz", + "integrity": "sha512-n3AKiVpY2/uDcGrS3+QsYDkjPfaOrNrsfQxU9nt5nitd9KuvVXrfAvgCO9DYPSfap+Gqjw9EOrXIsBp5tlHZjA==", "dependencies": { "@babel/helper-validator-identifier": "^7.24.5", "@eslint-community/eslint-utils": "^4.4.0", - "@eslint/eslintrc": "^3.0.2", "ci-info": "^4.0.0", "clean-regexp": "^1.0.0", "core-js-compat": "^3.37.0", "esquery": "^1.5.0", + "globals": "^15.7.0", "indent-string": "^4.0.0", "is-builtin-module": "^3.2.1", "jsesc": "^3.0.2", @@ -4088,37 +4088,6 @@ "eslint": ">=8.56.0" } }, - "node_modules/eslint-plugin-unicorn/node_modules/@eslint/eslintrc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^10.0.1", - "globals": "^14.0.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-plugin-unicorn/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/eslint-plugin-unicorn/node_modules/ci-info": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz", @@ -4133,37 +4102,10 @@ "node": ">=8" } }, - "node_modules/eslint-plugin-unicorn/node_modules/eslint-visitor-keys": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-plugin-unicorn/node_modules/espree": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz", - "integrity": "sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==", - "dependencies": { - "acorn": "^8.12.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.0.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/eslint-plugin-unicorn/node_modules/globals": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "version": "15.8.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.8.0.tgz", + "integrity": "sha512-VZAJ4cewHTExBWDHR6yptdIBlx9YSSZuwojj9Nt5mBRXQzrKakDsVKQ1J63sklLvzAJm0X5+RpO4i3Y2hcOnFw==", "engines": { "node": ">=18" }, @@ -4171,17 +4113,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-plugin-unicorn/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", @@ -7553,9 +7484,9 @@ } }, "node_modules/postcss": { - "version": "8.4.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz", - "integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==", + "version": "8.4.40", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.40.tgz", + "integrity": "sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==", "dev": true, "funding": [ { @@ -8841,15 +8772,15 @@ "dev": true }, "node_modules/start-server-and-test": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-2.0.4.tgz", - "integrity": "sha512-CKNeBTcP0hVqIlNismHMudb9q3lLdAjcVPO13/7gfI66fcJpeIb/o4NzQd1JK/CD+lfWVqr10ZH9Y14+OwlJuw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-2.0.5.tgz", + "integrity": "sha512-2CV4pz69NJVJKQmJeSr+O+SPtOreu0yxvhPmSXclzmAKkPREuMabyMh+Txpzemjx0RDzXOcG2XkhiUuxjztSQw==", "dev": true, "dependencies": { "arg": "^5.0.2", "bluebird": "3.7.2", "check-more-types": "2.24.0", - "debug": "4.3.5", + "debug": "4.3.6", "execa": "5.1.1", "lazy-ass": "1.6.0", "ps-tree": "1.2.0", @@ -9611,9 +9542,9 @@ } }, "node_modules/typescript": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", - "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -10158,29 +10089,29 @@ }, "packages/eslint-config": { "name": "@pm2.web/eslint-config", - "version": "1.4.2", + "version": "1.5.0", "dependencies": { - "@typescript-eslint/eslint-plugin": "^7.16.1", - "@typescript-eslint/parser": "^7.16.1", + "@typescript-eslint/eslint-plugin": "^7.18.0", + "@typescript-eslint/parser": "^7.18.0", "eslint-config-prettier": "^9.1.0", "eslint-config-turbo": "2.0.9", "eslint-plugin-import": "^2.29.1", "eslint-plugin-only-warn": "^1.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-simple-import-sort": "^12.1.1", - "eslint-plugin-unicorn": "^54.0.0", - "typescript": "^5.5.3" + "eslint-plugin-unicorn": "^55.0.0", + "typescript": "^5.5.4" } }, "packages/eslint-config/node_modules/@typescript-eslint/parser": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.16.1.tgz", - "integrity": "sha512-u+1Qx86jfGQ5i4JjK33/FnawZRpsLxRnKzGE6EABZ40KxVT/vWsiZFEBBHjFOljmmV3MBYOHEKi0Jm9hbAOClA==", - "dependencies": { - "@typescript-eslint/scope-manager": "7.16.1", - "@typescript-eslint/types": "7.16.1", - "@typescript-eslint/typescript-estree": "7.16.1", - "@typescript-eslint/visitor-keys": "7.16.1", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", + "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", + "dependencies": { + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4" }, "engines": { @@ -10200,9 +10131,9 @@ } }, "packages/eslint-config/node_modules/@typescript-eslint/types": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.16.1.tgz", - "integrity": "sha512-AQn9XqCzUXd4bAVEsAXM/Izk11Wx2u4H3BAfQVhSfzfDOm/wAON9nP7J5rpkCxts7E5TELmN845xTUCQrD1xIQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", "engines": { "node": "^18.18.0 || >=20.0.0" }, @@ -10212,12 +10143,12 @@ } }, "packages/eslint-config/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.16.1.tgz", - "integrity": "sha512-0vFPk8tMjj6apaAZ1HlwM8w7jbghC8jc1aRNJG5vN8Ym5miyhTQGMqU++kuBFDNKe9NcPeZ6x0zfSzV8xC1UlQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", + "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", "dependencies": { - "@typescript-eslint/types": "7.16.1", - "@typescript-eslint/visitor-keys": "7.16.1", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -10254,7 +10185,7 @@ }, "packages/mongoose-models": { "name": "@pm2.web/mongoose-models", - "version": "1.4.2", + "version": "1.5.0", "license": "MIT", "dependencies": { "@pm2.web/eslint-config": "*", @@ -10265,20 +10196,20 @@ }, "devDependencies": { "@types/bcrypt": "^5.0.2", - "typescript": "^5.5.3" + "typescript": "^5.5.4" } }, "packages/typescript-config": { "name": "@pm2.web/typescript-config", - "version": "1.4.2", + "version": "1.5.0", "license": "MIT" }, "packages/typings": { "name": "@pm2.web/typings", - "version": "1.4.2", + "version": "1.5.0", "license": "MIT", "devDependencies": { - "typescript": "^5.5.3" + "typescript": "^5.5.4" } } } diff --git a/package.json b/package.json index 2629533..edc2124 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pm2.web", - "version": "1.4.2", + "version": "1.5.0", "private": true, "repository": { "type": "git", diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 74e3b4b..2872a65 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -1,20 +1,20 @@ { "name": "@pm2.web/eslint-config", - "version": "1.4.2", + "version": "1.5.0", "private": true, "files": [ "base.js" ], "dependencies": { - "@typescript-eslint/eslint-plugin": "^7.16.1", - "@typescript-eslint/parser": "^7.16.1", + "@typescript-eslint/eslint-plugin": "^7.18.0", + "@typescript-eslint/parser": "^7.18.0", "eslint-config-prettier": "^9.1.0", "eslint-config-turbo": "2.0.9", "eslint-plugin-import": "^2.29.1", "eslint-plugin-only-warn": "^1.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-simple-import-sort": "^12.1.1", - "eslint-plugin-unicorn": "^54.0.0", - "typescript": "^5.5.3" + "eslint-plugin-unicorn": "^55.0.0", + "typescript": "^5.5.4" } } diff --git a/packages/mongoose-models/models/process.ts b/packages/mongoose-models/models/process.ts index 87268fe..1015d0d 100644 --- a/packages/mongoose-models/models/process.ts +++ b/packages/mongoose-models/models/process.ts @@ -62,6 +62,28 @@ const processSchema = new mongoose.Schema( "one-launch-status", ], }, + versioning: { + url: { + type: String, + required: false, + }, + revision: { + type: String, + required: false, + }, + comment: { + type: String, + required: false, + }, + branch: { + type: String, + required: false, + }, + unstaged: { + type: Boolean, + default: true, + }, + }, restartCount: Number, toggleCount: Number, deleteCount: Number, diff --git a/packages/mongoose-models/package.json b/packages/mongoose-models/package.json index 1c2f13c..1e99898 100644 --- a/packages/mongoose-models/package.json +++ b/packages/mongoose-models/package.json @@ -1,6 +1,6 @@ { "name": "@pm2.web/mongoose-models", - "version": "1.4.2", + "version": "1.5.0", "description": "Shared Mongoose Models for pm2.web", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -21,7 +21,7 @@ }, "devDependencies": { "@types/bcrypt": "^5.0.2", - "typescript": "^5.5.3" + "typescript": "^5.5.4" }, "author": "oxdev03", "license": "MIT" diff --git a/packages/typescript-config/package.json b/packages/typescript-config/package.json index 0d2c313..8a06077 100644 --- a/packages/typescript-config/package.json +++ b/packages/typescript-config/package.json @@ -1,6 +1,6 @@ { "name": "@pm2.web/typescript-config", - "version": "1.4.2", + "version": "1.5.0", "private": true, "license": "MIT" } diff --git a/packages/typings/package.json b/packages/typings/package.json index 4d9aa50..e312351 100644 --- a/packages/typings/package.json +++ b/packages/typings/package.json @@ -1,6 +1,6 @@ { "name": "@pm2.web/typings", - "version": "1.4.2", + "version": "1.5.0", "description": "Shared Typings for pm2.web", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -9,7 +9,7 @@ "watch": "tsc -w" }, "devDependencies": { - "typescript": "^5.5.3" + "typescript": "^5.5.4" }, "author": "oxdev03", "license": "MIT" diff --git a/packages/typings/src/process.ts b/packages/typings/src/process.ts index 32b6745..bf11d39 100644 --- a/packages/typings/src/process.ts +++ b/packages/typings/src/process.ts @@ -36,6 +36,13 @@ interface IProcess { type: IProcessType; logs?: ILog[]; status: IProcessStatus; + versioning: { + url?: string; + revision?: string; + comment?: string; + branch?: string; + unstaged?: boolean; + }; toggleCount: number; restartCount: number; deleteCount: number;