git-history-ui 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,12 +44,15 @@
44
44
  "@angular/cli": "^20.2.0",
45
45
  "@schematics/angular": "^20.2.0",
46
46
  "@types/jasmine": "~5.1.0",
47
+ "autoprefixer": "^10.4.21",
47
48
  "jasmine-core": "~5.9.0",
48
49
  "karma": "~6.4.0",
49
50
  "karma-chrome-launcher": "~3.2.0",
50
51
  "karma-coverage": "~2.2.0",
51
52
  "karma-jasmine": "~5.1.0",
52
53
  "karma-jasmine-html-reporter": "~2.1.0",
54
+ "postcss": "^8.5.6",
55
+ "tailwindcss": "^3.4.17",
53
56
  "typescript": "~5.9.2"
54
57
  }
55
58
  }
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ },
6
+ }
@@ -1,3 +1,7 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
1
5
  /* You can add global styles to this file, and also import other style files */
2
6
 
3
7
  /* Modern CSS Reset */
@@ -0,0 +1,11 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+ module.exports = {
3
+ content: [
4
+ "./src/**/*.{html,ts}",
5
+ ],
6
+ theme: {
7
+ extend: {},
8
+ },
9
+ plugins: [],
10
+ }
11
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-history-ui",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Beautiful git history visualization in your browser",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
@@ -10,10 +10,12 @@
10
10
  "build": "npm run build:backend && npm run build:frontend",
11
11
  "build:backend": "tsc -p tsconfig.json",
12
12
  "build:frontend": "cd frontend && ng build --configuration production",
13
+ "build:production": "NODE_ENV=production npm run build",
13
14
  "dev": "concurrently \"npm run dev:backend\" \"npm run dev:frontend\"",
14
15
  "dev:backend": "ts-node-dev --respawn --transpile-only src/backend/dev-server.ts",
15
16
  "dev:frontend": "cd frontend && ng serve --port 4200",
16
17
  "start": "node dist/backend/server.js",
18
+ "start:production": "NODE_ENV=production node dist/backend/server.js",
17
19
  "test": "jest",
18
20
  "test:coverage": "jest --coverage",
19
21
  "test:watch": "jest --watch",
package/public/index.html CHANGED
@@ -4,7 +4,6 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Git History UI</title>
7
- <script src="https://cdn.tailwindcss.com"></script>
8
7
  <script src="https://d3js.org/d3.v7.min.js"></script>
9
8
  <script src="https://cdn.socket.io/4.7.4/socket.io.min.js"></script>
10
9
  <style>
@@ -20,17 +20,25 @@ export async function startServer(
20
20
  ) {
21
21
  const app = express();
22
22
  const server = createServer(app);
23
+
24
+ // CORS configuration
25
+ const corsOptions = {
26
+ origin: process.env.NODE_ENV === 'production'
27
+ ? ['http://localhost:4200', 'http://localhost:3000', 'http://127.0.0.1:4200', 'http://127.0.0.1:3000']
28
+ : true,
29
+ credentials: true,
30
+ methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
31
+ allowedHeaders: ['Content-Type', 'Authorization', 'X-Requested-With']
32
+ };
33
+
23
34
  const io = new Server(server, {
24
- cors: {
25
- origin: "*",
26
- methods: ["GET", "POST"]
27
- }
35
+ cors: corsOptions
28
36
  });
29
37
 
30
38
  const gitService = new GitService();
31
39
 
32
40
  // Middleware
33
- app.use(cors());
41
+ app.use(cors(corsOptions));
34
42
  app.use(express.json());
35
43
 
36
44
  // Serve Angular build files