Update dependencies and project configuration

Add Nix flake support, update .gitignore to ignore SSL certs, upgrade
@types/bun and TypeScript versions, and update frontend SDK URLs in
index.html and sw.js to new API endpoints
This commit is contained in:
2026-01-18 20:39:50 +01:00
parent e5b01203b8
commit 1a0f91625a
8 changed files with 82 additions and 25 deletions

3
.gitignore vendored
View File

@@ -32,3 +32,6 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
# Finder (MacOS) folder config # Finder (MacOS) folder config
.DS_Store .DS_Store
# SSL certificates
ssl/

View File

@@ -1,26 +1,23 @@
{ {
"lockfileVersion": 1, "lockfileVersion": 1,
"configVersion": 0,
"workspaces": { "workspaces": {
"": { "": {
"name": "test-web-push", "name": "test-web-push",
"devDependencies": { "devDependencies": {
"@types/bun": "latest", "@types/bun": "1.3.6",
}, },
"peerDependencies": { "peerDependencies": {
"typescript": "^5", "typescript": "^5.9.3",
}, },
}, },
}, },
"packages": { "packages": {
"@types/bun": ["@types/bun@1.2.21", "", { "dependencies": { "bun-types": "1.2.21" } }, "sha512-NiDnvEqmbfQ6dmZ3EeUO577s4P5bf4HCTXtI6trMc6f6RzirY5IrF3aIookuSpyslFzrnvv2lmEWv5HyC1X79A=="], "@types/bun": ["@types/bun@1.3.6", "", { "dependencies": { "bun-types": "1.3.6" } }, "sha512-uWCv6FO/8LcpREhenN1d1b6fcspAB+cefwD7uti8C8VffIv0Um08TKMn98FynpTiU38+y2dUO55T11NgDt8VAA=="],
"@types/node": ["@types/node@24.3.0", "", { "dependencies": { "undici-types": "~7.10.0" } }, "sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow=="], "@types/node": ["@types/node@24.3.0", "", { "dependencies": { "undici-types": "~7.10.0" } }, "sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow=="],
"@types/react": ["@types/react@19.1.12", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-cMoR+FoAf/Jyq6+Df2/Z41jISvGZZ2eTlnsaJRptmZ76Caldwy1odD4xTr/gNV9VLj0AWgg/nmkevIyUfIIq5w=="], "bun-types": ["bun-types@1.3.6", "", { "dependencies": { "@types/node": "*" } }, "sha512-OlFwHcnNV99r//9v5IIOgQ9Uk37gZqrNMCcqEaExdkVq3Avwqok1bJFmvGMCkCE0FqzdY8VMOZpfpR3lwI+CsQ=="],
"bun-types": ["bun-types@1.2.21", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-sa2Tj77Ijc/NTLS0/Odjq/qngmEPZfbfnOERi0KRUYhT9R8M4VBioWVmMWE5GrYbKMc+5lVybXygLdibHaqVqw=="],
"csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="],
"typescript": ["typescript@5.9.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A=="], "typescript": ["typescript@5.9.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A=="],

27
flake.lock generated Normal file
View File

@@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1767116409,
"narHash": "sha256-5vKw92l1GyTnjoLzEagJy5V5mDFck72LiQWZSOnSicw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "cad22e7d996aea55ecab064e84834289143e44a0",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

21
flake.nix Normal file
View File

@@ -0,0 +1,21 @@
{
description = "DropUI Django";
inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
outputs = { self, nixpkgs, ... }: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in {
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
bun
biome
google-chrome
];
};
};
}

View File

@@ -1,17 +1,19 @@
<!DOCTYPE html> <!doctype html>
<html lang="pl"> <html lang="pl">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Test Web Push</title> <title>Test Web Push</title>
<link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="style.css" />
<script
src="http://localhost:8000/api/v1/webpush/public/integrations/7b35f08f-49d6-48f9-a830-f3654008dce5/sdk.js"
async
></script>
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<h1>🚀 Test Web Push</h1> <h1>🚀 Test Web Push</h1>
<p>Ultra prosta strona do testowania Web Push notyfikacji</p> <p>Ultra prosta strona do testowania Web Push notyfikacji</p>
</div> </div>
<script src="http://localhost:8000/campaigns/webpush/integration/4c9eb80b-a074-45b2-8f15-397c1f7696da.js"></script>
</body> </body>
</html> </html>

View File

@@ -8,7 +8,7 @@
"start": "bun run dev" "start": "bun run dev"
}, },
"devDependencies": { "devDependencies": {
"@types/bun": "latest" "@types/bun": "1.3.6"
}, },
"peerDependencies": { "peerDependencies": {
"typescript": "^5.9.2" "typescript": "^5.9.2"

View File

@@ -29,6 +29,12 @@ function getMimeType(filename: string): string {
const server = Bun.serve({ const server = Bun.serve({
port: 5173, port: 5173,
// tls: {
// key: Bun.file("./ssl/key.pem"),
// cert: Bun.file("./ssl/cert.pem"),
// },
async fetch(req) { async fetch(req) {
const url = new URL(req.url); const url = new URL(req.url);
const pathname = url.pathname; const pathname = url.pathname;

3
sw.js
View File

@@ -1,5 +1,6 @@
// sw.js // sw.js
console.log("Service Worker loaded"); console.log("Service Worker loaded");
importScripts( importScripts(
"http://localhost:8000/campaigns/webpush/sw-core/4c9eb80b-a074-45b2-8f15-397c1f7696da.js", "http://localhost:8000/api/v1/webpush/public/integrations/7b35f08f-49d6-48f9-a830-f3654008dce5/sw.js",
); );