@networkpro/web 1.24.4 → 1.24.5

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.
@@ -0,0 +1,37 @@
1
+ # .github/workflows/branch-guard.yml
2
+ #
3
+ # Copyright © 2025 Network Pro Strategies (Network Pro™)
4
+ # SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
+ # This file is part of Network Pro
6
+ #
7
+ # Warns if commits are pushed directly to master/main instead of via PR.
8
+ # Does NOT block the commit — it just posts a workflow summary and log warning.
9
+
10
+ name: Branch Guard
11
+
12
+ on:
13
+ push:
14
+ branches:
15
+ - master
16
+ - main
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ warn-direct-commit:
23
+ runs-on: ubuntu-24.04
24
+ steps:
25
+ - name: Check commit source
26
+ run: |
27
+ # Only trigger warning if commit wasn't from a merge or bot
28
+ if [[ "${{ github.event.head_commit.message }}" != *"Merge pull request"* ]] && \
29
+ [[ "${{ github.actor }}" != "dependabot[bot]" ]]; then
30
+ echo "::warning ::⚠️ Direct commit to ${GITHUB_REF##*/} by $GITHUB_ACTOR."
31
+ echo "### ⚠️ Direct Commit Detected" >> $GITHUB_STEP_SUMMARY
32
+ echo "A commit was pushed directly to \`${GITHUB_REF##*/}\` by **${GITHUB_ACTOR}**." >> $GITHUB_STEP_SUMMARY
33
+ echo "" >> $GITHUB_STEP_SUMMARY
34
+ echo "💡 It's recommended to use pull requests for traceability and CI validation." >> $GITHUB_STEP_SUMMARY
35
+ else
36
+ echo "✅ Merge or bot commit detected — no action needed."
37
+ fi
package/CHANGELOG.md CHANGED
@@ -22,6 +22,40 @@ This project attempts to follow [Keep a Changelog](https://keepachangelog.com/en
22
22
 
23
23
  ---
24
24
 
25
+ ## [1.24.5]
26
+
27
+ ### Added
28
+
29
+ - Introduced **Branch Guard workflow** (`.github/workflows/branch-guard.yml`) to automatically enforce branch protection policies.
30
+ - Ensures consistent branch naming conventions.
31
+ - Blocks direct pushes to protected branches (e.g., `master`, `main`, and `release/*`).
32
+ - Provides early validation for pull requests and feature branches to maintain repository integrity.
33
+ - Introduced comprehensive pre-push checks for code consistency and style compliance.
34
+ - Added optional `simple-git-hooks` configuration to automate local linting before commits or pushes.
35
+ - Implemented `lint:all` script using `npm-run-all` for efficient, parallel execution of linters.
36
+ - Ensures **ESLint**, **Stylelint**, **Markdownlint**, and **Prettier** all run before code is committed, improving codebase hygiene and preventing formatting drift.
37
+ - Designed for **developer-side speed and reliability**, running linters in parallel while deferring `format` (Prettier) until after lint checks complete for safety.
38
+ - Added **hybrid linting configuration**:
39
+ - Parallel execution for static lint tasks (`eslint`, `stylelint`, `markdownlint`).
40
+ - Sequential Prettier formatting step for deterministic, race-free execution.
41
+
42
+ ### Changed
43
+
44
+ - Reorganized local linting commands for clarity and consistency, consolidating redundant sequential scripts into the `lint:all` aggregator.
45
+ - Improved developer experience with faster pre-push validations and clearer script naming conventions.
46
+ - Bumped project version to `v1.24.5`.
47
+
48
+ ### Developer Experience
49
+
50
+ - Enhanced local development workflow by introducing **fast, parallel linting** and **optional pre-commit hooks**, reducing turnaround time for style and quality checks.
51
+ - Simplified npm scripts for readability and maintainability by adopting `npm-run-all` as the central task runner.
52
+
53
+ ### Notes
54
+
55
+ - 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
+
57
+ ---
58
+
25
59
  ## [1.24.4]
26
60
 
27
61
  ### Documentation
@@ -250,7 +284,7 @@ This project attempts to follow [Keep a Changelog](https://keepachangelog.com/en
250
284
  - Updated the text of `ServicesContent.svelte`.
251
285
  - Increased default Playwright test timeouts for navigation-sensitive suites (Desktop and Mobile) to improve stability under CI latency conditions.
252
286
  - Implemented `Promise.all()` pattern for combined click and navigation waits, reducing flakiness in route transition tests.
253
- - Updated the `'about' link` navigation tests in both Desktop and Mobile scenarios to include:
287
+ - Updated the `about` link navigation tests in both Desktop and Mobile scenarios to include:
254
288
  - Explicit `page.waitForLoadState('domcontentloaded')` calls before assertions.
255
289
  - Extended per-suite timeouts (`90s`) using `test.setTimeout(90000)` for reliability on slower environments.
256
290
  - Added fallback `waitForURL('\*\*/about', { timeout: 60000 })` to ensure deterministic routing checks.
@@ -1481,7 +1515,8 @@ This project attempts to follow [Keep a Changelog](https://keepachangelog.com/en
1481
1515
 
1482
1516
  <!-- Link references -->
1483
1517
 
1484
- [Unreleased]: https://github.com/netwk-pro/netwk-pro.github.io/compare/v1.24.4...HEAD
1518
+ [Unreleased]: https://github.com/netwk-pro/netwk-pro.github.io/compare/v1.24.5...HEAD
1519
+ [1.24.5]: https://github.com/netwk-pro/netwk-pro.github.io/releases/tag/v1.24.5
1485
1520
  [1.24.4]: https://github.com/netwk-pro/netwk-pro.github.io/releases/tag/v1.24.4
1486
1521
  [1.24.3]: https://github.com/netwk-pro/netwk-pro.github.io/releases/tag/v1.24.3
1487
1522
  [1.24.2]: https://github.com/netwk-pro/netwk-pro.github.io/releases/tag/v1.24.2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@networkpro/web",
3
3
  "private": false,
4
- "version": "1.24.4",
4
+ "version": "1.24.5",
5
5
  "description": "Locking Down Networks, Unlocking Confidence™ | Security, Networking, Privacy — Network Pro Strategies",
6
6
  "keywords": [
7
7
  "advisory",
@@ -41,16 +41,16 @@
41
41
  "build:vercel": "vercel build",
42
42
  "preview": "vite preview",
43
43
  "css:bundle": "node scripts/bundleCss.js",
44
- "prepare": "svelte-kit sync || echo ''",
44
+ "prepare": "svelte-kit sync && npx simple-git-hooks || echo ''",
45
45
  "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
46
46
  "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
47
47
  "type-check": "svelte-check --tsconfig ./jsconfig.json",
48
48
  "lint:types": "npm run type-check",
49
49
  "check:env": "node scripts/checkEnv.js",
50
50
  "check:node": "node scripts/checkNode.js",
51
- "checkout": "npm run check:node && npm run test:all && npm run lint:all && npm run check",
51
+ "checkout": "npm-run-all check:node test:all lint:all check",
52
52
  "verify": "npm run checkout",
53
- "delete": "rm -rf build .svelte-kit node_modules package-lock.json",
53
+ "delete": "rm -rf .svelte-kit node_modules package-lock.json",
54
54
  "clean": "npm run delete && npm cache clean --force && npm install",
55
55
  "upgrade": "ncu -u --format group --color",
56
56
  "check:updates": "ncu --format group --color",
@@ -69,14 +69,18 @@
69
69
  "lint:jsdoc": "eslint . --ext .js,.cjs,.mjs,.svelte --max-warnings=0",
70
70
  "lint:css": "stylelint \"**/*.{css,svelte}\" --ignore-path .stylelintignore",
71
71
  "lint:md": "npx markdownlint-cli2 \"**/*.{md,markdown}\" \"#node_modules/**\" \"#playwright-report/**\" \"#test-results/**\"",
72
- "lint:all": "npm run lint && npm run lint:md && npm run lint:css && npm run format",
73
72
  "format": "prettier --check .",
74
73
  "format:fix": "prettier --write .",
74
+ "lint:all": "npm-run-all --parallel --print-label lint lint:md lint:css --sequential format",
75
75
  "lhci": "lhci",
76
76
  "lhci:run": "lhci autorun --config=.lighthouserc.cjs",
77
77
  "audit:coverage": "vitest run tests/internal/auditCoverage.test.js",
78
78
  "postinstall": "npm run check:node"
79
79
  },
80
+ "simple-git-hooks": {
81
+ "pre-commit": "if [ \"$CI\" = \"true\" ]; then exit 0; else npm run lint:all; fi",
82
+ "pre-push": "if [ \"$CI\" = \"true\" ]; then exit 0; else npm run checkout; fi"
83
+ },
80
84
  "dependencies": {
81
85
  "dompurify": "^3.3.0",
82
86
  "posthog-js": "^1.284.0",
@@ -105,10 +109,12 @@
105
109
  "lightningcss": "^1.30.2",
106
110
  "markdownlint": "^0.39.0",
107
111
  "markdownlint-cli2": "^0.18.1",
112
+ "npm-run-all": "^4.1.5",
108
113
  "playwright": "^1.56.1",
109
114
  "postcss": "^8.5.6",
110
115
  "prettier": "3.6.2",
111
116
  "prettier-plugin-svelte": "^3.4.0",
117
+ "simple-git-hooks": "^2.13.1",
112
118
  "stylelint": "^16.25.0",
113
119
  "stylelint-config-html": "^1.1.0",
114
120
  "stylelint-config-recommended": "^17.0.0",