You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+70-1Lines changed: 70 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,71 @@ This project attempts to follow [Keep a Changelog](https://keepachangelog.com/en
22
22
23
23
---
24
24
25
+
## [1.25.0]
26
+
27
+
### Added
28
+
29
+
- Introduced unified environment detection utility (`src/lib/utils/env.js`) with full **JSDoc typing**.
30
+
- Normalizes `process.env` and `import.meta.env` usage across SSR (Node) and client contexts.
31
+
- Safely handles browser environments where `process` is undefined.
32
+
- Provides standardized flags for:
33
+
-`isDev`, `isProd`, `isAudit`, `isCI`, and `isTest`
34
+
- Enables consistent environment checks across analytics, CSP, and runtime logic.
35
+
36
+
- Added hybrid **environment + host-based analytics guard** in `src/lib/stores/posthog.js`.
37
+
- Automatically disables PostHog tracking in `audit` mode or when hostname matches `*.audit.netwk.pro`.
38
+
- Prevents analytics initialization during development and test contexts.
39
+
- Uses the shared `detectEnvironment()` utility for centralized logic.
40
+
- Improves runtime logging for environment-specific behavior.
41
+
42
+
### Changed
43
+
44
+
- Updated `hooks.server.js` to include a dedicated **audit environment block** for Content Security Policy (CSP).
45
+
- Hardened audit CSP by removing all analytics-related sources (`posthog.com`, `posthog-assets.com`).
46
+
- Redirects CSP violation reporting to the mock endpoint (`/api/mock-csp`) in audit mode.
47
+
- Preserves full HSTS and other production security headers for audit deployments.
48
+
- Added clear separation between `test`, `audit`, and `prod` security policies.
49
+
- Improved console debugging for environment detection (`NODE_ENV`, `ENV_MODE`).
50
+
51
+
- Refactored **environment detection logic** for improved reliability across client and server contexts.
52
+
- Added unified environment resolver at `src/lib/utils/env.js` to standardize detection for `dev`, `prod`, `audit`, `ci`, and `test` modes.
53
+
- Ensures consistent handling of both `process.env.*` (Node/SSR) and `import.meta.env.*` (Vite/client) variables.
54
+
- Prevents mismatched behavior between browser-side analytics (`posthog.js`) and server-side policies (`hooks.server.js`).
55
+
- Automatically falls back to `'unknown'` if no explicit mode is set, avoiding build-time exceptions.
56
+
57
+
- Refactored **Branch Guard** workflow (`.github/workflows/branch-guard.yml`) for improved accuracy and reduced noise.
58
+
- Adjusted detection logic to **ignore merge commits**, Dependabot updates, and automated actions.
59
+
- Ensures workflow warnings are shown **only for true direct commits** to protected branches (`master`, `main`).
60
+
- Simplified step output and summary formatting for clearer reporting in the Actions log and job summary.
61
+
- Maintains lightweight permissions (`contents: read`) and executes entirely without repository writes.
62
+
- Improves reliability of branch protection monitoring without affecting CI or merge operations.
63
+
64
+
### Fixed
65
+
66
+
- Resolved client-side crash in browser environments caused by `process.env` being undefined.
67
+
- Implemented defensive checks in `env.js` for `process` availability.
68
+
- Eliminated reference errors during client-side initialization of analytics.
69
+
70
+
### Developer Experience
71
+
72
+
- Simplified future configuration by consolidating environment checks into a single typed utility.
73
+
- Improved maintainability and Vercel compatibility by ensuring `.env.audit` and `PUBLIC_ENV_MODE` variables propagate correctly to both client and server environments.
74
+
75
+
### Developer Notes
76
+
77
+
- When deploying audit builds, ensure Vercel environment variables include:
78
+
79
+
```bash
80
+
ENV_MODE=audit
81
+
PUBLIC_ENV_MODE=audit
82
+
```
83
+
84
+
This enables analytics filtering and CSP hardening for the audit environment.
85
+
86
+
- Audit deployments retain full HTTPS and security headers but omit telemetry and external CSP reporting.
87
+
88
+
---
89
+
25
90
## [1.24.5]
26
91
27
92
### Added
@@ -54,6 +119,9 @@ This project attempts to follow [Keep a Changelog](https://keepachangelog.com/en
54
119
55
120
- For instructions on installing and configuring the new dependencies, please see the **[Editor Configuration](https://github.com/netwk-pro/netwk-pro.github.io/wiki/Editor-Configuration#automation)** section of the [Wiki](https://github.com/netwk-pro/netwk-pro.github.io/wiki).
56
121
122
+
> **Note:** Version `1.24.4` was merged but not tagged or released.
123
+
> Subsequent updates are reflected in `v1.24.5` and later.
124
+
57
125
---
58
126
59
127
## [1.24.4]
@@ -1515,7 +1583,8 @@ This project attempts to follow [Keep a Changelog](https://keepachangelog.com/en
0 commit comments