@networkpro/web 1.18.5 → 1.20.0

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.
Files changed (68) hide show
  1. package/.github/workflows/build-and-publish.yml +5 -4
  2. package/.github/workflows/lighthouse.yml +1 -1
  3. package/.github/workflows/meta-check.yml +1 -1
  4. package/.github/workflows/playwright.yml +1 -1
  5. package/.github/workflows/publish-test.yml +5 -4
  6. package/.github/workflows/templates/publish.template.yml +5 -4
  7. package/CHANGELOG.md +116 -1
  8. package/cspell.json +3 -0
  9. package/package.json +16 -16
  10. package/scripts/auditScripts.js +1 -1
  11. package/scripts/bundleCss.js +1 -1
  12. package/scripts/checkEnv.js +1 -1
  13. package/scripts/checkNode.js +1 -1
  14. package/scripts/checkVersions.js +1 -1
  15. package/scripts/generateTest.js +1 -1
  16. package/scripts/openReport.js +1 -1
  17. package/src/app.html +3 -6
  18. package/src/hooks.server.js +10 -7
  19. package/src/lib/README.md +160 -0
  20. package/src/lib/components/FullWidthSection.svelte +0 -9
  21. package/src/lib/components/ServiceSummaryTable.svelte +113 -0
  22. package/src/lib/components/foss/index.js +21 -0
  23. package/src/lib/components/index.js +31 -0
  24. package/src/lib/components/layout/HeaderDefault.svelte +3 -1
  25. package/src/lib/components/layout/HeaderHome.svelte +6 -5
  26. package/src/lib/components/layout/index.js +21 -0
  27. package/src/lib/images.js +1 -1
  28. package/src/lib/index.js +15 -5
  29. package/src/lib/meta.js +14 -9
  30. package/src/lib/pages/AboutContent.svelte +51 -15
  31. package/src/lib/pages/HomeContent.svelte +11 -1
  32. package/src/lib/pages/LicenseContent.svelte +3 -3
  33. package/src/lib/pages/PrivacyContent.svelte +31 -1
  34. package/src/lib/pages/ServicesContent.svelte +545 -0
  35. package/src/lib/pages/index.js +28 -0
  36. package/src/lib/stores/posthog.js +2 -1
  37. package/src/lib/styles/css/default.css +95 -0
  38. package/src/lib/styles/global.min.css +1 -1
  39. package/src/lib/styles/index.js +0 -1
  40. package/src/lib/types/README.md +50 -0
  41. package/src/lib/types/appConstants.js +1 -1
  42. package/src/lib/types/fossTypes.js +1 -1
  43. package/src/lib/utils/getUTMParams.js +1 -1
  44. package/src/lib/utils/purify.js +1 -1
  45. package/src/lib/utils/redirect.js +1 -1
  46. package/src/lib/utils/utm.js +2 -2
  47. package/src/routes/+layout.svelte +3 -11
  48. package/src/routes/+page.svelte +9 -7
  49. package/src/routes/consultation/+page.svelte +1 -1
  50. package/src/routes/links/+page.svelte +3 -2
  51. package/src/routes/services/+page.server.js +18 -0
  52. package/src/routes/services/+page.svelte +65 -0
  53. package/src/routes/status/+page.server.js +1 -1
  54. package/src/service-worker.js +2 -2
  55. package/static/bin/contact.vcf +1 -2
  56. package/static/disableSw.js +1 -1
  57. package/static/sitemap.xml +17 -5
  58. package/tests/e2e/app.spec.js +1 -1
  59. package/tests/e2e/mobile.spec.js +1 -1
  60. package/tests/e2e/shared/helpers.js +1 -1
  61. package/tests/meta/meta.test.js +1 -1
  62. package/tests/unit/client/lib/PWAInstallButton.test.js +80 -0
  63. package/tests/unit/client/lib/utils/redirect.test.js +1 -1
  64. package/tests/unit/server/internal/auditCoverage.test.js +1 -1
  65. package/tests/unit/server/lib/utils/purify.test.js +1 -1
  66. package/tests/unit/server/meta.test.js +1 -1
  67. package/vercel.json +12 -0
  68. package/vitest-setup-client.js +9 -0
