Merge remote-tracking branch 'origin/main' into dependabot/npm_and_yarn/tanstack-4e0cd3caa5
# Conflicts: # apps/web/package.json # packages/ui/package.json # pnpm-lock.yaml
This commit is contained in:
@@ -86,7 +86,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Container Image (multi-arch)
|
- name: Build Container Image (multi-arch)
|
||||||
id: build-container
|
id: build-container
|
||||||
uses: redhat-actions/buildah-build@v2
|
uses: redhat-actions/buildah-build@v3
|
||||||
with:
|
with:
|
||||||
containerfiles: |
|
containerfiles: |
|
||||||
./apps/web/infra/Containerfile
|
./apps/web/infra/Containerfile
|
||||||
@@ -103,7 +103,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Push To GHCR
|
- name: Push To GHCR
|
||||||
id: push-to-registry
|
id: push-to-registry
|
||||||
uses: redhat-actions/push-to-registry@v2
|
uses: redhat-actions/push-to-registry@v3
|
||||||
with:
|
with:
|
||||||
image: ${{ steps.build-container.outputs.image }}
|
image: ${{ steps.build-container.outputs.image }}
|
||||||
# Push the same tags used at build time:
|
# Push the same tags used at build time:
|
||||||
|
|||||||
+26
-26
@@ -41,25 +41,25 @@
|
|||||||
"@meshtastic/transport-web-serial": "workspace:*",
|
"@meshtastic/transport-web-serial": "workspace:*",
|
||||||
"@noble/curves": "^2.2.0",
|
"@noble/curves": "^2.2.0",
|
||||||
"@preact/signals-core": "^1.14.4",
|
"@preact/signals-core": "^1.14.4",
|
||||||
"@radix-ui/react-accordion": "^1.2.16",
|
"@radix-ui/react-accordion": "^1.2.17",
|
||||||
"@radix-ui/react-alert-dialog": "^1.1.19",
|
"@radix-ui/react-alert-dialog": "^1.1.20",
|
||||||
"@radix-ui/react-checkbox": "^1.3.7",
|
"@radix-ui/react-checkbox": "^1.3.8",
|
||||||
"@radix-ui/react-dialog": "^1.1.19",
|
"@radix-ui/react-dialog": "^1.1.20",
|
||||||
"@radix-ui/react-dropdown-menu": "^2.1.20",
|
"@radix-ui/react-dropdown-menu": "^2.1.21",
|
||||||
"@radix-ui/react-label": "^2.1.11",
|
"@radix-ui/react-label": "^2.1.12",
|
||||||
"@radix-ui/react-menubar": "^1.1.20",
|
"@radix-ui/react-menubar": "^1.1.21",
|
||||||
"@radix-ui/react-popover": "^1.1.19",
|
"@radix-ui/react-popover": "^1.1.20",
|
||||||
"@radix-ui/react-scroll-area": "^1.2.14",
|
"@radix-ui/react-scroll-area": "^1.2.15",
|
||||||
"@radix-ui/react-select": "^2.3.3",
|
"@radix-ui/react-select": "^2.3.4",
|
||||||
"@radix-ui/react-separator": "^1.1.11",
|
"@radix-ui/react-separator": "^1.1.12",
|
||||||
"@radix-ui/react-slider": "^1.4.3",
|
"@radix-ui/react-slider": "^1.4.4",
|
||||||
"@radix-ui/react-switch": "^1.3.3",
|
"@radix-ui/react-switch": "^1.3.4",
|
||||||
"@radix-ui/react-tabs": "^1.1.17",
|
"@radix-ui/react-tabs": "^1.1.18",
|
||||||
"@radix-ui/react-toast": "^1.2.19",
|
"@radix-ui/react-toast": "^1.2.20",
|
||||||
"@radix-ui/react-toggle-group": "^1.1.15",
|
"@radix-ui/react-toggle-group": "^1.1.16",
|
||||||
"@radix-ui/react-tooltip": "^1.2.12",
|
"@radix-ui/react-tooltip": "^1.2.13",
|
||||||
"@radix-ui/react-visually-hidden": "^1.2.7",
|
"@radix-ui/react-visually-hidden": "^1.2.8",
|
||||||
"@tailwindcss/vite": "^4.3.1",
|
"@tailwindcss/vite": "^4.3.3",
|
||||||
"@tanstack/react-router": "^1.170.18",
|
"@tanstack/react-router": "^1.170.18",
|
||||||
"@tanstack/react-router-devtools": "^1.167.0",
|
"@tanstack/react-router-devtools": "^1.167.0",
|
||||||
"@tanstack/router-cli": "^1.167.21",
|
"@tanstack/router-cli": "^1.167.21",
|
||||||
@@ -79,17 +79,17 @@
|
|||||||
"idb-keyval": "^6.3.0",
|
"idb-keyval": "^6.3.0",
|
||||||
"immer": "^11.1.15",
|
"immer": "^11.1.15",
|
||||||
"js-cookie": "^3.0.8",
|
"js-cookie": "^3.0.8",
|
||||||
"lucide-react": "^1.24.0",
|
"lucide-react": "^1.25.0",
|
||||||
"maplibre-gl": "5.24.0",
|
"maplibre-gl": "5.24.0",
|
||||||
"react": "^19.2.7",
|
"react": "^19.2.7",
|
||||||
"react-dom": "^19.2.7",
|
"react-dom": "^19.2.7",
|
||||||
"react-error-boundary": "^6.1.2",
|
"react-error-boundary": "^6.1.2",
|
||||||
"react-hook-form": "^7.81.0",
|
"react-hook-form": "^7.82.0",
|
||||||
"react-i18next": "^17.0.10",
|
"react-i18next": "^17.0.10",
|
||||||
"react-map-gl": "8.1.1",
|
"react-map-gl": "8.1.1",
|
||||||
"react-qrcode-logo": "^4.1.0",
|
"react-qrcode-logo": "^4.1.0",
|
||||||
"rfc4648": "^1.5.4",
|
"rfc4648": "^1.5.4",
|
||||||
"vite": "^8.1.4",
|
"vite": "^8.1.5",
|
||||||
"vite-plugin-html": "^3.2.2",
|
"vite-plugin-html": "^3.2.2",
|
||||||
"vite-plugin-pwa": "^1.3.0",
|
"vite-plugin-pwa": "^1.3.0",
|
||||||
"zod": "^4.1.12",
|
"zod": "^4.1.12",
|
||||||
@@ -105,19 +105,19 @@
|
|||||||
"@types/js-cookie": "^3.0.6",
|
"@types/js-cookie": "^3.0.6",
|
||||||
"@types/react": "^19.2.17",
|
"@types/react": "^19.2.17",
|
||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
"@types/serviceworker": "^0.0.199",
|
"@types/serviceworker": "^0.0.200",
|
||||||
"@types/w3c-web-serial": "^1.0.8",
|
"@types/w3c-web-serial": "^1.0.8",
|
||||||
"@vitejs/plugin-basic-ssl": "^2.3.0",
|
"@vitejs/plugin-basic-ssl": "^2.3.0",
|
||||||
"@vitejs/plugin-react": "^6.0.3",
|
"@vitejs/plugin-react": "^6.0.3",
|
||||||
"autoprefixer": "^10.5.2",
|
"autoprefixer": "^10.5.4",
|
||||||
"gzipper": "^8.3.0",
|
"gzipper": "^8.3.0",
|
||||||
"happy-dom": "^20.10.6",
|
"happy-dom": "^20.11.0",
|
||||||
"oxfmt": "^0.59.0",
|
"oxfmt": "^0.59.0",
|
||||||
"oxlint": "^1.74.0",
|
"oxlint": "^1.74.0",
|
||||||
"tailwind-merge": "^3.6.0",
|
"tailwind-merge": "^3.6.0",
|
||||||
"tailwindcss": "^4.3.3",
|
"tailwindcss": "^4.3.3",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
"tar": "^7.5.20",
|
"tar": "^7.5.21",
|
||||||
"testing-library": "^0.0.2",
|
"testing-library": "^0.0.2",
|
||||||
"typescript": "^7.0.2",
|
"typescript": "^7.0.2",
|
||||||
"vitest": "^4.1.10"
|
"vitest": "^4.1.10"
|
||||||
|
|||||||
@@ -1,44 +1,25 @@
|
|||||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { randId } from "./randId.ts";
|
import { randId } from "./randId.ts";
|
||||||
|
|
||||||
describe("randId", () => {
|
describe("randId", () => {
|
||||||
beforeEach(() => {
|
|
||||||
vi.restoreAllMocks();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("returns a number", () => {
|
|
||||||
const result = randId();
|
|
||||||
expect(typeof result).toBe("number");
|
|
||||||
});
|
|
||||||
|
|
||||||
it("returns an integer", () => {
|
it("returns an integer", () => {
|
||||||
const result = randId();
|
const result = randId();
|
||||||
|
expect(typeof result).toBe("number");
|
||||||
expect(Number.isInteger(result)).toBe(true);
|
expect(Number.isInteger(result)).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("uses Math.random to generate the number", () => {
|
it("returns a value within the uint32 range", () => {
|
||||||
const mockRandom = vi.spyOn(Math, "random").mockReturnValue(0.5);
|
|
||||||
const result = randId();
|
|
||||||
|
|
||||||
expect(mockRandom).toHaveBeenCalled();
|
|
||||||
expect(result).toBe(Math.floor(0.5 * 1e9));
|
|
||||||
});
|
|
||||||
|
|
||||||
it("returns a value between 0 and 1e9 (exclusive)", () => {
|
|
||||||
const result = randId();
|
const result = randId();
|
||||||
expect(result).toBeGreaterThanOrEqual(0);
|
expect(result).toBeGreaterThanOrEqual(0);
|
||||||
expect(result).toBeLessThan(1e9);
|
expect(result).toBeLessThanOrEqual(0xffffffff);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns different values on subsequent calls", () => {
|
it("returns unique values across many calls", () => {
|
||||||
vi.spyOn(Math, "random").mockRestore();
|
const results = new Set<number>();
|
||||||
|
for (let i = 0; i < 1000; i++) {
|
||||||
const results = new Set();
|
|
||||||
|
|
||||||
for (let i = 0; i < 100; i++) {
|
|
||||||
results.add(randId());
|
results.add(randId());
|
||||||
}
|
}
|
||||||
|
// With 32 bits of entropy over 1000 samples, collisions are vanishingly rare.
|
||||||
expect(results.size).toBeGreaterThan(95);
|
expect(results.size).toBe(1000);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
export const randId = () => {
|
export const randId = (): number => {
|
||||||
return Math.floor(Math.random() * 1e9);
|
const buf = new Uint32Array(1);
|
||||||
|
crypto.getRandomValues(buf);
|
||||||
|
return buf[0]!;
|
||||||
};
|
};
|
||||||
|
|||||||
+3
-3
@@ -33,7 +33,7 @@
|
|||||||
"@bufbuild/protobuf": "^2.12.1",
|
"@bufbuild/protobuf": "^2.12.1",
|
||||||
"@meshtastic/protobufs": "workspace:*",
|
"@meshtastic/protobufs": "workspace:*",
|
||||||
"ste-simple-events": "^3.0.11",
|
"ste-simple-events": "^3.0.11",
|
||||||
"tslog": "^4.11.0"
|
"tslog": "^5.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@meshtastic/core": "jsr:^2.6.6",
|
"@meshtastic/core": "jsr:^2.6.6",
|
||||||
@@ -42,10 +42,10 @@
|
|||||||
"@types/node": "^26.1.0",
|
"@types/node": "^26.1.0",
|
||||||
"@typescript/typescript6": "^6.0.2",
|
"@typescript/typescript6": "^6.0.2",
|
||||||
"husky": "^9.1.0",
|
"husky": "^9.1.0",
|
||||||
"lint-staged": "^17.0.8",
|
"lint-staged": "^17.1.0",
|
||||||
"oxfmt": "^0.59.0",
|
"oxfmt": "^0.59.0",
|
||||||
"oxlint": "^1.74.0",
|
"oxlint": "^1.74.0",
|
||||||
"tsdown": "^0.22.11",
|
"tsdown": "^0.22.13",
|
||||||
"typescript": "^7.0.2",
|
"typescript": "^7.0.2",
|
||||||
"vitest": "^4.1.10"
|
"vitest": "^4.1.10"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
"better-result": "^2.10.0",
|
"better-result": "^2.10.0",
|
||||||
"crc": "npm:crc@^4.3.2",
|
"crc": "npm:crc@^4.3.2",
|
||||||
"ste-simple-events": "^3.0.11",
|
"ste-simple-events": "^3.0.11",
|
||||||
"tslog": "^4.11.0"
|
"tslog": "^5.1.0"
|
||||||
},
|
},
|
||||||
"tsdown": {
|
"tsdown": {
|
||||||
"clean": true,
|
"clean": true,
|
||||||
|
|||||||
@@ -38,21 +38,21 @@
|
|||||||
"test": "vitest"
|
"test": "vitest"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@radix-ui/react-collapsible": "^1.1.16",
|
"@radix-ui/react-collapsible": "^1.1.17",
|
||||||
"@radix-ui/react-dialog": "^1.1.19",
|
"@radix-ui/react-dialog": "^1.1.20",
|
||||||
"@radix-ui/react-dropdown-menu": "^2.1.20",
|
"@radix-ui/react-dropdown-menu": "^2.1.21",
|
||||||
"@radix-ui/react-separator": "^1.1.11",
|
"@radix-ui/react-separator": "^1.1.12",
|
||||||
"@radix-ui/react-slot": "^1.3.0",
|
"@radix-ui/react-slot": "^1.3.0",
|
||||||
"@radix-ui/react-tooltip": "^1.2.12",
|
"@radix-ui/react-tooltip": "^1.2.13",
|
||||||
"@tanstack/react-router": "^1.170.18",
|
"@tanstack/react-router": "^1.170.18",
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"lucide-react": "^1.24.0",
|
"lucide-react": "^1.25.0",
|
||||||
"tailwind-merge": "^3.6.0"
|
"tailwind-merge": "^3.6.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tailwindcss/postcss": "^4.3.3",
|
"@tailwindcss/postcss": "^4.3.3",
|
||||||
"@tailwindcss/vite": "^4.3.2",
|
"@tailwindcss/vite": "^4.3.3",
|
||||||
"@types/react": "^19.2.17",
|
"@types/react": "^19.2.17",
|
||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
"@vitejs/plugin-react": "^6.0.3",
|
"@vitejs/plugin-react": "^6.0.3",
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
"tailwindcss": "^4.3.3",
|
"tailwindcss": "^4.3.3",
|
||||||
"tw-animate-css": "^1.4.0",
|
"tw-animate-css": "^1.4.0",
|
||||||
"typescript": "^7.0.2",
|
"typescript": "^7.0.2",
|
||||||
"vite": "^8.1.4",
|
"vite": "^8.1.5",
|
||||||
"vite-plugin-dts": "^5.0.3",
|
"vite-plugin-dts": "^5.0.3",
|
||||||
"vite-plugin-static-copy": "^4.1.1",
|
"vite-plugin-static-copy": "^4.1.1",
|
||||||
"vitest": "^4.1.10"
|
"vitest": "^4.1.10"
|
||||||
|
|||||||
Generated
+559
-932
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user