@@ -0,0 +1,80 @@
1
+ /* ==========================================================================
2
+ tests/unit/client/lib/PWAInstallButton.test.js
3
+
4
+ Copyright © 2025 Network Pro Strategies (Network Pro™)
5
+ SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
6
+ This file is part of Network Pro.
7
+ ========================================================================== */
8
+
9
+ /**
10
+ * @file redirect.test.js
11
+ * @description Unit test for PWA install component
12
+ * @module tests/unit/lib
13
+ * @author Scott Lopez
14
+ * @updated 2025-10-05
15
+ */
16
+
17
+ import PWAInstallButton from '$lib/components/PWAInstallButton.svelte';
18
+ import { fireEvent, render, waitFor } from '@testing-library/svelte';
19
+ import { describe, expect, it, vi } from 'vitest';
20
+
21
+ /* --------------------------------------------------------------------------
22
+ Fake BeforeInstallPromptEvent Mock
23
+ --------------------------------------------------------------------------
24
+ */
25
+ class FakeBeforeInstallPromptEvent {
26
+ constructor() {
27
+ this.prompt = vi.fn();
28
+ this.userChoice = Promise.resolve({
29
+ outcome: 'accepted',
30
+ platform: 'test',
31
+ });
32
+ }
33
+ }
34
+
35
+ /* --------------------------------------------------------------------------
36
+ Tests
37
+ -------------------------------------------------------------------------- */
38
+ describe('PWAInstallButton', () => {
39
+ it('shows button when pwa-install-available event is fired', async () => {
40
+ const { getByRole, queryByRole } = render(PWAInstallButton);
41
+
42
+ // Initially, the install button should not be in the DOM
43
+ expect(queryByRole('button')).toBeNull();
44
+
45
+ // Dispatch the custom event that makes the button appear
46
+ const fakeEvent = new FakeBeforeInstallPromptEvent();
47
+ window.dispatchEvent(
48
+ new CustomEvent('pwa-install-available', { detail: fakeEvent }),
49
+ );
50
+
51
+ // Verify that the button now appears
52
+ const button = await waitFor(() =>
53
+ getByRole('button', { name: /install app/i }),
54
+ );
55
+ expect(button).toBeInTheDocument();
56
+ });
57
+
58
+ it('calls prompt() when install button is clicked', async () => {
59
+ const { getByRole } = render(PWAInstallButton);
60
+
61
+ // Fire the event that makes the button visible
62
+ const fakeEvent = new FakeBeforeInstallPromptEvent();
63
+ window.dispatchEvent(
64
+ new CustomEvent('pwa-install-available', { detail: fakeEvent }),
65
+ );
66
+
67
+ // Wait until the button appears
68
+ const button = await waitFor(() =>
69
+ getByRole('button', { name: /install app/i }),
70
+ );
71
+
72
+ // Simulate a user clicking the install button
73
+ await fireEvent.click(button);
74
+
75
+ // Verify that prompt() was called — the core behavior we care about
76
+ expect(fakeEvent.prompt).toHaveBeenCalled();
77
+
78
+ // (Removed: button disappearance check, since it depends on async animation timing)
79
+ });
80
+ });
@@ -10,7 +10,7 @@ This file is part of Network Pro.
10
10
  * @file redirect.test.js
11
11
  * @description Unit test for src/lib/utils/redirect.js
12
12
  * @module tests/unit/lib/util/
13
- * @author SunDevil311
13
+ * @author Scott Lopez
14
14
  * @updated 2025-07-01
15
15
  */
16
16
 
@@ -11,7 +11,7 @@ This file is part of Network Pro.
11
11
  * @description Scans all .js files in src/ and scripts/ for matching unit
12
12
  * tests
13
13
  * @module tests/unit/server/internal
14
- * @author SunDevil311
14
+ * @author Scott Lopez
15
15
  * @updated 2025-09-17
16
16
  */
17
17
 
@@ -10,7 +10,7 @@ This file is part of Network Pro.
10
10
  * @file purify.test.js
11
11
  * @description Unit test for src/lib/utils/purify.js
12
12
  * @module tests/unit/lib/util
13
- * @author SunDevil311
13
+ * @author Scott Lopez
14
14
  * @updated 2025-06-01
15
15
  */
16
16
 
@@ -10,7 +10,7 @@ This file is part of Network Pro.
10
10
  * @file meta.test.js
11
11
  * @description Checks for correct metadata population
12
12
  * @module tests/unit/server
13
- * @author SunDevil311
13
+ * @author Scott Lopez
14
14
  * @updated 2025-09-17
15
15
  */
16
16
 
package/vercel.json CHANGED
@@ -1,4 +1,6 @@
1
1
  {
2
+ "$schema": "https://openapi.vercel.sh/vercel.json",
3
+ "version": 2,
2
4
  "redirects": [
3
5
  {
4
6
  "source": "/privacy-policy",
@@ -30,5 +32,15 @@
30
32
  "destination": "/foss-spotlight/:path*",
31
33
  "permanent": true
32
34
  }
35
+ ],
36
+ "rewrites": [
37
+ {
38
+ "source": "/relay-MSR0/static/(.*)",
39
+ "destination": "https://us-assets.i.posthog.com/static/$1"
40
+ },
41
+ {
42
+ "source": "/relay-MSR0/(.*)",
43
+ "destination": "https://us.i.posthog.com/$1"
44
+ }
33
45
  ]
34
46
  }
@@ -25,6 +25,15 @@ Object.defineProperty(window, 'matchMedia', {
25
25
  })),
26
26
  });
27
27
 
28
+ // Mock Web Animations API (jsdom doesn't implement element.animate)
29
+ if (!Element.prototype.animate) {
30
+ Element.prototype.animate = () => ({
31
+ onfinish: null,
32
+ cancel: () => {},
33
+ finished: Promise.resolve(),
34
+ });
35
+ }
36
+
28
37
  // Automatically clean up the DOM after each test
29
38
  afterEach(() => {
30
39
  cleanup();